[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [V3 PATCH 7/9] x86/hvm: pkeys, add pkeys support for guest_walk_tables



At 08:21 +0000 on 18 Dec (1450426907), Han, Huaitong wrote:
> On Wed, 2015-12-16 at 15:36 +0000, George Dunlap wrote:
> > With your current series, guest_walk_tables() already checks for
> > pkeys
> > being enabled in the guest before checking for them in the
> > pagetables.
> > For shadow mode, these will be false, and so no checks will be done. 
> >  If
> > anyone ever implements pkeys for shadow mode, then these will be
> > enabled, and the checks will be done, without any intervention on the
> > part of the caller.
> 
> I have understood it, but, the problem with shadow mode is that pfec
> may come from regs->error_code?hardware?, just like:
> rc = sh_walk_guest_tables(v, va, &gw, regs->error_code);
> so, when regs->error_code does not have PFEC_prot_key,
> guest_walk_tables may still check PKEY when codes is writen according
> to what you said, and it maybe return a different result.

That's OK -- in general there's no guarantee that the guest walk will
produce the same result as the original hardware fault, since the
guest may have modified its pagetables.

So flagging something as a pkey error when the original fault didn't
is OK.  OTOH, we shouldn't keep a hardware-supplied pkey bit in the
PFEC unless the guest walk finds a reason for it to be there.
IOW, we should treat it like the PFEC_present bit and have it depend
only on the walk (or go straight to George's plan of separating inputs
from outputs so that's not an issue).

Cheers,

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.