s390x and misc patches
Subsystems (3)
Hi Richard!
The following changes since commit 848a6caa88b9f082c89c9b41afa975761262981d:
Merge tag 'migration-20230602-pull-request' of https://gitlab.com/juan.quintela/qemu into staging (2023-06-02 17:33:29 -0700)
are available in the Git repository at:
https://gitlab.com/thuth/qemu.git tags/pull-request-2023-06-06
for you to fetch changes up to 1fb9bdaf59719c0d0c28043e58c8e3452fd6d7de:
linux-user: Emulate /proc/cpuinfo on s390x (2023-06-05 20:48:34 +0200)
----------------------------------------------------------------
* Fix emulated LCCB, LOCFHR, MXDB and MXDBR s390x instructions
* Fix the malta machine on s390x (big endian) hosts
* Emulate /proc/cpuinfo on s390x
* Remove pointless QOM casts
* Improve the inclusion logic for libkeyutils and ipmi-bt-test in meson.build
----------------------------------------------------------------
Camilla Conte (1):
gitlab-ci: Remove unused Python package
Ilya Leoshkevich (12):
target/s390x: Fix LCBB overwriting the top 32 bits
tests/tcg/s390x: Test LCBB
target/s390x: Fix LOCFHR taking the wrong half of R2
tests/tcg/s390x: Test LOCFHR
linux-user/s390x: Fix single-stepping SVC
tests/tcg/s390x: Test single-stepping SVC
target/s390x: Fix MXDB and MXDBR
tests/tcg/s390x: Test MXDB and MXDBR
s390x/tcg: Fix CPU address returned by STIDP
linux-user/elfload: Expose get_elf_hwcap() on s390x
linux-user/elfload: Introduce elf_hwcap_str() on s390x
linux-user: Emulate /proc/cpuinfo on s390xMax Fritz (1):
Add conditional dependency for libkeyutils
Philippe Mathieu-Daudé (2):
scripts: Add qom-cast-macro-clean-cocci-gen.py
bulk: Remove pointless QOM casts
Thomas Huth (2):
tests/qtest: Run ipmi-bt-test only if CONFIG_IPMI_EXTERN is set hw/mips/malta: Fix the malta machine on big endian hosts
MAINTAINERS | 1 + meson.build | 6 +- linux-user/loader.h | 5 ++ target/s390x/cpu_models.h | 10 ++- target/s390x/helper.h | 2 +- target/s390x/tcg/insn-data.h.inc | 8 +-- block/nbd.c | 4 +- chardev/char-pty.c | 2 +- hw/arm/musicpal.c | 2 +- hw/arm/xlnx-versal.c | 2 +- hw/display/vhost-user-gpu.c | 4 +- hw/intc/loongarch_extioi.c | 6 +- hw/m68k/q800.c | 2 +- hw/mips/malta.c | 4 +- hw/pci-host/bonito.c | 2 +- hw/ppc/pnv_lpc.c | 2 +- hw/ppc/pnv_occ.c | 2 +- hw/ppc/pnv_sbe.c | 2 +- hw/riscv/virt.c | 10 +-- hw/rx/rx62n.c | 2 +- hw/scsi/esp-pci.c | 18 ++--- hw/sparc/sun4m.c | 4 +- hw/virtio/virtio-mem-pci.c | 6 +- hw/virtio/virtio-pmem-pci.c | 6 +- linux-user/elfload.c | 29 +++++++- linux-user/s390x/cpu_loop.c | 9 +++ linux-user/syscall.c | 106 +++++++++++++++++++++++++++++- migration/fd.c | 4 +- migration/multifd.c | 2 +- migration/yank_functions.c | 4 +- nbd/client-connection.c | 2 +- nbd/server.c | 2 +- softmmu/qdev-monitor.c | 2 +- target/s390x/cpu_models.c | 4 +- target/s390x/tcg/fpu_helper.c | 5 +- target/s390x/tcg/translate.c | 8 +-- tests/tcg/s390x/lcbb.c | 51 ++++++++++++++ tests/tcg/s390x/locfhr.c | 29 ++++++++ tests/tcg/s390x/mxdb.c | 30 +++++++++ ui/vnc-ws.c | 6 +- .gitlab-ci.d/container-template.yml | 1 - scripts/qom-cast-macro-clean-cocci-gen.py | 49 ++++++++++++++ tests/qtest/meson.build | 3 +- tests/tcg/s390x/Makefile.target | 14 +++- tests/tcg/s390x/gdbstub/test-svc.py | 64 ++++++++++++++++++ tests/tcg/s390x/hello-s390x-asm.S | 20 ++++++ 46 files changed, 480 insertions(+), 76 deletions(-) create mode 100644 tests/tcg/s390x/lcbb.c create mode 100644 tests/tcg/s390x/locfhr.c create mode 100644 tests/tcg/s390x/mxdb.c create mode 100644 scripts/qom-cast-macro-clean-cocci-gen.py create mode 100644 tests/tcg/s390x/gdbstub/test-svc.py create mode 100644 tests/tcg/s390x/hello-s390x-asm.S
[PULL 02/18] tests/tcg/s390x: Test LCBB
From: Ilya Leoshkevich <[email protected]>
Add a test to prevent regressions.
Message-Id: <[email protected]>
--- tests/tcg/s390x/lcbb.c | 51 +++++++++++++++++++++++++++++++++ tests/tcg/s390x/Makefile.target | 1 + 2 files changed, 52 insertions(+) create mode 100644 tests/tcg/s390x/lcbb.c
tests/tcg/s390x/lcbb.c new file +51 -0
@@ -0,0 +1,51 @@ +/* +* Test the LCBB instruction. +* +* SPDX-License-Identifier: GPL-2.0-or-later +*/ +#include <assert.h> +#include <stdlib.h> + +static inline __attribute__((__always_inline__))void +lcbb (long *r1,void *dxb2,int m3,int *cc) +{ + asm("lcbb %[r1],%[dxb2],%[m3]\n" +"ipm %[cc]" + : [r1]"+r" (*r1), [cc]"=r" (*cc) + : [dxb2]"R" (*(char *)dxb2), [m3]"i" (m3) + :"cc" ); + *cc = (*cc >>28 ) &3 ; +} + +static char buf[0x1000] __attribute__((aligned(0x1000))); + +static inline __attribute__((__always_inline__))void +test_lcbb (void *p,int m3,int exp_r1,int exp_cc) +{ +long r1 =0xfedcba9876543210 ; +int cc; + +lcbb (&r1, p, m3, &cc); +assert (r1 == (0xfedcba9800000000 | exp_r1)); +assert (cc == exp_cc); +} + +int main (void ) +{ +test_lcbb (&buf[0 ],0 ,16 ,0 ); +test_lcbb (&buf[63 ],0 ,1 ,3 ); +test_lcbb (&buf[0 ],1 ,16 ,0 ); +test_lcbb (&buf[127 ],1 ,1 ,3 ); +test_lcbb (&buf[0 ],2 ,16 ,0 ); +test_lcbb (&buf[255 ],2 ,1 ,3 ); +test_lcbb (&buf[0 ],3 ,16 ,0 ); +test_lcbb (&buf[511 ],3 ,1 ,3 ); +test_lcbb (&buf[0 ],4 ,16 ,0 ); +test_lcbb (&buf[1023 ],4 ,1 ,3 ); +test_lcbb (&buf[0 ],5 ,16 ,0 ); +test_lcbb (&buf[2047 ],5 ,1 ,3 ); +test_lcbb (&buf[0 ],6 ,16 ,0 ); +test_lcbb (&buf[4095 ],6 ,1 ,3 ); + +return EXIT_SUCCESS ; +}
tests/tcg/s390x/Makefile.target +1 -0
@@ -47,6 +47,7 @@ $(PGM_SPECIFICATION_TESTS): LDFLAGS+=pgm-specification-user.o TESTS += $(PGM_SPECIFICATION_TESTS) Z13_TESTS=vistr +Z13_TESTS+=lcbb $(Z13_TESTS): CFLAGS+=-march=z13 -O2 TESTS+=$(Z13_TESTS)
Signature · 1 line
2.31.1
[PULL 01/18] target/s390x: Fix LCBB overwriting the top 32 bits
In reply to Thomas HuthFrom: Ilya Leoshkevich <[email protected]>
LCBB is supposed to overwrite only the bottom 32 bits, but QEMU erroneously overwrites the entire register.
Message-Id: <[email protected]>
--- target/s390x/tcg/insn-data.h.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
target/s390x/tcg/insn-data.h.inc +1 -1
@@ -486,7 +486,7 @@ F(0xb343, LCXBR, RRE, Z, x2h, x2l, new_P, x1_P, negf128, f128, IF_BFP) F(0xb373, LCDFR, RRE, FPSSH, 0, f2, new, f1, negf64, 0, IF_AFP1 | IF_AFP2) /* LOAD COUNT TO BLOCK BOUNDARY */ - C(0xe727, LCBB, RXE, V, la2, 0, r1, 0, lcbb, 0) + C(0xe727, LCBB, RXE, V, la2, 0, new, r1_32, lcbb, 0) /* LOAD HALFWORD */ C(0xb927, LHR, RRE, EI, 0, r2_16s, 0, r1_32, mov2, 0) C(0xb907, LGHR, RRE, EI, 0, r2_16s, 0, r1, mov2, 0)
Signature · 1 line
2.31.1
[PULL 04/18] tests/tcg/s390x: Test LOCFHR
In reply to Thomas HuthFrom: Ilya Leoshkevich <[email protected]>
Add a small test to prevent regressions.
Message-Id: <[email protected]>
--- tests/tcg/s390x/locfhr.c | 29 +++++++++++++++++++++++++++++ tests/tcg/s390x/Makefile.target | 1 + 2 files changed, 30 insertions(+) create mode 100644 tests/tcg/s390x/locfhr.c
tests/tcg/s390x/locfhr.c new file +29 -0
@@ -0,0 +1,29 @@ +/* +* Test the LOCFHR instruction. +* +* SPDX-License-Identifier: GPL-2.0-or-later +*/ +#include <assert.h> +#include <stdlib.h> + +static inline __attribute__((__always_inline__))long +locfhr (long r1,long r2,int m3,int cc) +{ + cc <<=28 ; + asm("spm %[cc]\n" +"locfhr %[r1],%[r2],%[m3]\n" + : [r1]"+r" (r1) + : [cc]"r" (cc), [r2]"r" (r2), [m3]"i" (m3) + :"cc" ); +return r1; +} + +int main (void ) +{ +assert (locfhr (0x1111111122222222 ,0x3333333344444444 ,8 ,0 ) == +0x3333333322222222 ); +assert (locfhr (0x5555555566666666 ,0x7777777788888888 ,11 ,1 ) == +0x5555555566666666 ); + +return EXIT_SUCCESS ; +}
tests/tcg/s390x/Makefile.target +1 -0
@@ -48,6 +48,7 @@ TESTS += $(PGM_SPECIFICATION_TESTS) Z13_TESTS=vistr Z13_TESTS+=lcbb +Z13_TESTS+=locfhr $(Z13_TESTS): CFLAGS+=-march=z13 -O2 TESTS+=$(Z13_TESTS)
Signature · 1 line
2.31.1
[PULL 17/18] linux-user/elfload: Introduce elf_hwcap_str() on s390x
In reply to Thomas HuthFrom: Ilya Leoshkevich <[email protected]>
It is required for implementing /proc/cpuinfo emulation.
Message-Id: <[email protected]>
--- linux-user/loader.h | 1 + linux-user/elfload.c | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+)
linux-user/loader.h +1 -0
@@ -58,6 +58,7 @@ extern unsigned long guest_stack_size;#ifdef TARGET_S390X uint32_t get_elf_hwcap (void ); +const char *elf_hwcap_str (uint32_t bit);#endif #endif /* LINUX_USER_LOADER_H */
linux-user/elfload.c +27 -0
@@ -1605,6 +1605,33 @@ uint32_t get_elf_hwcap(void)return hwcap; } +const char *elf_hwcap_str (uint32_t bit) +{ +static const char *hwcap_str[] = { + [HWCAP_S390_ESAN3 ] ="esan3" , + [HWCAP_S390_ZARCH ] ="zarch" , + [HWCAP_S390_STFLE ] ="stfle" , + [HWCAP_S390_MSA ] ="msa" , + [HWCAP_S390_LDISP ] ="ldisp" , + [HWCAP_S390_EIMM ] ="eimm" , + [HWCAP_S390_DFP ] ="dfp" , + [HWCAP_S390_HPAGE ] ="edat" , + [HWCAP_S390_ETF3EH ] ="etf3eh" , + [HWCAP_S390_HIGH_GPRS ] ="highgprs" , + [HWCAP_S390_TE ] ="te" , + [HWCAP_S390_VXRS ] ="vx" , + [HWCAP_S390_VXRS_BCD ] ="vxd" , + [HWCAP_S390_VXRS_EXT ] ="vxe" , + [HWCAP_S390_GS ] ="gs" , + [HWCAP_S390_VXRS_EXT2 ] ="vxe2" , + [HWCAP_S390_VXRS_PDE ] ="vxp" , + [HWCAP_S390_SORT ] ="sort" , + [HWCAP_S390_DFLT ] ="dflt" , + }; + +return bit <ARRAY_SIZE (hwcap_str) ? hwcap_str[bit] :NULL ; +} +static inline void init_thread (struct target_pt_regs *regs,struct image_info *infop) { regs->psw.addr = infop->entry;
Signature · 1 line
2.31.1
[PULL 07/18] Add conditional dependency for libkeyutils
In reply to Thomas HuthFrom: Max Fritz <[email protected]>
This modification enables better control over the inclusion of libkeyutils based on the configuration, enhancing the flexibility of the build system.
Message-Id: <[email protected]>
--- meson.build | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
meson.build +4 -2
@@ -1781,8 +1781,10 @@ if gnutls.found() tasn1 = dependency('libtasn1', method: 'pkg-config') endif -keyutils = dependency('libkeyutils', required: false, - method: 'pkg-config') +keyutils = not_found +if get_option('keyring').enabled() + keyutils = dependency('libkeyutils', required: false, method: 'pkg-config') +endif has_gettid = cc.has_function('gettid')
Signature · 1 line
2.31.1
[PULL 15/18] s390x/tcg: Fix CPU address returned by STIDP
In reply to Thomas HuthFrom: Ilya Leoshkevich <[email protected]>
In qemu-user-s390x, /proc/cpuinfo contains:
processor 0: version = 00, identification = 000000, machine = 8561 processor 1: version = 00, identification = 400000, machine = 8561
The highest nibble is supposed to contain the CPU address, but it's off by 2 bits. Fix the shift value and provide a symbolic constant for it.
With the fix we get:
processor 0: version = 00, identification = 000000, machine = 8561 processor 1: version = 00, identification = 100000, machine = 8561
Message-Id: <[email protected]>
--- target/s390x/cpu_models.h | 10 +++++++++- target/s390x/cpu_models.c | 4 ++-- 2 files changed, 11 insertions(+), 3 deletions(-)
target/s390x/cpu_models.h +9 -1
@@ -96,10 +96,18 @@ static inline bool s390_known_cpu_type(uint16_t type) {return s390_get_gen_for_cpu_type (type) !=0 ; } +#define CPU_ID_SHIFT 32 +#define CPU_ID_BITS 24 +/* +* When cpu_id_format is 0 (basic mode), the leftmost 4 bits of cpu_id contain +* the rightmost 4 bits of the physical CPU address. +*/ +#define CPU_PHYS_ADDR_BITS 4 +#define CPU_PHYS_ADDR_SHIFT (CPU_ID_SHIFT + CPU_ID_BITS - CPU_PHYS_ADDR_BITS)static inline uint64_t s390_cpuid_from_cpu_model (const S390CPUModel *model) {return ((uint64_t )model->cpu_ver <<56 ) | - ((uint64_t )model->cpu_id <<32 ) | + ((uint64_t )model->cpu_id <<CPU_ID_SHIFT ) | ((uint64_t )model->def->type <<16 ) | (model->def->gen ==7 ?0 : (uint64_t )model->cpu_id_format <<15 ); }
target/s390x/cpu_models.c +2 -2
@@ -607,8 +607,8 @@ void s390_realize_cpu_model(CPUState *cs, Error **errp)#if !defined(CONFIG_USER_ONLY ) cpu->env.cpuid =s390_cpuid_from_cpu_model (cpu->model);if (tcg_enabled ()) { -/* basic mode, write the cpu address into the first 4 bit of the ID */ - cpu->env.cpuid =deposit64 (cpu->env.cpuid,54 ,4 , cpu->env.core_id); + cpu->env.cpuid =deposit64 (cpu->env.cpuid,CPU_PHYS_ADDR_SHIFT , +CPU_PHYS_ADDR_BITS , cpu->env.core_id); }#endif }
Signature · 1 line
2.31.1
Re: [PULL 15/18] s390x/tcg: Fix CPU address returned by STIDP
Quoted 18 lines · Thomas Huth
From: Ilya Leoshkevich <[email protected]>
In qemu-user-s390x,
/proc/cpuinfocontains:processor 0: version = 00, identification = 000000, machine = 8561 processor 1: version = 00, identification = 400000, machine = 8561The highest nibble is supposed to contain the CPU address, but it's off by 2 bits. Fix the shift value and provide a symbolic constant for it.
With the fix we get:
processor 0: version = 00, identification = 000000, machine = 8561 processor 1: version = 00, identification = 100000, machine = 8561Fixes 076d4d39b65f ("s390x/cpumodel: wire up cpu type + id for TCG")Reviewed-by David Hildenbrand <[email protected]>Signed-off-by Ilya Leoshkevich <[email protected]>
Quoted 6 lines
Message-Id: <[email protected]>
Signed-off-by Thomas Huth <[email protected]>--- target/s390x/cpu_models.h | 10 +++++++++- target/s390x/cpu_models.c | 4 ++-- 2 files changed, 11 insertions(+), 3 deletions(-)
Is it a -stable material too?
(applies cleanly to 7.2 and 8.0)
Thanks,
/mjt
Re: [PULL 15/18] s390x/tcg: Fix CPU address returned by STIDP
Quoted 33 lines · Michael Tokarev
Quoted 23 lines · Thomas Huth
From: Ilya Leoshkevich <[email protected]>
In qemu-user-s390x,
/proc/cpuinfocontains:processor 0: version = 00, identification = 000000, machine = 8561
processor 1: version = 00, identification = 400000, machine = 8561The highest nibble is supposed to contain the CPU address, but it's off
by 2 bits. Fix the shift value and provide a symbolic constant for it.With the fix we get:
processor 0: version = 00, identification = 000000, machine = 8561
processor 1: version = 00, identification = 100000, machine = 8561Fixes 076d4d39b65f ("s390x/cpumodel: wire up cpu type + id forTCG")
Quoted 8 lines
Reviewed-by David Hildenbrand <[email protected]>Signed-off-by Ilya Leoshkevich <[email protected]>Message-Id: <[email protected]>
Signed-off-by Thomas Huth <[email protected]>---
target/s390x/cpu_models.h| 10 +++++++++-
target/s390x/cpu_models.c| 4 ++--2 files changed, 11 insertions(+), 3 deletions(-)
Quoted 6 lines
Is it a -stable material too?
(applies cleanly to 7.2 and 8.0)Thanks,
/mjt
Yes, from my perspective, it would be good to put this into stable. I forgot to tag it, because the rest of the series was a new feature. Thanks for noticing!
[PULL 16/18] linux-user/elfload: Expose get_elf_hwcap() on s390x
In reply to Thomas HuthFrom: Ilya Leoshkevich <[email protected]>
It is required for implementing /proc/cpuinfo emulation.
Message-Id: <[email protected]>
--- linux-user/loader.h | 4 ++++ linux-user/elfload.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-)
linux-user/loader.h +4 -0
@@ -56,4 +56,8 @@ abi_long memcpy_to_target(abi_ulong dest, const void *src,extern unsigned long guest_stack_size; +#ifdef TARGET_S390X +uint32_t get_elf_hwcap (void ); +#endif +#endif /* LINUX_USER_LOADER_H */
linux-user/elfload.c +1 -1
@@ -1583,7 +1583,7 @@ static inline void init_thread(struct target_pt_regs *regs,#define GET_FEATURE (_feat, _hwcap) \ do { if (s390_has_feat(_feat)) { hwcap |= _hwcap; } } while (0) -static uint32_t get_elf_hwcap (void ) +uint32_t get_elf_hwcap (void ) {/* * Let's assume we always have esan3 and zarch.
Signature · 1 line
2.31.1
[PULL 05/18] linux-user/s390x: Fix single-stepping SVC
In reply to Thomas HuthFrom: Ilya Leoshkevich <[email protected]>
Currently single-stepping SVC executes two instructions. The reason is that EXCP_DEBUG for the SVC instruction itself is masked by EXCP_SVC. Fix by re-raising EXCP_DEBUG.
Message-Id: <[email protected]>
--- linux-user/s390x/cpu_loop.c | 9 +++++++++ 1 file changed, 9 insertions(+)
linux-user/s390x/cpu_loop.c +9 -0
@@ -86,6 +86,15 @@ void cpu_loop(CPUS390XState *env) }else if (ret != -QEMU_ESIGRETURN ) { env->regs[2 ] = ret; } + +if (unlikely (cs->singlestep_enabled)) { +/* +* cpu_tb_exec() did not raise EXCP_DEBUG, because it has seen +* that EXCP_SVC was already pending. +*/ + cs->exception_index =EXCP_DEBUG ; + } +break ;case EXCP_DEBUG :
Signature · 1 line
2.31.1
[PULL 12/18] hw/mips/malta: Fix the malta machine on big endian hosts
In reply to Thomas HuthBooting a Linux kernel with the malta machine is currently broken on big endian hosts. The cpu_to_gt32 macro wants to byteswap a value for little endian targets only, but uses the wrong way to do this:
cpu_to_[lb]e32 works the other way round on big endian hosts! Fix it by using the same ways on both, big and little endian hosts.
Message-Id: <[email protected]>
--- hw/mips/malta.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
hw/mips/malta.c +2 -2
@@ -629,9 +629,9 @@ static void bl_setup_gt64120_jump_kernel(void **p, uint64_t run_addr,/* Bus endianess is always reversed */ #if TARGET_BIG_ENDIAN -#define cpu_to_gt32 cpu_to_le32 +#define cpu_to_gt32 (x) (x)#else -#define cpu_to_gt32 cpu_to_be32 +#define cpu_to_gt32 (x) bswap32(x)#endif /* setup MEM-to-PCI0 mapping as done by YAMON */
Signature · 1 line
2.31.1
[PULL 03/18] target/s390x: Fix LOCFHR taking the wrong half of R2
In reply to Thomas HuthFrom: Ilya Leoshkevich <[email protected]>
LOCFHR should write top-to-top, but QEMU erroneously writes bottom-to-top.
Message-Id: <[email protected]>
--- target/s390x/tcg/insn-data.h.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
target/s390x/tcg/insn-data.h.inc +1 -1
@@ -564,7 +564,7 @@ C(0xec46, LOCGHI, RIE_g, LOC2, r1, i2, r1, 0, loc, 0) C(0xec4e, LOCHHI, RIE_g, LOC2, r1_sr32, i2, new, r1_32h, loc, 0) /* LOAD HIGH ON CONDITION */ - C(0xb9e0, LOCFHR, RRF_c, LOC2, r1_sr32, r2, new, r1_32h, loc, 0) + C(0xb9e0, LOCFHR, RRF_c, LOC2, r1_sr32, r2_sr32, new, r1_32h, loc, 0) C(0xebe0, LOCFH, RSY_b, LOC2, r1_sr32, m2_32u, new, r1_32h, loc, 0) /* LOAD PAIR DISJOINT */ D(0xc804, LPD, SSF, ILA, 0, 0, new_P, r3_P32, lpd, 0, MO_TEUL)
Signature · 1 line
2.31.1
[PULL 18/18] linux-user: Emulate /proc/cpuinfo on s390x
In reply to Thomas HuthFrom: Ilya Leoshkevich <[email protected]>
Some s390x userspace programs are confused when seeing a foreign /proc/cpuinfo [1]. Add the emulation for s390x; follow the respective kernel code structure where possible.
Output example:
vendor_id : IBM/S390
# processors : 12
bogomips per cpu: 13370.00
max thread id : 0
features : esan3 zarch stfle msa
facilities : 0 1 2 3 4 7 9 16 17 18 19 21 22 24 25 27 30 31 32 33 34 35 37 40 41 45 49 51 52 53 57 58 61 69 71 72 75 76 77 129 130 131 135 138 146 148
processor 0: version = 00, identification = 000000, machine = 8561 processor 1: version = 00, identification = 100000, machine = 8561 [...]
cpu number : 0
version : 00
identification : 000000
machine : 8561
cpu number : 1
version : 00
identification : 100000
machine : 8561
[...]
[1] https://bugzilla.redhat.com/show_bug.cgi?id=2211472
Message-Id: <[email protected]>
--- linux-user/syscall.c | 106 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 104 insertions(+), 2 deletions(-)
linux-user/syscall.c +104 -2
@@ -8232,7 +8232,7 @@ void target_exception_dump(CPUArchState *env, const char *fmt, int code)#if HOST_BIG_ENDIAN !=TARGET_BIG_ENDIAN || \ defined(TARGET_SPARC ) || defined(TARGET_M68K ) || defined(TARGET_HPPA ) || \ - defined(TARGET_RISCV ) + defined(TARGET_RISCV ) || defined(TARGET_S390X )static int is_proc (const char *filename,const char *entry) {return strcmp (filename, entry) ==0 ;
@@ -8339,6 +8339,107 @@ static int open_cpuinfo(CPUArchState *cpu_env, int fd) }#endif +#if defined(TARGET_S390X ) +/* +* Emulate what a Linux kernel running in qemu-system-s390x -M accel=tcg would +* show in /proc/cpuinfo. +* +* Skip the following in order to match the missing support in op_ecag(): +* - show_cacheinfo(). +* - show_cpu_topology(). +* - show_cpu_mhz(). +* +* Use fixed values for certain fields: +* - bogomips per cpu - from a qemu-system-s390x run. +* - max thread id = 0, since SMT / SIGP_SET_MULTI_THREADING is not supported. +* +* Keep the code structure close to arch/s390/kernel/processor.c. +*/ + +static void show_facilities (int fd) +{ +size_t sizeof_stfl_bytes =2048 ; + g_autofree uint8_t *stfl_bytes = g_new0(uint8_t, sizeof_stfl_bytes); +unsigned int bit; + +dprintf (fd,"facilities :" ); +s390_get_feat_block (S390_FEAT_TYPE_STFL , stfl_bytes); +for (bit =0 ; bit < sizeof_stfl_bytes *8 ; bit++) { +if (test_be_bit (bit, stfl_bytes)) { +dprintf (fd," %d" , bit); + } + } +dprintf (fd,"\n" ); +} + +static int cpu_ident (unsigned long n) +{ +return deposit32 (0 ,CPU_ID_BITS -CPU_PHYS_ADDR_BITS ,CPU_PHYS_ADDR_BITS , + n); +} + +static void show_cpu_summary (CPUArchState *cpu_env,int fd) +{ +S390CPUModel *model =env_archcpu (cpu_env)->model; +int num_cpus =sysconf (_SC_NPROCESSORS_ONLN); +uint32_t elf_hwcap =get_elf_hwcap (); +const char *hwcap_str; +int i; + +dprintf (fd,"vendor_id : IBM/S390\n" +"# processors : %i\n" +"bogomips per cpu: 13370.00\n" , + num_cpus); +dprintf (fd,"max thread id : 0\n" ); +dprintf (fd,"features\t: " ); +for (i =0 ; i <sizeof (elf_hwcap) *8 ; i++) { +if (!(elf_hwcap & (1 << i))) { +continue ; + } + hwcap_str =elf_hwcap_str (i); +if (hwcap_str) { +dprintf (fd,"%s " , hwcap_str); + } + } +dprintf (fd,"\n" ); +show_facilities (fd); +for (i =0 ; i < num_cpus; i++) { +dprintf (fd,"processor %d: " +"version = %02X, " +"identification = %06X, " +"machine = %04X\n" , + i, model->cpu_ver,cpu_ident (i), model->def->type); + } +} + +static void show_cpu_ids (CPUArchState *cpu_env,int fd,unsigned long n) +{ +S390CPUModel *model =env_archcpu (cpu_env)->model; + +dprintf (fd,"version : %02X\n" , model->cpu_ver); +dprintf (fd,"identification : %06X\n" ,cpu_ident (n)); +dprintf (fd,"machine : %04X\n" , model->def->type); +} + +static void show_cpuinfo (CPUArchState *cpu_env,int fd,unsigned long n) +{ +dprintf (fd,"\ncpu number : %ld\n" , n); +show_cpu_ids (cpu_env, fd, n); +} + +static int open_cpuinfo (CPUArchState *cpu_env,int fd) +{ +int num_cpus =sysconf (_SC_NPROCESSORS_ONLN); +int i; + +show_cpu_summary (cpu_env, fd); +for (i =0 ; i < num_cpus; i++) { +show_cpuinfo (cpu_env, fd, i); + } +return 0 ; +} +#endif +#if defined(TARGET_M68K )static int open_hardware (CPUArchState *cpu_env,int fd) {
@@ -8363,7 +8464,8 @@ static int do_openat(CPUArchState *cpu_env, int dirfd, const char *pathname, int #if HOST_BIG_ENDIAN != TARGET_BIG_ENDIAN { "/proc/net/route", open_net_route, is_proc }, #endif -#if defined(TARGET_SPARC) || defined(TARGET_HPPA) || defined(TARGET_RISCV) +#if defined(TARGET_SPARC) || defined(TARGET_HPPA) || \ + defined(TARGET_RISCV) || defined(TARGET_S390X) { "/proc/cpuinfo", open_cpuinfo, is_proc }, #endif #if defined(TARGET_M68K)
Signature · 1 line
2.31.1
[PULL 10/18] tests/qtest: Run ipmi-bt-test only if CONFIG_IPMI_EXTERN is set
In reply to Thomas HuthThe ipmi-bt-test uses "-device ipmi-bmc-extern", thus it should only be run if this device has been enabled in the configuration.
Message-Id: <[email protected]>
--- tests/qtest/meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
tests/qtest/meson.build +2 -1
@@ -49,7 +49,8 @@ qtests_i386 = \ (config_all_devices.has_key('CONFIG_SGA') ? ['boot-serial-test'] : []) + \ (config_all_devices.has_key('CONFIG_ISA_IPMI_KCS') ? ['ipmi-kcs-test'] : []) + \ (config_host.has_key('CONFIG_LINUX') and \ - config_all_devices.has_key('CONFIG_ISA_IPMI_BT') ? ['ipmi-bt-test'] : []) + \ + config_all_devices.has_key('CONFIG_ISA_IPMI_BT') and + config_all_devices.has_key('CONFIG_IPMI_EXTERN') ? ['ipmi-bt-test'] : []) + \ (config_all_devices.has_key('CONFIG_WDT_IB700') ? ['wdt_ib700-test'] : []) + \ (config_all_devices.has_key('CONFIG_PVPANIC_ISA') ? ['pvpanic-test'] : []) + \ (config_all_devices.has_key('CONFIG_PVPANIC_PCI') ? ['pvpanic-pci-test'] : []) + \
Signature · 1 line
2.31.1
[PULL 14/18] bulk: Remove pointless QOM casts
In reply to Thomas HuthFrom: Philippe Mathieu-Daudé <[email protected]>
Mechanical change running Coccinelle spatch with content generated from the qom-cast-macro-clean-cocci-gen.py added in the previous commit.
Message-Id: <[email protected]>
--- block/nbd.c | 4 ++-- chardev/char-pty.c | 2 +- hw/arm/musicpal.c | 2 +- hw/arm/xlnx-versal.c | 2 +- hw/display/vhost-user-gpu.c | 4 ++-- hw/intc/loongarch_extioi.c | 6 +++--- hw/m68k/q800.c | 2 +- hw/pci-host/bonito.c | 2 +- hw/ppc/pnv_lpc.c | 2 +- hw/ppc/pnv_occ.c | 2 +- hw/ppc/pnv_sbe.c | 2 +- hw/riscv/virt.c | 10 +++++----- hw/rx/rx62n.c | 2 +- hw/scsi/esp-pci.c | 18 +++++++++--------- hw/sparc/sun4m.c | 4 ++-- hw/virtio/virtio-mem-pci.c | 6 +++--- hw/virtio/virtio-pmem-pci.c | 6 +++--- migration/fd.c | 4 ++-- migration/multifd.c | 2 +- migration/yank_functions.c | 4 ++-- nbd/client-connection.c | 2 +- nbd/server.c | 2 +- softmmu/qdev-monitor.c | 2 +- ui/vnc-ws.c | 6 +++--- 24 files changed, 49 insertions(+), 49 deletions(-)
block/nbd.c +2 -2
@@ -397,7 +397,7 @@ static void coroutine_fn GRAPH_RDLOCK nbd_reconnect_attempt(BDRVNBDState *s)/* Finalize previous connection if any */ if (s->ioc) { -qio_channel_detach_aio_context (QIO_CHANNEL (s->ioc)); +qio_channel_detach_aio_context (s->ioc);yank_unregister_function (BLOCKDEV_YANK_INSTANCE (s->bs->node_name), nbd_yank, s->bs);object_unref (OBJECT (s->ioc));
@@ -1455,7 +1455,7 @@ static void nbd_yank(void *opaque)BDRVNBDState *s = (BDRVNBDState *)bs->opaque;QEMU_LOCK_GUARD (&s->requests_lock); -qio_channel_shutdown (QIO_CHANNEL (s->ioc),QIO_CHANNEL_SHUTDOWN_BOTH ,NULL ); +qio_channel_shutdown (s->ioc,QIO_CHANNEL_SHUTDOWN_BOTH ,NULL ); s->state =NBD_CLIENT_QUIT ; }
chardev/char-pty.c +1 -1
@@ -334,7 +334,7 @@ static void char_pty_open(Chardev *chr, s =PTY_CHARDEV (chr); s->ioc =QIO_CHANNEL (qio_channel_file_new_fd (master_fd)); name =g_strdup_printf ("chardev-pty-%s" , chr->label); -qio_channel_set_name (QIO_CHANNEL (s->ioc), name); +qio_channel_set_name (s->ioc, name);g_free (name); s->timer_src =NULL ; *be_opened = false;
hw/arm/musicpal.c +1 -1
@@ -1250,7 +1250,7 @@ static void musicpal_init(MachineState *machine) uart_orgate =DEVICE (object_new (TYPE_OR_IRQ ));object_property_set_int (OBJECT (uart_orgate),"num-lines" ,2 , &error_fatal);qdev_realize_and_unref (uart_orgate,NULL , &error_fatal); -qdev_connect_gpio_out (DEVICE (uart_orgate),0 , +qdev_connect_gpio_out (uart_orgate,0 ,qdev_get_gpio_in (pic,MP_UART_SHARED_IRQ )); serial_mm_init(address_space_mem, MP_UART1_BASE, 2,
hw/arm/xlnx-versal.c +1 -1
@@ -327,7 +327,7 @@ static void versal_create_rtc(Versal *s, qemu_irq *pic)object_initialize_child (OBJECT (s),"rtc" , &s->pmc.rtc,TYPE_XLNX_ZYNQMP_RTC ); sbd =SYS_BUS_DEVICE (&s->pmc.rtc); -sysbus_realize (SYS_BUS_DEVICE (sbd), &error_fatal); +sysbus_realize (sbd, &error_fatal); mr =sysbus_mmio_get_region (sbd,0 );memory_region_add_subregion (&s->mr_ps,MM_PMC_RTC , mr);
hw/display/vhost-user-gpu.c +2 -2
@@ -364,11 +364,11 @@ vhost_user_gpu_gl_flushed(VirtIOGPUBase *b)VhostUserGPU *g =VHOST_USER_GPU (b);if (g->backend_blocked) { -vhost_user_gpu_unblock (VHOST_USER_GPU (g)); +vhost_user_gpu_unblock (g); g->backend_blocked = false; } -vhost_user_gpu_update_blocked (VHOST_USER_GPU (g), false); +vhost_user_gpu_update_blocked (g, false); } static bool
hw/intc/loongarch_extioi.c +3 -3
@@ -276,7 +276,7 @@ static void loongarch_extioi_instance_init(Object *obj)int i, cpu, pin;for (i =0 ; i <EXTIOI_IRQS ; i++) { -sysbus_init_irq (SYS_BUS_DEVICE (dev), &s->irq[i]); +sysbus_init_irq (dev, &s->irq[i]); }qdev_init_gpio_in (DEVICE (obj), extioi_setirq,EXTIOI_IRQS );
@@ -284,14 +284,14 @@ static void loongarch_extioi_instance_init(Object *obj)for (cpu =0 ; cpu <EXTIOI_CPUS ; cpu++) {memory_region_init_io (&s->extioi_iocsr_mem[cpu],OBJECT (s), &extioi_ops, s,"extioi_iocsr" ,0x900 ); -sysbus_init_mmio (SYS_BUS_DEVICE (dev), &s->extioi_iocsr_mem[cpu]); +sysbus_init_mmio (dev, &s->extioi_iocsr_mem[cpu]);for (pin =0 ; pin <LS3A_INTC_IP ; pin++) {qdev_init_gpio_out (DEVICE (obj), &s->parent_irq[cpu][pin],1 ); } }memory_region_init_io (&s->extioi_system_mem,OBJECT (s), &extioi_ops, s,"extioi_system_mem" ,0x900 ); -sysbus_init_mmio (SYS_BUS_DEVICE (dev), &s->extioi_system_mem); +sysbus_init_mmio (dev, &s->extioi_system_mem); }static void loongarch_extioi_class_init (ObjectClass *klass,void *data)
hw/m68k/q800.c +1 -1
@@ -525,7 +525,7 @@ static void q800_init(MachineState *machine)qdev_realize_and_unref (escc_orgate,NULL , &error_fatal);sysbus_connect_irq (sysbus,0 ,qdev_get_gpio_in (escc_orgate,0 ));sysbus_connect_irq (sysbus,1 ,qdev_get_gpio_in (escc_orgate,1 )); -qdev_connect_gpio_out (DEVICE (escc_orgate),0 , +qdev_connect_gpio_out (escc_orgate,0 ,qdev_get_gpio_in (glue,GLUE_IRQ_IN_ESCC ));sysbus_mmio_map (sysbus,0 ,SCC_BASE );
hw/pci-host/bonito.c +1 -1
@@ -656,7 +656,7 @@ static void bonito_pci_realize(PCIDevice *dev, Error **errp)PCIBonitoState *s =PCI_BONITO (dev);SysBusDevice *sysbus =SYS_BUS_DEVICE (s->pcihost);PCIHostState *phb =PCI_HOST_BRIDGE (s->pcihost); -BonitoState *bs =BONITO_PCI_HOST_BRIDGE (s->pcihost); +BonitoState *bs = s->pcihost;MemoryRegion *pcimem_alias =g_new (MemoryRegion,1 );/*
hw/ppc/pnv_lpc.c +1 -1
@@ -744,7 +744,7 @@ static void pnv_lpc_realize(DeviceState *dev, Error **errp)memory_region_add_subregion (&lpc->opb_mr,LPC_HC_REGS_OPB_ADDR , &lpc->lpc_hc_regs); -qdev_init_gpio_out (DEVICE (dev), &lpc->psi_irq,1 ); +qdev_init_gpio_out (dev, &lpc->psi_irq,1 ); }static void pnv_lpc_class_init (ObjectClass *klass,void *data)
hw/ppc/pnv_occ.c +1 -1
@@ -278,7 +278,7 @@ static void pnv_occ_realize(DeviceState *dev, Error **errp) occ,"occ-common-area" , PNV_OCC_SENSOR_DATA_BLOCK_SIZE); -qdev_init_gpio_out (DEVICE (dev), &occ->psi_irq,1 ); +qdev_init_gpio_out (dev, &occ->psi_irq,1 ); }static void pnv_occ_class_init (ObjectClass *klass,void *data)
hw/ppc/pnv_sbe.c +1 -1
@@ -381,7 +381,7 @@ static void pnv_sbe_realize(DeviceState *dev, Error **errp) psc->xscom_mbox_ops, sbe,"xscom-sbe-mbox" , psc->xscom_mbox_size); -qdev_init_gpio_out (DEVICE (dev), &sbe->psi_irq,1 ); +qdev_init_gpio_out (dev, &sbe->psi_irq,1 ); sbe->timer =timer_new_us (QEMU_CLOCK_VIRTUAL , sbe_timer, sbe); }
hw/riscv/virt.c +5 -5
@@ -1488,7 +1488,7 @@ static void virt_machine_init(MachineState *machine)for (i =0 ; i <VIRTIO_COUNT ; i++) {sysbus_create_simple ("virtio-mmio" , memmap[VIRT_VIRTIO ].base + i * memmap[VIRT_VIRTIO ].size, -qdev_get_gpio_in (DEVICE (virtio_irqchip),VIRTIO_IRQ + i)); +qdev_get_gpio_in (virtio_irqchip,VIRTIO_IRQ + i)); } gpex_pcie_init(system_memory,
@@ -1499,16 +1499,16 @@ static void virt_machine_init(MachineState *machine) virt_high_pcie_memmap.base, virt_high_pcie_memmap.size, memmap[VIRT_PCIE_PIO ].base, - DEVICE(pcie_irqchip)); + pcie_irqchip); -create_platform_bus (s,DEVICE (mmio_irqchip)); +create_platform_bus (s, mmio_irqchip);serial_mm_init (system_memory, memmap[VIRT_UART0 ].base, -0 ,qdev_get_gpio_in (DEVICE (mmio_irqchip),UART0_IRQ ),399193 , +0 ,qdev_get_gpio_in (mmio_irqchip,UART0_IRQ ),399193 ,serial_hd (0 ),DEVICE_LITTLE_ENDIAN );sysbus_create_simple ("goldfish_rtc" , memmap[VIRT_RTC ].base, -qdev_get_gpio_in (DEVICE (mmio_irqchip),RTC_IRQ )); +qdev_get_gpio_in (mmio_irqchip,RTC_IRQ ));virt_flash_create (s);
hw/rx/rx62n.c +1 -1
@@ -154,7 +154,7 @@ static void register_icu(RX62NState *s)sysbus_connect_irq (icu,0 ,qdev_get_gpio_in (DEVICE (&s->cpu),RX_CPU_IRQ ));sysbus_connect_irq (icu,1 ,qdev_get_gpio_in (DEVICE (&s->cpu),RX_CPU_FIR ));sysbus_connect_irq (icu,2 , s->irq[SWI ]); -sysbus_mmio_map (SYS_BUS_DEVICE (icu),0 ,RX62N_ICU_BASE ); +sysbus_mmio_map (icu,0 ,RX62N_ICU_BASE ); }static void register_tmr (RX62NState *s,int unit)
hw/scsi/esp-pci.c +9 -9
@@ -79,7 +79,7 @@ struct PCIESPState {static void esp_pci_handle_idle (PCIESPState *pci,uint32_t val) { -ESPState *s =ESP (&pci->esp); +ESPState *s = &pci->esp;trace_esp_pci_dma_idle (val);esp_dma_enable (s,0 ,0 );
@@ -93,7 +93,7 @@ static void esp_pci_handle_blast(PCIESPState *pci, uint32_t val)static void esp_pci_handle_abort (PCIESPState *pci,uint32_t val) { -ESPState *s =ESP (&pci->esp); +ESPState *s = &pci->esp;trace_esp_pci_dma_abort (val);if (s->current_req) {
@@ -103,7 +103,7 @@ static void esp_pci_handle_abort(PCIESPState *pci, uint32_t val)static void esp_pci_handle_start (PCIESPState *pci,uint32_t val) { -ESPState *s =ESP (&pci->esp); +ESPState *s = &pci->esp;trace_esp_pci_dma_start (val);
@@ -161,7 +161,7 @@ static void esp_pci_dma_write(PCIESPState *pci, uint32_t saddr, uint32_t val)static uint32_t esp_pci_dma_read (PCIESPState *pci,uint32_t saddr) { -ESPState *s =ESP (&pci->esp); +ESPState *s = &pci->esp;uint32_t val; val = pci->dma_regs[saddr];
@@ -183,7 +183,7 @@ static void esp_pci_io_write(void *opaque, hwaddr addr, uint64_t val, unsigned int size) {PCIESPState *pci = opaque; -ESPState *s =ESP (&pci->esp); +ESPState *s = &pci->esp;if (size <4 || addr &3 ) {/* need to upgrade request: we only support 4-bytes accesses */
@@ -228,7 +228,7 @@ static uint64_t esp_pci_io_read(void *opaque, hwaddr addr, unsigned int size) {PCIESPState *pci = opaque; -ESPState *s =ESP (&pci->esp); +ESPState *s = &pci->esp;uint32_t ret;if (addr <0x40 ) {
@@ -315,7 +315,7 @@ static const MemoryRegionOps esp_pci_io_ops = {static void esp_pci_hard_reset (DeviceState *dev) {PCIESPState *pci =PCI_ESP (dev); -ESPState *s =ESP (&pci->esp); +ESPState *s = &pci->esp;esp_hard_reset (s); pci->dma_regs[DMA_CMD] &= ~(DMA_CMD_DIR | DMA_CMD_INTE_D | DMA_CMD_INTE_P
@@ -366,7 +366,7 @@ static void esp_pci_scsi_realize(PCIDevice *dev, Error **errp) {PCIESPState *pci =PCI_ESP (dev);DeviceState *d =DEVICE (dev); -ESPState *s =ESP (&pci->esp); +ESPState *s = &pci->esp;uint8_t *pci_conf;if (!qdev_realize (DEVICE (s),NULL , errp)) {
@@ -394,7 +394,7 @@ static void esp_pci_scsi_realize(PCIDevice *dev, Error **errp)static void esp_pci_scsi_exit (PCIDevice *d) {PCIESPState *pci =PCI_ESP (d); -ESPState *s =ESP (&pci->esp); +ESPState *s = &pci->esp;qemu_free_irq (s->irq); }
hw/sparc/sun4m.c +2 -2
@@ -982,7 +982,7 @@ static void sun4m_hw_init(MachineState *machine)qdev_realize_and_unref (ms_kb_orgate,NULL , &error_fatal);sysbus_connect_irq (s,0 ,qdev_get_gpio_in (ms_kb_orgate,0 ));sysbus_connect_irq (s,1 ,qdev_get_gpio_in (ms_kb_orgate,1 )); -qdev_connect_gpio_out (DEVICE (ms_kb_orgate),0 , slavio_irq[14 ]); +qdev_connect_gpio_out (ms_kb_orgate,0 , slavio_irq[14 ]); dev =qdev_new (TYPE_ESCC );qdev_prop_set_uint32 (dev,"disabled" ,0 );
@@ -1004,7 +1004,7 @@ static void sun4m_hw_init(MachineState *machine)qdev_realize_and_unref (serial_orgate,NULL , &error_fatal);sysbus_connect_irq (s,0 ,qdev_get_gpio_in (serial_orgate,0 ));sysbus_connect_irq (s,1 ,qdev_get_gpio_in (serial_orgate,1 )); -qdev_connect_gpio_out (DEVICE (serial_orgate),0 , slavio_irq[15 ]); +qdev_connect_gpio_out (serial_orgate,0 , slavio_irq[15 ]);if (hwdef->apc_base) {apc_init (hwdef->apc_base,qemu_allocate_irq (cpu_halt_signal,NULL ,0 ));
hw/virtio/virtio-mem-pci.c +3 -3
@@ -42,7 +42,7 @@ static MemoryRegion *virtio_mem_pci_get_memory_region(MemoryDeviceState *md, Error **errp) {VirtIOMEMPCI *pci_mem =VIRTIO_MEM_PCI (md); -VirtIOMEM *vmem =VIRTIO_MEM (&pci_mem->vdev); +VirtIOMEM *vmem = &pci_mem->vdev;VirtIOMEMClass *vmc =VIRTIO_MEM_GET_CLASS (vmem);return vmc->get_memory_region (vmem, errp);
@@ -60,7 +60,7 @@ static void virtio_mem_pci_fill_device_info(const MemoryDeviceState *md, {VirtioMEMDeviceInfo *vi =g_new0 (VirtioMEMDeviceInfo,1 );VirtIOMEMPCI *pci_mem =VIRTIO_MEM_PCI (md); -VirtIOMEM *vmem =VIRTIO_MEM (&pci_mem->vdev); +VirtIOMEM *vmem = &pci_mem->vdev;VirtIOMEMClass *vpc =VIRTIO_MEM_GET_CLASS (vmem);DeviceState *dev =DEVICE (md);
@@ -123,7 +123,7 @@ static void virtio_mem_pci_instance_init(Object *obj) TYPE_VIRTIO_MEM); dev->size_change_notifier.notify = virtio_mem_pci_size_change_notify; - vmem =VIRTIO_MEM (&dev->vdev); + vmem = &dev->vdev; vmc =VIRTIO_MEM_GET_CLASS (vmem);/* * We never remove the notifier again, as we expect both devices to
hw/virtio/virtio-pmem-pci.c +3 -3
@@ -42,7 +42,7 @@ static MemoryRegion *virtio_pmem_pci_get_memory_region(MemoryDeviceState *md, Error **errp) {VirtIOPMEMPCI *pci_pmem =VIRTIO_PMEM_PCI (md); -VirtIOPMEM *pmem =VIRTIO_PMEM (&pci_pmem->vdev); +VirtIOPMEM *pmem = &pci_pmem->vdev;VirtIOPMEMClass *vpc =VIRTIO_PMEM_GET_CLASS (pmem);return vpc->get_memory_region (pmem, errp);
@@ -52,7 +52,7 @@ static uint64_t virtio_pmem_pci_get_plugged_size(const MemoryDeviceState *md, Error **errp) {VirtIOPMEMPCI *pci_pmem =VIRTIO_PMEM_PCI (md); -VirtIOPMEM *pmem =VIRTIO_PMEM (&pci_pmem->vdev); +VirtIOPMEM *pmem = &pci_pmem->vdev;VirtIOPMEMClass *vpc =VIRTIO_PMEM_GET_CLASS (pmem);MemoryRegion *mr = vpc->get_memory_region (pmem, errp);
@@ -65,7 +65,7 @@ static void virtio_pmem_pci_fill_device_info(const MemoryDeviceState *md, {VirtioPMEMDeviceInfo *vi =g_new0 (VirtioPMEMDeviceInfo,1 );VirtIOPMEMPCI *pci_pmem =VIRTIO_PMEM_PCI (md); -VirtIOPMEM *pmem =VIRTIO_PMEM (&pci_pmem->vdev); +VirtIOPMEM *pmem = &pci_pmem->vdev;VirtIOPMEMClass *vpc =VIRTIO_PMEM_GET_CLASS (pmem);DeviceState *dev =DEVICE (md);
migration/fd.c +2 -2
@@ -38,7 +38,7 @@ void fd_start_outgoing_migration(MigrationState *s, const char *fdname, Error **return ; } -qio_channel_set_name (QIO_CHANNEL (ioc),"migration-fd-outgoing" ); +qio_channel_set_name (ioc,"migration-fd-outgoing" );migration_channel_connect (s, ioc,NULL ,NULL );object_unref (OBJECT (ioc)); }
@@ -68,7 +68,7 @@ void fd_start_incoming_migration(const char *fdname, Error **errp)return ; } -qio_channel_set_name (QIO_CHANNEL (ioc),"migration-fd-incoming" ); +qio_channel_set_name (ioc,"migration-fd-incoming" ); qio_channel_add_watch_full(ioc, G_IO_IN, fd_accept_incoming_migration, NULL, NULL,
migration/multifd.c +1 -1
@@ -894,7 +894,7 @@ static void multifd_new_send_channel_async(QIOTask *task, gpointer opaque)trace_multifd_new_send_channel_async (p->id);if (!qio_task_propagate_error (task, &local_err)) { - p->c =QIO_CHANNEL (sioc); + p->c = sioc;qio_channel_set_delay (p->c, false); p->running = true;if (multifd_channel_connect (p, sioc, local_err)) {
migration/yank_functions.c +2 -2
@@ -35,7 +35,7 @@ void migration_ioc_register_yank(QIOChannel *ioc)if (migration_ioc_yank_supported (ioc)) {yank_register_function (MIGRATION_YANK_INSTANCE , migration_yank_iochannel, -QIO_CHANNEL (ioc)); + ioc); } }
@@ -44,7 +44,7 @@ void migration_ioc_unregister_yank(QIOChannel *ioc)if (migration_ioc_yank_supported (ioc)) {yank_unregister_function (MIGRATION_YANK_INSTANCE , migration_yank_iochannel, -QIO_CHANNEL (ioc)); + ioc); } }
nbd/client-connection.c +1 -1
@@ -156,7 +156,7 @@ static int nbd_connect(QIOChannelSocket *sioc, SocketAddress *addr,* channel. */ if (outioc && *outioc) { -qio_channel_close (QIO_CHANNEL (*outioc),NULL ); +qio_channel_close (*outioc,NULL );object_unref (OBJECT (*outioc)); *outioc =NULL ; }else {
nbd/server.c +1 -1
@@ -1189,7 +1189,7 @@ static int nbd_negotiate_options(NBDClient *client, Error **errp) } ret =0 ;object_unref (OBJECT (client->ioc)); - client->ioc =QIO_CHANNEL (tioc); + client->ioc = tioc;break ;case NBD_OPT_EXPORT_NAME :
softmmu/qdev-monitor.c +1 -1
@@ -711,7 +711,7 @@ DeviceState *qdev_device_add_from_qdict(const QDict *opts, goto err_del_dev; } -if (!qdev_realize (DEVICE (dev), bus, errp)) { +if (!qdev_realize (dev, bus, errp)) { goto err_del_dev; }return dev;
ui/vnc-ws.c +3 -3
@@ -40,9 +40,9 @@ static void vncws_tls_handshake_done(QIOTask *task,if (vs->ioc_tag) {g_source_remove (vs->ioc_tag); } - vs->ioc_tag =qio_channel_add_watch ( -QIO_CHANNEL (vs->ioc),G_IO_IN |G_IO_HUP |G_IO_ERR , - vncws_handshake_io, vs,NULL ); + vs->ioc_tag =qio_channel_add_watch (vs->ioc, +G_IO_IN |G_IO_HUP |G_IO_ERR , + vncws_handshake_io, vs,NULL ); } }
Signature · 1 line
2.31.1
[PULL 08/18] target/s390x: Fix MXDB and MXDBR
In reply to Thomas HuthFrom: Ilya Leoshkevich <[email protected]>
These instructions multiply 64 bits by 64 bits, not 128 bits by 64 bits.
Message-Id: <[email protected]>
--- target/s390x/helper.h | 2 +- target/s390x/tcg/insn-data.h.inc | 4 ++-- target/s390x/tcg/fpu_helper.c | 5 +++-- target/s390x/tcg/translate.c | 8 +------- 4 files changed, 7 insertions(+), 12 deletions(-)
target/s390x/helper.h +1 -1
@@ -50,7 +50,7 @@ DEF_HELPER_FLAGS_3(meeb, TCG_CALL_NO_WG, i64, env, i64, i64) DEF_HELPER_FLAGS_3(mdeb, TCG_CALL_NO_WG, i64, env, i64, i64) DEF_HELPER_FLAGS_3(mdb, TCG_CALL_NO_WG, i64, env, i64, i64) DEF_HELPER_FLAGS_3(mxb, TCG_CALL_NO_WG, i128, env, i128, i128) -DEF_HELPER_FLAGS_3(mxdb, TCG_CALL_NO_WG, i128, env, i128, i64) +DEF_HELPER_FLAGS_3(mxdb, TCG_CALL_NO_WG, i128, env, i64, i64) DEF_HELPER_FLAGS_2(ldeb, TCG_CALL_NO_WG, i64, env, i64) DEF_HELPER_FLAGS_3(ldxb, TCG_CALL_NO_WG, i64, env, i128, i32)DEF_HELPER_FLAGS_2 (lxdb,TCG_CALL_NO_WG , i128, env, i64)
target/s390x/tcg/insn-data.h.inc +2 -2
@@ -668,11 +668,11 @@ F(0xb31c, MDBR, RRE, Z, f1, f2, new, f1, mdb, 0, IF_BFP) F(0xb34c, MXBR, RRE, Z, x1, x2, new_x, x1, mxb, 0, IF_BFP) F(0xb30c, MDEBR, RRE, Z, f1, e2, new, f1, mdeb, 0, IF_BFP) - F(0xb307, MXDBR, RRE, Z, 0, f2, x1, x1, mxdb, 0, IF_BFP) + F(0xb307, MXDBR, RRE, Z, f1, f2, new_x, x1, mxdb, 0, IF_BFP) F(0xed17, MEEB, RXE, Z, e1, m2_32u, new, e1, meeb, 0, IF_BFP) F(0xed1c, MDB, RXE, Z, f1, m2_64, new, f1, mdb, 0, IF_BFP) F(0xed0c, MDEB, RXE, Z, f1, m2_32u, new, f1, mdeb, 0, IF_BFP) - F(0xed07, MXDB, RXE, Z, 0, m2_64, x1, x1, mxdb, 0, IF_BFP) + F(0xed07, MXDB, RXE, Z, f1, m2_64, new_x, x1, mxdb, 0, IF_BFP) /* MULTIPLY HALFWORD */ C(0x4c00, MH, RX_a, Z, r1_o, m2_16s, new, r1_32, mul, 0) C(0xe37c, MHY, RXY_a, GIE, r1_o, m2_16s, new, r1_32, mul, 0)
target/s390x/tcg/fpu_helper.c +3 -2
@@ -321,10 +321,11 @@ Int128 HELPER(mxb)(CPUS390XState *env, Int128 a, Int128 b) }/* 128/64-bit FP multiplication */ -Int128 HELPER (mxdb )(CPUS390XState *env,Int128 a,uint64_t f2) +Int128 HELPER (mxdb )(CPUS390XState *env,uint64_t f1,uint64_t f2) { +float128 f1_128 =float64_to_float128 (f1, &env->fpu_status);float128 ret =float64_to_float128 (f2, &env->fpu_status); - ret =float128_mul (ARG128 (a), ret, &env->fpu_status); + ret =float128_mul (f1_128, ret, &env->fpu_status);handle_exceptions (env, false,GETPC ());return RET128 (ret); }
target/s390x/tcg/translate.c +1 -7
@@ -3421,7 +3421,7 @@ static DisasJumpType op_mxb(DisasContext *s, DisasOps *o)static DisasJumpType op_mxdb (DisasContext *s,DisasOps *o) { -gen_helper_mxdb (o->out_128, cpu_env, o->in1_128, o->in2); +gen_helper_mxdb (o->out_128, cpu_env, o->in1, o->in2);return DISAS_NEXT ; }
@@ -5183,12 +5183,6 @@ static void prep_r1_P(DisasContext *s, DisasOps *o) }#define SPEC_prep_r1_P SPEC_r1_even -static void prep_x1 (DisasContext *s,DisasOps *o) -{ - o->out_128 =load_freg_128 (get_field (s, r1)); -} -#define SPEC_prep_x1 SPEC_r1_f128 -/* ====================================================================== */ /* The "Write OUTput" generators. These generally perform some non-trivial copy of data to TCG globals, or to main memory. The trivial cases are
Signature · 1 line
2.31.1
[PULL 13/18] scripts: Add qom-cast-macro-clean-cocci-gen.py
In reply to Thomas HuthFrom: Philippe Mathieu-Daudé <[email protected]>
Add a script to generate Coccinelle semantic patch removing all pointless QOM cast macro uses.
Message-Id: <[email protected]>
--- MAINTAINERS | 1 + scripts/qom-cast-macro-clean-cocci-gen.py | 49 +++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 scripts/qom-cast-macro-clean-cocci-gen.py
MAINTAINERS +1 -0
@@ -3045,6 +3045,7 @@ F: include/qom/ F: qapi/qom.json F: qapi/qdev.json F: scripts/coccinelle/qom-parent-type.cocci +F: scripts/qom-cast-macro-clean-cocci-gen.py F: softmmu/qdev-monitor.c F: stubs/qdev.c F: qom/
scripts/qom-cast-macro-clean-cocci-gen.py new file +49 -0
49 lines not on this page · raw message
Signature · 1 line
2.31.1
[PULL 06/18] tests/tcg/s390x: Test single-stepping SVC
In reply to Thomas HuthFrom: Ilya Leoshkevich <[email protected]>
Add a small test to prevent regressions.
Message-Id: <[email protected]>
--- tests/tcg/s390x/Makefile.target | 11 ++++- tests/tcg/s390x/gdbstub/test-svc.py | 64 +++++++++++++++++++++++++++++ tests/tcg/s390x/hello-s390x-asm.S | 20 +++++++++ 3 files changed, 94 insertions(+), 1 deletion(-) create mode 100644 tests/tcg/s390x/gdbstub/test-svc.py create mode 100644 tests/tcg/s390x/hello-s390x-asm.S
tests/tcg/s390x/Makefile.target +10 -1
@@ -77,7 +77,16 @@ run-gdbstub-signals-s390x: signals-s390x --bin $< --test $(S390X_SRC)/gdbstub/test-signals-s390x.py, \ mixing signals and debugging) -EXTRA_RUNS += run-gdbstub-signals-s390x +hello-s390x-asm: CFLAGS+=-nostdlib + +run-gdbstub-svc: hello-s390x-asm + $(call run-test, $@, $(GDB_SCRIPT) \ + --gdb $(HAVE_GDB_BIN) \ + --qemu $(QEMU) --qargs "$(QEMU_OPTS)" \ + --bin $< --test $(S390X_SRC)/gdbstub/test-svc.py, \ + single-stepping svc) + +EXTRA_RUNS += run-gdbstub-signals-s390x run-gdbstub-svc endif # MVX versions of sha512
tests/tcg/s390x/gdbstub/test-svc.py new file +64 -0
64 lines not on this page · raw message
tests/tcg/s390x/hello-s390x-asm.S new file +20 -0
@@ -0,0 +1,20 @@ +/* + * Hello, World! in assembly. + */ + +.globl _start +_start: + +/* puts("Hello, World!"); */ +lghi %r2,1 +larl %r3,foo +lghi %r4,foo_end-foo +svc 4 + +/* exit(0); */ +xgr %r2,%r2 +svc 1 + +.align 2 +foo: .asciz "Hello, World!\n" +foo_end:
Signature · 1 line
2.31.1
[PULL 09/18] tests/tcg/s390x: Test MXDB and MXDBR
In reply to Thomas HuthFrom: Ilya Leoshkevich <[email protected]>
Add a small test to prevent regressions.
Message-Id: <[email protected]>
--- tests/tcg/s390x/mxdb.c | 30 ++++++++++++++++++++++++++++++ tests/tcg/s390x/Makefile.target | 1 + 2 files changed, 31 insertions(+) create mode 100644 tests/tcg/s390x/mxdb.c
tests/tcg/s390x/mxdb.c new file +30 -0
@@ -0,0 +1,30 @@ +/* +* Test the MXDB and MXDBR instructions. +* +* SPDX-License-Identifier: GPL-2.0-or-later +*/ +#include <assert.h> +#include <stdlib.h> + +int main (void ) +{ +union { +double d[2 ]; +long double ld; + } a; +double b; + + a.d[0 ] =1.2345 ; + a.d[1 ] =999 ; + b =6.789 ; + asm("mxdb %[a],%[b]" : [a]"+f" (a.ld) : [b]"R" (b)); +assert (a.ld >8.38 && a.ld <8.39 ); + + a.d[0 ] =1.2345 ; + a.d[1 ] =999 ; + b =6.789 ; + asm("mxdbr %[a],%[b]" : [a]"+f" (a.ld) : [b]"f" (b)); +assert (a.ld >8.38 && a.ld <8.39 ); + +return EXIT_SUCCESS ; +}
tests/tcg/s390x/Makefile.target +1 -0
@@ -35,6 +35,7 @@ TESTS+=chrl TESTS+=rxsbg TESTS+=ex-relative-long TESTS+=ex-branch +TESTS+=mxdb cdsg: CFLAGS+=-pthread cdsg: LDFLAGS+=-pthread
Signature · 1 line
2.31.1
[PULL 11/18] gitlab-ci: Remove unused Python package
In reply to Thomas HuthFrom: Camilla Conte <[email protected]>
Python should have been removed in this commit:
https://gitlab.com/qemu-project/qemu/-/commit/94b8b146df84ba472f461398d93fb9cdf0db8f94
Message-Id: <[email protected]>
--- .gitlab-ci.d/container-template.yml | 1 - 1 file changed, 1 deletion(-)
.gitlab-ci.d/container-template.yml +0 -1
@@ -7,7 +7,6 @@ before_script: - export TAG="$CI_REGISTRY_IMAGE/qemu/$NAME:latest" - export COMMON_TAG="$CI_REGISTRY/qemu-project/qemu/qemu/$NAME:latest" - - apk add python3 - docker login $CI_REGISTRY -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" - until docker info; do sleep 1; done script:
Signature · 1 line
2.31.1
Richard Henderson
AppliedQuoted 12 lines · Thomas Huth
Hi Richard!
The following changes since commit
848a6caa88b9f082c89c9b41afa975761262981d:Merge tag 'migration-20230602-pull-request' of https://gitlab.com/juan.quintela/qemu into staging (2023-06-02 17:33:29 -0700)are available in the Git repository at:
https://gitlab.com/thuth/qemu.git tags/pull-request-2023-06-06for you to fetch changes up to
1fb9bdaf59719c0d0c28043e58c8e3452fd6d7de:
Quoted 8 lines
linux-user: Emulate /proc/cpuinfo on s390x (2023-06-05 20:48:34 +0200)----------------------------------------------------------------
* Fix emulated LCCB, LOCFHR, MXDB and MXDBR s390x instructions
* Fix the malta machine on s390x (big endian) hosts
* Emulate/proc/cpuinfoon s390x
* Remove pointless QOM casts
* Improve the inclusion logic for libkeyutils and ipmi-bt-test in meson.build
Applied, thanks. Please update https://wiki.qemu.org/ChangeLog/8.1 as appropriate.
r~