From: Yu Zhang <yu.c.zhang@linux.intel.com>
To: pbonzini@redhat.com, seanjc@google.com, vkuznets@redhat.com,
jmattson@google.com, joro@8bytes.org, wanpengli@tencent.com,
kvm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] KVM: X86: Fix the comments in prepare_vmcs02_rare()
Date: Fri, 15 Jul 2022 19:42:11 +0800 [thread overview]
Message-ID: <20220715114211.53175-3-yu.c.zhang@linux.intel.com> (raw)
In-Reply-To: <20220715114211.53175-1-yu.c.zhang@linux.intel.com>
Although EB.PF in vmcs02 is still set by simply "or"ing the EB of
vmcs01 and vmcs12, the explanation is obsolete. "enable_ept" being
set is not the only reason for L0 to clear its EB.PF.
Signed-off-by: Yu Zhang <yu.c.zhang@linux.intel.com>
---
arch/x86/kvm/vmx/nested.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c
index 778f82015f03..634a7d218048 100644
--- a/arch/x86/kvm/vmx/nested.c
+++ b/arch/x86/kvm/vmx/nested.c
@@ -2451,10 +2451,10 @@ static void prepare_vmcs02_rare(struct vcpu_vmx *vmx, struct vmcs12 *vmcs12)
* is not easy (if at all possible?) to merge L0 and L1's desires, we
* simply ask to exit on each and every L2 page fault. This is done by
* setting MASK=MATCH=0 and (see below) EB.PF=1.
- * Note that below we don't need special code to set EB.PF beyond the
- * "or"ing of the EB of vmcs01 and vmcs12, because when enable_ept,
- * vmcs01's EB.PF is 0 so the "or" will take vmcs12's value, and when
- * !enable_ept, EB.PF is 1, so the "or" will always be 1.
+ * Note that EB.PF is set by "or"ing of the EB of vmcs01 and vmcs12,
+ * because when L0 has no desire to intercept #PF, vmcs01's EB.PF is 0
+ * so the "or" will take vmcs12's value, otherwise EB.PF is 1, so the
+ * "or" will always be 1.
*/
if (vmx_need_pf_intercept(&vmx->vcpu)) {
/*
--
2.25.1
next prev parent reply other threads:[~2022-07-15 12:28 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-15 11:42 [PATCH 0/2] Fix the #PF injection logic for smaller MAXPHYADDR in nested Yu Zhang
2022-07-15 11:42 ` [PATCH 1/2] KVM: X86: Initialize 'fault' in kvm_fixup_and_inject_pf_error() Yu Zhang
2022-07-15 14:47 ` Sean Christopherson
2022-07-18 6:52 ` Yu Zhang
2022-07-15 11:42 ` Yu Zhang [this message]
2022-07-15 15:56 ` [PATCH 2/2] KVM: X86: Fix the comments in prepare_vmcs02_rare() Sean Christopherson
2022-07-18 7:58 ` Yu Zhang
2022-07-19 0:09 ` Sean Christopherson
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=20220715114211.53175-3-yu.c.zhang@linux.intel.com \
--to=yu.c.zhang@linux.intel.com \
--cc=jmattson@google.com \
--cc=joro@8bytes.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=seanjc@google.com \
--cc=vkuznets@redhat.com \
--cc=wanpengli@tencent.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