diff mbox series

[kvm-unit-tests,v2,2/2] s390x: uv-host: fix allocation of UV memory

Message ID 20221020123143.213778-3-imbrenda@linux.ibm.com (mailing list archive)
State New, archived
Headers show
Series s390x misc fixes | expand

Commit Message

Claudio Imbrenda Oct. 20, 2022, 12:31 p.m. UTC
Allocate the donated storage with 1M alignment from the normal pool, to
force it to be above 2G without wasting a whole 2G block of memory.

Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Reviewed-by: Janosch Frank <frankja@linux.ibm.com>
Reviewed-by; Steffen Eiden <seiden@linux.ibm.com>
---
 s390x/uv-host.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/s390x/uv-host.c b/s390x/uv-host.c
index a1a6d120..e1fc0213 100644
--- a/s390x/uv-host.c
+++ b/s390x/uv-host.c
@@ -329,7 +329,7 @@  static void test_init(void)
 	struct psw psw;
 
 	/* Donated storage needs to be over 2GB */
-	mem = (uint64_t)memalign(1UL << 31, uvcb_qui.uv_base_stor_len);
+	mem = (uint64_t)memalign_pages_flags(SZ_1M, uvcb_qui.uv_base_stor_len, AREA_NORMAL);
 
 	uvcb_init.header.len = sizeof(uvcb_init);
 	uvcb_init.header.cmd = UVC_CMD_INIT_UV;