From patchwork Wed May 31 22:13:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 101598 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp3213609vqr; Wed, 31 May 2023 15:22:15 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7BNnV+ebGSH4dmdzHMES9juqAX8ymYuJwK5yZpADVAmWtpigXtyeRmYIIJociYtGaVT4AJ X-Received: by 2002:a05:6a00:2da6:b0:64d:7314:6596 with SMTP id fb38-20020a056a002da600b0064d73146596mr6548340pfb.27.1685571735051; Wed, 31 May 2023 15:22:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685571735; cv=none; d=google.com; s=arc-20160816; b=lYqIdUK1Zzf2XaURurA2o4114ySBrDgyuhAPs5tC3snN0EBbx2j3losFz2SHwc5UTB v46aV6NHiI0q0oOQf4LpdNKgYLOUbNEfR8jtqNGuIRvtrs4pGo1joSBlhx6fdMlbCVW3 HHs1L+xYTG2PB0gNOpPoc5w/+jG6Kz9HwzdG+XZT04Jnd2oiGhMcKtxzNID0SFyfduVY qz1XXng+wR9qlj3YUb9CVfOtg26N1c5J41lYajpaaaO1i/8McRdOMzGmWTvPgA+aSMuK NcgPZla9OfXuvWB5LTg3Yl9+m3K8R/os+mrzm5Y8N0+UfJ8KkEaJO+MUHbOhnXtm+1Ub ioAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:cc:subject:to:reply-to:sender:from :dkim-signature:dkim-signature:date; bh=1pcpTxBqkRvq4f7Rr5CH8vPLuAphaJIJpXrzDaeWuWc=; b=RG2dGyCQFxabpUhwxfK22KjqHd9M/OXyDIbxpaW43A6SMWC5J0ycyQehJHTu0qXRm9 is+y9Jp5KrjlAbN6zNa0UpjXNowarxU35ph7jSilmZBZAXk0qo6/O+vdcdsvwsmnfehX 4+AvaIRz8W6h8KUnQA191TzZXky9+gC7sseV9IZfsynlzKaVA64V/zBHBG/9RoLU7uIS ZhLYsVVR8E5yKmJAzPPmlYjZZG7S2+8hsgBZA0JsfDVwGjdVnC/JVHDUP+Uhzdsvviao SUizOZRlngyGej0EqaFi4kNQifA4nJCLoYfRQ4e/ucPXUTw1lsVKuPPPnxDTwpGokWcr AqNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="Z/q6i98z"; dkim=neutral (no key) header.i=@linutronix.de header.b=jFG3R0xV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m16-20020a637110000000b0053f477a4659si1776520pgc.320.2023.05.31.15.22.00; Wed, 31 May 2023 15:22:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="Z/q6i98z"; dkim=neutral (no key) header.i=@linutronix.de header.b=jFG3R0xV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231145AbjEaWP0 (ORCPT + 99 others); Wed, 31 May 2023 18:15:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230503AbjEaWOe (ORCPT ); Wed, 31 May 2023 18:14:34 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42C2B13D; Wed, 31 May 2023 15:14:13 -0700 (PDT) Date: Wed, 31 May 2023 22:13:38 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1685571219; h=from:from:sender:sender:reply-to: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; bh=1pcpTxBqkRvq4f7Rr5CH8vPLuAphaJIJpXrzDaeWuWc=; b=Z/q6i98z5Tb0t/syH2GkMDkCkQcdKY7KLhvYnsNkzrVEjOdA6aVygSutZ6LBEHBAVogupU qC7ZSOamfOGAD/+jWTliYlmXXHeKm9e2dYE21lIth7ho2D4MJfYUoCHrlNVlG3Y9H2sqSX lTsqF2A5EADq/ASJLIF0vhq6+S4tumLO5Zu4uLznoHlvbyUoMQO1skD92Rw27Qxg612EEl 8gcuR4s6sROtQQjSLw4XMYATjWjZx701uXeJpfMN+WJMuaVC8T48f0QLHl3c72a9vDcFoP jupHJ8fDW6DyhWp+sUId7Lb5otnRRrgOwhfM+fMYr13+9BfgrwhKseQH5Gyryw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1685571219; h=from:from:sender:sender:reply-to: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; bh=1pcpTxBqkRvq4f7Rr5CH8vPLuAphaJIJpXrzDaeWuWc=; b=jFG3R0xVyBsgW/WhU9J/rHea0PONCGBH9lotIS0WhbWS+DWro1hjWLvdKVhvEiqNb5lN21 kowIKdlKr9kp4PCA== From: "tip-bot2 for Steve Wahl" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/platform] x86/platform/uv: Introduce helper function uv_pnode_to_socket. Cc: Steve Wahl , Dave Hansen , x86@kernel.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Message-ID: <168557121871.404.938275922115349330.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767450067488162150?= X-GMAIL-MSGID: =?utf-8?q?1767450067488162150?= The following commit has been merged into the x86/platform branch of tip: Commit-ID: 8c646cee0ae3c0a19a7d9fdb847c45c729cae945 Gitweb: https://git.kernel.org/tip/8c646cee0ae3c0a19a7d9fdb847c45c729cae945 Author: Steve Wahl AuthorDate: Fri, 19 May 2023 14:07:46 -05:00 Committer: Dave Hansen CommitterDate: Wed, 31 May 2023 09:34:59 -07:00 x86/platform/uv: Introduce helper function uv_pnode_to_socket. Add and use uv_pnode_to_socket() function, which parallels other helper functions in here, and will enable avoiding duplicate code in an upcoming patch. Signed-off-by: Steve Wahl Signed-off-by: Dave Hansen Link: https://lore.kernel.org/all/20230519190752.3297140-3-steve.wahl%40hpe.com --- arch/x86/include/asm/uv/uv_hub.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/arch/x86/include/asm/uv/uv_hub.h b/arch/x86/include/asm/uv/uv_hub.h index d3e3197..0acfd17 100644 --- a/arch/x86/include/asm/uv/uv_hub.h +++ b/arch/x86/include/asm/uv/uv_hub.h @@ -519,18 +519,24 @@ static inline int uv_socket_to_node(int socket) return _uv_socket_to_node(socket, uv_hub_info->socket_to_node); } +static inline int uv_pnode_to_socket(int pnode) +{ + unsigned short *p2s = uv_hub_info->pnode_to_socket; + + return p2s ? p2s[pnode - uv_hub_info->min_pnode] : pnode; +} + /* pnode, offset --> socket virtual */ static inline void *uv_pnode_offset_to_vaddr(int pnode, unsigned long offset) { unsigned int m_val = uv_hub_info->m_val; unsigned long base; - unsigned short sockid, node, *p2s; + unsigned short sockid, node; if (m_val) return __va(((unsigned long)pnode << m_val) | offset); - p2s = uv_hub_info->pnode_to_socket; - sockid = p2s ? p2s[pnode - uv_hub_info->min_pnode] : pnode; + sockid = uv_pnode_to_socket(pnode); node = uv_socket_to_node(sockid); /* limit address of previous socket is our base, except node 0 is 0 */