Received: by 2002:a17:907:d504:b0:9b2:89ee:1eb8 with SMTP id wb4csp3221641ejc; Fri, 29 Sep 2023 05:45:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE5el29pM6j092ZjcNpHmFJNz1PiFuoQ4fIcK4rMkNSwy0g/ft5vi2U7DoNMHXthfQbilDJ X-Received: by 2002:a7b:cd18:0:b0:402:906:1e87 with SMTP id f24-20020a7bcd18000000b0040209061e87mr3732524wmj.31.1695991551902; Fri, 29 Sep 2023 05:45:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695991551; cv=none; d=google.com; s=arc-20160816; b=iv1cKwK2yVYTq/QbK/KJ8Y4DqVcD4goi6RdLwaW1r5QIaLJym90wgbuBk+416s8SLT xqCzVREfLgFB1dpdQCJ13B6VTYvxXx4pFB+6UsVbRgm28lhszQ8HdWFQ9w/OGe/0P0xP +GDA+xP4dmBTyYhI7bVlFWz/T3S8QIxwtColOjoI+noIDughOF+LSFz3rGajUX7YrrsA JHWRPUgQ/R/s7a3MxItYZhfeMZViBm9iPcoInWxCLyfvJTPGKFq30UsSZ7etiiVfvaXs BThAa2Jao/fegeRBYMVK2Gf1jec6J7pb7jyv4tPnJNWRbW0hDJX4IQskhJiY9eBTaB2f 4t3w== 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=skqEF02oIUjd6jS0L+UMyBoCEj3yWjk8RN2xWtJA4/s=; fh=I+6CS2uJqPEgP3gz8gmk6tLbm1jsmO9tblK+QTjWHxs=; b=S1R48rcdjbogfQzj4BB8qAgexdzoQf6RnrH0gObq4xU8YCXBvYtng2V2C9wS5boYc3 65ab0HGK9BjjoywjM1DqRMw7O3GtQYUcs9dbUws8gfy5Ug2n1eqvR5uz8W76OinyTo6g N06pCtzyH246YlZ/Gvag7OrxzNBEe22hYSYelA39eX3dfhvUIVpFljU7YG4oyAQ07eW9 dxfag0kNpVpjmNgoe6aIVCzpTZ7tycJoluNUpK9L5Ddt34XWGGbk5rcUjXwDuuFH5pvx +PhSYkcdVOLvfmrREVHUmuhZgCaFV4aY1oVA3IZhhQWWdf5PMiVi6bGXGPFu5f1KH4mY ORmw== 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 k22-20020a5d5256000000b003232671356dsi6148407wrc.639.2023.09.29.05.45.51 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 Sep 2023 05:45:51 -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 4Rxqp26XBHz6883t; Fri, 29 Sep 2023 20:45:46 +0800 (CST) Received: from A190218597.china.huawei.com (10.48.156.153) 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, 29 Sep 2023 13:45:32 +0100 From: Salil Mehta To: , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH 4/9] hw/acpi: Init GED framework with cpu hotplug events Date: Fri, 29 Sep 2023 13:42:59 +0100 Message-ID: <20230929124304.13672-5-salil.mehta@huawei.com> X-Mailer: git-send-email 2.8.3 In-Reply-To: <20230929124304.13672-1-salil.mehta@huawei.com> References: <20230929124304.13672-1-salil.mehta@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.48.156.153] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To lhrpeml500001.china.huawei.com (7.191.163.213) X-CFilter-Loop: Reflected X-TUID: zZCb2n8X2ssv 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 --- 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 d831bbd889..d0a5a43abf 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" @@ -97,6 +98,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; @@ -108,6 +110,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