Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2172368lqt; Mon, 22 Apr 2024 03:47:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUvm+pbCw8jND7lcUZXx70jBgy1ll5sZqgrsxsvUrcyHmc5A+lOad3eda3gSU8qCLLgNdbYdDiGylnpHCeggNPH5drq/W6c30xMXxYc7Q== X-Google-Smtp-Source: AGHT+IHq4Yz6cFv2KijQO1bCK576ItYeqJlTz7/npb8nXQqoLGkyekhV1fK0YvFyNIoT0auNnEAw X-Received: by 2002:a17:907:9449:b0:a55:b5ba:8104 with SMTP id dl9-20020a170907944900b00a55b5ba8104mr1958603ejc.27.1713782835613; Mon, 22 Apr 2024 03:47:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713782835; cv=pass; d=google.com; s=arc-20160816; b=kjl2OHaFsnJqiDXoMhdZfYr1WgAmSiiUZIYr7n21umwiY+9hZZsWcZDhoij4bjYJae 8xKZBhlkiIBMtb99VOTZOW1WdyrS2ufDOhAlV0peSlGCk2fc0nb2d4nMW1UVUk6OcT4A kVw4BZxzQxZli40p2CksG49JIHh552qrz8HGLFR80R9rXPAxhID7MXhUzlVTO6DnDrsv Psv8+gV1Bd9saT354lgP35FEBDfdLPOei/RsGbd6SRqIU4OOPe69bve92W7TuspHp1kI dvjIWZ39jJSIWNkNkxSc6Eqz/pYEzUhg87TohVx473aaxTQJqsd7Tb8KHutKd0FZj6cu Hs+A== 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:organization:references :in-reply-to:message-id:subject:cc:to:from:date; bh=JzRCI4sO3Vnsq1R/bmeETRCFGRNlcRvvxAvd0HQiNRk=; fh=nHFNwxvj1apkwKxtiirFL+DTjrWj81dK8h+pwzhEICs=; b=v1Er2qkKOMCibeo2GdiEC0+8rQlOiMR4ElvCihgVlH2z+DDnllhc/AYlXbGhksURrO Asxqc5br0W3M4DeGJogRMp0JKyrVq7z6IEZxXRIhEwpxU3dwwiElv+FG4ou+PJnu0eSl 7phASXCebBlegpS2QZEGnH+wtQzqf+yUGdoC/QW2Z2lERzSmNYH5SEO6M1GzqxXvWO53 /EP25hlPvbX5jOiTTGB+NPyTQX+jueabE+h1fIDkzArugmAkVdWA8ztDtf535Uor8dKb G3UKZFNq9c16L/FzUJ5bquyvpZiCspughJMnTIQQtlsoDJQyGnH2qLyfBqSljFQzMmPI eHYg==; 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-153230-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-153230-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id ss20-20020a170907039400b00a55b653f200si1052970ejb.872.2024.04.22.03.47.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Apr 2024 03:47:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-153230-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; 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-153230-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-153230-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 5A6D51F2137F for ; Mon, 22 Apr 2024 10:47:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0463114600D; Mon, 22 Apr 2024 10:46:47 +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 D22BE14A8B; Mon, 22 Apr 2024 10:46:44 +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=1713782806; cv=none; b=INhdwBZkxxy/xTGn4pXr4LMN1N8lcBqEhAq/8/diPnnKzPFRL1tj0Br4M/rdkRM+E9cU/ErG5NDuAvcSEDaL9fWf5UM5iBVAiCBnhD9XVIR/WqYjDEROgk0FlDjepTvTMPvISVFXX9UBcVEIYrpGWXUkPwlozrErbd4XJO1NH9M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713782806; c=relaxed/simple; bh=TBfSszjsYeu8dxmuoA7yzrZI7AlIw4uTE4Ri0Sho5Z4=; h=Date:From:To:CC:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Se6ioeX757YOHIu6GxsCvU0gxaZXpeQVDFk8WxqMLHhWW/jkvaAvozVzjzvlGsVFVOpqmZqi4lXme15VljhFdGuki/v8O7LLSstJ1t05T6j7IIlLYYawFN8pCr3dZPUozQIvbEoqtlRwQCgzLDfEkFlEd7dxIJBlw3fnh9hpnmM= 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.31]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4VNMPR49BXz6K9Mn; Mon, 22 Apr 2024 18:46:35 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id 382BF1406AC; Mon, 22 Apr 2024 18:46:41 +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_256_GCM_SHA384) id 15.1.2507.35; Mon, 22 Apr 2024 11:46:40 +0100 Date: Mon, 22 Apr 2024 11:46:39 +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 , Lorenzo Pieralisi , Hanjun Guo , Sudeep Holla CC: Ingo Molnar , Borislav Petkov , "Dave Hansen" , , , Subject: Re: [PATCH v7 09/16] arm64: acpi: Move get_cpu_for_acpi_id() to a header Message-ID: <20240422114639.0000651a@Huawei.com> In-Reply-To: <20240418135412.14730-10-Jonathan.Cameron@huawei.com> References: <20240418135412.14730-1-Jonathan.Cameron@huawei.com> <20240418135412.14730-10-Jonathan.Cameron@huawei.com> 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: lhrpeml100006.china.huawei.com (7.191.160.224) To lhrpeml500005.china.huawei.com (7.191.163.240) On Thu, 18 Apr 2024 14:54:05 +0100 Jonathan Cameron wrote: > From: James Morse > > ACPI identifies CPUs by UID. get_cpu_for_acpi_id() maps the ACPI UID > to the Linux CPU number. > > The helper to retrieve this mapping is only available in arm64's NUMA > code. > > Move it to live next to get_acpi_id_for_cpu(). > > 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) > Signed-off-by: Jonathan Cameron Another one where we'd been focused on the general ACPI aspects so long the CC list didn't include relevant maintainers. +CC Lorenzo, Hanjun and Sudeep. > --- > v7: No change > --- > arch/arm64/include/asm/acpi.h | 11 +++++++++++ > arch/arm64/kernel/acpi_numa.c | 11 ----------- > 2 files changed, 11 insertions(+), 11 deletions(-) > > diff --git a/arch/arm64/include/asm/acpi.h b/arch/arm64/include/asm/acpi.h > index 6792a1f83f2a..bc9a6656fc0c 100644 > --- a/arch/arm64/include/asm/acpi.h > +++ b/arch/arm64/include/asm/acpi.h > @@ -119,6 +119,17 @@ static inline u32 get_acpi_id_for_cpu(unsigned int cpu) > return acpi_cpu_get_madt_gicc(cpu)->uid; > } > > +static inline int get_cpu_for_acpi_id(u32 uid) > +{ > + int cpu; > + > + for (cpu = 0; cpu < nr_cpu_ids; cpu++) > + if (uid == get_acpi_id_for_cpu(cpu)) > + return cpu; > + > + return -EINVAL; > +} > + > static inline void arch_fix_phys_package_id(int num, u32 slot) { } > void __init acpi_init_cpus(void); > int apei_claim_sea(struct pt_regs *regs); > diff --git a/arch/arm64/kernel/acpi_numa.c b/arch/arm64/kernel/acpi_numa.c > index e51535a5f939..0c036a9a3c33 100644 > --- a/arch/arm64/kernel/acpi_numa.c > +++ b/arch/arm64/kernel/acpi_numa.c > @@ -34,17 +34,6 @@ int __init acpi_numa_get_nid(unsigned int cpu) > return acpi_early_node_map[cpu]; > } > > -static inline int get_cpu_for_acpi_id(u32 uid) > -{ > - int cpu; > - > - for (cpu = 0; cpu < nr_cpu_ids; cpu++) > - if (uid == get_acpi_id_for_cpu(cpu)) > - return cpu; > - > - return -EINVAL; > -} > - > static int __init acpi_parse_gicc_pxm(union acpi_subtable_headers *header, > const unsigned long end) > {