Paolo Bonzini <pbonz...@redhat.com> writes:
> On 5/3/23 21:38, Fabiano Rosas wrote: >> When building --without-default-devices, the semihosting code will not >> be available, so check the proper config. > > Acked-by: Paolo Bonzini <pbonz...@redhat.com> > > for this change; however, there are two more related issues: > > 1) you still want to leave out the code if !TCG, because KVM is not able > to exit to userspace on semihosting calls as far as I understand Correct. > 2) I am not sure why CONFIG_ARM_COMPATIBLE_SEMIHOSTING=y appears in > config/targets/{arm,riscv32,riscv64}-softmmu/default.mak. I think we need to be clearer in the development guide when things are triggered by config/devices/ and when they are triggered by default rules in Kconfig. After Fabino's series the delta between config/aarch64-softmmu/minimal.mk and config/aarch64-softmmu/default.mk is pretty small. I guess minimal.mk should be renamed to virt.mk, sbsa-ref dropped from it (as you can't run it under KVM) and what controls which devices the virt platform can use? Should it be: CONFIG_PCI_DEVICES=y CONFIG_VIRTIO_PCI=y to ensure we can plug and play all the various VirtIO bits we need for the KVM/Xen use case? > > Putting things together you also need something like > > diff --git a/semihosting/Kconfig b/semihosting/Kconfig > index eaf3a20ef5b2..671020a33426 100644 > --- a/semihosting/Kconfig > +++ b/semihosting/Kconfig > @@ -4,4 +4,5 @@ config SEMIHOSTING > config ARM_COMPATIBLE_SEMIHOSTING > bool > + default y if (ARM && TCG) || RISCV32 || RISCV64 > select SEMIHOSTING > diff --git a/configs/devices/arm-softmmu/default.mak > b/configs/devices/arm-softmmu/default.mak > index 1b49a7830c7e..5e7a17d05bf8 100644 > --- a/configs/devices/arm-softmmu/default.mak > +++ b/configs/devices/arm-softmmu/default.mak > @@ -41,5 +41,4 @@ CONFIG_FSL_IMX25=y > CONFIG_FSL_IMX7=y > CONFIG_FSL_IMX6UL=y > CONFIG_SEMIHOSTING=y > -CONFIG_ARM_COMPATIBLE_SEMIHOSTING=y > CONFIG_ALLWINNER_H3=y > diff --git a/configs/devices/riscv32-softmmu/default.mak > b/configs/devices/riscv32-softmmu/default.mak > index d847bd5692ec..94a236c9c25b 100644 > --- a/configs/devices/riscv32-softmmu/default.mak > +++ b/configs/devices/riscv32-softmmu/default.mak > @@ -3,8 +3,6 @@ > # Uncomment the following lines to disable these optional devices: > # > #CONFIG_PCI_DEVICES=n > -CONFIG_SEMIHOSTING=y > -CONFIG_ARM_COMPATIBLE_SEMIHOSTING=y > # Boards: > # > diff --git a/configs/devices/riscv64-softmmu/default.mak > b/configs/devices/riscv64-softmmu/default.mak > index bc69301fa4a6..3f6805944849 100644 > --- a/configs/devices/riscv64-softmmu/default.mak > +++ b/configs/devices/riscv64-softmmu/default.mak > @@ -3,8 +3,6 @@ > # Uncomment the following lines to disable these optional devices: > # > #CONFIG_PCI_DEVICES=n > -CONFIG_SEMIHOSTING=y > -CONFIG_ARM_COMPATIBLE_SEMIHOSTING=y > # Boards: > # > > Paolo > >> Fixes: 29d9efca16 ("arm/Kconfig: Do not build TCG-only boards on a KVM-only >> build") >> Signed-off-by: Fabiano Rosas<faro...@suse.de> >> --- >> target/arm/helper.c | 4 ++-- >> target/arm/tcg/m_helper.c | 2 +- >> 2 files changed, 3 insertions(+), 3 deletions(-) -- Alex Bennée Virtualisation Tech Lead @ Linaro