Skip to content

Commit 772bca6

Browse files
xry111KexyBiscuit
authored andcommitted
AOSCOS: arm64: Disable MPAM by default
We have to work OotB on W510, and ARM64 does not support extending the built-in command line with the one from the bootloader. So only try MPAM if the user explicitly gives "aosc.try_mpam=1" via the cmdline. Signed-off-by: Xi Ruoyao <[email protected]>
1 parent def7d12 commit 772bca6

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

arch/arm64/kernel/pi/idreg-override.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,17 @@ static const struct ftr_set_desc sw_features __prel64_initconst = {
215215
},
216216
};
217217

218+
static struct arm64_ftr_override __read_mostly aosc_feature_override;
219+
220+
static const struct ftr_set_desc aosc_features __prel64_initconst = {
221+
.name = "aosc",
222+
.override = &aosc_feature_override,
223+
.fields = {
224+
FIELD("try_mpam", 0, NULL),
225+
{}
226+
},
227+
};
228+
218229
static const
219230
PREL64(const struct ftr_set_desc, reg) regs[] __prel64_initconst = {
220231
{ &mmfr0 },
@@ -226,6 +237,7 @@ PREL64(const struct ftr_set_desc, reg) regs[] __prel64_initconst = {
226237
{ &isar2 },
227238
{ &smfr0 },
228239
{ &sw_features },
240+
{ &aosc_features },
229241
};
230242

231243
static const struct {
@@ -390,6 +402,14 @@ static __init void parse_cmdline(const void *fdt, int chosen)
390402

391403
if (!IS_ENABLED(CONFIG_CMDLINE_FORCE) && prop)
392404
__parse_cmdline(prop, true);
405+
406+
/*
407+
* Sorry but we have to work OotB on some platforms with broken
408+
* firmware, notably W510. Use "aosc.try_mpam=1" if you really need
409+
* MPAM on AOSC.
410+
*/
411+
if (!arm64_apply_feature_override(0, 0, 4, &aosc_feature_override))
412+
__parse_cmdline("arm64.nompam", true);
393413
}
394414

395415
void __init init_feature_override(u64 boot_status, const void *fdt,

0 commit comments

Comments
 (0)