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

[PATCH 0/5] x86/pv: #DB vs %dr6 fixes, part 2


  • To: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Wed, 13 Sep 2023 00:21:08 +0100
  • Authentication-results: esa4.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Jan Beulich <JBeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Jinoh Kang <jinoh.kang.kr@xxxxxxxxx>
  • Delivery-date: Tue, 12 Sep 2023 23:21:42 +0000
  • Ironport-data: A9a23:CuUizasrubwxiTh+yJaol1NFAOfnVH5eMUV32f8akzHdYApBsoF/q tZmKW7Vaa3eamShLdwgaIm3/UgP78Ldxt9gQFduqn00FyxA+JbJXdiXEBz9bniYRiHhoOCLz O1FM4Wdc5pkJpP4jk3wWlQ0hSAkjclkfpKlVaicfHg3HFc4IMsYoUoLs/YjhYJ1isSODQqIu Nfjy+XSI1bg0DNvWo4uw/vrRChH4rKq4lv0gnRkPaoQ5A6HzSFIZH4iDfrZw0XQE9E88tGSH 44v/JnhlkvF8hEkDM+Sk7qTWiXmlZaLYGBiIlIPM0STqkAqSh4ai87XB9JFAatjsB2bnsgZ9 Tl4ncfYpTHFnEH7sL91vxFwS0mSNEDdkVPNCSDXXce7lyUqf5ZwqhnH4Y5f0YAwo45K7W9yG fMwLhdTMDzSxMWPg6OLcflttJwlLpLnI9ZK0p1g5Wmx4fcORJnCR+PB5MNC3Sd2jcdLdRrcT 5NHM3w1Nk2GOkARfA5NU/rSn8/x7pX7WxRepEiYuuwc5G/LwRYq+LPsLMDUapqBQsA9ckOw/ zibpjqpXk1CXDCZ4Wu383ywjO7xpH/2CIU+OrOm/c5Nq1LGkwT/DzVJDADm8JFVkHWWS99Zb kAZ5Ccqhawz71CwCMnwWQWip3yJtQJaXMBfe8UYwgyQzqvf4y6CG3MJCDVGbbQOq8seVTEsk FiTkLvBBz1pt73TSnub+fGXtxu9PCEUKSkJYipscOcey4C9+sdp1EuJF4s9Vvfv1bUZBA0c3 RiMi3Zgq+RQqvdIxpWA7VH12zSu/ZTWG1tdChrsYkqp6QZwZYiAboOu6ETG4fsoELt1XmVtr 1BfxZHAsblm4YWl0XXUHb5TRO3BC+OtamW0vLJ5I3U2G91BEVaHdJsY3jxxLVwB3i0sKW6wO x+7Ve+8CfZu0JqWgU1fOdLZ5ycCl/KI+THZuhf8N4AmX3SJXFXblByCnGbJt4wXrGAikLskJ bCQetu2AHARBMxPlWTnG7pBiuF2n31jnAs/oKwXKDz9jdKjiIO9E+9ZYDNikMhphE97nOkl2 4kGbJbbo/mueOb/fjPW4eYuwaMidBAG6WTNg5UPLIare1M2cFzN/teNmdvNjaQ5xfUK/goJl 1nhMnJlJK3X3CSZcl3aMy47OdsCn/9X9BoGAMDlBn7ws1BLXGplxP53m0cfFVX/yNFe8A==
  • Ironport-hdrordr: A9a23:LJa/56jNUqLAAyyHGLhMieAcgXBQXuAji2hC6mlwRA09TyXPrb HIoB19726WtN9xYhEdcL+7U5VoLUm3yXcX2+gs1NWZMzUO41HYSL2KhLGKqwEIfReSygc378 ldmsZFZOEZojJB/KDHCKXTKadD/DEnmprY4Nvj8w==
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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




 


Rackspace

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