linux-coco.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Salil Mehta <salil.mehta@huawei.com>
To: bibo mao <maobibo@loongson.cn>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
	Jonathan Cameron <jonathan.cameron@huawei.com>,
	Marc Zyngier <maz@kernel.org>, Will Deacon <will@kernel.org>,
	"christoffer.dall@arm.com" <christoffer.dall@arm.com>,
	"oliver.upton@linux.dev" <oliver.upton@linux.dev>,
	"mark.rutland@arm.com" <mark.rutland@arm.com>,
	"pbonzini@redhat.com" <pbonzini@redhat.com>,
	"Salil Mehta" <salil.mehta@opnsrc.net>,
	"andrew.jones@linux.dev" <andrew.jones@linux.dev>,
	yuzenghui <yuzenghui@huawei.com>,
	"kvmarm@lists.cs.columbia.edu" <kvmarm@lists.cs.columbia.edu>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"james.morse@arm.com" <james.morse@arm.com>,
	"steven.price@arm.com" <steven.price@arm.com>,
	"Suzuki K Poulose" <suzuki.poulose@arm.com>,
	Jean-Philippe Brucker <jean-philippe@linaro.org>,
	"kvmarm@lists.linux.dev" <kvmarm@lists.linux.dev>,
	"linux-coco@lists.linux.dev" <linux-coco@lists.linux.dev>
Subject: RE: [Question - ARM CCA] vCPU Hotplug Support in ARM Realm world might require ARM spec change?
Date: Tue, 25 Jul 2023 00:56:21 +0000	[thread overview]
Message-ID: <d13c4cb44a2b4b42a8b534c38c402a1d@huawei.com> (raw)
In-Reply-To: <2fa14ef5-b2f7-459d-8b84-114d36ba3cf7@loongson.cn>

Hi Bibo,

> From: bibo mao <maobibo@loongson.cn>
> Sent: Tuesday, July 25, 2023 1:29 AM
> To: Salil Mehta <salil.mehta@huawei.com>
> Cc: Catalin Marinas <catalin.marinas@arm.com>; Jonathan Cameron
> <jonathan.cameron@huawei.com>; Marc Zyngier <maz@kernel.org>; Will Deacon
> <will@kernel.org>; christoffer.dall@arm.com; oliver.upton@linux.dev;
> mark.rutland@arm.com; pbonzini@redhat.com; Salil Mehta
> <salil.mehta@opnsrc.net>; andrew.jones@linux.dev; yuzenghui
> <yuzenghui@huawei.com>; kvmarm@lists.cs.columbia.edu; linux-arm-
> kernel@lists.infradead.org; linux-kernel@vger.kernel.org;
> kvm@vger.kernel.org; qemu-devel@nongnu.org; james.morse@arm.com;
> steven.price@arm.com; Suzuki K Poulose <suzuki.poulose@arm.com>; Jean-
> Philippe Brucker <jean-philippe@linaro.org>; kvmarm@lists.linux.dev; linux-
> coco@lists.linux.dev
> Subject: Re: [Question - ARM CCA] vCPU Hotplug Support in ARM Realm world
> might require ARM spec change?
> 
> Is vcpu hotplug supported in arm virt-machine now?

Not yet. We are working on it. Please check the RFCs being tested.


[1] Pre-RFC V2 Changes: Support of Virtual CPU Hotplug for ARMv8 Arch  (WIP)
    https://github.com/salil-mehta/qemu.git virt-cpuhp-armv8/rfc-v1-port11052023.dev-1
[2] [RFC PATCH 00/32] ACPI/arm64: add support for virtual cpuhotplug  
    https://git.gitlab.arm.com/linux-arm/linux-jm.git virtual_cpu_hotplug/rfc/v2
    
    
> There is arm64 vcpu hotplug patch in qemu mailing list, however it is not merged.
> I do not know why it is not merged.


I think you are referring to patches [3], [4]? Please follow the discussion
for details. 


[3] [PATCH RFC 00/22] Support of Virtual CPU Hotplug for ARMv8 Arch
    https://lore.kernel.org/all/20200613213629.21984-1-salil.mehta@huawei.com/
[4] [PATCH RFC 0/4] Changes to Support *Virtual* CPU Hotplug for ARM64
    https://lore.kernel.org/all/20200625133757.22332-1-salil.mehta@huawei.com/#r


In summary, there were some ARM64 Architecture constraints which were being
violated in the earlier patches of the kernel [4] so we had to re-think of the
kernel changes. The Qemu part mostly remains same with some new introductions
of Guest HVC/SMC hyper call exit handling in user space etc. for policy checks
in VMM/Qemu. 


You can follow the KVMForum conference presentations [5], [6] delivered in the
year 2020 and 2023 to get hold of more details related to this.


[5] KVMForum 2023: Challenges Revisited in Supporting Virt CPU Hotplug on architectures that don't Support CPU Hotplug (like ARM64)
    https://kvm-forum.qemu.org/2023/talk/9SMPDQ/
[6] KVMForum 2020: Challenges in Supporting Virtual CPU Hotplug on SoC Based Systems (like ARM64)
    https://kvmforum2020.sched.com/event/eE4m



> I ask this question because we propose
> similar patch about LoongArch system in qemu mailing list, and kernel need not be
> modified for vcpu hotplug.


Could you please share the link of your patches so that we can have a look and
draw a comparison?


Thanks
Salil.

> 
> Regards
> Bibo, mao
> 
> 在 2023/7/19 10:35, Salil Mehta 写道:
> > [Reposting it here from Linaro Open Discussion List for more eyes to look
> at]
> >
> > Hello,
> > I have recently started to dabble with ARM CCA stuff and check if our
> > recent changes to support vCPU Hotplug in ARM64 can work in the realm
> > world. I have realized that in the RMM specification[1] PSCI_CPU_ON
> > command(B5.3.3) does not handles the PSCI_DENIED return code(B5.4.2),
> > from the host. This might be required to support vCPU Hotplug feature
> > in the realm world in future. vCPU Hotplug is an important feature to
> > support kata-containers in realm world as it reduces the VM boot time
> > and facilitates dynamic adjustment of vCPUs (which I think should be
> > true even with Realm world as current implementation only makes use
> > of the PSCI_ON/OFF to realize the Hotplug look-like effect?)
> >
> >
> > As per our recent changes [2], [3] related to support vCPU Hotplug on
> > ARM64, we handle the guest exits due to SMC/HVC Hypercall in the
> > user-space i.e. VMM/Qemu. In realm world, REC Exits to host due to
> > PSCI_CPU_ON should undergo similar policy checks and I think,
> >
> > 1. Host should *deny* to online the target vCPUs which are NOT plugged
> > 2. This means target REC should be denied by host. Can host call
> >    RMI_PSCI_COMPETE in such s case?
> > 3. The *return* value (B5.3.3.1.3 Output values) should be PSCI_DENIED
> > 4. Failure condition (B5.3.3.2) should be amended with
> >    runnable pre: target_rec.flags.runnable == NOT_RUNNABLE (?)
> >             post: result == PSCI_DENIED (?)
> > 5. Change would also be required in the flow (D1.4 PSCI flows) depicting
> >    PSCI_CPU_ON flow (D1.4.1)
> >
> >
> > I do understand that ARM CCA support is in its infancy stage and
> > discussing about vCPU Hotplug in realm world seem to be a far-fetched
> > idea right now. But specification changes require lot of time and if
> > this change is really required then it should be further discussed
> > within ARM.
> >
> > Many thanks!
> >
> >
> > Bes regards
> > Salil
> >
> >
> > References:
> >
> > [1] https://developer.arm.com/documentation/den0137/latest/
> > [2] https://github.com/salil-mehta/qemu.git virt-cpuhp-armv8/rfc-v1-port11052023.dev-1
> > [3] https://git.gitlab.arm.com/linux-arm/linux-jm.git virtual_cpu_hotplug/rfc/v2

  reply	other threads:[~2023-07-25  0:56 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-19  2:35 [Question - ARM CCA] vCPU Hotplug Support in ARM Realm world might require ARM spec change? Salil Mehta
2023-07-19  9:28 ` Suzuki K Poulose
2023-07-24 16:27   ` Suzuki K Poulose
2023-07-25  0:05     ` Salil Mehta
2023-07-25 11:19       ` Suzuki K Poulose
2023-07-27 14:24         ` Salil Mehta
2023-07-27 16:40           ` Suzuki K Poulose
2023-07-25  0:28 ` bibo mao
2023-07-25  0:56   ` Salil Mehta [this message]
2023-07-25  1:13     ` bibo mao
2023-07-25  5:45       ` Salil Mehta
2023-07-25  6:24         ` bibo mao
2023-07-27 14:15           ` Salil Mehta

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=d13c4cb44a2b4b42a8b534c38c402a1d@huawei.com \
    --to=salil.mehta@huawei.com \
    --cc=andrew.jones@linux.dev \
    --cc=catalin.marinas@arm.com \
    --cc=christoffer.dall@arm.com \
    --cc=james.morse@arm.com \
    --cc=jean-philippe@linaro.org \
    --cc=jonathan.cameron@huawei.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=kvmarm@lists.linux.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-coco@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maobibo@loongson.cn \
    --cc=mark.rutland@arm.com \
    --cc=maz@kernel.org \
    --cc=oliver.upton@linux.dev \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=salil.mehta@opnsrc.net \
    --cc=steven.price@arm.com \
    --cc=suzuki.poulose@arm.com \
    --cc=will@kernel.org \
    --cc=yuzenghui@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;
as well as URLs for NNTP newsgroup(s).