diff options
author | Binbin Wu <[email protected]> | 2023-03-22 12:58:23 +0800 |
---|---|---|
committer | Sean Christopherson <[email protected]> | 2023-03-22 10:18:18 -0700 |
commit | 627778bfcfa1ff81acfe863dcc4316edd0a51276 (patch) | |
tree | a236e5eb266b114921cdc0b7b2efd297766ed972 /tools/testing/selftests/bpf/progs/test_autoload.c | |
parent | bede6eb4db19424477c36dace426ae12255f4a0d (diff) |
KVM: SVM: Use kvm_is_cr4_bit_set() to query SMAP/SMEP in "can emulate"
Use kvm_is_cr4_bit_set() to query SMAP and SMEP when determining whether
or not AMD's SMAP+SEV errata prevents KVM from emulating an instruction.
This eliminates an implicit cast from ulong to bool and makes the code
slightly more readable.
Note, any overhead from making multiple calls to kvm_read_cr4_bits() is
negligible, not to mention the code is question is encountered only in
rare situations, i.e. is not a remotely hot path.
Suggested-by: Sean Christopherson <[email protected]>
Signed-off-by: Binbin Wu <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[sean: keep local smap/smep variables, massage changelog]
Signed-off-by: Sean Christopherson <[email protected]>
Diffstat (limited to 'tools/testing/selftests/bpf/progs/test_autoload.c')
0 files changed, 0 insertions, 0 deletions