On 23/7/26 11:45, Markus Armbruster wrote:
Philippe Mathieu-Daudé <[email protected]> writes:
Hi,
On 21/5/26 16:54, [email protected] wrote:
From: Marc-André Lureau <[email protected]>
gpa2hva() returns a referenced MemoryRegion via its p_mr out-parameter
(inherited from memory_region_find()), but both SEV callers were failing
to release it.
Comment orthogonal to your fix; odd to have a non-monitor code
call an undocumented monitor method.
Which one?
$ git grep -w gpa2hva
hmp-commands.hx:538: .name = "gpa2hva",
hmp-commands.hx:546:``gpa2hva`` *addr*
include/monitor/monitor.h:57:void *gpa2hva(MemoryRegion **p_mr, hwaddr
addr, uint64_t size, Error **errp);
monitor/hmp-cmds.c:715:void *gpa2hva(MemoryRegion **p_mr, hwaddr addr,
uint64_t size, Error **errp)
monitor/hmp-cmds.c:753: ptr = gpa2hva(&mr, addr, 1, &local_err);
monitor/hmp-cmds.c:827: ptr = gpa2hva(&mr, addr, 1, &local_err);
target/i386/sev.c:1579: hva = gpa2hva(&mr, desc->base, desc->len,
NULL);
target/i386/sev.c:2093: hva = gpa2hva(&mr, gpa, data_sz, errp);
$
Should the method be moved
out of monitor/hmp-cmds.c somewhere into system/ and documented
(likely in system/physmem.c, also moving the declaration to
"system/memory.h")? Besides some day we should be able to build
without monitor.
Fixes: c7f7e6970d3b ("sev: add sev-inject-launch-secret")
Signed-off-by: Marc-André Lureau <[email protected]>