From: Sean Christopherson <seanjc@google.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: kvm@vger.kernel.org, Sean Christopherson <seanjc@google.com>
Subject: [kvm-unit-tests PATCH] x86/debug: Verify DR6 is always empty on an INT1/ICEBP #DB
Date: Thu, 14 May 2026 14:12:37 -0700 [thread overview]
Message-ID: <20260514211237.1629774-1-seanjc@google.com> (raw)
Extend the single-step + INT/ICEBP #DB testcase to verify that DR6.BS==0
on the ICEBP #DB, even when single-step is fully enabled. Per the SDM:
The INT1 instruction also uses a one-byte opcode (F1) and generates a
debug exception (#DB) without setting any bits in DR6.
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
x86/debug.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/x86/debug.c b/x86/debug.c
index 09f06ef5..36235370 100644
--- a/x86/debug.c
+++ b/x86/debug.c
@@ -281,11 +281,12 @@ static noinline unsigned long singlestep_with_movss_blocking(void)
static void report_singlestep_with_movss_blocking_and_icebp(unsigned long start,
const char *usermode)
{
- report(n == 4 &&
+ report(n == 5 &&
is_icebp_db(dr6[0]) && db_addr[0] == start &&
- is_single_step_db(dr6[1]) && db_addr[1] == start + 6 &&
- is_single_step_db(dr6[2]) && db_addr[2] == start + 6 + 1 &&
- is_single_step_db(dr6[3]) && db_addr[3] == start + 6 + 1 + 1,
+ is_icebp_db(dr6[1]) && db_addr[1] == start + 1 &&
+ is_single_step_db(dr6[2]) && db_addr[2] == start + 1 + 6 &&
+ is_single_step_db(dr6[3]) && db_addr[3] == start + 1 + 6 + 1 &&
+ is_single_step_db(dr6[4]) && db_addr[4] == start + 1 + 6 + 1 + 1,
"%sSingle-Step + ICEBP #DB w/ MOVSS blocking", usermode);
}
@@ -311,7 +312,8 @@ static noinline unsigned long singlestep_with_movss_blocking_and_icebp(void)
"popf\n\t"
"mov %%ax, %%ss\n\t"
".byte 0xf1;"
- "1:and $~(1<<8),%%rax\n\t"
+ "1:.byte 0xf1;"
+ "and $~(1<<8),%%rax\n\t"
"push %%rax\n\t"
"popf\n\t"
"lea 1b(%%rip),%0\n\t"
base-commit: 9eb6c57313060d34f7e5b2ac6f90bb5873bbe2ff
--
2.54.0.563.g4f69b47b94-goog
reply other threads:[~2026-05-14 21:12 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20260514211237.1629774-1-seanjc@google.com \
--to=seanjc@google.com \
--cc=kvm@vger.kernel.org \
--cc=pbonzini@redhat.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