From: Sean Christopherson <seanjc@google.com>
To: Sebastian Ott <sebott@redhat.com>
Cc: kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
Marc Zyngier <maz@kernel.org>,
Oliver Upton <oliver.upton@linux.dev>
Subject: Re: [PATCH] KVM: arm64: Fix smp_processor_id() call in preemptible context
Date: Tue, 6 Jun 2023 06:59:07 -0700 [thread overview]
Message-ID: <ZH87qwYqtUM5eG2H@google.com> (raw)
In-Reply-To: <2f16f83e-ed60-fcb7-7f3d-0fa216c41cb9@redhat.com>
On Tue, Jun 06, 2023, Sebastian Ott wrote:
> Fixes: 1c913a1c35aa ("KVM: arm64: Iterate arm_pmus list to probe for default PMU")
> Signed-off-by: Sebastian Ott <sebott@redhat.com>
> ---
> arch/arm64/kvm/pmu-emul.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm64/kvm/pmu-emul.c b/arch/arm64/kvm/pmu-emul.c
> index 491ca7eb2a4c..f9e4e4334875 100644
> --- a/arch/arm64/kvm/pmu-emul.c
> +++ b/arch/arm64/kvm/pmu-emul.c
> @@ -700,6 +700,7 @@ static struct arm_pmu *kvm_pmu_probe_armpmu(void)
>
> mutex_lock(&arm_pmus_lock);
>
> + preempt_disable();
get_cpu() + put_cpu() would be more succinct and self-documenting.
> cpu = smp_processor_id();
> list_for_each_entry(entry, &arm_pmus, entry) {
> tmp = entry->arm_pmu;
> @@ -709,7 +710,7 @@ static struct arm_pmu *kvm_pmu_probe_armpmu(void)
> break;
> }
> }
> -
> + preempt_enable();
> mutex_unlock(&arm_pmus_lock);
>
> return pmu;
> --
> 2.40.1
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2023-06-06 13:59 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-06 10:37 [PATCH] KVM: arm64: Fix smp_processor_id() call in preemptible context Sebastian Ott
2023-06-06 13:59 ` Sean Christopherson [this message]
2023-06-06 14:10 ` Oliver Upton
2023-06-06 14:24 ` Sebastian Ott
2023-06-06 14:29 ` Sean Christopherson
2023-06-06 15:18 ` Oliver Upton
2023-06-06 15:46 ` Sean Christopherson
2023-06-06 17:00 ` Oliver Upton
2023-06-06 17:04 ` Sean Christopherson
2023-06-06 16:17 ` Marc Zyngier
2023-06-06 16:48 ` Oliver Upton
2023-06-06 17:10 ` Marc Zyngier
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=ZH87qwYqtUM5eG2H@google.com \
--to=seanjc@google.com \
--cc=kvmarm@lists.linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=maz@kernel.org \
--cc=oliver.upton@linux.dev \
--cc=sebott@redhat.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;
as well as URLs for NNTP newsgroup(s).