From patchwork Mon Nov 30 11:27:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Zijlstra X-Patchwork-Id: 11940259 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 888E3C64E8A for ; Mon, 30 Nov 2020 11:38:53 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id F2BE12073C for ; Mon, 30 Nov 2020 11:38:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="IntvTR+I" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F2BE12073C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id AE51E8D000C; Mon, 30 Nov 2020 06:38:31 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A46DA8D000A; Mon, 30 Nov 2020 06:38:31 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 84DAA8D000E; Mon, 30 Nov 2020 06:38:31 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0122.hostedemail.com [216.40.44.122]) by kanga.kvack.org (Postfix) with ESMTP id 616CA8D000C for ; Mon, 30 Nov 2020 06:38:31 -0500 (EST) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 2B3E8181AC553 for ; Mon, 30 Nov 2020 11:38:31 +0000 (UTC) X-FDA: 77540886822.10.wave38_070974d273a1 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin10.hostedemail.com (Postfix) with ESMTP id 0A14A16A046 for ; Mon, 30 Nov 2020 11:38:31 +0000 (UTC) X-HE-Tag: wave38_070974d273a1 X-Filterd-Recvd-Size: 3142 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf18.hostedemail.com (Postfix) with ESMTP for ; Mon, 30 Nov 2020 11:38:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Type:MIME-Version:References: Subject:Cc:To:From:Date:Message-ID:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:In-Reply-To; bh=V9QjUriZDqhHtbmhIGOJQ2OP24LyJ0914LVzwONP/5E=; b=IntvTR+I8tJ7fMvRMnYS9SHGv2 5QTX0u3Exk+2zImll++TftJj9uAShEAa0kGy23ztNLIE5FLk3maTTHXVEimUEglqS6mDzKC4xcGQp bhUOhy38oOdmsupqMBaKTZOsq6SQus4an4hbMDGS4mcZ2MRchReKPNvL/OqZm6aCcXOIFQUCPcYvt +Xtg7s+lMOa9IUwAZVpr9edcR+8VvE87kj3Ijt9X3qXUF/KlZZWMbHV80nym1hF4ijCzh86CdAjNg 0Vj0nMh5mt0b1zl/vabbQkoq1YMdppfUKs0uuqW9LosNXePQ9LuRYm0OR+S7MTNj8X7cLLD4p19/7 lpI2/QUQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kjhVc-0007Qq-5B; Mon, 30 Nov 2020 11:38:20 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 37EB430785A; Mon, 30 Nov 2020 12:38:18 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 0) id EF3D92B84F9CA; Mon, 30 Nov 2020 12:38:17 +0100 (CET) Message-ID: <20201130113603.264918968@infradead.org> User-Agent: quilt/0.66 Date: Mon, 30 Nov 2020 12:27:13 +0100 From: Peter Zijlstra To: x86@kernel.org, willy@infradead.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, aarcange@redhat.com, kirill.shutemov@linux.intel.com, jroedel@suse.de, peterz@infradead.org Subject: [RFC][PATCH 8/9] x86/mm/pae: Use WRITE_ONCE() References: <20201130112705.900705277@infradead.org> MIME-Version: 1.0 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Signed-off-by: Peter Zijlstra (Intel) --- arch/x86/include/asm/pgtable-3level.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) --- a/arch/x86/include/asm/pgtable-3level.h +++ b/arch/x86/include/asm/pgtable-3level.h @@ -27,9 +27,9 @@ */ static inline void native_set_pte(pte_t *ptep, pte_t pte) { - ptep->pte_high = pte.pte_high; + WRITE_ONCE(ptep->pte_high, pte.pte_high); smp_wmb(); - ptep->pte_low = pte.pte_low; + WRITE_ONCE(ptep->pte_low, pte.pte_low); } static inline void native_set_pte_atomic(pte_t *ptep, pte_t pte) @@ -58,14 +58,14 @@ static inline void native_set_pud(pud_t static inline void native_pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep) { - ptep->pte_low = 0; + WRITE_ONCE(ptep->pte_low, 0); smp_wmb(); - ptep->pte_high = 0; + WRITE_ONCE(ptep->pte_high, 0); } static inline void native_pmd_clear(pmd_t *pmdp) { - pmdp->pmd_low = 0; + WRITE_ONCE(pmdp->pmd_low, 0); smp_wmb(); pmdp->pmd_high = 0; }