From: Yu Zhang <yu.c.zhang@linux.intel.com>
To: Paolo Bonzini <pbonzini@redhat.com>, kvm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, rkrcmar@redhat.com,
tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com,
xiaoguangrong@tencent.com, joro@8bytes.org
Subject: Re: [PATCH v3 2/5] KVM: MMU: check guest CR3 reserved bits based on its physical address width.
Date: Thu, 24 Aug 2017 23:38:23 +0800 [thread overview]
Message-ID: <f772ea78-12cc-7bde-de3c-19aa8aca6251@linux.intel.com> (raw)
In-Reply-To: <35e285e7-168a-25e6-1053-c005da18c103@redhat.com>
On 8/24/2017 11:50 PM, Paolo Bonzini wrote:
> On 24/08/2017 17:23, Yu Zhang wrote:
>>>> static inline u64 rsvd_bits(int s, int e)
>>>> {
>>>> + if (e < s)
>>>> + return 0;
>>>> +
>>>> return ((1ULL << (e - s + 1)) - 1) << s;
>>>> }
>>> e = s - 1 is already supported; why do you need e <= s - 2?
>> Sorry? I do not quite understand. When will e = s - 1?
> Is there any case where e < s? I can see that MAXPHYADDR=63 gives
> rsvd_bits(63, 62), but that works.
>
> In practice, MAXPHYADDR will never be 59 even because the PKRU bits are
> at bits 59..62.
Thanks, Paolo.
I see. I had made an assumption that MAXPHYADDR shall not exceed the
physical one,
which is 52 I believe. But I'm not sure there's any place to check this.
Maybe we should make sure the vcpu->arch.maxphyaddr will not be greater
than the
value of the host?
Yu
>
> Paolo
>
next prev parent reply other threads:[~2017-08-24 15:38 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-24 12:27 [PATCH v3 0/5] KVM: MMU: 5 level EPT/shadow support Yu Zhang
2017-08-24 12:27 ` [PATCH v3 1/5] KVM: x86: Add return value to kvm_cpuid() Yu Zhang
2017-08-24 12:27 ` [PATCH v3 2/5] KVM: MMU: check guest CR3 reserved bits based on its physical address width Yu Zhang
2017-08-24 13:40 ` Paolo Bonzini
2017-08-24 15:23 ` Yu Zhang
2017-08-24 15:50 ` Paolo Bonzini
2017-08-24 15:38 ` Yu Zhang [this message]
2017-08-24 16:27 ` Paolo Bonzini
2017-08-24 16:21 ` Yu Zhang
2017-08-24 16:51 ` Paolo Bonzini
2017-09-15 23:19 ` Jim Mattson
2017-09-18 8:15 ` Yu Zhang
2017-09-18 8:41 ` Paolo Bonzini
2017-09-18 9:35 ` Yu Zhang
2017-08-24 12:27 ` [PATCH v3 3/5] KVM: MMU: Rename PT64_ROOT_LEVEL to PT64_ROOT_4LEVEL Yu Zhang
2017-08-24 12:27 ` [PATCH v3 4/5] KVM: MMU: Add 5 level EPT & Shadow page table support Yu Zhang
2017-08-24 13:42 ` Paolo Bonzini
2017-08-24 12:27 ` [PATCH v3 5/5] KVM: MMU: Expose the LA57 feature to VM Yu Zhang
2017-08-24 13:47 ` [PATCH v3 0/5] KVM: MMU: 5 level EPT/shadow support Paolo Bonzini
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=f772ea78-12cc-7bde-de3c-19aa8aca6251@linux.intel.com \
--to=yu.c.zhang@linux.intel.com \
--cc=hpa@zytor.com \
--cc=joro@8bytes.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=pbonzini@redhat.com \
--cc=rkrcmar@redhat.com \
--cc=tglx@linutronix.de \
--cc=xiaoguangrong@tencent.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox