From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (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 B4054136658 for ; Sun, 22 Dec 2024 04:07:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=96.67.55.147 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734840476; cv=none; b=cn4C1sVQrASNrE7BC2wYF7f/u7bXDTcI12kqnkP5sSpqL1hsHq9yu1QElZunBcSoar0Kw472lymnUHuUr7LQyspATGgPxH+8Q2oMfnP6sXo37wbxhhPCstaveRU+Y4sE5vrVWvPSYrcvdauy3FLX6i58oURfcuiyqMZc+iOa4V0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734840476; c=relaxed/simple; bh=KOXF+1fTm1721E6Jvfcgoye+Ok7Tz6N9SEZ7D5MIDuU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RHhBvvnIsTQujYFW0QeYjdcuJ9WvokiIj5flmFuMxJZvUfZ7anPaOsLZfXkGuIIoSk7RaSvb4xqUpcShQFjTfVK4yFVJuOegWG4Y2RjdShOFXe1bj4bJj8ImZDuoxeYmcUp4df7dIEren4t3lx3f98RRem8f+c445lvDB4Py6VA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=surriel.com; spf=pass smtp.mailfrom=shelob.surriel.com; arc=none smtp.client-ip=96.67.55.147 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=surriel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=shelob.surriel.com Received: from fangorn.home.surriel.com ([10.0.13.7]) by shelob.surriel.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.97.1) (envelope-from ) id 1tPDFT-000000000V0-2Kh0; Sat, 21 Dec 2024 23:07:23 -0500 From: Rik van Riel To: x86@kernel.org Cc: linux-kernel@vger.kernel.org, kernel-team@meta.com, dave.hansen@linux.intel.com, luto@kernel.org, peterz@infradead.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, hpa@zytor.com, akpm@linux-foundation.org, Rik van Riel Subject: [PATCH 05/10] x86,tlb: use INVLPGB in flush_tlb_all Date: Sat, 21 Dec 2024 23:06:37 -0500 Message-ID: <20241222040717.3096835-6-riel@surriel.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241222040717.3096835-1-riel@surriel.com> References: <20241222040717.3096835-1-riel@surriel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: riel@surriel.com The flush_tlb_all() function is not used a whole lot, but we might as well use broadcast TLB flushing there, too. Signed-off-by: Rik van Riel --- arch/x86/mm/tlb.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c index 09980fb17907..bf85cd0590d5 100644 --- a/arch/x86/mm/tlb.c +++ b/arch/x86/mm/tlb.c @@ -1074,6 +1074,11 @@ static void do_flush_tlb_all(void *info) void flush_tlb_all(void) { count_vm_tlb_event(NR_TLB_REMOTE_FLUSH); + if (static_cpu_has(X86_FEATURE_INVLPGB)) { + invlpgb_flush_all(); + tlbsync(); + return; + } on_each_cpu(do_flush_tlb_all, NULL, 1); } -- 2.47.1