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_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 8DCBAC433ED for ; Tue, 11 May 2021 15:36:20 +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 4135F61626 for ; Tue, 11 May 2021 15:36:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4135F61626 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.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:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ZRtRNRys59dMA6XThxs6cQc80uXXsApdo/BeTsJYg90=; b=UuoDfoVJd8z5gwtnOVDC8qadU HtQsNw+b+VtllqaZrBQMs3nnmFRZdEjfo2ByK7vKr+SH8jMvYD/pmQg0xkoxnsPe0wWcFioVX34Aw zqHcOk82rDSRk7s2TaYkPpl17tS8zIk1nLZEir55aaQ+tgTbF8Pys6TYBx8PcZorkbL2FCNCjCCf5 deAKzAzMpRvoaXszPMSHa+hJmq5rUMCSYDJk/Sh3gBbBJRUl+3JqC7w1iICVkARaGuKvVIwSITWnA tGZRSmHZv4BF3dtvqek+ReCK2q71J5C3rvED89tgB9fEmADxEtjH8i5mSQaKsezu8diuni7jDLn+l d/jfQMryg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lgUP6-000cGM-Ew; Tue, 11 May 2021 15:34:37 +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 1lgUP3-000cFv-RP for linux-arm-kernel@desiato.infradead.org; Tue, 11 May 2021 15:34:33 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=B1UZN0WyOAMs0KWbTn90+7vJek1AVqPdfUx/DvfmMX4=; b=vQhxfjOT8q7EQUMApAaPfqcUFM GDrDXX7Z/35qkscr9UwpQlsGty2uWzl66zawGjZULVDFiGEgxAAY5YOvVJU0KLcI7okXN6VcYyFQy +Kd1Q7ibQdNZDR8oO/gpyFkQYSmFJY3wnBYxLVuKUV7L6juLPQDBz3bP1i5s3FNz5w/xP7CvWWXSR i2hYCSBP9Piwsgu/nZAik5EGWhkOX8Q8qfBP6dODqQu2ehA12vcu81aOVKVD9QcukykDDMhWGU0Wd PnxR94wk61xuKB+Ke7dYbV9pV9rdVgd+TkZB00R0wbs3KuuVqpeUSrkQjLmfC2PbUJpE0jXwLshM9 G41ELN4w==; Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lgUP0-009ipH-Tj for linux-arm-kernel@lists.infradead.org; Tue, 11 May 2021 15:34:32 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 688A5D6E; Tue, 11 May 2021 08:34:27 -0700 (PDT) Received: from C02TD0UTHF1T.local (unknown [10.57.29.91]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C63D53F718; Tue, 11 May 2021 08:34:25 -0700 (PDT) Date: Tue, 11 May 2021 16:34:22 +0100 From: Mark Rutland To: Fuad Tabba Cc: linux-arm-kernel@lists.infradead.org, will@kernel.org, catalin.marinas@arm.com, maz@kernel.org, ardb@kernel.org, james.morse@arm.com, alexandru.elisei@arm.com, suzuki.poulose@arm.com Subject: Re: [PATCH v1 02/13] arm64: Do not enable uaccess for invalidate_icache_range Message-ID: <20210511153422.GE8933@C02TD0UTHF1T.local> References: <20210511144252.3779113-1-tabba@google.com> <20210511144252.3779113-3-tabba@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210511144252.3779113-3-tabba@google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210511_083431_030432_4DC07B15 X-CRM114-Status: GOOD ( 16.58 ) 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 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: 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 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