KVM: x86: Make use of kvm_read_cr*_bits() when testing bits

[ Upstream commit 74cdc83691 ]

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>
Signed-off-by: Mathias Krause <minipli@grsecurity.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Mathias Krause 2023-05-08 17:46:00 +02:00 • committed by Greg Kroah-Hartman
commit 27ec4cbc1d
2 changed files with 4 additions and 4 deletions