[RFC PATCH 0/2] hw/arm/raspi: Restrict BCM2835 / BCM2836 SoC to TCG

Philippe Mathieu-Daudé posted 2 patches 3 years, 2 months ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20210131151410.318649-1-f4bug@amsat.org
Maintainers: Michael Tokarev <mjt@tls.msk.ru>, Laurent Vivier <laurent@vivier.eu>
hw/arm/bcm2836.c | 38 +++++++++++++++++++++++---------------
hw/arm/raspi.c   | 22 ++++++++++++++--------
2 files changed, 37 insertions(+), 23 deletions(-)
[RFC PATCH 0/2] hw/arm/raspi: Restrict BCM2835 / BCM2836 SoC to TCG
Posted by Philippe Mathieu-Daudé 3 years, 2 months ago
Peter mentioned [*] KVM only support ARMv8 targets. Restrict the
non-ARMv8 machines to TCG.

While this is still not enough to boot a raspi3 image using KVM:

  $ qemu-system-aarch64 -M raspi3b -enable-kvm ...
  qemu-system-aarch64: ../../softmmu/physmem.c:745: cpu_address_space_init: A=
ssertion `asidx =3D=3D 0 || !kvm_enabled()' failed.
  Aborted (core dumped)

This increases the odds to have a KVM-only build pass qtests.

[*]: https://www.mail-archive.com/qemu-devel@nongnu.org/msg777669.html

Philippe Mathieu-Daud=C3=A9 (2):
  hw/arm/raspi: Trivial code movement
  hw/arm/raspi: Restrict BCM2835 / BCM2836 SoC to TCG

 hw/arm/bcm2836.c | 38 +++++++++++++++++++++++---------------
 hw/arm/raspi.c   | 22 ++++++++++++++--------
 2 files changed, 37 insertions(+), 23 deletions(-)

--=20
2.26.2

Re: [RFC PATCH 0/2] hw/arm/raspi: Restrict BCM2835 / BCM2836 SoC to TCG
Posted by Peter Maydell 3 years, 2 months ago
On Sun, 31 Jan 2021 at 15:14, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>
> Peter mentioned [*] KVM only support ARMv8 targets. Restrict the
> non-ARMv8 machines to TCG.
>
> While this is still not enough to boot a raspi3 image using KVM:
>
>   $ qemu-system-aarch64 -M raspi3b -enable-kvm ...
>   qemu-system-aarch64: ../../softmmu/physmem.c:745: cpu_address_space_init: A=
> ssertion `asidx =3D=3D 0 || !kvm_enabled()' failed.
>   Aborted (core dumped)

Side note: this assertion isn't specific to the raspi3b -- it's
caused because we don't correctly screen out "tried to use KVM
on a CPU type with EL3 enabled", which should cause an error
but instead gets far enough through CPU init to hit this assertion.

thanks
-- PMM