Messages in this thread | | | Date | Tue, 19 Aug 2014 08:11:39 +0200 | From | Paolo Bonzini <> | Subject | Re: [PATCH 1/5] KVM: vmx: fix ept reserved bits for 1-GByte page |
| |
Il 19/08/2014 04:17, Wanpeng Li ha scritto: >>> >> - if (level == 1 || (level == 2 && (spte & (1ULL << 7)))) { >>> >> + if (level == 1 || ((level == 3 || level == 2) >>> >> + && (spte & (1ULL << 7)))) { >> > >> >This condition can be simplified by checking the return value of ept_rsvd_mask. >> >If it includes 0x38, this is a large page.
Oops, a "not" was missing. If it includes 0x38, this is _not_ a large page (it is a page directory / page directory pointer / PML4).
>> Otherwise it is a leaf page and >> you can go down the "if". > As you know, 5:3 bits which used for EPT MT are not reserved bits, so > I fail to understand why check the return value of ept_rsvd_mask and > it's a large page if includes 0x38. Could you eplain in more details? ;-)
A non-leaf page will always have 0x38 in the ept_rsvd_mask. A leaf page will never have 0x38 in the ept_rsvd_mask.
Paolo
| |