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=-14.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,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 B2611C433ED for ; Wed, 12 May 2021 09:38:05 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 1781261260 for ; Wed, 12 May 2021 09:38:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1781261260 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=desiato.20200630; 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=Y3+d0YNTNSxdI4zMQUE8uTfUJEhpraABomTOZwJOkz8=; b=Ve4uGv5J6HHlgdDWMND8hCyHh J3bj/ac93h8go1PR/1vOsBNFTWRObEHZfpCCVUDJ8jh0+4I2lmkP/V3XvvTCDMR/stx9UoVpbY/jS vSroFfI4rUv2QIbyEHHDS8vc//yEFmQv6B48qHi22zrUiLmJdrhIE+yR2G5MESdpQu7AflEA5BXgU CLN9ymuFF1qgNB5y6HQV53PplKGTPhWSTQaYw+DA+UnMhAP7TKMGpdCfWyvuq8bCwdDcC/WCUR/b4 f7LlrIN24CmoFnIcykkj8dW98Qj2TOCv1meVyxk+aeBD28bqQcz9XgdmaxoQtCxbv9/BSb71yy00a lgGyWGZBg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lglHc-002RiE-2D; Wed, 12 May 2021 09:36:00 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lglHZ-002Ri4-Lx for linux-arm-kernel@desiato.infradead.org; Wed, 12 May 2021 09:35:57 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=tGQCi7DvyWuqff4iiIdzmnynNY3ZkhKPKOsHZMY4N3s=; b=bhUJy5yywqluiUPyahwXJdQIko 0GY/trEFO2QdleqnvTxuKuGtxMN21VgUDKV4Fa5VKF9VMZLp6L7FP+rmB/eur8sLZSTSYvi1h01CE gmsBQgXKV+qu1KAAi9f8Re9FuiGY/dxq+pv96Lp1vjg/Fd0TUJA4pupb8RKTvx68ApAQuMNDdXSCX nWIhiCTY3/rxKWbwfd0oKqR0RVj2nIXMbhztRsumV6GZyXbrKMfU17qr/9RjeSZUC21o+Ujz7dxMN vk+935bxwdUYD1amTcWKG3Seu8Ci+CT9z/kWDIuGj/YaKReBF11Fl97XW4JdoQaiGhcETraSI+9mf ZToJ81Cw==; Received: from mail-ot1-x333.google.com ([2607:f8b0:4864:20::333]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lglHW-00AFsx-G0 for linux-arm-kernel@lists.infradead.org; Wed, 12 May 2021 09:35:56 +0000 Received: by mail-ot1-x333.google.com with SMTP id t4-20020a05683014c4b02902ed26dd7a60so9879679otq.7 for ; Wed, 12 May 2021 02:35:53 -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=tGQCi7DvyWuqff4iiIdzmnynNY3ZkhKPKOsHZMY4N3s=; b=FHMr+cVYQbpgw7vpodpwWTYYaw9eD6uEqQujX88iSW6yFsv7JGuwFncCfIoI8711Rv MZcPd4LfDb3uVwZFwNNabJ89siCaYzAmnVNqFRpTQ6Sn8EKOMyUfwBcPT6g8RGk7dADb 7nE8tzRtnDV438EyfWWEagAW50bxp/Z8cVhR2kaPa99hDhmmcDZTW06k0DYA2oX/VYsj EkH0W3CxnqZ7xMJUGF6xXTzbVTRnL4mg2opnf+ZNepbLa1BLoR/VmedzCQHGDDxscykN N91JlRoUCeA8U0ufytRs/K7rGdISs0J5rcW3mDzHNXC3S52f9km24GH4fMjsA9SfAyqI V/Cg== 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=tGQCi7DvyWuqff4iiIdzmnynNY3ZkhKPKOsHZMY4N3s=; b=XI6JTBQrVzQdznUWGlu1mOOcm68rWMi3m5MzBqUsSWMRArN5Su0b/d4U9cjO6GjGmX X5PHCFWSCFICPWy8NOj/CYu84EIFV15gI1bht9H3CwKbZ9+5TOIR7S/LdFyQFqmc2m9B s8hWiEWXuqDFvHP3VKlGLfCD/rOnAiaQzt1sZ2F5I0JRUtnTqQztgx+rWfwJrXWyq8oM cz3ekexRY0fs1fi8SHGVLB5ZU2M3f6rlHOaufMk4ShKlafP2m97reU4/LX/lSdA8MwZG vfnq6khV8kW35AdsFr6+WNY+3SGS+O3uHgQxd6jZ8gtv6rnBpDQAcqmUo6qPI1obvwMr 8XfQ== X-Gm-Message-State: AOAM533c3rwPS+kA3qaO4TC+Eu+K+0b73e5cAKKrgJPV+TerXJp/3dSB tVXeG/jh4gVEqH0vqUqAnijcnJ8WmYxNnw7YxWihRBCHKQZ/lA== X-Google-Smtp-Source: ABdhPJzcrDlIsC+lXLbPN0cuebFY/MTtnuWM3wszngH+HPVoXXA8AZ0DqcjJC1z/Va3FQel42CSgSI0lu4/XBV/8S9E= X-Received: by 2002:a05:6830:1e15:: with SMTP id s21mr24947971otr.144.1620812153162; Wed, 12 May 2021 02:35:53 -0700 (PDT) MIME-Version: 1.0 References: <20210511144252.3779113-1-tabba@google.com> <20210511144252.3779113-3-tabba@google.com> <20210511153422.GE8933@C02TD0UTHF1T.local> In-Reply-To: <20210511153422.GE8933@C02TD0UTHF1T.local> From: Fuad Tabba Date: Wed, 12 May 2021 10:35:17 +0100 Message-ID: Subject: Re: [PATCH v1 02/13] arm64: Do not enable uaccess for invalidate_icache_range To: Mark Rutland Cc: "moderated list:ARM64 PORT (AARCH64 ARCHITECTURE)" , Will Deacon , Catalin Marinas , Marc Zyngier , ardb@kernel.org, James Morse , Alexandru Elisei , Suzuki K Poulose X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210512_023554_575200_165982C6 X-CRM114-Status: GOOD ( 22.00 ) 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 Mark, On Tue, May 11, 2021 at 4:34 PM Mark Rutland wrote: > > On Tue, May 11, 2021 at 03:42:41PM +0100, Fuad Tabba wrote: > > invalidate_icache_range() works on the kernel linear map, and > > doesn't need uaccess. Remove the code that toggles > > uaccess_ttbr0_enable, as well as the code that emits an entry > > into the exception table (via the macro > > invalidate_icache_by_line). > > Probably also worth mentioning the return type change, but regardless: Will do in v2. > Acked-by: Mark Rutland > > I do worry this means we've been silently ignoring cases where this > faults, and so there's the risk that this has been masking bugs > elsewhere. It'd be good to throw Syzkaller and the like at this ASAP Good point. I'll look into that. Thanks, /fuad > Thanks, > Mark. > > > No functional change intended. > > > > Reported-by: Catalin Marinas > > Reported-by: Will Deacon > > Link: https://lore.kernel.org/linux-arch/20200511110014.lb9PEahJ4hVOYrbwIb_qUHXyNy9KQzNFdb_I3YlzY6A@z/ > > Signed-off-by: Fuad Tabba > > --- > > arch/arm64/include/asm/cacheflush.h | 2 +- > > arch/arm64/mm/cache.S | 11 +---------- > > 2 files changed, 2 insertions(+), 11 deletions(-) > > > > diff --git a/arch/arm64/include/asm/cacheflush.h b/arch/arm64/include/asm/cacheflush.h > > index 52e5c1623224..a586afa84172 100644 > > --- a/arch/arm64/include/asm/cacheflush.h > > +++ b/arch/arm64/include/asm/cacheflush.h > > @@ -57,7 +57,7 @@ > > * - size - region size > > */ > > extern void __flush_icache_range(unsigned long start, unsigned long end); > > -extern int invalidate_icache_range(unsigned long start, unsigned long end); > > +extern void invalidate_icache_range(unsigned long start, unsigned long end); > > extern void __flush_dcache_area(void *addr, size_t len); > > extern void __inval_dcache_area(void *addr, size_t len); > > extern void __clean_dcache_area_poc(void *addr, size_t len); > > diff --git a/arch/arm64/mm/cache.S b/arch/arm64/mm/cache.S > > index 092f73acdf9a..6babaaf34f17 100644 > > --- a/arch/arm64/mm/cache.S > > +++ b/arch/arm64/mm/cache.S > > @@ -105,21 +105,12 @@ SYM_FUNC_END(__flush_cache_user_range) > > */ > > SYM_FUNC_START(invalidate_icache_range) > > alternative_if ARM64_HAS_CACHE_DIC > > - mov x0, xzr > > isb > > ret > > alternative_else_nop_endif > > > > - uaccess_ttbr0_enable x2, x3, x4 > > - > > - invalidate_icache_by_line x0, x1, x2, x3, 1, 2f > > - mov x0, xzr > > -1: > > - uaccess_ttbr0_disable x1, x2 > > + invalidate_icache_by_line x0, x1, x2, x3, 0, 0f > > ret > > -2: > > - mov x0, #-EFAULT > > - b 1b > > SYM_FUNC_END(invalidate_icache_range) > > > > /* > > -- > > 2.31.1.607.g51e8a6a459-goog > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel