Skip to contentSkip to conversation

xen/balloon: fix balloon initialization for PVH Dom0

PATCH Applied Roger Pau Monne 3 participants 5 messages Aug 8, 2018 Xen hypervisor interface

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen/balloon: fix balloon initialization for PVH Dom0

The current balloon code tries to calculate a delta factor for the balloon target when running in HVM mode in order to account for memory used by the firmware.

This workaround for memory accounting doesn't work properly on a PVH Dom0, that has a static-max value different from the target value even at startup. Note that this is not a problem for DomUs because guests are started with a static-max value that matches the amount of RAM in the memory map.

Fix this by forcefully setting target_diff for Dom0, regardless of it's mode.

---
Cc: Gabriel Ercarug <[email protected]>
Cc: Boris Ostrovsky <[email protected]>
Cc: Juergen Gross <[email protected]>
Cc: [email protected]

---
 drivers/xen/xen-balloon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/xen/xen-balloon.c +1 -1
index b437fccd4e62..294f35ce9e46 100644
@@ -81,7 +81,7 @@ static void watch_target(struct xenbus_watch *watch,
 			static_max = new_target;
 		else
 			static_max >>= PAGE_SHIFT - 10;
-		target_diff = xen_pv_domain() ? 0
+		target_diff = (xen_pv_domain() || xen_initial_domain()) ? 0
 				: static_max - balloon_stats.target_pages;
 	}
 
Signature · 1 line
2.18.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Roger Pau Monne

The current balloon code tries to calculate a delta factor for the balloon target when running in HVM mode in order to account for memory used by the firmware.

This workaround for memory accounting doesn't work properly on a PVH Dom0, that has a static-max value different from the target value even at startup. Note that this is not a problem for DomUs because guests are started with a static-max value that matches the amount of RAM in the memory map.

Quoted 5 lines

Fix this by forcefully setting target_diff for Dom0, regardless of it's mode.

Juergen

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

maintainer Reviewed-by on v1 1/1
#2 lore raw
In reply to Roger Pau Monne
Quoted 10 lines · Roger Pau Monne

The current balloon code tries to calculate a delta factor for the balloon target when running in HVM mode in order to account for memory used by the firmware.

This workaround for memory accounting doesn't work properly on a PVH Dom0, that has a static-max value different from the target value even at startup. Note that this is not a problem for DomUs because guests are started with a static-max value that matches the amount of RAM in the memory map.

Quoted 5 lines

Fix this by forcefully setting target_diff for Dom0, regardless of it's mode.

Juergen

#3 lore raw
In reply to Roger Pau Monne
Quoted 10 lines · Roger Pau Monne

The current balloon code tries to calculate a delta factor for the balloon target when running in HVM mode in order to account for memory used by the firmware.

This workaround for memory accounting doesn't work properly on a PVH Dom0, that has a static-max value different from the target value even at startup. Note that this is not a problem for DomUs because guests are started with a static-max value that matches the amount of RAM in the memory map.

Quoted 6 lines

Fix this by forcefully setting target_diff for Dom0, regardless of it's mode.

Applied to for-linus-4.19

-boris

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#4 lore raw
In reply to Roger Pau Monne
Quoted 10 lines · Roger Pau Monne

The current balloon code tries to calculate a delta factor for the balloon target when running in HVM mode in order to account for memory used by the firmware.

This workaround for memory accounting doesn't work properly on a PVH Dom0, that has a static-max value different from the target value even at startup. Note that this is not a problem for DomUs because guests are started with a static-max value that matches the amount of RAM in the memory map.

Quoted 6 lines

Fix this by forcefully setting target_diff for Dom0, regardless of it's mode.

Applied to for-linus-4.19

-boris