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

[PATCH 0/3] x86: Debug Regs fixes, part 1


  • To: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Tue, 29 Aug 2023 14:43:30 +0100
  • Authentication-results: esa3.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, 29 Aug 2023 13:43:54 +0000
  • Ironport-data: A9a23:z8nyRqC+HVRzjRVW/wHjw5YqxClBgxIJ4kV8jS/XYbTApG4mgmYBn WIbWGnTbPvZYWageY91aYS0oR4AsJ7cmtdrQQY4rX1jcSlH+JHPbTi7wuUcHAvJd5GeExg3h yk6QoOdRCzhZiaE/n9BCpC48T8nk/nOHuGmYAL9EngZbRd+Tys8gg5Ulec8g4p56fC0GArIs t7pyyHlEAbNNwVcbCRMscpvlDs15K6p4GNC7wRnDRx2lAS2e0c9Xcp3yZ6ZdxMUcqEMdsamS uDKyq2O/2+x13/B3fv8z94X2mVTKlLjFVDmZkh+AsBOsTAbzsAG6Y4pNeJ0VKtio27hc+ada jl6ncfYpQ8BZsUgkQmGOvVSO3kW0aZuoNcrLZUj2CA6IoKvn3bEmp1T4E8K0YIw4tlVOCJn0 tYiNHMWZR2Mh8Dm0YqcY7w57igjBJGD0II3v3hhyXfSDOo8QICFSKLPjTNa9G5u3IYUR6+YP pdHL2M1N3wsYDUWUrsTILs4kP2lmT/UdDpApUjOjaE2/3LS3Ep6172F3N/9I4bSFJQKzx/Dz o7A1zTjQQ0iOe688hnb6nGDn9D1hzjFG6tHQdVU8dY12QbOlwT/EiY+RVa95PW0lEO6c9ZeM FAPvDojq7Ao806mRcW7WAe3yFamlBMBX9tbE8Uh9RqAjKHT5m6xGWwsXjNHLts8u6ceRz0s0 V/PnNrvCnpsqpWaTHuc8vGfqjbaBMQOBTZcP2leF1JDuoS95thp1XojU+qPDoatsf/MWhjX6 QqW7zM1iroTr54a74KSqAWvby2XmrDFSQs85wPyV22j7x9kaIPNW7FE+WQ3/t4bct/HEwDpU Gws3pHHsbtQVc3leDmlGr1lIV2/2xqS3NQwa3ZLFoJpyTmi8mXLkWt4sGAnfxcB3irplFbUj K7vVeF5vs870JiCN/Ufj2eN5yMClPOIKDgdfqqIBueim7AoHON9wAlgZFSLw0fmm1U2nKc0N P+zKJj9VixGVvs+k2HqH4/xNIPHIQhkmQvuqW3TlUz7gdJymlbIIVv6DLd+Rr9gt/7VyOkk2 91eK9GL231ivB7WO0HqHXooBQlSdxATXMmmw/G7g8bfemKK7kl9Ua6OqV7gEqQ595loehDgp SrjBhEFmQKi2xUq62yiMxheVV8mZr4nxVpTAMDmFQzAN6QLCWp30JoiSg==
  • Ironport-hdrordr: A9a23:NRQW76Hk12c5qOXupLqE0seALOsnbusQ8zAXPhZKOHtom6uj5q OTdZUgtSMc5wx7ZJhNo7q90cq7IE80l6Qb3WBLB8bHYOCOggLBEGgF1+bfKlbbdREWmNQw6U /OGZIObuEZoTJB/KTHCKjTKadE/OW6
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

This is the rework of "x86: Fix calculation of %dr6/dr7 reserved bits",
accounting for things which have changed in the past 5 years, and new
discoveries.

In particular, it was buggy to take Roger's R-by.  The logic was correct when
he reviewed it, and was not correct in the forward-port presented.

Introduce enough BusLock infrastructure (avaialble in current/next gen Intel
and AMD CPUs) to get the dr6 calculations up-to-date, and reimplement the
constants logic with reserved bits in a way that's hopefully clear and
acceptable to everyone.

This is part 1 of the work to address the bug Jinoh reported.  Sorry I haven't
had time to sort the rest yet, but at least this is a small bit of progress.

Andrew Cooper (3):
  x86: Reject bad %dr6/%dr7 values when loading guest state
  x86: Introduce new debug.c for debug register infrastructure
  x86: Fix calculation of %dr6/dr7 reserved bits

 xen/arch/x86/Makefile                       |  1 +
 xen/arch/x86/debug.c                        | 46 +++++++++++++++++++++
 xen/arch/x86/domain.c                       | 24 ++++++++++-
 xen/arch/x86/hvm/hvm.c                      | 14 ++++++-
 xen/arch/x86/include/asm/debugreg.h         | 15 +++++--
 xen/arch/x86/include/asm/x86-defns.h        | 21 +++++++++-
 xen/arch/x86/pv/misc-hypercalls.c           | 16 ++-----
 xen/include/public/arch-x86/cpufeatureset.h |  1 +
 8 files changed, 117 insertions(+), 21 deletions(-)
 create mode 100644 xen/arch/x86/debug.c

-- 
2.30.2




 


Rackspace

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