Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp2079474lqa; Tue, 30 Apr 2024 07:41:36 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVaneL33z5HElGEedH9njTPzolGutseMFgxL4c1FAAHW/xnE5OivrVWh5Db37mTxs2tnmUnMuebiWZ/eftV7kFIUvU/ReHVyReaoEQIxQ== X-Google-Smtp-Source: AGHT+IEKSRdJePmY7G5sX9Xtdgq5e12ELQAIavU0XYQH8VkTNhMFYCK0hyZ4vTk6SU2a6kBC1ceF X-Received: by 2002:a05:6214:d08:b0:6a0:4d4f:9428 with SMTP id 8-20020a0562140d0800b006a04d4f9428mr4558424qvh.32.1714488096273; Tue, 30 Apr 2024 07:41:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714488096; cv=pass; d=google.com; s=arc-20160816; b=LVD50Gr7rCpm3ueNzi0Fj9QsiARe+fgHkvzWcDrddaqraGL2MkzrcpQ0e6BY2f28O3 OZrD47swkAZ3O9fAYWtixX2S3nzUPCnxBY9tO+lF1Q0XNHmzlnL12dvYBtYMywPs5BB2 mk2KMDPJCgUxnaoCpn9RPMTFJJrbsTqRGmmZ/bRZkHKFu9omacnjSpLXPYbSyzVWiH7l DJCgGKGqusDR9kC/aLb/9skrASUU/G6XYBJIbT89BH63yAvO+8z+MsWC9B5eYX/hXEGm JEmdODJ98G8zhZVZNVfHBjiVHlhDZnmp9FTBudVszu6jWKHYTkEh2CYM7y2Yf5wchc8+ sadQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=B8BA+FxkvHBiMUSCYqg9SRNKkBvvsx3zImtYHvIOCoo=; fh=25IklNjpQtm3+ZI4w1ifckV22BkO2b6a/wyTwiBBJrk=; b=uZIwXakbBxm07P6wa0tjMzQmlJXLTpgEfFWru3owVygwxHaImlQKb/r10GFOhUaqU6 Z+R41pMm9JC2ajC7mdQJniFPUKcIzGPMsdKnqlh02J8FaJDoIs1ZmQO2CmwoaeJWuV6z /Qdb+0jblIMtV1pv1fcZJF7WWJVnOlXyntKl3TgrJS+HELHmh1AeKWObgxwXZRdw2Yde C3S8Kipc6HYBdtgFKZdHh5mftg4B/w9jR/D4WnwW7x/zWjm1d9trPK880DPgRmKqdths eK/XaU9Q73GX7dDinvAx6X+VTUSE8OsOJV7Zr6x9cbMlL5QW98xyjTF8tkuGOeayNagN ac4w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-164174-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-164174-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id pt2-20020a056214048200b006993d828d7fsi29353830qvb.259.2024.04.30.07.41.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 07:41:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-164174-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-164174-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-164174-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id E86351C22EE4 for ; Tue, 30 Apr 2024 14:41:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 970FF180A8B; Tue, 30 Apr 2024 14:33:25 +0000 (UTC) Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B9136180A70; Tue, 30 Apr 2024 14:33:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.176.79.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714487605; cv=none; b=Wvmo22VBcBlwci9hKjEH8vtjO/94OmGjTsWcUNig0hesfaB+j3mVNbq0R+mktsO1UXYB7rCp5IStRIvXYcx+cVBWicc6Jubk76gNREWSmsglIdlPBkSumCofjXmA9ny1YooSPGyqt6zNmnRYljmaMF49w0ovIfei4w1k/VEsbzE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714487605; c=relaxed/simple; bh=JOtBk0Y4w1pZHwjVrcc+I+akWt3sBbp8f9hSPAgnTME=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=SZQtBmc6wZo6anWdtGt1VFOzWZ/LxwCIBLj6t7jQRmcqFNbtoTJjHTe9D1b4v06H8l9z/rrRzIqGtPpQGJd7X5l8dJVV248d6L/kg53MWCdYrzTZCgsV5JDlleJLWZAGg0Md6LTjy2SMPczLUhlRR8Zr14eNtee0Z2Bop/tDYlc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=185.176.79.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.18.186.216]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4VTN0M3QkFz6GD3R; Tue, 30 Apr 2024 22:30:43 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id B8A08140B2A; Tue, 30 Apr 2024 22:33:20 +0800 (CST) Received: from SecurePC-101-06.china.huawei.com (10.122.247.231) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Tue, 30 Apr 2024 15:33:20 +0100 From: Jonathan Cameron To: Thomas Gleixner , Peter Zijlstra , , , , , , , , , Russell King , "Rafael J . Wysocki" , Miguel Luis , James Morse , Salil Mehta , Jean-Philippe Brucker , Catalin Marinas , Will Deacon , Marc Zyngier , Hanjun Guo , Gavin Shan CC: Ingo Molnar , Borislav Petkov , Dave Hansen , , , Subject: [PATCH v9 17/19] arm64: Kconfig: Enable hotplug CPU on arm64 if ACPI_PROCESSOR is enabled. Date: Tue, 30 Apr 2024 15:24:32 +0100 Message-ID: <20240430142434.10471-18-Jonathan.Cameron@huawei.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240430142434.10471-1-Jonathan.Cameron@huawei.com> References: <20240430142434.10471-1-Jonathan.Cameron@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: lhrpeml100003.china.huawei.com (7.191.160.210) To lhrpeml500005.china.huawei.com (7.191.163.240) In order to move arch_register_cpu() to be called via the same path for initially present CPUs described by ACPI and hotplugged CPUs ACPI_HOTPLUG_CPU needs to be enabled. The protection against invalid IDs in acpi_map_cpu() is needed as at least one production BIOS is in the wild which reports entries in DSDT (with no _STA method, so assumed enabled and present) that don't match MADT. Tested-by: Miguel Luis Signed-off-by: Jonathan Cameron --- V9: No change. --- arch/arm64/Kconfig | 1 + arch/arm64/kernel/acpi.c | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 7b11c98b3e84..fed7d0d54179 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -5,6 +5,7 @@ config ARM64 select ACPI_CCA_REQUIRED if ACPI select ACPI_GENERIC_GSI if ACPI select ACPI_GTDT if ACPI + select ACPI_HOTPLUG_CPU if ACPI_PROCESSOR select ACPI_IORT if ACPI select ACPI_REDUCED_HARDWARE_ONLY if ACPI select ACPI_MCFG if (ACPI && PCI) diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c index dba8fcec7f33..fb9368197c74 100644 --- a/arch/arm64/kernel/acpi.c +++ b/arch/arm64/kernel/acpi.c @@ -29,6 +29,7 @@ #include #include +#include #include #include #include @@ -413,6 +414,27 @@ void arch_reserve_mem_area(acpi_physical_address addr, size_t size) memblock_mark_nomap(addr, size); } +#ifdef CONFIG_ACPI_HOTPLUG_CPU +int acpi_map_cpu(acpi_handle handle, phys_cpuid_t physid, u32 apci_id, + int *pcpu) +{ + /* If an error code is passed in this stub can't fix it */ + if (*pcpu < 0) { + pr_warn_once("Unable to map CPU to valid ID\n"); + return *pcpu; + } + + return 0; +} +EXPORT_SYMBOL(acpi_map_cpu); + +int acpi_unmap_cpu(int cpu) +{ + return 0; +} +EXPORT_SYMBOL(acpi_unmap_cpu); +#endif /* CONFIG_ACPI_HOTPLUG_CPU */ + #ifdef CONFIG_ACPI_FFH /* * Implements ARM64 specific callbacks to support ACPI FFH Operation Region as -- 2.39.2