[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH V9 4/5] xen/mm: Clean up pfec handling in gva_to_gfn
At 22:12 +0800 on 03 Feb (1454537524), Huaitong Han wrote: > From: George Dunlap <george.dunlap@xxxxxxxxxx> > > At the moment, the pfec argument to gva_to_gfn has two functions: > > * To inform guest_walk what kind of access is happenind > > * As a value to pass back into the guest in the event of a fault. > > Unfortunately this is not quite treated consistently: the hvm_fetch_* > function will "pre-clear" the PFEC_insn_fetch flag before calling > gva_to_gfn; meaning guest_walk doesn't actually know whether a given > access is an instruction fetch or not. This works now, but will cause > issues when pkeys are introduced, since guest_walk will need to know > whether an access is an instruction fetch even if it doesn't return > PFEC_insn_fetch. > > Fix this by making a clean separation for in and out functionalities > of the pfec argument: > > 1. Always pass in the access type to gva_to_gfn > > 2. Filter out inappropriate access flags before returning from gva_to_gfn. > > (The PFEC_insn_fetch flag should only be passed to the guest if either NX or > SMEP is enabled. See Intel 64 Developer's Manual, Volume 3, Chapter Paging, > PAGE-FAULT EXCEPTIONS) > > Signed-off-by: George Dunlap <george.dunlap@xxxxxxxxxx> > Signed-off-by: Huaitong Han <huaitong.han@xxxxxxxxx> > Acked-by: Jan Beulich <jbeulich@xxxxxxxx> Acked-by: Tim Deegan <tim@xxxxxxx> _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |