From patchwork Sat Dec 17 18:55:32 2022 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: 34239 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp1636208wrn; Sat, 17 Dec 2022 10:57:56 -0800 (PST) X-Google-Smtp-Source: AA0mqf4tjrBKTlQiTJJOVJyJuu5hBmxC3IzxOOFSUeIGKpepTCa/bcWLLihMs4WiSFl/fOXH+RXB X-Received: by 2002:a17:906:b0cb:b0:7ba:5d72:2f96 with SMTP id bk11-20020a170906b0cb00b007ba5d722f96mr17636255ejb.22.1671303476809; Sat, 17 Dec 2022 10:57:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671303476; cv=none; d=google.com; s=arc-20160816; b=FN4VYrr3R6BhctFiSLvO0AJbPsScnRcbUZUPN6vfROjZlvqAWwBWMQsBh/ptiA2U8T L7uSCYKH9CNeJmwjFQT0SckS+qSIyhSPA9Qn7/jHoqxqD0LAXSJbBg8kBZ8z8kB1W+bp HCuKmQ8aacl1c/thrNS7ETfBVWbzHa783oUVn87mzPovfd6kKbfDf8h4dYgaX3s2n1oy 0EscRoiGRgit23jbkHM/kbBh71UXKJuX6ATBf/nTjhReLyXMiOe49MoIJLSS4QrbzfwC gX7hksLHj+fJ8JyJt4WFWSdTPHa9wtB5qaFArj5rthsws3s3LWxrn4bhw84o6AbIxV1C 9WTQ== 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=nnhG1yoylZQ4yHA8V2Wi+1iakrx4cPgvIkGwcKrqkG8=; b=0A5wG0VFXnTQSQ6TuuZ+v3xSRs5kVwNyQp3S+SKFHEEsjgYVi8ifGEAKfNb8OtGL2T JcfN/73Y2NmGooGJsDUbBbhP+Lsdi7m6cSf3tBgrO4ablRZv7hUxKwB97XUo6xzz3pPn JdZE5zOTr+L2N+OE5P5PE730nqBST9nb1tF06VhVBlQXXZ1KEMHc+xDY7JZvSFsjtM5w JNQPCUr2+xR1QkgZygYxm858fqV9plOstAzOAxyZAxOslsKNbH2Qc2UP1GoGGYybrfdc TpWYEiENbOLb4ToJV78sCv9R93Znnwx7Hb5DNe8p3UZzkNknB94UAaqX7NyyOOVtcpOy 4XLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=zEOiwGcZ; dkim=neutral (no key) header.i=@linutronix.de header.b="AqDe/RXR"; 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 l26-20020a170906079a00b007c10ac8f9afsi4525795ejc.807.2022.12.17.10.57.34; Sat, 17 Dec 2022 10:57:56 -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=zEOiwGcZ; dkim=neutral (no key) header.i=@linutronix.de header.b="AqDe/RXR"; 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 S230323AbiLQS4s (ORCPT + 99 others); Sat, 17 Dec 2022 13:56:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230039AbiLQSzi (ORCPT ); Sat, 17 Dec 2022 13:55:38 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 388842D5; Sat, 17 Dec 2022 10:55:37 -0800 (PST) Date: Sat, 17 Dec 2022 18:55:32 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1671303333; 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=nnhG1yoylZQ4yHA8V2Wi+1iakrx4cPgvIkGwcKrqkG8=; b=zEOiwGcZsApXtm8iXT2w9pC6EGvpDuVv4j3vys2Wq5+yXOSlp0Mbz0IvJD2culVKDs45MW V4IxDx9vuzjnibp0kjPFjkpiYpquFCZvLtlSq25K0Y1RTQLfCL8WNoL/4NEtKPy+0RPYTd HrWgvni6i1osNxJlgI53S3CHa7iZ9rhExtOFavtSibNL2B32emwdWHpx9jXDJP6KB+7gq5 OFllO/rPcZkuE/srYJhgFtf/K13lU96eIUQ0dZ/UMa+xxXNViTMB7TQ6R7UqVyN1DMR9uS hsx0OiRzfzhCrnL1bsE64wWfVIGE0SJN1fGOW7PGPAIQdjbE1h+bjOR29D/DsQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1671303333; 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=nnhG1yoylZQ4yHA8V2Wi+1iakrx4cPgvIkGwcKrqkG8=; b=AqDe/RXRtimJNan3OEXfrKfJ11GiHP3Ox0QoFcAccVSrAtLonPsi8/nGo/UvSNmSH0MNNP AxPHXwAxelhUN0CQ== From: "tip-bot2 for Peter Zijlstra" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/mm] x86/mm/pae: Don't (ab)use atomic64 Cc: "Peter Zijlstra (Intel)" , x86@kernel.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Message-ID: <167130333280.4906.12675723278515944040.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 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?1752488714544741343?= X-GMAIL-MSGID: =?utf-8?q?1752488714544741343?= The following commit has been merged into the x86/mm branch of tip: Commit-ID: 7a9b8bdb6af3e19fb8e3dc7a3caf6a9ea1bed8cd Gitweb: https://git.kernel.org/tip/7a9b8bdb6af3e19fb8e3dc7a3caf6a9ea1bed8cd Author: Peter Zijlstra AuthorDate: Thu, 26 Nov 2020 17:38:42 +01:00 Committer: Dave Hansen CommitterDate: Thu, 15 Dec 2022 10:37:27 -08:00 x86/mm/pae: Don't (ab)use atomic64 PAE implies CX8, write readable code. Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20221022114424.971450128%40infradead.org --- arch/x86/include/asm/pgtable-3level.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/arch/x86/include/asm/pgtable-3level.h b/arch/x86/include/asm/pgtable-3level.h index 94f50b0..0a1b81d 100644 --- a/arch/x86/include/asm/pgtable-3level.h +++ b/arch/x86/include/asm/pgtable-3level.h @@ -2,8 +2,6 @@ #ifndef _ASM_X86_PGTABLE_3LEVEL_H #define _ASM_X86_PGTABLE_3LEVEL_H -#include - /* * Intel Physical Address Extension (PAE) Mode - three-level page * tables on PPro+ CPUs. @@ -95,11 +93,12 @@ static inline void pud_clear(pud_t *pudp) #ifdef CONFIG_SMP static inline pte_t native_ptep_get_and_clear(pte_t *ptep) { - pte_t res; + pte_t old = *ptep; - res.pte = (pteval_t)arch_atomic64_xchg((atomic64_t *)ptep, 0); + do { + } while (!try_cmpxchg64(&ptep->pte, &old.pte, 0ULL)); - return res; + return old; } #else #define native_ptep_get_and_clear(xp) native_local_ptep_get_and_clear(xp)