Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp497620rdb; Tue, 19 Sep 2023 01:30:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHvzt+qJZ9dBcMCmnih7otXPNxmbtD7/JqSkHSff0FHhUF9BJV7MyKiSfEasGcsjX+0COKh X-Received: by 2002:a17:903:1249:b0:1bf:69af:b4e4 with SMTP id u9-20020a170903124900b001bf69afb4e4mr11179990plh.37.1695112212840; Tue, 19 Sep 2023 01:30:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695112212; cv=none; d=google.com; s=arc-20160816; b=i5/tul7wsXERbR3R4kLpcvJxIz1jKN4mU/l4h6GtF+FOER2KAyHcvgH8I08ssXQxgz 0hFUUPlh/eWde6uFBtODDlNtbRJyO+bT+CkJ3PKPIcfjEVUsbkWsuTG0oK7UYhB+RK9w 0kUVVA7mNa4jO3ryWX1dLh8KNSUU6ihOqFozwa6KcsjlhSFSVkwBYkRsUodduZ/rILLG L+A+1jsOOjWJRemm7RTs5NJ+q+KoWsviHaywkLaFCfCFYmuVa1+/qElwotUK6Pabe100 YW9wJMgUaO9eiyu27b+7ryEwGMdpeFZEdEaSSZRNiLsHRxB7dQ43iWk388BZpRolXCdt Gl2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=omPau9d/hvAoI0gDrC/4LG/Ef7KpyIVKvwkkyw1GuWQ=; fh=PXJ1nrAkwnzNPHtj0xILXFW28d5sEdNuBWEBRL0T4wA=; b=ozSPBbEtDwqfMs6hZ1w9VYIFjdXC/qnAnqVqpS0x7iCAalTMsK3kub4G0k2pGVJ8xd 27BEUCbeJobTNhgDIgCml/KZWaUp0rwuy2LAX4paTnJ2D1hmsnsREZOE/JlyM5gAR8A6 M77jqXbcXx0aiQ5DVZWeDSzVotwNotiourASzsIC8yDlO3GSC/bolV3nuv+uzgiJgE/3 fID5E3Of3jFtUT/dBQ7q+2usU3DAMiNc1kuVfsRGhJMr8YFCmLLqDd2CsF9oxIo0f1tQ KrqU+2O0/+2OewX5fj7+0IjVSec4tGQwmqZOCSu8V6SZe63kPnqSDr0LK9EgeEm5YatU JEgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fwsvuiS5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id lm4-20020a170903298400b001b7ecbbaa13si9231121plb.152.2023.09.19.01.30.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 01:30:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fwsvuiS5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id C68E681CE843; Mon, 18 Sep 2023 18:17:48 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230365AbjISBRp (ORCPT + 99 others); Mon, 18 Sep 2023 21:17:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230423AbjISBRo (ORCPT ); Mon, 18 Sep 2023 21:17:44 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9600107 for ; Mon, 18 Sep 2023 18:16:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695086211; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=omPau9d/hvAoI0gDrC/4LG/Ef7KpyIVKvwkkyw1GuWQ=; b=fwsvuiS5ayp+PO/4Y8J3q7X+Z9HvlUpCyWR1SccVVFgKLz3RaPtKFpVjrIsSTuoM+7IL/l 8vD0yHDFLq6Z0ohqg+bPyJmknzZE1NhkjWJuNW5R3uq4CYpvFurtXvz83uP9pixjqKPt2G ucISVdJZOOHkqxOSyBUyIU5Cq/VIWCo= Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-338-hjgpeR04OyimXEqfzbVKuw-1; Mon, 18 Sep 2023 21:16:49 -0400 X-MC-Unique: hjgpeR04OyimXEqfzbVKuw-1 Received: by mail-pl1-f197.google.com with SMTP id d9443c01a7336-1c40ac5b6e7so42983255ad.0 for ; Mon, 18 Sep 2023 18:16:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695086208; x=1695691008; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=omPau9d/hvAoI0gDrC/4LG/Ef7KpyIVKvwkkyw1GuWQ=; b=Z9+nmKEwm+Us5CfoSNvbrbh9i0m+JmynONivtatBMuF527V+eWZsv9H8AS+nQxmn/7 feeGR/2dg4XP9ZkZHX3kOpADNl86t5Qd4xrtufqgw2MXGbEM+MUMN3rItFyUXzvawfgF 7sQngp7dXxXPK742M52kJDtpL0d38vLAIyXC4mJo58cmPsu/HZOeCx7SCTkcrOqM7Yid FkbcubQBGhh2TLT36+Axr4VGHlfJgqyPDM+r9AALEY+ybeNRcgt8po9AJpOMslFxfBh3 aJAIv3UdNaOARmZ4h7q6k+iupj8MKbmE4VutCZkNWJKu4oVu6MBRTOnBxjZW8dGOJ3rd 4umw== X-Gm-Message-State: AOJu0YwhLaNy6MH7VruQtVzJe7HmgGhM9LT0NhN3ZU4QN6uGG4Lq9djY +f7gcZaE0Vd/7+KLwTa1xXhsai4TfLznH2OQvID2qiNz/KymCd61N+tn/BDPlmWCZ6vYGT3TomO D6TEXmfOqxnaZKxxNHIuhx7Cmq+h9SGLt X-Received: by 2002:a17:903:32ce:b0:1c5:82bb:223b with SMTP id i14-20020a17090332ce00b001c582bb223bmr3093049plr.60.1695086208301; Mon, 18 Sep 2023 18:16:48 -0700 (PDT) X-Received: by 2002:a17:903:32ce:b0:1c5:82bb:223b with SMTP id i14-20020a17090332ce00b001c582bb223bmr3093033plr.60.1695086207927; Mon, 18 Sep 2023 18:16:47 -0700 (PDT) Received: from ?IPV6:2001:8003:e5b0:9f00:dbbc:1945:6e65:ec5? ([2001:8003:e5b0:9f00:dbbc:1945:6e65:ec5]) by smtp.gmail.com with ESMTPSA id g1-20020a170902c38100b001bc2831e1a8sm6580180plg.80.2023.09.18.18.16.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 18 Sep 2023 18:16:47 -0700 (PDT) Message-ID: <9ef55959-66f3-0dc3-dec8-e2b673f965a4@redhat.com> Date: Tue, 19 Sep 2023 11:16:40 +1000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [RFC PATCH v2 26/35] arm64: acpi: Move get_cpu_for_acpi_id() to a header Content-Language: en-US To: James Morse , 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 Cc: x86@kernel.org, Salil Mehta , Russell King , Jean-Philippe Brucker , jianyong.wu@arm.com, justin.he@arm.com References: <20230913163823.7880-1-james.morse@arm.com> <20230913163823.7880-27-james.morse@arm.com> From: Gavin Shan In-Reply-To: <20230913163823.7880-27-james.morse@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.3 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.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 (pete.vger.email [0.0.0.0]); Mon, 18 Sep 2023 18:17:49 -0700 (PDT) On 9/14/23 02:38, James Morse wrote: > 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 > --- > arch/arm64/include/asm/acpi.h | 11 +++++++++++ > arch/arm64/kernel/acpi_numa.c | 11 ----------- > 2 files changed, 11 insertions(+), 11 deletions(-) > Reviewed-by: Gavin Shan > diff --git a/arch/arm64/include/asm/acpi.h b/arch/arm64/include/asm/acpi.h > index 4d537d56eb84..ce5045038e87 100644 > --- a/arch/arm64/include/asm/acpi.h > +++ b/arch/arm64/include/asm/acpi.h > @@ -100,6 +100,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) > {