Skip to content

Commit

Permalink
qemu: fix invalid memmap when max IPA size unknown
Browse files Browse the repository at this point in the history
  • Loading branch information
osy committed Dec 23, 2024
1 parent 6853b2c commit 6b9d08c
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions patches/qemu-9.1.2-utm.patch
Original file line number Diff line number Diff line change
Expand Up @@ -1123,3 +1123,36 @@ index a63a7763a0..141fd35300 100644
--
2.41.0

From 6aca8e564507533c53258abf08c0d283ccb207b7 Mon Sep 17 00:00:00 2001
From: Joelle van Dyne <[email protected]>
Date: Mon, 23 Dec 2024 00:15:08 -0800
Subject: [PATCH v3 3/3] hw/arm/virt: handle hvf with unknown max IPA size

When it is not possible to determine the max IPA bit size, the helper
function will return 0. We do not try to set up the memmap in this case
and instead fall back to the default in machvirt_init().

Signed-off-by: Joelle van Dyne <[email protected]>
---
hw/arm/virt.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index f9b3380815..8c431e24b3 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -3053,6 +3053,11 @@ static int virt_hvf_get_physical_address_range(MachineState *ms)
int default_ipa_size = hvf_arm_get_default_ipa_bit_size();
int max_ipa_size = hvf_arm_get_max_ipa_bit_size();

+ /* Unknown max ipa size, we'll let the caller figure it out */
+ if (max_ipa_size == 0) {
+ return 0;
+ }
+
/* We freeze the memory map to compute the highest gpa */
virt_set_memmap(vms, max_ipa_size);

--
2.41.0

0 comments on commit 6b9d08c

Please sign in to comment.