ACRN:DM: Add one API to query the memfd/offset for the given GPA

After using the memfd to allocate memory for guest vm, it needs to
query the offset in memfd for the given GPA. In order to search the
memfd/offset, the added memory_region from memfd needs to be kept in
one arrary.

Tracked-On: #7210

Acked-by: Wang Yu <yu1.wang@intel.com>
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
This commit is contained in:
Zhao Yakui
2022-04-01 10:56:47 +08:00
committed by acrnsi-robot
parent a46b0058d8
commit 3645a9557d
2 changed files with 58 additions and 0 deletions

View File

@@ -89,6 +89,12 @@ struct vm_isa_irq {
int ioapic_irq;
};
struct vm_mem_region {
uint64_t fd_offset;
int fd;
};
bool vm_find_memfd_region(struct vmctx *ctx, vm_paddr_t gpa,
struct vm_mem_region *ret_region);
/*
* Create a device memory segment identified by 'segid'.
*