From mboxrd@z Thu Jan 1 00:00:00 1970 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=-10.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable 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 4D3C4C48BDF for ; Fri, 18 Jun 2021 15:28:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 38D78610C7 for ; Fri, 18 Jun 2021 15:28:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235263AbhFRPae (ORCPT ); Fri, 18 Jun 2021 11:30:34 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:49705 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235749AbhFRP3i (ORCPT ); Fri, 18 Jun 2021 11:29:38 -0400 Received: from localhost (mailhub3.si.c-s.fr [192.168.12.233]) by localhost (Postfix) with ESMTP id 4G62q23V0dzBCLV; Fri, 18 Jun 2021 17:27:26 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id agQHzAYYeUsd; Fri, 18 Jun 2021 17:27:26 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 4G62q12wtwzBCL9; Fri, 18 Jun 2021 17:27:25 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 5059F8B84B; Fri, 18 Jun 2021 17:27:25 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id 9CJLhPmF_CRb; Fri, 18 Jun 2021 17:27:25 +0200 (CEST) Received: from [192.168.4.90] (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 814148B84A; Fri, 18 Jun 2021 17:27:24 +0200 (CEST) Subject: Re: [PATCH 8/8] membarrier: Rewrite sync_core_before_usermode() and improve documentation To: Andy Lutomirski , Nicholas Piggin , x86@kernel.org Cc: Will Deacon , linux-mm@kvack.org, Peter Zijlstra , LKML , stable@vger.kernel.org, Dave Hansen , Mathieu Desnoyers , Catalin Marinas , Paul Mackerras , Andrew Morton , linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org References: <07a8b963002cb955b7516e61bad19514a3acaa82.1623813516.git.luto@kernel.org> <1623818343.eko1v01gvr.astroid@bobo.none> <1e248763-9372-6e4e-5dea-cda999000aeb@kernel.org> From: Christophe Leroy Message-ID: Date: Fri, 18 Jun 2021 17:27:21 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <1e248763-9372-6e4e-5dea-cda999000aeb@kernel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 16/06/2021 à 20:52, Andy Lutomirski a écrit : > On 6/15/21 9:45 PM, Nicholas Piggin wrote: >> Excerpts from Andy Lutomirski's message of June 16, 2021 1:21 pm: >>> The old sync_core_before_usermode() comments suggested that a non-icache-syncing >>> return-to-usermode instruction is x86-specific and that all other >>> architectures automatically notice cross-modified code on return to >>> userspace. > >>> +/* >>> + * XXX: can a powerpc person put an appropriate comment here? >>> + */ >>> +static inline void membarrier_sync_core_before_usermode(void) >>> +{ >>> +} >>> + >>> +#endif /* _ASM_POWERPC_SYNC_CORE_H */ >> >> powerpc's can just go in asm/membarrier.h > > $ ls arch/powerpc/include/asm/membarrier.h > ls: cannot access 'arch/powerpc/include/asm/membarrier.h': No such file > or directory https://github.com/torvalds/linux/blob/master/arch/powerpc/include/asm/membarrier.h Was added by https://github.com/torvalds/linux/commit/3ccfebedd8cf54e291c809c838d8ad5cc00f5688 > > >> >> /* >> * The RFI family of instructions are context synchronising, and >> * that is how we return to userspace, so nothing is required here. >> */ > > Thanks! > From mboxrd@z Thu Jan 1 00:00:00 1970 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=-10.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 BCD65C48BDF for ; Fri, 18 Jun 2021 15:27:58 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DBEFB6100A for ; Fri, 18 Jun 2021 15:27:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DBEFB6100A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=csgroup.eu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4G62qd0gYDz3c6p for ; Sat, 19 Jun 2021 01:27:57 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=csgroup.eu (client-ip=93.17.236.30; helo=pegase1.c-s.fr; envelope-from=christophe.leroy@csgroup.eu; receiver=) Received: from pegase1.c-s.fr (pegase1.c-s.fr [93.17.236.30]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4G62qF2zxhz2yY7 for ; Sat, 19 Jun 2021 01:27:33 +1000 (AEST) Received: from localhost (mailhub3.si.c-s.fr [192.168.12.233]) by localhost (Postfix) with ESMTP id 4G62q23V0dzBCLV; Fri, 18 Jun 2021 17:27:26 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id agQHzAYYeUsd; Fri, 18 Jun 2021 17:27:26 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 4G62q12wtwzBCL9; Fri, 18 Jun 2021 17:27:25 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 5059F8B84B; Fri, 18 Jun 2021 17:27:25 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id 9CJLhPmF_CRb; Fri, 18 Jun 2021 17:27:25 +0200 (CEST) Received: from [192.168.4.90] (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 814148B84A; Fri, 18 Jun 2021 17:27:24 +0200 (CEST) Subject: Re: [PATCH 8/8] membarrier: Rewrite sync_core_before_usermode() and improve documentation To: Andy Lutomirski , Nicholas Piggin , x86@kernel.org References: <07a8b963002cb955b7516e61bad19514a3acaa82.1623813516.git.luto@kernel.org> <1623818343.eko1v01gvr.astroid@bobo.none> <1e248763-9372-6e4e-5dea-cda999000aeb@kernel.org> From: Christophe Leroy Message-ID: Date: Fri, 18 Jun 2021 17:27:21 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <1e248763-9372-6e4e-5dea-cda999000aeb@kernel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 8bit X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dave Hansen , Peter Zijlstra , Catalin Marinas , linuxppc-dev@lists.ozlabs.org, LKML , stable@vger.kernel.org, linux-mm@kvack.org, Mathieu Desnoyers , Paul Mackerras , Andrew Morton , Will Deacon , linux-arm-kernel@lists.infradead.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" Le 16/06/2021 à 20:52, Andy Lutomirski a écrit : > On 6/15/21 9:45 PM, Nicholas Piggin wrote: >> Excerpts from Andy Lutomirski's message of June 16, 2021 1:21 pm: >>> The old sync_core_before_usermode() comments suggested that a non-icache-syncing >>> return-to-usermode instruction is x86-specific and that all other >>> architectures automatically notice cross-modified code on return to >>> userspace. > >>> +/* >>> + * XXX: can a powerpc person put an appropriate comment here? >>> + */ >>> +static inline void membarrier_sync_core_before_usermode(void) >>> +{ >>> +} >>> + >>> +#endif /* _ASM_POWERPC_SYNC_CORE_H */ >> >> powerpc's can just go in asm/membarrier.h > > $ ls arch/powerpc/include/asm/membarrier.h > ls: cannot access 'arch/powerpc/include/asm/membarrier.h': No such file > or directory https://github.com/torvalds/linux/blob/master/arch/powerpc/include/asm/membarrier.h Was added by https://github.com/torvalds/linux/commit/3ccfebedd8cf54e291c809c838d8ad5cc00f5688 > > >> >> /* >> * The RFI family of instructions are context synchronising, and >> * that is how we return to userspace, so nothing is required here. >> */ > > Thanks! > From mboxrd@z Thu Jan 1 00:00:00 1970 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=-10.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 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 4889DC48BDF for ; Fri, 18 Jun 2021 15:29:06 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0B7F5610C7 for ; Fri, 18 Jun 2021 15:29:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0B7F5610C7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=csgroup.eu Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:Cc:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=pyCPyp6bh7oUoGOHv4/bkIXpBUfw8YsO8YfxkJf2FIM=; b=A/8ozd9klsn1Ywbsj9B/7mZafH sbN17sifezXPlIFbhu58918QSwhpVvTjQdhf+IIs3I9xMQDxXmepdTHDps768Prf27fcY3O1UW6eG Eq9frLsO5XU/e3HIrBrBvq1RrAxdG9NhtRmfBSokGTTg/VhUk0mkH28+EaD8kIXuB16UTmJ7ex/pg IcB/5ZaAaxx7qsVawMiKMbV/e0DsnHqLbHZbqTKudmME5SJy2gx7cknASD8tYl5WDwRhPqISB0lv3 rmB37Uq9eH9b+2twBEOZkHK3nPaVY2/ZK9Rgls6SCAhoQupJnJJBkq6nVCbIIBrowPkGxs2w9ojPJ 4dD7G8qw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1luGP7-00EjHV-RL; Fri, 18 Jun 2021 15:27:33 +0000 Received: from pegase1.c-s.fr ([93.17.236.30]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1luGP3-00EjGS-Hi for linux-arm-kernel@lists.infradead.org; Fri, 18 Jun 2021 15:27:31 +0000 Received: from localhost (mailhub3.si.c-s.fr [192.168.12.233]) by localhost (Postfix) with ESMTP id 4G62q23V0dzBCLV; Fri, 18 Jun 2021 17:27:26 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id agQHzAYYeUsd; Fri, 18 Jun 2021 17:27:26 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 4G62q12wtwzBCL9; Fri, 18 Jun 2021 17:27:25 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 5059F8B84B; Fri, 18 Jun 2021 17:27:25 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id 9CJLhPmF_CRb; Fri, 18 Jun 2021 17:27:25 +0200 (CEST) Received: from [192.168.4.90] (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 814148B84A; Fri, 18 Jun 2021 17:27:24 +0200 (CEST) Subject: Re: [PATCH 8/8] membarrier: Rewrite sync_core_before_usermode() and improve documentation To: Andy Lutomirski , Nicholas Piggin , x86@kernel.org Cc: Will Deacon , linux-mm@kvack.org, Peter Zijlstra , LKML , stable@vger.kernel.org, Dave Hansen , Mathieu Desnoyers , Catalin Marinas , Paul Mackerras , Andrew Morton , linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org References: <07a8b963002cb955b7516e61bad19514a3acaa82.1623813516.git.luto@kernel.org> <1623818343.eko1v01gvr.astroid@bobo.none> <1e248763-9372-6e4e-5dea-cda999000aeb@kernel.org> From: Christophe Leroy Message-ID: Date: Fri, 18 Jun 2021 17:27:21 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <1e248763-9372-6e4e-5dea-cda999000aeb@kernel.org> Content-Language: fr X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210618_082729_789375_008882C6 X-CRM114-Status: GOOD ( 10.94 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: base64 Content-Type: text/plain; charset="utf-8"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org CgpMZSAxNi8wNi8yMDIxIMOgIDIwOjUyLCBBbmR5IEx1dG9taXJza2kgYSDDqWNyaXTCoDoKPiBP biA2LzE1LzIxIDk6NDUgUE0sIE5pY2hvbGFzIFBpZ2dpbiB3cm90ZToKPj4gRXhjZXJwdHMgZnJv bSBBbmR5IEx1dG9taXJza2kncyBtZXNzYWdlIG9mIEp1bmUgMTYsIDIwMjEgMToyMSBwbToKPj4+ IFRoZSBvbGQgc3luY19jb3JlX2JlZm9yZV91c2VybW9kZSgpIGNvbW1lbnRzIHN1Z2dlc3RlZCB0 aGF0IGEgbm9uLWljYWNoZS1zeW5jaW5nCj4+PiByZXR1cm4tdG8tdXNlcm1vZGUgaW5zdHJ1Y3Rp b24gaXMgeDg2LXNwZWNpZmljIGFuZCB0aGF0IGFsbCBvdGhlcgo+Pj4gYXJjaGl0ZWN0dXJlcyBh dXRvbWF0aWNhbGx5IG5vdGljZSBjcm9zcy1tb2RpZmllZCBjb2RlIG9uIHJldHVybiB0bwo+Pj4g dXNlcnNwYWNlLgo+IAo+Pj4gKy8qCj4+PiArICogWFhYOiBjYW4gYSBwb3dlcnBjIHBlcnNvbiBw dXQgYW4gYXBwcm9wcmlhdGUgY29tbWVudCBoZXJlPwo+Pj4gKyAqLwo+Pj4gK3N0YXRpYyBpbmxp bmUgdm9pZCBtZW1iYXJyaWVyX3N5bmNfY29yZV9iZWZvcmVfdXNlcm1vZGUodm9pZCkKPj4+ICt7 Cj4+PiArfQo+Pj4gKwo+Pj4gKyNlbmRpZiAvKiBfQVNNX1BPV0VSUENfU1lOQ19DT1JFX0ggKi8K Pj4KPj4gcG93ZXJwYydzIGNhbiBqdXN0IGdvIGluIGFzbS9tZW1iYXJyaWVyLmgKPiAKPiAkIGxz IGFyY2gvcG93ZXJwYy9pbmNsdWRlL2FzbS9tZW1iYXJyaWVyLmgKPiBsczogY2Fubm90IGFjY2Vz cyAnYXJjaC9wb3dlcnBjL2luY2x1ZGUvYXNtL21lbWJhcnJpZXIuaCc6IE5vIHN1Y2ggZmlsZQo+ IG9yIGRpcmVjdG9yeQoKaHR0cHM6Ly9naXRodWIuY29tL3RvcnZhbGRzL2xpbnV4L2Jsb2IvbWFz dGVyL2FyY2gvcG93ZXJwYy9pbmNsdWRlL2FzbS9tZW1iYXJyaWVyLmgKCgpXYXMgYWRkZWQgYnkg aHR0cHM6Ly9naXRodWIuY29tL3RvcnZhbGRzL2xpbnV4L2NvbW1pdC8zY2NmZWJlZGQ4Y2Y1NGUy OTFjODA5YzgzOGQ4YWQ1Y2MwMGY1Njg4Cgo+IAo+IAo+Pgo+PiAvKgo+PiAgICogVGhlIFJGSSBm YW1pbHkgb2YgaW5zdHJ1Y3Rpb25zIGFyZSBjb250ZXh0IHN5bmNocm9uaXNpbmcsIGFuZAo+PiAg ICogdGhhdCBpcyBob3cgd2UgcmV0dXJuIHRvIHVzZXJzcGFjZSwgc28gbm90aGluZyBpcyByZXF1 aXJlZCBoZXJlLgo+PiAgICovCj4gCj4gVGhhbmtzIQo+IAoKX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KbGludXgtYXJtLWtlcm5lbCBtYWlsaW5nIGxpc3QK bGludXgtYXJtLWtlcm5lbEBsaXN0cy5pbmZyYWRlYWQub3JnCmh0dHA6Ly9saXN0cy5pbmZyYWRl YWQub3JnL21haWxtYW4vbGlzdGluZm8vbGludXgtYXJtLWtlcm5lbAo=