aboutsummaryrefslogtreecommitdiff
path: root/arch/x86/kvm/pmu.c
diff options
context:
space:
mode:
authorGravatar Sean Christopherson <seanjc@google.com> 2023-03-22 09:55:20 -0700
committerGravatar Sean Christopherson <seanjc@google.com> 2023-03-22 10:10:37 -0700
commit0c928ff26bd68d9638444601c0cbf4e4f978b752 (patch)
treecbe00deb0690ecd4c1a7c1a9a48723b687a9ccd4 /arch/x86/kvm/pmu.c
parentKVM: VMX: Make CR0.WP a guest owned bit (diff)
downloadlinux-0c928ff26bd68d9638444601c0cbf4e4f978b752.tar.gz
linux-0c928ff26bd68d9638444601c0cbf4e4f978b752.tar.bz2
linux-0c928ff26bd68d9638444601c0cbf4e4f978b752.zip
KVM: SVM: Fix benign "bool vs. int" comparison in svm_set_cr0()
Explicitly convert the return from is_paging() to a bool when comparing against old_paging, which is also a boolean. is_paging() sneakily uses kvm_read_cr0_bits() and returns an int, i.e. returns X86_CR0_PG or 0, not 1 or 0. Luckily, the bug is benign as it only results in a false positive, not a false negative, i.e. only causes a spurious refresh of CR4 when paging is enabled in both the old and new. Cc: Maxim Levitsky <mlevitsk@redhat.com> Fixes: c53bbe2145f5 ("KVM: x86: SVM: don't passthrough SMAP/SMEP/PKE bits in !NPT && !gCR0.PG case") Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'arch/x86/kvm/pmu.c')
0 files changed, 0 insertions, 0 deletions