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=-12.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,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 EAFE4C48BDF for ; Tue, 15 Jun 2021 14:27:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C69B56109D for ; Tue, 15 Jun 2021 14:27:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231483AbhFOO3C (ORCPT ); Tue, 15 Jun 2021 10:29:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:45162 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230519AbhFOO2X (ORCPT ); Tue, 15 Jun 2021 10:28:23 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0E7006148E; Tue, 15 Jun 2021 14:26:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1623767179; bh=YBPTf/6+PVpbr1NQY+Q90GleIgQdpyqztKsc/hv/Hso=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=KU5VOauoPOaiMDCAYN3Fm2eo9EoZpxO7FdW2QrJw52mgxFtPJWa7qlrd30gCmHaT5 JTu7AEOJuQM0LV/AcjW2D3hXQiibixloQqNn3QenMK/qyscnmuoNBAEOsmyCNQkNtS nogVPjlPwN4OzhV3DJlVW6VTX2elZ7MOpfb0mttQsxRwjCQzf4TwI7IjIjopIoRCRF CYDs4Y6kxKMWi5CUfC7egi3IbntIWCFUTMLQFdhP1oFgkGYhi0rF4Pe+d/c+R1jscL x+5WRYmiYsSKbzrZP1ximp9ExoODwsVZKcSztVV94ot7Uyq9sFQmGxJIi6WHcNVxRE O6frABYWyKT4w== Date: Tue, 15 Jun 2021 15:26:14 +0100 From: Will Deacon To: Catalin Marinas Cc: Anshuman Khandual , linux-arm-kernel@lists.infradead.org, Mark Rutland , James Morse , linux-kernel@vger.kernel.org Subject: Re: [PATCH] arm64/mm: Fix ttbr0 values stored in struct thread_info for software-pan Message-ID: <20210615142614.GA20934@willie-the-truck> References: <1623749578-11231-1-git-send-email-anshuman.khandual@arm.com> <20210615142539.GJ26027@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210615142539.GJ26027@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 15, 2021 at 03:25:39PM +0100, Catalin Marinas wrote: > On Tue, Jun 15, 2021 at 03:02:58PM +0530, Anshuman Khandual wrote: > > When using CONFIG_ARM64_SW_TTBR0_PAN, a task's thread_info::ttbr0 must be > > the TTBR0_EL1 value used to run userspace. With 52-bit PAs, the PA must be > > packed into the TTBR using phys_to_ttbr(), but we forget to do this in some > > of the SW PAN code. Thus, if the value is installed into TTBR0_EL1 (as may > > happen in the uaccess routines), this could result in UNPREDICTABLE > > behaviour. > > > > Since hardware with 52-bit PA support almost certainly has HW PAN, which > > will be used in preference, this shouldn't be a practical issue, but let's > > fix this for consistency. > > I'm ok with fixing this for consistency. We should never hit those paths > unless someone built hardware with 52-bit PA (8.2) but without PAN (8.1) > and it would not be architecture compliant. > > I'll leave it with Will for 5.14, it's no a fix that needs urgent > queuing. > > Reviewed-by: Catalin Marinas Cheers, I'll pick it up. Will 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=-10.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,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 E1247C48BDF for ; Tue, 15 Jun 2021 17:03:17 +0000 (UTC) Received: from bombadil.infradead.org (unknown [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 95E8B61879 for ; Tue, 15 Jun 2021 17:03:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 95E8B61879 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org 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: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=pH2QLhMVhmCPCbOl8PcuK73Yb2Z5vL2k/aNu7mMku6I=; b=ihrMiEt1OSyrO5 d2ydjq5NyFhM74/5/rbLrTqAzeQelz5rBQeTQWHL9isyBua7llCzRB3lfF1Ed+kMbVsFPU7lDQA21 6ElB8Ofydplt/5AT7oDQQUqAzlFbdXWJm65Mc2V9VFsEUOgUVM5Pbg5m0LnJEW/9eZNlFzfaY+g6c O/pHYq5Fy/ojshIb5KoH7G1q9/iCowuJeFhKAUtopfnU7nIl2FvaFszteGUH+oEAopuNU6Gp2Ivlc FyJxYVkxsjf1PetZrTemsbky2WgJHtFuOKr9w3zcFjqm+VBVNQuGCZe+4bcxZEL5NgyRn4k4zLEAP iEu/p2dFBcIiOWSuT7ug==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ltCM2-001WqX-JZ; Tue, 15 Jun 2021 16:56:00 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ltA1K-000Zwq-OT for linux-arm-kernel@bombadil.infradead.org; Tue, 15 Jun 2021 14:26:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; 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=4T6hEK8XD8gxORjlKK9Kn7dW4iwDJmOT/SUZR0q/yd4=; b=Ln79HAO9VnX6+e4Kf1CnS7Mo8K zPYreZIAJmZXx0LE57VJ6Br39/LHm6Xu7Das3WkL9jobNjwjQXdMzzGFiA9VVWqI1vWPA4sLTsrRH JRGgH8s5jPjKTigqNKuQHVb5aj3yNjL4UDOnmTLl3g88hpS41NKmF826NG9auGkawxCHxw2bsVZAw AiN2IEGbIksLt2COZsAnA2KzS3A1dS/RBHJW8sNh/fNmw9pfD9AkJ28zyDExIubiwrd4mj5Nn64QT CUtrAPAo+5aNSCmoFp44t05uj1QN9ScRbH5FsF+Y/8UbWLicdqEVS3eurmvlc7s3RIIdIxw1OF7KL x7DJblcg==; Received: from mail.kernel.org ([198.145.29.99]) by desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ltA1A-008055-LL for linux-arm-kernel@lists.infradead.org; Tue, 15 Jun 2021 14:26:25 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0E7006148E; Tue, 15 Jun 2021 14:26:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1623767179; bh=YBPTf/6+PVpbr1NQY+Q90GleIgQdpyqztKsc/hv/Hso=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=KU5VOauoPOaiMDCAYN3Fm2eo9EoZpxO7FdW2QrJw52mgxFtPJWa7qlrd30gCmHaT5 JTu7AEOJuQM0LV/AcjW2D3hXQiibixloQqNn3QenMK/qyscnmuoNBAEOsmyCNQkNtS nogVPjlPwN4OzhV3DJlVW6VTX2elZ7MOpfb0mttQsxRwjCQzf4TwI7IjIjopIoRCRF CYDs4Y6kxKMWi5CUfC7egi3IbntIWCFUTMLQFdhP1oFgkGYhi0rF4Pe+d/c+R1jscL x+5WRYmiYsSKbzrZP1ximp9ExoODwsVZKcSztVV94ot7Uyq9sFQmGxJIi6WHcNVxRE O6frABYWyKT4w== Date: Tue, 15 Jun 2021 15:26:14 +0100 From: Will Deacon To: Catalin Marinas Cc: Anshuman Khandual , linux-arm-kernel@lists.infradead.org, Mark Rutland , James Morse , linux-kernel@vger.kernel.org Subject: Re: [PATCH] arm64/mm: Fix ttbr0 values stored in struct thread_info for software-pan Message-ID: <20210615142614.GA20934@willie-the-truck> References: <1623749578-11231-1-git-send-email-anshuman.khandual@arm.com> <20210615142539.GJ26027@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210615142539.GJ26027@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210615_152623_731370_A3794E72 X-CRM114-Status: GOOD ( 18.22 ) 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, Jun 15, 2021 at 03:25:39PM +0100, Catalin Marinas wrote: > On Tue, Jun 15, 2021 at 03:02:58PM +0530, Anshuman Khandual wrote: > > When using CONFIG_ARM64_SW_TTBR0_PAN, a task's thread_info::ttbr0 must be > > the TTBR0_EL1 value used to run userspace. With 52-bit PAs, the PA must be > > packed into the TTBR using phys_to_ttbr(), but we forget to do this in some > > of the SW PAN code. Thus, if the value is installed into TTBR0_EL1 (as may > > happen in the uaccess routines), this could result in UNPREDICTABLE > > behaviour. > > > > Since hardware with 52-bit PA support almost certainly has HW PAN, which > > will be used in preference, this shouldn't be a practical issue, but let's > > fix this for consistency. > > I'm ok with fixing this for consistency. We should never hit those paths > unless someone built hardware with 52-bit PA (8.2) but without PAN (8.1) > and it would not be architecture compliant. > > I'll leave it with Will for 5.14, it's no a fix that needs urgent > queuing. > > Reviewed-by: Catalin Marinas Cheers, I'll pick it up. Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel