Re: Multiple CPU support for uvmm on virt-arm64 qemu machine
Philipp Eppelt <[email protected]> Wed, 30 Oct 2024 18:20:35 +0100
| Newsgroups | gmane.comp.micro-kernel.l4.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi Mohamed,
Am 29.10.24 um 10:43 schrieb Mohamed Dawod:
> Hello,
> I'm trying to provide multiple CPUs for a linux VM on top of L4.
> I'm using the qemu virt machine and building for aarch64. so I used *-smp*
> option to provide more CPUs.
>
> $ qemu-system-aarch64 -M virt,virtualization=true -cpu cortex-a57 -smp 4 -m
> 1024 -kernel ....etc....
I'm not sure which gic version qemu uses. Please try setting it explicitly to
with gic-version=3 argument: `-M virt,virtualization=true,gic-version=3`
>
> Unfortunately, This didn't work. I tried to add more CPU device nodes to the dts
> file *virt-arm_virt-64.dts *but it also didn't work. >
> I think that it's because of the provided interrupt-controller with
> *virt-arm_virt-64.dts* in /l4/pkg/uvmm/conf/dts/ which mentioned that it
> supports only one CPU.
>
> icsoc {
> compatible = "simple-bus";
> #address-cells = <2>;
> #size-cells = <2>;
> ranges;
>
> /* Uvmm will adapt the compatible string depending on the present gic
> * version. It expects reg entries that provide enough space for the
> * Cpu/Dist interface for gicv2 (at least 0x1000, 0x1000) or the
> * Dist/Redist interface for gicv3 (0x10000, 0x20000 * number of cpus).
I'm not an expert for ARM64, but judging from the line above I'd say you have to
increase the size of the second reg entry. For example for four cores:
reg = <0 0x40000 0 0x10000>,
<0 0x50000 0 0x80000>;
You should be able to just use the github version of this file, it has a gic
node that is configured for 32 cores and comes with four CPU nodes.
https://github.com/kernkonzept/uvmm/blob/master/configs/dts/virt-arm_virt-64.dts
> * *The entries provided here support any gicv2 setup or a gicv3 setup
> * with one Cpu.*
> */
> gic: interrupt-controller {
> compatible = "arm,gic-400", "arm,cortex-a15-gic",
> "arm,cortex-a9-gic";
> #interrupt-cells = <3>;
> #address-cells = <0>;
> interrupt-controller;
> reg = <0 0x40000 0 0x10000>,
> <0 0x50000 0 0x20000>;
> };
> };
>
>
> My question now, is there any workaround to support multiple CPUs for virt
> machine on arm64 ?
Multiple CPUs should work. For SMP there are a couple of things to consider:
- QEMU: -smp parameter
- Kernel configuration for SMP and the number of maximum cores
- The DTS defines the maximum number of cores for the uvmm will set up. So
adding CPU device nodes is the correct path.
- The ned script defines the number of cores available at runtime to uvmm. No
cpu parameter in the start_vm({}) call means the VM gets access to all cpus.
- Linux must of course also support SMP, but that's very likely not the problem
here ;-)
I hope this sheds some light.
Cheers,
Philipp
--
[email protected] - Tel. 0351-41 883 221
http://www.kernkonzept.com
Kernkonzept GmbH. Sitz: Dresden. Amtsgericht Dresden, HRB 31129.
Geschäftsführer: Dr.-Ing. Michael Hohmuth
_______________________________________________
l4-hackers mailing list -- [email protected]
To unsubscribe send an email to [email protected]
OpenPGP_signature.asc
(application/pgp-signature, 840 B)
-----BEGIN PGP SIGNATURE----- wsF5BAABCAAjFiEEO7T7Jq7ah1WoVcqMg8udkTKw7CEFAmciauQFAwAAAAAACgkQg8udkTKw7CEV lg//aJx3bDt47MugTBg1zQZk3GU9KDT1J0Lx/q8l2Hz5HEZKunIXjB9XVpLjFgdC5I0JSYSBOzD+ nGfWyA+JdViPv1BrQHRC/ra80Ku9uetMOf7aap108yxDRKZlz3OLxnIBkrxlA67unaVajuurx9zs p+2/lvfsTupNrp1oB0I1JBnQHFILhI4VmDuaDNIFlB1d+7RpAd1+X04MAH03WLnhh+QJvn6n+a8S k89TQY1WpzPLJwJ6PTFdajBXZsAXoD09gthRoGSpxTMZXWu1HrFoWOcdu01rYDkIfUGk7Owreq6e noKRogkZRAcMTzl9XRojopOtGYvEPpUld+KhENrU0FadtRRa9k00lq4olB1hTZ6yqGW3jwVH12Dy JXYrv3QBQeRvKzn4huArfHOMPSZK7ZwpRocpdcg7FtlhcebjMI6X3PZMaYSpJQdrGnixweBOmve1 yGTyBh1HXjs3E7EKhQsvwLBP5lm2wSnvGGpAyOJ3y+m4vmmxa9e7ApH4X5sBYHuhZBmrjGrP2det L86iI3XXsPC4qkY/O+CDU+JFsEAcjNKT8fTxqpJp8PPnoQ6eG2Fqp98XWFhGvhw+kHNjdlhYv7za AxsyIN4lJJhcvmFRjgpA6e2YkKbyajDahMt4zMn4BeU8ZbWzNc6UaIMnWVo22PcrKk2dg90o56jt qKY= =gcql -----END PGP SIGNATURE-----