Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6154012rdb; Thu, 14 Dec 2023 09:37:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IHx5QwQ3szrB2KqoFNxfosLHKRoPpLGlZPk8/DJ+YR5lBEpYZdnfzwEUNI7mtMHC92y/uBX X-Received: by 2002:a05:6a00:198e:b0:690:f877:aa1e with SMTP id d14-20020a056a00198e00b00690f877aa1emr11317822pfl.12.1702575434819; Thu, 14 Dec 2023 09:37:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702575434; cv=none; d=google.com; s=arc-20160816; b=ZegzkErjc5lDupa53q+dOZuN3EbLKHJJaAXCRg4OBEU5d8SK1dKhxbxt0EnelS93Hn LQMBqk6T2RuYUPYdkYiB1B2Y8hVdg9UnpMR7v8ytQvQRyExNGdwV3FsYyRfSUuIWQeE0 //wIwXMdMvS9JPVcOTnbFyCVszZFe6C8oUMGUifcaDefpZOmzEvNmpepQsSXkjJkfAgk q7Jyy3DjoCGdNYUQJlkbz4cygDvexnk1osuSm9oPC/jdyB8O6zdVM5Oflecn1HjLLyAn sLcGrga7ewV++xJk+zgPQw21BwurbDFiui+lXfQwVkQHz4gcWX686K5Nf4X1djZRA4uG tlmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=Jz98Wrj98ZfWSYNCWVtAMWgZrbPNwTeg/7OWq9bcXWE=; fh=4iHbZ733mqZc4Bx83AV0konbWC9aXbRvmPAEmCiuGYk=; b=lJswiI/Z2pHp46eFnlVjUYTBhbPGi9PsUgR5oeIwOyrtv0dC3Gaglgku7wwdG4UIX4 LJ7svkhUi2MkpmU58GW3vu3aWyku1o2fEwgMEM8tMfqgIvMty9oMm61Vnm+NlVlG1Qh4 UjIWRoiWpmIQ65g9FCxIGa39xO3lBwjhtOAMvqn3T81tTKOwS9ZH5LInJaZo68ySJB5y Syg3v0Yszsrk0y8DDJDIO/dEm8TWlSVidsK0E713zzpJ4ZLkgZD46L//iOOyoAbt0aQ5 Lw9c/0nhB645p1XLX4ZSFw1Tv3LJkuk13lTHBDBaP5hKVXBQCgn2rrYjD0jaRQ2sz0Sd Vz4g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id t5-20020a62d145000000b006ce72ca697asi11621609pfl.251.2023.12.14.09.37.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 09:37:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 597BF80F697A; Thu, 14 Dec 2023 09:37:11 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235604AbjLNRgx (ORCPT + 99 others); Thu, 14 Dec 2023 12:36:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235547AbjLNRgX (ORCPT ); Thu, 14 Dec 2023 12:36:23 -0500 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9318A134; Thu, 14 Dec 2023 09:36:29 -0800 (PST) Received: from mail.maildlp.com (unknown [172.18.186.231]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4Srfc62XW9z688KN; Fri, 15 Dec 2023 01:34:30 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id CC9911400DB; Fri, 15 Dec 2023 01:36:27 +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; Thu, 14 Dec 2023 17:36:27 +0000 Date: Thu, 14 Dec 2023 17:36:26 +0000 From: Jonathan Cameron To: "Russell King (Oracle)" CC: , , , , , , , , , , , , , , Salil Mehta , Jean-Philippe Brucker , , , James Morse Subject: Re: [PATCH RFC v3 02/21] ACPI: processor: Add support for processors described as container packages Message-ID: <20231214173626.00005062@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) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.202.227.76] X-ClientProxiedBy: lhrpeml100002.china.huawei.com (7.191.160.241) To lhrpeml500005.china.huawei.com (7.191.163.240) X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Thu, 14 Dec 2023 09:37:11 -0800 (PST) On Wed, 13 Dec 2023 12:49:21 +0000 Russell King (Oracle) wrote: > From: James Morse > > ACPI has two ways of describing processors in the DSDT. From ACPI v6.5, > 5.2.12: > > "Starting with ACPI Specification 6.3, the use of the Processor() object > was deprecated. Only legacy systems should continue with this usage. On > the Itanium architecture only, a _UID is provided for the Processor() > that is a string object. This usage of _UID is also deprecated since it > can preclude an OSPM from being able to match a processor to a > non-enumerable device, such as those defined in the MADT. From ACPI > Specification 6.3 onward, all processor objects for all architectures > except Itanium must now use Device() objects with an _HID of ACPI0007, > and use only integer _UID values." > > Also see https://uefi.org/specs/ACPI/6.5/08_Processor_Configuration_and_Control.html#declaring-processors > > Duplicate descriptions are not allowed, the ACPI processor driver already > parses the UID from both devices and containers. acpi_processor_get_info() > returns an error if the UID exists twice in the DSDT. > > The missing probe for CPUs described as packages creates a problem for > moving the cpu_register() calls into the acpi_processor driver, as CPUs > described like this don't get registered, leading to errors from other > subsystems when they try to add new sysfs entries to the CPU node. > (e.g. topology_sysfs_init()'s use of topology_add_dev() via cpuhp) > > To fix this, parse the processor container and call acpi_processor_add() > for each processor that is discovered like this. The processor container > handler is added with acpi_scan_add_handler(), so no detach call will > arrive. > > Qemu TCG describes CPUs using processor devices in a processor container. > For more information, see build_cpus_aml() in Qemu hw/acpi/cpu.c and > https://uefi.org/specs/ACPI/6.5/08_Processor_Configuration_and_Control.html#processor-container-device > > Signed-off-by: James Morse > Tested-by: Miguel Luis > Tested-by: Vishnu Pajjuri > Tested-by: Jianyong Wu > --- > Outstanding comments: > https://lore.kernel.org/r/20230914145353.000072e2@Huawei.com Looks like you resolved those (were all patch description things). So I'm happy. Reviewed-by: Jonathan Cameron Thanks, J > https://lore.kernel.org/r/50571c2f-aa3c-baeb-3add-cd59e0eddc02@redhat.com > --- > drivers/acpi/acpi_processor.c | 22 ++++++++++++++++++++++ > 1 file changed, 22 insertions(+) > > diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c > index 4fe2ef54088c..6a542e0ce396 100644 > --- a/drivers/acpi/acpi_processor.c > +++ b/drivers/acpi/acpi_processor.c > @@ -626,9 +626,31 @@ static struct acpi_scan_handler processor_handler = { > }, > }; > > +static acpi_status acpi_processor_container_walk(acpi_handle handle, > + u32 lvl, > + void *context, > + void **rv) > +{ > + struct acpi_device *adev; > + acpi_status status; > + > + adev = acpi_get_acpi_dev(handle); > + if (!adev) > + return AE_ERROR; > + > + status = acpi_processor_add(adev, &processor_device_ids[0]); > + acpi_put_acpi_dev(adev); > + > + return status; > +} > + > static int acpi_processor_container_attach(struct acpi_device *dev, > const struct acpi_device_id *id) > { > + acpi_walk_namespace(ACPI_TYPE_PROCESSOR, dev->handle, > + ACPI_UINT32_MAX, acpi_processor_container_walk, > + NULL, NULL, NULL); > + > return 1; > } >