[tip:,x86/mm] x86/cpu: Use cpu_feature_enabled() when checking global pages support
Message ID | 167463981101.4906.8494952549894706565.tip-bot2@tip-bot2 |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp186655wrn; Wed, 25 Jan 2023 01:46:19 -0800 (PST) X-Google-Smtp-Source: AMrXdXtri1WlYyGFrr3SmrP3HoHSFgH28GMwTbce2VN5iIR+1pKWcNay1E5T1X8Z3M4ymfn4jrR3 X-Received: by 2002:a05:6402:449a:b0:499:376e:6b2b with SMTP id er26-20020a056402449a00b00499376e6b2bmr33907707edb.0.1674639979635; Wed, 25 Jan 2023 01:46:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674639979; cv=none; d=google.com; s=arc-20160816; b=b88z55UdRJSRRHOATcHQRoF+fyZm5N7LFI90Ul5j52WpKBynToOJ6Gx/00S8mLfiaY cyLXXx3/jVB6aH2KNA+mdXW17DPcZZFqcIJ49TZea7VdeIfKlOrGu/YeZZjPAjgAxVTl 5Hk0RvrAgDTVgAqo8+Fj0ldfZgNF5p3wbrMRxUGfm16c/aeM4fbfn11hxos8U7udoD5J AcByrSdT3nN3SAEWCJfDyc/DvfQ27xx58JYVXJAEV0/yE10F64PdopQFCLtwQRblZ+jv /kQuMTO589JzOvPQRz+St8/Sbc/qfuGhU9wIENOU1Ysrt9G+Mlmp690JRzmzv9fU39Wm 5ToQ== 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:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=vzaEP7E6E1PaybXUfz3v0RQtUATPx3kmREJUUl+Xx80=; b=KRd3ZUUMbjwOnvH8zDTE+jQ65TCGLz6oymFvzvGRJiQ9sCGAHb8B+omvCVqoRx/gNo TU08AEU0A1u05/ekroKDx3p2uh01JTxf2u+8weji0LlfJCEEMBwE3rnJBmUzBKM9eUJo lgJcFBBzcusLTteVdCs8j+uTwV995bemk5ZUzyLQI/Xp26qnK+VFw2jNvLYv04zNg78P FKvQ2MweSA8g7HVElQWAC6UUaOvs8fwdY6WLviCBgnDm2gO8EukTa5WFvvgIOaw6sroC a5SYH5hgQZVsCoYASUiSz10akYzKnVpwl1mZaH7zsl/dX2wjTgoMNiHhO0OEfGWRz0IO 17zA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=eMG7Pavt; dkim=neutral (no key) header.i=@linutronix.de header.b=ofIXQP2O; 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 c17-20020aa7c991000000b0049e1885b53asi5947496edt.575.2023.01.25.01.45.55; Wed, 25 Jan 2023 01:46:19 -0800 (PST) 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=eMG7Pavt; dkim=neutral (no key) header.i=@linutronix.de header.b=ofIXQP2O; 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 S235414AbjAYJoT (ORCPT <rfc822;rust.linux@gmail.com> + 99 others); Wed, 25 Jan 2023 04:44:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235392AbjAYJoN (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 25 Jan 2023 04:44:13 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 549A52726; Wed, 25 Jan 2023 01:43:36 -0800 (PST) Date: Wed, 25 Jan 2023 09:43:31 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1674639811; 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: in-reply-to:in-reply-to:references:references; bh=vzaEP7E6E1PaybXUfz3v0RQtUATPx3kmREJUUl+Xx80=; b=eMG7Pavtv3lgfnqYR/cRzPhsy0TiuRn7yWMRTdBReilm2epvz3mozwC+Ar3RZVvN90mRlW PjejF5RDuBgq9jtIFrmkXjD6Z6X5HjtYZvf3mMnLWATGrvBJ2iS5jahF6IvQvgVUhfud8+ qmyUqXt7u1k/xKqBnoXTW2cOmFyvvsWc2SpGwJsBVNSfHlvDbzUMXiM9aTmOlldLwSuhv7 oDekFtaNH5Dg7+yBapPKg8SBxjRhc4/qInZwYSfBuYLYABtK6OWQPCtzeapklx1gJ+eKPh /jYOG4eGnM9WvKNYZahn8RGLzpD7yssgFd/P0kW+vKBxPryMGWThV/YjlxmwyA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1674639811; 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: in-reply-to:in-reply-to:references:references; bh=vzaEP7E6E1PaybXUfz3v0RQtUATPx3kmREJUUl+Xx80=; b=ofIXQP2O9R4pdYaAw7hB9jcebe6/IZPb0sVs+9OWt6D+Ku6uTQnqoRVyXTl11dMnlTy4qi VzWvv6xArPAnGSCw== From: "tip-bot2 for Borislav Petkov (AMD)" <tip-bot2@linutronix.de> Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/mm] x86/cpu: Use cpu_feature_enabled() when checking global pages support Cc: "Borislav Petkov (AMD)" <bp@alien8.de>, Ingo Molnar <mingo@kernel.org>, x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230125075013.9292-1-bp@alien8.de> References: <20230125075013.9292-1-bp@alien8.de> MIME-Version: 1.0 Message-ID: <167463981101.4906.8494952549894706565.tip-bot2@tip-bot2> Robot-ID: <tip-bot2@linutronix.de> Robot-Unsubscribe: Contact <mailto:tglx@linutronix.de> to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit 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 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755980602434113324?= X-GMAIL-MSGID: =?utf-8?q?1755987291506831832?= |
Series |
[tip:,x86/mm] x86/cpu: Use cpu_feature_enabled() when checking global pages support
|
|
Commit Message
tip-bot2 for Thomas Gleixner
Jan. 25, 2023, 9:43 a.m. UTC
The following commit has been merged into the x86/mm branch of tip: Commit-ID: ebd3ad60a688131de7df1dd05fd2d7c57f542268 Gitweb: https://git.kernel.org/tip/ebd3ad60a688131de7df1dd05fd2d7c57f542268 Author: Borislav Petkov (AMD) <bp@alien8.de> AuthorDate: Wed, 25 Jan 2023 08:50:13 +01:00 Committer: Ingo Molnar <mingo@kernel.org> CommitterDate: Wed, 25 Jan 2023 10:32:06 +01:00 x86/cpu: Use cpu_feature_enabled() when checking global pages support X86_FEATURE_PGE determines whether the CPU has enabled global page translations support. Use the faster cpu_feature_enabled() check to shave off some more cycles when flushing all TLB entries, including the global ones. What this practically saves is: mov 0x82eb308(%rip),%rax # 0xffffffff8935bec8 <boot_cpu_data+40> test $0x20,%ah ... which test the bit. Not a lot, but TLB flushing is a timing-sensitive path, so anything to make it even faster. No functional changes. Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Signed-off-by: Ingo Molnar <mingo@kernel.org> Link: https://lore.kernel.org/r/20230125075013.9292-1-bp@alien8.de --- arch/x86/mm/tlb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c index c1e31e9..92d73cc 100644 --- a/arch/x86/mm/tlb.c +++ b/arch/x86/mm/tlb.c @@ -1205,7 +1205,7 @@ void __flush_tlb_all(void) */ VM_WARN_ON_ONCE(preemptible()); - if (boot_cpu_has(X86_FEATURE_PGE)) { + if (cpu_feature_enabled(X86_FEATURE_PGE)) { __flush_tlb_global(); } else { /*