git: e283c994ab27 - main - x86/xen: fill hypercall page with int3
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 22 Feb 2024 10:31:20 UTC
The branch main has been updated by royger:
URL: https://cgit.FreeBSD.org/src/commit/?id=e283c994ab270706142ef5dde9092950000af901
commit e283c994ab270706142ef5dde9092950000af901
Author: Roger Pau Monné <royger@FreeBSD.org>
AuthorDate: 2024-02-02 08:50:16 +0000
Commit: Roger Pau Monné <royger@FreeBSD.org>
CommitDate: 2024-02-22 10:08:04 +0000
x86/xen: fill hypercall page with int3
Filling the hypercall page with nops is not helpful from a debugging point of
view, as for example attempting to execute an hypercall before the page is
initialized will result in the execution flow falling through into
xen_start32, making the mistake less obvious to spot.
Instead fill the page with int3 (0xcc) which will result in a #BP trap.
Sponsored by: Cloud Software Group
Reviewed by: markj
Differential revision: https://reviews.freebsd.org/D43930
---
sys/amd64/amd64/xen-locore.S | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sys/amd64/amd64/xen-locore.S b/sys/amd64/amd64/xen-locore.S
index db949af1e7ca..ed2aae038b6d 100644
--- a/sys/amd64/amd64/xen-locore.S
+++ b/sys/amd64/amd64/xen-locore.S
@@ -67,7 +67,7 @@
.p2align PAGE_SHIFT, 0x90 /* Hypercall_page needs to be PAGE aligned */
ENTRY(hypercall_page)
- .skip 0x1000, 0x90 /* Fill with "nop"s */
+ .skip 0x1000, 0xcc /* Fill with `int3` to generate a #BP trap. */
/* PVH entry point. */
.code32