summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm
diff options
context:
space:
mode:
authorSean Christopherson <seanjc@google.com>2021-06-22 19:57:20 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2021-06-25 00:00:43 +0200
commitcd628f0f1e1ce0709c2c6bc852b1a3abf9638b26 (patch)
tree3467d12ae417da7bcb9e31a4018a271b496c700d /arch/x86/kvm
parentKVM: x86/mmu: Use MMU's roles to compute last non-leaf level (diff)
downloadlinux-cd628f0f1e1ce0709c2c6bc852b1a3abf9638b26.tar.xz
linux-cd628f0f1e1ce0709c2c6bc852b1a3abf9638b26.zip
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 <seanjc@google.com> Message-Id: <20210622175739.3610207-36-seanjc@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm')
-rw-r--r--arch/x86/kvm/mmu/paging_tmpl.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kvm/mmu/paging_tmpl.h b/arch/x86/kvm/mmu/paging_tmpl.h
index 5cf36eb96ee2..c92e712607b6 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;