From: Binbin Wu <binbin.wu@linux.intel.com>
To: Chao Gao <chao.gao@intel.com>, Sean Christopherson <seanjc@google.com>
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
pbonzini@redhat.com, kai.huang@intel.com,
David.Laight@aculab.com, robert.hu@linux.intel.com
Subject: Re: [PATCH v9 4/6] KVM: x86: Introduce untag_addr() in kvm_x86_ops
Date: Thu, 29 Jun 2023 15:22:01 +0800 [thread overview]
Message-ID: <5a9e57e3-0361-77f8-834f-edb8600483e1@linux.intel.com> (raw)
In-Reply-To: <ZJ0rcVpSjbZInnIq@chao-email>
On 6/29/2023 2:57 PM, Chao Gao wrote:
> On Thu, Jun 29, 2023 at 02:12:27PM +0800, Binbin Wu wrote:
>>>> + /*
>>>> + * Check LAM_U48 in cr3_ctrl_bits to avoid guest_cpuid_has().
>>>> + * If not set, vCPU doesn't supports LAM.
>>>> + */
>>>> + if (!(vcpu->arch.cr3_ctrl_bits & X86_CR3_LAM_U48) ||
>>> This is unnecessary, KVM should never allow the LAM bits in CR3 to be set if LAM
>>> isn't supported.
> A corner case is:
>
> If EPT is enabled, CR3 writes are not trapped. then guests can set the
> LAM bits in CR3 if hardware supports LAM regardless whether or not guest
> enumerates LAM.
I recalled the main reason why I added the check.
It's used to avoid the following checking on CR3 & CR4, which may cause
an additional VMREAD.
Also, about the virtualization hole, if guest can enable LAM bits in CR3
in non-root mode without cause any problem,
that means the hardware supports LAM, should KVM continue to untag the
address following CR3 setting?
Because skip untag the address probably will cause guest failure, and of
cause, this is the guest itself to blame.
But untag the address seems do no harm?
next prev parent reply other threads:[~2023-06-29 7:22 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-06 9:18 [PATCH v9 0/6] Linear Address Masking (LAM) KVM Enabling Binbin Wu
2023-06-06 9:18 ` [PATCH v9 1/6] KVM: x86: Consolidate flags for __linearize() Binbin Wu
2023-06-06 9:18 ` [PATCH v9 2/6] KVM: x86: Virtualize CR4.LAM_SUP Binbin Wu
2023-06-07 3:40 ` Huang, Kai
2023-06-07 4:55 ` Binbin Wu
2023-06-07 9:20 ` Huang, Kai
2023-06-06 9:18 ` [PATCH v9 3/6] KVM: x86: Virtualize CR3.LAM_{U48,U57} Binbin Wu
2023-06-27 23:40 ` Sean Christopherson
2023-06-28 3:05 ` Binbin Wu
2023-06-28 17:40 ` Sean Christopherson
2023-07-03 7:56 ` Binbin Wu
2023-07-22 1:28 ` Sean Christopherson
2023-06-06 9:18 ` [PATCH v9 4/6] KVM: x86: Introduce untag_addr() in kvm_x86_ops Binbin Wu
2023-06-28 0:15 ` Sean Christopherson
2023-06-29 6:12 ` Binbin Wu
2023-06-29 6:57 ` Chao Gao
2023-06-29 7:22 ` Binbin Wu [this message]
2023-06-29 15:33 ` Sean Christopherson
2023-06-29 8:30 ` David Laight
2023-06-29 15:16 ` Sean Christopherson
2023-06-29 17:26 ` Binbin Wu
2023-06-06 9:18 ` [PATCH v9 5/6] KVM: x86: Untag address when LAM applicable Binbin Wu
2023-06-28 0:19 ` Sean Christopherson
2023-06-06 9:18 ` [PATCH v9 6/6] KVM: x86: Expose LAM feature to userspace VMM Binbin Wu
2023-06-07 3:52 ` Huang, Kai
2023-06-16 1:45 ` Binbin Wu
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=5a9e57e3-0361-77f8-834f-edb8600483e1@linux.intel.com \
--to=binbin.wu@linux.intel.com \
--cc=David.Laight@aculab.com \
--cc=chao.gao@intel.com \
--cc=kai.huang@intel.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=robert.hu@linux.intel.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
all inboxes | Powered by JetHome®