lkml.org 
[lkml]   [2014]   [Aug]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3] KVM: vmx: fix ept reserved bits for 1-GByte page
Il 20/08/2014 05:17, Wanpeng Li ha scritto:
> + else if (spte & (1ULL << 7))

You have to check level == 1 specifically here, or add...

> + /*
> + * 1GB/2MB page, bits 29:12 or 20:12 reserved respectively,
> + * level == 1 if the hypervisor is using the ignored bit 7.
> + */
> + mask |= (PAGE_SIZE << ((level - 1) * 9)) - PAGE_SIZE;
> + else

... "if (level > 1)" here.

Otherwise, you're marking bits 6:3 as reserved for 4K pages. This
should cause a WARN, because KVM puts 0110 in those bits:

ret = (MTRR_TYPE_WRBACK << VMX_EPT_MT_EPTE_SHIFT)
| VMX_EPT_IPAT_BIT;

(in vmx_get_mt_mask: writeback memory, ignore PAT memory type from the
guest's page tables)

How are you testing this patch?

Paolo

> + /* bits 6:3 reserved */
> + mask |= 0x78;



\
 
 \ /
  Last update: 2014-08-20 09:21    [W:0.045 / U:0.620 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site