Re: [RFC Patch 0/7] kernel: Introduce multikernel architecture support
Stefan Hajnoczi <[email protected]> Mon, 29 Sep 2025 11:11:49 -0400
| Newsgroups | dev.linux.lists.multikernel,org.infradead.lists.kexec,org.kernel.vger.linux-kernel,org.kvack.linux-mm |
|---|---|
| Message-ID | <20250929151149.GB81824@fedora> |
--yMiB+Rg43ijt+EVK Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Sep 27, 2025 at 12:42:23PM -0700, Cong Wang wrote: > On Wed, Sep 24, 2025 at 12:03=E2=80=AFPM Stefan Hajnoczi <stefanha@redhat= =2Ecom> wrote: > > > > Thanks, that gives a nice overview! > > > > I/O Resource Allocation part will be interesting. Restructuring existing > > device drivers to allow spawned kernels to use specific hardware queues > > could be a lot of work and very device-specific. I guess a small set of > > devices can be supported initially and then it can grow over time. >=20 > My idea is to leverage existing technologies like XDP, which > offers huge benefits here: >=20 > 1) It is based on shared memory (although it is virtual) >=20 > 2) Its API's are user-space API's, which is even stronger for > kernel-to-kernel sharing, this possibly avoids re-inventing > another protocol. >=20 > 3) It provides eBPF. >=20 > 4) The spawned kernel does not require any hardware knowledge, > just pure XDP-ringbuffer-based software logic. >=20 > But it also has limitations: >=20 > 1) xdp_md is too specific for networking, extending it to storage > could be very challenging. But we could introduce a SDP for > storage to just mimic XDP. >=20 > 2) Regardless, we need a doorbell anyway. IPI is handy, but > I hope we could have an even lighter one. Or more ideally, > redirecting the hardware queue IRQ into each target CPU. I see. I was thinking that spawned kernels would talk directly to the hardware. Your idea of using a software interface is less invasive but has an overhead similar to paravirtualized devices. A software approach that supports a wider range of devices is virtio_vdpa (drivers/vdpa/). The current virtio_vdpa implementation assumes that the device is located in the same kernel. A kernel-to-kernel bridge would be needed so that the spawned kernel forwards the vDPA operations to the other kernel. The other kernel provides the virtio-net, virtio-blk, etc device functionality by passing requests to a netdev, blkdev, etc. There are in-kernel simulator devices for virtio-net and virtio-blk in drivers/vdpa/vdpa_sim/ which can be used as a starting point. These devices are just for testing and would need to be fleshed out to become useful for real workloads. I have CCed Jason Wang, who maintains vDPA, in case you want to discuss it more. >=20 > > > > This also reminds me of VFIO/mdev devices, which would be another > > solution to the same problem, but equally device-specific and also a lot > > of work to implement the devices that spawned kernels see. >=20 > Right. >=20 > I prototyped VFIO on my side with AI, but failed with its complex PCI > interface. And the spawn kernel still requires hardware knowledge > to interpret PCI BAR etc.. Yeah, it's complex and invasive. :/ Stefan --yMiB+Rg43ijt+EVK Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEhpWov9P5fNqsNXdanKSrs4Grc8gFAmjaobUACgkQnKSrs4Gr c8ipuwf+KotYqejI+vt5pti8fHvl4phnkHcS2tYcg/IHT1cO0y5ha7uvltnia9/N uSJ88YcQ/Fo2pkLyiIZYVAH7jqJIWJ5GI61pAwiTDiXi+EDoao4EpqD3MC+GHBQ9 ZD444E59MYSKts6yCIHC6gpcXSU12Z9uPvQgQLRDQ3cStlAJC33HRmBFptZNt2rD 8/2/c35N16qbMo3a7O/Owe3/2fJkQFEHp+3znyf8U3obn0b8Cutec++rA4e4UAQR PuaVm3iBeSDJRjXZvJMXlDBrBYma0mOhsUkJBdcs/8D1ncAs1v+0kBK1UbA2JgQv vjv+rLhgtSOCuUALtpAqfw53quM2OQ== =y4ib -----END PGP SIGNATURE----- --yMiB+Rg43ijt+EVK--