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=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS 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 D7BDBC54FCC for ; Mon, 20 Apr 2020 07:08:04 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (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 4B68B21473 for ; Mon, 20 Apr 2020 07:08:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=ellerman.id.au header.i=@ellerman.id.au header.b="noVjUuTR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4B68B21473 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 495HpT2Vy0zDqW4 for ; Mon, 20 Apr 2020 17:08:01 +1000 (AEST) Received: from ozlabs.org (bilbo.ozlabs.org [203.11.71.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 495Hkd2dqGzDqnf for ; Mon, 20 Apr 2020 17:04:41 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ellerman.id.au header.i=@ellerman.id.au header.a=rsa-sha256 header.s=201909 header.b=noVjUuTR; dkim-atps=neutral Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 495Hkd0tnfz9s71; Mon, 20 Apr 2020 17:04:41 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ellerman.id.au; s=201909; t=1587366281; bh=II93fe5qoEg/RB29rgoPaGD/lALoGpYHbek7N1QOFUI=; h=From:To:Subject:In-Reply-To:References:Date:From; b=noVjUuTR6I+r+9Sfrw6J6YK71pkNxRHDhVg83+hze9yWb/cLeOMm+AQu5iUIDpX37 q5Fb4ANDPCDve29VmUM4DgsHB9ysO2JZZ8HkSCDIisw/Rx5c9Sxb2bmLlUz8F2uwLM bcq/Qsv0K5YsZR6xu0Z6Rz299Z/bouDL1n4ziYQ89ybAPQw4oa1sNrfpKZqg872I7L Wiq7k6A/S2zpJwINz69j/tS8OmePSXu5/ehUi7L7ujU697a50ah0PbI4qfgPleky5P zbZKoYDmfPA4amHPK/8Yd3gz+R5I65FNr5lgTW3T0fO4EEvumzryikq5R4Y5KKCzO/ dLBt2SEzlb1qg== From: Michael Ellerman To: Nicholas Piggin , "Aneesh Kumar K.V" , linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH] powerpc/book3s64/kuap: SPRN_AMR modification need CSI instructions before and after In-Reply-To: <1587345091.ewst0wvt61.astroid@bobo.none> References: <20200419135359.731325-1-aneesh.kumar@linux.ibm.com> <1587341611.capj46kr99.astroid@bobo.none> <1587345091.ewst0wvt61.astroid@bobo.none> Date: Mon, 20 Apr 2020 17:04:55 +1000 Message-ID: <87y2qqhc2w.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain 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: , Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" Nicholas Piggin writes: > Excerpts from Nicholas Piggin's message of April 20, 2020 10:17 am: >> Excerpts from Aneesh Kumar K.V's message of April 19, 2020 11:53 pm: >>> As per the ISA, context synchronizing instructions is needed before and after >>> SPRN_AMR update. Use isync before and the CSI after is implied by the rfid >>> that we will use to switch to a new context. >> >> Not entirely sure if we need this. This will restore AMR to more >> permissive, so if it executes ahead of a stray load from this >> context, it won't make it fault. I thought we'd convinced ourselves it didn't matter in practice due to the proximity of the entry/exit. >> That said, leaving this end open makes it harder to reason about >> user access protection I guess, so let's add it. > > We probably should test whether it needs updating, like the entry > code does. That will be the common case (no update), so yes I agree. cheers