-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
qemu: fix invalid memmap when max IPA size unknown
- Loading branch information
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|