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.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,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 9D3E8C48BDF for ; Tue, 15 Jun 2021 17:01:29 +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 7047C61625 for ; Tue, 15 Jun 2021 17:01:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7047C61625 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=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=iHFN5rVvmwqoUoN7efcUo5g61Qo0hKkJCne52olhhZg=; b=PAbrfhGj88CNNU rhFmMBnIFbXS9lHVGqTNeeJ8ucR3I7FsRHOmfUir5lJXucEErY/NYJRAZ9OKTUbYNbScKwNWuKahX SU3y25ew1BD19yqFboqf10KK4C7wrTTJAq8EKLLhQjHMErrD5EOAcI7nRZv6VsUF2NSqYKFxSFmjO fhvKl4O21yoodsOue6127hG/8j9Ss8cSzO4N5zv01IdW6f+9xFc7f5B5Hv03QNtoS+B7Z6hfQWccF JdvlsUxa7loiJf5e64ggH22BGFazP05rKzitcF7rVDDk/S3okW80t39M3j/+31wQ5T0EeidCldzLo BD8Kxdp5l3z2muSPmwyg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ltCL5-001WVK-Ir; Tue, 15 Jun 2021 16:55:00 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ltA0d-000ZdU-MZ for linux-arm-kernel@lists.infradead.org; Tue, 15 Jun 2021 14:25:45 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id A5FA761483; Tue, 15 Jun 2021 14:25:41 +0000 (UTC) Date: Tue, 15 Jun 2021 15:25:39 +0100 From: Catalin Marinas To: Anshuman Khandual Cc: linux-arm-kernel@lists.infradead.org, Will Deacon , 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: <20210615142539.GJ26027@arm.com> References: <1623749578-11231-1-git-send-email-anshuman.khandual@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1623749578-11231-1-git-send-email-anshuman.khandual@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_072543_836530_E00BF1CC X-CRM114-Status: GOOD ( 14.32 ) 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: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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel