This series is an attempt to provide device memory hotplug support on ARM virt platform. This is based on Eric's recent works here[1] and carries some of the pc-dimm related patches dropped from his series. The kernel support for arm64 memory hot add was added recently by Robin and hence the guest kernel should be => 5.0-rc1. NVDIM support is not included currently as we still have an unresolved issue while hot adding NVDIMM[2]. However NVDIMM cold plug patches can be included, but not done for now, for keeping it simple. This makes use of GED device to sent hotplug ACPI events to the Guest. GED code is based on Nemu. Thanks to the efforts of Samuel and Sebastien to add the hardware-reduced support to Nemu using GED device[3]. (Please shout if I got the author/signed-off wrong for those patches or missed any names). This is sanity tested on a HiSilicon ARM64 platform and appreciate any further testing. Note: Attempted adding dimm_pxm test case to bios-tables-test for arm/virt. But noticed the issue decribed here[5]. This is under investigation now. upstream url: https://patchwork.kernel.org/cover/11150345/ Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
87 lines
2.9 KiB
Diff
87 lines
2.9 KiB
Diff
From abbcc35ccb22d81d69a28dc66b5f5d94e673a25e Mon Sep 17 00:00:00 2001
|
|
From: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>
|
|
Date: Wed, 18 Sep 2019 14:06:33 +0100
|
|
Subject: [PATCH] tests: Add bios tests to arm/virt
|
|
|
|
This adds numamem and memhp tests for arm/virt platform.
|
|
|
|
Signed-off-by: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>
|
|
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
|
|
Message-Id: <20190918130633.4872-12-shameerali.kolothum.thodi@huawei.com>
|
|
Acked-by: Peter Maydell <peter.maydell@linaro.org>
|
|
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
|
|
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
|
|
---
|
|
tests/bios-tables-test.c | 49 ++++++++++++++++++++++++++++++++++++++++
|
|
1 file changed, 49 insertions(+)
|
|
|
|
diff --git a/tests/bios-tables-test.c b/tests/bios-tables-test.c
|
|
index 53a91a8067..5e177b7155 100644
|
|
--- a/tests/bios-tables-test.c
|
|
+++ b/tests/bios-tables-test.c
|
|
@@ -874,6 +874,53 @@ static void test_acpi_piix4_tcg_dimm_pxm(void)
|
|
test_acpi_tcg_dimm_pxm(MACHINE_PC);
|
|
}
|
|
|
|
+static void test_acpi_virt_tcg_memhp(void)
|
|
+{
|
|
+ test_data data = {
|
|
+ .machine = "virt",
|
|
+ .accel = "tcg",
|
|
+ .uefi_fl1 = "pc-bios/edk2-aarch64-code.fd",
|
|
+ .uefi_fl2 = "pc-bios/edk2-arm-vars.fd",
|
|
+ .cd = "tests/data/uefi-boot-images/bios-tables-test.aarch64.iso.qcow2",
|
|
+ .ram_start = 0x40000000ULL,
|
|
+ .scan_len = 256ULL * 1024 * 1024,
|
|
+ };
|
|
+
|
|
+ data.variant = ".memhp";
|
|
+ test_acpi_one(" -cpu cortex-a57"
|
|
+ " -m 256M,slots=3,maxmem=1G"
|
|
+ " -object memory-backend-ram,id=ram0,size=128M"
|
|
+ " -object memory-backend-ram,id=ram1,size=128M"
|
|
+ " -numa node,memdev=ram0 -numa node,memdev=ram1"
|
|
+ " -numa dist,src=0,dst=1,val=21",
|
|
+ &data);
|
|
+
|
|
+ free_test_data(&data);
|
|
+
|
|
+}
|
|
+
|
|
+static void test_acpi_virt_tcg_numamem(void)
|
|
+{
|
|
+ test_data data = {
|
|
+ .machine = "virt",
|
|
+ .accel = "tcg",
|
|
+ .uefi_fl1 = "pc-bios/edk2-aarch64-code.fd",
|
|
+ .uefi_fl2 = "pc-bios/edk2-arm-vars.fd",
|
|
+ .cd = "tests/data/uefi-boot-images/bios-tables-test.aarch64.iso.qcow2",
|
|
+ .ram_start = 0x40000000ULL,
|
|
+ .scan_len = 128ULL * 1024 * 1024,
|
|
+ };
|
|
+
|
|
+ data.variant = ".numamem";
|
|
+ test_acpi_one(" -cpu cortex-a57"
|
|
+ " -object memory-backend-ram,id=ram0,size=128M"
|
|
+ " -numa node,memdev=ram0",
|
|
+ &data);
|
|
+
|
|
+ free_test_data(&data);
|
|
+
|
|
+}
|
|
+
|
|
static void test_acpi_virt_tcg(void)
|
|
{
|
|
test_data data = {
|
|
@@ -920,6 +967,8 @@ int main(int argc, char *argv[])
|
|
qtest_add_func("acpi/q35/dimmpxm", test_acpi_q35_tcg_dimm_pxm);
|
|
} else if (strcmp(arch, "aarch64") == 0) {
|
|
qtest_add_func("acpi/virt", test_acpi_virt_tcg);
|
|
+ qtest_add_func("acpi/virt/numamem", test_acpi_virt_tcg_numamem);
|
|
+ qtest_add_func("acpi/virt/memhp", test_acpi_virt_tcg_memhp);
|
|
}
|
|
ret = g_test_run();
|
|
boot_sector_cleanup(disk);
|
|
--
|
|
2.19.1
|