diff options
author | Binbin Wu <binbin.wu@linux.intel.com> | 2023-03-22 07:58:23 +0300 |
---|---|---|
committer | Sean Christopherson <seanjc@google.com> | 2023-03-22 20:18:18 +0300 |
commit | 627778bfcfa1ff81acfe863dcc4316edd0a51276 (patch) | |
tree | a236e5eb266b114921cdc0b7b2efd297766ed972 /tools/perf/scripts/python/exported-sql-viewer.py | |
parent | bede6eb4db19424477c36dace426ae12255f4a0d (diff) | |
download | linux-627778bfcfa1ff81acfe863dcc4316edd0a51276.tar.xz |
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 <seanjc@google.com>
Signed-off-by: Binbin Wu <binbin.wu@linux.intel.com>
Link: https://lore.kernel.org/r/20230322045824.22970-4-binbin.wu@linux.intel.com
[sean: keep local smap/smep variables, massage changelog]
Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'tools/perf/scripts/python/exported-sql-viewer.py')
0 files changed, 0 insertions, 0 deletions