From 8f8d7e6add1a4223116371d0d6d5ee4610e84b53 Mon Sep 17 00:00:00 2001 From: zhenyzha Date: Tue, 15 Aug 2023 10:55:20 +0800 Subject: [PATCH] hotplug_mem_repeat:Update size_mem acquisition method for aarch64 For the arm platform, there are two smallest mem block sizes. Section size must be at least 128MB for 4K and 16k base page size config. Section size must be at least 512MB for 64K base Update the block size mem acquisition method by the current guest base page size. Signed-off-by: zhenyzha --- qemu/tests/cfg/hotplug_memory_repeat.cfg | 9 ++++++++- qemu/tests/hotplug_mem_repeat.py | 8 +++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/qemu/tests/cfg/hotplug_memory_repeat.cfg b/qemu/tests/cfg/hotplug_memory_repeat.cfg index 1995c683a3..cc66358140 100644 --- a/qemu/tests/cfg/hotplug_memory_repeat.cfg +++ b/qemu/tests/cfg/hotplug_memory_repeat.cfg @@ -9,7 +9,7 @@ no WinXP Win2000 Win2003 WinVista slots_mem = 256 mem_fixed = 4096 - x86_64: + aarch64,x86_64: mem_fixed = 8192 size_mem = 128M maxmem_mem = 40G @@ -24,6 +24,13 @@ maxmem_mem = 70G backend_mem = memory-backend-ram repeat_times = 256 + aarch64: + # Section size must be at least 128MB for 4K and 16k base + # page size config. + # Section size must be at least 512MB for 64K base + get_basic_page = "getconf PAGE_SIZE" + size_mem_64k = 512M + maxmem_mem = 140G variants test_type: - repeat_256: only Linux diff --git a/qemu/tests/hotplug_mem_repeat.py b/qemu/tests/hotplug_mem_repeat.py index 7ca0cfbd9a..6f78a6f7c8 100644 --- a/qemu/tests/hotplug_mem_repeat.py +++ b/qemu/tests/hotplug_mem_repeat.py @@ -2,6 +2,7 @@ from virttest import error_context from virttest import utils_test + from virttest.utils_test.qemu import MemoryHotplugTest LOG_JOB = logging.getLogger('avocado.test') @@ -35,12 +36,17 @@ def start_test(self): memory 256 times, then unplug 256 times. Otherwise, repeat hotplug and unplug in turn for 256 times. This is test entry. """ - times = int(self.params["repeat_times"]) + times = self.params.get_numeric("repeat_times", int) target_mems = [] for i in range(times): target_mems.append("mem%s" % i) vm = self.env.get_vm(self.params["main_vm"]) session = vm.wait_for_login() + if self.params.get("vm_arch_name", "") == "aarch64": + self.test.log.info("Check basic page size on guest.") + get_basic_page = self.params.get("get_basic_page") + if session.cmd(get_basic_page).strip() == '65536': + self.params['size_mem'] = self.params.get("size_mem_64k") if self.params.get_boolean("mem_unplug_test", False): arg = "movable_node" utils_test.update_boot_option(vm, args_added=arg)