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=-13.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 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 8F3BCC4363A for ; Tue, 27 Oct 2020 17:35:24 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 20923208B8 for ; Tue, 27 Oct 2020 17:35:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="dUrTEXYZ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 20923208B8 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=merlin.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=xjHI8XOFo/U769WsHUM6fE+dpmHX2tsFliw0mI22M0c=; b=dUrTEXYZSlAs3d8Dv90+sSzbj tHcC4/zxArHNdjELsZy/6ukRvtXxz0B+mcXwg9sUYFlKne1KtPFaCJLVTzI4WUI9Kd7RbL8CiJz23 M4iD3q6BPrYxjscyeVY5KmMw+19TOOZH9CIydzVosq/3gpu/BGmJ+aU997EF1eV6tu+agB5Rn3sso aTYKYfHwUCu5QucuZOf3JAnNQoLqJfuXwEPC6EVOv/gT1YyS4cPCA002EfroWIuMoYGV8QDzrGqnj QK/VT1s8GhQPLNVsYo9yffS3NLoAkMS7O8xHg5+m4koggIoC4c5x9A4+vYyicwyTasdL9dTeQ6IBF Jxv6ahuZg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kXSr0-0008Iz-7A; Tue, 27 Oct 2020 17:33:50 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kXSqn-0008Fc-Qa for linux-arm-kernel@lists.infradead.org; Tue, 27 Oct 2020 17:33:40 +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 04904139F; Tue, 27 Oct 2020 10:33:35 -0700 (PDT) Received: from [10.57.50.191] (unknown [10.57.50.191]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A83733F719; Tue, 27 Oct 2020 10:33:33 -0700 (PDT) Subject: Re: [PATCHv3 10/17] arm64: uaccess: simplify __copy_user_flushcache() To: Mark Rutland , linux-arm-kernel@lists.infradead.org References: <20201026133156.44186-1-mark.rutland@arm.com> <20201026133156.44186-11-mark.rutland@arm.com> From: Robin Murphy Message-ID: Date: Tue, 27 Oct 2020 17:33:31 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: <20201026133156.44186-11-mark.rutland@arm.com> Content-Language: en-GB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201027_133338_389418_AB5E18BD X-CRM114-Status: GOOD ( 19.03 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: catalin.marinas@arm.com, james.morse@arm.com, hch@lst.de, will@kernel.org Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2020-10-26 13:31, Mark Rutland wrote: > Currently __copy_user_flushcache() open-codes raw_copy_from_user(), and > doesn't use uaccess_mask_ptr() on the user address. Let's have it call > raw_copy_from_user(), which is both a simplification and ensures that > user pointers are masked under speculation. I think this originally stems from the fact that "raw_*" were merely generic aliases for "__arch_*" at the time. Then whichever chump subsequently implemented uaccess_mask_ptr() for arm64 clearly did a terrible job... ;) > There should be no functional change as a result of this patch. Reviewed-by: Robin Murphy > Signed-off-by: Mark Rutland > Cc: Catalin Marinas > Cc: Christoph Hellwig > Cc: Robin Murphy > Cc: Will Deacon > --- > arch/arm64/lib/uaccess_flushcache.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/arch/arm64/lib/uaccess_flushcache.c b/arch/arm64/lib/uaccess_flushcache.c > index bfa30b75b2b8e..c83bb5a4aad2c 100644 > --- a/arch/arm64/lib/uaccess_flushcache.c > +++ b/arch/arm64/lib/uaccess_flushcache.c > @@ -30,9 +30,7 @@ unsigned long __copy_user_flushcache(void *to, const void __user *from, > { > unsigned long rc; > > - uaccess_enable_not_uao(); > - rc = __arch_copy_from_user(to, from, n); > - uaccess_disable_not_uao(); > + rc = raw_copy_from_user(to, from, n); > > /* See above */ > __clean_dcache_area_pop(to, n - rc); > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel