From patchwork Sat Jun 13 21:36:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 187897 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp1521478ilo; Sat, 13 Jun 2020 14:48:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwqHD1bh7/BN73lWY6TPzrnwrZYna5P3jFS6xNn39I6M/s4Kx6jgDOVJi2NtyLh51Tfvvlh X-Received: by 2002:a25:bc47:: with SMTP id d7mr32968321ybk.180.1592084892847; Sat, 13 Jun 2020 14:48:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592084892; cv=none; d=google.com; s=arc-20160816; b=V0LNFWzaTA6UnMjwt8Epm9FAlY/hNMqPc3LtkHJEMIB6Ylzv+duZSGmVpX9txmOh6C axOPke2HoXKS9rBRv2QMQp303EKP5ddOhElcCrOsN+lsOGKN1whaUKk7zmSKrEpfjPEv k0UogZ2NnD+YfO/+3S9c+knjdEcf0mO/TZ/VWTiy7i0sXX6TsnszZM9WIkHxc61UjiyG pD+evjJ7vLeCU0HFgoZprEUkXoIb8sPgA9JvJWmLtNJ8aD+NGrrE0beiExmnD+PCu63U e8NKd9rZuBbNlWUze5BSKhfEJaE7evePsbUf9nnG4azI2xUAtaHiW2Wn0QNZ96AON65d mL2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mime-version:references :in-reply-to:message-id:date:subject:to:from; bh=0yff527cHXWdzwx+n5n2z19CODuo/vU7BLGvOJJjAsc=; b=F90lG43RD6hiKt8ksGf7/n6wapGKl7qh++riaMeed+iVE1pS4d7NhCp4nKkc+6s1ve QpsYNL+c4YK/GxDq4lEzZtf6ZnsobZVXPSws+dDI6pkfuZS1P2oWNOJrSRC9Wq6A+qWs i3mg78SjR9ZnJMT6ahoahNLVUcpXGjt2Blnh9zRCx+pn91YmP9GF7ExPnW9H1zZzvtjx WTT+BiUYQR3ofjVmcwWD4KMVtXrnc6K1esDCJuEQp1uvnaccsrqWeBMuGcNBTbduaA0l gFzKeSEs3Seu1oTCtJyHKUOci2NmEqaOY3RlDvcHPAQqDN9YNiqiKJ1ThPf2LNO/bIkH 2VbQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id j126si8730176ybb.172.2020.06.13.14.48.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 13 Jun 2020 14:48:12 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:38470 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jkE0a-0001ke-7s for patch@linaro.org; Sat, 13 Jun 2020 17:48:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59844) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jkDxz-0006tJ-C3; Sat, 13 Jun 2020 17:45:31 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:3776 helo=huawei.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jkDxx-0003GQ-Dn; Sat, 13 Jun 2020 17:45:31 -0400 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id EF046561478D198E2282; Sun, 14 Jun 2020 05:45:25 +0800 (CST) Received: from A190218597.china.huawei.com (10.47.30.60) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.487.0; Sun, 14 Jun 2020 05:45:17 +0800 From: Salil Mehta To: , Subject: [PATCH RFC 11/22] arm/cpuhp: Update GED _EVT method AML with cpu scan Date: Sat, 13 Jun 2020 22:36:18 +0100 Message-ID: <20200613213629.21984-12-salil.mehta@huawei.com> X-Mailer: git-send-email 2.8.3 In-Reply-To: <20200613213629.21984-1-salil.mehta@huawei.com> References: <20200613213629.21984-1-salil.mehta@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.47.30.60] X-CFilter-Loop: Reflected Received-SPF: pass client-ip=45.249.212.191; envelope-from=salil.mehta@huawei.com; helo=huawei.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/13 17:44:35 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] 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_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, drjones@redhat.com, sudeep.holla@arm.com, gshan@redhat.com, mst@redhat.com, jiakernel2@gmail.com, maz@kernel.org, zhukeqian1@huawei.com, david@redhat.com, richard.henderson@linaro.org, linuxarm@huawei.com, eric.auger@redhat.com, james.morse@arm.com, catalin.marinas@arm.com, imammedo@redhat.com, Salil Mehta , pbonzini@redhat.com, mehta.salil.lnk@gmail.com, maran.wilson@oracle.com, will@kernel.org, wangxiongfeng2@huawei.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" OSPM evaluates _EVT method to map the event. The cpu hotplug event eventually results in start of the cpu scan. Scan figures out the cpu and the kind of event(plug/unplug) and notifies it back to the guest. The change in this patch updates the GED AML _EVT method with the call to \\_SB.CPUS.CSCN which will do above. Co-developed-by: Keqian Zhu Signed-off-by: Salil Mehta --- hw/acpi/generic_event_device.c | 4 ++++ include/hw/acpi/cpu_hotplug.h | 3 +++ 2 files changed, 7 insertions(+) -- 2.17.1 diff --git a/hw/acpi/generic_event_device.c b/hw/acpi/generic_event_device.c index 0f2c8a959e..79177deda2 100644 --- a/hw/acpi/generic_event_device.c +++ b/hw/acpi/generic_event_device.c @@ -108,6 +108,10 @@ void build_ged_aml(Aml *table, const char *name, HotplugHandler *hotplug_dev, aml_append(if_ctx, aml_call0(MEMORY_DEVICES_CONTAINER "." MEMORY_SLOT_SCAN_METHOD)); break; + case ACPI_GED_CPU_HOTPLUG_EVT: + aml_append(if_ctx, aml_call0(ACPI_CPU_CONTAINER "." + ACPI_CPU_SCAN_METHOD)); + break; case ACPI_GED_PWR_DOWN_EVT: aml_append(if_ctx, aml_notify(aml_name(ACPI_POWER_BUTTON_DEVICE), diff --git a/include/hw/acpi/cpu_hotplug.h b/include/hw/acpi/cpu_hotplug.h index 48b291e45e..f47fc8e79b 100644 --- a/include/hw/acpi/cpu_hotplug.h +++ b/include/hw/acpi/cpu_hotplug.h @@ -20,6 +20,9 @@ #include "hw/acpi/cpu.h" #define ACPI_CPU_HOTPLUG_REG_LEN 12 +#define ACPI_CPU_SCAN_METHOD "CSCN" +#define ACPI_CPU_CONTAINER "\\_SB.CPUS" + typedef struct AcpiCpuHotplug { Object *device;