Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp74073lqs; Thu, 13 Jun 2024 04:26:06 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVKS95pyQZqpQ4VnvjeZPaJSt3PwprPJ6faBUv+9ypTC/81ldu4px1hhWuHepjA6LpvftRVm+r9NJ2dAF3q2NyCozaeDmAcxpl4chiB1g== X-Google-Smtp-Source: AGHT+IG9/wvvgXU+WoNSfQUdSMoCAjGB4mgZG/jxAOKqQx2kcaF/+0cekVnPjXGOoOPE6KsQGOQC X-Received: by 2002:a05:6a20:2449:b0:1b8:4580:dab0 with SMTP id adf61e73a8af0-1b8a9bb8e13mr4814651637.18.1718277966611; Thu, 13 Jun 2024 04:26:06 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718277966; cv=pass; d=google.com; s=arc-20160816; b=vOKbbp5rZdjNb/wkevGvzXZA0fgDhnyOPOBqDYADEcR8+9vH4jXzUCZDHBM5hOBWHY Ide2i/Qp1vFID8wbYWRzO6loankXvqGZzHovalDYctUScTy9eu+6xjou1kYIwiJWGWgM 6dLLbPtRC9b2VPH5XDr2Xu14wL7KbXPA+n9R6+3EF0oZw9ari58gD1+0RsBmvgwHl8sW VX5e4iDrCPqcEaDEMBQEk1BGxHJ1QFRjHlx7WCUwxFUMBdpOgBEMdFpOGQuHLKL4onsu hAZDbRLvY0hAYgUjVRWGMenYRNAJ+MFLcPfYEmHvDJrdVAGYVD9pk6LsY+fkk4+l5UkS skZg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:references:in-reply-to:subject:cc:to:from:message-id :date:dkim-signature; bh=Fsg/Yy5/6aWhGNLFFvGSAYZdi/Si7KB/ILIOw5jSitw=; fh=rdi9IMvYhWZkOWXeCyjfeNNHEyFxkioWBKtcgC0KjmE=; b=rA1eblDde+I7WiHlQELyHvtaP+dDkZj2+iMf8wd9O0KKNHqnKkLhqWd216VHHBRlew uoW7hE40u1aT2hZBHGfvSCbEXdhKuZrqNn2u/2kZcli8LZAjusLyS5alrkdmTJOVGv14 Itr2FiaYTMLvC2PkuqE3313trKgI3CH9pYMilk9xNJCYWGAcE6zDWRDsse6iPnkLr6kb yJ6/qeKul5/esb/GtTZ0gysvWG18Vt0d7SLuqx+MNs8Oq3O7AATX/WyV0XQ/kuSVQ55W Nk0TPrstjvGKnfv5A3u/iO0TDe/druORlcqfGFbbwW11cjb1gynDSikslASHFJRzEgmE aV8Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IoMHuSLZ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-213088-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-213088-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d2e1a72fcca58-705ccb70f32si1237957b3a.244.2024.06.13.04.26.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 04:26:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-213088-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IoMHuSLZ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-213088-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-213088-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 65DECB23B1F for ; Thu, 13 Jun 2024 11:23:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D504613C9DE; Thu, 13 Jun 2024 11:23:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="IoMHuSLZ" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0A3885BACF for ; Thu, 13 Jun 2024 11:23:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718277829; cv=none; b=YXUTitsIi4jwcnrVTdMTZKvwJ6h7y/7Sq2aHjzLLkAgK/B6PaYrNAFJQUmMu+hcEngFB6uXDuT6o4vIWk2NeFC6CmvRvosaLZPCOqKM2SAGf88viaZ8pcp7FPtCYVjHrwjN1MqyyI38la7fM2wZQtXxdL2f99fw2dzNrbrd9s8s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718277829; c=relaxed/simple; bh=sqgBrvb1tQtLs7yqLxnsmPlbQsKBTcgqd4+WVYki8NA=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=sQh32ssqWVgb8qCFYHeGavKCw06Fw5WOqgGo8TemFdfSL2I+PLJRaA036cpv/lRJurjX6JKy3BF8H9oYH0ZVQ80+N/udS0XE7VoTok7WTZfZKeZHUSKrnHn/cOdYFIVSqYbaATvc/OqGYTgXSe0Vn9a0zrEv82HnIE5uL7cImKg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=IoMHuSLZ; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 80EFAC2BBFC; Thu, 13 Jun 2024 11:23:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718277828; bh=sqgBrvb1tQtLs7yqLxnsmPlbQsKBTcgqd4+WVYki8NA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=IoMHuSLZR5RB4BxswtmmHoKCuhmA8LeQyKKu7kjBWRojZcKSGvSAl3zJD70QMsHY7 GUFhpEUG/upkV7fXsNVUY+Armma8CD4dh1xu3ewwcN23nzVSGMnEn1NsXjHrI5IeJl jbGnNl3AMVn/xzd+ZPwvsNh2p274JM51VV08EMJTJA1HxKLRAr8RIiC46EDux+1J8X V8c1/ri8+BdyFnGoHvXzrIT3e3UOxqUehJKI+91zuL8MrY0WhuNC2+PwkLko2KNOFj Niu12/k+oLeM7edwHke4V6CD4rg95qw5R5WUyJUJpXSxcBHOQLNyzOVA0a6o8kEgh0 WuJMouCa/o75A== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1sHiYU-003Wgr-9U; Thu, 13 Jun 2024 12:23:46 +0100 Date: Thu, 13 Jun 2024 12:23:46 +0100 Message-ID: <86y179jdbx.wl-maz@kernel.org> From: Marc Zyngier To: Anshuman Khandual Cc: linux-arm-kernel@lists.infradead.org, mark.rutland@arm.com, ryan.roberts@arm.com, Catalin Marinas , Will Deacon , linux-kernel@vger.kernel.org Subject: Re: [PATCH] arm64/mm: Drop ESR_ELx_FSC_TYPE In-Reply-To: <20240613094538.3263536-1-anshuman.khandual@arm.com> References: <20240613094538.3263536-1-anshuman.khandual@arm.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/29.2 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: anshuman.khandual@arm.com, linux-arm-kernel@lists.infradead.org, mark.rutland@arm.com, ryan.roberts@arm.com, catalin.marinas@arm.com, will@kernel.org, linux-kernel@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false 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. Thanks, M. [1] http://lore.kernel.org/r/20240529145628.3272630-1-maz@kernel.org -- Without deviation from the norm, progress is not possible.