From: Xiaoyao Li <xiaoyao.li@intel.com>
To: Sean Christopherson <seanjc@google.com>,
Paolo Bonzini <pbonzini@redhat.com>
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, xiaoyao.li@intel.com
Subject: [PATCH 2/2] KVM: VMX: Move the comment of CR4.MCE handling right above the code
Date: Mon, 10 Apr 2023 08:50:17 -0400 [thread overview]
Message-ID: <20230410125017.1305238-3-xiaoyao.li@intel.com> (raw)
In-Reply-To: <20230410125017.1305238-1-xiaoyao.li@intel.com>
... to improve the code readability.
No functional change indented.
Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
---
arch/x86/kvm/vmx/vmx.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
index befa2486836b..c9421eb25666 100644
--- a/arch/x86/kvm/vmx/vmx.c
+++ b/arch/x86/kvm/vmx/vmx.c
@@ -3433,13 +3433,13 @@ void vmx_set_cr4(struct kvm_vcpu *vcpu, unsigned long cr4)
{
unsigned long old_cr4 = kvm_read_cr4(vcpu);
struct vcpu_vmx *vmx = to_vmx(vcpu);
+ unsigned long hw_cr4;
+
/*
* Pass through host's Machine Check Enable value to hw_cr4, which
* is in force while we are in guest mode. Do not let guests control
* this bit, even if host CR4.MCE == 0.
*/
- unsigned long hw_cr4;
-
hw_cr4 = (cr4_read_shadow() & X86_CR4_MCE) | (cr4 & ~X86_CR4_MCE);
if (is_unrestricted_guest(vcpu))
hw_cr4 |= KVM_VM_CR4_ALWAYS_ON_UNRESTRICTED_GUEST;
--
2.34.1
next prev parent reply other threads:[~2023-04-10 12:50 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-10 12:50 [PATCH 0/2] KVM: VMX: Clean up of vmx_set_cr4() Xiaoyao Li
2023-04-10 12:50 ` [PATCH 1/2] KVM: VMX: Use kvm_read_cr4() to get cr4 value Xiaoyao Li
2023-04-10 17:11 ` Sean Christopherson
2023-04-12 8:02 ` Xiaoyao Li
2023-04-12 15:03 ` Sean Christopherson
2023-04-13 1:23 ` Xiaoyao Li
2023-04-10 12:50 ` Xiaoyao Li [this message]
2023-06-02 1:25 ` [PATCH 0/2] KVM: VMX: Clean up of vmx_set_cr4() 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=20230410125017.1305238-3-xiaoyao.li@intel.com \
--to=xiaoyao.li@intel.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@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
all inboxes | Powered by JetHome®