Re: 5.0.0-rc3 : Opcode 1f 12 0f 00 (7ce003e4) leaked temporaries

2020-04-17 Thread Richard Henderson
On 4/17/20 2:20 AM, Philippe Mathieu-Daudé wrote:
> --enable-debug enables --enable-debug-tcg which is not designed for
> performance. You might want to try '--enable-debug --disable-debug-tcg'.

More importantly, --enable-debug turns off compiler optimization.  That is
going to be the biggest hit to performance.


r~




Re: 5.0.0-rc3 : Opcode 1f 12 0f 00 (7ce003e4) leaked temporaries

2020-04-17 Thread BALATON Zoltan

On Fri, 17 Apr 2020, Peter Maydell wrote:

On Fri, 17 Apr 2020 at 01:43, Dennis Clarke via  wrote:

Also I did compile qemu with --enable-debug --disable-strip and the
performance is truely horrific.  I can only assume that those options
are the cause. Any thoughts from anyone would be wonderful.


Well, you turned on debug and you got some warnings
which are only emitted with debug on, so you can
work around it by not doing that :-) And yes, debug
is slower (it builds QEMU without optimization enabled
so it's easier to debug QEMU in gdb, and it turns on
various extra sanity checks.)


Last time I've looked I've found it effectively disables TB cache (at 
least with PPC) because one of those checks forces a flush which is the 
main source of the slowness with --enable-debug. Not sure if this could be 
avoided, I didn't know about --disable-tcg-debug Philippe suggested so 
haven't tested that.


Regards,
BALATON Zoltan



Re: 5.0.0-rc3 : Opcode 1f 12 0f 00 (7ce003e4) leaked temporaries

2020-04-17 Thread Peter Maydell
On Fri, 17 Apr 2020 at 12:00, BALATON Zoltan  wrote:
> On Fri, 17 Apr 2020, Peter Maydell wrote:
> > And yes, debug
> > is slower (it builds QEMU without optimization enabled
> > so it's easier to debug QEMU in gdb, and it turns on
> > various extra sanity checks.)
>
> Last time I've looked I've found it effectively disables TB cache (at
> least with PPC) because one of those checks forces a flush which is the
> main source of the slowness with --enable-debug. Not sure if this could be
> avoided, I didn't know about --disable-tcg-debug Philippe suggested so
> haven't tested that.

It's not supposed to disable TB caching, and in my experience
it does not (no TB caching at all is incredibly slow). If it's
doing that on PPC that would be worth investigating.

I do almost all of my work and local testing with --enable-debug,
so I notice if it's slowed down to the extent that "no TB caching"
would involve. It is naturally slower than the non-debug config
both because of some extra checking and also because all the C
code is being compiled at -O0 rather than -O2.

thanks
-- PMM



Re: 5.0.0-rc3 : Opcode 1f 12 0f 00 (7ce003e4) leaked temporaries

2020-04-17 Thread Philippe Mathieu-Daudé
Hi Dennis,

On 4/17/20 2:42 AM, Dennis Clarke via wrote:>
> Very strange messages from qemu 5.0.0-rc3 wherein I try to run :
>
> $ /usr/local/bin/qemu-system-ppc64 --version
> QEMU emulator version 4.2.93
> Copyright (c) 2003-2020 Fabrice Bellard and the QEMU Project developers
> $
> $
> $ /usr/local/bin/qemu-system-ppc64 \
>  > -machine pseries-4.1 -cpu power9 -smp 4 -m 12G -accel tcg \
>  > -drive file=/home/ppc64/ppc64le.qcow2 \
>  > -device virtio-net-pci,netdev=usernet \
>  > -netdev user,id=usernet,hostfwd=tcp::1-:22 \
>  > -serial stdio -display none -vga none
> qemu-system-ppc64: warning: TCG doesn't support requested feature,
> cap-cfpc=workaround
> qemu-system-ppc64: warning: TCG doesn't support requested feature,
> cap-sbbc=workaround
> qemu-system-ppc64: warning: TCG doesn't support requested feature,
> cap-ibs=workaround[...]> Quiescing Open Firmware ...
> Booting Linux via __start() @ 0x0200 ...
> Opcode 1f 12 0f 00 (7ce003e4) leaked temporaries
[...]

Thanks for this report. I purposed a patch to fix this, but don't expect
it to be fixed in the next 5.0 release because this is not a critical
security bug.

>  From this point onwards I see an endless stream of :
>
> Opcode 1f 12 0f 00 (7ce003e4) leaked temporaries
> Opcode 1f 12 0f 00 (7ce003e4) leaked temporaries
> Opcode 1f 12 0f 00 (7ce003e4) leaked temporaries
> Opcode 1f 12 0f 00 (7ce003e4) leaked temporaries
> Opcode 1f 12 0f 00 (7ce003e4) leaked temporaries
> Opcode 1f 12 0f 00 (7ce003e4) leaked temporaries
[...]
>
> No idea what that is .. but it doesn't look friendly.
>
> Also I did compile qemu with --enable-debug --disable-strip and the
> performance is truely horrific.  I can only assume that those options
> are the cause. Any thoughts from anyone would be wonderful.

--enable-debug enables --enable-debug-tcg which is not designed for
performance. You might want to try '--enable-debug --disable-debug-tcg'.



Re: 5.0.0-rc3 : Opcode 1f 12 0f 00 (7ce003e4) leaked temporaries

2020-04-17 Thread Peter Maydell
On Fri, 17 Apr 2020 at 10:16, David Gibson  wrote:
>
> On Fri, Apr 17, 2020 at 10:01:53AM +0100, Peter Maydell wrote:
> > David -- is this a known bug?
>
> Not known to me.

I see Philippe's just posted a patch for it :-)

thanks
-- PMM



Re: 5.0.0-rc3 : Opcode 1f 12 0f 00 (7ce003e4) leaked temporaries

2020-04-17 Thread David Gibson
On Fri, Apr 17, 2020 at 10:01:53AM +0100, Peter Maydell wrote:
> On Fri, 17 Apr 2020 at 01:43, Dennis Clarke via  
> wrote:
> >
> >
> > Very strange messages from qemu 5.0.0-rc3 wherein I try to run :
> 
> Thanks for the report. Did this work with older QEMU?
> 
> > $ /usr/local/bin/qemu-system-ppc64 --version
> > QEMU emulator version 4.2.93
> > Copyright (c) 2003-2020 Fabrice Bellard and the QEMU Project developers
> > $
> > $
> > $ /usr/local/bin/qemu-system-ppc64 \
> >  > -machine pseries-4.1 -cpu power9 -smp 4 -m 12G -accel tcg \
> >  > -drive file=/home/ppc64/ppc64le.qcow2 \
> >  > -device virtio-net-pci,netdev=usernet \
> >  > -netdev user,id=usernet,hostfwd=tcp::1-:22 \
> >  > -serial stdio -display none -vga none
> > qemu-system-ppc64: warning: TCG doesn't support requested feature,
> > cap-cfpc=workaround
> > qemu-system-ppc64: warning: TCG doesn't support requested feature,
> > cap-sbbc=workaround
> > qemu-system-ppc64: warning: TCG doesn't support requested feature,
> > cap-ibs=workaround
> >
> >
> > SLOF **
> 
> [kernel boot log snipped]
> 
> 
> > root@titan:~#
> >
> >  From this point onwards I see an endless stream of :
> >
> > Opcode 1f 12 0f 00 (7ce003e4) leaked temporaries
> 
> > No idea what that is .. but it doesn't look friendly.
> >
> > Also I did compile qemu with --enable-debug --disable-strip and the
> > performance is truely horrific.  I can only assume that those options
> > are the cause. Any thoughts from anyone would be wonderful.
> 
> Well, you turned on debug and you got some warnings
> which are only emitted with debug on, so you can
> work around it by not doing that :-) And yes, debug
> is slower (it builds QEMU without optimization enabled
> so it's easier to debug QEMU in gdb, and it turns on
> various extra sanity checks.)
> 
> The warning is something we should fix -- it's a bug
> in the PPC code generation where we didn't correctly
> free a TCG temporary. The good news is that this won't
> generally have any visible bad effects, because the
> TCG common code will clean all those temporaries up
> at the end of each block anyway. The only time the leak
> is an issue is if guest code has a straight line sequence
> of hundreds of the same instruction in a row, in which
> case they'll all be in the same block and we might
> hit the limit on total temporaries. That won't happen
> unless guest code is deliberately doing something crazy.
> 
> David -- is this a known bug?

Not known to me.

-- 
David Gibson| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson


signature.asc
Description: PGP signature


Re: 5.0.0-rc3 : Opcode 1f 12 0f 00 (7ce003e4) leaked temporaries

2020-04-17 Thread Peter Maydell
On Fri, 17 Apr 2020 at 01:43, Dennis Clarke via  wrote:
>
>
> Very strange messages from qemu 5.0.0-rc3 wherein I try to run :

Thanks for the report. Did this work with older QEMU?

> $ /usr/local/bin/qemu-system-ppc64 --version
> QEMU emulator version 4.2.93
> Copyright (c) 2003-2020 Fabrice Bellard and the QEMU Project developers
> $
> $
> $ /usr/local/bin/qemu-system-ppc64 \
>  > -machine pseries-4.1 -cpu power9 -smp 4 -m 12G -accel tcg \
>  > -drive file=/home/ppc64/ppc64le.qcow2 \
>  > -device virtio-net-pci,netdev=usernet \
>  > -netdev user,id=usernet,hostfwd=tcp::1-:22 \
>  > -serial stdio -display none -vga none
> qemu-system-ppc64: warning: TCG doesn't support requested feature,
> cap-cfpc=workaround
> qemu-system-ppc64: warning: TCG doesn't support requested feature,
> cap-sbbc=workaround
> qemu-system-ppc64: warning: TCG doesn't support requested feature,
> cap-ibs=workaround
>
>
> SLOF **

[kernel boot log snipped]


> root@titan:~#
>
>  From this point onwards I see an endless stream of :
>
> Opcode 1f 12 0f 00 (7ce003e4) leaked temporaries

> No idea what that is .. but it doesn't look friendly.
>
> Also I did compile qemu with --enable-debug --disable-strip and the
> performance is truely horrific.  I can only assume that those options
> are the cause. Any thoughts from anyone would be wonderful.

Well, you turned on debug and you got some warnings
which are only emitted with debug on, so you can
work around it by not doing that :-) And yes, debug
is slower (it builds QEMU without optimization enabled
so it's easier to debug QEMU in gdb, and it turns on
various extra sanity checks.)

The warning is something we should fix -- it's a bug
in the PPC code generation where we didn't correctly
free a TCG temporary. The good news is that this won't
generally have any visible bad effects, because the
TCG common code will clean all those temporaries up
at the end of each block anyway. The only time the leak
is an issue is if guest code has a straight line sequence
of hundreds of the same instruction in a row, in which
case they'll all be in the same block and we might
hit the limit on total temporaries. That won't happen
unless guest code is deliberately doing something crazy.

David -- is this a known bug?

thanks
-- PMM



5.0.0-rc3 : Opcode 1f 12 0f 00 (7ce003e4) leaked temporaries

2020-04-16 Thread Dennis Clarke via



Very strange messages from qemu 5.0.0-rc3 wherein I try to run :

$ /usr/local/bin/qemu-system-ppc64 --version
QEMU emulator version 4.2.93
Copyright (c) 2003-2020 Fabrice Bellard and the QEMU Project developers
$
$
$ /usr/local/bin/qemu-system-ppc64 \
> -machine pseries-4.1 -cpu power9 -smp 4 -m 12G -accel tcg \
> -drive file=/home/ppc64/ppc64le.qcow2 \
> -device virtio-net-pci,netdev=usernet \
> -netdev user,id=usernet,hostfwd=tcp::1-:22 \
> -serial stdio -display none -vga none
qemu-system-ppc64: warning: TCG doesn't support requested feature, 
cap-cfpc=workaround
qemu-system-ppc64: warning: TCG doesn't support requested feature, 
cap-sbbc=workaround
qemu-system-ppc64: warning: TCG doesn't support requested feature, 
cap-ibs=workaround



SLOF **
QEMU Starting
 Build Date = Mar 27 2020 13:57:26
 FW Version = git-8e012d6fddb62be8
 Press "s" to enter Open Firmware.

C0240
Populating /vdevice methods
Populating /vdevice/vty@7100
Populating /vdevice/nvram@7101
Populating /vdevice/v-scsi@7102
   SCSI: Looking for devices
  8000 DISK : "QEMU QEMU HARDDISK2.5+"
  8200 CD-ROM   : "QEMU QEMU CD-ROM  2.5+"
C05A0
No NVRAM common partition, re-initializing...
Scanning USB
Using default console: /vdevice/vty@7100

  Welcome to Open Firmware

  Copyright (c) 2004, 2017 IBM Corporation All rights reserved.
  This program and the accompanying materials are made available
  under the terms of the BSD License available at
  http://www.opensource.org/licenses/bsd-license.php


Trying to load:  from: /vdevice/v-scsi@7102/disk@8000 
...   Successfully loaded

Welcome to GRUB!
.
.
.
etc
etc

Populating /vdevice methods
Populating /vdevice/vty@7100
Populating /vdevice/nvram@7101
Loading Linux 5.5.0-1-powerpc64le ...
Loading initial ramdisk ...
OF stdout device is: /vdevice/vty@7100
Preparing to boot Linux version 5.5.0-1-powerpc64le 
(debian-ker...@lists.debian.org) (gcc version 9.3.0 (Debian 9.3.0-8)) #1 
SMP Debian 5.5.13-2 (2020-03-30)

Detected machine type: 0101
command line: BOOT_IMAGE=/boot/vmlinux-5.5.0-1-powerpc64le 
root=UUID=349c875e-f9c9-4fdd-9023-7f4a11bdd6c6 ro verbose

Max number of cores passed to firmware: 2048 (NR_CPUS = 2048)
Calling ibm,client-architecture-support... done
memory layout at init:
  memory_limit :  (16 MB aligned)
  alloc_bottom : 0518
  alloc_top: 3000
  alloc_top_hi : 0003
  rmo_top  : 3000
  ram_top  : 0003
instantiating rtas at 0x2fff... done
prom_hold_cpus: skipped
copying OF device tree...
Building dt strings...
Building dt structure...
Device tree strings 0x0519 -> 0x05190b3e
Device tree struct  0x051a -> 0x051b
Quiescing Open Firmware ...
Booting Linux via __start() @ 0x0200 ...
Opcode 1f 12 0f 00 (7ce003e4) leaked temporaries
[0.00] radix-mmu: Page sizes from device-tree:
[0.00] radix-mmu: Page size shift = 12 AP=0x0
[0.00] radix-mmu: Page size shift = 16 AP=0x5
[0.00] radix-mmu: Page size shift = 21 AP=0x1
[0.00] radix-mmu: Page size shift = 30 AP=0x2
[0.00] radix-mmu: Activating Kernel Userspace Execution Prevention
[0.00] radix-mmu: Activating Kernel Userspace Access Prevention
[0.00] radix-mmu: Mapped 0x-0x4000 
with 1.00 GiB pages (exec)
[0.00] radix-mmu: Mapped 0x4000-0x0003 
with 1.00 GiB pages

[0.00] lpar: Using radix MMU under hypervisor
[0.00] Linux version 5.5.0-1-powerpc64le 
(debian-ker...@lists.debian.org) (gcc version 9.3.0 (Debian 9.3.0-8)) #1 
SMP Debian 5.5.13-2 (2020-03-30)

[0.00] Found initrd at 0xc370:0xc51783ed
[0.00] Using pSeries machine description
[0.00] printk: bootconsole [udbg0] enabled
[0.00] Partition configured for 4 cpus.
[0.00] CPU maps initialized for 1 thread per core
[0.00] -
[0.00] phys_mem_size = 0x3
[0.00] dcache_bsize  = 0x80
[0.00] icache_bsize  = 0x80
[0.00] cpu_features  = 0x0001c06f8f4f91a7
[0.00]   possible= 0x0001fbefcf5fb1a7
[0.00]   always  = 0x0003800081a1
[0.00] cpu_user_features = 0xdc0065c2 0xaee0
[0.00] mmu_features  = 0xbc006041
[0.00] firmware_features = 0x0005455a445f
[0.00] vmalloc start = 0xc008
[0.00] IO start  = 0xc00a
[0.00] vmemmap start = 0xc00c
[0.00] -
[0.00] numa:   NODE_DATA [mem 0x2fffcaf80-0x2fffc]
[0.00] rfi-flush: fallback