From: Avi Kivity <avi@redhat.com>
To: Joerg Roedel <joerg.roedel@amd.com>
Cc: Anthony Liguori <anthony@codemonkey.ws>, kvm@vger.kernel.org
Subject: Re: [PATCH] qemu-kvm: Ask kernel about supported svm features
Date: Thu, 22 Apr 2010 15:13:14 +0300 [thread overview]
Message-ID: <4BD03D5A.6090905@redhat.com> (raw)
In-Reply-To: <20100422120249.GW31537@amd.com>
On 04/22/2010 03:02 PM, Joerg Roedel wrote:
>>
>>> Signed-off-by: Joerg Roedel<joerg.roedel@amd.com>
>>> ---
>>> qemu-kvm-x86.c | 14 ++++++++++++--
>>> 1 files changed, 12 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/qemu-kvm-x86.c b/qemu-kvm-x86.c
>>> index 748ff69..6eccd69 100644
>>> --- a/qemu-kvm-x86.c
>>> +++ b/qemu-kvm-x86.c
>>> @@ -1327,8 +1327,18 @@ int kvm_arch_init_vcpu(CPUState *cenv)
>>> qemu_kvm_cpuid_on_env(©);
>>> limit = copy.regs[R_EAX];
>>>
>>> - for (i = 0x80000000; i<= limit; ++i)
>>> - do_cpuid_ent(&cpuid_ent[cpuid_nent++], i, 0,©);
>>> + for (i = 0x80000000; i<= limit; ++i) {
>>> + do_cpuid_ent(&cpuid_ent[cpuid_nent], i, 0,©);
>>> + switch (i) {
>>> + case 0x8000000a:
>>> + cpuid_ent[cpuid_nent].eax = kvm_arch_get_supported_cpuid(cenv, 0x8000000a, R_EAX);
>>> + cpuid_ent[cpuid_nent].ebx = kvm_arch_get_supported_cpuid(cenv, 0x8000000a, R_EBX);
>>> + cpuid_ent[cpuid_nent].ebx = kvm_arch_get_supported_cpuid(cenv, 0x8000000a, R_EBX);
>>> + cpuid_ent[cpuid_nent].edx = kvm_arch_get_supported_cpuid(cenv, 0x8000000a, R_EDX);
>>> + break;
>>> + }
>>> + cpuid_nent += 1;
>>> + }
>>>
>> I don't understand why this is different compared to all other cpuid bits.
>>
> Because for the SVM features we report to the guest we need to ask the
> kernel which of them are supported.
That's true for all cpuid features.
> We can't just take the host-cpuid
> because most of the additional svm features need special emulation in
> the kernel. Or do you think this should better be handled in
> target-i386/cpuid.c?
>
Yes. -cpu host should take KVM_GET_SUPPORTED_CPUID output and loop it
back to the vcpu configuration, others just take the qemu configuration,
mask it with supported bits, and pass it back (see
check_features_against_host()).
(need feature names for the bits, too, so you can enable or disable them
from the command line)
--
error compiling committee.c: too many arguments to function
next prev parent reply other threads:[~2010-04-22 12:13 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-22 10:57 [PATCH] qemu-kvm: Ask kernel about supported svm features Joerg Roedel
2010-04-22 11:07 ` Avi Kivity
2010-04-22 12:02 ` Joerg Roedel
2010-04-22 12:13 ` Avi Kivity [this message]
2010-04-22 12:28 ` Joerg Roedel
2010-04-22 14:48 ` Avi Kivity
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=4BD03D5A.6090905@redhat.com \
--to=avi@redhat.com \
--cc=anthony@codemonkey.ws \
--cc=joerg.roedel@amd.com \
--cc=kvm@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox