Skip to content

x86: Debug Regs fixes, part 1

Andrew Cooper xen-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 14 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3x86: Reject bad %dr6/%dr7 values when loading guest statexen/arch/x86/domain.c xen/arch/x86/hvm/hvm.c+27 -09 replies
2/3x86: Introduce new debug.c for debug register infrastructurexen/arch/x86/Makefile xen/arch/x86/debug.c xen/arch/x86/include/asm/debugreg.h+31 -02 replies
3/3x86: Fix calculation of %dr6/dr7 reserved bitsxen/arch/x86/debug.c xen/arch/x86/domain.c xen/arch/x86/hvm/hvm.c +4 more+59 -213 replies

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchJan Beulich
1/3A-b
2/3A-b
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

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

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
Signature · 1 line
2.30.2