From: Sean Christopherson <seanjc@google.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Sean Christopherson <seanjc@google.com>,
Vitaly Kuznetsov <vkuznets@redhat.com>,
Wanpeng Li <wanpengli@tencent.com>,
Jim Mattson <jmattson@google.com>, Joerg Roedel <joro@8bytes.org>,
kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] KVM: x86: Deplete Paolo's brown paper bag supply by one
Date: Wed, 6 Apr 2022 22:51:06 +0000 [thread overview]
Message-ID: <20220406225106.55471-1-seanjc@google.com> (raw)
Fix an inverted check on CR0.PG when computing the cpu_role, the MMU is
direct and all CR4 bits ignored if paging is disabled, not enabled.
Fixes: d73678dc11ec ("KVM: x86/mmu: split cpu_role from mmu_role")
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
I haven't done much testing on the rest of the MMU role patches, this just
popped up in very, very basic testing ;-) I assume this will be squashed,
hence the snarky shortlog.
arch/x86/kvm/mmu/mmu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c
index e41d7bba7a65..ab24fc161bac 100644
--- a/arch/x86/kvm/mmu/mmu.c
+++ b/arch/x86/kvm/mmu/mmu.c
@@ -4699,7 +4699,7 @@ kvm_calc_cpu_role(struct kvm_vcpu *vcpu, const struct kvm_mmu_role_regs *regs)
role.base.smm = is_smm(vcpu);
role.base.guest_mode = is_guest_mode(vcpu);
- if (____is_cr0_pg(regs)) {
+ if (!____is_cr0_pg(regs)) {
role.base.direct = 1;
return role;
}
base-commit: 56ba4b488353a8925b30367d72e41d1996c23554
--
2.35.1.1094.g7c7d902a7c-goog
next reply other threads:[~2022-04-06 22:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-06 22:51 Sean Christopherson [this message]
2022-04-07 7:07 ` [PATCH] KVM: x86: Deplete Paolo's brown paper bag supply by one 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=20220406225106.55471-1-seanjc@google.com \
--to=seanjc@google.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=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