From patchwork Mon Jan 28 11:05:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shameerali Kolothum Thodi X-Patchwork-Id: 10783589 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1975B6C2 for ; Mon, 28 Jan 2019 11:08:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0A9782A763 for ; Mon, 28 Jan 2019 11:08:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F2EA42A76C; Mon, 28 Jan 2019 11:08:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6B2352A708 for ; Mon, 28 Jan 2019 11:08:42 +0000 (UTC) Received: from localhost ([127.0.0.1]:57937 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1go4mP-0004ye-IJ for patchwork-qemu-devel@patchwork.kernel.org; Mon, 28 Jan 2019 06:08:41 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56060) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1go4km-0003fk-4X for qemu-devel@nongnu.org; Mon, 28 Jan 2019 06:07:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1go4ki-00044P-HH for qemu-devel@nongnu.org; Mon, 28 Jan 2019 06:06:58 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:2237 helo=huawei.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1go4kf-00042l-UK; Mon, 28 Jan 2019 06:06:54 -0500 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id AAB8B905E925BDFD9B86; Mon, 28 Jan 2019 19:06:48 +0800 (CST) Received: from S00345302A-PC.china.huawei.com (10.202.227.237) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.408.0; Mon, 28 Jan 2019 19:06:40 +0800 From: Shameer Kolothum To: , , , , , Date: Mon, 28 Jan 2019 11:05:42 +0000 Message-ID: <20190128110545.20644-1-shameerali.kolothum.thodi@huawei.com> X-Mailer: git-send-email 2.12.0.windows.1 MIME-Version: 1.0 X-Originating-IP: [10.202.227.237] X-CFilter-Loop: Reflected X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 45.249.212.191 Subject: [Qemu-devel] [RFC PATCH 0/4] ARM virt: ACPI memory hotplug support X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linuxarm@huawei.com, xuwei5@huawei.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP This series is an attempt to provide hotplug support to both pc-dimm and nvdimm device memory on ARM virt platform. This is based on Eric's recent works to support PCDIMM/NVDIMM device memory[1]. The kernel support for arm64 memory hot add was added only recently by Robin[2] and hence the guest kernel should be => 5.0-rc1. This makes use of PL061 GPIO controller to sent related ACPI events to the Guest. The only reference I could find with respect to the GPIO pins usage is here[3] which says, "use PIN 3 for system_powerdown, reserving PIN 0, 1, 2 for PCI hotplug, CPU hotplug and memory hotplug". Hence Pin 2 is used for PCDIMM and pin 4 for NVDIMM. This is sanity tested on a HiSilicon ARM64 platform and appreciate any further testing. This series can be applied on top of Eric's branch here[4] Test: ------ Please use a Guest kernel image >5.0-rc1 with all the mem/nvdimm hotplug related CONFIGs enabled. ./qemu-system-aarch64 \ -machine virt,gic-version=3,nvdimm \ -m 1G,maxmem=4G,slots=4 \ -cpu host \ -kernel Image \ -initrd rootfs-iperf.cpio \ -bios QEMU_EFI.fd \ -numa node,nodeid=0 \ -net none \ -nographic -enable-kvm \ -append "console=ttyAMA0 acpi=force earlycon=pl011,0x9000000" Enter Qemu monitor, Add pc-dimm: object_add memory-backend-ram,id=mem1,size=1G device_add pc-dimm,id=dimm1,memdev=mem1 Add nvdimm: object_add memory-backend-ram,id=mem2,size=1G device_add nvdimm,id=dimm2,memdev=mem2 Known Issue: It is observed that hot adding nvdimm will results in guest reboot failure. EDK2 fails to build the ACPI tables on reboot. Please find below EDK2 log on Guest reboot after nvdimm hot-add, ProcessCmdAddChecksum: invalid checksum range in "etc/acpi/tables" OnRootBridgesConnected: InstallAcpiTables: Protocol Error The root cause seems to be EDK2 ACPI table checksum failure as NFIT table is getting updated on hot-add. This needs further investigation. Thanks, Shameer [1]https://lists.gnu.org/archive/html/qemu-devel/2019-01/msg05740.html [2]https://patchwork.kernel.org/patch/10724455/ [3]https://lists.gnu.org/archive/html/qemu-arm/2015-12/msg00095.html [4]https://github.com/eauger/qemu/tree/v3.1.0-dimm-v5 Shameer Kolothum (4): hw:acpi: Make ACPI IO address space configurable hw/arm/virt: Add GPIO based pcdimm hotplug ACPI event support hw/arm/virt: Enable pc-dimm hotplug support hw/arm/virt: Add nvdimm hotplug support default-configs/arm-softmmu.mak | 1 + hw/acpi/memory_hotplug.c | 13 +++-- hw/arm/virt-acpi-build.c | 45 +++++++++++++++-- hw/arm/virt.c | 105 ++++++++++++++++++++++++++++++++++++--- hw/i386/acpi-build.c | 3 +- include/hw/acpi/memory_hotplug.h | 6 ++- include/hw/arm/virt.h | 15 ++++++ 7 files changed, 168 insertions(+), 20 deletions(-)