From: Wanpeng Li <wanpeng.li@linux.intel.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>,
Gleb Natapov <gleb@kernel.org>,
Zhang Yang <yang.z.zhang@intel.com>,
kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] KVM: vmx: fix ept reserved bits for 1-GByte page
Date: Wed, 20 Aug 2014 15:32:09 +0800 [thread overview]
Message-ID: <20140820073209.GA11700@kernel> (raw)
In-Reply-To: <53F4457A.8060506@redhat.com>
On Wed, Aug 20, 2014 at 08:51:38AM +0200, Paolo Bonzini wrote:
>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)
>
Got it.
Regards,
Wanpeng Li
>How are you testing this patch?
>
>Paolo
>
>> + /* bits 6:3 reserved */
>> + mask |= 0x78;
prev parent reply other threads:[~2014-08-20 7:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-20 3:17 [PATCH v3] KVM: vmx: fix ept reserved bits for 1-GByte page Wanpeng Li
2014-08-20 6:51 ` Paolo Bonzini
2014-08-20 7:32 ` Wanpeng Li [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140820073209.GA11700@kernel \
--to=wanpeng.li@linux.intel.com \
--cc=gleb@kernel.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mtosatti@redhat.com \
--cc=pbonzini@redhat.com \
--cc=yang.z.zhang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.