Hi Ben, On 27/08/2025 17:19, Ben Horgan wrote: > On 8/22/25 16:30, James Morse wrote: >> When a CPU comes online, it may bring a newly accessible MSC with >> it. Only the default partid has its value reset by hardware, and >> even then the MSC might not have been reset since its config was >> previously dirtyied. e.g. Kexec. >> >> Any in-use partid must have its configuration restored, or reset. >> In-use partids may be held in caches and evicted later. >> >> MSC are also reset when CPUs are taken offline to cover cases where >> firmware doesn't reset the MSC over reboot using UEFI, or kexec >> where there is no firmware involvement. >> >> If the configuration for a RIS has not been touched since it was >> brought online, it does not need resetting again. >> >> To reset, write the maximum values for all discovered controls. >> diff --git a/drivers/resctrl/mpam_devices.c b/drivers/resctrl/mpam_devices.c >> index bb62de6d3847..c1f01dd748ad 100644 >> --- a/drivers/resctrl/mpam_devices.c >> +++ b/drivers/resctrl/mpam_devices.c >> @@ -849,8 +850,115 @@ static int mpam_msc_hw_probe(struct mpam_msc *msc) >> +static void mpam_reset_ris_partid(struct mpam_msc_ris *ris, u16 partid) >> +{ >> + u16 bwa_fract = MPAMCFG_MBW_MAX_MAX; >> + struct mpam_msc *msc = ris->vmsc->msc; >> + struct mpam_props *rprops = &ris->props; >> + >> + mpam_assert_srcu_read_lock_held(); >> + >> + mutex_lock(&msc->part_sel_lock); >> + __mpam_part_sel(ris->ris_idx, partid, msc); >> + >> + if (mpam_has_feature(mpam_feat_cpor_part, rprops)) >> + mpam_reset_msc_bitmap(msc, MPAMCFG_CPBM, rprops->cpbm_wd); >> + >> + if (mpam_has_feature(mpam_feat_mbw_part, rprops)) >> + mpam_reset_msc_bitmap(msc, MPAMCFG_MBW_PBM, rprops->mbw_pbm_bits); >> + >> + if (mpam_has_feature(mpam_feat_mbw_min, rprops)) >> + mpam_write_partsel_reg(msc, MBW_MIN, 0); >> + >> + if (mpam_has_feature(mpam_feat_mbw_max, rprops)) >> + mpam_write_partsel_reg(msc, MBW_MAX, bwa_fract); > MPAMCFG_MBW_MAX_MAX can be used directly instead of bwa_fract. Without the second user, yes. >> + >> + if (mpam_has_feature(mpam_feat_mbw_prop, rprops)) >> + mpam_write_partsel_reg(msc, MBW_PROP, bwa_fract); > Shouldn't this reset to 0? STRIDEM1 is a cost. Heh, this is just a copy and paste of the last value, because it clears the 'enable' bit, and the spec says "there is no setting of the STRIDEM1 control field that disables the effects of proportional-stride". Yes - zero would be better. Thanks, James