From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.1 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6F6DAC433E0 for ; Mon, 15 Mar 2021 15:12:51 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BD11564DDF for ; Mon, 15 Mar 2021 15:12:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BD11564DDF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4Dzg010kYWz30Cq for ; Tue, 16 Mar 2021 02:12:49 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=S1L0JIba; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::f2b; helo=mail-qv1-xf2b.google.com; envelope-from=danielhb413@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=S1L0JIba; dkim-atps=neutral Received: from mail-qv1-xf2b.google.com (mail-qv1-xf2b.google.com [IPv6:2607:f8b0:4864:20::f2b]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4DzfzW2Drbz2yYp for ; Tue, 16 Mar 2021 02:12:22 +1100 (AEDT) Received: by mail-qv1-xf2b.google.com with SMTP id q9so2448259qvm.6 for ; Mon, 15 Mar 2021 08:12:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=SsWC72cATsneQ9JENKvjqCvrC5G6MPviehAjVUfTUcs=; b=S1L0JIba5tqegutWX+xhiDA+NEJDxD6E90598hAsy+bnBHCSRTBdslb3DIW3Vttpgk /xDHqEOGB26vZunxVx06Lt2/xUAI/WG7tjdJ8iCDfXCRF0NZMY8kfzzlmzYgLi38r1Qi 6rgEtM531qLUM6zTER84F3y/1g1cKV4Ui3AMOyfdXQ9IDi9zQj8AYf1qLTK4tq3Bugdx hioKR7C/VSfIGmKTU6O4Xtcl9CvO3hREIOERY/F8oABKFajXs5t6nxDbzQA8jHveepNq Lb3ofxwnelZpcipvR1e2YUZtYiJH9Gh7gHn7d7AicQzok0xaI9toRIY1MWOj/zuRMBjA LBsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=SsWC72cATsneQ9JENKvjqCvrC5G6MPviehAjVUfTUcs=; b=lOUB5FVVbPgFB23FnYw8uw/6zVKycHcm5Sr7gMr328ctwVA7Z2MPAIq8Q76spr0v3P 8ujwKMb0WsLjOoV2s8P+BTp8Ybipcep9j+lituhNtBaKr2MEIDPHl013TkUN4E31SPeg e7to5K9p5hyFEsHeT0/vJys/3gSNLRa5ER8evn3QFFfQ+pddUy8olcN8epIvbBTZmqq/ i0byjXxWcE9gutgeDXEf1/B06w2zwbXFHzKRzKmZpB3yjeHyF/mvBikOlt/3DEObprZE 5jYiIMqFD8Q+1Ex3GTrEl/xYcc+nHkMt63jZZGxZXBDuUCOoI1CmotE9jQH7JMT+cTmK EPMg== X-Gm-Message-State: AOAM533fYmCpgZIor8hxUf7QerKvMvp8kXz1X0MptGfO3gtlbnSVQ76C mV86z5f/3M/v/Dkiuy5dIBc= X-Google-Smtp-Source: ABdhPJxaBwYrNo+cRRGlwmIWYusSQpr7ufUllC89Ms50RVwD+YSoLj0BrNarhOR2ndL0C/6DPegVEA== X-Received: by 2002:ad4:44ef:: with SMTP id p15mr25513188qvt.25.1615821127086; Mon, 15 Mar 2021 08:12:07 -0700 (PDT) Received: from ?IPv6:2804:431:c7c7:cc80:21a:fa87:b9b8:5376? ([2804:431:c7c7:cc80:21a:fa87:b9b8:5376]) by smtp.gmail.com with ESMTPSA id j30sm11261143qtv.90.2021.03.15.08.12.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 15 Mar 2021 08:12:06 -0700 (PDT) Subject: Re: [PATCH] powerpc/numa: Fix topology_physical_package_id() on pSeries To: =?UTF-8?Q?C=c3=a9dric_Le_Goater?= , linuxppc-dev@lists.ozlabs.org References: <20210312143154.3181109-1-clg@kaod.org> From: Daniel Henrique Barboza Message-ID: Date: Mon, 15 Mar 2021 12:12:03 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: <20210312143154.3181109-1-clg@kaod.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nathan Lynch , Srikar Dronamraju , Greg Kurz , Vasant Hegde , David Gibson Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On 3/12/21 11:31 AM, Cédric Le Goater wrote: > Initial commit 15863ff3b8da ("powerpc: Make chip-id information > available to userspace") introduce a cpu_to_chip_id() routine for the > PowerNV platform using the "ibm,chip-id" property to query the chip id > of a CPU. But PAPR does not specify such a property and the node id > query is broken. > > Use cpu_to_node() instead which guarantees to have a correct value on > all platforms, PowerNV an pSeries. It is worth mentioning that that this patch will change how topology_physical_package_id() represents in a QEMU guest. Right now, ibm,chip-id in QEMU is matching the socket-id. After this patch, topology_physical_package_id() will now match the NUMA id of the CPU. Reviewed-by: Daniel Henrique Barboza Tested-by: Daniel Henrique Barboza > > Cc: Nathan Lynch > Cc: Srikar Dronamraju > Cc: Vasant Hegde > Signed-off-by: Cédric Le Goater > --- > arch/powerpc/include/asm/topology.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/powerpc/include/asm/topology.h b/arch/powerpc/include/asm/topology.h > index 3beeb030cd78..887c42a4e43d 100644 > --- a/arch/powerpc/include/asm/topology.h > +++ b/arch/powerpc/include/asm/topology.h > @@ -123,7 +123,7 @@ static inline int cpu_to_coregroup_id(int cpu) > #ifdef CONFIG_PPC64 > #include > > -#define topology_physical_package_id(cpu) (cpu_to_chip_id(cpu)) > +#define topology_physical_package_id(cpu) (cpu_to_node(cpu)) > > #define topology_sibling_cpumask(cpu) (per_cpu(cpu_sibling_map, cpu)) > #define topology_core_cpumask(cpu) (cpu_cpu_mask(cpu)) >