lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <86bjrbenh1.wl-maz@kernel.org>
Date: Thu, 29 May 2025 11:10:50 +0100
From: Marc Zyngier <maz@...nel.org>
To: Xi Ruoyao <xry111@...111.site>
Cc: James Morse <james.morse@....com>,
	Anshuman Khandual <anshuman.khandual@....com>,
	Ben Horgan <ben.horgan@....com>,
	linux-arm-kernel@...ts.infradead.org,
	linux-kernel@...r.kernel.org,
	Shameer Kolothum <shameerali.kolothum.thodi@...wei.com>,
	Mingcong Bai <jeffbai@...c.io>,
	Shaopeng Tan <tan.shaopeng@...itsu.com>
Subject: Re: [PATCH v3] arm64: Add override for MPAM

On Thu, 29 May 2025 11:01:54 +0100,
Marc Zyngier <maz@...nel.org> wrote:
> 
> So you would need to:
> 
> - nuke both MPAM and MPAM_frac in their respective ID registers,
>   ensuring that we effectively advertise the absence of MPAM
> 
> - either check for both fields wherever we currently refer only to
>   MPAM, as what we have today looks fragile, or unconditionally
>   override both ID fields if the HW actually implements MPAMv0.1.
> 
>   I personally think the former is easier to implement.
> 
> Note that these would be two separate changes, and that you only need
> to implement the first one to achieve what you're after for the
> current level of MPAM support.

To be completely clear, the change for this patch could be as simple
as this:

diff --git a/arch/arm64/kernel/pi/idreg-override.c b/arch/arm64/kernel/pi/idreg-override.c
index 836e5a9b98d03..bc57b290e5e7b 100644
--- a/arch/arm64/kernel/pi/idreg-override.c
+++ b/arch/arm64/kernel/pi/idreg-override.c
@@ -155,6 +155,7 @@ static const struct ftr_set_desc pfr1 __prel64_initconst = {
 		FIELD("gcs", ID_AA64PFR1_EL1_GCS_SHIFT, NULL),
 		FIELD("mte", ID_AA64PFR1_EL1_MTE_SHIFT, NULL),
 		FIELD("sme", ID_AA64PFR1_EL1_SME_SHIFT, pfr1_sme_filter),
+		FIELD("mpam_frac", ID_AA64PFR1_EL1_MPAM_frac_SHIFT, NULL),
 		{}
 	},
 };
@@ -247,7 +248,7 @@ static const struct {
 	{ "rodata=off",			"arm64_sw.rodataoff=1" },
 	{ "arm64.nolva",		"id_aa64mmfr2.varange=0" },
 	{ "arm64.no32bit_el0",		"id_aa64pfr0.el0=1" },
-	{ "arm64.nompam",		"id_aa64pfr0.mpam=0" },
+	{ "arm64.nompam",		"id_aa64pfr0.mpam=0 id_aa64pfr1.mpam_frac=0" },
 };
 
 static int __init parse_hexdigit(const char *p, u64 *v)


HTH,

	M.

-- 
Without deviation from the norm, progress is not possible.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ