Received: by 2002:a05:7412:8598:b0:f9:33c2:5753 with SMTP id n24csp87678rdh; Mon, 18 Dec 2023 12:22:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IGd9gmaoqqsRgRKicraqIHf989lEvK+KXRKh8zciao7RJ10JjcZvxTR9qmIZVuOmYTaybge X-Received: by 2002:a05:6a20:29a5:b0:18f:f86f:bcdc with SMTP id f37-20020a056a2029a500b0018ff86fbcdcmr8006007pzh.69.1702930950927; Mon, 18 Dec 2023 12:22:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702930950; cv=none; d=google.com; s=arc-20160816; b=bXuoqDWS9QMWTCqDIPnu76BcExsIe7ECILbHFlFbh97Udr4lVU3u3kr3vi6Sh6WN14 1S6Gq16PN8M6rEcAU3jGxKsKT9exkGbEEposGHJfNQJmaTeE1NV01b2kI6gT/D0P7dVg sdDvLqZr6skO+IgRSjv1w3Xk40KJv8Hi3R0o95g1gKBKJfjyDUUNFIR2XL+yyBIRhd0J i0lo/NsoO5kKYAJLKKJDpKjZ9i9XWtaGpf9vergD5x5X8JBLuCYDJayS7jn4HA59A1ju 5REaqDiXBkYzf3vkGgVkyRF1lR+ttpaOtOxKZTcHD+cE0Ws8a+IqeqqFF7CHJM+5cdqx +arw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence; bh=fGmAXhjX5Y4s1RFRjJ9B0I+ERw19f5OL+MbL6CYALRM=; fh=FdKLH5Lkv+cCalk9mliJbP8ks5hX326lBveelCIbs6Y=; b=tLjz0g9K7bCUaNU9+gSJc1loofvdtRv1VtEu0ybz5IIIlMdKr6mTiNqdSj5ksjRXZX 4Jip47wykEyUzsiMyfDucOOpi9uaquqcaoqa5vf6/vTtJrNBHUQkevbCzTNEBA+u2ueC I+hlDT72JP7XtRnRXqiJ+f4OKv+MJv7gRX/T0HDFQVJbcoyst3D4XqHVb/XNgdHiOijY axiUIEC51dd9DaItZDG1TzZFqfgjchUZjTct3uldEHZE0zvsx7bzulcRswG9Y3fzsgdx kyfEjJgBlSQVMeW4J7fNP3ObVKozL1t7nLGQ4gWsTadUvv9uSQ8+hMvuPWi4MukwCCFj k4+A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-4340-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4340-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id x1-20020a631701000000b005c179c0075dsi18424737pgl.883.2023.12.18.12.22.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 12:22:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-4340-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-4340-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4340-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 95E4D285AAA for ; Mon, 18 Dec 2023 20:22:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 370AA7346F; Mon, 18 Dec 2023 20:22:17 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ot1-f46.google.com (mail-ot1-f46.google.com [209.85.210.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6321348784; Mon, 18 Dec 2023 20:22:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ot1-f46.google.com with SMTP id 46e09a7af769-6da682dcf66so513815a34.1; Mon, 18 Dec 2023 12:22:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702930934; x=1703535734; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fGmAXhjX5Y4s1RFRjJ9B0I+ERw19f5OL+MbL6CYALRM=; b=Ewc749Ov3tSnW7kxInzjvOz9y0X89L9WZH5F2NhPIGtsqEZ0G3Bx8BbhqRfEXQM535 9BKkPq9xcP2VSSAvYyUJuKh0WkxJ51Zb09XIk8hxOG0R+XMh1et5DyeqV2EVd8myWWad 8EfoF5Q62zb1QPX307G8jvFIs3EdVQ3H1am29PtWmsIiMpfrlp2kbW4SeLWQwReZptHf XcwtWMTBDi8NskJtEPfvTMSQNY5ZNAMBPp3EMuk08KOa81A0TY9AHCQLWAN0VKOAmUAJ q7u7Fwss5mGw7nlbT64mZQG4bfHTpQcgcPZOAfi+MvQ7nzD8OaRLwa/5td20uFIOR0k0 R/XQ== X-Gm-Message-State: AOJu0YznsevHnQ91cbokb1kD3rUeOQn3+y1Gtls3UVoMEBS6NTJVMyNL 5adZuJRLjyjxVowXRYwpOfvLjqrLKd9TtuykCu07b6JX X-Received: by 2002:a4a:a581:0:b0:591:cdc0:f28d with SMTP id d1-20020a4aa581000000b00591cdc0f28dmr5277719oom.0.1702930934339; Mon, 18 Dec 2023 12:22:14 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: In-Reply-To: From: "Rafael J. Wysocki" Date: Mon, 18 Dec 2023 21:22:03 +0100 Message-ID: Subject: Re: [PATCH RFC v3 03/21] ACPI: processor: Register CPUs that are online, but not described in the DSDT To: Russell King Cc: linux-pm@vger.kernel.org, loongarch@lists.linux.dev, linux-acpi@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, kvmarm@lists.linux.dev, x86@kernel.org, acpica-devel@lists.linuxfoundation.org, linux-csky@vger.kernel.org, linux-doc@vger.kernel.org, linux-ia64@vger.kernel.org, linux-parisc@vger.kernel.org, Salil Mehta , Jean-Philippe Brucker , jianyong.wu@arm.com, justin.he@arm.com, James Morse Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Dec 13, 2023 at 1:49=E2=80=AFPM Russell King wrote: > > From: James Morse > > ACPI has two descriptions of CPUs, one in the MADT/APIC table, the other > in the DSDT. Both are required. (ACPI 6.5's 8.4 "Declaring Processors" > says "Each processor in the system must be declared in the ACPI > namespace"). Having two descriptions allows firmware authors to get > this wrong. > > If CPUs are described in the MADT/APIC, they will be brought online > early during boot. Once the register_cpu() calls are moved to ACPI, > they will be based on the DSDT description of the CPUs. When CPUs are > missing from the DSDT description, they will end up online, but not > registered. > > Add a helper that runs after acpi_init() has completed to register > CPUs that are online, but weren't found in the DSDT. Any CPU that > is registered by this code triggers a firmware-bug warning and kernel > taint. > > Qemu TCG only describes the first CPU in the DSDT, unless cpu-hotplug > is configured. So why is this a kernel problem? > Signed-off-by: James Morse > Reviewed-by: Jonathan Cameron > Reviewed-by: Gavin Shan > Tested-by: Miguel Luis > Tested-by: Vishnu Pajjuri > Tested-by: Jianyong Wu > Signed-off-by: Russell King (Oracle) > --- > drivers/acpi/acpi_processor.c | 19 +++++++++++++++++++ > 1 file changed, 19 insertions(+) > > diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.= c > index 6a542e0ce396..0511f2bc10bc 100644 > --- a/drivers/acpi/acpi_processor.c > +++ b/drivers/acpi/acpi_processor.c > @@ -791,6 +791,25 @@ void __init acpi_processor_init(void) > acpi_pcc_cpufreq_init(); > } > > +static int __init acpi_processor_register_missing_cpus(void) > +{ > + int cpu; > + > + if (acpi_disabled) > + return 0; > + > + for_each_online_cpu(cpu) { > + if (!get_cpu_device(cpu)) { > + pr_err_once(FW_BUG "CPU %u has no ACPI namespace = description!\n", cpu); > + add_taint(TAINT_FIRMWARE_WORKAROUND, LOCKDEP_STIL= L_OK); > + arch_register_cpu(cpu); Which part of this code is related to ACPI? > + } > + } > + > + return 0; > +} > +subsys_initcall_sync(acpi_processor_register_missing_cpus); > + > #ifdef CONFIG_ACPI_PROCESSOR_CSTATE > /** > * acpi_processor_claim_cst_control - Request _CST control from the plat= form. > --