From: James Morse <james.morse@arm.com>
To: Ben Horgan <ben.horgan@arm.com>
Cc: reinette.chatre@intel.com, fenghuay@nvidia.com, gshan@redhat.com,
zengheng4@huawei.com, jonathan.cameron@huawei.com,
tan.shaopeng@jp.fujitsu.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1 2/2] arm_mpam: Disable preemption when making accesses to fake MSC in kunit test
Date: Fri, 6 Mar 2026 18:24:09 +0000 [thread overview]
Message-ID: <ecfc388a-9e84-4d66-8548-e3e2c818717b@arm.com> (raw)
In-Reply-To: <20260227110314.4038066-3-ben.horgan@arm.com>
Hi Ben,
On 27/02/2026 11:03, Ben Horgan wrote:
> Accesses to MSC must be made from a cpu that is affine to that MSC and the
> driver checks this in __mpam_write_reg() using smp_processor_id(). A fake
> in-memory MSC is used for testing. When using that, it doesn't matter which
> cpu we access it from but calling smp_processor_id() from a preemptible
> context gives warnings when running with CONFIG_DEBUG_PREEMPT.
Bah!
> Add a test helper that wraps mpam_reset_msc_bitmap() with preemption
> disabled to ensure all (fake) MSC accesses are made with preemption
> disabled.
> diff --git a/drivers/resctrl/test_mpam_devices.c b/drivers/resctrl/test_mpam_devices.c
> index 3e8d564a0c64..75bd41bcc395 100644
> --- a/drivers/resctrl/test_mpam_devices.c
> +++ b/drivers/resctrl/test_mpam_devices.c
> @@ -322,6 +322,14 @@ static void test_mpam_enable_merge_features(struct kunit *test)
> mutex_unlock(&mpam_list_lock);
> }
>
> +static void __test_mpam_reset_msc_bitmap(struct mpam_msc *msc, u16 reg, u16 wd)
> +{
> + /* Avoid warnings when running with CONFIG_DEBUG_PREEMPT */
> + guard(preempt)();
> +
> + mpam_reset_msc_bitmap(msc, reg, wd);
> +}
Reviewed-by: James Morse <james.morse@arm.com>
Thanks,
James
next prev parent reply other threads:[~2026-03-06 18:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-27 11:03 [PATCH v1 0/2] arm_mpam: A couple of fixes on v7.0-rc1 Ben Horgan
2026-02-27 11:03 ` [PATCH v1 1/2] arm_mpam: Fix null pointer dereference when restoring bandwidth counters Ben Horgan
2026-03-06 18:24 ` James Morse
2026-02-27 11:03 ` [PATCH v1 2/2] arm_mpam: Disable preemption when making accesses to fake MSC in kunit test Ben Horgan
2026-03-06 18:24 ` James Morse [this message]
2026-03-19 0:56 ` [PATCH v1 0/2] arm_mpam: A couple of fixes on v7.0-rc1 Tan, Shaopeng/譚 紹鵬
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ecfc388a-9e84-4d66-8548-e3e2c818717b@arm.com \
--to=james.morse@arm.com \
--cc=ben.horgan@arm.com \
--cc=fenghuay@nvidia.com \
--cc=gshan@redhat.com \
--cc=jonathan.cameron@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=reinette.chatre@intel.com \
--cc=tan.shaopeng@jp.fujitsu.com \
--cc=zengheng4@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome