From ebb6b74ec1221e1a290547832c0db45b081d80e0 Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Thu, 19 Dec 2024 18:32:40 +0000 Subject: [PATCH] libvmmapi: Map the guest physical address space with PROT_CAP This lets the gdb stub see capability tag bits; otherwise, they're cleared on load and the debugger sees all capabilities as invalid. Note that this enables the writing of capabilities to the GPA space as well. --- lib/libvmmapi/vmmapi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libvmmapi/vmmapi.c b/lib/libvmmapi/vmmapi.c index d8c49665faed..d260555020e2 100644 --- a/lib/libvmmapi/vmmapi.c +++ b/lib/libvmmapi/vmmapi.c @@ -415,7 +415,7 @@ setup_memory_segment(struct vmctx *ctx, vm_paddr_t gpa, size_t len, char *base) flags |= MAP_NOCORE; /* mmap into the process address space on the host */ - ptr = mmap(base + gpa, len, PROT_RW, flags, ctx->fd, gpa); + ptr = mmap(base + gpa, len, PROT_RW | PROT_CAP, flags, ctx->fd, gpa); if (ptr == MAP_FAILED) return (-1);