Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4191532rdb; Thu, 14 Sep 2023 14:59:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGm6kyk1nvB61EhZdOtV1bh6zCHRiNDrqYO7oUT8NSzQC2o/7/zN6P+Ncy09WK4T2RvD2YM X-Received: by 2002:a17:903:1cb:b0:1bf:1a9e:85f7 with SMTP id e11-20020a17090301cb00b001bf1a9e85f7mr7483933plh.1.1694728740587; Thu, 14 Sep 2023 14:59:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694728740; cv=none; d=google.com; s=arc-20160816; b=V+B7enHIn4ID1Cf9ftS8xkExI16fMhA4ZTISVqyVTaj+HvQJGoJ6DZfmNDfQZQrba9 QZ7b8js8BgnEPe6zvGvzgorttjH93osXtJ39xBTx43S5ZgBaX7xz5sDZixACcZ55Idjg fH4wrbrezZ+6rAUle08WQPb93gU+a+Thj9f6Enzn17E911NjEACXM7gX4SsdRrkxC29z GC9RNy9TtEnMUlsMPL6KUhva7mrUhWXkKStWeuxvP/60CQySR2LMwwUDgts0PVP1cu3X QER0rGPQBSwPwSDv8iplXnIUaFdDFJswHCR2Mgjp5elDF8YtOwv8/5JTFkNLf3KnnnxQ gjTQ== 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=gY3BLATAngPeUb2icaJyox4/LQoB7R8q02EbbkVuNoo=; fh=oO43h3w0Gnh1/uzgjBLTRg+oe1Gv6aFHPIod5z8aS5s=; b=Z+CfLvO6mG7+nYY0zotxloxTpMMLRNbHapnR1N9qSH8Fj7HnDj/agZtyU4Tq7i0xNC jH/qc68K55q2ZJvwJ4cvZXUoZZ7SBt6u/ectd0dvoxcRlctqGDgFOTJjItJtHlaa0u5w Xp3usaJ+XDKDoibRW3mdzpuMUqqSVr0bqbwqzk2iNkwg9IGB5KgZDzcL/IK2FjRneWU2 DzqcDa+PVt9kJE79eU21a7YSztePpH+dHRfiXLvibtx0roDz0m9EyxMjfPjMC0Utbu50 OXzlFOvhecZXgM1vpo2mTwNLgxSmqhIyj8ZnupdqMwicSOOIpI5HxQq6KUEZ9tKeVcQv 7DIg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id b2-20020a170902b60200b001b7fee7d5f0si2188633pls.25.2023.09.14.14.59.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 14:59:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id 72E0682958AF; Thu, 14 Sep 2023 06:54:03 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239324AbjINNyD (ORCPT + 99 others); Thu, 14 Sep 2023 09:54:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239292AbjINNyC (ORCPT ); Thu, 14 Sep 2023 09:54:02 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA2DF1AE; Thu, 14 Sep 2023 06:53:57 -0700 (PDT) Received: from lhrpeml500005.china.huawei.com (unknown [172.18.147.226]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4RmdwB3Lzdz6D8rX; Thu, 14 Sep 2023 21:49:14 +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.31; Thu, 14 Sep 2023 14:53:54 +0100 Date: Thu, 14 Sep 2023 14:53:53 +0100 From: Jonathan Cameron To: James Morse CC: , , , , , , , , , Salil Mehta , Russell King , Jean-Philippe Brucker , , Subject: Re: [RFC PATCH v2 15/35] ACPI: processor: Add support for processors described as container packages Message-ID: <20230914145353.000072e2@Huawei.com> In-Reply-To: <20230913163823.7880-16-james.morse@arm.com> References: <20230913163823.7880-1-james.morse@arm.com> <20230913163823.7880-16-james.morse@arm.com> 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: lhrpeml500006.china.huawei.com (7.191.161.198) To lhrpeml500005.china.huawei.com (7.191.163.240) X-CFilter-Loop: Reflected 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 (snail.vger.email [0.0.0.0]); Thu, 14 Sep 2023 06:54:03 -0700 (PDT) On Wed, 13 Sep 2023 16:38:03 +0000 James Morse wrote: > ACPI has two ways of describing processors in the DSDT. Either as a device > object with HID ACPI0007, or as a type 'C' package inside a Processor > Container. The ACPI processor driver probes CPUs described as devices, but > not those described as packages. > Specification reference needed... Terminology wise, I'd just refer to Processor() objects as I think they are named objects rather than data terms like a package (Which include a PkgLength etc) > 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 packages in a processor container. processor terms in a processor container. > > Signed-off-by: James Morse Otherwise looks fine to me. Jonathan > --- > 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 c0839bcf78c1..b4bde78121bb 100644 > --- a/drivers/acpi/acpi_processor.c > +++ b/drivers/acpi/acpi_processor.c > @@ -625,9 +625,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; > } >