[libvirt] [PATCH qemu v2 0/6] -no-user-config option, move CPU models to /usr/share

Changes v1 -> v2: - Move qemu_read_default_config_files() prototype to qemu-config.h - Make defconfig and userconfig variable bool - Coding style change Patches 1 to 4 just move some code around, patch 5 just adds the new option without adding any new config file. Patch 6 finally creates a /usr/share/qemu /cpus-x86_64.conf file, with the CPU models we currently have on Qemu. Reference to previous discussion: - http://marc.info/?l=qemu-devel&m=133278877315665 Eduardo Habkost (6): move code to read default config files to a separate function (v2) eliminate arch_config_name variable move list of default config files to an array vl.c: change 'defconfig' variable to bool implement -no-user-config command-line option (v2) move CPU definitions to /usr/share/qemu/cpus-x86_64.conf (v2) Makefile | 12 +++- arch_init.c | 32 ++++++++- arch_init.h | 2 - qemu-config.h | 4 + qemu-options.hx | 16 ++++- sysconfigs/target/cpus-x86_64.conf | 128 ++++++++++++++++++++++++++++++++++ sysconfigs/target/target-x86_64.conf | 128 ---------------------------------- vl.c | 18 ++--- 8 files changed, 193 insertions(+), 147 deletions(-) create mode 100644 sysconfigs/target/cpus-x86_64.conf -- 1.7.3.2

Function added to arch_init.c because it depends on arch-specific settings. Changes v1 -> v2: - Move qemu_read_default_config_file() prototype to qemu-config.h Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> --- arch_init.c | 18 ++++++++++++++++++ qemu-config.h | 4 ++++ vl.c | 10 ++-------- 3 files changed, 24 insertions(+), 8 deletions(-) diff --git a/arch_init.c b/arch_init.c index 9a35aee..4008115 100644 --- a/arch_init.c +++ b/arch_init.c @@ -112,6 +112,24 @@ const uint32_t arch_type = QEMU_ARCH; #define ALL_EQ(v1, v2) ((v1) == (v2)) #endif + +int qemu_read_default_config_files(void) +{ + int ret; + + ret = qemu_read_config_file(CONFIG_QEMU_CONFDIR "/qemu.conf"); + if (ret < 0 && ret != -ENOENT) { + return ret; + } + + ret = qemu_read_config_file(arch_config_name); + if (ret < 0 && ret != -ENOENT) { + return ret; + } + + return 0; +} + static int is_dup_page(uint8_t *page) { VECTYPE *p = (VECTYPE *)page; diff --git a/qemu-config.h b/qemu-config.h index 20d707f..ff934a1 100644 --- a/qemu-config.h +++ b/qemu-config.h @@ -16,4 +16,8 @@ int qemu_config_parse(FILE *fp, QemuOptsList **lists, const char *fname); int qemu_read_config_file(const char *filename); +/* Read default Qemu config files + */ +int qemu_read_default_config_files(void); + #endif /* QEMU_CONFIG_H */ diff --git a/vl.c b/vl.c index ae91a8a..1e5e593 100644 --- a/vl.c +++ b/vl.c @@ -2354,14 +2354,8 @@ int main(int argc, char **argv, char **envp) if (defconfig) { int ret; - - ret = qemu_read_config_file(CONFIG_QEMU_CONFDIR "/qemu.conf"); - if (ret < 0 && ret != -ENOENT) { - exit(1); - } - - ret = qemu_read_config_file(arch_config_name); - if (ret < 0 && ret != -ENOENT) { + ret = qemu_read_default_config_files(); + if (ret < 0) { exit(1); } } -- 1.7.3.2

Not needed anymore, as the code that uses the variable is already inside arch_init.c. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> --- arch_init.c | 3 +-- arch_init.h | 2 -- 2 files changed, 1 insertions(+), 4 deletions(-) diff --git a/arch_init.c b/arch_init.c index 4008115..152cbbb 100644 --- a/arch_init.c +++ b/arch_init.c @@ -54,7 +54,6 @@ int graphic_height = 600; int graphic_depth = 15; #endif -const char arch_config_name[] = CONFIG_QEMU_CONFDIR "/target-" TARGET_ARCH ".conf"; #if defined(TARGET_ALPHA) #define QEMU_ARCH QEMU_ARCH_ALPHA @@ -122,7 +121,7 @@ int qemu_read_default_config_files(void) return ret; } - ret = qemu_read_config_file(arch_config_name); + ret = qemu_read_config_file(CONFIG_QEMU_CONFDIR "/target-" TARGET_ARCH ".conf"); if (ret < 0 && ret != -ENOENT) { return ret; } diff --git a/arch_init.h b/arch_init.h index 828256c..c7cb94a 100644 --- a/arch_init.h +++ b/arch_init.h @@ -1,8 +1,6 @@ #ifndef QEMU_ARCH_INIT_H #define QEMU_ARCH_INIT_H -extern const char arch_config_name[]; - enum { QEMU_ARCH_ALL = -1, QEMU_ARCH_ALPHA = 1, -- 1.7.3.2

More files will be added to the list, with additional attributes, later. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> --- arch_init.c | 25 ++++++++++++++++--------- 1 files changed, 16 insertions(+), 9 deletions(-) diff --git a/arch_init.c b/arch_init.c index 152cbbb..62332e9 100644 --- a/arch_init.c +++ b/arch_init.c @@ -112,20 +112,27 @@ const uint32_t arch_type = QEMU_ARCH; #endif +static struct defconfig_file { + const char *filename; +} default_config_files[] = { + { CONFIG_QEMU_CONFDIR "/qemu.conf" }, + { CONFIG_QEMU_CONFDIR "/target-" TARGET_ARCH ".conf" }, + { NULL }, /* end of list */ +}; + + int qemu_read_default_config_files(void) { int ret; - - ret = qemu_read_config_file(CONFIG_QEMU_CONFDIR "/qemu.conf"); - if (ret < 0 && ret != -ENOENT) { - return ret; - } + struct defconfig_file *f; - ret = qemu_read_config_file(CONFIG_QEMU_CONFDIR "/target-" TARGET_ARCH ".conf"); - if (ret < 0 && ret != -ENOENT) { - return ret; + for (f = default_config_files; f->filename; f++) { + ret = qemu_read_config_file(f->filename); + if (ret < 0 && ret != -ENOENT) { + return ret; + } } - + return 0; } -- 1.7.3.2

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> --- vl.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vl.c b/vl.c index 1e5e593..a4f4676 100644 --- a/vl.c +++ b/vl.c @@ -2279,7 +2279,7 @@ int main(int argc, char **argv, char **envp) #ifdef CONFIG_VNC int show_vnc_port = 0; #endif - int defconfig = 1; + int defconfig = true; const char *log_mask = NULL; const char *log_file = NULL; GMemVTable mem_trace = { @@ -2346,7 +2346,7 @@ int main(int argc, char **argv, char **envp) popt = lookup_opt(argc, argv, &optarg, &optind); switch (popt->index) { case QEMU_OPTION_nodefconfig: - defconfig=0; + defconfig = false; break; } } -- 1.7.3.2

On Tue, Apr 24, 2012 at 20:32, Eduardo Habkost <ehabkost@redhat.com> wrote:
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> --- vl.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/vl.c b/vl.c index 1e5e593..a4f4676 100644 --- a/vl.c +++ b/vl.c @@ -2279,7 +2279,7 @@ int main(int argc, char **argv, char **envp) #ifdef CONFIG_VNC int show_vnc_port = 0; #endif - int defconfig = 1; + int defconfig = true;
The type is still 'int', is that intentional?
const char *log_mask = NULL; const char *log_file = NULL; GMemVTable mem_trace = { @@ -2346,7 +2346,7 @@ int main(int argc, char **argv, char **envp) popt = lookup_opt(argc, argv, &optarg, &optind); switch (popt->index) { case QEMU_OPTION_nodefconfig: - defconfig=0; + defconfig = false; break; } } -- 1.7.3.2

On Sat, Apr 28, 2012 at 07:53:41AM +0000, Blue Swirl wrote:
On Tue, Apr 24, 2012 at 20:32, Eduardo Habkost <ehabkost@redhat.com> wrote:
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> --- vl.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/vl.c b/vl.c index 1e5e593..a4f4676 100644 --- a/vl.c +++ b/vl.c @@ -2279,7 +2279,7 @@ int main(int argc, char **argv, char **envp) #ifdef CONFIG_VNC int show_vnc_port = 0; #endif - int defconfig = 1; + int defconfig = true;
The type is still 'int', is that intentional?
Oops! It was not, sorry. I will respin the series. -- Eduardo

Changes v1 -> v2: - Change 'userconfig' field/variables to bool instead of int - Coding style change Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> --- arch_init.c | 11 ++++++++--- qemu-config.h | 2 +- qemu-options.hx | 16 +++++++++++++--- vl.c | 6 +++++- 4 files changed, 27 insertions(+), 8 deletions(-) diff --git a/arch_init.c b/arch_init.c index 62332e9..996baba 100644 --- a/arch_init.c +++ b/arch_init.c @@ -114,19 +114,24 @@ const uint32_t arch_type = QEMU_ARCH; static struct defconfig_file { const char *filename; + /* Indicates it is an user config file (disabled by -no-user-config) */ + bool userconfig; } default_config_files[] = { - { CONFIG_QEMU_CONFDIR "/qemu.conf" }, - { CONFIG_QEMU_CONFDIR "/target-" TARGET_ARCH ".conf" }, + { CONFIG_QEMU_CONFDIR "/qemu.conf", true }, + { CONFIG_QEMU_CONFDIR "/target-" TARGET_ARCH ".conf", true }, { NULL }, /* end of list */ }; -int qemu_read_default_config_files(void) +int qemu_read_default_config_files(bool userconfig) { int ret; struct defconfig_file *f; for (f = default_config_files; f->filename; f++) { + if (!userconfig && f->userconfig) { + continue; + } ret = qemu_read_config_file(f->filename); if (ret < 0 && ret != -ENOENT) { return ret; diff --git a/qemu-config.h b/qemu-config.h index ff934a1..6d7365d 100644 --- a/qemu-config.h +++ b/qemu-config.h @@ -18,6 +18,6 @@ int qemu_read_config_file(const char *filename); /* Read default Qemu config files */ -int qemu_read_default_config_files(void); +int qemu_read_default_config_files(bool userconfig); #endif /* QEMU_CONFIG_H */ diff --git a/qemu-options.hx b/qemu-options.hx index a169792..7d0b054 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -2685,9 +2685,19 @@ DEF("nodefconfig", 0, QEMU_OPTION_nodefconfig, STEXI @item -nodefconfig @findex -nodefconfig -Normally QEMU loads a configuration file from @var{sysconfdir}/qemu.conf and -@var{sysconfdir}/target-@var{ARCH}.conf on startup. The @code{-nodefconfig} -option will prevent QEMU from loading these configuration files at startup. +Normally QEMU loads configuration files from @var{sysconfdir} and @var{datadir} at startup. +The @code{-nodefconfig} option will prevent QEMU from loading any of those config files. +ETEXI +DEF("no-user-config", 0, QEMU_OPTION_nouserconfig, + "-no-user-config\n" + " do not load user-provided config files at startup\n", + QEMU_ARCH_ALL) +STEXI +@item -no-user-config +@findex -no-user-config +The @code{-no-user-config} option makes QEMU not load any of the user-provided +config files on @var{sysconfdir}, but won't make it skip the QEMU-provided config +files from @var{datadir}. ETEXI DEF("trace", HAS_ARG, QEMU_OPTION_trace, "-trace [events=<file>][,file=<file>]\n" diff --git a/vl.c b/vl.c index a4f4676..967b7e8 100644 --- a/vl.c +++ b/vl.c @@ -2280,6 +2280,7 @@ int main(int argc, char **argv, char **envp) int show_vnc_port = 0; #endif int defconfig = true; + bool userconfig = true; const char *log_mask = NULL; const char *log_file = NULL; GMemVTable mem_trace = { @@ -2348,13 +2349,16 @@ int main(int argc, char **argv, char **envp) case QEMU_OPTION_nodefconfig: defconfig = false; break; + case QEMU_OPTION_nouserconfig: + userconfig = false; + break; } } } if (defconfig) { int ret; - ret = qemu_read_default_config_files(); + ret = qemu_read_default_config_files(userconfig); if (ret < 0) { exit(1); } -- 1.7.3.2

Changes v1 -> v2: - userconfig variable is now bool, not int Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> --- Makefile | 12 +++- arch_init.c | 1 + sysconfigs/target/cpus-x86_64.conf | 128 ++++++++++++++++++++++++++++++++++ sysconfigs/target/target-x86_64.conf | 128 ---------------------------------- 4 files changed, 138 insertions(+), 131 deletions(-) create mode 100644 sysconfigs/target/cpus-x86_64.conf diff --git a/Makefile b/Makefile index 4f43793..6c20f27 100644 --- a/Makefile +++ b/Makefile @@ -280,11 +280,18 @@ ifdef CONFIG_VIRTFS $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1" $(INSTALL_DATA) fsdev/virtfs-proxy-helper.1 "$(DESTDIR)$(mandir)/man1" endif -install-sysconfig: + +install-datadir: + $(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)" + +install-confdir: $(INSTALL_DIR) "$(DESTDIR)$(qemu_confdir)" + +install-sysconfig: install-datadir install-confdir $(INSTALL_DATA) $(SRC_PATH)/sysconfigs/target/target-x86_64.conf "$(DESTDIR)$(qemu_confdir)" + $(INSTALL_DATA) $(SRC_PATH)/sysconfigs/target/cpus-x86_64.conf "$(DESTDIR)$(qemu_datadir)" -install: all $(if $(BUILD_DOCS),install-doc) install-sysconfig +install: all $(if $(BUILD_DOCS),install-doc) install-sysconfig install-datadir $(INSTALL_DIR) "$(DESTDIR)$(bindir)" ifneq ($(TOOLS),) $(INSTALL_PROG) $(STRIP_OPT) $(TOOLS) "$(DESTDIR)$(bindir)" @@ -294,7 +301,6 @@ ifneq ($(HELPERS-y),) $(INSTALL_PROG) $(STRIP_OPT) $(HELPERS-y) "$(DESTDIR)$(libexecdir)" endif ifneq ($(BLOBS),) - $(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)" set -e; for x in $(BLOBS); do \ $(INSTALL_DATA) $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(qemu_datadir)"; \ done diff --git a/arch_init.c b/arch_init.c index 996baba..988adca 100644 --- a/arch_init.c +++ b/arch_init.c @@ -117,6 +117,7 @@ static struct defconfig_file { /* Indicates it is an user config file (disabled by -no-user-config) */ bool userconfig; } default_config_files[] = { + { CONFIG_QEMU_DATADIR "/cpus-" TARGET_ARCH ".conf", false }, { CONFIG_QEMU_CONFDIR "/qemu.conf", true }, { CONFIG_QEMU_CONFDIR "/target-" TARGET_ARCH ".conf", true }, { NULL }, /* end of list */ diff --git a/sysconfigs/target/cpus-x86_64.conf b/sysconfigs/target/cpus-x86_64.conf new file mode 100644 index 0000000..cee0ea9 --- /dev/null +++ b/sysconfigs/target/cpus-x86_64.conf @@ -0,0 +1,128 @@ +# x86 CPU MODELS + +[cpudef] + name = "Conroe" + level = "2" + vendor = "GenuineIntel" + family = "6" + model = "2" + stepping = "3" + feature_edx = "sse2 sse fxsr mmx clflush pse36 pat cmov mca pge mtrr sep apic cx8 mce pae msr tsc pse de fpu" + feature_ecx = "ssse3 sse3" + extfeature_edx = "i64 xd syscall" + extfeature_ecx = "lahf_lm" + xlevel = "0x8000000A" + model_id = "Intel Celeron_4x0 (Conroe/Merom Class Core 2)" + +[cpudef] + name = "Penryn" + level = "2" + vendor = "GenuineIntel" + family = "6" + model = "2" + stepping = "3" + feature_edx = "sse2 sse fxsr mmx clflush pse36 pat cmov mca pge mtrr sep apic cx8 mce pae msr tsc pse de fpu" + feature_ecx = "sse4.1 cx16 ssse3 sse3" + extfeature_edx = "i64 xd syscall" + extfeature_ecx = "lahf_lm" + xlevel = "0x8000000A" + model_id = "Intel Core 2 Duo P9xxx (Penryn Class Core 2)" + +[cpudef] + name = "Nehalem" + level = "2" + vendor = "GenuineIntel" + family = "6" + model = "2" + stepping = "3" + feature_edx = "sse2 sse fxsr mmx clflush pse36 pat cmov mca pge mtrr sep apic cx8 mce pae msr tsc pse de fpu" + feature_ecx = "popcnt sse4.2 sse4.1 cx16 ssse3 sse3" + extfeature_edx = "i64 syscall xd" + extfeature_ecx = "lahf_lm" + xlevel = "0x8000000A" + model_id = "Intel Core i7 9xx (Nehalem Class Core i7)" + +[cpudef] + name = "Westmere" + level = "11" + vendor = "GenuineIntel" + family = "6" + model = "44" + stepping = "1" + feature_edx = "sse2 sse fxsr mmx clflush pse36 pat cmov mca pge mtrr sep apic cx8 mce pae msr tsc pse de fpu" + feature_ecx = "aes popcnt sse4.2 sse4.1 cx16 ssse3 sse3" + extfeature_edx = "i64 syscall xd" + extfeature_ecx = "lahf_lm" + xlevel = "0x8000000A" + model_id = "Westmere E56xx/L56xx/X56xx (Nehalem-C)" + +[cpudef] + name = "SandyBridge" + level = "0xd" + vendor = "GenuineIntel" + family = "6" + model = "42" + stepping = "1" + feature_edx = " sse2 sse fxsr mmx clflush pse36 pat cmov mca pge mtrr sep apic cx8 mce pae msr tsc pse de fpu" + feature_ecx = "avx xsave aes tsc-deadline popcnt x2apic sse4.2 sse4.1 cx16 ssse3 pclmulqdq sse3" + extfeature_edx = "i64 rdtscp nx syscall " + extfeature_ecx = "lahf_lm" + xlevel = "0x8000000A" + model_id = "Intel Xeon E312xx (Sandy Bridge)" + +[cpudef] + name = "Opteron_G1" + level = "5" + vendor = "AuthenticAMD" + family = "15" + model = "6" + stepping = "1" + feature_edx = "sse2 sse fxsr mmx clflush pse36 pat cmov mca pge mtrr sep apic cx8 mce pae msr tsc pse de fpu" + feature_ecx = "sse3" + extfeature_edx = "lm fxsr mmx nx pse36 pat cmov mca pge mtrr syscall apic cx8 mce pae msr tsc pse de fpu" + extfeature_ecx = " " + xlevel = "0x80000008" + model_id = "AMD Opteron 240 (Gen 1 Class Opteron)" + +[cpudef] + name = "Opteron_G2" + level = "5" + vendor = "AuthenticAMD" + family = "15" + model = "6" + stepping = "1" + feature_edx = "sse2 sse fxsr mmx clflush pse36 pat cmov mca pge mtrr sep apic cx8 mce pae msr tsc pse de fpu" + feature_ecx = "cx16 sse3" + extfeature_edx = "lm rdtscp fxsr mmx nx pse36 pat cmov mca pge mtrr syscall apic cx8 mce pae msr tsc pse de fpu" + extfeature_ecx = "svm lahf_lm" + xlevel = "0x80000008" + model_id = "AMD Opteron 22xx (Gen 2 Class Opteron)" + +[cpudef] + name = "Opteron_G3" + level = "5" + vendor = "AuthenticAMD" + family = "15" + model = "6" + stepping = "1" + feature_edx = "sse2 sse fxsr mmx clflush pse36 pat cmov mca pge mtrr sep apic cx8 mce pae msr tsc pse de fpu" + feature_ecx = "popcnt cx16 monitor sse3" + extfeature_edx = "lm rdtscp fxsr mmx nx pse36 pat cmov mca pge mtrr syscall apic cx8 mce pae msr tsc pse de fpu" + extfeature_ecx = "misalignsse sse4a abm svm lahf_lm" + xlevel = "0x80000008" + model_id = "AMD Opteron 23xx (Gen 3 Class Opteron)" + +[cpudef] + name = "Opteron_G4" + level = "0xd" + vendor = "AuthenticAMD" + family = "21" + model = "1" + stepping = "2" + feature_edx = "sse2 sse fxsr mmx clflush pse36 pat cmov mca pge mtrr sep apic cx8 mce pae msr tsc pse de fpu" + feature_ecx = "avx xsave aes popcnt sse4.2 sse4.1 cx16 ssse3 pclmulqdq sse3" + extfeature_edx = "lm rdtscp pdpe1gb fxsr mmx nx pse36 pat cmov mca pge mtrr syscall apic cx8 mce pae msr tsc pse de fpu" + extfeature_ecx = " fma4 xop 3dnowprefetch misalignsse sse4a abm svm lahf_lm" + xlevel = "0x8000001A" + model_id = "AMD Opteron 62xx class CPU" + diff --git a/sysconfigs/target/target-x86_64.conf b/sysconfigs/target/target-x86_64.conf index cee0ea9..e69de29 100644 --- a/sysconfigs/target/target-x86_64.conf +++ b/sysconfigs/target/target-x86_64.conf @@ -1,128 +0,0 @@ -# x86 CPU MODELS - -[cpudef] - name = "Conroe" - level = "2" - vendor = "GenuineIntel" - family = "6" - model = "2" - stepping = "3" - feature_edx = "sse2 sse fxsr mmx clflush pse36 pat cmov mca pge mtrr sep apic cx8 mce pae msr tsc pse de fpu" - feature_ecx = "ssse3 sse3" - extfeature_edx = "i64 xd syscall" - extfeature_ecx = "lahf_lm" - xlevel = "0x8000000A" - model_id = "Intel Celeron_4x0 (Conroe/Merom Class Core 2)" - -[cpudef] - name = "Penryn" - level = "2" - vendor = "GenuineIntel" - family = "6" - model = "2" - stepping = "3" - feature_edx = "sse2 sse fxsr mmx clflush pse36 pat cmov mca pge mtrr sep apic cx8 mce pae msr tsc pse de fpu" - feature_ecx = "sse4.1 cx16 ssse3 sse3" - extfeature_edx = "i64 xd syscall" - extfeature_ecx = "lahf_lm" - xlevel = "0x8000000A" - model_id = "Intel Core 2 Duo P9xxx (Penryn Class Core 2)" - -[cpudef] - name = "Nehalem" - level = "2" - vendor = "GenuineIntel" - family = "6" - model = "2" - stepping = "3" - feature_edx = "sse2 sse fxsr mmx clflush pse36 pat cmov mca pge mtrr sep apic cx8 mce pae msr tsc pse de fpu" - feature_ecx = "popcnt sse4.2 sse4.1 cx16 ssse3 sse3" - extfeature_edx = "i64 syscall xd" - extfeature_ecx = "lahf_lm" - xlevel = "0x8000000A" - model_id = "Intel Core i7 9xx (Nehalem Class Core i7)" - -[cpudef] - name = "Westmere" - level = "11" - vendor = "GenuineIntel" - family = "6" - model = "44" - stepping = "1" - feature_edx = "sse2 sse fxsr mmx clflush pse36 pat cmov mca pge mtrr sep apic cx8 mce pae msr tsc pse de fpu" - feature_ecx = "aes popcnt sse4.2 sse4.1 cx16 ssse3 sse3" - extfeature_edx = "i64 syscall xd" - extfeature_ecx = "lahf_lm" - xlevel = "0x8000000A" - model_id = "Westmere E56xx/L56xx/X56xx (Nehalem-C)" - -[cpudef] - name = "SandyBridge" - level = "0xd" - vendor = "GenuineIntel" - family = "6" - model = "42" - stepping = "1" - feature_edx = " sse2 sse fxsr mmx clflush pse36 pat cmov mca pge mtrr sep apic cx8 mce pae msr tsc pse de fpu" - feature_ecx = "avx xsave aes tsc-deadline popcnt x2apic sse4.2 sse4.1 cx16 ssse3 pclmulqdq sse3" - extfeature_edx = "i64 rdtscp nx syscall " - extfeature_ecx = "lahf_lm" - xlevel = "0x8000000A" - model_id = "Intel Xeon E312xx (Sandy Bridge)" - -[cpudef] - name = "Opteron_G1" - level = "5" - vendor = "AuthenticAMD" - family = "15" - model = "6" - stepping = "1" - feature_edx = "sse2 sse fxsr mmx clflush pse36 pat cmov mca pge mtrr sep apic cx8 mce pae msr tsc pse de fpu" - feature_ecx = "sse3" - extfeature_edx = "lm fxsr mmx nx pse36 pat cmov mca pge mtrr syscall apic cx8 mce pae msr tsc pse de fpu" - extfeature_ecx = " " - xlevel = "0x80000008" - model_id = "AMD Opteron 240 (Gen 1 Class Opteron)" - -[cpudef] - name = "Opteron_G2" - level = "5" - vendor = "AuthenticAMD" - family = "15" - model = "6" - stepping = "1" - feature_edx = "sse2 sse fxsr mmx clflush pse36 pat cmov mca pge mtrr sep apic cx8 mce pae msr tsc pse de fpu" - feature_ecx = "cx16 sse3" - extfeature_edx = "lm rdtscp fxsr mmx nx pse36 pat cmov mca pge mtrr syscall apic cx8 mce pae msr tsc pse de fpu" - extfeature_ecx = "svm lahf_lm" - xlevel = "0x80000008" - model_id = "AMD Opteron 22xx (Gen 2 Class Opteron)" - -[cpudef] - name = "Opteron_G3" - level = "5" - vendor = "AuthenticAMD" - family = "15" - model = "6" - stepping = "1" - feature_edx = "sse2 sse fxsr mmx clflush pse36 pat cmov mca pge mtrr sep apic cx8 mce pae msr tsc pse de fpu" - feature_ecx = "popcnt cx16 monitor sse3" - extfeature_edx = "lm rdtscp fxsr mmx nx pse36 pat cmov mca pge mtrr syscall apic cx8 mce pae msr tsc pse de fpu" - extfeature_ecx = "misalignsse sse4a abm svm lahf_lm" - xlevel = "0x80000008" - model_id = "AMD Opteron 23xx (Gen 3 Class Opteron)" - -[cpudef] - name = "Opteron_G4" - level = "0xd" - vendor = "AuthenticAMD" - family = "21" - model = "1" - stepping = "2" - feature_edx = "sse2 sse fxsr mmx clflush pse36 pat cmov mca pge mtrr sep apic cx8 mce pae msr tsc pse de fpu" - feature_ecx = "avx xsave aes popcnt sse4.2 sse4.1 cx16 ssse3 pclmulqdq sse3" - extfeature_edx = "lm rdtscp pdpe1gb fxsr mmx nx pse36 pat cmov mca pge mtrr syscall apic cx8 mce pae msr tsc pse de fpu" - extfeature_ecx = " fma4 xop 3dnowprefetch misalignsse sse4a abm svm lahf_lm" - xlevel = "0x8000001A" - model_id = "AMD Opteron 62xx class CPU" - -- 1.7.3.2

I changed everything on my previous patch to change 'defconfig', but forgot to actually change the variable data type. As the incomplete change doesn't cause any issues or compiler warnings, I am simply sending this additional patch instead of respinning the whole series. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> --- vl.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/vl.c b/vl.c index 967b7e8..87db855 100644 --- a/vl.c +++ b/vl.c @@ -2279,7 +2279,7 @@ int main(int argc, char **argv, char **envp) #ifdef CONFIG_VNC int show_vnc_port = 0; #endif - int defconfig = true; + bool defconfig = true; bool userconfig = true; const char *log_mask = NULL; const char *log_file = NULL; -- 1.7.3.2

Anthony, isn't this going to get in for 1.1? I was expecting it to be applied before the freeze. On Tue, Apr 24, 2012 at 05:32:55PM -0300, Eduardo Habkost wrote:
Changes v1 -> v2: - Move qemu_read_default_config_files() prototype to qemu-config.h - Make defconfig and userconfig variable bool - Coding style change
Patches 1 to 4 just move some code around, patch 5 just adds the new option without adding any new config file. Patch 6 finally creates a /usr/share/qemu /cpus-x86_64.conf file, with the CPU models we currently have on Qemu.
Reference to previous discussion: - http://marc.info/?l=qemu-devel&m=133278877315665
Eduardo Habkost (6): move code to read default config files to a separate function (v2) eliminate arch_config_name variable move list of default config files to an array vl.c: change 'defconfig' variable to bool implement -no-user-config command-line option (v2) move CPU definitions to /usr/share/qemu/cpus-x86_64.conf (v2)
Makefile | 12 +++- arch_init.c | 32 ++++++++- arch_init.h | 2 - qemu-config.h | 4 + qemu-options.hx | 16 ++++- sysconfigs/target/cpus-x86_64.conf | 128 ++++++++++++++++++++++++++++++++++ sysconfigs/target/target-x86_64.conf | 128 ---------------------------------- vl.c | 18 ++--- 8 files changed, 193 insertions(+), 147 deletions(-) create mode 100644 sysconfigs/target/cpus-x86_64.conf
-- 1.7.3.2
-- Eduardo

Am 02.05.2012 15:50, schrieb Eduardo Habkost:
Anthony, isn't this going to get in for 1.1? I was expecting it to be applied before the freeze.
You wrote you would respin it with s/int/bool/. :) Andreas -- SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

On Wed, May 02, 2012 at 04:01:55PM +0200, Andreas Färber wrote:
Am 02.05.2012 15:50, schrieb Eduardo Habkost:
Anthony, isn't this going to get in for 1.1? I was expecting it to be applied before the freeze.
You wrote you would respin it with s/int/bool/. :)
I sent an additional patch instead of respinning (see patch 7/6 sent as reply to this series). -- Eduardo
participants (3)
-
Andreas Färber
-
Blue Swirl
-
Eduardo Habkost