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=-6.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 00F95C2B9F4 for ; Fri, 18 Jun 2021 00:14:51 +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 AA171613B9 for ; Fri, 18 Jun 2021 00:14:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AA171613B9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org 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-Transfer-Encoding:Content-Type: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=V648pg6VNGTg+CwZu5kpctNS0rCuyQOBQH9RsJr028k=; b=edyZMMYhQGfST83pc26EYxJX1e OuBW2yy25D/LrIcc4jiYeiT/c9lIZykPASpR36iT/b5vuIgLvRs3dJHXr3qnflJXOIe2T8rFy9VqD YOt11dB2uCCqLtjIcTcOZ7kXFtwpovMuefNifh4XTE+Imsbno6JXZGBwul4WBY599z/kO5yTPK1or Um0IlCOvmRCN7YTODIZQ7FOYghju9UkYeD8lFWxrYXaOR2AKdqYmeyiCgC9TTk0BjNuVa0F5pQ1WQ BGyX5b1l9Z8WWUZyvBU2LtifodgHTaKhNejtb2n4efcE9nw53C0DD9Y3W6ynouNHZZ0c7Y7lRuwgj kVl5+Zeg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lu28Y-00CAcd-9z; Fri, 18 Jun 2021 00:13:30 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lu28U-00CAas-MG for linux-arm-kernel@lists.infradead.org; Fri, 18 Jun 2021 00:13:27 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id C22EC613B4; Fri, 18 Jun 2021 00:13:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1623975206; bh=nM5X1GSDxCk8rh3UgTy/aR3zlWC0sDSSq0YpILKyEOw=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=OMVzzQM29lbdahlsKSCVkJIHPNqJWdv46bej0dxQNvHfFZ1lx+2X51jV4n/h5APXr 6FAoQ57E0/MvTDa7+CQeg8RV0KRnQayjeq3MS/wiDkP5F/ydPJSLV1nqrNRFPJ4hYd gm2yBgu4zSYV3TAKzdCYZSBu5ih2hOszRhY5uFzyKioNIvL/5w6vnuiWSGgh7teYx5 mEqwNwWB/Vm+xbTsOZ6Yi5ETW509W13lkrpSvQyoTu8kkiZRI2S6tz0qobJj/Xvy9x 11CjCqYHnKB3Ubl663ze8hjxIMC8oG9VCEyiswd7jQh1NnrWoH4N3E2801z1EbiLK1 TzN+n0ZFCOOnw== Subject: Re: [PATCH 8/8] membarrier: Rewrite sync_core_before_usermode() and improve documentation To: Mathieu Desnoyers Cc: x86 , Dave Hansen , linux-kernel , linux-mm , Andrew Morton , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , linuxppc-dev , Nicholas Piggin , Catalin Marinas , Will Deacon , linux-arm-kernel , Peter Zijlstra , stable References: <07a8b963002cb955b7516e61bad19514a3acaa82.1623813516.git.luto@kernel.org> <1939350496.10696.1623943014767.JavaMail.zimbra@efficios.com> From: Andy Lutomirski Message-ID: <678def50-eecd-fb0f-eac0-c0ba1a442574@kernel.org> Date: Thu, 17 Jun 2021 17:13:24 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <1939350496.10696.1623943014767.JavaMail.zimbra@efficios.com> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210617_171326_812202_96FB97E1 X-CRM114-Status: GOOD ( 18.82 ) 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-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 6/17/21 8:16 AM, Mathieu Desnoyers wrote: > ----- On Jun 15, 2021, at 11:21 PM, Andy Lutomirski luto@kernel.org wrote: > > [...] > >> +# An architecture that wants to support >> +# MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE needs to define precisely what it >> +# is supposed to do and implement membarrier_sync_core_before_usermode() to >> +# make it do that. Then it can select ARCH_HAS_MEMBARRIER_SYNC_CORE via >> +# Kconfig.Unfortunately, MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE is not a >> +# fantastic API and may not make sense on all architectures. Once an >> +# architecture meets these requirements, > > Can we please remove the editorial comment about the quality of the membarrier > sync-core's API ? Done >> +# >> +# On x86, a program can safely modify code, issue >> +# MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE, and then execute that code, via >> +# the modified address or an alias, from any thread in the calling process. >> +# >> +# On arm64, a program can modify code, flush the icache as needed, and issue >> +# MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE to force a "context synchronizing >> +# event", aka pipeline flush on all CPUs that might run the calling process. >> +# Then the program can execute the modified code as long as it is executed >> +# from an address consistent with the icache flush and the CPU's cache type. >> +# >> +# On powerpc, a program can use MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE >> +# similarly to arm64. It would be nice if the powerpc maintainers could >> +# add a more clear explanantion. > > We should document the requirements on ARMv7 as well. Done. > > Thanks, > > Mathieu > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel