From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 406B8C4332F for ; Wed, 8 Nov 2023 10:59:12 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r0gGn-00013F-7Q; Wed, 08 Nov 2023 05:58:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r0gGl-00012q-4Y; Wed, 08 Nov 2023 05:58:47 -0500 Received: from frasgout.his.huawei.com ([185.176.79.56]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r0gGi-0004jP-9j; Wed, 08 Nov 2023 05:58:46 -0500 Received: from lhrpeml500004.china.huawei.com (unknown [172.18.147.206]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4SQMRp5CdBz67XhB; Wed, 8 Nov 2023 18:55:02 +0800 (CST) Received: from lhrpeml500001.china.huawei.com (7.191.163.213) by lhrpeml500004.china.huawei.com (7.191.163.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Wed, 8 Nov 2023 10:58:31 +0000 Received: from lhrpeml500001.china.huawei.com ([7.191.163.213]) by lhrpeml500001.china.huawei.com ([7.191.163.213]) with mapi id 15.01.2507.031; Wed, 8 Nov 2023 10:58:31 +0000 To: Igor Mammedov CC: "qemu-devel@nongnu.org" , "qemu-arm@nongnu.org" , "maz@kernel.org" , "jean-philippe@linaro.org" , Jonathan Cameron , "lpieralisi@kernel.org" , "peter.maydell@linaro.org" , "richard.henderson@linaro.org" , "andrew.jones@linux.dev" , "david@redhat.com" , "philmd@linaro.org" , "eric.auger@redhat.com" , "oliver.upton@linux.dev" , "pbonzini@redhat.com" , "mst@redhat.com" , "will@kernel.org" , "gshan@redhat.com" , "rafael@kernel.org" , "alex.bennee@linaro.org" , "linux@armlinux.org.uk" , "darren@os.amperecomputing.com" , "ilkka@os.amperecomputing.com" , "vishnu@os.amperecomputing.com" , "karl.heubaum@oracle.com" , "miguel.luis@oracle.com" , "salil.mehta@opnsrc.net" , zhukeqian , "wangxiongfeng (C)" , "wangyanan (Y)" , "jiakernel2@gmail.com" , "maobibo@loongson.cn" , "lixianglai@loongson.cn" , Linuxarm Subject: RE: [PATCH V6 7/9] hw/acpi: Update ACPI GED framework to support vCPU Hotplug Thread-Topic: [PATCH V6 7/9] hw/acpi: Update ACPI GED framework to support vCPU Hotplug Thread-Index: AQHZ/cOYufqPrPRhXUanC39HFNBrArBdo9oAgA/gD4A= Date: Wed, 8 Nov 2023 10:58:30 +0000 Message-ID: <950b9f911fb341dca81ceeaeab6c50b3@huawei.com> References: <20231013105129.25648-1-salil.mehta@huawei.com> <20231013105129.25648-8-salil.mehta@huawei.com> <20231027151828.5c9d499b@imammedo.users.ipa.redhat.com> In-Reply-To: <20231027151828.5c9d499b@imammedo.users.ipa.redhat.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.195.245.122] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-CFilter-Loop: Reflected Received-SPF: pass client-ip=185.176.79.56; envelope-from=salil.mehta@huawei.com; helo=frasgout.his.huawei.com X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Salil Mehta From: Salil Mehta via Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Hi Igor, > From: Igor Mammedov > Sent: Friday, October 27, 2023 2:18 PM > To: Salil Mehta > Cc: qemu-devel@nongnu.org; qemu-arm@nongnu.org; maz@kernel.org; jean- > philippe@linaro.org; Jonathan Cameron ; > lpieralisi@kernel.org; peter.maydell@linaro.org; > richard.henderson@linaro.org; andrew.jones@linux.dev; david@redhat.com; > philmd@linaro.org; eric.auger@redhat.com; oliver.upton@linux.dev; > pbonzini@redhat.com; mst@redhat.com; will@kernel.org; gshan@redhat.com; > rafael@kernel.org; alex.bennee@linaro.org; linux@armlinux.org.uk; > darren@os.amperecomputing.com; ilkka@os.amperecomputing.com; > vishnu@os.amperecomputing.com; karl.heubaum@oracle.com; > miguel.luis@oracle.com; salil.mehta@opnsrc.net; zhukeqian > ; wangxiongfeng (C) ; > wangyanan (Y) ; jiakernel2@gmail.com; > maobibo@loongson.cn; lixianglai@loongson.cn; Linuxarm > Subject: Re: [PATCH V6 7/9] hw/acpi: Update ACPI GED framework to support > vCPU Hotplug >=20 > On Fri, 13 Oct 2023 11:51:27 +0100 > Salil Mehta wrote: >=20 > > ACPI GED shall be used to convey to the guest kernel about any CPU hot-= (un)plug > > events. Therefore, existing ACPI GED framework inside QEMU needs to be = enhanced > > to support CPU hotplug state and events. > > >=20 > This is a part of hw wiring which you started to introduce in 4/9 > Given patches are small, I'd merge this into 4/9 to avoid broken context. > So essentially GED improvement would consist from hw and aml parts. > with some extra refactoring (5/9) in a separate patch. No issues. Will merge. Thanks Salil. > > Co-developed-by: Keqian Zhu > > Signed-off-by: Keqian Zhu > > Signed-off-by: Salil Mehta > > Reviewed-by: Jonathan Cameron > > Reviewed-by: Gavin Shan > > Tested-by: Vishnu Pajjuri > > Tested-by: Xianglai Li > > --- > > hw/acpi/generic_event_device.c | 10 ++++++++++ > > 1 file changed, 10 insertions(+) > > > > diff --git a/hw/acpi/generic_event_device.c b/hw/acpi/generic_event_dev= ice.c > > index 62d504d231..0d5f0140e5 100644 > > --- a/hw/acpi/generic_event_device.c > > +++ b/hw/acpi/generic_event_device.c > > @@ -12,6 +12,7 @@ > > #include "qemu/osdep.h" > > #include "qapi/error.h" > > #include "hw/acpi/acpi.h" > > +#include "hw/acpi/cpu.h" > > #include "hw/acpi/generic_event_device.h" > > #include "hw/irq.h" > > #include "hw/mem/pc-dimm.h" > > @@ -239,6 +240,8 @@ static void acpi_ged_device_plug_cb(HotplugHandler = *hotplug_dev, > > } else { > > acpi_memory_plug_cb(hotplug_dev, &s->memhp_state, dev, err= p); > > } > > + } else if (object_dynamic_cast(OBJECT(dev), TYPE_CPU)) { > > + acpi_cpu_plug_cb(hotplug_dev, &s->cpuhp_state, dev, errp); > > } else { > > error_setg(errp, "virt: device plug request for unsupported de= vice" > > " type: %s", object_get_typename(OBJECT(dev))); > > @@ -253,6 +256,8 @@ static void acpi_ged_unplug_request_cb(HotplugHandl= er *hotplug_dev, > > if ((object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM) && > > !(object_dynamic_cast(OBJECT(dev), TYPE_NVDIMM)= ))) { > > acpi_memory_unplug_request_cb(hotplug_dev, &s->memhp_state, de= v, errp); > > + } else if (object_dynamic_cast(OBJECT(dev), TYPE_CPU)) { > > + acpi_cpu_unplug_request_cb(hotplug_dev, &s->cpuhp_state, dev, = errp); > > } else { > > error_setg(errp, "acpi: device unplug request for unsupported = device" > > " type: %s", object_get_typename(OBJECT(dev))); > > @@ -266,6 +271,8 @@ static void acpi_ged_unplug_cb(HotplugHandler *hotp= lug_dev, > > > > if (object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM)) { > > acpi_memory_unplug_cb(&s->memhp_state, dev, errp); > > + } else if (object_dynamic_cast(OBJECT(dev), TYPE_CPU)) { > > + acpi_cpu_unplug_cb(&s->cpuhp_state, dev, errp); > > } else { > > error_setg(errp, "acpi: device unplug for unsupported device" > > " type: %s", object_get_typename(OBJECT(dev))); > > @@ -277,6 +284,7 @@ static void acpi_ged_ospm_status(AcpiDeviceIf *adev= , ACPIOSTInfoList ***list) > > AcpiGedState *s =3D ACPI_GED(adev); > > > > acpi_memory_ospm_status(&s->memhp_state, list); > > + acpi_cpu_ospm_status(&s->cpuhp_state, list); > > } > > > > static void acpi_ged_send_event(AcpiDeviceIf *adev, AcpiEventStatusBit= s ev) > > @@ -291,6 +299,8 @@ static void acpi_ged_send_event(AcpiDeviceIf *adev,= AcpiEventStatusBits ev) > > sel =3D ACPI_GED_PWR_DOWN_EVT; > > } else if (ev & ACPI_NVDIMM_HOTPLUG_STATUS) { > > sel =3D ACPI_GED_NVDIMM_HOTPLUG_EVT; > > + } else if (ev & ACPI_CPU_HOTPLUG_STATUS) { > > + sel =3D ACPI_GED_CPU_HOTPLUG_EVT; > > } else { > > /* Unknown event. Return without generating interrupt. */ > > warn_report("GED: Unsupported event %d. No irq injected", ev);