Fix nvmm_ram_block_added() function arguments
A parameter max_size was added to the RAMBlockNotifier ram_block_added function. Use the max_size for pre allocation of hva space. Signed-off-by: Reinoud Zandijk <Reinoud@NetBSD.org> Message-Id: <20210718134650.1191-3-reinoud@NetBSD.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
5fd0711b85
commit
8d4cd3dd8b
@ -1132,13 +1132,14 @@ static MemoryListener nvmm_memory_listener = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nvmm_ram_block_added(RAMBlockNotifier *n, void *host, size_t size)
|
nvmm_ram_block_added(RAMBlockNotifier *n, void *host, size_t size,
|
||||||
|
size_t max_size)
|
||||||
{
|
{
|
||||||
struct nvmm_machine *mach = get_nvmm_mach();
|
struct nvmm_machine *mach = get_nvmm_mach();
|
||||||
uintptr_t hva = (uintptr_t)host;
|
uintptr_t hva = (uintptr_t)host;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = nvmm_hva_map(mach, hva, size);
|
ret = nvmm_hva_map(mach, hva, max_size);
|
||||||
|
|
||||||
if (ret == -1) {
|
if (ret == -1) {
|
||||||
error_report("NVMM: Failed to map HVA, HostVA:%p "
|
error_report("NVMM: Failed to map HVA, HostVA:%p "
|
||||||
|
Loading…
Reference in New Issue
Block a user