diff options
-rw-r--r-- | drivers/kvm/kvm.h | 4 | ||||
-rw-r--r-- | drivers/kvm/paging_tmpl.h | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h index a7c5e6bee034..65ab268d4256 100644 --- a/drivers/kvm/kvm.h +++ b/drivers/kvm/kvm.h | |||
@@ -121,7 +121,7 @@ struct kvm_pte_chain { | |||
121 | * bits 4:7 - page table level for this shadow (1-4) | 121 | * bits 4:7 - page table level for this shadow (1-4) |
122 | * bits 8:9 - page table quadrant for 2-level guests | 122 | * bits 8:9 - page table quadrant for 2-level guests |
123 | * bit 16 - "metaphysical" - gfn is not a real page (huge page/real mode) | 123 | * bit 16 - "metaphysical" - gfn is not a real page (huge page/real mode) |
124 | * bits 17:18 - "access" - the user and writable bits of a huge page pde | 124 | * bits 17:19 - "access" - the user, writable, and nx bits of a huge page pde |
125 | */ | 125 | */ |
126 | union kvm_mmu_page_role { | 126 | union kvm_mmu_page_role { |
127 | unsigned word; | 127 | unsigned word; |
@@ -131,7 +131,7 @@ union kvm_mmu_page_role { | |||
131 | unsigned quadrant : 2; | 131 | unsigned quadrant : 2; |
132 | unsigned pad_for_nice_hex_output : 6; | 132 | unsigned pad_for_nice_hex_output : 6; |
133 | unsigned metaphysical : 1; | 133 | unsigned metaphysical : 1; |
134 | unsigned hugepage_access : 2; | 134 | unsigned hugepage_access : 3; |
135 | }; | 135 | }; |
136 | }; | 136 | }; |
137 | 137 | ||
diff --git a/drivers/kvm/paging_tmpl.h b/drivers/kvm/paging_tmpl.h index a7c5cb0319ea..4b5391c717f8 100644 --- a/drivers/kvm/paging_tmpl.h +++ b/drivers/kvm/paging_tmpl.h | |||
@@ -366,6 +366,8 @@ static u64 *FNAME(fetch)(struct kvm_vcpu *vcpu, gva_t addr, | |||
366 | metaphysical = 1; | 366 | metaphysical = 1; |
367 | hugepage_access = *guest_ent; | 367 | hugepage_access = *guest_ent; |
368 | hugepage_access &= PT_USER_MASK | PT_WRITABLE_MASK; | 368 | hugepage_access &= PT_USER_MASK | PT_WRITABLE_MASK; |
369 | if (*guest_ent & PT64_NX_MASK) | ||
370 | hugepage_access |= (1 << 2); | ||
369 | hugepage_access >>= PT_WRITABLE_SHIFT; | 371 | hugepage_access >>= PT_WRITABLE_SHIFT; |
370 | table_gfn = (*guest_ent & PT_BASE_ADDR_MASK) | 372 | table_gfn = (*guest_ent & PT_BASE_ADDR_MASK) |
371 | >> PAGE_SHIFT; | 373 | >> PAGE_SHIFT; |