Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp6587987rdb; Tue, 2 Jan 2024 06:53:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IEuNR0ecaZ77D2Pgf9vcEbLKw8NBGtBmWvR9BFzk4OWM+a269XWsEwm2GN3XkgJBKnikoC+ X-Received: by 2002:a05:620a:46a3:b0:77f:afbc:99d8 with SMTP id bq35-20020a05620a46a300b0077fafbc99d8mr26525078qkb.103.1704207230743; Tue, 02 Jan 2024 06:53:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704207230; cv=none; d=google.com; s=arc-20160816; b=L5f/yTf7YCYEIOjPdgPCNwi6tfjPjURS0ns+fjulW6CXraRZwHx8hQjxFw24WlrDpQ yUkXsfgLQQirdCC/RLaJaKGr5vXltCcXDTRjAIymIXNDuanoI5IIaR2PKqDPJ1e/I9Wj o6KZtSa7xmhIxEnyUwB5pa7lBSYDhxA7fRM511A6OxVem3cpuaURSSIrmHLHFzCAY/J3 ih0BjjolZyXYTRS5evOCjmwcKhU0CyZSQrCiwEdNbkfAOcXKEwSyogmOi3Wk0y9IWDNm KeAablmZ2W7SJimW8dUnf58Uqqjqa6KUdBbsV0u3ml7nNxfTDiXJmi+S+JqMQjNJ7ZiH 4O+g== ARC-Message-Signature: i=1; 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:organization:references :in-reply-to:message-id:subject:cc:to:from:date; bh=ZwkciSLNRsWK64PrQW3oXelgkrFVXnrGarqWXYYKi14=; fh=4tkd9eTxbo2wxlGMQyq82BG82I843ilgVHOmrdyv6sw=; b=omM0Esr7Zg9xQrj1grO9wXSDDiMttny0tfVBlzOFo7ubD/PiMuu27EztFYVMVn3xBg uMQumDDV0VpGkETxMpa3ab+CUcBv3S4L3CP+CFMtrQekghWNVuWZoZUWBt8JNC/doSAN cwnpR3JMnsOw1BFymDQdAivw18w8NIWRgQstu5YDt+rG4OX4rawkyPOa+2Y9dfo2WxY3 NEcgDWvx9iEOyqY8Ab9gEw76yV2TbKoG0MYUh/slfJhdE3m+qje2hPyufipQmRoG8y1O vAsZpK9EKptJg9fUp09xBpRa91GtzDggX7EuMKK5IcmNUmjTAGg4WEXHTeIYKKo5XWfj DfCg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-14514-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-14514-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. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id c28-20020a05620a201c00b0078157671738si15354916qka.219.2024.01.02.06.53.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jan 2024 06:53:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-14514-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-14514-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-14514-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 806481C220B7 for ; Tue, 2 Jan 2024 14:53:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8758414A98; Tue, 2 Jan 2024 14:53:29 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org 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 8081C1400D; Tue, 2 Jan 2024 14:53:25 +0000 (UTC) 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 4T4G5q1Xwbz6K5pD; Tue, 2 Jan 2024 22:51:59 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id D4BBB1400DB; Tue, 2 Jan 2024 22:53:22 +0800 (CST) Received: from localhost (10.202.227.76) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Tue, 2 Jan 2024 14:53:22 +0000 Date: Tue, 2 Jan 2024 14:53:20 +0000 From: Jonathan Cameron To: "Russell King (Oracle)" CC: , , , , , , , , , , , , , , Salil Mehta , Jean-Philippe Brucker , , , James Morse Subject: Re: [PATCH RFC v3 17/21] ACPI: add support to register CPUs based on the _STA enabled bit Message-ID: <20240102145320.000062f9@Huawei.com> In-Reply-To: References: Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.33; x86_64-w64-mingw32) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: lhrpeml100002.china.huawei.com (7.191.160.241) To lhrpeml500005.china.huawei.com (7.191.163.240) On Mon, 18 Dec 2023 13:03:32 +0000 "Russell King (Oracle)" wrote: > On Wed, Dec 13, 2023 at 12:50:38PM +0000, Russell King wrote: > > From: James Morse > > > > acpi_processor_get_info() registers all present CPUs. Registering a > > CPU is what creates the sysfs entries and triggers the udev > > notifications. > > > > arm64 virtual machines that support 'virtual cpu hotplug' use the > > enabled bit to indicate whether the CPU can be brought online, as > > the existing ACPI tables require all hardware to be described and > > present. > > > > If firmware describes a CPU as present, but disabled, skip the > > registration. Such CPUs are present, but can't be brought online for > > whatever reason. (e.g. firmware/hypervisor policy). > > > > Once firmware sets the enabled bit, the CPU can be registered and > > brought online by user-space. Online CPUs, or CPUs that are missing > > an _STA method must always be registered. > > ... > > > @@ -526,6 +552,9 @@ static void acpi_processor_post_eject(struct acpi_device *device) > > acpi_processor_make_not_present(device); > > return; > > } > > + > > + if (cpu_present(pr->id) && !(sta & ACPI_STA_DEVICE_ENABLED)) > > + arch_unregister_cpu(pr->id); > > This change isn't described in the commit log, but seems to be the cause > of the build error identified by the kernel build bot that is fixed > later in this series. I'm wondering whether this should be in a > different patch, maybe "ACPI: Check _STA present bit before making CPUs > not present" ? Would seem a bit odd to call arch_unregister_cpu() way before the code is added to call the matching arch_registers_cpu() Mind you this eject doesn't just apply to those CPUs that are registered later I think, but instead to all. So we run into the spec hole that there is no way to identify initially 'enabled' CPUs that might be disabled later. > > Or maybe my brain isn't working properly (due to being Covid positive.) > Any thoughts, Jonathan? I'll go with a resounding 'not sure' on where this change belongs. I blame my non existent start of the year hangover. Hope you have recovered! Jonathan