Message ID | 20200929224355.1224017-1-philmd@redhat.com |
---|---|
Headers | show |
Series | Support disabling TCG on ARM (part 2) | expand |
On Wed, 30 Sep 2020 00:43:43 +0200 Philippe Mathieu-Daudé <philmd@redhat.com> wrote: > Cover from Samuel Ortiz from (part 1) [1]: > > This patchset allows for building and running ARM targets with TCG > disabled. [...] > > The rationale behind this work comes from the NEMU project where we're > trying to only support x86 and ARM 64-bit architectures, without > including the TCG code base. We can only do so if we can build and run > ARM binaries with TCG disabled. I don't recall exact reason but TCG variant is used by bios-tables-test to test arm/virt so it will probably break that (it has something to do with how KVM uses CPU/GIC, which was making ACPI tables not stable (i.e. depend on host), so comparison with master tables was failing) > > v4 almost 2 years later... [2]: > - Rebased on Meson > - Addressed Richard review comments > - Addressed Claudio review comments > > v3 almost 18 months later [3]: > - Rebased > - Addressed Thomas review comments > - Added Travis-CI job to keep building --disable-tcg on ARM > > v2 [4]: > - Addressed review comments from Richard and Thomas from v1 [1] > > Regards, > > Phil. > > [1]: https://lists.gnu.org/archive/html/qemu-devel/2018-11/msg02451.html > [2]: https://www.mail-archive.com/qemu-devel@nongnu.org/msg689168.html > [3]: https://www.mail-archive.com/qemu-devel@nongnu.org/msg641796.html > [4]: https://lists.gnu.org/archive/html/qemu-devel/2019-08/msg05003.html > > Green CI: > - https://cirrus-ci.com/build/4572961761918976 > - https://gitlab.com/philmd/qemu/-/pipelines/196047779 > - https://travis-ci.org/github/philmd/qemu/builds/731370972 > > Based-on: <20200929125609.1088330-1-philmd@redhat.com> > "hw/arm: Restrict APEI tables generation to the 'virt' machine" > https://www.mail-archive.com/qemu-devel@nongnu.org/msg745792.html > > Philippe Mathieu-Daudé (10): > accel/tcg: Add stub for cpu_loop_exit() > meson: Allow optional target/${ARCH}/Kconfig > target/arm: Select SEMIHOSTING if TCG is available > target/arm: Restrict ARMv4 cpus to TCG accel > target/arm: Restrict ARMv5 cpus to TCG accel > target/arm: Restrict ARMv6 cpus to TCG accel > target/arm: Restrict ARMv7 R-profile cpus to TCG accel > target/arm: Restrict ARMv7 M-profile cpus to TCG accel > target/arm: Reorder meson.build rules > .travis.yml: Add a KVM-only Aarch64 job > > Samuel Ortiz (1): > target/arm: Do not build TCG objects when TCG is off > > Thomas Huth (1): > target/arm: Make m_helper.c optional via CONFIG_ARM_V7M > > default-configs/arm-softmmu.mak | 3 -- > meson.build | 8 +++- > target/arm/cpu.h | 12 ------ > accel/stubs/tcg-stub.c | 5 +++ > target/arm/cpu_tcg.c | 4 +- > target/arm/helper.c | 7 ---- > target/arm/m_helper-stub.c | 73 +++++++++++++++++++++++++++++++++ > .travis.yml | 35 ++++++++++++++++ > hw/arm/Kconfig | 32 +++++++++++++++ > target/arm/Kconfig | 4 ++ > target/arm/meson.build | 40 +++++++++++------- > 11 files changed, 184 insertions(+), 39 deletions(-) > create mode 100644 target/arm/m_helper-stub.c > create mode 100644 target/arm/Kconfig >
On 9/30/20 12:43 AM, Philippe Mathieu-Daudé wrote: > KVM requires a cpu based on (at least) the ARMv7 architecture. > > Only enable the following ARMv4 CPUs when TCG is available: > > - StrongARM (SA1100/1110) > - OMAP1510 (TI925T) > > Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> > --- > hw/arm/Kconfig | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig > index 7d040827af..b546b20654 100644 > --- a/hw/arm/Kconfig > +++ b/hw/arm/Kconfig > @@ -1,3 +1,7 @@ > +config ARM_V4 > + bool > + select TCG This should be 'depends on TCG' because we can not *select* TCG, either we enabled it or not. The problem is the machines are already selected in default-configs/arm-softmmu.mak, so we can not build the current config without TCG. > + > config ARM_VIRT > bool > imply PCI_DEVICES > @@ -30,6 +34,7 @@ config ARM_VIRT > > config CHEETAH > bool > + select ARM_V4 > select OMAP > select TSC210X > > @@ -244,6 +249,7 @@ config COLLIE > > config SX1 > bool > + select ARM_V4 > select OMAP > > config VERSATILE >
On 9/30/20 9:58 AM, Igor Mammedov wrote: > On Wed, 30 Sep 2020 00:43:43 +0200 > Philippe Mathieu-Daudé <philmd@redhat.com> wrote: > >> Cover from Samuel Ortiz from (part 1) [1]: >> >> This patchset allows for building and running ARM targets with TCG >> disabled. [...] >> >> The rationale behind this work comes from the NEMU project where we're >> trying to only support x86 and ARM 64-bit architectures, without >> including the TCG code base. We can only do so if we can build and run >> ARM binaries with TCG disabled. > > I don't recall exact reason but TCG variant is used by bios-tables-test > to test arm/virt so it will probably break that > (it has something to do with how KVM uses CPU/GIC, which was making > ACPI tables not stable (i.e. depend on host), so comparison with master > tables was failing) Not a problem, we can restrict bios-tables-test to TCG. I don't expect the KVM-only build being able to run many of our current tests, as most of them expect TCG. I'll have a look at restricting the TCG-dependent tests after this series get accepted. > >> >> v4 almost 2 years later... [2]: >> - Rebased on Meson >> - Addressed Richard review comments >> - Addressed Claudio review comments >> >> v3 almost 18 months later [3]: >> - Rebased >> - Addressed Thomas review comments >> - Added Travis-CI job to keep building --disable-tcg on ARM >> >> v2 [4]: >> - Addressed review comments from Richard and Thomas from v1 [1] >> >> Regards, >> >> Phil. >> >> [1]: https://lists.gnu.org/archive/html/qemu-devel/2018-11/msg02451.html >> [2]: https://www.mail-archive.com/qemu-devel@nongnu.org/msg689168.html >> [3]: https://www.mail-archive.com/qemu-devel@nongnu.org/msg641796.html >> [4]: https://lists.gnu.org/archive/html/qemu-devel/2019-08/msg05003.html >> >> Green CI: >> - https://cirrus-ci.com/build/4572961761918976 >> - https://gitlab.com/philmd/qemu/-/pipelines/196047779 >> - https://travis-ci.org/github/philmd/qemu/builds/731370972 >> >> Based-on: <20200929125609.1088330-1-philmd@redhat.com> >> "hw/arm: Restrict APEI tables generation to the 'virt' machine" >> https://www.mail-archive.com/qemu-devel@nongnu.org/msg745792.html >> >> Philippe Mathieu-Daudé (10): >> accel/tcg: Add stub for cpu_loop_exit() >> meson: Allow optional target/${ARCH}/Kconfig >> target/arm: Select SEMIHOSTING if TCG is available >> target/arm: Restrict ARMv4 cpus to TCG accel >> target/arm: Restrict ARMv5 cpus to TCG accel >> target/arm: Restrict ARMv6 cpus to TCG accel >> target/arm: Restrict ARMv7 R-profile cpus to TCG accel >> target/arm: Restrict ARMv7 M-profile cpus to TCG accel >> target/arm: Reorder meson.build rules >> .travis.yml: Add a KVM-only Aarch64 job >> >> Samuel Ortiz (1): >> target/arm: Do not build TCG objects when TCG is off >> >> Thomas Huth (1): >> target/arm: Make m_helper.c optional via CONFIG_ARM_V7M >> >> default-configs/arm-softmmu.mak | 3 -- >> meson.build | 8 +++- >> target/arm/cpu.h | 12 ------ >> accel/stubs/tcg-stub.c | 5 +++ >> target/arm/cpu_tcg.c | 4 +- >> target/arm/helper.c | 7 ---- >> target/arm/m_helper-stub.c | 73 +++++++++++++++++++++++++++++++++ >> .travis.yml | 35 ++++++++++++++++ >> hw/arm/Kconfig | 32 +++++++++++++++ >> target/arm/Kconfig | 4 ++ >> target/arm/meson.build | 40 +++++++++++------- >> 11 files changed, 184 insertions(+), 39 deletions(-) >> create mode 100644 target/arm/m_helper-stub.c >> create mode 100644 target/arm/Kconfig >> >
On 9/30/20 12:43 AM, Philippe Mathieu-Daudé wrote: > Extend the generic Meson script to pass optional target Kconfig > file to the minikconf script. > > Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> > --- > We could use fs.exists() but is_file() is more specific > (can not be a directory). > > Cc: Paolo Bonzini <pbonzini@redhat.com> > Cc: Claudio Fontana <cfontana@suse.de> > --- > meson.build | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/meson.build b/meson.build > index d36dd085b5..9ab5d514d7 100644 > --- a/meson.build > +++ b/meson.build > @@ -529,6 +529,7 @@ kconfig_external_symbols = [ > ] > ignored = ['TARGET_XML_FILES', 'TARGET_ABI_DIR', 'TARGET_DIRS'] > > +fs = import('fs') > foreach target : target_dirs > config_target = keyval.load(meson.current_build_dir() / target / 'config-target.mak') > > @@ -569,8 +570,13 @@ foreach target : target_dirs > endforeach > > config_devices_mak = target + '-config-devices.mak' > + target_kconfig = 'target' / config_target['TARGET_BASE_ARCH'] / 'Kconfig' > + minikconf_input = ['default-configs' / target + '.mak', 'Kconfig'] > + if fs.is_file(target_kconfig) > + minikconf_input += [target_kconfig] > + endif > config_devices_mak = configure_file( > - input: ['default-configs' / target + '.mak', 'Kconfig'], > + input: minikconf_input, > output: config_devices_mak, > depfile: config_devices_mak + '.d', > capture: true, > I can't say I understand it, but the general idea seems right to me. Ciao, Claudio
On 30/09/20 14:50, Claudio Fontana wrote: > On 9/30/20 12:43 AM, Philippe Mathieu-Daudé wrote: >> Extend the generic Meson script to pass optional target Kconfig >> file to the minikconf script. >> >> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> >> --- >> We could use fs.exists() but is_file() is more specific >> (can not be a directory). >> >> Cc: Paolo Bonzini <pbonzini@redhat.com> >> Cc: Claudio Fontana <cfontana@suse.de> >> --- >> meson.build | 8 +++++++- >> 1 file changed, 7 insertions(+), 1 deletion(-) >> >> diff --git a/meson.build b/meson.build >> index d36dd085b5..9ab5d514d7 100644 >> --- a/meson.build >> +++ b/meson.build >> @@ -529,6 +529,7 @@ kconfig_external_symbols = [ >> ] >> ignored = ['TARGET_XML_FILES', 'TARGET_ABI_DIR', 'TARGET_DIRS'] >> >> +fs = import('fs') >> foreach target : target_dirs >> config_target = keyval.load(meson.current_build_dir() / target / 'config-target.mak') >> >> @@ -569,8 +570,13 @@ foreach target : target_dirs >> endforeach >> >> config_devices_mak = target + '-config-devices.mak' >> + target_kconfig = 'target' / config_target['TARGET_BASE_ARCH'] / 'Kconfig' >> + minikconf_input = ['default-configs' / target + '.mak', 'Kconfig'] >> + if fs.is_file(target_kconfig) >> + minikconf_input += [target_kconfig] >> + endif >> config_devices_mak = configure_file( >> - input: ['default-configs' / target + '.mak', 'Kconfig'], >> + input: minikconf_input, >> output: config_devices_mak, >> depfile: config_devices_mak + '.d', >> capture: true, >> > > I can't say I understand it, but the general idea seems right to me. Acked-by: Paolo Bonzini <pbonzini@redhat.com>
On 9/29/20 5:43 PM, Philippe Mathieu-Daudé wrote: > Since the support of SYS_READC in commit 8de702cb67 the > semihosting code is strongly depedent of the TCG accelerator > via a call to cpu_loop_exit(). > > Ideally we would only build semihosting support when TCG > is available, but unfortunately this is not trivial because > semihosting is used by many targets in different configurations. > For now add a simple stub to avoid link failure when building > with --disable-tcg: > > hw/semihosting/console.c:160: undefined reference to `cpu_loop_exit' > > Cc: Keith Packard <keithp@keithp.com> > Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> > --- > accel/stubs/tcg-stub.c | 5 +++++ > 1 file changed, 5 insertions(+) Reviewed-by: Richard Henderson <richard.henderson@linaro.org> r~
On 03/10/20 11:13, Richard Henderson wrote: >> + target_kconfig = 'target' / config_target['TARGET_BASE_ARCH'] / 'Kconfig' >> + minikconf_input = ['default-configs' / target + '.mak', 'Kconfig'] >> + if fs.is_file(target_kconfig) > Missing a meson.current_source_dir()? > Leastwise that was a comment that Paolo had for me. Not sure, but it was the only way I thought the BSD build could fail; unless the capstone submodule really was not present in Peter's checkout and submodule update was disabled. Paolo
On 30/09/2020 10.03, Philippe Mathieu-Daudé wrote: > On 9/30/20 12:43 AM, Philippe Mathieu-Daudé wrote: >> KVM requires a cpu based on (at least) the ARMv7 architecture. >> >> Only enable the following ARMv4 CPUs when TCG is available: >> >> - StrongARM (SA1100/1110) >> - OMAP1510 (TI925T) >> >> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> >> --- >> hw/arm/Kconfig | 6 ++++++ >> 1 file changed, 6 insertions(+) >> >> diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig >> index 7d040827af..b546b20654 100644 >> --- a/hw/arm/Kconfig >> +++ b/hw/arm/Kconfig >> @@ -1,3 +1,7 @@ >> +config ARM_V4 >> + bool >> + select TCG > > This should be 'depends on TCG' because we can not > *select* TCG, either we enabled it or not. > > The problem is the machines are already selected in > default-configs/arm-softmmu.mak, so we can not build > the current config without TCG. Is it really a problem? If the users disabled TCG and still have these machines in their arm-softmmu.mak, it's a configuration issue on their side, so it's ok if they get an error in that case. Thomas
On 10/3/20 4:15 AM, Paolo Bonzini wrote: > On 03/10/20 11:13, Richard Henderson wrote: >>> + target_kconfig = 'target' / config_target['TARGET_BASE_ARCH'] / 'Kconfig' >>> + minikconf_input = ['default-configs' / target + '.mak', 'Kconfig'] >>> + if fs.is_file(target_kconfig) >> Missing a meson.current_source_dir()? >> Leastwise that was a comment that Paolo had for me. > > Not sure, but it was the only way I thought the BSD build could fail; > unless the capstone submodule really was not present in Peter's checkout > and submodule update was disabled. I don't think the build actually failed, I think it was just the cmake warning from the missing method: to which Peter objected. FWIW with and without source_dir work for me when testing, and I'm about to include it in the v3 pull for an abundance of caution. r~
Philippe Mathieu-Daudé <philmd@redhat.com> writes: > Cover from Samuel Ortiz from (part 1) [1]: > > This patchset allows for building and running ARM targets with TCG > disabled. [...] > > The rationale behind this work comes from the NEMU project where we're > trying to only support x86 and ARM 64-bit architectures, without > including the TCG code base. We can only do so if we can build and run > ARM binaries with TCG disabled. > > v4 almost 2 years later... [2]: > - Rebased on Meson > - Addressed Richard review comments > - Addressed Claudio review comments Have you re-based recently because I was having a look but ran into merge conflicts. I'd like to get the merged at some point because I ran into similar issues with the Xen only build without TCG. > > v3 almost 18 months later [3]: > - Rebased > - Addressed Thomas review comments > - Added Travis-CI job to keep building --disable-tcg on ARM > > v2 [4]: > - Addressed review comments from Richard and Thomas from v1 [1] > > Regards, > > Phil. > > [1]: https://lists.gnu.org/archive/html/qemu-devel/2018-11/msg02451.html > [2]: https://www.mail-archive.com/qemu-devel@nongnu.org/msg689168.html > [3]: https://www.mail-archive.com/qemu-devel@nongnu.org/msg641796.html > [4]: https://lists.gnu.org/archive/html/qemu-devel/2019-08/msg05003.html > > Green CI: > - https://cirrus-ci.com/build/4572961761918976 > - https://gitlab.com/philmd/qemu/-/pipelines/196047779 > - https://travis-ci.org/github/philmd/qemu/builds/731370972 > > Based-on: <20200929125609.1088330-1-philmd@redhat.com> > "hw/arm: Restrict APEI tables generation to the 'virt' machine" > https://www.mail-archive.com/qemu-devel@nongnu.org/msg745792.html > > Philippe Mathieu-Daudé (10): > accel/tcg: Add stub for cpu_loop_exit() > meson: Allow optional target/${ARCH}/Kconfig > target/arm: Select SEMIHOSTING if TCG is available > target/arm: Restrict ARMv4 cpus to TCG accel > target/arm: Restrict ARMv5 cpus to TCG accel > target/arm: Restrict ARMv6 cpus to TCG accel > target/arm: Restrict ARMv7 R-profile cpus to TCG accel > target/arm: Restrict ARMv7 M-profile cpus to TCG accel > target/arm: Reorder meson.build rules > .travis.yml: Add a KVM-only Aarch64 job > > Samuel Ortiz (1): > target/arm: Do not build TCG objects when TCG is off > > Thomas Huth (1): > target/arm: Make m_helper.c optional via CONFIG_ARM_V7M > > default-configs/arm-softmmu.mak | 3 -- > meson.build | 8 +++- > target/arm/cpu.h | 12 ------ > accel/stubs/tcg-stub.c | 5 +++ > target/arm/cpu_tcg.c | 4 +- > target/arm/helper.c | 7 ---- > target/arm/m_helper-stub.c | 73 +++++++++++++++++++++++++++++++++ > .travis.yml | 35 ++++++++++++++++ > hw/arm/Kconfig | 32 +++++++++++++++ > target/arm/Kconfig | 4 ++ > target/arm/meson.build | 40 +++++++++++------- > 11 files changed, 184 insertions(+), 39 deletions(-) > create mode 100644 target/arm/m_helper-stub.c > create mode 100644 target/arm/Kconfig -- Alex Bennée
Hi Alex, On 1/28/21 1:41 AM, Alex Bennée wrote: > Philippe Mathieu-Daudé <philmd@redhat.com> writes: > >> Cover from Samuel Ortiz from (part 1) [1]: >> >> This patchset allows for building and running ARM targets with TCG >> disabled. [...] >> >> The rationale behind this work comes from the NEMU project where we're >> trying to only support x86 and ARM 64-bit architectures, without >> including the TCG code base. We can only do so if we can build and run >> ARM binaries with TCG disabled. >> >> v4 almost 2 years later... [2]: >> - Rebased on Meson >> - Addressed Richard review comments >> - Addressed Claudio review comments > > Have you re-based recently because I was having a look but ran into > merge conflicts. I'd like to get the merged at some point because I ran > into similar issues with the Xen only build without TCG. I addressed most of this review comments locally. Since Claudio's accelerator series was getting more attention (and is bigger) I was waiting it gets merged first. He just respun v14: https://lists.gnu.org/archive/html/qemu-devel/2021-01/msg07171.html
Philippe Mathieu-Daudé <philmd@redhat.com> writes: > Hi Alex, > > On 1/28/21 1:41 AM, Alex Bennée wrote: >> Philippe Mathieu-Daudé <philmd@redhat.com> writes: >> >>> Cover from Samuel Ortiz from (part 1) [1]: >>> >>> This patchset allows for building and running ARM targets with TCG >>> disabled. [...] >>> >>> The rationale behind this work comes from the NEMU project where we're >>> trying to only support x86 and ARM 64-bit architectures, without >>> including the TCG code base. We can only do so if we can build and run >>> ARM binaries with TCG disabled. >>> >>> v4 almost 2 years later... [2]: >>> - Rebased on Meson >>> - Addressed Richard review comments >>> - Addressed Claudio review comments >> >> Have you re-based recently because I was having a look but ran into >> merge conflicts. I'd like to get the merged at some point because I ran >> into similar issues with the Xen only build without TCG. > > I addressed most of this review comments locally. Since Claudio's > accelerator series was getting more attention (and is bigger) I was > waiting it gets merged first. He just respun v14: > https://lists.gnu.org/archive/html/qemu-devel/2021-01/msg07171.html OK I'll have a look at Claudio's first ;-) -- Alex Bennée