Slightly RFC.  This is the next chunk of debug fixes from the bug that Jinoh
reported.

I've decided to tackle PV guests alone to simplify the problem (No
introspection, get some of the core changes in place).

Patch 5 is still a bit chunky to follow, but I can't see any way to simplify
it without transiently breaking something.

Patchs 1 and 3 are entirely new, relative to previous postings of this work.
Others are rebased/shuffled.

There are still bugs/misfeatures:

 1) Data breakpoints during emulation (copy to/from guest) are accounted
    against Xen and not given back to the guest.
 2) Instruction breakpoints aren't calculated for FEP; CPUID.  This may not
    matter, but like everything in PV, it's undocumented and unclear if it's
    intended behaviour or not.

that can be left to some other future to fix.

Andrew Cooper (5):
  x86/pv: Fix the determiniation of whether to inject #DB
  x86: Introduce x86_merge_dr6()
  x86/emul: Add a pending_dbg field to x86_emulate_ctxt.retire
  x86/pv: Drop priv_op_ctxt.bpmatch and use pending_dbg instead
  x86/pv: Rewrite %dr6 handling

 xen/arch/x86/debug.c                   | 20 +++++++++++++++++
 xen/arch/x86/include/asm/debugreg.h    |  7 ++++++
 xen/arch/x86/include/asm/domain.h      | 12 ++++++++++
 xen/arch/x86/include/asm/x86-defns.h   |  7 ++++++
 xen/arch/x86/pv/emul-priv-op.c         | 31 +++++++++++++-------------
 xen/arch/x86/pv/emulate.c              |  6 ++---
 xen/arch/x86/pv/ro-page-fault.c        |  4 ++--
 xen/arch/x86/pv/traps.c                | 17 ++++++++++----
 xen/arch/x86/traps.c                   | 12 +++++-----
 xen/arch/x86/x86_emulate/x86_emulate.c |  6 ++++-
 xen/arch/x86/x86_emulate/x86_emulate.h | 22 ++++++++++++++----
 11 files changed, 109 insertions(+), 35 deletions(-)

-- 
2.30.2


Reply via email to