lkml.org 
[lkml]   [2017]   [Aug]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v3 2/5] KVM: MMU: check guest CR3 reserved bits based on its physical address width.
From
Date
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.

Paolo

\
 
 \ /
  Last update: 2017-08-24 17:52    [W:0.065 / U:50.624 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site