[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <84c57893-b652-8818-464d-c9b3ae58f3a1@huawei.com>
Date: Sat, 29 Jun 2019 11:23:47 +0800
From: Xiongfeng Wang <wangxiongfeng2@...wei.com>
To: <rjw@...ysocki.net>, <catalin.marinas@....com>,
<james.morse@....com>
CC: <linux-acpi@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>, <guohanjun@...wei.com>,
<xiexiuqi@...wei.com>, <huawei.libin@...wei.com>,
<john.garry@...wei.com>, <jonathan.cameron@...wei.com>
Subject: Re: [RFC PATCH v2 0/3] Support CPU hotplug for ARM64
My test process is as follows:
1. Use the following command to boot a Guest OS with 8 CPUs
qemu-system-aarch64 -machine virt -cpu cortex-a57 -machine type=virt \
-nographic -m 2048 -smp cpus=8,sockets=2,cores=4 \
-numa node,mem=1024,cpus=0-3 -numa node,mem=1024,cpus=4-7 \
-kernel $IMAGE_FILE -bios /home/wxf/QEMU_EFI.fd \
--initrd $INITRDFS_FILE \
--append "root=/dev/ram rdinit=/linuxrc earlycon=pl011,0x9000000 acpi.debug_layer=0xffffffff acpi.debug_level=0x2" \
--fsdev local,id=kmod_dev,path=$VIRFS,security_model=none \
-device virtio-9p-device,fsdev=kmod_dev,mount_tag=kmod_mount
2. Extract the ACPI table DSDT and APIC. Mark CPU6 as disabled in APIC.
Add '_STA' and '_EJ0' method for CPU6 in DSDT.
Modified tables are attached as attachment. I referred to the following two
documents to override the ACPI tables.
Documentation/admin-guide/acpi/initrd_table_override.rst
Documentation/admin-guide/acpi/dsdt-override.rst
3. Add a procfs interface to sent a event to a namespace node in DSDT.
It is used to emulate the SCI interrupt. It is based on https://lwn.net/Articles/84089/
The patch is attached.
4. Use the following commands to test hot-add and hot-remove
a. echo "C006 1" > /proc/acpi/sci/notify
b. echo 1 > /sys/devices/system/cpu/cpu6/online
c. use 'taskset' to run an application on CPU6
d. echo 0 > /sys/devices/system/cpu/cpu6/online
e. echo "C006 3" > /proc/acpi/sci/notify
Thanks,
Xiongfeng Wang
On 2019/6/29 10:42, Xiongfeng Wang wrote:
> This patchset mark all the GICC node in MADT as possible CPUs even though it
> is disabled. But only those enabled GICC node are marked as present CPUs.
> So that kernel will initialize some CPU related data structure in advance before
> the CPU is actually hot added into the system. This patchset also implement
> 'acpi_(un)map_cpu()' and 'arch_(un)register_cpu()' for ARM64. These functions are
> needed to enable CPU hotplug.
>
> To support CPU hotplug, we need to add all the possible GICC node in MADT
> including those CPUs that are not present but may be hot added later. Those
> CPUs are marked as disabled in GICC nodes.
>
> Changelog:
>
> v1 -> v2:
> rebase the thrid patch to the lastest kernel
>
> Xiongfeng Wang (3):
> ACPI / scan: evaluate _STA for processors declared via ASL Device
> statement
> arm64: mark all the GICC nodes in MADT as possible cpu
> arm64: Add CPU hotplug support
>
> arch/arm64/kernel/acpi.c | 22 ++++++++++++++++++++++
> arch/arm64/kernel/setup.c | 19 ++++++++++++++++++-
> arch/arm64/kernel/smp.c | 11 +++++------
> drivers/acpi/scan.c | 12 ++++++++++++
> 4 files changed, 57 insertions(+), 7 deletions(-)
>
View attachment "0001-SCI-interrupt-emulation.patch" of type "text/plain" (6090 bytes)
View attachment "APIC.dsl" of type "text/plain" (15266 bytes)
View attachment "DSDT.dsl" of type "text/plain" (224951 bytes)
Powered by blists - more mailing lists