Skip to contentSkip to conversation

ppc-for-6.1 queue 20210713

GIT PULL Applied David Gibson 4 participants 12 messages Jul 13, 2021 – Jul 20, 2021

lore
Share & tools
lore
#0 lore raw

The following changes since commit 57e28d34c0cb04abf7683ac6a12c87ede447c320:

Merge remote-tracking branch 'remotes/cohuck-gitlab/tags/s390x-20210708' into staging (2021-07-12 19:15:11 +0100)

are available in the Git repository at:

https://gitlab.com/dgibson/qemu.git tags/ppc-for-6.1-20210713

for you to fetch changes up to c785a40179b10ce2d7a4afdb04f63c98d53a1756:

mv64361: Remove extra break from a switch case (2021-07-13 10:12:17 +1000)

----------------------------------------------------------------
ppc patch queue 2021-07-13

I thought I'd sent the last PR before the 6.1 soft freeze, but unfortunately I need one more. This last minute one puts in a SLOF update, along with a couple of bugfixes.

----------------------------------------------------------------
Alexey Kardashevskiy (1):
pseries: Update SLOF firmware image

BALATON Zoltan (2):
ppc/pegasos2: Allow setprop in VOF
mv64361: Remove extra break from a switch case

 hw/pci-host/mv64361.c |   1 -
 hw/ppc/pegasos2.c     |  10 ++++++++++
 pc-bios/README        |   2 +-
 pc-bios/slof.bin      | Bin 968888 -> 991744 bytes
 roms/SLOF             |   2 +-
 5 files changed, 12 insertions(+), 3 deletions(-)
#1 lore raw

[PULL 3/3] mv64361: Remove extra break from a switch case

From: BALATON Zoltan <[email protected]>

The switch case of writing PCI 1 IO base address had an extra break statement that made part of the code unreachable. This did not cause a problem as guests ususally leave this register at its default value.

Fixes dcdf98a9015 ("Add emulation of Marvell MV64361 PPC system

controller")

Reported-by Coverity (CID 1458135)

Message-Id: <[email protected]>

---
 hw/pci-host/mv64361.c | 1 -
 1 file changed, 1 deletion(-)
hw/pci-host/mv64361.c +0 -1
index 20510d8680..92b0f5d047 100644
@@ -687,7 +687,6 @@ static void mv64361_write(void *opaque, hwaddr addr, uint64_t val,
     case MV64340_PCI_1_IO_BASE_ADDR:
         s->pci[1].io_base = val & 0x30fffffULL;
         warn_swap_bit(val);
-        break;
         if (!(s->cpu_conf & BIT(27))) {
             s->pci[1].remap[4] = (val & 0xffffULL) << 16;
         }
Signature · 1 line
2.31.1
#2 lore raw

[PULL 1/3] ppc/pegasos2: Allow setprop in VOF

In reply to David Gibson

From: BALATON Zoltan <[email protected]>

Linux needs setprop to fix up the device tree, otherwise it's not finding devices and cannot boot. Since recent VOF change now we need to add a callback to allow this which is what this patch does.

Message-Id: <[email protected]>

---
 hw/ppc/pegasos2.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
hw/ppc/pegasos2.c +10 -0
index 9a6ae867e4..9fad1854b1 100644
@@ -443,10 +443,17 @@ static target_ulong vhyp_encode_hpt_for_kvm_pr(PPCVirtualHypervisor *vhyp)
     return POWERPC_CPU(current_cpu)->env.spr[SPR_SDR1];
 }
 
+static bool pegasos2_setprop(MachineState *ms, const char *path,
+                             const char *propname, void *val, int vallen)
+{
+    return true;
+}
+
 static void pegasos2_machine_class_init(ObjectClass *oc, void *data)
 {
     MachineClass *mc = MACHINE_CLASS(oc);
     PPCVirtualHypervisorClass *vhc = PPC_VIRTUAL_HYPERVISOR_CLASS(oc);
+    VofMachineIfClass *vmc = VOF_MACHINE_CLASS(oc);
 
     mc->desc = "Genesi/bPlan Pegasos II";
     mc->init = pegasos2_init;
@@ -462,6 +469,8 @@ static void pegasos2_machine_class_init(ObjectClass *oc, void *data)
     vhc->cpu_exec_enter = vhyp_nop;
     vhc->cpu_exec_exit = vhyp_nop;
     vhc->encode_hpt_for_kvm_pr = vhyp_encode_hpt_for_kvm_pr;
+
+    vmc->setprop = pegasos2_setprop;
 }
 
 static const TypeInfo pegasos2_machine_info = {
@@ -471,6 +480,7 @@ static const TypeInfo pegasos2_machine_info = {
     .instance_size = sizeof(Pegasos2MachineState),
     .interfaces = (InterfaceInfo[]) {
         { TYPE_PPC_VIRTUAL_HYPERVISOR },
+        { TYPE_VOF_MACHINE_IF },
         { }
     },
 };
Signature · 1 line
2.31.1
#3 lore raw

[PULL 2/3] pseries: Update SLOF firmware image

In reply to David Gibson

From: Alexey Kardashevskiy <[email protected]>

This is all about TPM fixes and improvements.

The change log is:

Alexey Kardashevskiy (2):
tcgbios: Fix warnings
version: update to 20210711

Stefan Berger (9):
tcgbios: Fix details in log entries
tcgbios: Fix a typo in the sha256 algo description
tcgbios: Add implementations for sha1, sha384, and sha512
tpm: Add firmware API call 2HASH-EXT-LOG
tcgbios: Change format of S_CRTM_VERSION string to ucs-2
tcgbios: Use assembly for 32 bit rotr in sha256
tcgbios: Use The proper sha function for each PCR bank
tcgbios: Add test cases and test script to run them
Travis: Add script for running tests on Travis

Thomas Huth (1):
Fix bad header guard in version.h

---
 pc-bios/README   |   2 +-
 pc-bios/slof.bin | Bin 968888 -> 991744 bytes
 roms/SLOF        |   2 +-
 3 files changed, 2 insertions(+), 2 deletions(-)
pc-bios/README +1 -1
index d344e3bc1b..db39d757b0 100644
@@ -14,7 +14,7 @@
 - SLOF (Slimline Open Firmware) is a free IEEE 1275 Open Firmware
   implementation for certain IBM POWER hardware.  The sources are at
   https://github.com/aik/SLOF, and the image currently in qemu is
-  built from git tag qemu-slof-20210217.
+  built from git tag qemu-slof-20210711.
 
 - VOF (Virtual Open Firmware) is a minimalistic firmware to work with
   -machine pseries,x-vof=on. When enabled, the firmware acts as a slim shim and
pc-bios/slof.bin binary +0 -0
index 3f3918a9e144e12f6e39fab6fc1c9ec9cf9d2898..855521e650e8b33279dc3b9561952ae2ce7e9188 100644
GIT binary patch
roms/SLOF +1 -1
index 33a7322de1..dd0dcaa1c1 160000
@@ -1 +1 @@
-Subproject commit 33a7322de13e9dca4b38851a345a58d37e7a441d
+Subproject commit dd0dcaa1c1085c159ddab709c7f274b3917be8bd
Signature · 1 line
2.31.1
#4 lore raw
In reply to David Gibson
Quoted 13 lines · David Gibson

The following changes since commit 57e28d34c0cb04abf7683ac6a12c87ede447c320:

Merge remote-tracking branch 'remotes/cohuck-gitlab/tags/s390x-20210708' into staging (2021-07-12 19:15:11 +0100)

are available in the Git repository at:

https://gitlab.com/dgibson/qemu.git tags/ppc-for-6.1-20210713

for you to fetch changes up to c785a40179b10ce2d7a4afdb04f63c98d53a1756:

mv64361: Remove extra break from a switch case (2021-07-13 10:12:17 +1000)

Quoted 8 lines

----------------------------------------------------------------
ppc patch queue 2021-07-13

I thought I'd sent the last PR before the 6.1 soft freeze, but unfortunately I need one more. This last minute one puts in a SLOF update, along with a couple of bugfixes.

----------------------------------------------------------------

Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/6.1
for any user-visible changes.

-- PMM

#5 lore raw

R: [PULL 0/3] ppc-for-6.1 queue 20210713

In reply to David Gibson

Hi
i small report
im try to build last relesase on a PowerMac G5 quad on debian sid PPC64 but ld exit with an error:

gigi@debian:~/src/tags/ppc-for-6.1-20210713/build$ ninja
[3864/9215] Compiling C object libqemu-mipsel-softmmu.fa.p/target_mips_tcg_msa_helper.c.o
FAILED: libqemu-mipsel-softmmu.fa.p/target_mips_tcg_msa_helper.c.o
cc -Ilibqemu-mipsel-softmmu.fa.p -I. -I.. -Itarget/mips -I../target/mips -I../capstone/include/capstone -Iqapi -Itrace -Iui -Iui/shader -I/usr/include/pixman-1 -I/usr/include/glib-2.0 -I/usr/lib/powerpc64-linux-gnu/glib-2.0/include -fdiagnostics-color=auto -pipe -Wall -Winvalid-pch -Werror -std=gnu11 -O2 -g -isystem /home/gigi/src/tags/ppc-for-6.1-20210713/linux-headers -isystem linux-headers -iquote . -iquote /home/gigi/src/tags/ppc-for-6.1-20210713 -iquote /home/gigi/src/tags/ppc-for-6.1-20210713/include -iquote /home/gigi/src/tags/ppc-for-6.1-20210713/disas/libvixl -iquote /home/gigi/src/tags/ppc-for-6.1-20210713/tcg/ppc -pthread -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -Wold-style-declaration -Wold-style-definition -Wtype-limits -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wempty-body -Wnested-externs -Wendif-labels -Wexpansion-to-defined -Wimplicit-fallthrough=2 -Wno-missing-include-dirs -Wno-shift-negative-value -Wno-psabi -fstack-protector-strong -fPIE -isystem../linux-headers -isystemlinux-headers -DNEED_CPU_H '-DCONFIG_TARGET="mipsel-softmmu-config-target.h"' '-DCONFIG_DEVICES="mipsel-softmmu-config-devices.h"' -MD -MQ libqemu-mipsel-softmmu.fa.p/target_mips_tcg_msa_helper.c.o -MF libqemu-mipsel-softmmu.fa.p/target_mips_tcg_msa_helper.c.o.d -o libqemu-mipsel-softmmu.fa.p/target_mips_tcg_msa_helper.c.o -c ../target/mips/tcg/msa_helper.c
during RTL pass: sched1
../target/mips/tcg/msa_helper.c: In function ‘helper_msa_fmin_df’:
../target/mips/tcg/msa_helper.c:7536:1: internal compiler error: Errore di segmentazione
 7536 | }
      | ^
0x3fffa7b8e1c3 generic_start_main
../csu/libc-start.c:308
0x3fffa7b8e3d3 __libc_start_main
../sysdeps/unix/sysv/linux/powerpc/libc-start.c:98
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <file:///usr/share/doc/gcc-10/README.Bugs> for instructions.
[3869/9215] Compiling C object libqemu-mipsel-softmmu.fa.p/target_mips_tcg_translate.c.o
ninja: build stopped: subcommand failed.

Ciao
Luigi
________________________________
Da: Qemu-ppc <[email protected]> per conto di David Gibson <[email protected]>
Inviato: martedì 13 luglio 2021 04:07
A: [email protected] <[email protected]>; [email protected] <[email protected]>
Cc: [email protected] <[email protected]>; [email protected] <[email protected]>; David Gibson <[email protected]>
Oggetto: [PULL 0/3] ppc-for-6.1 queue 20210713

The following changes since commit 57e28d34c0cb04abf7683ac6a12c87ede447c320:

Merge remote-tracking branch 'remotes/cohuck-gitlab/tags/s390x-20210708' into staging (2021-07-12 19:15:11 +0100)

are available in the Git repository at:

https://gitlab.com/dgibson/qemu.git tags/ppc-for-6.1-20210713

for you to fetch changes up to c785a40179b10ce2d7a4afdb04f63c98d53a1756:

mv64361: Remove extra break from a switch case (2021-07-13 10:12:17 +1000)

----------------------------------------------------------------
ppc patch queue 2021-07-13

I thought I'd sent the last PR before the 6.1 soft freeze, but unfortunately I need one more. This last minute one puts in a SLOF update, along with a couple of bugfixes.

----------------------------------------------------------------
Alexey Kardashevskiy (1):
pseries: Update SLOF firmware image

BALATON Zoltan (2):
ppc/pegasos2: Allow setprop in VOF
mv64361: Remove extra break from a switch case

 hw/pci-host/mv64361.c |   1 -
 hw/ppc/pegasos2.c     |  10 ++++++++++
 pc-bios/README        |   2 +-
 pc-bios/slof.bin      | Bin 968888 -> 991744 bytes
 roms/SLOF             |   2 +-
 5 files changed, 12 insertions(+), 3 deletions(-)
#6 lore raw

Re: R: [PULL 0/3] ppc-for-6.1 queue 20210713

Quoted 3 lines · luigi burdo

Hi
i small report
im try to build last relesase on a PowerMac G5 quad on debian sid PPC64 but ld exit with an error:

Looks like it's gcc that crashes not ld. If you're sure it's not a hardware problem this may be a gcc bug. Sometimes big compile jobs can break if a machine is not stable but if it always fails at the same place and does not fail when compiling something else like a Linux kernel then it's more likely to be an actual bug. That function has some crazy use of macros so maybe it's exposing some bug in gcc. You could restrict what targets you build with --target-list configure option of QEMU if you don't actually need mips (compiling will be faster if you only build the targets you need) or you can try with clang if available in your distro to check if that works better. If this can be consistently reproduced you could try reporting it to gcc as the error message suggests. Probably not much QEMU can do about it.

Regards,
BALATON Zoltan

Quoted 4 lines
gigi@debian:~/src/tags/ppc-for-6.1-20210713/build$ ninja
[3864/9215] Compiling C object libqemu-mipsel-softmmu.fa.p/target_mips_tcg_msa_helper.c.o
FAILED: libqemu-mipsel-softmmu.fa.p/target_mips_tcg_msa_helper.c.o
cc -Ilibqemu-mipsel-softmmu.fa.p -I. -I.. -Itarget/mips -I../target/mips -I../capstone/include/capstone -Iqapi -Itrace -Iui -Iui/shader -I/usr/include/pixman-1 -I/usr/include/glib-2.0 -I/usr/lib/powerpc64-linux-gnu/glib-2.0/include -fdiagnostics-color=auto -pipe -Wall -Winvalid-pch -Werror -std=gnu11 -O2 -g -isystem /home/gigi/src/tags/ppc-for-6.1-20210713/linux-headers -isystem linux-headers -iquote . -iquote /home/gigi/src/tags/ppc-for-6.1-20210713 -iquote /home/gigi/src/tags/ppc-for-6.1-20210713/include -iquote /home/gigi/src/tags/ppc-for-6.1-20210713/disas/libvixl -iquote /home/gigi/src/tags/ppc-for-6.1-20210713/tcg/ppc -pthread -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -Wold-style-declaration -Wold-style-definition -Wtype-limits -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wempt

y-body -Wnested-externs -Wendif-labels -Wexpansion-to-defined -Wimplicit-fallthrough=2 -Wno-missing-include-dirs -Wno-shift-negative-value -Wno-psabi -fstack-protector-strong -fPIE -isystem../linux-headers -isystemlinux-headers -DNEED_CPU_H '-DCONFIG_TARGET="mipsel-softmmu-config-target.h"' '-DCONFIG_DEVICES="mipsel-softmmu-config-devices.h"' -MD -MQ libqemu-mipsel-softmmu.fa.p/target_mips_tcg_msa_helper.c.o -MF libqemu-mipsel-softmmu.fa.p/target_mips_tcg_msa_helper.c.o.d -o libqemu-mipsel-softmmu.fa.p/target_mips_tcg_msa_helper.c.o -c ../target/mips/tcg/msa_helper.c

Quoted 60 lines

during RTL pass: sched1
../target/mips/tcg/msa_helper.c: In function ‘helper_msa_fmin_df’:
../target/mips/tcg/msa_helper.c:7536:1: internal compiler error: Errore di segmentazione 7536 | }

     | ^

0x3fffa7b8e1c3 generic_start_main
../csu/libc-start.c:308
0x3fffa7b8e3d3 __libc_start_main ../sysdeps/unix/sysv/linux/powerpc/libc-start.c:98
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <file:///usr/share/doc/gcc-10/README.Bugs> for instructions. [3869/9215] Compiling C object libqemu-mipsel-softmmu.fa.p/target_mips_tcg_translate.c.o
ninja: build stopped: subcommand failed.

Ciao
Luigi
________________________________
Da: Qemu-ppc <[email protected]> per conto di David Gibson <[email protected]>
Inviato: martedì 13 luglio 2021 04:07
A: [email protected] <[email protected]>; [email protected] <[email protected]>
Cc: [email protected] <[email protected]>; [email protected] <[email protected]>; David Gibson <[email protected]>
Oggetto: [PULL 0/3] ppc-for-6.1 queue 20210713

The following changes since commit 57e28d34c0cb04abf7683ac6a12c87ede447c320:

Merge remote-tracking branch 'remotes/cohuck-gitlab/tags/s390x-20210708' into staging (2021-07-12 19:15:11 +0100)

are available in the Git repository at:

https://gitlab.com/dgibson/qemu.git tags/ppc-for-6.1-20210713

for you to fetch changes up to c785a40179b10ce2d7a4afdb04f63c98d53a1756:

mv64361: Remove extra break from a switch case (2021-07-13 10:12:17 +1000)

----------------------------------------------------------------
ppc patch queue 2021-07-13

I thought I'd sent the last PR before the 6.1 soft freeze, but unfortunately I need one more. This last minute one puts in a SLOF update, along with a couple of bugfixes.

----------------------------------------------------------------
Alexey Kardashevskiy (1):
pseries: Update SLOF firmware image

BALATON Zoltan (2):
ppc/pegasos2: Allow setprop in VOF
mv64361: Remove extra break from a switch case

hw/pci-host/mv64361.c |   1 -
hw/ppc/pegasos2.c     |  10 ++++++++++
pc-bios/README        |   2 +-
pc-bios/slof.bin      | Bin 968888 -> 991744 bytes
roms/SLOF             |   2 +-
5 files changed, 12 insertions(+), 3 deletions(-)
#7 lore raw

R: R: [PULL 0/3] ppc-for-6.1 queue 20210713

Hi Zoltan can be the gcc, in past on ppc we face the same kind of issue.
i will ask some other guys in the debian ppc ML if can try to build qemu and see if they have the same issue. in positive case we will report to the mantainer.
Thanks
Luigi

________________________________
Da: BALATON Zoltan <[email protected]>
Inviato: sabato 17 luglio 2021 21:55
A: luigi burdo <[email protected]>
Cc: David Gibson <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>
Oggetto: Re: R: [PULL 0/3] ppc-for-6.1 queue 20210713

Quoted 3 lines · luigi burdo

Hi
i small report
im try to build last relesase on a PowerMac G5 quad on debian sid PPC64 but ld exit with an error:

Looks like it's gcc that crashes not ld. If you're sure it's not a hardware problem this may be a gcc bug. Sometimes big compile jobs can break if a machine is not stable but if it always fails at the same place and does not fail when compiling something else like a Linux kernel then it's more likely to be an actual bug. That function has some crazy use of macros so maybe it's exposing some bug in gcc. You could restrict what targets you build with --target-list configure option of QEMU if you don't actually need mips (compiling will be faster if you only build the targets you need) or you can try with clang if available in your distro to check if that works better. If this can be consistently reproduced you could try reporting it to gcc as the error message suggests. Probably not much QEMU can do about it.

Regards,
BALATON Zoltan

Quoted 4 lines
gigi@debian:~/src/tags/ppc-for-6.1-20210713/build$ ninja
[3864/9215] Compiling C object libqemu-mipsel-softmmu.fa.p/target_mips_tcg_msa_helper.c.o
FAILED: libqemu-mipsel-softmmu.fa.p/target_mips_tcg_msa_helper.c.o
cc -Ilibqemu-mipsel-softmmu.fa.p -I. -I.. -Itarget/mips -I../target/mips -I../capstone/include/capstone -Iqapi -Itrace -Iui -Iui/shader -I/usr/include/pixman-1 -I/usr/include/glib-2.0 -I/usr/lib/powerpc64-linux-gnu/glib-2.0/include -fdiagnostics-color=auto -pipe -Wall -Winvalid-pch -Werror -std=gnu11 -O2 -g -isystem /home/gigi/src/tags/ppc-for-6.1-20210713/linux-headers -isystem linux-headers -iquote . -iquote /home/gigi/src/tags/ppc-for-6.1-20210713 -iquote /home/gigi/src/tags/ppc-for-6.1-20210713/include -iquote /home/gigi/src/tags/ppc-for-6.1-20210713/disas/libvixl -iquote /home/gigi/src/tags/ppc-for-6.1-20210713/tcg/ppc -pthread -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -Wold-style-declaration -Wold-style-definition -Wtype-limits -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wempt

y-body -Wnested-externs -Wendif-labels -Wexpansion-to-defined -Wimplicit-fallthrough=2 -Wno-missing-include-dirs -Wno-shift-negative-value -Wno-psabi -fstack-protector-strong -fPIE -isystem../linux-headers -isystemlinux-headers -DNEED_CPU_H '-DCONFIG_TARGET="mipsel-softmmu-config-target.h"' '-DCONFIG_DEVICES="mipsel-softmmu-config-devices.h"' -MD -MQ libqemu-mipsel-softmmu.fa.p/target_mips_tcg_msa_helper.c.o -MF libqemu-mipsel-softmmu.fa.p/target_mips_tcg_msa_helper.c.o.d -o libqemu-mipsel-softmmu.fa.p/target_mips_tcg_msa_helper.c.o -c ../target/mips/tcg/msa_helper.c

Quoted 60 lines

during RTL pass: sched1
../target/mips/tcg/msa_helper.c: In function ‘helper_msa_fmin_df’:
../target/mips/tcg/msa_helper.c:7536:1: internal compiler error: Errore di segmentazione 7536 | }

     | ^

0x3fffa7b8e1c3 generic_start_main
../csu/libc-start.c:308
0x3fffa7b8e3d3 __libc_start_main ../sysdeps/unix/sysv/linux/powerpc/libc-start.c:98
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <file:///usr/share/doc/gcc-10/README.Bugs> for instructions. [3869/9215] Compiling C object libqemu-mipsel-softmmu.fa.p/target_mips_tcg_translate.c.o
ninja: build stopped: subcommand failed.

Ciao
Luigi
________________________________
Da: Qemu-ppc <[email protected]> per conto di David Gibson <[email protected]>
Inviato: martedì 13 luglio 2021 04:07
A: [email protected] <[email protected]>; [email protected] <[email protected]>
Cc: [email protected] <[email protected]>; [email protected] <[email protected]>; David Gibson <[email protected]>
Oggetto: [PULL 0/3] ppc-for-6.1 queue 20210713

The following changes since commit 57e28d34c0cb04abf7683ac6a12c87ede447c320:

Merge remote-tracking branch 'remotes/cohuck-gitlab/tags/s390x-20210708' into staging (2021-07-12 19:15:11 +0100)

are available in the Git repository at:

https://gitlab.com/dgibson/qemu.git tags/ppc-for-6.1-20210713

for you to fetch changes up to c785a40179b10ce2d7a4afdb04f63c98d53a1756:

mv64361: Remove extra break from a switch case (2021-07-13 10:12:17 +1000)

----------------------------------------------------------------
ppc patch queue 2021-07-13

I thought I'd sent the last PR before the 6.1 soft freeze, but unfortunately I need one more. This last minute one puts in a SLOF update, along with a couple of bugfixes.

----------------------------------------------------------------
Alexey Kardashevskiy (1):
pseries: Update SLOF firmware image

BALATON Zoltan (2):
ppc/pegasos2: Allow setprop in VOF
mv64361: Remove extra break from a switch case

hw/pci-host/mv64361.c |   1 -
hw/ppc/pegasos2.c     |  10 ++++++++++
pc-bios/README        |   2 +-
pc-bios/slof.bin      | Bin 968888 -> 991744 bytes
roms/SLOF             |   2 +-
5 files changed, 12 insertions(+), 3 deletions(-)
#8 lore raw

R: R: [PULL 0/3] ppc-for-6.1 queue 20210713

In reply to BALATON Zoltan

I Zoltan,
i was able to build on my quad qemu, a ram bank was die and make me the issue with gcc.. this is what happening if i run pegasos 2 with --enable-kvm.

via_superio_cfg: unimplemented register 0xf2
via_superio_cfg: unimplemented register 0xf4
via_superio_cfg: unimplemented register 0xf6
via_superio_cfg: unimplemented register 0xf7
via_superio_cfg: unimplemented register 0xf4
via_superio_cfg: unimplemented register 0xf2
PegasosII Boot Strap (c) 2002-2003 bplan GmbH
Running on CPU PVR:000C0209
Enable L1 ICache... Done.
mv64361_write: Unimplemented register write 0x108 = 0
Reading W83194 : FAILED.
Setting Front Side Bus to 133MHz... FAILED.
Invalid access at addr 0xFE000E43, size 1, region '(null)', reason: rejected Invalid access at addr 0xFE000E44, size 1, region '(null)', reason: rejected Invalid access at addr 0xFE000E41, size 1, region '(null)', reason: rejected Invalid access at addr 0xFE000E42, size 1, region '(null)', reason: rejected Invalid access at addr 0xFE000E40, size 1, region '(null)', reason: rejected Configuring DDR...mv64361_write: Unimplemented register write 0x1494 = 291
mv64361_write: Unimplemented register write 0x1494 = 291
mv64361_write: Unimplemented register write 0x1494 = 291
mv64361_write: Unimplemented register write 0x1494 = 291

(tooo many i cut)

mv64361_write: Unimplemented register write 0x1494 = 291
mv64361_write: Unimplemented register write 0x1494 = 291
mv64361_write: Unimplemented register write 0x1494 = 291
mv64361_write: Unimplemented register write 0x1494 = 291
mv64361_write: Unimplemented register write 0x1480 = 300000
mv64361_write: Unimplemented register write 0x10 = 0
mv64361_write: Unimplemented register write 0x210 = 0
mv64361_write: Unimplemented register write 0x20 = 0
mv64361_write: Unimplemented register write 0x220 = 0
mv64361_write: Unimplemented register write 0x8 = 0
mv64361_write: Unimplemented register write 0x208 = 20000000
mv64361_write: Unimplemented register write 0x18 = 40000000
mv64361_write: Unimplemented register write 0x218 = 60000000
mv64361_write: Unimplemented register write 0x8 = 0
mv64361_write: Unimplemented register write 0x10 = 1fff
mv64361_write: Unimplemented register write 0x208 = 2000
mv64361_write: Unimplemented register write 0x210 = 1fff
mv64361_write: Unimplemented register write 0x1400 = 58200400
mv64361_write: Unimplemented register write 0x1404 = 24110051
mv64361_write: Unimplemented register write 0x1408 = 12813330
mv64361_write: Unimplemented register write 0x140c = 11b
mv64361_write: Unimplemented register write 0x1414 = 0
mv64361_write: Unimplemented register write 0x1410 = 12
mv64361_write: Unimplemented register write 0x1418 = 5
mv64361_read: Unimplemented register read 0x1418
mv64361_write: Unimplemented register write 0x1418 = 1
mv64361_read: Unimplemented register read 0x1418
mv64361_write: Unimplemented register write 0x1420 = 0
mv64361_write: Unimplemented register write 0x1418 = 4
mv64361_read: Unimplemented register read 0x1418
mv64361_write: Unimplemented register write 0x141c = 162
mv64361_write: Unimplemented register write 0x1418 = 3
mv64361_read: Unimplemented register read 0x1418
mv64361_write: Unimplemented register write 0x141c = 62
mv64361_write: Unimplemented register write 0x1418 = 3
mv64361_read: Unimplemented register read 0x1418
mv64361_write: Unimplemented register write 0x1418 = 1
mv64361_read: Unimplemented register read 0x1418
mv64361_write: Unimplemented register write 0x1418 = 2
mv64361_read: Unimplemented register read 0x1418
mv64361_write: Unimplemented register write 0x1418 = 2
mv64361_read: Unimplemented register read 0x1418
Done.
Configuring PCI0...mv64361_write: Unimplemented register write 0xc3c = ffffffff
mv64361_read: Unimplemented register read 0x10
mv64361_write: Unimplemented register write 0xc08 = 0
mv64361_read: Unimplemented register read 0x210
mv64361_write: Unimplemented register write 0xd08 = 0
mv64361_read: Unimplemented register read 0x20
mv64361_write: Unimplemented register write 0xc0c = 0
mv64361_read: Unimplemented register read 0x220
mv64361_write: Unimplemented register write 0xd0c = 0
mv64361_write: Unimplemented register write 0xc10 = 0
mv64361_write: Unimplemented register write 0xd10 = 0
mv64361_write: Unimplemented register write 0xd18 = 0
mv64361_write: Unimplemented register write 0xc14 = 0
mv64361_write: Unimplemented register write 0xd14 = 0
mv64361_write: Unimplemented register write 0xd1c = 0
mv64361_write: Unimplemented register write 0xd20 = 0
mv64361_write: Unimplemented register write 0xd24 = 0
mv64361_write: Unimplemented register write 0xd28 = 0
mv64361_write: Unimplemented register write 0xe00 = 0
Done.
Configuring PCI1...mv64361_write: Unimplemented register write 0xcbc = ffffffff
mv64361_read: Unimplemented register read 0x10
mv64361_write: Unimplemented register write 0xc88 = 0
mv64361_read: Unimplemented register read 0x210
mv64361_write: Unimplemented register write 0xd88 = 0
mv64361_read: Unimplemented register read 0x20
mv64361_write: Unimplemented register write 0xc8c = 0
mv64361_read: Unimplemented register read 0x220
mv64361_write: Unimplemented register write 0xd8c = 0
mv64361_write: Unimplemented register write 0xc90 = 0
mv64361_write: Unimplemented register write 0xd90 = 0
mv64361_write: Unimplemented register write 0xd98 = 0
mv64361_write: Unimplemented register write 0xc94 = 0
mv64361_write: Unimplemented register write 0xd94 = 0
mv64361_write: Unimplemented register write 0xd9c = 0
mv64361_write: Unimplemented register write 0xda0 = 0
mv64361_write: Unimplemented register write 0xda4 = 0
mv64361_write: Unimplemented register write 0xda8 = 0
mv64361_write: Unimplemented register write 0xe80 = 0
Done.
Configuring ETH...mv64361_write: Unimplemented register write 0x2290 = 3f
mv64361_read: Unimplemented register read 0x10
mv64361_write: Unimplemented register write 0x2204 = 0
mv64361_write: Unimplemented register write 0x2200 = 0
mv64361_read: Unimplemented register read 0x210
mv64361_write: Unimplemented register write 0x220c = 0
mv64361_write: Unimplemented register write 0x2208 = 0
mv64361_read: Unimplemented register read 0x20
mv64361_write: Unimplemented register write 0x2214 = 0
mv64361_write: Unimplemented register write 0x2210 = 0
mv64361_read: Unimplemented register read 0x220
mv64361_write: Unimplemented register write 0x221c = 0
mv64361_write: Unimplemented register write 0x2218 = 0
mv64361_write: Unimplemented register write 0x2220 = 0
mv64361_write: Unimplemented register write 0x2224 = 0
mv64361_write: Unimplemented register write 0x2228 = 0
mv64361_write: Unimplemented register write 0x222c = 0
mv64361_write: Unimplemented register write 0x2290 = 3f
mv64361_write: Unimplemented register write 0x2000 = e0
Done.
mv64361_write: Unimplemented register write 0xd9c = 1ffff000
mv64361_read: Unimplemented register read 0xcbc
mv64361_write: Unimplemented register write 0xcbc = 0
mv64361_write: Unimplemented register write 0xf008 = 30011
mv64361_write: Unimplemented register write 0x1d00 = 801f0030
mv64361_read: Unimplemented register read 0xc80
mv64361_write: Unimplemented register write 0xc80 = 0
mv64361_read: Unimplemented register read 0x1424
mv64361_write: Unimplemented register write 0x1424 = 1000000
Releasing IDE reset ... Done.
Configuring Legacy Devices
Initializing KBD...Invalid access at addr 0xFE0003F0, size 1, region '(null)', reason: rejected
Done.
via_superio_cfg: unimplemented register 0xf6
via_superio_cfg: unimplemented register 0xf7
via_superio_cfg: unimplemented register 0xf2
Invalid access at addr 0xFE000084, size 1, region '(null)', reason: rejected Invalid access at addr 0xFE000085, size 1, region '(null)', reason: rejected Invalid access at addr 0xFE000086, size 1, region '(null)', reason: rejected Invalid access at addr 0xFE000088, size 1, region '(null)', reason: rejected Invalid access at addr 0xFE00008C, size 1, region '(null)', reason: rejected Invalid access at addr 0xFE00008D, size 1, region '(null)', reason: rejected Invalid access at addr 0xFE00008E, size 1, region '(null)', reason: rejected Testing 10000000 Bytes, Pass: 00000000 Failed: 00000000

In dmesg i had many of this.

[ 3634.418495] kvmppc_exit_pr_progint: emulation at 700 failed (00000700)
[ 3634.418525] Couldn't emulate instruction 0x00000700 (op 0 xop 896)
[ 3634.418551] Couldn't emulate instruction 0x00000700 (op 0 xop 896)
[ 3634.418577] Couldn't emulate instruction 0x00000700 (op 0 xop 896)
[ 3634.418603] Couldn't emulate instr...

___
i will build latest linux kernel and do new test. thanks
Luigi

________________________________
Da: BALATON Zoltan <[email protected]>
Inviato: sabato 17 luglio 2021 21:55
A: luigi burdo <[email protected]>
Cc: David Gibson <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>
Oggetto: Re: R: [PULL 0/3] ppc-for-6.1 queue 20210713

Quoted 3 lines · luigi burdo

Hi
i small report
im try to build last relesase on a PowerMac G5 quad on debian sid PPC64 but ld exit with an error:

Looks like it's gcc that crashes not ld. If you're sure it's not a hardware problem this may be a gcc bug. Sometimes big compile jobs can break if a machine is not stable but if it always fails at the same place and does not fail when compiling something else like a Linux kernel then it's more likely to be an actual bug. That function has some crazy use of macros so maybe it's exposing some bug in gcc. You could restrict what targets you build with --target-list configure option of QEMU if you don't actually need mips (compiling will be faster if you only build the targets you need) or you can try with clang if available in your distro to check if that works better. If this can be consistently reproduced you could try reporting it to gcc as the error message suggests. Probably not much QEMU can do about it.

Regards,
BALATON Zoltan

Quoted 4 lines
gigi@debian:~/src/tags/ppc-for-6.1-20210713/build$ ninja
[3864/9215] Compiling C object libqemu-mipsel-softmmu.fa.p/target_mips_tcg_msa_helper.c.o
FAILED: libqemu-mipsel-softmmu.fa.p/target_mips_tcg_msa_helper.c.o
cc -Ilibqemu-mipsel-softmmu.fa.p -I. -I.. -Itarget/mips -I../target/mips -I../capstone/include/capstone -Iqapi -Itrace -Iui -Iui/shader -I/usr/include/pixman-1 -I/usr/include/glib-2.0 -I/usr/lib/powerpc64-linux-gnu/glib-2.0/include -fdiagnostics-color=auto -pipe -Wall -Winvalid-pch -Werror -std=gnu11 -O2 -g -isystem /home/gigi/src/tags/ppc-for-6.1-20210713/linux-headers -isystem linux-headers -iquote . -iquote /home/gigi/src/tags/ppc-for-6.1-20210713 -iquote /home/gigi/src/tags/ppc-for-6.1-20210713/include -iquote /home/gigi/src/tags/ppc-for-6.1-20210713/disas/libvixl -iquote /home/gigi/src/tags/ppc-for-6.1-20210713/tcg/ppc -pthread -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -Wold-style-declaration -Wold-style-definition -Wtype-limits -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wempt

y-body -Wnested-externs -Wendif-labels -Wexpansion-to-defined -Wimplicit-fallthrough=2 -Wno-missing-include-dirs -Wno-shift-negative-value -Wno-psabi -fstack-protector-strong -fPIE -isystem../linux-headers -isystemlinux-headers -DNEED_CPU_H '-DCONFIG_TARGET="mipsel-softmmu-config-target.h"' '-DCONFIG_DEVICES="mipsel-softmmu-config-devices.h"' -MD -MQ libqemu-mipsel-softmmu.fa.p/target_mips_tcg_msa_helper.c.o -MF libqemu-mipsel-softmmu.fa.p/target_mips_tcg_msa_helper.c.o.d -o libqemu-mipsel-softmmu.fa.p/target_mips_tcg_msa_helper.c.o -c ../target/mips/tcg/msa_helper.c

Quoted 60 lines

during RTL pass: sched1
../target/mips/tcg/msa_helper.c: In function ‘helper_msa_fmin_df’:
../target/mips/tcg/msa_helper.c:7536:1: internal compiler error: Errore di segmentazione 7536 | }

     | ^

0x3fffa7b8e1c3 generic_start_main
../csu/libc-start.c:308
0x3fffa7b8e3d3 __libc_start_main ../sysdeps/unix/sysv/linux/powerpc/libc-start.c:98
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <file:///usr/share/doc/gcc-10/README.Bugs> for instructions. [3869/9215] Compiling C object libqemu-mipsel-softmmu.fa.p/target_mips_tcg_translate.c.o
ninja: build stopped: subcommand failed.

Ciao
Luigi
________________________________
Da: Qemu-ppc <[email protected]> per conto di David Gibson <[email protected]>
Inviato: martedì 13 luglio 2021 04:07
A: [email protected] <[email protected]>; [email protected] <[email protected]>
Cc: [email protected] <[email protected]>; [email protected] <[email protected]>; David Gibson <[email protected]>
Oggetto: [PULL 0/3] ppc-for-6.1 queue 20210713

The following changes since commit 57e28d34c0cb04abf7683ac6a12c87ede447c320:

Merge remote-tracking branch 'remotes/cohuck-gitlab/tags/s390x-20210708' into staging (2021-07-12 19:15:11 +0100)

are available in the Git repository at:

https://gitlab.com/dgibson/qemu.git tags/ppc-for-6.1-20210713

for you to fetch changes up to c785a40179b10ce2d7a4afdb04f63c98d53a1756:

mv64361: Remove extra break from a switch case (2021-07-13 10:12:17 +1000)

----------------------------------------------------------------
ppc patch queue 2021-07-13

I thought I'd sent the last PR before the 6.1 soft freeze, but unfortunately I need one more. This last minute one puts in a SLOF update, along with a couple of bugfixes.

----------------------------------------------------------------
Alexey Kardashevskiy (1):
pseries: Update SLOF firmware image

BALATON Zoltan (2):
ppc/pegasos2: Allow setprop in VOF
mv64361: Remove extra break from a switch case

hw/pci-host/mv64361.c |   1 -
hw/ppc/pegasos2.c     |  10 ++++++++++
pc-bios/README        |   2 +-
pc-bios/slof.bin      | Bin 968888 -> 991744 bytes
roms/SLOF             |   2 +-
5 files changed, 12 insertions(+), 3 deletions(-)
#9 lore raw

Re: R: R: [PULL 0/3] ppc-for-6.1 queue 20210713

Hello,

Quoted 2 lines · luigi burdo

i was able to build on my quad qemu, a ram bank was die and make me the issue with gcc.. this is what happening if i run pegasos 2 with --enable-kvm.

OK. Can you also show the full command so we know what options you used?

Quoted 5 lines

via_superio_cfg: unimplemented register 0xf2
via_superio_cfg: unimplemented register 0xf4
via_superio_cfg: unimplemented register 0xf6
via_superio_cfg: unimplemented register 0xf7
via_superio_cfg: unimplemented register 0xf4

Quoted 8 lines

via_superio_cfg: unimplemented register 0xf2
PegasosII Boot Strap (c) 2002-2003 bplan GmbH
Running on CPU PVR:000C0209
Enable L1 ICache... Done.
mv64361_write: Unimplemented register write 0x108 = 0
Reading W83194 : FAILED.
Setting Front Side Bus to 133MHz... FAILED.
Invalid access at addr 0xFE000E43, size 1, region '(null)', reason: rejected

So this shows that what I've seen on emulated KVM (running QEMU in a PPC Linux guest running on qemu-system-ppc64 -M mac99) does not match what real hardware does so that could be a bug in emulated KVM. As shown at the end of this message:

https://lists.nongnu.org/archive/html/qemu-ppc/2021-06/msg00146.html

I did not get the Invalid access warning but instead got endless kvm exits with the NIP not incrementing past the instruction doing this invalid access so probably there's a problem with handling invalid access with emulated KVM PR but I don't know where to look for that problem or how to fix it. It could also be a bug in guest kernel or QEMU, I'm not sure. Hope somebody with more knowledge about PPC KVM could give some hints. Aparently this is not a problem on real machine where it works as expected (the Invalid address is because we don't emulate this device but it's not needed and it boots without it and we get the same warnings with TCG).

Quoted 5 lines

Invalid access at addr 0xFE000E44, size 1, region '(null)', reason: rejected Invalid access at addr 0xFE000E41, size 1, region '(null)', reason: rejected Invalid access at addr 0xFE000E42, size 1, region '(null)', reason: rejected Invalid access at addr 0xFE000E40, size 1, region '(null)', reason: rejected Configuring DDR...mv64361_write: Unimplemented register write 0x1494 = 291

[...]

Quoted 7 lines

Releasing IDE reset ... Done.
Configuring Legacy Devices
Initializing KBD...Invalid access at addr 0xFE0003F0, size 1, region '(null)', reason: rejected
Done.
via_superio_cfg: unimplemented register 0xf6
via_superio_cfg: unimplemented register 0xf7
via_superio_cfg: unimplemented register 0xf2

Quoted 8 lines

Invalid access at addr 0xFE000084, size 1, region '(null)', reason: rejected Invalid access at addr 0xFE000085, size 1, region '(null)', reason: rejected Invalid access at addr 0xFE000086, size 1, region '(null)', reason: rejected Invalid access at addr 0xFE000088, size 1, region '(null)', reason: rejected Invalid access at addr 0xFE00008C, size 1, region '(null)', reason: rejected Invalid access at addr 0xFE00008D, size 1, region '(null)', reason: rejected Invalid access at addr 0xFE00008E, size 1, region '(null)', reason: rejected Testing 10000000 Bytes, Pass: 00000000 Failed: 00000000

So does it stop here or do you get to the firmware ok prompt?

Quoted 7 lines

In dmesg i had many of this.

[ 3634.418495] kvmppc_exit_pr_progint: emulation at 700 failed (00000700)
[ 3634.418525] Couldn't emulate instruction 0x00000700 (op 0 xop 896)
[ 3634.418551] Couldn't emulate instruction 0x00000700 (op 0 xop 896)
[ 3634.418577] Couldn't emulate instruction 0x00000700 (op 0 xop 896)
[ 3634.418603] Couldn't emulate instr...

This looks like we're getting Program Exceptions that's raised for invalid instructions so either it's going off track and tries to execute something it should not or could be that since we're running G4 code on a G5 there may be some differences so an instruction valid on G4 could be invalid on G5? KVM should handle these but not sure it does for all such cases or it works correctly as this was probably not tested for a while. We would need to know where it got the exception but the above logs don't show that. Was there anything before these? Maybe there's a kvm trace you can enable or adding -d int would show the exception but that would generate a lot of logs so you may need to filter out some unneeded ones to find the relevant logs. We'd need the address where it got the exception that make it go to 0x700 and the opcode at that address. The logs above only show that it got to 0x700 and got endless exceptions where as a handler for Program Exception should be at 0x700 but probably the firmware did not install one as it should not get such exceptions when working normally on a G4. Which firmware version are you using? The 1.1 from up050404 should work but the 1.2 from MorphOS storage is known to have a cmpd instruction that's invalid on G4 yet it works but may raise an exception or do something else on G5. With TCG that's fixed by this patch:

https://lists.nongnu.org/archive/html/qemu-ppc/2021-07/msg00207.html

that's not in master yet but if using that firmware version this may also cause problem in KVM if it does not do the same on G5 than on G4. I don't know if that's the case but it's a possibility. Once we find out what opcode is causing the program exception we can look up in the G5 and G4 manuals to see why it gets the exception and what can we do about it.

Quoted 1 line

i will build latest linux kernel and do new test.

Apart from that you could also try what happens with the sc 1 calls that is used but VOF when you use -kernel boot.img instead of -bios pegasos2.rom. I got the host QEMU crash with that when trying on emulated KVM but if it works on real hardware that could also be fixed in emulation so I can at least reproduce the problems you find on real hardware.

Regards,
BALATON Zoltan

#10 lore raw

R: R: R: [PULL 0/3] ppc-for-6.1 queue 20210713

Hi Zoltan,
i have same issue with kvm with only qemu-system-ppc -M pegasos2 -bios pegasos2.rom --enable-kvm and with this command line that work great on my PC (without kvm of course)

qemu-system-ppc -M pegasos2 -bios pegasos2.rom -device ati-vga,romfile="" -display sdl -rtc base=localtime -drive if=none,id=hd,file=/home/gigi/peggy2,format=raw -device ide-hd,drive=hd,bus=ide.0 -drive if=none,id=cd,file=/home/gigi/Chrysalis_3.15.iso -device ide-cd,drive=cd,bus=ide.0 -device AC97 -m 1024 -netdev user,id=mynet0 -device sungem,netdev=mynet0 -serial stdio --enable-kvm

about:

Quoted 1 line

So does it stop here or do you get to the firmware ok prompt?

never, with kvm enable no ok promt, without kvm enabled everything work ok (on G5 and PC).
with kvm enabled the seriel stdio log stop and because of this i check dmesg where there i found this never ending looping message:

Quoted 7 lines
[ 3634.418495] kvmppc_exit_pr_progint: emulation at 700 failed (00000700)
[ 3634.418525] Couldn't emulate instruction 0x00000700 (op 0 xop 896)
[ 3634.418551] Couldn't emulate instruction 0x00000700 (op 0 xop 896)
[ 3634.418577] Couldn't emulate instruction 0x00000700 (op 0 xop 896)
[ 3634.418603] Couldn't emulate instr...

Apart from that you could also try what happens with the sc 1 calls that

is used but VOF when you use -kernel boot.img instead of -bios

i will test kvm with VOF too and report

I think to build last linux kernel just because mine last is 5.04, and im just courious if somethig was fixed in last kernel for not make you creazy for notiing 🙂

Ciao
Lugii
________________________________
Da: BALATON Zoltan <[email protected]>
Inviato: martedì 20 luglio 2021 16:02
A: luigi burdo <[email protected]>
Cc: [email protected] <[email protected]>; [email protected] <[email protected]>
Oggetto: Re: R: R: [PULL 0/3] ppc-for-6.1 queue 20210713

Hello,

Quoted 2 lines · luigi burdo

i was able to build on my quad qemu, a ram bank was die and make me the issue with gcc.. this is what happening if i run pegasos 2 with --enable-kvm.

OK. Can you also show the full command so we know what options you used?

Quoted 5 lines

via_superio_cfg: unimplemented register 0xf2
via_superio_cfg: unimplemented register 0xf4
via_superio_cfg: unimplemented register 0xf6
via_superio_cfg: unimplemented register 0xf7
via_superio_cfg: unimplemented register 0xf4

Quoted 8 lines

via_superio_cfg: unimplemented register 0xf2
PegasosII Boot Strap (c) 2002-2003 bplan GmbH
Running on CPU PVR:000C0209
Enable L1 ICache... Done.
mv64361_write: Unimplemented register write 0x108 = 0
Reading W83194 : FAILED.
Setting Front Side Bus to 133MHz... FAILED.
Invalid access at addr 0xFE000E43, size 1, region '(null)', reason: rejected

So this shows that what I've seen on emulated KVM (running QEMU in a PPC Linux guest running on qemu-system-ppc64 -M mac99) does not match what real hardware does so that could be a bug in emulated KVM. As shown at the end of this message:

https://lists.nongnu.org/archive/html/qemu-ppc/2021-06/msg00146.html

I did not get the Invalid access warning but instead got endless kvm exits with the NIP not incrementing past the instruction doing this invalid access so probably there's a problem with handling invalid access with emulated KVM PR but I don't know where to look for that problem or how to fix it. It could also be a bug in guest kernel or QEMU, I'm not sure. Hope somebody with more knowledge about PPC KVM could give some hints. Aparently this is not a problem on real machine where it works as expected (the Invalid address is because we don't emulate this device but it's not needed and it boots without it and we get the same warnings with TCG).

Quoted 5 lines

Invalid access at addr 0xFE000E44, size 1, region '(null)', reason: rejected Invalid access at addr 0xFE000E41, size 1, region '(null)', reason: rejected Invalid access at addr 0xFE000E42, size 1, region '(null)', reason: rejected Invalid access at addr 0xFE000E40, size 1, region '(null)', reason: rejected Configuring DDR...mv64361_write: Unimplemented register write 0x1494 = 291

[...]

Quoted 7 lines

Releasing IDE reset ... Done.
Configuring Legacy Devices
Initializing KBD...Invalid access at addr 0xFE0003F0, size 1, region '(null)', reason: rejected
Done.
via_superio_cfg: unimplemented register 0xf6
via_superio_cfg: unimplemented register 0xf7
via_superio_cfg: unimplemented register 0xf2

Quoted 8 lines

Invalid access at addr 0xFE000084, size 1, region '(null)', reason: rejected Invalid access at addr 0xFE000085, size 1, region '(null)', reason: rejected Invalid access at addr 0xFE000086, size 1, region '(null)', reason: rejected Invalid access at addr 0xFE000088, size 1, region '(null)', reason: rejected Invalid access at addr 0xFE00008C, size 1, region '(null)', reason: rejected Invalid access at addr 0xFE00008D, size 1, region '(null)', reason: rejected Invalid access at addr 0xFE00008E, size 1, region '(null)', reason: rejected Testing 10000000 Bytes, Pass: 00000000 Failed: 00000000

So does it stop here or do you get to the firmware ok prompt?

Quoted 7 lines

In dmesg i had many of this.

[ 3634.418495] kvmppc_exit_pr_progint: emulation at 700 failed (00000700)
[ 3634.418525] Couldn't emulate instruction 0x00000700 (op 0 xop 896)
[ 3634.418551] Couldn't emulate instruction 0x00000700 (op 0 xop 896)
[ 3634.418577] Couldn't emulate instruction 0x00000700 (op 0 xop 896)
[ 3634.418603] Couldn't emulate instr...

This looks like we're getting Program Exceptions that's raised for invalid instructions so either it's going off track and tries to execute something it should not or could be that since we're running G4 code on a G5 there may be some differences so an instruction valid on G4 could be invalid on G5? KVM should handle these but not sure it does for all such cases or it works correctly as this was probably not tested for a while. We would need to know where it got the exception but the above logs don't show that. Was there anything before these? Maybe there's a kvm trace you can enable or adding -d int would show the exception but that would generate a lot of logs so you may need to filter out some unneeded ones to find the relevant logs. We'd need the address where it got the exception that make it go to 0x700 and the opcode at that address. The logs above only show that it got to 0x700 and got endless exceptions where as a handler for Program Exception should be at 0x700 but probably the firmware did not install one as it should not get such exceptions when working normally on a G4. Which firmware version are you using? The 1.1 from up050404 should work but the 1.2 from MorphOS storage is known to have a cmpd instruction that's invalid on G4 yet it works but may raise an exception or do something else on G5. With TCG that's fixed by this patch:

https://lists.nongnu.org/archive/html/qemu-ppc/2021-07/msg00207.html

that's not in master yet but if using that firmware version this may also cause problem in KVM if it does not do the same on G5 than on G4. I don't know if that's the case but it's a possibility. Once we find out what opcode is causing the program exception we can look up in the G5 and G4 manuals to see why it gets the exception and what can we do about it.

Quoted 1 line

i will build latest linux kernel and do new test.

Apart from that you could also try what happens with the sc 1 calls that is used but VOF when you use -kernel boot.img instead of -bios pegasos2.rom. I got the host QEMU crash with that when trying on emulated KVM but if it works on real hardware that could also be fixed in emulation so I can at least reproduce the problems you find on real hardware.

Regards,
BALATON Zoltan

#11 lore raw

Re: R: R: R: [PULL 0/3] ppc-for-6.1 queue 20210713

Quoted 1 line · luigi burdo

i have same issue with kvm with only qemu-system-ppc -M pegasos2 -bios pegasos2.rom --enable-kvm

Yes, OK as it already fails during the firmware then other options may not matter now only that you're using kvm and pegasos2 ROM.

Quoted 4 lines

and with this command line that work great on my PC (without kvm of course)

qemu-system-ppc -M pegasos2 -bios pegasos2.rom -device ati-vga,romfile="" -display sdl -rtc base=localtime -drive if=none,id=hd,file=/home/gigi/peggy2,format=raw -device ide-hd,drive=hd,bus=ide.0 -drive if=none,id=cd,file=/home/gigi/Chrysalis_3.15.iso -device ide-cd,drive=cd,bus=ide.0 -device AC97 -m 1024 -netdev user,id=mynet0 -device sungem,netdev=mynet0 -serial stdio --enable-kvm

The above command should be OK but I wonder if -device AC97 works? (I haven't tried it but this AC97 device is emulating an AC97 audio which is part of an Intel chipset and pegasos2 has one that is part of VIA VT8231 that I think has different register mappings so a driver expecting VIA AC97 may not work with Intel one unless it somehow detects that; in other words if sound is not working you can drop -device AC97 and instead look at implementing hw/audio/via-ac97.c similar to hw/audio/ac97.c but maching VIA VT8231 docs for registers, that should make sound work; other options may be usb-audio which does not work with mac99 but did not try with pegasos2 or passing through a real USB or PCI audio device). The other option is -netdev user,id=mynet0 -device sungem,netdev=mynet0 which I think is stating the default as user networking is the default so you could shorten it to just -device sungem with the same result (or several other network devices are available as sungem is usually appears on Mac or Sun machines not as PCI card but if it works then that does not matter). Using the long form may only make sense if you want something else than user, like tap when you need a -netdev option to enable that instead of user. These are just some comments to simplify the command line, not relevant to the problem why it's not working.

Quoted 9 lines

about:

Quoted 1 line

So does it stop here or do you get to the firmware ok prompt?

never, with kvm enable no ok promt, without kvm enabled everything work ok (on G5 and PC).
with kvm enabled the seriel stdio log stop and because of this i check dmesg where there i found this never ending looping message:

Quoted 5 lines
[ 3634.418495] kvmppc_exit_pr_progint: emulation at 700 failed (00000700)
[ 3634.418525] Couldn't emulate instruction 0x00000700 (op 0 xop 896)
[ 3634.418551] Couldn't emulate instruction 0x00000700 (op 0 xop 896)
[ 3634.418577] Couldn't emulate instruction 0x00000700 (op 0 xop 896)
[ 3634.418603] Couldn't emulate instr...

Yes, this happens because it gets an unexpected Program Exception trying to execute something in the ROM that raises this exception which then jumps to 0x700 but there's no handler there which then results in another Program Exception due to trying to execute garbage at 0x700 which then repeats endlessly. The real problem is why we get here, that is the first exception and what opcode caused that. So should find a way to find that out. I'm not sure what works with KVM (TCG just logs the invalid instruction with -d guest_errors but KVM runs the code on real CPU so that will take the exception. If there's no kvm log before the above line and -d int or enabling some kvm traces does not help either than we may need to attach a gdb and break on 0x700 then get a backtrace to find the address it's coming from and see what's there. There's some docs here: https://qemu-project.gitlab.io/qemu/system/gdb.html but basically add -s -S to the command line, then QEMU won't start running but wait for gdb to connect. From another window start gdb and type 'target remote localhost:1234' which should then attach to the guest in QEMU. Then you can examine the VM from gdb or debug it. E.g. set breakpint: b *0x700, start vm: c (for continue), then when you get a breakpoint hit you may be able to get more info with bt (for backtrace) or info registers. The only difference from debugging a normal program is that you won't have the executable so no symbols so you have to write addresses as *0x<address> otherwise it complains about unknown symbol as it tries to interpret it as a function or variable name. (If you do this on a machine that's another architecture like running qemu-system-ppc on x86_64 host then you need a cross-gdb that supports the guest arch but here we're debugging KVM VM on same arch host so the host gdb should work.)

Quoted 6 lines
Quoted 1 line

Apart from that you could also try what happens with the sc 1 calls that

is used but VOF when you use -kernel boot.img instead of -bios

i will test kvm with VOF too and report

I think to build last linux kernel just because mine last is 5.04, and im just courious if somethig was fixed in last kernel for not make you creazy for notiing 🙂

You can try. Running the latest kernel is useful if we find something in KVM that needs to be reported but otherwise I'm not sure how much changes were made to this recently so don't think it would matter but testing with latest version is always a good idea to at least not chase already fixed bugs.

Regards,
BALATON Zoltan