diff mbox series

[kvm-unit-tests,2/8] s390x: uv-host: Check for sufficient amount of memory

Message ID 20230323103913.40720-3-frankja@linux.ibm.com (mailing list archive)
State New, archived
Headers show
Series s390x: uv-host: Fixups and extensions part 1 | expand

Commit Message

Janosch Frank March 23, 2023, 10:39 a.m. UTC
The UV init storage needs to be above 2G so we need a little over 2G
of memory when running the test.

Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
---
 s390x/uv-host.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

Comments

Nico Boehr March 23, 2023, 12:31 p.m. UTC | #1
Quoting Janosch Frank (2023-03-23 11:39:07)
> The UV init storage needs to be above 2G so we need a little over 2G
> of memory when running the test.
> 
> Signed-off-by: Janosch Frank <frankja@linux.ibm.com>

Reviewed-by: Nico Boehr <nrb@linux.ibm.com>
diff mbox series

Patch

diff --git a/s390x/uv-host.c b/s390x/uv-host.c
index 68de47e7..e38a9913 100644
--- a/s390x/uv-host.c
+++ b/s390x/uv-host.c
@@ -715,6 +715,17 @@  int main(void)
 	test_invalid();
 	test_uv_uninitialized();
 	test_query();
+
+	/*
+	 * Some of the UV memory needs to be allocated with >31 bit
+	 * addresses which means we need a lot more memory than other
+	 * tests.
+	 */
+	if (get_ram_size() < (SZ_1M * 2200UL)) {
+		report_skip("Not enough memory. This test needs about 2200MB of memory");
+		goto done;
+	}
+
 	test_init();
 
 	setup_vmem();