Skip to content

Commit

Permalink
libvmmapi: Map the guest physical address space with PROT_CAP
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
markjdb committed Dec 20, 2024
1 parent f8d9fe2 commit ebb6b74
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/libvmmapi/vmmapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Check warning on line 421 in lib/libvmmapi/vmmapi.c

View workflow job for this annotation

GitHub Actions / Style Checker

Missing Signed-off-by: line
Expand Down

0 comments on commit ebb6b74

Please sign in to comment.