diff options
| author | Gleb Natapov <gleb@redhat.com> | 2013-01-30 09:45:00 -0500 |
|---|---|---|
| committer | Marcelo Tosatti <mtosatti@redhat.com> | 2013-02-04 20:24:28 -0500 |
| commit | feb3eb704a86d97edb296502e95da42d622dac61 (patch) | |
| tree | 72353f4f448128ce8037532ff35db90f88b9f813 | |
| parent | 75d61fbcf563373696578570e914f555e12c8d97 (diff) | |
KVM: MMU: make spte_is_locklessly_modifiable() more clear
spte_is_locklessly_modifiable() checks that both SPTE_HOST_WRITEABLE and
SPTE_MMU_WRITEABLE are present on spte. Make it more explicit.
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
| -rw-r--r-- | arch/x86/kvm/mmu.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 9f628f7a40b2..2fa82b04f14e 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c | |||
| @@ -448,7 +448,8 @@ static bool __check_direct_spte_mmio_pf(u64 spte) | |||
| 448 | 448 | ||
| 449 | static bool spte_is_locklessly_modifiable(u64 spte) | 449 | static bool spte_is_locklessly_modifiable(u64 spte) |
| 450 | { | 450 | { |
| 451 | return !(~spte & (SPTE_HOST_WRITEABLE | SPTE_MMU_WRITEABLE)); | 451 | return (spte & (SPTE_HOST_WRITEABLE | SPTE_MMU_WRITEABLE)) == |
| 452 | (SPTE_HOST_WRITEABLE | SPTE_MMU_WRITEABLE); | ||
| 452 | } | 453 | } |
| 453 | 454 | ||
| 454 | static bool spte_has_volatile_bits(u64 spte) | 455 | static bool spte_has_volatile_bits(u64 spte) |
