Skip to content

Commit 8873c14

Browse files
Lai Jiangshanbonzini
authored andcommitted
KVM: X86: Rename variable smap to not_smap in permission_fault()
Comments above the variable says the bit is set when SMAP is overridden or the same meaning in update_permission_bitmask(): it is not subjected to SMAP restriction. Renaming it to reflect the negative implication and make the code better readability. Signed-off-by: Lai Jiangshan <jiangshan.ljs@antgroup.com> Message-Id: <20220311070346.45023-4-jiangshanlai@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
1 parent 94b4a2f commit 8873c14

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

arch/x86/kvm/mmu.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,9 +234,9 @@ static inline u8 permission_fault(struct kvm_vcpu *vcpu, struct kvm_mmu *mmu,
234234
* but it will be one in index if SMAP checks are being overridden.
235235
* It is important to keep this branchless.
236236
*/
237-
unsigned long smap = (cpl - 3) & (rflags & X86_EFLAGS_AC);
237+
unsigned long not_smap = (cpl - 3) & (rflags & X86_EFLAGS_AC);
238238
int index = (pfec >> 1) +
239-
(smap >> (X86_EFLAGS_AC_BIT - PFERR_RSVD_BIT + 1));
239+
(not_smap >> (X86_EFLAGS_AC_BIT - PFERR_RSVD_BIT + 1));
240240
bool fault = (mmu->permissions[index] >> pte_access) & 1;
241241
u32 errcode = PFERR_PRESENT_MASK;
242242

0 commit comments

Comments
 (0)