[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] target-i386: adds PV_DEDICATED hint CPUID featu
From: |
Eduardo Habkost |
Subject: |
Re: [Qemu-devel] [PATCH] target-i386: adds PV_DEDICATED hint CPUID feature bit |
Date: |
Fri, 9 Feb 2018 09:46:15 -0200 |
User-agent: |
Mutt/1.9.1 (2017-09-22) |
On Fri, Feb 09, 2018 at 09:41:41AM +0100, Paolo Bonzini wrote:
> On 08/02/2018 19:12, Eduardo Habkost wrote:
> > On Thu, Feb 08, 2018 at 05:44:20PM +0800, Wanpeng Li wrote:
> >> From: Wanpeng Li <address@hidden>
> >>
> >> Add PV_DEDICATED hint cpuid feature bit.
> >>
> > [...]
> >> diff --git a/target/i386/cpu.c b/target/i386/cpu.c
> >> index d70954b..cf48931 100644
> >> --- a/target/i386/cpu.c
> >> +++ b/target/i386/cpu.c
> >> @@ -4076,6 +4076,9 @@ static int x86_cpu_filter_features(X86CPU *cpu)
> >> x86_cpu_get_supported_feature_word(w, false);
> >> uint32_t requested_features = env->features[w];
> >> env->features[w] &= host_feat;
> >> + if (cpu->pv_dedicated && (w == FEAT_KVM)) {
> >> + env->features[w] |= CPUID_PV_DEDICATED;
> >> + }
> >
> > Why do this trick here instead of just adding "pv-dedicated" to
> > feature_word_info[FEAT_KVM].feat_names?
>
> I think because it can be added independent of KVM_GET_SUPPORTED_CPUID.
If QEMU knows it can be enabled if outside GET_SUPPORTED_CPUID,
kvm_arch_get_supported_cpuid() can return it as supported.
--
Eduardo
Re: [Qemu-devel] [PATCH] target-i386: adds PV_DEDICATED hint CPUID feature bit, Paolo Bonzini, 2018/02/09