From: Bibo Mao <maobibo@loongson.cn>
To: Huacai Chen <chenhuacai@kernel.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
Juergen Gross <jgross@suse.com>,
Ajay Kaher <ajay.kaher@broadcom.com>,
Alexey Makhalov <alexey.makhalov@broadcom.com>,
Broadcom internal kernel review list
<bcm-kernel-feedback-list@broadcom.com>,
WANG Xuerui <kernel@xen0n.name>,
kvm@vger.kernel.org, loongarch@lists.linux.dev,
linux-kernel@vger.kernel.org, virtualization@lists.linux.dev,
x86@kernel.org
Subject: Re: [PATCH v2 3/3] LoongArch: Add paravirt preempt print prompt
Date: Mon, 24 Nov 2025 15:10:10 +0800 [thread overview]
Message-ID: <fa25523c-4913-186b-caea-d7a46d52a71e@loongson.cn> (raw)
In-Reply-To: <CAAhV-H5xA_QcRXJsiW929pQ3zPw-5BqgbGW6K5Qy9sa3ofH+9g@mail.gmail.com>
On 2025/11/24 下午2:33, Huacai Chen wrote:
> Hi, Bibo,
>
> On Mon, Nov 24, 2025 at 11:54 AM Bibo Mao <maobibo@loongson.cn> wrote:
>>
>> Add paravirt preempt print prompt together with steal timer information,
>> so that it is easy to check whether paravirt preempt feature is enabled
>> or not.
>>
>> Signed-off-by: Bibo Mao <maobibo@loongson.cn>
>> ---
>> arch/loongarch/kernel/paravirt.c | 10 ++++++++--
>> 1 file changed, 8 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/loongarch/kernel/paravirt.c b/arch/loongarch/kernel/paravirt.c
>> index d4163679adc4..ffe1cf284c41 100644
>> --- a/arch/loongarch/kernel/paravirt.c
>> +++ b/arch/loongarch/kernel/paravirt.c
>> @@ -300,6 +300,7 @@ static struct notifier_block pv_reboot_nb = {
>> int __init pv_time_init(void)
>> {
>> int r;
>> + bool pv_preempted = false;
>>
>> if (!kvm_para_has_feature(KVM_FEATURE_STEAL_TIME))
>> return 0;
>> @@ -322,8 +323,10 @@ int __init pv_time_init(void)
>> return r;
>> }
>>
>> - if (kvm_para_has_feature(KVM_FEATURE_PREEMPT))
>> + if (kvm_para_has_feature(KVM_FEATURE_PREEMPT)) {
>> static_branch_enable(&virt_preempt_key);
>> + pv_preempted = true;
>> + }
>> #endif
>>
>> static_call_update(pv_steal_clock, paravt_steal_clock);
>> @@ -334,7 +337,10 @@ int __init pv_time_init(void)
>> static_key_slow_inc(¶virt_steal_rq_enabled);
>> #endif
>>
>> - pr_info("Using paravirt steal-time\n");
>> + if (pv_preempted)
> No pv_preempted needed, you can just use
> static_key_enabled(&virt_preempt_key) and merge this patch to Patch-2.
yes, good idea.
Will do in next version with these two points.
Regards
Bibo Mao
>
>
> Huacai
>
>> + pr_info("Using paravirt steal-time with preempt hint enabled\n");
>> + else
>> + pr_info("Using paravirt steal-time with preempt hint disabled\n");
>>
>> return 0;
>> }
>> --
>> 2.39.3
>>
prev parent reply other threads:[~2025-11-24 7:12 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-24 3:53 [PATCH v2 0/3] LoongArch: KVM: Add paravirt preempt support Bibo Mao
2025-11-24 3:53 ` [PATCH v2 1/3] LoongArch: KVM: Add paravirt preempt feature in hypervisor side Bibo Mao
2025-11-24 3:54 ` [PATCH v2 2/3] LoongArch: Add paravirt support with vcpu_is_preempted() in guest side Bibo Mao
2025-11-24 6:33 ` Huacai Chen
2025-11-24 6:55 ` Jürgen Groß
2025-11-24 7:00 ` Bibo Mao
2025-11-24 7:13 ` Huacai Chen
2025-11-24 7:48 ` Bibo Mao
2025-11-24 8:03 ` Huacai Chen
2025-11-24 8:32 ` Bibo Mao
2025-11-24 9:03 ` Huacai Chen
2025-11-24 9:05 ` Bibo Mao
2025-11-24 9:33 ` Huacai Chen
2025-11-24 3:54 ` [PATCH v2 3/3] LoongArch: Add paravirt preempt print prompt Bibo Mao
2025-11-24 6:33 ` Huacai Chen
2025-11-24 7:10 ` Bibo Mao [this message]
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=fa25523c-4913-186b-caea-d7a46d52a71e@loongson.cn \
--to=maobibo@loongson.cn \
--cc=ajay.kaher@broadcom.com \
--cc=alexey.makhalov@broadcom.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=chenhuacai@kernel.org \
--cc=jgross@suse.com \
--cc=kernel@xen0n.name \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=loongarch@lists.linux.dev \
--cc=pbonzini@redhat.com \
--cc=virtualization@lists.linux.dev \
--cc=x86@kernel.org \
/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
all inboxes | Powered by JetHome®