From: "Andreas Färber" <afaerber@suse.de>
To: Marcelo Tosatti <mtosatti@redhat.com>,
Anthony Liguori <aliguori@us.ibm.com>,
Eduardo Habkost <ehabkost@redhat.com>
Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org
Subject: Re: [Qemu-devel] [PATCH 27/28] target-i386: kvm_cpu_fill_host: use GET_SUPPORTED_CPUID
Date: Fri, 02 Nov 2012 16:52:49 +0100 [thread overview]
Message-ID: <5093EC51.4000307@suse.de> (raw)
In-Reply-To: <5093E7E8.4030007@suse.de>
Am 02.11.2012 16:34, schrieb Andreas Färber:
> Am 31.10.2012 10:40, schrieb Marcelo Tosatti:
>> From: Eduardo Habkost <ehabkost@redhat.com>
>>
>> Change the kvm_cpu_fill_host() function to use
>> kvm_arch_get_supported_cpuid() instead of running the CPUID instruction
>> directly, when checking for supported CPUID features.
>>
>> This should solve two problems at the same time:
>>
>> * "-cpu host" was not enabling features that don't need support on
>> the host CPU (e.g. x2apic);
>> * "check" and "enforce" options were not detecting problems when the
>> host CPU did support a feature, but the KVM kernel code didn't
>> support it.
>>
>> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
>> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
>> ---
>> target-i386/cpu.c | 25 +++++++++++++++----------
>> 1 files changed, 15 insertions(+), 10 deletions(-)
>>
>> diff --git a/target-i386/cpu.c b/target-i386/cpu.c
>> index 390ed47..4c84e9f 100644
>> --- a/target-i386/cpu.c
>> +++ b/target-i386/cpu.c
>> @@ -773,13 +773,13 @@ static int cpu_x86_fill_model_id(char *str)
>> */
>> static void kvm_cpu_fill_host(x86_def_t *x86_cpu_def)
>> {
>> + KVMState *s = kvm_state;
>
> This broke the linux-user build:
>
> target-i386/cpu.o: In function `kvm_cpu_fill_host':
> /home/andreas/QEMU/qemu-rcar/target-i386/cpu.c:783: undefined reference
> to `kvm_state'
> collect2: error: ld returned 1 exit status
> make[1]: *** [qemu-i386] Fehler 1
> make: *** [subdir-i386-linux-user] Fehler 2
As a quickfix this would work, but strikes me as ugly:
Signed-off-by: Andreas Färber <afaerber@suse.de>
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index c46286a..8663623 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -780,7 +780,11 @@ static int cpu_x86_fill_model_id(char *str)
*/
static void kvm_cpu_fill_host(x86_def_t *x86_cpu_def)
{
+#ifdef CONFIG_KVM
KVMState *s = kvm_state;
+#else
+ KVMState *s = NULL;
+#endif
uint32_t eax = 0, ebx = 0, ecx = 0, edx = 0;
assert(kvm_enabled());
Andreas
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
next prev parent reply other threads:[~2012-11-02 15:52 UTC|newest]
Thread overview: 68+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-31 9:39 [PATCH 00/28] [PULL] qemu-kvm.git uq/master queue Marcelo Tosatti
2012-10-31 9:39 ` [Qemu-devel] " Marcelo Tosatti
2012-10-31 9:39 ` [PATCH 01/28] i386: kvm: kvm_arch_get_supported_cpuid: move R_EDX hack outside of for loop Marcelo Tosatti
2012-10-31 9:39 ` [Qemu-devel] " Marcelo Tosatti
2012-10-31 9:39 ` [PATCH 02/28] i386: kvm: kvm_arch_get_supported_cpuid: clean up has_kvm_features check Marcelo Tosatti
2012-10-31 9:39 ` [Qemu-devel] " Marcelo Tosatti
2012-10-31 9:39 ` [PATCH 03/28] i386: kvm: kvm_arch_get_supported_cpuid: use 'entry' variable Marcelo Tosatti
2012-10-31 9:39 ` [Qemu-devel] " Marcelo Tosatti
2012-10-31 9:39 ` [PATCH 04/28] i386: kvm: extract register switch to cpuid_entry_get_reg() function Marcelo Tosatti
2012-10-31 9:39 ` [Qemu-devel] " Marcelo Tosatti
2012-10-31 9:39 ` [PATCH 05/28] i386: kvm: extract CPUID entry lookup to cpuid_find_entry() function Marcelo Tosatti
2012-10-31 9:39 ` [Qemu-devel] " Marcelo Tosatti
2012-10-31 9:39 ` [PATCH 06/28] i386: kvm: extract try_get_cpuid() loop to get_supported_cpuid() function Marcelo Tosatti
2012-10-31 9:39 ` [Qemu-devel] " Marcelo Tosatti
2012-10-31 9:39 ` [PATCH 07/28] i386: kvm: kvm_arch_get_supported_cpuid: replace if+switch with single 'if' Marcelo Tosatti
2012-10-31 9:39 ` [Qemu-devel] " Marcelo Tosatti
2012-10-31 9:39 ` [PATCH 08/28] i386: kvm: set CPUID_EXT_HYPERVISOR on kvm_arch_get_supported_cpuid() Marcelo Tosatti
2012-10-31 9:39 ` [Qemu-devel] " Marcelo Tosatti
2012-10-31 9:39 ` [PATCH 09/28] i386: kvm: set CPUID_EXT_TSC_DEADLINE_TIMER " Marcelo Tosatti
2012-10-31 9:39 ` [Qemu-devel] " Marcelo Tosatti
2012-10-31 9:39 ` [PATCH 10/28] i386: kvm: x2apic is not supported without in-kernel irqchip Marcelo Tosatti
2012-10-31 9:39 ` [Qemu-devel] " Marcelo Tosatti
2012-10-31 9:39 ` [PATCH 11/28] i386: kvm: mask cpuid_kvm_features earlier Marcelo Tosatti
2012-10-31 9:39 ` [Qemu-devel] " Marcelo Tosatti
2012-10-31 9:39 ` [PATCH 12/28] i386: kvm: mask cpuid_ext4_features bits earlier Marcelo Tosatti
2012-10-31 9:39 ` [Qemu-devel] " Marcelo Tosatti
2012-10-31 9:39 ` [PATCH 13/28] i386: kvm: filter CPUID feature words earlier, on cpu.c Marcelo Tosatti
2012-10-31 9:39 ` [Qemu-devel] " Marcelo Tosatti
2012-10-31 9:39 ` [PATCH 14/28] i386: kvm: reformat filter_features_for_kvm() code Marcelo Tosatti
2012-10-31 9:39 ` [Qemu-devel] " Marcelo Tosatti
2012-10-31 9:39 ` [PATCH 15/28] i386: kvm: filter CPUID leaf 7 based on GET_SUPPORTED_CPUID, too Marcelo Tosatti
2012-10-31 9:39 ` [Qemu-devel] " Marcelo Tosatti
2012-10-31 9:39 ` [PATCH 16/28] i386: cpu: add missing CPUID[EAX=7,ECX=0] flag names Marcelo Tosatti
2012-10-31 9:39 ` [Qemu-devel] [PATCH 16/28] i386: cpu: add missing CPUID[EAX=7, ECX=0] " Marcelo Tosatti
2012-10-31 9:39 ` [PATCH 17/28] target-i386: Add missing kvm cpuid feature name Marcelo Tosatti
2012-10-31 9:39 ` [Qemu-devel] " Marcelo Tosatti
2012-10-31 9:39 ` [PATCH 18/28] cirrus_vga: allow configurable vram size Marcelo Tosatti
2012-10-31 9:39 ` [Qemu-devel] " Marcelo Tosatti
2012-10-31 9:39 ` [PATCH 19/28] Use machine options to emulate -no-kvm-irqchip Marcelo Tosatti
2012-10-31 9:39 ` [Qemu-devel] " Marcelo Tosatti
2012-10-31 9:39 ` [PATCH 20/28] Issue warning when deprecated -no-kvm-pit is used Marcelo Tosatti
2012-10-31 9:39 ` [Qemu-devel] " Marcelo Tosatti
2012-10-31 9:39 ` [PATCH 21/28] Use global properties to emulate -no-kvm-pit-reinjection Marcelo Tosatti
2012-10-31 9:39 ` [Qemu-devel] " Marcelo Tosatti
2012-10-31 9:40 ` [PATCH 22/28] Issue warning when deprecated drive parameter boot=on|off is used Marcelo Tosatti
2012-10-31 9:40 ` [Qemu-devel] " Marcelo Tosatti
2012-10-31 9:40 ` [PATCH 23/28] Issue warning when deprecated -tdf option " Marcelo Tosatti
2012-10-31 9:40 ` [Qemu-devel] " Marcelo Tosatti
2012-10-31 9:40 ` [PATCH 24/28] Emulate qemu-kvms -no-kvm option Marcelo Tosatti
2012-10-31 9:40 ` [Qemu-devel] " Marcelo Tosatti
2012-10-31 9:40 ` [PATCH 25/28] target-i386: make cpu_x86_fill_host() void Marcelo Tosatti
2012-10-31 9:40 ` [Qemu-devel] " Marcelo Tosatti
2012-10-31 9:40 ` [PATCH 26/28] target-i386: cpu: make -cpu host/check/enforce code KVM-specific Marcelo Tosatti
2012-10-31 9:40 ` [Qemu-devel] " Marcelo Tosatti
2012-10-31 9:40 ` [PATCH 27/28] target-i386: kvm_cpu_fill_host: use GET_SUPPORTED_CPUID Marcelo Tosatti
2012-10-31 9:40 ` [Qemu-devel] " Marcelo Tosatti
2012-11-02 15:34 ` Andreas Färber
2012-11-02 15:52 ` Andreas Färber [this message]
2012-11-02 16:05 ` Eduardo Habkost
2012-11-02 16:05 ` [Qemu-devel] " Eduardo Habkost
2012-11-02 16:25 ` [PATCH] target-i386: cpu: fix --disable-kvm compilation Eduardo Habkost
2012-11-02 16:25 ` [Qemu-devel] " Eduardo Habkost
2012-11-02 16:54 ` Andreas Färber
2012-11-02 16:54 ` [Qemu-devel] " Andreas Färber
2012-10-31 9:40 ` [PATCH 28/28] update-linux-headers.sh: Handle new kernel uapi/ directories Marcelo Tosatti
2012-10-31 9:40 ` [Qemu-devel] " Marcelo Tosatti
2012-11-01 19:32 ` [PATCH 00/28] [PULL] qemu-kvm.git uq/master queue Anthony Liguori
2012-11-01 19:32 ` [Qemu-devel] " Anthony Liguori
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5093EC51.4000307@suse.de \
--to=afaerber@suse.de \
--cc=aliguori@us.ibm.com \
--cc=ehabkost@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.