From patchwork Wed Nov 2 09:12:38 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: 14126 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3503925wru; Wed, 2 Nov 2022 02:14:32 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5fMV2daNx6SYkBmZgiZ/4FLWcQrnv+X9/fH3G9VBrLX/VBc1P3AmG+15HY5cEtu/C1MU8A X-Received: by 2002:a62:a512:0:b0:536:e2bd:e15e with SMTP id v18-20020a62a512000000b00536e2bde15emr24441496pfm.1.1667380471964; Wed, 02 Nov 2022 02:14:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667380471; cv=none; d=google.com; s=arc-20160816; b=g3yzYrTF2xzb0WrB6Pk+DkdRyl1cpCl6/A1MoJt0p77Hjv8AnqrNgAcwZSQqKvPyv6 8bdEVDy4QDgRuoGR3aCpwvahFSlzuO6HHqKqju+AeTsPy7efWHnZxauLALSvIqtjYfP3 NRY6qcRJaEv3tB7Au7b00T/7JY9HdqQ4mF0t9M1rfbTdl/1RtlQlZ9E4y6O6OjmiJQbT lt3dbH2FOIehBTxsw6HYi8Yusg+jf2eADrjZgcKyAtNwf8gyLMMC1hl8AaANBZwTaPzv L5cjwKGGAuTlCRNFZCQUYgkAqVir+yaAtpyMfgsRqKQiR6uX7srsP0vZhhRcK03VvlBr wkIg== 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=fU47EUKC4U4OsnqSfoay35OX31MeTDwt/5o2wlBWrec=; b=ED7A1Ek9F34Hun2dy+xKmphLJYOieULENuzUXZ/aIu3GSHQjGMsUFiOqW680gm5PZk H/aXGrPgGaD8n2armx/HokRKJLuFOsNuxCAWjx8aGVik4MuEqvbQ5HCKP/+qX9ju9ozq FS3kBQLjc2HU10OLI5LJRrfUJqaC3AoF7GlrBEem9JNOyvd28b3bJp/Z3ql3MotNCJUV tqy600IvKrW/1Gzmrj4jE6CPDbjJtLyLZuLdnM88x7hy2PSCQbCwd1bgUF4Uwh4gNl5o 4mHPcJvpvRaQY3foArt2h8snzaWn6nniOrIGfmQx++S7Fwzb+1b5V0z6CBXwDM/QEcO5 +Dng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=gYeWZCLx; dkim=neutral (no key) header.i=@linutronix.de; 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 e18-20020a17090301d200b001768452d4d0si17662953plh.30.2022.11.02.02.14.18; Wed, 02 Nov 2022 02:14:31 -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=gYeWZCLx; dkim=neutral (no key) header.i=@linutronix.de; 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 S231332AbiKBJNl (ORCPT + 99 others); Wed, 2 Nov 2022 05:13:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231330AbiKBJMm (ORCPT ); Wed, 2 Nov 2022 05:12:42 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 380BD28709; Wed, 2 Nov 2022 02:12:41 -0700 (PDT) Date: Wed, 02 Nov 2022 09:12:38 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1667380359; 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=fU47EUKC4U4OsnqSfoay35OX31MeTDwt/5o2wlBWrec=; b=gYeWZCLx9diIdJ5L6x2bpTn/s8z/TCCETe3bC0J/eV0Ky0XIAsQVuLWpthQug9pK/H3vMr lJZ9LqA4EwM+UtctnRuMIIRi8D5AK/2Pm8KNLDzbFnvo38R/uP/R8J1Jnvdwacg1X40enX 24oVjg9HF5K3fzRLP17yUckeO/TaiR5q1UoLtwFJ1iMoBVse6HpqnpM1ku7SDXiC+dwFLT wEv7mTmPdQv84BqWsEYhs38cVMcGXQYUFOfvhny09POULCMuyqK3FTbKzcID4XAwWPlrYB hEnjVzfYeewerO307fhFHI1cZYsvgJQjlwOkZlPODzVVmgqKVcyCCBgPuFcM9A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1667380359; 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=fU47EUKC4U4OsnqSfoay35OX31MeTDwt/5o2wlBWrec=; b=wCxNmaIccdNJN6nNtfT1PV9LkZHuYmtHNhpGZPOfdiPlvVmSsjWEZJqQncWpY6+K5jkyty rTkJQvFTSXAv2wBA== 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: <166738035851.7716.7987336244095815440.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?1748375145802687943?= X-GMAIL-MSGID: =?utf-8?q?1748375145802687943?= The following commit has been merged into the x86/mm branch of tip: Commit-ID: a677802d5b0258f93f54620e1cd181b56547c36c Gitweb: https://git.kernel.org/tip/a677802d5b0258f93f54620e1cd181b56547c36c Author: Peter Zijlstra AuthorDate: Thu, 26 Nov 2020 17:38:42 +01:00 Committer: Peter Zijlstra CommitterDate: Tue, 01 Nov 2022 13:44:03 +01: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)