Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp765579ybj; Thu, 7 May 2020 07:11:32 -0700 (PDT) X-Google-Smtp-Source: APiQypLBmz9LE8TwM7WdbF+vWhHUpzI/9EFbaJ7lch+z2SYvMGkwpO/LDmkjy+/oCVcjtL5c0/ae X-Received: by 2002:a05:6402:1d1c:: with SMTP id dg28mr11944638edb.315.1588860692140; Thu, 07 May 2020 07:11:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588860692; cv=none; d=google.com; s=arc-20160816; b=u/zZX3twCAsZLW5tB2x0bfBAW2ibPDIAtBsJZ5l646AysBChi+/4hi9quj4h1YECI3 FPwy5dSk55dtU1Db/zxAjro9B3hbp8US7QSnM3b+a6TuuvXUQ+dz/iXQAjkob9wLu6rr 2awzSB191aXk23kZU+brWxGCwXWY4TVx8SxZybvCxcl10EqNXOl6VdkNzsWNuNx5Cmvu BnNuGRQlSUIKseF2zijcWoWo3SJssHfWylkjr0R4IoS13MG8njMBHciY7qSIITd7BLqw dtLID1MCFbtDJcAImuzVzZMFamzli9K+88ko5fRDQFwp3e/XD9/U9i7w2F8bkbCSrqaC 7tOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :robot-unsubscribe:robot-id:message-id:mime-version:references :in-reply-to:cc:subject:to:reply-to:from:date; bh=0J/qf6ydaq5Cexb3Om24V323NXhSzT7/5wMmSb8VQdU=; b=nBcJuYHTGtX35LopNXCOwUIwL+1zlQCre+ezGnZfSOn133+cC7uGghUAOqlL4Ta8fS 1b95CBsoXbN4a57vw+GgRK84ouNnn7+NrItHKghHE52+eVzF5wxyycTVNVDWodqYcWJs dea1oLr1rsxMyWse2wOa+REThyWouJl5AO+mMgy4YiXUdMa+wofONbRuUVFbtJGP/BGb VpuSYH+pbIHfpNOtyVq0qQUH2Ed7B9dM+qCCdGY+LYUIhhdWkcZycWJne4Zajncn991T XeJyVPzWqK9FE2X9zEVBZ41rIhJj43hsWxqvbrH/Q+fp9BdhmJGtPt3DygygLJebpaWl Yk4Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v21si3182055edq.326.2020.05.07.07.11.07; Thu, 07 May 2020 07:11:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728052AbgEGOIN (ORCPT + 99 others); Thu, 7 May 2020 10:08:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726742AbgEGOH0 (ORCPT ); Thu, 7 May 2020 10:07:26 -0400 Received: from Galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6BFD4C05BD43; Thu, 7 May 2020 07:07:26 -0700 (PDT) Received: from [5.158.153.53] (helo=tip-bot2.lab.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1jWhBK-00026u-H6; Thu, 07 May 2020 16:07:22 +0200 Received: from [127.0.1.1] (localhost [IPv6:::1]) by tip-bot2.lab.linutronix.de (Postfix) with ESMTP id 20F311C03AB; Thu, 7 May 2020 16:07:22 +0200 (CEST) Date: Thu, 07 May 2020 14:07:22 -0000 From: "tip-bot2 for Christoph Hellwig" Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/platform] x86/platform/uv: Simplify uv_send_IPI_one() Cc: Christoph Hellwig , Thomas Gleixner , Russ Anderson , x86 , LKML In-Reply-To: <20200504171527.2845224-9-hch@lst.de> References: <20200504171527.2845224-9-hch@lst.de> MIME-Version: 1.0 Message-ID: <158886044210.8414.17434284090917646663.tip-bot2@tip-bot2> X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the x86/platform branch of tip: Commit-ID: 8e77554580250f1185cffd8d3ac6a9b01de05d60 Gitweb: https://git.kernel.org/tip/8e77554580250f1185cffd8d3ac6a9b01de05d60 Author: Christoph Hellwig AuthorDate: Mon, 04 May 2020 19:15:24 +02:00 Committer: Thomas Gleixner CommitterDate: Thu, 07 May 2020 15:32:22 +02:00 x86/platform/uv: Simplify uv_send_IPI_one() Merge two helpers only used by uv_send_IPI_one() into the main function. Signed-off-by: Christoph Hellwig Signed-off-by: Thomas Gleixner Not-acked-by: Dimitri Sivanich Cc: Russ Anderson Link: https://lkml.kernel.org/r/20200504171527.2845224-9-hch@lst.de --- arch/x86/include/asm/uv/uv_hub.h | 20 -------------------- arch/x86/kernel/apic/x2apic_uv_x.c | 19 ++++++++++++++----- 2 files changed, 14 insertions(+), 25 deletions(-) diff --git a/arch/x86/include/asm/uv/uv_hub.h b/arch/x86/include/asm/uv/uv_hub.h index a998e65..8a25d95 100644 --- a/arch/x86/include/asm/uv/uv_hub.h +++ b/arch/x86/include/asm/uv/uv_hub.h @@ -837,26 +837,6 @@ static inline void uv_set_cpu_scir_bits(int cpu, unsigned char value) } extern unsigned int uv_apicid_hibits; -static unsigned long uv_hub_ipi_value(int apicid, int vector, int mode) -{ - apicid |= uv_apicid_hibits; - return (1UL << UVH_IPI_INT_SEND_SHFT) | - ((apicid) << UVH_IPI_INT_APIC_ID_SHFT) | - (mode << UVH_IPI_INT_DELIVERY_MODE_SHFT) | - (vector << UVH_IPI_INT_VECTOR_SHFT); -} - -static inline void uv_hub_send_ipi(int pnode, int apicid, int vector) -{ - unsigned long val; - unsigned long dmode = dest_Fixed; - - if (vector == NMI_VECTOR) - dmode = dest_NMI; - - val = uv_hub_ipi_value(apicid, vector, dmode); - uv_write_global_mmr64(pnode, UVH_IPI_INT, val); -} /* * Get the minimum revision number of the hub chips within the partition. diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c index f1a0142..3830538 100644 --- a/arch/x86/kernel/apic/x2apic_uv_x.c +++ b/arch/x86/kernel/apic/x2apic_uv_x.c @@ -588,12 +588,21 @@ static int uv_wakeup_secondary(int phys_apicid, unsigned long start_rip) static void uv_send_IPI_one(int cpu, int vector) { - unsigned long apicid; - int pnode; + unsigned long apicid = per_cpu(x86_cpu_to_apicid, cpu); + int pnode = uv_apicid_to_pnode(apicid); + unsigned long dmode, val; + + if (vector == NMI_VECTOR) + dmode = dest_NMI; + else + dmode = dest_Fixed; - apicid = per_cpu(x86_cpu_to_apicid, cpu); - pnode = uv_apicid_to_pnode(apicid); - uv_hub_send_ipi(pnode, apicid, vector); + val = (1UL << UVH_IPI_INT_SEND_SHFT) | + ((apicid | uv_apicid_hibits) << UVH_IPI_INT_APIC_ID_SHFT) | + (dmode << UVH_IPI_INT_DELIVERY_MODE_SHFT) | + (vector << UVH_IPI_INT_VECTOR_SHFT); + + uv_write_global_mmr64(pnode, UVH_IPI_INT, val); } static void uv_send_IPI_mask(const struct cpumask *mask, int vector)