On 24/08/17 16:16, Jan Beulich wrote: >>>> On 17.08.17 at 16:44, <wei.l...@citrix.com> wrote: >> Move the code to pv/emul-mmio-op.c. Fix coding style issues while >> moving. >> >> Note that mmio_ro_emulated_write is needed by both PV and HVM, so it >> is left in x86/mm.c. >> >> Signed-off-by: Wei Liu <wei.l...@citrix.com> >> --- >> xen/arch/x86/mm.c | 129 -------------------------------- >> xen/arch/x86/pv/Makefile | 1 + >> xen/arch/x86/pv/emul-mmio-op.c | 166 >> +++++++++++++++++++++++++++++++++++++++++ > Again I think just mmio.c would do. Other comments on earlier > patches apply here as well.
I think it would be wise to merge the ptwr and mmio handling. At the moment, we invoke a full lookup pte/decode/try-to-emulate cycle twice in the #PF handler for PV guests before handing the fault back to the guest. The correct ops and context can be determined by inspecting the l1e under %cr2 before calling into any emulation code. Simplifying this logic before moving it would be the better option. ~Andrew _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel