On Fri, Jan 11, 2013 at 03:10:20AM +0100, Igor Mammedov wrote: > commit 8935499831312 makes cpuid return to guest host's vendor value > instead of built-in one by default if kvm_enabled() == true and allows > to override this behavior if 'vendor' is specified on -cpu command line. > > But every time guest calls cpuid to get 'vendor' value, host's value is > read again and again in default case. > > It complicates semantic of vendor property and makes it harder to use. > > Instead of reading 'vendor' value from host every time cpuid[vendor] is > called, override 'vendor' value only once in cpu_x86_find_by_name(), when > built-in CPU model is found and if(kvm_enabled() == true). > > It provides the same default semantic > if (kvm_enabled() == true) vendor = host's vendor > else vendor = built-in vendor > > and then later: > if (custom vendor) vendor = custom vendor > > 'vendor' value is overridden when user provides it on -cpu command line, > and there isn't need in vendor_override field anymore, remove it. > > Signed-off-by: Igor Mammedov <imamm...@redhat.com>
In case my previous reviewed-by line (buried in the discussion about property defaults) was missed: Reviewed-by: Eduardo Habkost <ehabk...@redhat.com> > --- > v4: > - rebased with "target-i386: move out CPU features initialization > in separate func" dropped. So remove vendor_override in > cpu_x86_register() instead. > - replace x86cpu_vendor_words2str() with x86_cpu_vendor_words2str() > due to renaming of the last in previous patch > --- > target-i386/cpu.c | 27 ++++++++++++--------------- > target-i386/cpu.h | 1 - > 2 files changed, 12 insertions(+), 16 deletions(-) > [...] -- Eduardo