Re: [PATCH 1/5] KVM: vmx: fix ept reserved bits for 1-GByte page

From: Paolo Bonzini
Date: Tue Aug 19 2014 - 02:11:53 EST


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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/