All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Jan Beulich" <JBeulich@suse.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>, "Wei Liu" <wl@xen.org>,
	"Jinoh Kang" <jinoh.kang.kr@gmail.com>
Subject: [PATCH 0/3] x86: Debug Regs fixes, part 1
Date: Tue, 29 Aug 2023 14:43:30 +0100	[thread overview]
Message-ID: <20230829134333.3551243-1-andrew.cooper3@citrix.com> (raw)

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



             reply	other threads:[~2023-08-29 13:44 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-29 13:43 Andrew Cooper [this message]
2023-08-29 13:43 ` [PATCH 1/3] x86: Reject bad %dr6/%dr7 values when loading guest state Andrew Cooper
2023-08-29 14:08   ` Jan Beulich
2023-08-30 14:35     ` Andrew Cooper
2023-08-30 15:12       ` Jan Beulich
2023-08-30 15:28         ` Andrew Cooper
2023-08-30 16:13           ` Jan Beulich
2023-08-30 17:02             ` Andrew Cooper
2023-08-31  6:08               ` Jan Beulich
2023-08-30  6:46   ` Jan Beulich
2023-08-30 14:39     ` Andrew Cooper
2023-08-29 13:43 ` [PATCH 2/3] x86: Introduce new debug.c for debug register infrastructure Andrew Cooper
2023-08-29 14:10   ` Jan Beulich
2023-08-29 14:25     ` Andrew Cooper
2023-08-29 13:43 ` [PATCH 3/3] x86: Fix calculation of %dr6/dr7 reserved bits Andrew Cooper
2023-08-29 14:21   ` Jan Beulich
2023-08-29 14:29     ` Andrew Cooper
2023-08-29 15:47       ` Jan Beulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230829134333.3551243-1-andrew.cooper3@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=jinoh.kang.kr@gmail.com \
    --cc=roger.pau@citrix.com \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.