Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp537594lqs; Thu, 13 Jun 2024 19:25:22 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU8iRe0Rgn8tdQSKPE9yvqZssI7+JTyzB4WIQ46F6ctHrzEyfqf6JKT9n6kA93xiSWOTkBSEC+lBbSraIWDve1SzTTK3pfyOcfRGaqANg== X-Google-Smtp-Source: AGHT+IExOIMOKdoizQjEi6jnTxCCmBcnBmYnfumfVesBJ/eSTv5nQKg2Xk9VCLG34VkbFylnldGE X-Received: by 2002:a17:90a:4a84:b0:2c2:da02:a2c7 with SMTP id 98e67ed59e1d1-2c4dbd451a4mr1362107a91.44.1718331922117; Thu, 13 Jun 2024 19:25:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718331922; cv=pass; d=google.com; s=arc-20160816; b=ozMXoMwGzV50UgYg6VHPPeuSKevlA4SnP7eeDDseoM2WUP9U0IreFAFMGRkwF9fKNK /iHO969tnAuc6cv9bGltp9sNw+NvbOSl5CakMFHnV1WqSn+c5m0O3qUTd60vnC1yh9a0 uKUKMBiWm4LXJirMRegTkqDJXEU2wsUzpv2DgqcRY63WzXqnMASeNZnMMCZ03LqFjO7s 9s9bZtX8b0gYIENfoX7DXq6RAY93/mern44xzinQb98TqZMfT1dTJt5Ho5TGBNFNskK6 /1HzuGkYgIm8SAV9i2+7M9EpJdxZmEdXimg9qwHGrbxSH6hpBveNhD/0BRcsX6HH2p6R ihUA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=++lRrPZIeU62FCvvPHTaFsXIUe2gLeEhO5BLdzO/nxw=; fh=Yh5MnIr2kwTlJ639NYew6vOL/lU3o+rUQ25HelSCr8w=; b=AwfiChwQyjuQ6Yv6IXmA522tfsTs6Y6/Ho+JpMZZQJwActVNbYW7wemlSRO2E11Pwn EPOq223rM55rLA7EuvEjFY9R0kBJTmInWjApIer4qKgFTn0Bad+c9Asral+kqTNKshq4 P0FEuiA+w4dWb0+4oIa+n6Kyi8RrndxbXeTFIu5kVeLh1OyJ+T23Q/v0pk7CmoaR3Cao 71nCfa/5lbyr/KKIO2Wo1OIJnVlLhhMYrpPnrwh7l7t6H+7+65gUMcy16+S/r/dhCYJx W42T/mFXsFXIQEwJvLlC9gk7IoeWIp4/bijJfnLWsRPoZKkIaY8dWhoLgU8+BjzA55h3 NYkA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-214224-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-214224-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2c4a76a5c18si4653650a91.91.2024.06.13.19.25.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 19:25:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-214224-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-214224-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-214224-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 7A8DA283418 for ; Fri, 14 Jun 2024 02:25:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1967F1836C8; Fri, 14 Jun 2024 02:25:02 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 094A114532B for ; Fri, 14 Jun 2024 02:24:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718331901; cv=none; b=IQB5HzFnz5rohIDPm40uC007D/zF++fw2WpY56hLxvxcEkc1DLkai+KPVwZxFloclcwUixdaW/5zENDUU3cWddXTn1vxWk4G6W6OOlvmu1+KpaZRr4Gh3CQXpEWbGR42kGCe7lMHAKwtRUMerbBTnQZN9baorD1qkXrVdZ16eyI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718331901; c=relaxed/simple; bh=/Xs1YwUSUUPtBTM3JJOUhEixbPf3wiUKxyU+gNVx/Uw=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=lnI58idG483xn/U2tSzcqdU6o7VAFVnUNAVVCzukclQmPzHb2sXn64JEuamfZC9mAUJE+qpUmW5bP3ujAQ/kA+Y3SaVi4rFe9Oa2Uz8wayIRnzCE4HcLx5htBTWcDLW0QuXfaPVu2Zjcmdcgqm6GGmMCnhxq/C+WxzjFP0cr9Ks= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com 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 9DB4DFEC; Thu, 13 Jun 2024 19:25:22 -0700 (PDT) Received: from [10.162.16.42] (a077893.blr.arm.com [10.162.16.42]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0FFCA3F73B; Thu, 13 Jun 2024 19:24:55 -0700 (PDT) Message-ID: Date: Fri, 14 Jun 2024 07:54:53 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] arm64/mm: Drop ESR_ELx_FSC_TYPE Content-Language: en-US To: Marc Zyngier Cc: linux-arm-kernel@lists.infradead.org, mark.rutland@arm.com, ryan.roberts@arm.com, Catalin Marinas , Will Deacon , linux-kernel@vger.kernel.org References: <20240613094538.3263536-1-anshuman.khandual@arm.com> <86y179jdbx.wl-maz@kernel.org> From: Anshuman Khandual In-Reply-To: <86y179jdbx.wl-maz@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 6/13/24 16:53, Marc Zyngier wrote: > On Thu, 13 Jun 2024 10:45:38 +0100, > Anshuman Khandual wrote: >> >> Fault status codes at page table level 0, 1, 2 and 3 for access, permission >> and translation faults are architecturally organized in a way, that masking >> out ESR_ELx_FSC_TYPE, fetches Level 0 status code for the respective fault. >> >> Helpers like esr_fsc_is_[translation|permission|access_flag]_fault() mask >> out ESR_ELx_FSC_TYPE before comparing against corresponding Level 0 status >> code as the kernel does not yet care about the page table level, the fault >> really occurred previously. >> >> This scheme is starting to crumble after FEAT_LPA2 when level -1 got added. >> Fault status code for translation fault at level -1 is 0x2B which does not >> follow ESR_ELx_FSC_TYPE, requiring esr_fsc_is_translation_fault() changes. >> >> This changes above helpers to compare against individual fault status code >> values for each page table level and drop ESR_ELx_FSC_TYPE which is losing >> its value as a common mask. > > I'd rather we do not drop the existing #defines, for a very > self-serving reason: > > NV requires an implementation to synthesise fault syndromes, and these > definition are extensively used to compose the syndrome information > (see the NV MMU series at [1]). This is also heavily use to emulate > the AT instructions (fault reporting in PAR_EL1.FST). > > Having additional helpers is fine. Dropping the base definitions > isn't, and I'd like to avoid reintroducing them. You would like to just leave behind all the existing level 0 syndrome macro definitions in place ? #define ESR_ELx_FSC_ACCESS (0x08) #define ESR_ELx_FSC_FAULT (0x04) #define ESR_ELx_FSC_PERM (0x0C) Or which are rather #define ESR_ELx_FSC_ACCESS ESR_ELx_FSC_ACCESS_L0 #define ESR_ELx_FSC_FAULT ESR_ELx_FSC_FAULT_L0 #define ESR_ELx_FSC_PERM ESR_ELx_FSC_PERM_L0 But just wondering why cannot ESR_ELx_FSC_[ACCESS|FAULT|PERM]_L0 definitions be used directly in new use cases ? > > Thanks, > > M. > > [1] http://lore.kernel.org/r/20240529145628.3272630-1-maz@kernel.org >