Commit a102a67
KVM: x86/mmu: Don't drop level/direct from MMU role calculation
Use the calculated role as-is when propagating it to kvm_mmu.mmu_role,
i.e. stop masking off meaningful fields. The concept of masking off
fields came from kvm_mmu_pte_write(), which (correctly) ignores certain
fields when comparing kvm_mmu_page.role against kvm_mmu.mmu_role, e.g.
the current mmu's access and level have no relation to a shadow page's
access and level.
Masking off the level causes problems for 5-level paging, e.g. CR4.LA57
has its own redundant flag in the extended role, and nested EPT would
need a similar hack to support 5-level paging for L2.
Opportunistically rework the mask for kvm_mmu_pte_write() to define the
fields that should be ignored as opposed to the fields that should be
checked, i.e. make it opt-out instead of opt-in so that new fields are
automatically picked up. While doing so, stop ignoring "direct". The
field is effectively ignored anyways because kvm_mmu_pte_write() is only
reached with an indirect mmu and the loop only walks indirect shadow
pages, but double checking "direct" literally costs nothing.
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>1 parent e743664 commit a102a67
1 file changed
+18
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | 218 | | |
230 | 219 | | |
231 | 220 | | |
| |||
4930 | 4919 | | |
4931 | 4920 | | |
4932 | 4921 | | |
4933 | | - | |
4934 | 4922 | | |
4935 | 4923 | | |
4936 | 4924 | | |
| |||
5002 | 4990 | | |
5003 | 4991 | | |
5004 | 4992 | | |
5005 | | - | |
5006 | 4993 | | |
5007 | 4994 | | |
5008 | 4995 | | |
| |||
5059 | 5046 | | |
5060 | 5047 | | |
5061 | 5048 | | |
5062 | | - | |
5063 | 5049 | | |
5064 | 5050 | | |
5065 | 5051 | | |
| |||
5100 | 5086 | | |
5101 | 5087 | | |
5102 | 5088 | | |
5103 | | - | |
5104 | 5089 | | |
5105 | 5090 | | |
5106 | 5091 | | |
| |||
5339 | 5324 | | |
5340 | 5325 | | |
5341 | 5326 | | |
| 5327 | + | |
| 5328 | + | |
| 5329 | + | |
| 5330 | + | |
| 5331 | + | |
| 5332 | + | |
| 5333 | + | |
| 5334 | + | |
| 5335 | + | |
| 5336 | + | |
| 5337 | + | |
| 5338 | + | |
| 5339 | + | |
| 5340 | + | |
| 5341 | + | |
| 5342 | + | |
5342 | 5343 | | |
5343 | 5344 | | |
5344 | 5345 | | |
| |||
5394 | 5395 | | |
5395 | 5396 | | |
5396 | 5397 | | |
5397 | | - | |
5398 | | - | |
| 5398 | + | |
| 5399 | + | |
5399 | 5400 | | |
5400 | 5401 | | |
5401 | 5402 | | |
| |||
0 commit comments