Skip to contentSkip to conversation

removal of tci (tcg interpreter)

RFC PATCH Superseded Philippe Mathieu-Daudé 12 participants 38 messages Jun 29, 2017 – Aug 3, 2017 Kbuild

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover removal of tci (tcg interpreter)

There have been some comments on the ML about the usefulness of tci.

https://lists.nongnu.org/archive/html/qemu-devel/2017-06/msg04551.html

Peter Maydell> I'd prefer we just got rid of it.

https://lists.nongnu.org/archive/html/qemu-devel/2017-06/msg04296.html

Richard Henderson> Is it time to remove it? I'm pretty sure the only hosts
for which it will work have proper backends...

Richard quotes are way clearer than me trying to paraphrase what he told me:
- it doesn't use libffi, and as such the way it makes calls to helpers doesn't work for many hosts.
- we already cover almost everthing that debian does. if debian or gentoo doesn't support it, one can confidently say there's little interest.
- if someone *does* want to run qemu on something else, it isn't difficult to port tcg.

I figured out MAINTAINERS was unsync, so added patches 1-4, they are not really tci-related.

Patches 5,6 are trivial fixes to let the codebase quite sane if there is future need to revert/reimport tci.

Patches 7,8 are the removal, marked RFC... let's debate!

Regards,

Phil.

PS: How to have fun with TCI and MTTCG:

$ wget -q https://github.com/raspberrypi/firmware/raw/master/boot/kernel7.img
$ ./configure --enable-tcg-interpreter && make subdir-arm-softmmu
$ arm-softmmu/qemu-system-arm -machine raspi2 -cpu cortex-a7 -smp 4 -accel tcg,thread=multi -kernel kernel7.img
qemu-system-arm: Guest expects a stronger memory ordering than the host provides
This may cause strange/hard to debug errors
Segmentation fault (core dumped)

-

$ arm-softmmu/qemu-system-arm -machine raspi2 -cpu cortex-a7 -smp 4 -accel tcg,thread=multi -kernel kernel7.img
qemu-system-arm: Guest expects a stronger memory ordering than the host provides
This may cause strange/hard to debug errors
qemu-system-arm: Trying to execute code outside RAM or ROM at 0xef661ad0
This usually means one of the following happened:

(1) You told QEMU to execute a kernel for the wrong machine type, and it crashed on startup (eg trying to run a raspberry pi kernel on a versatilepb QEMU machine)
(2) You didn't give QEMU a kernel or BIOS filename at all, and QEMU executed a ROM full of no-op instructions until it fell off the end
(3) Your guest kernel has a bug and crashed by jumping off into nowhere

This is almost always one of the first two, so check your command line and that you are using the right type of kernel for this machine.
If you think option (3) is likely then you can try debugging your guest with the -d debug options; in particular -d guest_errors will cause the log to include a dump of the guest register state at this point.

Execution cannot continue; stopping here.

Segmentation fault (core dumped)

-

$ arm-softmmu/qemu-system-arm -machine raspi2 -cpu cortex-a7 -smp 4 -accel tcg,thread=multi -kernel kernel7.img
qemu-system-arm: Guest expects a stronger memory ordering than the host provides
This may cause strange/hard to debug errors
qemu-system-arm: Trying to execute code outside RAM or ROM at 0xe28fe004
This usually means one of the following happened:

(1) You told QEMU to execute a kernel for the wrong machine type, and it crashed on startup (eg trying to run a raspberry pi kernel on a versatilepb QEMU machine)
(2) You didn't give QEMU a kernel or BIOS filename at all, and QEMU executed a ROM full of no-op instructions until it fell off the end
(3) Your guest kernel has a bug and crashed by jumping off into nowhere

This is almost always one of the first two, so check your command line and that you are using the right type of kernel for this machine.
If you think option (3) is likely then you can try debugging your guest with the -d debug options; in particular -d guest_errors will cause the log to include a dump of the guest register state at this point.

Execution cannot continue; stopping here.

qemu-system-arm: qemu/accel/tcg/cpu-exec.c:599: cpu_loop_exec_tb: Assertion `use_icount' failed. Aborted (core dumped)

-

$ arm-softmmu/qemu-system-arm -machine raspi2 -cpu cortex-a7 -smp 4 -accel tcg,thread=multi -kernel kernel7.img
qemu-system-arm: Guest expects a stronger memory ordering than the host provides
This may cause strange/hard to debug errors
qemu/tcg/tcg.c:480: temp_idx: Assertion `n >= 0 && n < s->nb_temps' failed.
Aborted (core dumped)

-

$ arm-softmmu/qemu-system-arm -machine raspi2 -cpu cortex-a7 -smp 4 -accel tcg,thread=multi -kernel kernel7.img
qemu-system-arm: Guest expects a stronger memory ordering than the host provides
This may cause strange/hard to debug errors
write access to unsupported AArch32 system register cp:15 opc1:4 crn:12 crm:0 opc2:0 (non-secure)
Segmentation fault (core dumped)

-

$ arm-softmmu/qemu-system-arm -machine raspi2 -cpu cortex-a7 -smp 4 -accel tcg,thread=multi -kernel kernel7.img
qemu-system-arm: Guest expects a stronger memory ordering than the host provides
This may cause strange/hard to debug errors
qemu-system-arm: Trying to execute code outside RAM or ROM at 0xe59f5014
This usually means one of the following happened:

(1) You told QEMU to execute a kernel for the wrong machine type, and it crashed on startup (eg trying to run a raspberry pi kernel on a versatilepb QEMU machine)
(2) You didn't give QEMU a kernel or BIOS filename at all, and QEMU executed a ROM full of no-op instructions until it fell off the end
(3) Your guest kernel has a bug and crashed by jumping off into nowhere

This is almost always one of the first two, so check your command line and that you are using the right type of kernel for this machine.
If you think option (3) is likely then you can try debugging your guest with the -d debug options; in particular -d guest_errors will cause the log to include a dump of the guest register state at this point.

Execution cannot continue; stopping here.

qemu: fatal: Trying to execute code outside RAM or ROM at 0xe59f5014 R00=00000031 R01=00000308 R02=00000000 R03=e59f5014 R04=00000000 R05=00000000 R06=00000000 R07=00000000 R08=00000000 R09=00000000 R10=00000000 R11=00000000 R12=00000000 R13=00000000 R14=00000308 R15=e59f5014 PSR=a00001d3 N-C- A NS svc32
s00=00000000 s01=00000000 d00=0000000000000000 s02=00000000 s03=00000000 d01=0000000000000000 s04=00000000 s05=00000000 d02=0000000000000000 s06=00000000 s07=00000000 d03=0000000000000000 s08=00000000 s09=00000000 d04=0000000000000000 s10=00000000 s11=00000000 d05=0000000000000000 s12=00000000 s13=00000000 d06=0000000000000000 s14=00000000 s15=00000000 d07=0000000000000000 s16=00000000 s17=00000000 d08=0000000000000000 s18=00000000 s19=00000000 d09=0000000000000000 s20=00000000 s21=00000000 d10=0000000000000000 s22=00000000 s23=00000000 d11=0000000000000000 s24=00000000 s25=00000000 d12=0000000000000000 s26=00000000 s27=00000000 d13=0000000000000000 s28=00000000 s29=00000000 d14=0000000000000000 s30=00000000 s31=00000000 d15=0000000000000000 s32=00000000 s33=00000000 d16=0000000000000000 s34=00000000 s35=00000000 d17=0000000000000000 s36=00000000 s37=00000000 d18=0000000000000000 s38=00000000 s39=00000000 d19=0000000000000000 s40=00000000 s41=00000000 d20=0000000000000000 s42=00000000 s43=00000000 d21=0000000000000000 s44=00000000 s45=00000000 d22=0000000000000000 s46=00000000 s47=00000000 d23=0000000000000000 s48=00000000 s49=00000000 d24=0000000000000000 s50=00000000 s51=00000000 d25=0000000000000000 s52=00000000 s53=00000000 d26=0000000000000000 s54=00000000 s55=00000000 d27=0000000000000000 s56=00000000 s57=00000000 d28=0000000000000000 s58=00000000 s59=00000000 d29=0000000000000000 s60=00000000 s61=00000000 d30=0000000000000000 s62=00000000 s63=00000000 d31=0000000000000000
FPSCR: 00000000

-

$ arm-softmmu/qemu-system-arm -machine raspi2 -cpu cortex-a7 -smp 4 -accel tcg,thread=multi -kernel kernel7.img
qemu-system-arm: Guest expects a stronger memory ordering than the host provides
This may cause strange/hard to debug errors
read access to unsupported AArch32 64 bit system register cp:13 opc1: 13 crm:0 (non-secure)
qemu: fatal: Unhandled exception 0x0

R00=00000002 R01=00000308 R02=00000000 R03=08000000 R04=00000000 R05=00000000 R06=00000000 R07=00000000 R08=00000000 R09=00000000 R10=00000000 R11=00000000 R12=00000000 R13=00000000 R14=00000308 R15=08000000 PSR=200001d3 --C- A NS svc32
s00=00000000 s01=00000000 d00=0000000000000000 s02=00000000 s03=00000000 d01=0000000000000000 s04=00000000 s05=00000000 d02=0000000000000000 s06=00000000 s07=00000000 d03=0000000000000000 s08=00000000 s09=00000000 d04=0000000000000000 s10=00000000 s11=00000000 d05=0000000000000000 s12=00000000 s13=00000000 d06=0000000000000000 s14=00000000 s15=00000000 d07=0000000000000000 s16=00000000 s17=00000000 d08=0000000000000000 s18=00000000 s19=00000000 d09=0000000000000000 s20=00000000 s21=00000000 d10=0000000000000000 s22=00000000 s23=00000000 d11=0000000000000000 s24=00000000 s25=00000000 d12=0000000000000000 s26=00000000 s27=00000000 d13=0000000000000000 s28=00000000 s29=00000000 d14=0000000000000000 s30=00000000 s31=00000000 d15=0000000000000000 s32=00000000 s33=00000000 d16=0000000000000000 s34=00000000 s35=00000000 d17=0000000000000000 s36=00000000 s37=00000000 d18=0000000000000000 s38=00000000 s39=00000000 d19=0000000000000000 s40=00000000 s41=00000000 d20=0000000000000000 s42=00000000 s43=00000000 d21=0000000000000000 s44=00000000 s45=00000000 d22=0000000000000000 s46=00000000 s47=00000000 d23=0000000000000000 s48=00000000 s49=00000000 d24=0000000000000000 s50=00000000 s51=00000000 d25=0000000000000000 s52=00000000 s53=00000000 d26=0000000000000000 s54=00000000 s55=00000000 d27=0000000000000000 s56=00000000 s57=00000000 d28=0000000000000000 s58=00000000 s59=00000000 d29=0000000000000000 s60=00000000 s61=00000000 d30=0000000000000000 s62=00000000 s63=00000000 d31=0000000000000000
FPSCR: 00000000

:)

Philippe Mathieu-Daudé (8):
MAINTAINERS: update tcg entries
MAINTAINERS: update kvm entries
MAINTAINERS: update xen entries
MAINTAINERS: update tci entry
tcg/tci: enable bswap16_i64
tcg/tci: disable MTTCG if TCI is enabled
tcg/tci: time to remove it :(
travis: remove tcg/tci job

 .travis.yml              |    3 -
 MAINTAINERS              |   16 +-
 Makefile.target          |    2 -
 configure                |   31 +-
 disas.c                  |    5 +-
 disas/Makefile.objs      |    4 -
 disas/tci.c              |   61 ---
 include/disas/bfd.h      |    1 -
 include/exec/exec-all.h  |   16 +-
 tcg/tcg-common.c         |    4 -
 tcg/tcg.c                |    6 +-
 tcg/tci.c                | 1251 ----------------------------------------------
 tcg/tci/README           |  130 -----
 tcg/tci/tcg-target.h     |  195 --------
 tcg/tci/tcg-target.inc.c |  897 ---------------------------------
 15 files changed, 14 insertions(+), 2608 deletions(-)
 delete mode 100644 disas/tci.c
 delete mode 100644 tcg/tci.c
 delete mode 100644 tcg/tci/README
 delete mode 100644 tcg/tci/tcg-target.h
 delete mode 100644 tcg/tci/tcg-target.inc.c
Signature · 1 line
2.13.1
#1 lore raw

PATCH 1/8 MAINTAINERS: update TCG entries

moved in a9ded601..244f1441 to accel/

---
 MAINTAINERS | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
MAINTAINERS +1 -5
index 839f7ca063..06006fc7df 100644
@@ -84,14 +84,10 @@ M: Paolo Bonzini <[email protected]>
 M: Peter Crosthwaite <[email protected]>
 M: Richard Henderson <[email protected]>
 S: Maintained
-F: cpu-exec.c
-F: cpu-exec-common.c
 F: cpus.c
-F: cputlb.c
 F: exec.c
 F: softmmu_template.h
-F: translate-all.*
-F: translate-common.c
+F: accel/tcg/
 F: include/exec/cpu*.h
 F: include/exec/exec-all.h
 F: include/exec/helper*.h
Signature · 1 line
2.13.1
#2 lore raw

PATCH 2/8 MAINTAINERS: update KVM entries

In reply to Philippe Mathieu-Daudé

moved in 92229a57 to accel/

---
 MAINTAINERS | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
MAINTAINERS +1 -1
index 06006fc7df..86a08c5aac 100644
@@ -273,8 +273,8 @@ Overall
 M: Paolo Bonzini <[email protected]>
 L: [email protected]
 S: Supported
-F: kvm-*
 F: */kvm.*
+F: accel/kvm/
 F: include/sysemu/kvm*.h
 
 ARM
Signature · 1 line
2.13.1
#3 lore raw

PATCH 3/8 MAINTAINERS: update Xen entry

In reply to Philippe Mathieu-Daudé

moved in 56e2cd24..28b99f47 to accel/

---
 MAINTAINERS | 1 -
 1 file changed, 1 deletion(-)
MAINTAINERS +0 -1
index 86a08c5aac..530293044b 100644
@@ -323,7 +323,6 @@ M: Stefano Stabellini <[email protected]>
 M: Anthony Perard <[email protected]>
 L: [email protected]
 S: Supported
-F: xen-*
 F: */xen*
 F: hw/9pfs/xen-9p-backend.c
 F: hw/char/xen_console.c
Signature · 1 line
2.13.1
Acked-by on v1 3/8
#4 lore raw

Re: [Qemu-devel] [PATCH 3/8] MAINTAINERS: update Xen entry

Quoted 1 line · Philippe Mathieu-Daudé

moved in 56e2cd24..28b99f47 to accel/

That is not accurate, files have been moved to hw/i386/xen/ as written in both commits messages.

Beside that:

Quoted 20 lines
---
 MAINTAINERS | 1 -
 1 file changed, 1 deletion(-)
MAINTAINERS +0 -1
index 86a08c5aac..530293044b 100644
@@ -323,7 +323,6 @@ M: Stefano Stabellini <[email protected]>
 M: Anthony Perard <[email protected]>
 L: [email protected]
 S: Supported
-F: xen-*
 F: */xen*
 F: hw/9pfs/xen-9p-backend.c
 F: hw/char/xen_console.c
Signature · 1 line
2.13.1
Signature · 1 line
Anthony PERARD
#5 lore raw

Re: [Qemu-devel] [PATCH 3/8] MAINTAINERS: update Xen entry

Quoted 5 lines · Anthony PERARD
Quoted 1 line · Philippe Mathieu-Daudé

moved in 56e2cd24..28b99f47 to accel/

That is not accurate, files have been moved to hw/i386/xen/ as written in both commits messages.

Oops hopefully you noticed! I copied the commits ranges from patch 1 and forgot to update the paths which are actually hw/xen and hw/i386/xen.

Quoted 2 lines

Beside that:

Thank you.

#6 lore raw

Re: [Qemu-devel] [PATCH 3/8] MAINTAINERS: update Xen entry

In reply to Philippe Mathieu-Daudé
Quoted 1 line · Philippe Mathieu-Daudé

moved in 56e2cd24..28b99f47 to accel/

Actually to hw/.

I can certainly queue patches 1-4 immediately, thanks.

Paolo

Quoted 18 lines
---
 MAINTAINERS | 1 -
 1 file changed, 1 deletion(-)
MAINTAINERS +0 -1
index 86a08c5aac..530293044b 100644
@@ -323,7 +323,6 @@ M: Stefano Stabellini <[email protected]>
 M: Anthony Perard <[email protected]>
 L: [email protected]
 S: Supported
-F: xen-*
 F: */xen*
 F: hw/9pfs/xen-9p-backend.c
 F: hw/char/xen_console.c
#7 lore raw

PATCH 4/8 MAINTAINERS: update TCI entry

In reply to Philippe Mathieu-Daudé

moved in 244f1441 to tcg/

---
 MAINTAINERS | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
MAINTAINERS +1 -1
index 530293044b..9bad523060 100644
@@ -1654,7 +1654,7 @@ TCI target
 M: Stefan Weil <[email protected]>
 S: Maintained
 F: tcg/tci/
-F: tci.c
+F: tcg/tci.c
 F: disas/tci.c
 
 Block drivers
Signature · 1 line
2.13.1
#8 lore raw

PATCH RESEND 5/8 tcg/tci: enable bswap16_i64

In reply to Philippe Mathieu-Daudé

remove some copy/paste leftover, code seems sane.

while running Alex Bennée's image aarch64-linux-3.15rc2-buildroot.img:

Trace 0x7fa1904b0890 [0: ffffffc00036cd04]
----------------
IN:
0xffffffc00036cd24: 5ac00694 rev16 w20, w20

OP:
---- ffffffc00036cd24 0000000000000000 0000000000000000 ext32u_i64 tmp3,x20
ext16u_i64 tmp2,tmp3
bswap16_i64 x20,tmp2
movi_i64 tmp4,$0x10
shr_i64 tmp2,tmp3,tmp4
ext16u_i64 tmp2,tmp2
bswap16_i64 tmp2,tmp2
deposit_i64 x20,x20,tmp2,$0x10,$0x10

Linking TBs 0x7fa1904b0890 [ffffffc00036cd04] index 0 -> 0x7fa1904b0aa0 [ffffffc00036cd24] Trace 0x7fa1904b0aa0 [0: ffffffc00036cd24]
TODO qemu/tci.c:1049: tcg_qemu_tb_exec()
qemu/tci.c:1049: tcg fatal error
Aborted

---
 tcg/tci.c | 1 -
 1 file changed, 1 deletion(-)
tcg/tci.c +0 -1
index 4bdc645f2a..f39bfb95c0 100644
@@ -1046,7 +1046,6 @@ uintptr_t tcg_qemu_tb_exec(CPUArchState *env, uint8_t *tb_ptr)
             break;
 #if TCG_TARGET_HAS_bswap16_i64
         case INDEX_op_bswap16_i64:
-            TODO();
             t0 = *tb_ptr++;
             t1 = tci_read_r16(&tb_ptr);
             tci_write_reg64(t0, bswap16(t1));
Signature · 1 line
2.13.1
Reviewed-by on v1 5/8
#9 lore raw

Re: [Qemu-devel] [PATCH RESEND 5/8] tcg/tci: enable bswap16_i64

Quoted 7 lines · Philippe Mathieu-Daudé

remove some copy/paste leftover, code seems sane.

Double-sob seems odd.

Quoted 4 lines
---
 tcg/tci.c | 1 -
 1 file changed, 1 deletion(-)

Otherwise,

Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org
#10 lore raw

Re: [Qemu-devel] [PATCH RESEND 5/8] tcg/tci: enable bswap16_i64

Quoted 7 lines · Eric Blake
Quoted 3 lines · Philippe Mathieu-Daudé

Double-sob seems odd.

eh you never know... I need to improve my mailing skills :|

Quoted 7 lines
Quoted 4 lines
---
  tcg/tci.c | 1 -
  1 file changed, 1 deletion(-)

Otherwise,

Thanks.

Reviewed-by
#11 lore raw

Re: [Qemu-devel] [PATCH RESEND 5/8] tcg/tci: enable bswap16_i64

In reply to Eric Blake

Am 29.06.2017 um 18:29 schrieb Eric Blake:

Quoted 10 lines · Philippe Mathieu-Daudé
Quoted 7 lines

remove some copy/paste leftover, code seems sane.

Double-sob seems odd.

Maybe that double SOB can be cleaned by qemu-trivial (cc'ed).

Quoted 9 lines
Quoted 5 lines
---
 tcg/tci.c | 1 -
 1 file changed, 1 deletion(-)

Otherwise,

Note from the author: it's not a copy/paste leftover, but was there on purpose: that code part was simply never executed before, and I only removed the TODO() statements from tested code.

So you are the first one who found a test case. Congratulations.

#12 lore raw

Re: [Qemu-devel] [PATCH RESEND 5/8] tcg/tci: enable bswap16_i64

Quoted 20 lines · Stefan Weil

Am 29.06.2017 um 18:29 schrieb Eric Blake:

Quoted 10 lines · Philippe Mathieu-Daudé
Quoted 7 lines

remove some copy/paste leftover, code seems sane.

Double-sob seems odd.

Maybe that double SOB can be cleaned by qemu-trivial (cc'ed).

Quoted 6 lines
Quoted 5 lines
---
  tcg/tci.c | 1 -
  1 file changed, 1 deletion(-)
Quoted 8 lines
Quoted 3 lines

Otherwise,

Note from the author: it's not a copy/paste leftover, but was there on purpose: that code part was simply never executed before, and I only removed the TODO() statements from tested code.

I'll reword the commit message in my tci-fixes-for-2.10-v2 series.

Quoted 1 line

So you are the first one who found a test case. Congratulations.

Oh nice :)

Quoted 1 line

Thank.

#13 lore raw

PATCH 6/8 tcg/tci: disable MTTCG if TCI is enabled

In reply to Philippe Mathieu-Daudé

TCI + MTTCG cause strange errors...

  $ arm-softmmu/qemu-system-arm -machine raspi2 -cpu cortex-a7 -smp 4 -accel tcg,thread=multi -kernel kernel7.img
  qemu-system-arm: Guest expects a stronger memory ordering than the host provides
  This may cause strange/hard to debug errors
  Segmentation fault (core dumped)
---
 configure | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
configure +5 -1
index c571ad14e5..510f443e06 100755
@@ -6225,7 +6225,11 @@ fi
 if test "$target_softmmu" = "yes" ; then
   echo "CONFIG_SOFTMMU=y" >> $config_target_mak
   if test "$mttcg" = "yes" ; then
-    echo "TARGET_SUPPORTS_MTTCG=y" >> $config_target_mak
+    if test "$tcg_interpreter" = "yes" ; then
+        echo "TCI enabled, disabling MTTCG"
+    else
+        echo "TARGET_SUPPORTS_MTTCG=y" >> $config_target_mak
+    fi
   fi
 fi
 if test "$target_user_only" = "yes" ; then
Signature · 1 line
2.13.1
#14 lore raw

Re: [Qemu-devel] [PATCH 6/8] tcg/tci: disable MTTCG if TCI is enabled

Hi Peter,

I think this patch belongs to 2.10, as there is no time to fix TCI + MTTCG. Should I RESEND it alone with "for 2.10" subject?

One other option might be disable TCI if MTTCG enabled, but there is no ./configure option for MTTCG while there is for TCI.

Regards,

Phil.

Quoted 30 lines · Philippe Mathieu-Daudé

TCI + MTTCG cause strange errors...

   $ arm-softmmu/qemu-system-arm -machine raspi2 -cpu cortex-a7 -smp 4 -accel tcg,thread=multi -kernel kernel7.img
   qemu-system-arm: Guest expects a stronger memory ordering than the host provides
   This may cause strange/hard to debug errors
   Segmentation fault (core dumped)
---
  configure | 6 +++++-
  1 file changed, 5 insertions(+), 1 deletion(-)
configure +5 -1
index c571ad14e5..510f443e06 100755
@@ -6225,7 +6225,11 @@ fi
  if test "$target_softmmu" = "yes" ; then
    echo "CONFIG_SOFTMMU=y" >> $config_target_mak
    if test "$mttcg" = "yes" ; then
-    echo "TARGET_SUPPORTS_MTTCG=y" >> $config_target_mak
+    if test "$tcg_interpreter" = "yes" ; then
+        echo "TCI enabled, disabling MTTCG"
+    else
+        echo "TARGET_SUPPORTS_MTTCG=y" >> $config_target_mak
+    fi
    fi
  fi
  if test "$target_user_only" = "yes" ; then
#15 lore raw

Re: [Qemu-devel] [PATCH 6/8] tcg/tci: disable MTTCG if TCI is enabled

Quoted 5 lines · Philippe Mathieu-Daudé

Hi Peter,

I think this patch belongs to 2.10, as there is no time to fix TCI + MTTCG. Should I RESEND it alone with "for 2.10" subject?

Quoted 14 lines

One other option might be disable TCI if MTTCG enabled, but there is no ./configure option for MTTCG while there is for TCI.

Regards,

Phil.

Quoted 6 lines · Philippe Mathieu-Daudé

TCI + MTTCG cause strange errors...

   $ arm-softmmu/qemu-system-arm -machine raspi2 -cpu cortex-a7 -smp 4 -accel tcg,thread=multi -kernel kernel7.img
   qemu-system-arm: Guest expects a stronger memory ordering than the host provides
   This may cause strange/hard to debug errors
   Segmentation fault (core dumped)

So this isn't TCI enabling MTTCG by accident - this is the user forcing it when it wouldn't otherwise be enabled. Hence the scary warning...

Quoted 16 lines
Quoted 16 lines
---
  configure | 6 +++++-
  1 file changed, 5 insertions(+), 1 deletion(-)
configure +1 -1
index c571ad14e5..510f443e06 100755
@@ -6225,7 +6225,11 @@ fi
  if test "$target_softmmu" = "yes" ; then
    echo "CONFIG_SOFTMMU=y" >> $config_target_mak
    if test "$mttcg" = "yes" ; then
-    echo "TARGET_SUPPORTS_MTTCG=y" >> $config_target_mak
+    if test "$tcg_interpreter" = "yes" ; then
Quoted 8 lines

configure fi · line 6235

Quoted 8 lines
configure +4 -0
+        echo "TCI enabled, disabling MTTCG"
+    else
+        echo "TARGET_SUPPORTS_MTTCG=y" >> $config_target_mak
+    fi
    fi
  fi
  if test "$target_user_only" = "yes" ; then

--
Alex Bennée

#16 lore raw

Re: [Qemu-devel] [PATCH 6/8] tcg/tci: disable MTTCG if TCI is enabled

Quoted 18 lines · Alex Bennée
Quoted 15 lines · Philippe Mathieu-Daudé

Hi Peter,

I think this patch belongs to 2.10, as there is no time to fix TCI + MTTCG. Should I RESEND it alone with "for 2.10" subject?

One other option might be disable TCI if MTTCG enabled, but there is no ./configure option for MTTCG while there is for TCI.

Regards,

Phil.

Quoted 2 lines · Philippe Mathieu-Daudé

TCI + MTTCG cause strange errors...

Quoted 7 lines
Quoted 4 lines
Quoted 4 lines
    $ arm-softmmu/qemu-system-arm -machine raspi2 -cpu cortex-a7 -smp 4 -accel tcg,thread=multi -kernel kernel7.img
    qemu-system-arm: Guest expects a stronger memory ordering than the host provides
    This may cause strange/hard to debug errors
    Segmentation fault (core dumped)

So this isn't TCI enabling MTTCG by accident - this is the user forcing it when it wouldn't otherwise be enabled. Hence the scary warning...

Hmmm this is the user enabling TCI, I'm not sure about "forcing it". Now MTTCG is enforced by the ./configure and there is no option to disable it.

I posted this patch after realizing there are more TCI users/testers than just Stefan Weil, Jaroslaw Pelczar and me. Peter commented about http://qira.me/ which doesn't look very active. (see this thread: http://lists.nongnu.org/archive/html/qemu-devel/2017-06/threads.html#06528 )

Thinking about eventual downstream project using the TCI part of QEMU and trying to stay up-to-date with upstream, this patch might save headaches.

Since there is no formal yes/no to this patch I'm still wondering if I should track it or no.

Regards,

Phil.

Quoted 29 lines
Quoted 16 lines
Quoted 16 lines
---
   configure | 6 +++++-
   1 file changed, 5 insertions(+), 1 deletion(-)
configure +1 -1
index c571ad14e5..510f443e06 100755
@@ -6225,7 +6225,11 @@ fi
   if test "$target_softmmu" = "yes" ; then
     echo "CONFIG_SOFTMMU=y" >> $config_target_mak
     if test "$mttcg" = "yes" ; then
-    echo "TARGET_SUPPORTS_MTTCG=y" >> $config_target_mak
+    if test "$tcg_interpreter" = "yes" ; then
Quoted 8 lines

configure fi · line 6235

Quoted 8 lines
configure +4 -0
+        echo "TCI enabled, disabling MTTCG"
+    else
+        echo "TARGET_SUPPORTS_MTTCG=y" >> $config_target_mak
+    fi
     fi
   fi
   if test "$target_user_only" = "yes" ; then

--
Alex Bennée

#17 lore raw

Re: [Qemu-devel] [PATCH 6/8] tcg/tci: disable MTTCG if TCI is enabled

Quoted 26 lines · Philippe Mathieu-Daudé
Quoted 25 lines · Alex Bennée
Quoted 21 lines · Philippe Mathieu-Daudé

Hi Peter,

I think this patch belongs to 2.10, as there is no time to fix TCI + MTTCG. Should I RESEND it alone with "for 2.10" subject?

One other option might be disable TCI if MTTCG enabled, but there is no ./configure option for MTTCG while there is for TCI.

Regards,

Phil.

Quoted 8 lines · Philippe Mathieu-Daudé

TCI + MTTCG cause strange errors...

    $ arm-softmmu/qemu-system-arm -machine raspi2 -cpu cortex-a7 -smp 4
-accel tcg,thread=multi -kernel kernel7.img
    qemu-system-arm: Guest expects a stronger memory ordering than the host
provides
    This may cause strange/hard to debug errors
    Segmentation fault (core dumped)
Quoted 5 lines
Quoted 2 lines

So this isn't TCI enabling MTTCG by accident - this is the user forcing it when it wouldn't otherwise be enabled. Hence the scary warning...

Hmmm this is the user enabling TCI, I'm not sure about "forcing it". Now MTTCG is enforced by the ./configure and there is no option to disable it.

Er, no.

If you write "-accel tcg" you are not forcing mttcg on. If you write "-accel tcg,thread=multi" you are forcing it on. If you write "-accel tcg,thread=single" you are forcing it off.

MTTCG is only enabled by default if TCG_TARGET_DEFAULT_MO is defined, and in the case of TCI, it is not.

r~

#18 lore raw

Re: [Qemu-devel] [PATCH 6/8] tcg/tci: disable MTTCG if TCI is enabled

Quoted 30 lines · Richard Henderson
Quoted 29 lines · Philippe Mathieu-Daudé
Quoted 27 lines · Alex Bennée
Quoted 5 lines · Philippe Mathieu-Daudé

Hi Peter,

I think this patch belongs to 2.10, as there is no time to fix TCI + MTTCG. Should I RESEND it alone with "for 2.10" subject?

Quoted 16 lines

One other option might be disable TCI if MTTCG enabled, but there is no ./configure option for MTTCG while there is for TCI.

Regards,

Phil.

Quoted 8 lines · Philippe Mathieu-Daudé

TCI + MTTCG cause strange errors...

     $ arm-softmmu/qemu-system-arm -machine raspi2 -cpu cortex-a7 -smp 4
-accel tcg,thread=multi -kernel kernel7.img
     qemu-system-arm: Guest expects a stronger memory ordering than the host
provides
     This may cause strange/hard to debug errors
     Segmentation fault (core dumped)

So this isn't TCI enabling MTTCG by accident - this is the user forcing it when it wouldn't otherwise be enabled. Hence the scary warning...

Quoted 7 lines
Quoted 2 lines

Hmmm this is the user enabling TCI, I'm not sure about "forcing it". Now MTTCG is enforced by the ./configure and there is no option to disable it.

Er, no.

If you write "-accel tcg" you are not forcing mttcg on. If you write "-accel tcg,thread=multi" you are forcing it on.

Ok! I obviously missed this part.

Quoted 4 lines

If you write "-accel tcg,thread=single" you are forcing it off.

MTTCG is only enabled by default if TCG_TARGET_DEFAULT_MO is defined, and in the case of TCI, it is not.

Ok, so I misunderstood Alex :) I thought about ./configure enabled while he was describing -accel enabled.

Thanks for pointing that out :)

Quoted 4 lines

r~

#19 lore raw

RFC PATCH 7/8 tcg/tci: time to remove it :(

In reply to Philippe Mathieu-Daudé

"./configure --disable-tcg-interpreter" generates a warning:
./configure: --disable-tcg-interpreter is obsolete, Experimental TCG interpreter has been removed"

"./configure --enable-tcg-interpreter" generates an error:

Experimental TCG interpreter has been removed

---
 MAINTAINERS              |    7 -
 Makefile.target          |    2 -
 configure                |   32 +-
 disas.c                  |    5 +-
 disas/Makefile.objs      |    4 -
 disas/tci.c              |   61 ---
 include/disas/bfd.h      |    1 -
 include/exec/exec-all.h  |   16 +-
 tcg/tcg-common.c         |    4 -
 tcg/tcg.c                |    6 +-
 tcg/tci.c                | 1250 ----------------------------------------------
 tcg/tci/README           |  130 -----
 tcg/tci/tcg-target.h     |  195 --------
 tcg/tci/tcg-target.inc.c |  897 ---------------------------------
 14 files changed, 14 insertions(+), 2596 deletions(-)
 delete mode 100644 disas/tci.c
 delete mode 100644 tcg/tci.c
 delete mode 100644 tcg/tci/README
 delete mode 100644 tcg/tci/tcg-target.h
 delete mode 100644 tcg/tci/tcg-target.inc.c
MAINTAINERS +0 -7
index 9bad523060..a6b94244c9 100644
@@ -1650,13 +1650,6 @@ S: Odd Fixes
 F: tcg/sparc/
 F: disas/sparc.c
 
-TCI target
-M: Stefan Weil <[email protected]>
-S: Maintained
-F: tcg/tci/
-F: tcg/tci.c
-F: disas/tci.c
-
 Block drivers
 -------------
 VMDK
Makefile.target +0 -2
index 0066579090..63b6f98cc5 100644
@@ -92,8 +92,6 @@ obj-y += exec.o
 obj-y += accel/
 obj-y += tcg/tcg.o tcg/tcg-op.o tcg/optimize.o
 obj-y += tcg/tcg-common.o tcg/tcg-runtime.o
-obj-$(CONFIG_TCG_INTERPRETER) += tcg/tci.o
-obj-$(CONFIG_TCG_INTERPRETER) += disas/tci.o
 obj-y += fpu/softfloat.o
 obj-y += target/$(TARGET_BASE_ARCH)/
 obj-y += disas.o
configure +8 -24
index 510f443e06..ed7e6a965c 100755
@@ -236,7 +236,6 @@ debug_tcg="no"
 debug="no"
 fortify_source=""
 strip_opt="yes"
-tcg_interpreter="no"
 bigendian="no"
 mingw32="no"
 gcov="no"
@@ -560,7 +559,7 @@ case "$cpu" in
     supported_cpu="yes"
   ;;
   *)
-    # This will result in either an error or falling back to TCI later
+    # This will result in an error later
     ARCH=unknown
   ;;
 esac
@@ -953,9 +952,10 @@ for opt do
   ;;
   --enable-hax) hax="yes"
   ;;
-  --disable-tcg-interpreter) tcg_interpreter="no"
+  --disable-tcg-interpreter)
+      echo "$0: $opt is obsolete, Experimental TCG interpreter has been removed" >&2
   ;;
-  --enable-tcg-interpreter) tcg_interpreter="yes"
+  --enable-tcg-interpreter) error_exit "Experimental TCG interpreter has been removed"
   ;;
   --disable-cap-ng)  cap_ng="no"
   ;;
@@ -1258,8 +1258,7 @@ esac
 QEMU_CFLAGS="$CPU_CFLAGS $QEMU_CFLAGS"
 EXTRA_CFLAGS="$CPU_CFLAGS $EXTRA_CFLAGS"
 
-# For user-mode emulation the host arch has to be one we explicitly
-# support, even if we're using TCI.
+# For user-mode emulation the host arch has to be one we explicitly support
 if [ "$ARCH" = "unknown" ]; then
   bsd_user="no"
   linux_user="no"
@@ -1344,7 +1343,6 @@ Advanced options (experts only):
   --with-trace-file=NAME   Full PATH,NAME of file to store traces
                            Default:trace-<pid>
   --disable-slirp          disable SLIRP userspace network connectivity
-  --enable-tcg-interpreter enable TCG with bytecode interpreter (TCI)
   --oss-lib                path to OSS library
   --cpu=CPU                Build for host CPU [$cpu]
   --with-coroutine=BACKEND coroutine backend. Supported options:
@@ -1457,14 +1455,9 @@ fi
 # Suppress writing compiled files
 python="$python -B"
 
-# Now we have handled --enable-tcg-interpreter and know we're not just
-# printing the help message, bail out if the host CPU isn't supported.
+# Bail out if the host CPU isn't supported.
 if test "$ARCH" = "unknown"; then
-    if test "$tcg_interpreter" = "yes" ; then
-        echo "Unsupported CPU = $cpu, will use TCG with TCI (experimental)"
-    else
-        error_exit "Unsupported CPU = $cpu, try --enable-tcg-interpreter"
-    fi
+    error_exit "Unsupported CPU = $cpu"
 fi
 
 # Consult white-list to determine whether to enable werror
@@ -5175,7 +5168,6 @@ echo "Install blobs     $blobs"
 echo "KVM support       $kvm"
 echo "HAX support       $hax"
 echo "RDMA support      $rdma"
-echo "TCG interpreter   $tcg_interpreter"
 echo "fdt support       $fdt"
 echo "preadv support    $preadv"
 echo "fdatasync         $fdatasync"
@@ -5618,9 +5610,6 @@ fi
 if test "$signalfd" = "yes" ; then
   echo "CONFIG_SIGNALFD=y" >> $config_host_mak
 fi
-if test "$tcg_interpreter" = "yes" ; then
-  echo "CONFIG_TCG_INTERPRETER=y" >> $config_host_mak
-fi
 if test "$fdatasync" = "yes" ; then
   echo "CONFIG_FDATASYNC=y" >> $config_host_mak
 fi
@@ -5878,9 +5867,7 @@ if test "$vxhs" = "yes" ; then
   echo "VXHS_LIBS=$vxhs_libs" >> $config_host_mak
 fi
 
-if test "$tcg_interpreter" = "yes"; then
-  QEMU_INCLUDES="-I\$(SRC_PATH)/tcg/tci $QEMU_INCLUDES"
-elif test "$ARCH" = "sparc64" ; then
+if test "$ARCH" = "sparc64" ; then
   QEMU_INCLUDES="-I\$(SRC_PATH)/tcg/sparc $QEMU_INCLUDES"
 elif test "$ARCH" = "s390x" ; then
   QEMU_INCLUDES="-I\$(SRC_PATH)/tcg/s390 $QEMU_INCLUDES"
@@ -6330,9 +6317,6 @@ for i in $ARCH $TARGET_BASE_ARCH ; do
   ;;
   esac
 done
-if test "$tcg_interpreter" = "yes" ; then
-  disas_config "TCI"
-fi
 
 case "$ARCH" in
 alpha)
disas.c +2 -3
index d335c55bbf..adaae64311 100644
@@ -283,9 +283,8 @@ void disas(FILE *out, void *code, unsigned long size)
 #else
     s.info.endian = BFD_ENDIAN_LITTLE;
 #endif
-#if defined(CONFIG_TCG_INTERPRETER)
-    print_insn = print_insn_tci;
-#elif defined(__i386__)
+
+#if defined(__i386__)
     s.info.mach = bfd_mach_i386_i386;
     print_insn = print_insn_i386;
 #elif defined(__x86_64__)
disas/Makefile.objs +0 -4
index 62632ef0dd..5fad067b42 100644
@@ -22,7 +22,3 @@ common-obj-$(CONFIG_S390_DIS) += s390.o
 common-obj-$(CONFIG_SH4_DIS) += sh4.o
 common-obj-$(CONFIG_SPARC_DIS) += sparc.o
 common-obj-$(CONFIG_LM32_DIS) += lm32.o
-
-# TODO: As long as the TCG interpreter and its generated code depend
-# on the QEMU target, we cannot compile the disassembler here.
-#common-obj-$(CONFIG_TCI_DIS) += tci.o
disas/tci.c deleted +0 -61

61 lines not on this page · raw message

include/disas/bfd.h +0 -1
index b01e002b4c..6088a47df1 100644
@@ -384,7 +384,6 @@ typedef struct disassemble_info {
    target address.  Return number of bytes processed.  */
 typedef int (*disassembler_ftype) (bfd_vma, disassemble_info *);
 
-int print_insn_tci(bfd_vma, disassemble_info*);
 int print_insn_big_mips         (bfd_vma, disassemble_info*);
 int print_insn_little_mips      (bfd_vma, disassemble_info*);
 int print_insn_i386             (bfd_vma, disassemble_info*);
include/exec/exec-all.h +2 -14
index 724ec73dce..247578be71 100644
@@ -373,14 +373,7 @@ TranslationBlock *tb_htable_lookup(CPUState *cpu, target_ulong pc,
 
 #if defined(USE_DIRECT_JUMP)
 
-#if defined(CONFIG_TCG_INTERPRETER)
-static inline void tb_set_jmp_target1(uintptr_t jmp_addr, uintptr_t addr)
-{
-    /* patch the branch destination */
-    atomic_set((int32_t *)jmp_addr, addr - (jmp_addr + 4));
-    /* no need to flush icache explicitly */
-}
-#elif defined(_ARCH_PPC)
+#if defined(_ARCH_PPC)
 void ppc_tb_set_jmp_target(uintptr_t jmp_addr, uintptr_t addr);
 #define tb_set_jmp_target1 ppc_tb_set_jmp_target
 #elif defined(__i386__) || defined(__x86_64__)
@@ -450,13 +443,8 @@ static inline void tb_add_jump(TranslationBlock *tb, int n,
 }
 
 /* GETPC is the true target of the return instruction that we'll execute.  */
-#if defined(CONFIG_TCG_INTERPRETER)
-extern uintptr_t tci_tb_ptr;
-# define GETPC() tci_tb_ptr
-#else
-# define GETPC() \
+#define GETPC() \
     ((uintptr_t)__builtin_extract_return_addr(__builtin_return_address(0)))
-#endif
 
 /* The true return address will often point to a host insn that is part of
    the next translated guest insn.  Adjust the address backward to point to
tcg/tcg-common.c +0 -4
index 2f139de802..a663812c69 100644
@@ -27,10 +27,6 @@
 #include "exec/cpu-common.h"
 #include "tcg/tcg.h"
 
-#if defined(CONFIG_TCG_INTERPRETER)
-uintptr_t tci_tb_ptr;
-#endif
-
 TCGOpDef tcg_op_defs[] = {
 #define DEF(s, oargs, iargs, cargs, flags) \
          { #s, oargs, iargs, cargs, iargs + oargs + cargs, flags },
tcg/tcg.c +2 -4
index 35598296c5..71ba033a64 100644
@@ -765,8 +765,7 @@ void tcg_gen_callN(TCGContext *s, void *func, TCGArg ret,
     flags = info->flags;
     sizemask = info->sizemask;
 
-#if defined(__sparc__) && !defined(__arch64__) \
-    && !defined(CONFIG_TCG_INTERPRETER)
+#if defined(__sparc__) && !defined(__arch64__)
     /* We have 64-bit values in one register, but need to pass as two
        separate parameters.  Split them.  */
     int orig_sizemask = sizemask;
@@ -813,8 +812,7 @@ void tcg_gen_callN(TCGContext *s, void *func, TCGArg ret,
 
     pi_first = pi = s->gen_next_parm_idx;
     if (ret != TCG_CALL_DUMMY_ARG) {
-#if defined(__sparc__) && !defined(__arch64__) \
-    && !defined(CONFIG_TCG_INTERPRETER)
+#if defined(__sparc__) && !defined(__arch64__)
         if (orig_sizemask & 1) {
             /* The 32-bit ABI is going to return the 64-bit value in
                the %o0/%o1 register pair.  Prepare for this by using
tcg/tci.c deleted +0 -1250

1,250 lines not on this page · raw message

tcg/tci/README deleted +0 -130

130 lines not on this page · raw message

tcg/tci/tcg-target.h deleted +0 -195

195 lines not on this page · raw message

tcg/tci/tcg-target.inc.c deleted +0 -897

897 lines not on this page · raw message

Signature · 1 line
2.13.1
#20 lore raw

Re: [Qemu-devel] [RFC PATCH 7/8] tcg/tci: time to remove it :(

Quoted 6 lines · Philippe Mathieu-Daudé

"./configure --disable-tcg-interpreter" generates a warning:
./configure: --disable-tcg-interpreter is obsolete, Experimental TCG interpreter has been removed"

"./configure --enable-tcg-interpreter" generates an error:

Experimental TCG interpreter has been removed

configure will already complain about any unknown command line arguments it is given, so you could just delete --enable-tcg-interpreter support and rely on it saying the option does not exist.

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#21 lore raw

RFC PATCH 8/8 travis: remove tcg/tci job

In reply to Philippe Mathieu-Daudé
---
 .travis.yml | 3 ---
 1 file changed, 3 deletions(-)
.travis.yml +0 -3
index 27a2d9cfb3..d10ee5ed79 100644
@@ -74,9 +74,6 @@ matrix:
     - env: CONFIG="--enable-gprof --enable-gcov --disable-pie"
       compiler: gcc
     # We manually include builds which we disable "make check" for
-    - env: CONFIG="--enable-debug --enable-tcg-interpreter"
-           TEST_CMD=""
-      compiler: gcc
     - env: CONFIG="--enable-trace-backends=simple"
            TEST_CMD=""
       compiler: gcc
Signature · 1 line
2.13.1
#22 lore raw
In reply to Philippe Mathieu-Daudé

Hi Philippe,

Quoted 11 lines · Philippe Mathieu-Daudé

There have been some comments on the ML about the usefulness of tci.

https://lists.nongnu.org/archive/html/qemu-devel/2017-06/msg04551.html

Peter Maydell> I'd prefer we just got rid of it.

https://lists.nongnu.org/archive/html/qemu-devel/2017-06/msg04296.html

Richard Henderson> Is it time to remove it? I'm pretty sure the only hosts
for which it will work have proper backends...

Quoted 7 lines

Richard quotes are way clearer than me trying to paraphrase what he told me:
- it doesn't use libffi, and as such the way it makes calls to helpers doesn't work for many hosts.
- we already cover almost everthing that debian does. if debian or gentoo doesn't support it, one can confidently say there's little interest.
- if someone *does* want to run qemu on something else, it isn't difficult to port tcg.

I figured out MAINTAINERS was unsync, so added patches 1-4, they are not really tci-related.

Since they are not related to TCI at all, please submit these as separate series.

Quoted 2 lines

Patches 5,6 are trivial fixes to let the codebase quite sane if there is future need to revert/reimport tci.

I think this should go into 2.10...

Quoted 1 line

Patches 7,8 are the removal, marked RFC... let's debate!

... but NACK for a direct removal. Common sense is to make obsolete features as deprecated first and then wait for 2 public releases before the final removal, so that users still have a chance to speak up in case they still need the feature and are willing to maintain it.

Please see the following URL for details (and please also add an entry for TCI in the Miscellaneous section there):

http://wiki.qemu.org/Features/LegacyRemoval

Thomas

#23 lore raw

On 06/29/2017 05:46 AM, Thomas Huth wrote:>> I figured out MAINTAINERS was unsync, so added patches 1-4, they are not really

Quoted 4 lines
Quoted 1 line

tci-related.

Since they are not related to TCI at all, please submit these as separate series.

Ok.

Quoted 4 lines
Quoted 2 lines

Patches 5,6 are trivial fixes to let the codebase quite sane if there is future need to revert/reimport tci.

I think this should go into 2.10...

Ok I will resend separately.

Quoted 11 lines
Quoted 1 line

Patches 7,8 are the removal, marked RFC... let's debate!

... but NACK for a direct removal. Common sense is to make obsolete features as deprecated first and then wait for 2 public releases before the final removal, so that users still have a chance to speak up in case they still need the feature and are willing to maintain it.

Please see the following URL for details (and please also add an entry for TCI in the Miscellaneous section there):

http://wiki.qemu.org/Features/LegacyRemoval

Ok I'll follow the procedure and see how to modify the ./configure (with Daniel comment), also update the wiki accordingly.

Regards,

Phil.

#24 lore raw
In reply to Thomas Huth
Quoted 5 lines · Thomas Huth
Quoted 1 line

Patches 7,8 are the removal, marked RFC... let's debate!

... but NACK for a direct removal. Common sense is to make obsolete features as deprecated first and then wait for 2 public releases before the final removal, so that users still have a chance to speak up in case they still need the feature and are willing to maintain it.

I think this is a slightly different case than what is in
http://wiki.qemu.org/Features/LegacyRemoval.

TCI is enabled only with a specific configure argument if your machine is not supported by TCG. This would break _build_ configurations, not user configurations. It's a remote possibility that users are building their own QEMU, with TCI enabled, to work around a TCG bug. So we can be more speedy in removing the code.

Paolo

#25 lore raw
Quoted 9 lines · Paolo Bonzini
Quoted 5 lines · Thomas Huth
Quoted 1 line

Patches 7,8 are the removal, marked RFC... let's debate!

... but NACK for a direct removal. Common sense is to make obsolete features as deprecated first and then wait for 2 public releases before the final removal, so that users still have a chance to speak up in case they still need the feature and are willing to maintain it.

Quoted 8 lines

I think this is a slightly different case than what is in
http://wiki.qemu.org/Features/LegacyRemoval.

TCI is enabled only with a specific configure argument if your machine is not supported by TCG. This would break _build_ configurations, not user configurations. It's a remote possibility that users are building their own QEMU, with TCI enabled, to work around a TCG bug. So we can be more speedy in removing the code.

You never know ... it's unlikely, but there might be people around who run configure with "--enable-tcg-interpreter" on purpose. And why the hurry for removing this? It's been around in the current shape since years, so waiting for two more releases does not hurt, does it?

Thomas

#26 lore raw
Quoted 7 lines · Thomas Huth
Quoted 5 lines

TCI is enabled only with a specific configure argument if your machine is not supported by TCG. This would break _build_ configurations, not user configurations. It's a remote possibility that users are building their own QEMU, with TCI enabled, to work around a TCG bug. So we can be more speedy in removing the code.

You never know ... it's unlikely, but there might be people around who run configure with "--enable-tcg-interpreter" on purpose.

And they have never reported a bug? :) But I agree it's not a big deal.
Richard should decide.

Paolo

Quoted 3 lines

And why the
hurry for removing this? It's been around in the current shape since years, so waiting for two more releases does not hurt, does it?

#27 lore raw
Quoted 8 lines · Paolo Bonzini
Quoted 5 lines · Thomas Huth
Quoted 5 lines

TCI is enabled only with a specific configure argument if your machine is not supported by TCG. This would break _build_ configurations, not user configurations. It's a remote possibility that users are building their own QEMU, with TCI enabled, to work around a TCG bug. So we can be more speedy in removing the code.

Quoted 11 lines
Quoted 2 lines

You never know ... it's unlikely, but there might be people around who run configure with "--enable-tcg-interpreter" on purpose.

And they have never reported a bug? :) But I agree it's not a big deal.
Richard should decide.

Paolo

Quoted 3 lines

And why the
hurry for removing this? It's been around in the current shape since years, so waiting for two more releases does not hurt, does it?

The various BSD folks also decided to rather maintain their patches downstream instead of trying hard to get them included in the upstream repository... now that we've got a deprecation warning in the configure script, things fortunately start to change :-)

Likely nobody is maintaining downstream TCI patches ... but we don't really now for sure - it could be the same situation as with BSD. So we should give the users a chance to speak up first before we remove it.

Thomas

#28 lore raw
In reply to Paolo Bonzini
Quoted 6 lines · Paolo Bonzini
Quoted 5 lines · Thomas Huth
Quoted 5 lines

TCI is enabled only with a specific configure argument if your machine is not supported by TCG. This would break _build_ configurations, not user configurations. It's a remote possibility that users are building their own QEMU, with TCI enabled, to work around a TCG bug. So we can be more speedy in removing the code.

Quoted 11 lines
Quoted 2 lines

You never know ... it's unlikely, but there might be people around who run configure with "--enable-tcg-interpreter" on purpose.

And they have never reported a bug? :) But I agree it's not a big deal.
Richard should decide.

Paolo

Quoted 3 lines

And why the
hurry for removing this? It's been around in the current shape since years, so waiting for two more releases does not hurt, does it?

It is unlikely someone is using it for ARM aarch64 (see patch 5).

MTTCG was not in 2.9 but is now enabled by default on alpha/arm* since February 2017 and on ppc64 since April 2017. Looking at the 6 different bugs I show in the cover, I'm pretty sure no active developer but me keep trying to use tci :p

Phil.

#29 lore raw
In reply to Paolo Bonzini

Am 29.06.2017 um 17:47 schrieb Paolo Bonzini:

Quoted 8 lines · Thomas Huth
Quoted 5 lines
Quoted 5 lines

TCI is enabled only with a specific configure argument if your machine is not supported by TCG. This would break _build_ configurations, not user configurations. It's a remote possibility that users are building their own QEMU, with TCI enabled, to work around a TCG bug. So we can be more speedy in removing the code.

Quoted 7 lines
Quoted 2 lines

You never know ... it's unlikely, but there might be people around who run configure with "--enable-tcg-interpreter" on purpose.

And they have never reported a bug? :) But I agree it's not a big deal.
Richard should decide.

Paolo

Was there a bug? I'm not aware of one.

The TODO assertions were added on purpose when I wrote the code:

Initially all TCG codes had it, and I removed them as soon as a statement was executed and I had verified the result.

So the recently failing assertions are simply code which was not triggered before, maybe because earlier versions of QEMU did not use those cases or maybe because a new guest scenario now needs them while my tests did not.

TCI was never meant to be used for production, so I think my approach was acceptable.

Stefan

#30 lore raw
Quoted 2 lines · Stefan Weil

TCI was never meant to be used for production, so I think my approach was acceptable.

I think perhaps this is at the root of some of the difference in perspective here -- I tend to the view that given that QEMU is a production codebase, we should not really have code in it which is neither (a) production-quality nor
(b) intended to be incrementally improved until it reaches that level of usability; so anything that's in the middle ground should either be improved, or removed.
I don't know whether I'm in a minority in that general view.

You can make a similar argument regarding the obscure host OS/CPU either we support the platform well enough that you can actually use it and we're testing to ensure it remains the case, or we don't support it, and we should remove the code. (Ditto, various ancient board models...)

thanks
-- PMM

#31 lore raw
In reply to Thomas Huth
Quoted 19 lines · Thomas Huth
Quoted 9 lines · Paolo Bonzini
Quoted 5 lines · Thomas Huth
Quoted 1 line

Patches 7,8 are the removal, marked RFC... let's debate!

... but NACK for a direct removal. Common sense is to make obsolete features as deprecated first and then wait for 2 public releases before the final removal, so that users still have a chance to speak up in case they still need the feature and are willing to maintain it.

Quoted 8 lines

I think this is a slightly different case than what is in
http://wiki.qemu.org/Features/LegacyRemoval.

TCI is enabled only with a specific configure argument if your machine is not supported by TCG. This would break _build_ configurations, not user configurations. It's a remote possibility that users are building their own QEMU, with TCI enabled, to work around a TCG bug. So we can be more speedy in removing the code.

Quoted 4 lines

You never know ... it's unlikely, but there might be people around who run configure with "--enable-tcg-interpreter" on purpose. And why the hurry for removing this? It's been around in the current shape since years, so waiting for two more releases does not hurt, does it?

The flipside is that even if we delete it, if someone does suddenly care, the code is still there in git & easy to undelete again. Given that we believe there are zero users, it is known broken in many ways, and TCG provides a working alternative, I don't see a strong reason to not just kill it right away.

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#32 lore raw
Quoted 5 lines · Daniel P. Berrange

The flipside is that even if we delete it, if someone does suddenly care, the code is still there in git & easy to undelete again. Given that we believe there are zero users, it is known broken in many ways, and TCG provides a working alternative, I don't see a strong reason to not just kill it right away.

"zero users" is quite a strong and hard to prove statement. I don't really see a reason not to do at least one release of deprecate-and-warn before we drop it.

(People do occasionally do weird stuff with TCI, eg http://qira.me/
involves a QEMU fork with a very hacked about TCI.)

thanks
-- PMM

#33 lore raw
In reply to Daniel P. Berrange
Quoted 25 lines · Daniel P. Berrange
Quoted 19 lines · Thomas Huth
Quoted 9 lines · Paolo Bonzini
Quoted 5 lines · Thomas Huth
Quoted 1 line

Patches 7,8 are the removal, marked RFC... let's debate!

... but NACK for a direct removal. Common sense is to make obsolete features as deprecated first and then wait for 2 public releases before the final removal, so that users still have a chance to speak up in case they still need the feature and are willing to maintain it.

Quoted 8 lines

I think this is a slightly different case than what is in
http://wiki.qemu.org/Features/LegacyRemoval.

TCI is enabled only with a specific configure argument if your machine is not supported by TCG. This would break _build_ configurations, not user configurations. It's a remote possibility that users are building their own QEMU, with TCI enabled, to work around a TCG bug. So we can be more speedy in removing the code.

Quoted 4 lines

You never know ... it's unlikely, but there might be people around who run configure with "--enable-tcg-interpreter" on purpose. And why the hurry for removing this? It's been around in the current shape since years, so waiting for two more releases does not hurt, does it?

Quoted 5 lines

The flipside is that even if we delete it, if someone does suddenly care, the code is still there in git & easy to undelete again. Given that we believe there are zero users, it is known broken in many ways, and TCG provides a working alternative, I don't see a strong reason to not just kill it right away.

At least I was using TCI a couple of times during the last years (when I was suspecting a bug in the normal TCG backend, so I could compare). There might be other people, too, so I would not dare to say that there are zero users!
Though I used it a couple of times in the past, I personally would not object the removal of TCI nowadays since the normal TCG backends have become pretty mature ... but other users of TCI might have a different opinion here, so let's mark it as deprecated now and remove it next year (unless somebody speaks up and explains why it should not be removed).

Thomas

#34 lore raw
In reply to Philippe Mathieu-Daudé

Am 29.06.2017 um 03:02 schrieb Philippe Mathieu-Daudé:

Quoted 19 lines

There have been some comments on the ML about the usefulness of tci.

https://lists.nongnu.org/archive/html/qemu-devel/2017-06/msg04551.html

Peter Maydell> I'd prefer we just got rid of it.

https://lists.nongnu.org/archive/html/qemu-devel/2017-06/msg04296.html

Richard Henderson> Is it time to remove it? I'm pretty sure the only hosts
for which it will work have proper backends...

Richard quotes are way clearer than me trying to paraphrase what he told me:
- it doesn't use libffi, and as such the way it makes calls to helpers doesn't work for many hosts.
- we already cover almost everthing that debian does. if debian or gentoo doesn't support it, one can confidently say there's little interest.
- if someone *does* want to run qemu on something else, it isn't difficult to port tcg.

I figured out MAINTAINERS was unsync, so added patches 1-4, they are not really tci-related.

Quoted 8 lines

Patches 5,6 are trivial fixes to let the codebase quite sane if there is future need to revert/reimport tci.

Patches 7,8 are the removal, marked RFC... let's debate!

Regards,

Phil.

Hi,

as Peter already has written, there are different perspectives on QEMU.

My conclusion is that depending on those perspectives people come to different results whether certain code parts are useful or not.

When I started using (and contributing) to QEMU in 2006, I wanted to analyse code running on an embedded MIPS system. With real hardware that was impossible, but with QEMU I could watch and debug that code (as soon as the MIPS emulation was sufficiently good, so that was my initial motivation).

Later I was responsible for automated software tests. Those tests included software written for embedded PCs. The only missing components for an emulation with QEMU were the network cards, so I wrote the eepro100 (part of official QEMU) and dp8381x (only in my fork) network hardware emulations.

Later I wanted to build and run QEMU on platforms which were not implemented. So that was the motivation to write TCI. I also used TCI to analyse TCG commands with Valgrind. It is for example very easy to count the frequency of the different TCG opcodes executed in an emulation run. TCI could also be used to monitor register usage with minimal code changes. And I still think that it is the easiest way to build QEMU on a completely new platform (that should work out of the box) and to make emulation work there (that might require some efforts).

In my current role I'm interested in the emulation of old computer systems. Therefore my fork still includes some hardware emulations which were removed in the official QEMU, and especially emulation of all generations of the Intel PC platform is important for me.

I am aware that neither of those applications is in the primary focus of most QEMU developers who want to have a stable, well performing platform for server virtualisation. My server qemu.weilnetz.de also uses that technology, so I want that, too.

Nevertheless QEMU is the only software which I know which not only addresses the needs for server / PC virtualisation, but also is useful for researchers and scientists, archivists, learners and teachers or experimenters.

Up to now, I had the impression that QEMU is sufficiently modular so that the different perspectives and expectations could be supported without harming each other too much. The only drawback was additional code (which would not be needed when focussing on a single perspective) causing additional compilation time and more (formal, mostly automated) file changes for code clean ups and API‌ changes.

Cheers
Stefan

#35 lore raw
Quoted 5 lines · Stefan Weil

Nevertheless QEMU is the only software which I know which not only addresses the needs for server / PC virtualisation, but also is useful for researchers and scientists, archivists, learners and teachers or experimenters.

Quoted 7 lines

Up to now, I had the impression that QEMU is sufficiently modular so that the different perspectives and expectations could be supported without harming each other too much. The only drawback was additional code (which would not be needed when focussing on a single perspective) causing additional compilation time and more (formal, mostly automated) file changes for code clean ups and API‌ changes.

Yes, the whole of TCG demonstrates that we're not purely trying to be a virtual-machine-usecase-only codebase, so certainly there is scope for having multiple parts and uses in QEMU.

I think the part of TCI that makes it stand out as awkward here is that it is an option that you have to pick at configure time, and enabling it disables the standard TCG backend. If it was a runtime option to use the interpreter rather than the codegen (in the same way that you can runtime select between KVM and TCG), I think that would help a lot:
* reduces the number of build configs we need to test
* means it's accessible to the bulk of users who use their distro's build of QEMU rather than rolling their own
* less of a beartrap for users who enable the config option and then wonder why QEMU is running so slowly
* opens the possibility of using the interpreter as part of mainstream TCG (eg in the cases of "execute one insn and throw it away, which might be faster interpreted in theory)

TCI is also awkward because it means we don't really know what the set of platforms we run on is. (For instance I'd like to fix our configure script which currently uses 'uname' as a fallback for identifying target CPU and OS, which is totally wrong for cross-compile. It would be easier to be sure such a refactor was correct if we knew which hosts we could possibly run on...)

That to me all adds up to a position where while I don't care enough to take active steps to remove TCI from QEMU, I wouldn't be unhappy to see it go if other people strongly support removal, and if nobody's interested in trying to fix its problems.

thanks
-- PMM

#36 lore raw
In reply to Philippe Mathieu-Daudé
This series seems to have some coding style problems. See output below for more information:

Hi,

This series seems to have some coding style problems. See output below for more information:

Subject: [Qemu-devel] [RFC PATCH 0/8] removal of tci (tcg interpreter)
Message-id: [email protected]
Type: series

=== TEST SCRIPT BEGIN ===
#!/bin/bash

BASE=base
n=1
total=$(git log --oneline $BASE.. | wc -l)
failed=0

git config --local diff.renamelimit 0
git config --local diff.renames True

commits="$(git log --format=%H --reverse $BASE..)" for c in $commits; do

    echo "Checking PATCH $n/$total: $(git log -n 1 --format=%s $c)..."
    if ! git show $c --format=email | ./scripts/checkpatch.pl --mailback -; then
        failed=1
        echo
    fi
    n=$((n+1))

done

exit $failed
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
fatal: Cannot update paths and switch to branch 'test' at the same time.
Did you intend to checkout 'origin/patchew/[email protected]' which can not be resolved as commit? Traceback (most recent call last):
File "/home/fam/bin/patchew", line 440, in test_one

    git_clone_repo(clone, r["repo"], r["head"], logf)

File "/home/fam/bin/patchew", line 53, in git_clone_repo
cwd=clone)
File "/usr/lib64/python3.5/subprocess.py", line 271, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['git', 'checkout', 'origin/patchew/[email protected]', '-b', 'test']' returned non-zero exit status 128

---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to [email protected]

#37 lore raw
Quoted 5 lines · On Thu, 07/06 16:49, [email protected] wrote:

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
fatal: Cannot update paths and switch to branch 'test' at the same time.
Did you intend to checkout 'origin/patchew/[email protected]' which can not be resolved as commit? Traceback (most recent call last):
File "/home/fam/bin/patchew", line 440, in test_one

Quoted 7 lines
    git_clone_repo(clone, r["repo"], r["head"], logf)

File "/home/fam/bin/patchew", line 53, in git_clone_repo
cwd=clone)
File "/usr/lib64/python3.5/subprocess.py", line 271, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['git', 'checkout', 'origin/patchew/[email protected]', '-b', 'test']' returned non-zero exit status 128

Ignore this please, patchew is recovering from a bad state.