KVM: x86: Make use of kvm_read_cr*_bits() when testing bits
authorMathias Krause <minipli@grsecurity.net>
Wed, 22 Mar 2023 01:37:29 +0000 (02:37 +0100)
committerSean Christopherson <seanjc@google.com>
Wed, 22 Mar 2023 14:47:25 +0000 (07:47 -0700)
commit74cdc836919bf34684ef66f995273f35e2189daf
treecc9fa2d45611e6b719a5c8161db5d33b9242f5ff
parente40bcf9f3a187126ce74a05d3b177fc16874446f
KVM: x86: Make use of kvm_read_cr*_bits() when testing bits

Make use of the kvm_read_cr{0,4}_bits() helper functions when we only
want to know the state of certain bits instead of the whole register.

This not only makes the intent cleaner, it also avoids a potential
VMREAD in case the tested bits aren't guest owned.

Signed-off-by: Mathias Krause <minipli@grsecurity.net>
Link: https://lore.kernel.org/r/20230322013731.102955-5-minipli@grsecurity.net
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/pmu.c
arch/x86/kvm/vmx/vmx.c