lkml.org 
[lkml]   [2016]   [Jun]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 1/5] mmu: mark spte present if the x bit is set
Date
Paolo Bonzini <pbonzini@redhat.com> writes:

> On 28/06/2016 19:33, Bandan Das wrote:
>>>> >> static int is_shadow_present_pte(u64 pte)
>>>> >> {
>>>> >> - return pte & PT_PRESENT_MASK && !is_mmio_spte(pte);
>>>> >> + return pte & (PT_PRESENT_MASK | shadow_x_mask) &&
>>>> >> + !is_mmio_spte(pte);
>>> >
>>> > This should really be pte & 7 when using EPT. But this is okay as an
>>> > alternative to a new shadow_present_mask.
>> I could revive shadow_xonly_valid probably... Anyway, for now I will
>> add a TODO comment here.
>
> It's okay to it like this, because the only invalid PTEs reaching this
> point are those that is_mmio_spte filters away. Hence you'll never get
> -W- PTEs here, and pte & 7 is really the same as how you wrote it. It's
> pretty clever, and doesn't need a TODO at all. :)

Thanks, understood. So, the way it is written now covers all cases for
pte & 7. Let's still add a comment - clever things are usually
confusing to many!

> Paolo

\
 
 \ /
  Last update: 2016-06-28 23:21    [W:0.312 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site