From: Sean Christopherson Date: Tue, 22 Jun 2021 17:57:20 +0000 (-0700) Subject: KVM: x86/mmu: Use MMU's role to detect EFER.NX in guest page walk X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=cd628f0f1e1ce0709c2c6bc852b1a3abf9638b26;p=linux.git KVM: x86/mmu: Use MMU's role to detect EFER.NX in guest page walk Use the NX bit from the MMU's role instead of the MMU itself so that the redundant, dedicated "nx" flag can be dropped. No functional change intended. Signed-off-by: Sean Christopherson Message-Id: <20210622175739.3610207-36-seanjc@google.com> Signed-off-by: Paolo Bonzini --- diff --git a/arch/x86/kvm/mmu/paging_tmpl.h b/arch/x86/kvm/mmu/paging_tmpl.h index 5cf36eb96ee24..c92e712607b60 100644 --- a/arch/x86/kvm/mmu/paging_tmpl.h +++ b/arch/x86/kvm/mmu/paging_tmpl.h @@ -471,7 +471,7 @@ retry_walk: error: errcode |= write_fault | user_fault; - if (fetch_fault && (mmu->nx || is_cr4_smep(mmu))) + if (fetch_fault && (is_efer_nx(mmu) || is_cr4_smep(mmu))) errcode |= PFERR_FETCH_MASK; walker->fault.vector = PF_VECTOR;