projects
/
GitHub
/
LineageOS
/
G12
/
android_kernel_amlogic_linux-4.9.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
515fa37
)
KVM: x86: Add is_executable_pte()
author
Ben Hutchings
<ben@decadent.org.uk>
Sat, 19 Oct 2019 17:10:55 +0000
(18:10 +0100)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Sat, 16 Nov 2019 09:29:52 +0000
(10:29 +0100)
Extracted from commit
d3e328f2cb01
"kvm: x86: mmu: Verify that
restored PTE has needed perms in fast page fault".
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kvm/mmu.c
patch
|
blob
|
blame
|
history
diff --git
a/arch/x86/kvm/mmu.c
b/arch/x86/kvm/mmu.c
index a1edd19a1665cbc4c3bcd647bbf2b44989ddba0b..96a0601a47c41425d90b1cb41058ea6f1c43d542 100644
(file)
--- a/
arch/x86/kvm/mmu.c
+++ b/
arch/x86/kvm/mmu.c
@@
-338,6
+338,11
@@
static int is_last_spte(u64 pte, int level)
return 0;
}
+static bool is_executable_pte(u64 spte)
+{
+ return (spte & (shadow_x_mask | shadow_nx_mask)) == shadow_x_mask;
+}
+
static kvm_pfn_t spte_to_pfn(u64 pte)
{
return (pte & PT64_BASE_ADDR_MASK) >> PAGE_SHIFT;