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=-9.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 CFAF5C04FF3 for ; Mon, 24 May 2021 19:02:40 +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 958B1600D4 for ; Mon, 24 May 2021 19:02:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 958B1600D4 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com 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:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=O636OeP47ej3SojBMiTVqZwwA9zX55nU/GQhqaC/pBs=; b=vqn+G/E/3+3H6B lDP3YSgMQcT5Pt1ECTdw+p+gOl3s8oCWescLGlphU/M2nk5pbN8xNhPMA0q/fHMguOer7xacO4oAk 2niO30RTCLMSkW9QuBx6EUwvqpC/Vu60XyTp3Nbt59BZ0lOLPR6l8YyuyKzKeOcl6VzraFVDlQOjX sFgR+2ovuI3V+J8XCfdQeZ1252w6jSestVggD8U2O1CoroaFyq1Te8Ekfuqsr4vuHzOWo198W9L5I D2nEDNNmZryxG7xnx6u8P8JND0NxvOUn/JRfrqV6omnOk4aSR8aWb2ovo91/YuzmOt0TGDfT4cNS6 4PAfAWjOnx0NZtrDNpig==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1llFnS-001Zmd-Lz; Mon, 24 May 2021 18:59:26 +0000 Received: from mail-oo1-xc2a.google.com ([2607:f8b0:4864:20::c2a]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1ll6lS-000nZA-Em for linux-arm-kernel@lists.infradead.org; Mon, 24 May 2021 09:20:47 +0000 Received: by mail-oo1-xc2a.google.com with SMTP id j26-20020a4adf5a0000b029020eac899f76so4408129oou.7 for ; Mon, 24 May 2021 02:20:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=GyMWtGdmfqxHWFPolOlIAWjuenQUb99jYlx+sXV8CTM=; b=gkwjPycFkrWCvoqY4B/8b7MfyjNqb71h+y2cgzTMbxW8+vCg/mXvrcuUuqiYMFH+UA FeiQ5JF4DyyE0FY4STI7Vt9HkwPjvptsCD2wHPmEp41KhVctkrgaErWouoG0aEgXVWVR QcmoW11EdRfd0BJQCfugXCY4KRpWLKR283VzuMalaG+xdZrtpJeYM7JouPFdI3ryO43F U56uCRGvZG42DIt3i3HrhahsBhnAwkaD/H1mKQhOt+VpblC61YkZq0W60UWkVHPhQldM td4FVo8rdUSv8lX8r92jhfFyL+BXiMuuGgetTmI0u9pmeWkLivnr+aaeEHpsiaYyc+91 QOkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=GyMWtGdmfqxHWFPolOlIAWjuenQUb99jYlx+sXV8CTM=; b=FRtEiUSjJVsJROdv1q9f0J/b3yGsWFHq4POSfYWF5EwUih8qNi1noOpd6dDr97JbRO UKjnCVCq3aLvke+eJ57EM1wUEGxbxQYH/95L/hJiXLvqxKjXGO+6sfyA0FQxP1dlsdSu DXKYg9gTjIy/xHwJDcX2ATywwcuCPYgGFezd8x38MeOllm38blxvTGxXGgFs1RFE+26L Q04AIdJkcEvClLfhQoLygBgeYfDK5nu1ztSv27SRocgrClxxGFsWHxvBnvF1boGRn7Wj KHZQjgjjxsIhrIZVUeWNfXCONZZcvK7jd7zlHKkuaWH3u9y+WT5TX3hj+lLfqJSwPFye pGzA== X-Gm-Message-State: AOAM533jRf4N8NzKQJAyFCTdKpJMnNbkvES67yFYwT1bmINH2Qsnf8wo ttS5hek9U+0yGeCKdd7SLBjbJtDShIyBftPPQwWMSA== X-Google-Smtp-Source: ABdhPJxsTp4Th4FWveeJqvBIvTTniL8AjAhyTqZVO1vE2KBKdWzgmYbsYrAEDdtEu99lw/24mZ+6cPmSxwdwZvwgg30= X-Received: by 2002:a4a:ea2b:: with SMTP id y11mr17601155ood.42.1621848042169; Mon, 24 May 2021 02:20:42 -0700 (PDT) MIME-Version: 1.0 References: <20210524083001.2586635-1-tabba@google.com> <20210524083001.2586635-5-tabba@google.com> In-Reply-To: From: Fuad Tabba Date: Mon, 24 May 2021 10:20:06 +0100 Message-ID: Subject: Re: [PATCH v4 04/18] arm64: Do not enable uaccess for flush_icache_range To: Ard Biesheuvel Cc: Linux ARM , Will Deacon , Catalin Marinas , Mark Rutland , Marc Zyngier , James Morse , Alexandru Elisei , Suzuki K Poulose , Robin Murphy X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210524_022046_538114_A50BD866 X-CRM114-Status: GOOD ( 18.92 ) 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 Hi Ard, > > diff --git a/arch/arm64/mm/cache.S b/arch/arm64/mm/cache.S > > index 2d881f34dd9d..7c54bcbf5a36 100644 > > --- a/arch/arm64/mm/cache.S > > +++ b/arch/arm64/mm/cache.S > > @@ -14,6 +14,34 @@ > > #include > > #include > > > > +/* > > + * __flush_cache_range(start,end) [fixup] > > + * > > + * Ensure that the I and D caches are coherent within specified region. > > + * This is typically used when code has been written to a memory region, > > + * and will be executed. > > + * > > + * - start - virtual start address of region > > + * - end - virtual end address of region > > + * - fixup - optional label to branch to on user fault > > + */ > > +.macro __flush_cache_range, fixup > > +alternative_if ARM64_HAS_CACHE_IDC > > + dsb ishst > > Should this perhaps be dsb ish? IIUC, ishst does not synchronize on > completion of cache maintenance, and while that is implicit on this > code path, I'd still assume it needs to complete before carrying on. > Or does IDC not require this? I'm not sure; ishst in this patch is unchanged (just moved to the macro). Reading the Arm ARM (B2-143) I think that ishst is correct: """ CTR_EL0.{DIC, IDC} == {0, 1} The write is complete for the shareability domain. Subsequently the location has been invalidated to the Point of unification (PoU) from the instruction cache, and that invalidation is complete for the shareability domain. CTR_EL0.{DIC, IDC} == {1, 1} The write is complete for the shareability domain. """ Does my interpretation sound right to you? Thanks! /fuad _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel