Skip to contentSkip to conversation

qemu-log: add log category for MMU info

PATCH Antony Pavlov 2 participants 2 messages Nov 6, 2014

lore
Share & tools
lore
#0 lore raw
Quoted 15 lines
Quoted 15 lines

Running barebox on qemu-system-mips* with '-d unimp' overloads stderr by very very many mips_cpu_handle_mmu_fault() messages:

mips_cpu_handle_mmu_fault address=b80003fd ret 0 physical 00000000180003fd
prot 3
mips_cpu_handle_mmu_fault address=a0800884 ret 0 physical 0000000000800884
prot 3
mips_cpu_handle_mmu_fault pc a080cd80 ad b80003fd rw 0 mmu_idx 0

So it's very difficult to find LOG_UNIMP message.

The mips_cpu_handle_mmu_fault() messages appears on enabling ANY logging! It's not very handy.

Quoted 8 lines
Quoted 4 lines

Adding separate log category for *_cpu_handle_mmu_fault() logging fixes the problem.

Have you benchmarked the performance delta with this patch applied? Just boot up a random small PPC guest that shuts down immediately and "time" it with and without the patch applied.

Here is my simple benchmark.

I have used buildroot with qemu_ppc64_pseries_defconfig configuration.

After successfull rootfs image build I patched inittab for halting-after-boot:

output/images/rootfs.ext2/etc/inittab 2014-11-06 10:20:57.089421643 +0300 renamed from output/images/rootfs.ext2/etc/inittab 2014-11-06 10:21:25.024198993 +0300 +3 -2
@@ -23,10 +23,11 @@
 # now run any rc scripts
 ::sysinit:/etc/init.d/rcS
 
-::askfirst:-/bin/sh
+::sysinit:/sbin/halt
+#::askfirst:-/bin/sh
 
 # Put a getty on the serial port
-hvc0::respawn:/sbin/getty -L  hvc0 115200 vt100 # GENERIC_SERIAL
+#hvc0::respawn:/sbin/getty -L  hvc0 115200 vt100 # GENERIC_SERIAL
 
 # Stuff to do for the 3-finger salute
 ::ctrlaltdel:/sbin/reboot

Here is my qemu cmdline:

buildroot$ time ~/qemu.git/ppc64-softmmu/qemu-system-ppc64 -M pseries -cpu POWER7 -m 256 -kernel output/images/vmlinux -append 'console=hvc0 root=/dev/sda' -drive file=output/images/rootfs.ext2,if=scsi,index=0 -serial stdio -nographic -monitor none

I use my 'not-very-busy' AMD Opteron 6176 SE-based server for testing.

Three 'time' command outputs; qemu with "qemu-log: add log category for MMU info" patch:

    real    0m39.744s
    user    0m36.940s
    sys     0m1.216s
    real    0m39.552s
    user    0m37.200s
    sys     0m0.924s
    real    0m39.585s
    user    0m37.340s
    sys     0m0.704s

Three 'time' command outputs; qemu without "qemu-log: add log category for MMU info" patch:

    real    0m39.732s
    user    0m37.484s
    sys     0m0.756s
    real    0m40.077s
    user    0m37.920s
    sys     0m0.744s
    real    0m39.766s
    user    0m37.304s
    sys     0m1.032s

So the performance delta is less than experimental error.

--
Best regards,
  Antony Pavlov

#1 lore raw
Quoted 85 lines

Am 06.11.2014 um 09:11 schrieb Antony Pavlov <[email protected]>:

Quoted 14 lines
Quoted 14 lines

Running barebox on qemu-system-mips* with '-d unimp' overloads stderr by very very many mips_cpu_handle_mmu_fault() messages:

mips_cpu_handle_mmu_fault address=b80003fd ret 0 physical 00000000180003fd
prot 3
mips_cpu_handle_mmu_fault address=a0800884 ret 0 physical 0000000000800884
prot 3
mips_cpu_handle_mmu_fault pc a080cd80 ad b80003fd rw 0 mmu_idx 0

So it's very difficult to find LOG_UNIMP message.

The mips_cpu_handle_mmu_fault() messages appears on enabling ANY logging! It's not very handy.

Quoted 8 lines
Quoted 4 lines

Adding separate log category for *_cpu_handle_mmu_fault() logging fixes the problem.

Have you benchmarked the performance delta with this patch applied? Just boot up a random small PPC guest that shuts down immediately and "time" it with and without the patch applied.

Here is my simple benchmark.

I have used buildroot with qemu_ppc64_pseries_defconfig configuration.

After successfull rootfs image build I patched inittab for halting-after-boot:

output/images/rootfs.ext2/etc/inittab 2014-11-06 10:20:57.089421643 +0300 renamed from output/images/rootfs.ext2/etc/inittab 2014-11-06 10:21:25.024198993 +0300 +0 -0
@@ -23,10 +23,11 @@
 # now run any rc scripts

::sysinit:/etc/init.d/rcS

-::askfirst:-/bin/sh
+::sysinit:/sbin/halt
+#::askfirst:-/bin/sh

# Put a getty on the serial port

output/images/rootfs.ext2/etc/inittab 2014-11-06 10:20:57.089421643 +0300 renamed from output/images/rootfs.ext2/etc/inittab 2014-11-06 10:21:25.024198993 +0300 +1 -1
-hvc0::respawn:/sbin/getty -L  hvc0 115200 vt100 # GENERIC_SERIAL
+#hvc0::respawn:/sbin/getty -L  hvc0 115200 vt100 # GENERIC_SERIAL

# Stuff to do for the 3-finger salute
::ctrlaltdel:/sbin/reboot

Here is my qemu cmdline:

buildroot$ time ~/qemu.git/ppc64-softmmu/qemu-system-ppc64 -M pseries -cpu POWER7 -m 256 -kernel output/images/vmlinux -append 'console=hvc0 root=/dev/sda' -drive file=output/images/rootfs.ext2,if=scsi,index=0 -serial stdio -nographic -monitor none

I use my 'not-very-busy' AMD Opteron 6176 SE-based server for testing.

Three 'time' command outputs; qemu with "qemu-log: add log category for MMU info" patch:

   real    0m39.744s
   user    0m36.940s
   sys     0m1.216s
   real    0m39.552s
   user    0m37.200s
   sys     0m0.924s
   real    0m39.585s
   user    0m37.340s
   sys     0m0.704s

Three 'time' command outputs; qemu without "qemu-log: add log category for MMU info" patch:

   real    0m39.732s
   user    0m37.484s
   sys     0m0.756s
   real    0m40.077s
   user    0m37.920s
   sys     0m0.744s
Quoted 6 lines
   real    0m39.766s
   user    0m37.304s
   sys     0m1.032s

So the performance delta is less than experimental error.

Ok, works for me then :).

Alex