mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Jürgen Groß" <jgross@suse.com>
To: Huacai Chen <chenhuacai@kernel.org>, Bibo Mao <maobibo@loongson.cn>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	WANG Xuerui <kernel@xen0n.name>,
	Ajay Kaher <ajay.kaher@broadcom.com>,
	Alexey Makhalov <alexey.makhalov@broadcom.com>,
	Broadcom internal kernel review list
	<bcm-kernel-feedback-list@broadcom.com>,
	kvm@vger.kernel.org, loongarch@lists.linux.dev,
	linux-kernel@vger.kernel.org, virtualization@lists.linux.dev,
	x86@kernel.org
Subject: Re: [PATCH v2 2/3] LoongArch: Add paravirt support with vcpu_is_preempted() in guest side
Date: Mon, 24 Nov 2025 07:55:46 +0100	[thread overview]
Message-ID: <47fed3cd-58fd-4670-a939-7b2e7ca1b673@suse.com> (raw)
In-Reply-To: <CAAhV-H5Oag+mDp0CfZ1VDeapeKas354j68JZN9bN42=D4huowA@mail.gmail.com>


[-- Attachment #1.1.1: Type: text/plain, Size: 1370 bytes --]

On 24.11.25 07:33, Huacai Chen wrote:
> Hi, Bibo,
> 
> On Mon, Nov 24, 2025 at 11:54 AM Bibo Mao <maobibo@loongson.cn> wrote:
>>
>> Function vcpu_is_preempted() is used to check whether vCPU is preempted
>> or not. Here add implementation with vcpu_is_preempted() when option
>> CONFIG_PARAVIRT is enabled.
>>
>> Signed-off-by: Bibo Mao <maobibo@loongson.cn>
>> ---
>>   arch/loongarch/include/asm/qspinlock.h |  5 +++++
>>   arch/loongarch/kernel/paravirt.c       | 16 ++++++++++++++++
>>   2 files changed, 21 insertions(+)
>>
>> diff --git a/arch/loongarch/include/asm/qspinlock.h b/arch/loongarch/include/asm/qspinlock.h
>> index e76d3aa1e1eb..9a5b7ba1f4cb 100644
>> --- a/arch/loongarch/include/asm/qspinlock.h
>> +++ b/arch/loongarch/include/asm/qspinlock.h
>> @@ -34,6 +34,11 @@ static inline bool virt_spin_lock(struct qspinlock *lock)
>>          return true;
>>   }
>>
>> +#ifdef CONFIG_SMP
>> +#define vcpu_is_preempted      vcpu_is_preempted
>> +bool vcpu_is_preempted(int cpu);
> In V1 there is a build error because you reference mp_ops, so in V2
> you needn't put it in CONFIG_SMP.
> On the other hand, even if you really build a UP guest kernel, when
> multiple guests run together, you probably need vcpu_is_preemtped.

I don't think so. When the UP guest's vcpu is preempted, who will use this
function?


Juergen

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3743 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

  reply	other threads:[~2025-11-24  6:55 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ß [this message]
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

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=47fed3cd-58fd-4670-a939-7b2e7ca1b673@suse.com \
    --to=jgross@suse.com \
    --cc=ajay.kaher@broadcom.com \
    --cc=alexey.makhalov@broadcom.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=chenhuacai@kernel.org \
    --cc=kernel@xen0n.name \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=loongarch@lists.linux.dev \
    --cc=maobibo@loongson.cn \
    --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®