kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Dong, Eddie" <eddie.dong@intel.com>
To: Jim Mattson <jmattson@google.com>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"pbonzini@redhat.com" <pbonzini@redhat.com>, "Christopherson,,
	Sean" <seanjc@google.com>
Subject: RE: [PATCH 2/6] KVM: x86: Mask off reserved bits in CPUID.80000006H
Date: Fri, 30 Sep 2022 21:20:55 +0000	[thread overview]
Message-ID: <BL0PR11MB304234A34209F12E03F746198A569@BL0PR11MB3042.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20220929225203.2234702-2-jmattson@google.com>



> -----Original Message-----
> From: Jim Mattson <jmattson@google.com>
> Sent: Thursday, September 29, 2022 3:52 PM
> To: kvm@vger.kernel.org; pbonzini@redhat.com; Christopherson,, Sean
> <seanjc@google.com>
> Cc: Jim Mattson <jmattson@google.com>
> Subject: [PATCH 2/6] KVM: x86: Mask off reserved bits in CPUID.80000006H
> 
> KVM_GET_SUPPORTED_CPUID should only enumerate features that KVM
> actually supports. CPUID.80000006H:EDX[17:16] are reserved bits and should
> be masked off.
> 
> Fixes: 43d05de2bee7 ("KVM: pass through CPUID(0x80000006)")
> Signed-off-by: Jim Mattson <jmattson@google.com>
> ---
>  arch/x86/kvm/cpuid.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c index
> ea4e213bcbfb..90f9c295825d 100644
> --- a/arch/x86/kvm/cpuid.c
> +++ b/arch/x86/kvm/cpuid.c
> @@ -1125,6 +1125,7 @@ static inline int __do_cpuid_func(struct
> kvm_cpuid_array *array, u32 function)
>  		break;
>  	case 0x80000006:
>  		/* L2 cache and TLB: pass through host info. */
> +		entry->edx &= ~GENMASK(17, 16);

SDM of Intel CPU says the edx is reserved=0.  I must miss something.

BTW, for those reserved bits, their meaning is not defined, and the VMM should not depend on them IMO.
What is the problem if hypervisor returns none-zero value?

Thanks Eddie

>  		break;
>  	case 0x80000007: /* Advanced power management */
>  		/* invariant TSC is CPUID.80000007H:EDX[8] */
> --
> 2.38.0.rc1.362.ged0d419d3c-goog


  reply	other threads:[~2022-09-30 21:21 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-29 22:51 [PATCH 1/6] KVM: x86: Mask off reserved bits in CPUID.80000001H Jim Mattson
2022-09-29 22:51 ` [PATCH 2/6] KVM: x86: Mask off reserved bits in CPUID.80000006H Jim Mattson
2022-09-30 21:20   ` Dong, Eddie [this message]
2022-09-30 23:12     ` Jim Mattson
2022-09-30 23:59       ` Dong, Eddie
2022-10-01  0:35         ` Jim Mattson
2022-10-03 19:35           ` Dong, Eddie
2022-10-03 20:18             ` Jim Mattson
2022-10-05  0:08               ` Dong, Eddie
2022-10-05  2:59                 ` Jim Mattson
2022-10-05 17:09                   ` Dong, Eddie
2022-10-19 22:42   ` Sean Christopherson
2022-09-29 22:52 ` [PATCH 3/6] KVM: x86: Mask off reserved bits in CPUID.80000008H Jim Mattson
2022-10-19 22:49   ` Sean Christopherson
2022-09-29 22:52 ` [PATCH 4/6] KVM: x86: Mask off reserved bits in CPUID.8000001AH Jim Mattson
2022-09-29 22:52 ` [PATCH 5/6] KVM: x86: Mask off reserved bits in CPUID.8000001EH Jim Mattson
2022-10-19 22:53   ` Sean Christopherson
2022-10-22  8:26     ` Paolo Bonzini
2022-09-29 22:52 ` [PATCH 6/6] KVM: x86: Mask off reserved bits in CPUID.8000001FH Jim Mattson
2022-10-22  8:34   ` Paolo Bonzini
2022-09-30 21:04 ` [PATCH 1/6] KVM: x86: Mask off reserved bits in CPUID.80000001H Dong, Eddie
2022-09-30 23:14   ` Jim Mattson
2022-10-19 22:58 ` Sean Christopherson
2022-10-22  8:36   ` Paolo Bonzini

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=BL0PR11MB304234A34209F12E03F746198A569@BL0PR11MB3042.namprd11.prod.outlook.com \
    --to=eddie.dong@intel.com \
    --cc=jmattson@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=seanjc@google.com \
    /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;
as well as URLs for NNTP newsgroup(s).