public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Yosry Ahmed <yosry.ahmed@linux.dev>
To: Sean Christopherson <seanjc@google.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Ken Hofsass <hofsass@google.com>,
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Yosry Ahmed <yosry.ahmed@linux.dev>
Subject: [PATCH 0/3] KVM: x86: Accelerate reading CR3 for guest debug
Date: Fri, 21 Nov 2025 19:32:01 +0000	[thread overview]
Message-ID: <20251121193204.952988-1-yosry.ahmed@linux.dev> (raw)

Some guest debuggers use the value of CR3 to attribute a debug event to
a guest process. Providing CR3 in the debug info makes this
significantly faster than doing KVM_GET_SREGS every time, so add support
for that. Also extend the debug_regs selftest to cover this.

Yosry Ahmed (3):
  KVM: x86: Add CR3 to guest debug info
  KVM: selftests: Use TEST_ASSERT_EQ() in debug_regs
  KVM: selftests: Verify CR3 in debug_regs

 arch/x86/include/uapi/asm/kvm.h              |  1 +
 arch/x86/kvm/svm/svm.c                       |  2 +
 arch/x86/kvm/vmx/vmx.c                       |  2 +
 arch/x86/kvm/x86.c                           |  3 +
 include/uapi/linux/kvm.h                     |  1 +
 tools/testing/selftests/kvm/x86/debug_regs.c | 82 ++++++++++----------
 6 files changed, 48 insertions(+), 43 deletions(-)


base-commit: d209f1ea367750edfcba7db8d199a856e4186511
-- 
2.52.0.rc2.455.g230fcf2819-goog


             reply	other threads:[~2025-11-21 19:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-21 19:32 Yosry Ahmed [this message]
2025-11-21 19:32 ` [PATCH 1/3] KVM: x86: Add CR3 to guest debug info Yosry Ahmed
2025-11-21 21:01   ` Sean Christopherson
2025-11-21 23:12     ` Yosry Ahmed
2025-11-24 14:45       ` Sean Christopherson
2025-11-24 15:35         ` Yosry Ahmed
2025-11-21 19:32 ` [PATCH 2/3] KVM: selftests: Use TEST_ASSERT_EQ() in debug_regs Yosry Ahmed
2025-11-21 19:32 ` [PATCH 3/3] KVM: selftests: Verify CR3 " Yosry Ahmed

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=20251121193204.952988-1-yosry.ahmed@linux.dev \
    --to=yosry.ahmed@linux.dev \
    --cc=hofsass@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=seanjc@google.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox