On Sat, 31 Oct 2020 16:53:24 +1100
Alexey Kardashevskiy <a...@ozlabs.ru> wrote:

> Has anyone at least tried this, or everybody is busy  KVMforuming? :)
> 

Yeah virtualKVMforuming :)

I had tried when you posted this v10 but I didn't get far at the time,
because the kernel I was passing didn't want to boot and then I got
distracted by more urgent work... so I just gave a try on my laptop 
(fedora32 with gcc-10.2.1-6.fc32.x86_64) and:

[36/945] Compiling C object 
libqemu-ppc64-softmmu.fa.p/hw_ppc_spapr_of_client.c.o
FAILED: libqemu-ppc64-softmmu.fa.p/hw_ppc_spapr_of_client.c.o 
cc -Ilibqemu-ppc64-softmmu.fa.p -I. -I../.. -Itarget/ppc -I../../target/ppc 
-Itrace -Iqapi -Iui -Iui/shader -I/usr/include/capstone -I/usr/include/pixman-1 
-I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -fdiagnostics-color=auto 
-pipe -Wall -Winvalid-pch -Werror -std=gnu99 -O2 -g -U_FORTIFY_SOURCE 
-D_FORTIFY_SOURCE=2 -m64 -mcx16 -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 -Wno-missing-include-dirs 
-Wno-shift-negative-value -Wno-psabi -fstack-protector-strong -isystem 
/home/greg/Work/qemu/qemu-ppc/linux-headers -isystem linux-headers -iquote 
/home/greg/Work/qemu/qemu-ppc/tcg/i386 -iquote . -iquote 
/home/greg/Work/qemu/qemu-ppc -iquote /home/greg/Work/qemu/qemu-ppc/accel/tcg 
-iquote /home/greg/Work/qemu/qemu-ppc/include -iquote 
/home/greg/Work/qemu/qemu-ppc/disas/libvixl -pthread -fPIC 
-isystem../../linux-headers -isystemlinux-headers -DNEED_CPU_H 
'-DCONFIG_TARGET="ppc64-softmmu-config-target.h"' 
'-DCONFIG_DEVICES="ppc64-softmmu-config-devices.h"' -MD -MQ 
libqemu-ppc64-softmmu.fa.p/hw_ppc_spapr_of_client.c.o -MF 
libqemu-ppc64-softmmu.fa.p/hw_ppc_spapr_of_client.c.o.d -o 
libqemu-ppc64-softmmu.fa.p/hw_ppc_spapr_of_client.c.o -c 
../../hw/ppc/spapr_of_client.c
../../hw/ppc/spapr_of_client.c: In function ‘prop_format’:
../../hw/ppc/spapr_of_client.c:131:29: error: comparison is always false due to 
limited range of data type [-Werror=type-limits]
  131 |         if (*c < 0x20 || *c >= 0x80) {
      |                             ^~

Fixed by:

-    const char *c;
+    const unsigned char *c;

../../hw/ppc/spapr_of_client.c: In function ‘spapr_h_of_client’:
../../hw/ppc/spapr_of_client.c:793:35: error: taking address of packed member 
of ‘struct prom_args’ may result in an unaligned pointer value 
[-Werror=address-of-packed-member]
  793 |                                   &pargs.args[nargs + 1]);
      |                                   ^~~~~~~~~~~~~~~~~~~~~~
../../hw/ppc/spapr_of_client.c:800:38: error: taking address of packed member 
of ‘struct prom_args’ may result in an unaligned pointer value 
[-Werror=address-of-packed-member]
  800 |                                      &pargs.args[nargs + 1]);
      |                                      ^~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Fixed by dropping QEMU_PACKED and ensuring we don't have unwanted padding:

-} QEMU_PACKED;
+};
+
+QEMU_BUILD_BUG_ON(sizeof(struct prom_args) != 13 * 4);

I'll resume my experiments later :)

Cheers,

--
Greg

Reply via email to