forked from kata-containers/kata-containers
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request kata-containers#1888 from yuanzhe-liu0/qemu_align
qemu: align before memory hotplug on arm64
- Loading branch information
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
tools/packaging/qemu/patches/5.1.x/0013-qemu-align-before-memory-hotplug-on-arm64.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,41 @@ | ||
From 0a153bdd2c31932c8357970c8f71f710dbfc7d11 Mon Sep 17 00:00:00 2001 | ||
From: Yuanzhe Liu <[email protected]> | ||
Date: Wed, 19 May 2021 14:17:03 0000 | ||
Subject: [PATCH] qemu: align before memory hotplug on arm64 | ||
|
||
When hotplug memory on arm64 in kata, kernel will shout: | ||
|
||
[ 0.396551] Block size [0x40000000] unaligned hotplug range: start 0xc8000000, size 0x40000000 | ||
[ 0.396556] acpi PNP0C80:01: add_memory failed | ||
[ 0.396834] acpi PNP0C80:01: acpi_memory_enable_device() error | ||
[ 0.396948] acpi PNP0C80:01: Enumeration failure | ||
|
||
It means that kernel will check if the memory range to be hotplugged | ||
align with 1G before plug the memory. So we should twist the qemu to | ||
make sure the memory range align with 1G to pass the kernel check. | ||
|
||
Signed-off-by: Yuanzhe Liu <[email protected]> | ||
--- | ||
hw/arm/virt.c | 5 - | ||
1 file changed, 4 insertions( ), 1 deletion(-) | ||
|
||
diff --git a/hw/arm/virt.c b/hw/arm/virt.c | ||
index 09eb6c06e4..513f191dfe 100644 | ||
--- a/hw/arm/virt.c | ||
b/hw/arm/virt.c | ||
@@ -2217,8 2217,11 @@ static void virt_memory_plug(HotplugHandler *hotplug_dev, | ||
MachineState *ms = MACHINE(hotplug_dev); | ||
bool is_nvdimm = object_dynamic_cast(OBJECT(dev), TYPE_NVDIMM); | ||
Error *local_err = NULL; | ||
PCDIMMDevice *dimm = PC_DIMM(dev); | ||
|
||
- pc_dimm_plug(PC_DIMM(dev), MACHINE(vms), &local_err); | ||
dimm->addr = QEMU_ALIGN_UP(dimm->addr, 0x40000000); | ||
pc_dimm_plug(dimm, MACHINE(vms), &local_err); | ||
if (local_err) { | ||
goto out; | ||
} | ||
-- | ||
2.20.1 | ||
|