Received: by 2002:a17:907:8744:b0:9bd:85f7:2662 with SMTP id qo4csp1415620ejc; Fri, 13 Oct 2023 03:53:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE6LSW4M+HVcCsVG48QEjYBKCjguQdsZEpBzj4s44jB6hnwDZGIyFur4P5baRvrTDjpekz4 X-Received: by 2002:a05:6808:3d8:b0:3a1:e17a:b3fb with SMTP id o24-20020a05680803d800b003a1e17ab3fbmr26959472oie.1.1697194403220; Fri, 13 Oct 2023 03:53:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697194403; cv=none; d=google.com; s=arc-20160816; b=k/Y6VqeOD4J4DCBwiiR2f4mDC2qsmgTrPFlM2+n0okGxMu5OkBDPLHEMuqAiKvJO6M Bvj6GmwYykEz1lstKikn6qB+Rr5IWSlI7ICcr8EVdeFUyqyFE7ztdrZ43ALPAyT89DYG lN1BimYdmwY/Q4T6ZeADHXfVy7mgNgTVi6T8afiHHhy8wOTZ0nXm9bG2hD1XwhGhpe/p vDbtJL7pCDBeE1qfog9CX6uB4d5nk/7js9DKt3NhUlznHpBmRkntG3IHXMKnmzuza5MI +6ObpLZdS87DG6oNN72eaRpL4z0NXV9fleQAWcsPNgxTG8FJftxMr0n25Ehehs8UitZD Aaew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=4qEZfOsawVW85TDoPoac5dHuZzFwiGKgtz3g3x8F/KI=; fh=I+6CS2uJqPEgP3gz8gmk6tLbm1jsmO9tblK+QTjWHxs=; b=R4XQCG+rlfAqixLHkwN/s07QOK6PujYA5dbVLXqQ0etcxVbJ4NYkgZkSvqM5vgaE6J bN+kCCw8AQIuX9SbDyamRdWeYghoNx0sz5fIXpRjN9+YJZ+oH36/EXh5v+UePXV8Sx3u ctISFn7JpKCntuf1yemgJuIjb7bKLnQUpybTGCQj0mQJIUAHKLDy62BMBF4/77/5Ba4B giKOQP+7EHrL8E7hrDwMf9DQl5yQSZ6vHCOsTUwssk6OUdy85gvTqToL4Cxbq0nzy/Dt T/pOPC9fyCVwS91Bij7d7w8YYjmYpzghkfjFA5iF9O4t/Vgzfx/3PUIkhz4bLS08WqRG JEHw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of salil.mehta@huawei.com designates 185.176.79.56 as permitted sender) smtp.mailfrom=salil.mehta@huawei.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from frasgout.his.huawei.com (frasgout.his.huawei.com. [185.176.79.56]) by mx.google.com with ESMTPS id o4-20020a656a44000000b005aad5164a45si1486573pgu.444.2023.10.13.03.53.22 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Oct 2023 03:53:23 -0700 (PDT) Received-SPF: pass (google.com: domain of salil.mehta@huawei.com designates 185.176.79.56 as permitted sender) client-ip=185.176.79.56; Authentication-Results: mx.google.com; spf=pass (google.com: domain of salil.mehta@huawei.com designates 185.176.79.56 as permitted sender) smtp.mailfrom=salil.mehta@huawei.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from lhrpeml500001.china.huawei.com (unknown [172.18.147.226]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4S6NZ96l3Hz6J9hJ; Fri, 13 Oct 2023 18:50:09 +0800 (CST) Received: from A190218597.china.huawei.com (10.195.247.32) by lhrpeml500001.china.huawei.com (7.191.163.213) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Fri, 13 Oct 2023 11:53:02 +0100 From: Salil Mehta To: , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH V6 4/9] hw/acpi: Init GED framework with CPU hotplug events Date: Fri, 13 Oct 2023 11:51:24 +0100 Message-ID: <20231013105129.25648-5-salil.mehta@huawei.com> X-Mailer: git-send-email 2.8.3 In-Reply-To: <20231013105129.25648-1-salil.mehta@huawei.com> References: <20231013105129.25648-1-salil.mehta@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.195.247.32] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To lhrpeml500001.china.huawei.com (7.191.163.213) X-CFilter-Loop: Reflected X-TUID: 9AJhArIec6l7 ACPI GED(as described in the ACPI 6.2 spec) can be used to generate ACPI events when OSPM/guest receives an interrupt listed in the _CRS object of GED. OSPM then maps or demultiplexes the event by evaluating _EVT method. This change adds the support of CPU hotplug event initialization in the existing GED framework. Co-developed-by: Keqian Zhu Signed-off-by: Keqian Zhu Signed-off-by: Salil Mehta Reviewed-by: Jonathan Cameron Reviewed-by: Gavin Shan Reviewed-by: David Hildenbrand Tested-by: Vishnu Pajjuri Tested-by: Xianglai Li --- hw/acpi/generic_event_device.c | 8 ++++++++ include/hw/acpi/generic_event_device.h | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/hw/acpi/generic_event_device.c b/hw/acpi/generic_event_device.c index a3d31631fe..d2fa1d0e4a 100644 --- a/hw/acpi/generic_event_device.c +++ b/hw/acpi/generic_event_device.c @@ -25,6 +25,7 @@ static const uint32_t ged_supported_events[] = { ACPI_GED_MEM_HOTPLUG_EVT, ACPI_GED_PWR_DOWN_EVT, ACPI_GED_NVDIMM_HOTPLUG_EVT, + ACPI_GED_CPU_HOTPLUG_EVT, }; /* @@ -400,6 +401,13 @@ static void acpi_ged_initfn(Object *obj) memory_region_init_io(&ged_st->regs, obj, &ged_regs_ops, ged_st, TYPE_ACPI_GED "-regs", ACPI_GED_REG_COUNT); sysbus_init_mmio(sbd, &ged_st->regs); + + s->cpuhp.device = OBJECT(s); + memory_region_init(&s->container_cpuhp, OBJECT(dev), "cpuhp container", + ACPI_CPU_HOTPLUG_REG_LEN); + sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->container_cpuhp); + cpu_hotplug_hw_init(&s->container_cpuhp, OBJECT(dev), + &s->cpuhp_state, 0); } static void acpi_ged_class_init(ObjectClass *class, void *data) diff --git a/include/hw/acpi/generic_event_device.h b/include/hw/acpi/generic_event_device.h index ba84ce0214..a803ea818e 100644 --- a/include/hw/acpi/generic_event_device.h +++ b/include/hw/acpi/generic_event_device.h @@ -60,6 +60,7 @@ #define HW_ACPI_GENERIC_EVENT_DEVICE_H #include "hw/sysbus.h" +#include "hw/acpi/cpu_hotplug.h" #include "hw/acpi/memory_hotplug.h" #include "hw/acpi/ghes.h" #include "qom/object.h" @@ -95,6 +96,7 @@ OBJECT_DECLARE_SIMPLE_TYPE(AcpiGedState, ACPI_GED) #define ACPI_GED_MEM_HOTPLUG_EVT 0x1 #define ACPI_GED_PWR_DOWN_EVT 0x2 #define ACPI_GED_NVDIMM_HOTPLUG_EVT 0x4 +#define ACPI_GED_CPU_HOTPLUG_EVT 0x8 typedef struct GEDState { MemoryRegion evt; @@ -106,6 +108,9 @@ struct AcpiGedState { SysBusDevice parent_obj; MemHotplugState memhp_state; MemoryRegion container_memhp; + CPUHotplugState cpuhp_state; + MemoryRegion container_cpuhp; + AcpiCpuHotplug cpuhp; GEDState ged_state; uint32_t ged_event_bitmap; qemu_irq irq; -- 2.34.1