[PATCH 3/3] tests/qtest/readconfig: Test the docs/config/q35-*.cfg files

2023-07-04 Thread Thomas Huth
Test that we can successfully parse the docs/config/q35-emulated.cfg, docs/config/q35-virtio-graphical.cfg and docs/config/q35-virtio-serial.cfg config files (the "...-serial.cfg" file is a subset of the graphical config file, so we skip that in quick mode). These config files use two hard-coded i

[PATCH 0/3] Test the docs/config/q35-*.cfg config files

2023-07-04 Thread Thomas Huth
With some tweaking (e.g. by creating temporary image files), we can check whether the docs/config/q35-*.cfg files can be loaded by QEMU successfully, so we can avoid that these files bitrot and avoid that our config file parser gets regressions. Thomas Huth (3): tests/qtest/readconfig-test: Allo

[PATCH 2/3] tests/qtest: Move mkimg() and have_qemu_img() from libqos to libqtest

2023-07-04 Thread Thomas Huth
These two functions can be useful for other qtests beside the qos-test, too, so move them to libqtest instead. Signed-off-by: Thomas Huth --- tests/qtest/libqos/libqos.h | 2 -- tests/qtest/libqtest.h | 20 ++ tests/qtest/libqos/libqos.c | 49 +-

[PATCH 1/3] tests/qtest/readconfig-test: Allow testing for arbitrary memory sizes

2023-07-04 Thread Thomas Huth
Make test_x86_memdev_resp() more flexible by allowing arbitrary memory sizes as parameter here. Signed-off-by: Thomas Huth --- tests/qtest/readconfig-test.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/qtest/readconfig-test.c b/tests/qtest/readconfig-test.c i

[PATCH v2 1/1] vhost-vdpa: mute unaligned memory error report

2023-07-04 Thread Laurent Vivier
With TPM CRM device, vhost-vdpa reports an error when it tries to register a listener for a non aligned memory region: qemu-system-x86_64: vhost_vdpa_listener_region_add received unaligned region qemu-system-x86_64: vhost_vdpa_listener_region_del received unaligned region This error can be co

[PATCH v2 0/1] vhost-vdpa: skip TPM CRB memory section

2023-07-04 Thread Laurent Vivier
An error is reported for vhost-vdpa case: qemu-kvm: vhost_vdpa_listener_region_add received unaligned region Marc-André has proposed a fix to this problem by skipping the memory region owned by the TPM CRB but it seems more generic to skip not aligned memory. v1 of this series proposed to set the

Re: [PATCH v2 1/1] vhost-vdpa: mute unaligned memory error report

2023-07-04 Thread David Hildenbrand
On 04.07.23 09:19, Laurent Vivier wrote: With TPM CRM device, vhost-vdpa reports an error when it tries to register a listener for a non aligned memory region: qemu-system-x86_64: vhost_vdpa_listener_region_add received unaligned region qemu-system-x86_64: vhost_vdpa_listener_region_del re

Re: [PATCH 01/12] linux-user: elfload: Add more initial s390x PSW bits

2023-07-04 Thread David Hildenbrand
On 03.07.23 17:50, Ilya Leoshkevich wrote: Make the PSW look more similar to the real s390x userspace PSW. Except for being there, the newly added bits should not affect the userspace code execution. What's the purpose of this then? Required for follow-up patches? Signed-off-by: Ilya Leoshke

Re: [PATCH 02/12] target/s390x: Fix EPSW CC reporting

2023-07-04 Thread David Hildenbrand
On 03.07.23 17:50, Ilya Leoshkevich wrote: EPSW should explicitly calculate and insert CC, like IPM does. Fixes: e30a9d3fea58 ("target-s390: Implement EPSW") Cc: qemu-sta...@nongnu.org Signed-off-by: Ilya Leoshkevich --- Reviewed-by: David Hildenbrand -- Cheers, David / dhildenb

Re: [PATCH 03/12] target/s390x: Fix MDEB and MDEBR

2023-07-04 Thread David Hildenbrand
On 03.07.23 17:50, Ilya Leoshkevich wrote: These instructions multiply 32 bits by 32 bits, not 32 bits by 64 bits. Fixes: 83b00736f3d8 ("target-s390: Convert FP MULTIPLY") Cc: qemu-sta...@nongnu.org Signed-off-by: Ilya Leoshkevich --- Reviewed-by: David Hildenbrand -- Cheers, David / dhild

Re: [PATCH 01/12] linux-user: elfload: Add more initial s390x PSW bits

2023-07-04 Thread Ilya Leoshkevich
On Tue, 2023-07-04 at 09:32 +0200, David Hildenbrand wrote: > On 03.07.23 17:50, Ilya Leoshkevich wrote: > > Make the PSW look more similar to the real s390x userspace PSW. > > Except for being there, the newly added bits should not affect the > > userspace code execution. > > What's the purpose o

Re: [PATCH 04/12] target/s390x: Fix MVCRL with a large value in R0

2023-07-04 Thread David Hildenbrand
On 03.07.23 17:50, Ilya Leoshkevich wrote: Using a large R0 causes an assertion error: qemu-s390x: target/s390x/tcg/mem_helper.c:183: access_prepare_nf: Assertion `size > 0 && size <= 4096' failed. Even though PoP explicitly advises against using more than 8 bits for the size, an emulator

Re: [PATCH 05/12] target/s390x: Fix LRA overwriting the top 32 bits on DAT error

2023-07-04 Thread David Hildenbrand
On 03.07.23 17:50, Ilya Leoshkevich wrote: When a DAT error occurs, LRA is supposed to write the error information to the bottom 32 bits of R1, and leave the top 32 bits of R1 alone. Fix by passing the original value of R1 into helper and copying the top 32 bits to the return value. Fixes: d8fe

Re: [PATCH 01/12] linux-user: elfload: Add more initial s390x PSW bits

2023-07-04 Thread David Hildenbrand
On 04.07.23 09:40, Ilya Leoshkevich wrote: On Tue, 2023-07-04 at 09:32 +0200, David Hildenbrand wrote: On 03.07.23 17:50, Ilya Leoshkevich wrote: Make the PSW look more similar to the real s390x userspace PSW. Except for being there, the newly added bits should not affect the userspace code exe

Re: [PATCH v4] target: ppc: Use MSR_HVB bit to get the target endianness for memory dump

2023-07-04 Thread Vaibhav Jain
Thanks for fixing this Narayana, Narayana Murty N writes: > Currently on PPC64 qemu always dumps the guest memory in > Big Endian (BE) format even though the guest running in Little Endian > (LE) mode. So crash tool fails to load the dump as illustrated below: > > Log : > $ virsh dump DOMAIN -

Re: [PATCH v2 1/1] vhost-vdpa: mute unaligned memory error report

2023-07-04 Thread Laurent Vivier
On 7/4/23 09:25, David Hildenbrand wrote: On 04.07.23 09:19, Laurent Vivier wrote: With TPM CRM device, vhost-vdpa reports an error when it tries to register a listener for a non aligned memory region:    qemu-system-x86_64: vhost_vdpa_listener_region_add received unaligned region    qemu-syste

Re: [PATCH 06/12] target/s390x: Fix LRA when DAT is off

2023-07-04 Thread David Hildenbrand
On 03.07.23 17:50, Ilya Leoshkevich wrote: LRA should perform DAT regardless of whether it's on or off. Disable DAT check for MMU_S390_LRA. Fixes: defb0e3157af ("s390x: Implement opcode helpers") Cc: qemu-sta...@nongnu.org Signed-off-by: Ilya Leoshkevich --- target/s390x/mmu_helper.c | 2 +-

Re: [PATCH 07/12] target/s390x: Fix relative long instructions with large offsets

2023-07-04 Thread David Hildenbrand
On 03.07.23 17:50, Ilya Leoshkevich wrote: The expression "imm * 2" in gen_ri2() can wrap around if imm is large enough. Fix by casting imm to int64_t, like it's done in disas_jdest(). Fixes: e8ecdfeb30f0 ("Fix EXECUTE of relative branches") Signed-off-by: Ilya Leoshkevich --- target/s390x/t

Re: [PATCH 08/12] tests/tcg/s390x: Test EPSW

2023-07-04 Thread David Hildenbrand
On 03.07.23 17:50, Ilya Leoshkevich wrote: Add a small test to prevent regressions. Signed-off-by: Ilya Leoshkevich --- tests/tcg/s390x/Makefile.target | 1 + tests/tcg/s390x/epsw.c | 23 +++ 2 files changed, 24 insertions(+) create mode 100644 tests/tcg/s390

Re: [PATCH 09/12] tests/tcg/s390x: Test LARL with a large offset

2023-07-04 Thread David Hildenbrand
On 03.07.23 17:50, Ilya Leoshkevich wrote: Add a small test to prevent regressions. Signed-off-by: Ilya Leoshkevich --- tests/tcg/s390x/Makefile.target | 1 + tests/tcg/s390x/larl.c | 17 + 2 files changed, 18 insertions(+) create mode 100644 tests/tcg/s390x/larl

Re: [PATCH 11/12] tests/tcg/s390x: Test MDEB and MDEBR

2023-07-04 Thread David Hildenbrand
On 03.07.23 17:50, Ilya Leoshkevich wrote: Add a small test to prevent regressions. Signed-off-by: Ilya Leoshkevich --- tests/tcg/s390x/Makefile.target | 1 + tests/tcg/s390x/mdeb.c | 30 ++ 2 files changed, 31 insertions(+) create mode 100644 tests/t

Re: [PATCH 09/12] tests/tcg/s390x: Test LARL with a large offset

2023-07-04 Thread Ilya Leoshkevich
On Tue, 2023-07-04 at 09:56 +0200, David Hildenbrand wrote: > On 03.07.23 17:50, Ilya Leoshkevich wrote: > > Add a small test to prevent regressions. > > > > Signed-off-by: Ilya Leoshkevich > > --- > >   tests/tcg/s390x/Makefile.target |  1 + > >   tests/tcg/s390x/larl.c  | 17 +++

Re: [PATCH 12/12] tests/tcg/s390x: Test MVCRL with a large value in R0

2023-07-04 Thread David Hildenbrand
On 03.07.23 17:50, Ilya Leoshkevich wrote: Add a small test to prevent regressions. Signed-off-by: Ilya Leoshkevich --- tests/tcg/s390x/mie3-mvcrl.c | 46 1 file changed, 36 insertions(+), 10 deletions(-) diff --git a/tests/tcg/s390x/mie3-mvcrl.c b/tests

Re: [PATCH 05/12] target/s390x: Fix LRA overwriting the top 32 bits on DAT error

2023-07-04 Thread Ilya Leoshkevich
On Tue, 2023-07-04 at 09:47 +0200, David Hildenbrand wrote: > On 03.07.23 17:50, Ilya Leoshkevich wrote: > > When a DAT error occurs, LRA is supposed to write the error > > information > > to the bottom 32 bits of R1, and leave the top 32 bits of R1 alone. > > > > Fix by passing the original value

Re: [PATCH 05/12] target/s390x: Fix LRA overwriting the top 32 bits on DAT error

2023-07-04 Thread Richard Henderson
On 7/4/23 10:05, Ilya Leoshkevich wrote: +    ret = (r1 & 0x) | exc | 0x8000; ull missing for large constant? Will do. Just for my understanding, why is this necessary? 32-bit host; you'll get a warning for the large constant. r~

[PATCH 1/3] softmmu: Support concurrent bounce buffers

2023-07-04 Thread Mattias Nissler
It is not uncommon for device models to request mapping of several DMA regions at the same time. An example is igb (and probably other net devices as well) when a packet is spread across multiple descriptors. In order to support this when indirect DMA is used, as is the case when running the devic

[PATCH 3/3] vfio-user: Message-based DMA support

2023-07-04 Thread Mattias Nissler
Wire up support for DMA for the case where the vfio-user client does not provide mmap()-able file descriptors, but DMA requests must be performed via the VFIO-user protocol. This installs an indirect memory region, which already works for pci_dma_{read,write}, and pci_dma_map works thanks to the ex

[PATCH 0/3] Support message-based DMA in vfio-user server

2023-07-04 Thread Mattias Nissler
This series adds basic support for message-based DMA in qemu's vfio-user server. This is useful for cases where the client does not provide file descriptors for accessing system memory via memory mappings. My motivating use case is to hook up device models as PCIe endpoints to a hardware design. Th

[PATCH 2/3] softmmu: Remove DMA unmap notification callback

2023-07-04 Thread Mattias Nissler
According to old commit messages, this was introduced to retry a DMA operation at a later point in case the single bounce buffer is found to be busy. This was never used widely - only the dma-helpers code made use of it, but there are other device models that use multiple DMA mappings (concurrently

Re: [PATCH 05/12] target/s390x: Fix LRA overwriting the top 32 bits on DAT error

2023-07-04 Thread David Hildenbrand
  } else {   cc = 0;   ret |= addr & ~TARGET_PAGE_MASK; diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index 0cef6efbef4..a6079ab7b4f 100644 --- a/target/s390x/tcg/translate.c +++ b/target/s390x/tcg/translate.c @@ -2932,7 +2932,7 @@ static DisasJu

[PATCH v2 00/12] target/s390x: Miscellaneous TCG fixes

2023-07-04 Thread Ilya Leoshkevich
v1: https://lists.gnu.org/archive/html/qemu-devel/2023-07/msg00454.html v1 -> v2: Add ULL for a large constant (David). Add a comment explaining the usage of ALGFI in the LARL test. Hi, Randomized testing found a number of issues in the s390x emulation. This series fixes 6 of them (patc

[PATCH v2 03/12] target/s390x: Fix MDEB and MDEBR

2023-07-04 Thread Ilya Leoshkevich
These instructions multiply 32 bits by 32 bits, not 32 bits by 64 bits. Fixes: 83b00736f3d8 ("target-s390: Convert FP MULTIPLY") Cc: qemu-sta...@nongnu.org Reviewed-by: David Hildenbrand Signed-off-by: Ilya Leoshkevich --- target/s390x/tcg/fpu_helper.c| 3 ++- target/s390x/tcg/insn-data.h.i

[PATCH v2 09/12] tests/tcg/s390x: Test LARL with a large offset

2023-07-04 Thread Ilya Leoshkevich
Add a small test to prevent regressions. Acked-by: David Hildenbrand Signed-off-by: Ilya Leoshkevich --- tests/tcg/s390x/Makefile.target | 1 + tests/tcg/s390x/larl.c | 21 + 2 files changed, 22 insertions(+) create mode 100644 tests/tcg/s390x/larl.c diff --git a

[PATCH v2 07/12] target/s390x: Fix relative long instructions with large offsets

2023-07-04 Thread Ilya Leoshkevich
The expression "imm * 2" in gen_ri2() can wrap around if imm is large enough. Fix by casting imm to int64_t, like it's done in disas_jdest(). Fixes: e8ecdfeb30f0 ("Fix EXECUTE of relative branches") Reviewed-by: David Hildenbrand Signed-off-by: Ilya Leoshkevich --- target/s390x/tcg/translate.c

[PATCH v2 01/12] linux-user: elfload: Add more initial s390x PSW bits

2023-07-04 Thread Ilya Leoshkevich
Make the PSW look more similar to the real s390x userspace PSW. Except for being there, the newly added bits should not affect the userspace code execution. Reviewed-by: David Hildenbrand Signed-off-by: Ilya Leoshkevich --- linux-user/elfload.c | 4 +++- 1 file changed, 3 insertions(+), 1 delet

Re: [PATCH v2 05/12] target/s390x: Fix LRA overwriting the top 32 bits on DAT error

2023-07-04 Thread David Hildenbrand
On 04.07.23 10:12, Ilya Leoshkevich wrote: When a DAT error occurs, LRA is supposed to write the error information to the bottom 32 bits of R1, and leave the top 32 bits of R1 alone. Fix by passing the original value of R1 into helper and copying the top 32 bits to the return value. Fixes: d8fe

[PATCH v2 11/12] tests/tcg/s390x: Test MDEB and MDEBR

2023-07-04 Thread Ilya Leoshkevich
Add a small test to prevent regressions. Acked-by: David Hildenbrand Signed-off-by: Ilya Leoshkevich --- tests/tcg/s390x/Makefile.target | 1 + tests/tcg/s390x/mdeb.c | 30 ++ 2 files changed, 31 insertions(+) create mode 100644 tests/tcg/s390x/mdeb.c dif

[PATCH v2 10/12] tests/tcg/s390x: Test LRA

2023-07-04 Thread Ilya Leoshkevich
Add a small test to prevent regressions. Signed-off-by: Ilya Leoshkevich --- tests/tcg/s390x/Makefile.softmmu-target | 1 + tests/tcg/s390x/lra.S | 19 +++ 2 files changed, 20 insertions(+) create mode 100644 tests/tcg/s390x/lra.S diff --git a/tests/tcg/s390x

[PATCH v2 02/12] target/s390x: Fix EPSW CC reporting

2023-07-04 Thread Ilya Leoshkevich
EPSW should explicitly calculate and insert CC, like IPM does. Fixes: e30a9d3fea58 ("target-s390: Implement EPSW") Cc: qemu-sta...@nongnu.org Reviewed-by: David Hildenbrand Signed-off-by: Ilya Leoshkevich --- target/s390x/tcg/translate.c | 4 1 file changed, 4 insertions(+) diff --git a/t

[PATCH v2 05/12] target/s390x: Fix LRA overwriting the top 32 bits on DAT error

2023-07-04 Thread Ilya Leoshkevich
When a DAT error occurs, LRA is supposed to write the error information to the bottom 32 bits of R1, and leave the top 32 bits of R1 alone. Fix by passing the original value of R1 into helper and copying the top 32 bits to the return value. Fixes: d8fe4a9c284f ("target-s390: Convert LRA") Cc: qem

[PATCH v2 06/12] target/s390x: Fix LRA when DAT is off

2023-07-04 Thread Ilya Leoshkevich
LRA should perform DAT regardless of whether it's on or off. Disable DAT check for MMU_S390_LRA. Fixes: defb0e3157af ("s390x: Implement opcode helpers") Cc: qemu-sta...@nongnu.org Reviewed-by: David Hildenbrand Signed-off-by: Ilya Leoshkevich --- target/s390x/mmu_helper.c | 2 +- 1 file changed

[PATCH v2 12/12] tests/tcg/s390x: Test MVCRL with a large value in R0

2023-07-04 Thread Ilya Leoshkevich
Add a small test to prevent regressions. Reviewed-by: David Hildenbrand Signed-off-by: Ilya Leoshkevich --- tests/tcg/s390x/mie3-mvcrl.c | 46 1 file changed, 36 insertions(+), 10 deletions(-) diff --git a/tests/tcg/s390x/mie3-mvcrl.c b/tests/tcg/s390x/mie3

[PATCH v2 08/12] tests/tcg/s390x: Test EPSW

2023-07-04 Thread Ilya Leoshkevich
Add a small test to prevent regressions. Reviewed-by: David Hildenbrand Signed-off-by: Ilya Leoshkevich --- tests/tcg/s390x/Makefile.target | 1 + tests/tcg/s390x/epsw.c | 23 +++ 2 files changed, 24 insertions(+) create mode 100644 tests/tcg/s390x/epsw.c diff --

Re: [PULL 00/38] maintainer updates for 8.1: testing, fuzz, plugins, docs, gdbstub

2023-07-04 Thread Richard Henderson
On 7/3/23 15:43, Alex Bennée wrote: The following changes since commit d145c0da22cde391d8c6672d33146ce306e8bf75: Merge tag 'pull-tcg-20230701' ofhttps://gitlab.com/rth7680/qemu into staging (2023-07-01 08:55:37 +0200) are available in the Git repository at: https://gitlab.com/stsquad/q

Re: [PATCH 0/3] Support message-based DMA in vfio-user server

2023-07-04 Thread David Hildenbrand
On 04.07.23 10:06, Mattias Nissler wrote: This series adds basic support for message-based DMA in qemu's vfio-user server. This is useful for cases where the client does not provide file descriptors for accessing system memory via memory mappings. My motivating use case is to hook up device model

[PATCH v2 04/12] target/s390x: Fix MVCRL with a large value in R0

2023-07-04 Thread Ilya Leoshkevich
Using a large R0 causes an assertion error: qemu-s390x: target/s390x/tcg/mem_helper.c:183: access_prepare_nf: Assertion `size > 0 && size <= 4096' failed. Even though PoP explicitly advises against using more than 8 bits for the size, an emulator crash is never a good thing. Fix by truncati

[PATCH] target/riscv: Add Zihintntl extension ISA string to DTS

2023-07-04 Thread Jason Chien
RVA23 Profiles states: The RVA23 profiles are intended to be used for 64-bit application processors that will run rich OS stacks from standard binary OS distributions and with a substantial number of third-party binary user applications that will be supported over a considerable length of time in t

[PATCH] ui/vnc-clipboard: fix infinite loop in inflate_buffer (CVE-2023-3255)

2023-07-04 Thread Mauro Matteo Cascella
A wrong exit condition may lead to an infinite loop when inflating a valid zlib buffer containing some extra bytes in the `inflate_buffer` function. The bug only occurs post-authentication. Return the buffer immediately if the end of the compressed data has been reached (Z_STREAM_END). Fixes: CVE-

Re: [PATCH 5/9] accel: Move CPUTLB to CPUState and assert offset

2023-07-04 Thread Anton Johansson via
On 6/30/23 16:16, Richard Henderson wrote: On 6/30/23 14:25, Anton Johansson wrote: @@ -448,6 +448,13 @@ struct CPUState {     /* track IOMMUs whose translations we've cached in the TCG TLB */   GArray *iommu_notifiers; + +    /* + * The following fields needs to be within CPU_M

Re: [PATCH 02/13] ppc440: Add cpu link property to PCIe controller model

2023-07-04 Thread Philippe Mathieu-Daudé
On 4/7/23 00:02, BALATON Zoltan wrote: The PCIe controller model uses PPC DCRs but cannot be modeled with TYPE_PPC4xx_DCR_DEVICE as it derives from TYPE_PCIE_HOST_BRIDGE. Add a cpu link property to it similar to other DCR devices to allow registering DCRs from the device model. Signed-off-by: BA

Re: [PATCH 01/13] ppc440: Change ppc460ex_pcie_init() parameter type

2023-07-04 Thread Philippe Mathieu-Daudé
On 4/7/23 00:02, BALATON Zoltan wrote: Change parameter of ppc460ex_pcie_init() from env to cpu to allow further refactoring. Signed-off-by: BALATON Zoltan --- hw/ppc/ppc440.h| 2 +- hw/ppc/ppc440_uc.c | 7 --- hw/ppc/sam460ex.c | 2 +- 3 files changed, 6 insertions(+), 5 deletion

Re: [PATCH 4/9] include/hw: introduce CPU_MAX_NEGATIVE_ENV_OFFSET

2023-07-04 Thread Anton Johansson via
On 6/30/23 16:19, Richard Henderson wrote: On 6/30/23 14:25, Anton Johansson wrote: For reasons related to code-generation quality, the offset of CPUTLBDescFast and IcountDecr from CPUArchState needs to fit within 11 bits of displacement (arm[32|64] and riscv addressing modes). This commit in

Re: [PATCH 03/13] ppc440: Add a macro to shorten PCIe controller DCR registration

2023-07-04 Thread Philippe Mathieu-Daudé
On 4/7/23 00:02, BALATON Zoltan wrote: It is more readable to wrap the complex call to ppc_dcr_register in a macro when needed repeatedly. Signed-off-by: BALATON Zoltan --- hw/ppc/ppc440_uc.c | 76 +- 1 file changed, 28 insertions(+), 48 deletions(

Re: [PATCH 04/13] ppc440: Rename local variable in dcr_read_pcie()

2023-07-04 Thread Philippe Mathieu-Daudé
On 4/7/23 00:02, BALATON Zoltan wrote: Rename local variable storing state struct in dcr_read_pcie() for brevity and consistency with other functions. Signed-off-by: BALATON Zoltan --- hw/ppc/ppc440_uc.c | 50 +++--- 1 file changed, 25 insertions(+), 2

Re: [PATCH 05/13] ppc440: Stop using system io region for PCIe buses

2023-07-04 Thread Philippe Mathieu-Daudé
On 4/7/23 00:02, BALATON Zoltan wrote: Add separate memory regions for the mem and io spaces of the PCIe bus to avoid different buses using the same system io region. "Reduce the I/O space to 64K." Signed-off-by: BALATON Zoltan --- hw/ppc/ppc440_uc.c | 9 ++--- 1 file changed, 6 inser

Re: [PATCH 07/13] ppc440: Add busnum property to PCIe controller model

2023-07-04 Thread Philippe Mathieu-Daudé
On 4/7/23 00:02, BALATON Zoltan wrote: Instead of guessing controller number from dcrn_base add a property so the device does not need knowledge about where it is used. Signed-off-by: BALATON Zoltan --- hw/ppc/ppc440_uc.c | 25 +++-- 1 file changed, 11 insertions(+), 14 d

Re: [PATCH 08/13] ppc440: Remove ppc460ex_pcie_init legacy init function

2023-07-04 Thread Philippe Mathieu-Daudé
On 4/7/23 00:02, BALATON Zoltan wrote: After previous changes we can now remove the legacy init function and move the device creation to board code. Signed-off-by: BALATON Zoltan --- hw/ppc/ppc440.h | 1 - hw/ppc/ppc440_uc.c | 21 - hw/ppc/sam460ex.c

Re: [PATCH 0/9] Collapse CPUNegativeOffsetState into CPUState

2023-07-04 Thread Anton Johansson via
On 7/1/23 11:21, Paolo Bonzini wrote: On 6/30/23 14:25, Anton Johansson via wrote: CPUNegativeOffsetState is a struct placed immediately before CPUArchState in the ArchCPU struct.  Its purpose is to ensure that certain fields (CPUTLBDescFast, IcountDecr) lay within a small negative offset of C

Re: [PATCH 09/13] ppc4xx_pci: Rename QOM type name define

2023-07-04 Thread Philippe Mathieu-Daudé
On 4/7/23 00:02, BALATON Zoltan wrote: Rename the TYPE_PPC4xx_PCI_HOST_BRIDGE define and its string value to match each other and other similar types and to avoid confusion with "ppc4xx-host-bridge" type defined in same file. Signed-off-by: BALATON Zoltan --- hw/ppc/ppc440_bamboo.c | 3 +--

Re: [PATCH 10/13] ppc4xx_pci: Add define for ppc4xx-host-bridge type name

2023-07-04 Thread Philippe Mathieu-Daudé
On 4/7/23 00:02, BALATON Zoltan wrote: Add a QOM type name define for ppc4xx-host-bridge in the common header and replace direct use of the string name with the constant. Signed-off-by: BALATON Zoltan --- hw/ppc/ppc440_pcix.c| 3 ++- hw/ppc/ppc4xx_pci.c | 4 ++-- include/hw/ppc/ppc4

Re: [PATCH 11/13] ppc440_pcix: Rename QOM type define abd move it to common header

2023-07-04 Thread Philippe Mathieu-Daudé
On 4/7/23 00:02, BALATON Zoltan wrote: Rename TYPE_PPC440_PCIX_HOST_BRIDGE to better match its string value, move it to common header and use it also in sam460ex to replace hard coded type name. Signed-off-by: BALATON Zoltan --- hw/ppc/ppc440_pcix.c| 9 - hw/ppc/sam460ex.c

Re: [PATCH 12/13] ppc440_pcix: Don't use iomem for regs

2023-07-04 Thread Philippe Mathieu-Daudé
On 4/7/23 00:02, BALATON Zoltan wrote: The iomem memory region is better used for the PCI IO space but currently used for registers. Stop using it for that to allow this to be cleaned up in the next patch. Signed-off-by: BALATON Zoltan --- hw/ppc/ppc440_pcix.c | 7 --- 1 file changed, 4

Re: [PATCH 13/13] ppc440_pcix: Stop using system io region for PCI bus

2023-07-04 Thread Philippe Mathieu-Daudé
On 4/7/23 00:02, BALATON Zoltan wrote: Use the iomem region for the PCI io space and map it directly from the board without an intermediate alias that is not really needed. "Reduce the I/O region to 64K." Signed-off-by: BALATON Zoltan --- hw/ppc/ppc440_pcix.c | 8 +--- hw/ppc/sam460ex

Re: [PATCH] ui/vnc-clipboard: fix infinite loop in inflate_buffer (CVE-2023-3255)

2023-07-04 Thread Marc-André Lureau
On Tue, Jul 4, 2023 at 10:42 AM Mauro Matteo Cascella wrote: > A wrong exit condition may lead to an infinite loop when inflating a > valid zlib buffer containing some extra bytes in the `inflate_buffer` > function. The bug only occurs post-authentication. Return the buffer > immediately if the e

Re: [PATCH v1 2/5] linux-headers: Import arm-smccc.h from Linux v6.4-rc7

2023-07-04 Thread Cornelia Huck
On Mon, Jun 26 2023, Shaoqin Huang wrote: > Copy in the SMCCC definitions from the kernel, which will be used to > implement SMCCC handling in userspace. > > Signed-off-by: Shaoqin Huang > --- > linux-headers/linux/arm-smccc.h | 240 > 1 file changed, 240 insert

Re: [PATCH v1 4/5] arm/kvm: add skeleton implementation for userspace SMCCC call handling

2023-07-04 Thread Cornelia Huck
On Mon, Jun 26 2023, Shaoqin Huang wrote: > The SMCCC call filtering provide the ability to forward the SMCCC call > to userspace, so we provide a new option `user-smccc` to enable handling > SMCCC call in userspace, the default value is off. > > And add the skeleton implementation for userspace

[PATCH] virtio-gpu: fix potential divide-by-zero regression

2023-07-04 Thread marcandre . lureau
From: Marc-André Lureau Commit 9462ff4695aa0 ("virtio-gpu/win32: allocate shareable 2d resources/images") introduces a division, which can lead to crashes when "height" is 0. Fixes: https://gitlab.com/qemu-project/qemu/-/issues/1744 Signed-off-by: Marc-André Lureau --- hw/display/virtio-gpu.c

Re: [PATCH] virtio-gpu: fix potential divide-by-zero regression

2023-07-04 Thread Thomas Huth
On 04/07/2023 11.19, marcandre.lur...@redhat.com wrote: From: Marc-André Lureau Commit 9462ff4695aa0 ("virtio-gpu/win32: allocate shareable 2d resources/images") introduces a division, which can lead to crashes when "height" is 0. Fixes: https://gitlab.com/qemu-project/qemu/-/issues/1744 Signe

Re: [PATCH] virtio-gpu: fix potential divide-by-zero regression

2023-07-04 Thread Alexander Bulekov
On 230704 1119, marcandre.lur...@redhat.com wrote: > From: Marc-André Lureau > > Commit 9462ff4695aa0 ("virtio-gpu/win32: allocate shareable 2d > resources/images") introduces a division, which can lead to crashes when > "height" is 0. > > Fixes: https://gitlab.com/qemu-project/qemu/-/issues/174

Re: [PATCH] virtio-gpu: fix potential divide-by-zero regression

2023-07-04 Thread Marc-André Lureau
On Tue, Jul 4, 2023 at 11:24 AM Thomas Huth wrote: > On 04/07/2023 11.19, marcandre.lur...@redhat.com wrote: > > From: Marc-André Lureau > > > > Commit 9462ff4695aa0 ("virtio-gpu/win32: allocate shareable 2d > > resources/images") introduces a division, which can lead to crashes when > > "height

Re: [PATCH 1/1] A new virtio pci device named virtio-vcpu-stall-watchdog-pci

2023-07-04 Thread zhanghao1
> On Thu, Jun 15, 2023 at 02:13:02PM +0800, zhanghao1 wrote: > > Each vcpu creates a corresponding timer task. The watchdog > > is driven by a timer according to a certain period. Each time > > the timer expires, the counter is decremented. When the counter > > is "0", the watchdog considers the vc

[PATCH] kconfig: Add PCIe devices to s390xx machines

2023-07-04 Thread Cédric Le Goater
It is useful to extend the number of available PCI devices to KVM guests for passthrough scenarios and also to expose these models to a different (big endian) architecture. Signed-off-by: Cédric Le Goater --- hw/s390x/Kconfig | 4 1 file changed, 4 insertions(+) diff --git a/hw/s390x/Kconf

Re: [PATCH 03/13] ppc440: Add a macro to shorten PCIe controller DCR registration

2023-07-04 Thread BALATON Zoltan
On Tue, 4 Jul 2023, Philippe Mathieu-Daudé wrote: On 4/7/23 00:02, BALATON Zoltan wrote: It is more readable to wrap the complex call to ppc_dcr_register in a macro when needed repeatedly. Signed-off-by: BALATON Zoltan --- hw/ppc/ppc440_uc.c | 76 +

Re: [PATCH 10/13] ppc4xx_pci: Add define for ppc4xx-host-bridge type name

2023-07-04 Thread BALATON Zoltan
On Tue, 4 Jul 2023, Philippe Mathieu-Daudé wrote: On 4/7/23 00:02, BALATON Zoltan wrote: Add a QOM type name define for ppc4xx-host-bridge in the common header and replace direct use of the string name with the constant. Signed-off-by: BALATON Zoltan --- hw/ppc/ppc440_pcix.c| 3 ++- hw/

Re: QEMU assert (was: [xen-unstable test] 181558: regressions - FAIL)

2023-07-04 Thread Anthony PERARD via
On Wed, Jun 28, 2023 at 02:31:39PM +0200, Roger Pau Monné wrote: > On Fri, Jun 23, 2023 at 03:04:21PM +, osstest service owner wrote: > > flight 181558 xen-unstable real [real] > > http://logs.test-lab.xenproject.org/osstest/logs/181558/ > > > > Regressions :-( > > > > Tests which did not suc

Re: [PATCH 12/13] ppc440_pcix: Don't use iomem for regs

2023-07-04 Thread BALATON Zoltan
On Tue, 4 Jul 2023, Philippe Mathieu-Daudé wrote: On 4/7/23 00:02, BALATON Zoltan wrote: The iomem memory region is better used for the PCI IO space but currently used for registers. Stop using it for that to allow this to be cleaned up in the next patch. Signed-off-by: BALATON Zoltan --- hw

Re: [PATCH] ui/vnc-clipboard: fix infinite loop in inflate_buffer (CVE-2023-3255)

2023-07-04 Thread Mauro Matteo Cascella
On Tue, Jul 4, 2023 at 11:03 AM Marc-André Lureau wrote: > > > > On Tue, Jul 4, 2023 at 10:42 AM Mauro Matteo Cascella > wrote: >> >> A wrong exit condition may lead to an infinite loop when inflating a >> valid zlib buffer containing some extra bytes in the `inflate_buffer` >> function. The bug

Re: [PATCH 05/13] ppc440: Stop using system io region for PCIe buses

2023-07-04 Thread BALATON Zoltan
On Tue, 4 Jul 2023, Philippe Mathieu-Daudé wrote: On 4/7/23 00:02, BALATON Zoltan wrote: Add separate memory regions for the mem and io spaces of the PCIe bus to avoid different buses using the same system io region. "Reduce the I/O space to 64K." Unlike the other similar patch this does not

Re: [PATCH 03/13] ppc440: Add a macro to shorten PCIe controller DCR registration

2023-07-04 Thread Philippe Mathieu-Daudé
On 4/7/23 11:33, BALATON Zoltan wrote: On Tue, 4 Jul 2023, Philippe Mathieu-Daudé wrote: On 4/7/23 00:02, BALATON Zoltan wrote: It is more readable to wrap the complex call to ppc_dcr_register in a macro when needed repeatedly. Signed-off-by: BALATON Zoltan ---   hw/ppc/ppc440_uc.c | 76 +

Re: QEMU assert (was: [xen-unstable test] 181558: regressions - FAIL)

2023-07-04 Thread Roger Pau Monné
On Tue, Jul 04, 2023 at 10:37:38AM +0100, Anthony PERARD wrote: > On Wed, Jun 28, 2023 at 02:31:39PM +0200, Roger Pau Monné wrote: > > On Fri, Jun 23, 2023 at 03:04:21PM +, osstest service owner wrote: > > > flight 181558 xen-unstable real [real] > > > http://logs.test-lab.xenproject.org/osstes

Re: [PATCH 12/13] ppc440_pcix: Don't use iomem for regs

2023-07-04 Thread Philippe Mathieu-Daudé
On 4/7/23 11:37, BALATON Zoltan wrote: On Tue, 4 Jul 2023, Philippe Mathieu-Daudé wrote: On 4/7/23 00:02, BALATON Zoltan wrote: The iomem memory region is better used for the PCI IO space but currently used for registers. Stop using it for that to allow this to be cleaned up in the next patch.

RE: [PATCH v1 0/5] target/arm: Handle psci calls in userspace

2023-07-04 Thread Salil Mehta via
Hi Shaoqin, Just saw this. Apologies. I missed to reply this earlier as I was bit disconnected for last few days. > From: Shaoqin Huang > Sent: Tuesday, June 27, 2023 3:35 AM > Hi Salil, > > On 6/26/23 21:42, Salil Mehta wrote: > >> From: Shaoqin Huang > >> Sent: Monday, June 26, 2023 7:49 AM

Re: [PATCH v2 1/5] ppc/pnv: quad xscom callbacks are P9 specific

2023-07-04 Thread Frederic Barrat
On 04/07/2023 07:42, Joel Stanley wrote: Rename the functions to include P9 in the name in preparation for adding P10 versions. Correct the unimp read message while we're changing the function. Reviewed-by: Cédric Le Goater Signed-off-by: Joel Stanley --- Reviewed-by: Frederic Barrat

Re: [PATCH v2 2/5] ppc/pnv: Subclass quad xscom callbacks

2023-07-04 Thread Frederic Barrat
On 04/07/2023 07:42, Joel Stanley wrote: Make the existing pnv_quad_xscom_read/write be P9 specific, in preparation for a different P10 callback. Reviewed-by: Cédric Le Goater Signed-off-by: Joel Stanley --- Reviewed-by: Frederic Barrat Fred v2: Add scom region size to class ---

Re: [PATCH 07/15] hw/timer/arm_timer: Extract arm_timer_reset()

2023-07-04 Thread Philippe Mathieu-Daudé
On 8/6/23 16:46, Peter Maydell wrote: On Wed, 31 May 2023 at 21:36, Philippe Mathieu-Daudé wrote: Extract arm_timer_reset() before converting this model to QOM/QDev in few commits. This will become our DeviceReset handler. Signed-off-by: Philippe Mathieu-Daudé --- hw/timer/arm_timer.c | 7

Re: [PATCH] kconfig: Add PCIe devices to s390xx machines

2023-07-04 Thread Thomas Huth
On 04/07/2023 11.32, Cédric Le Goater wrote: It is useful to extend the number of available PCI devices to KVM guests for passthrough scenarios and also to expose these models to a different (big endian) architecture. Maybe mention that these devices can work on s390x since they support MSI-X

Re: [PATCH v2 3/5] ppc/pnv: Add P10 quad xscom model

2023-07-04 Thread Frederic Barrat
On 04/07/2023 07:42, Joel Stanley wrote: Add a PnvQuad class for the P10 powernv machine. No xscoms are implemented yet, but this allows them to be added. The size is reduced to avoid the quad region from overlapping with the core region. address-space: xscom-0 -0

Re: [PATCH v2 5/5] ppc/pnv: Return zero for core thread state xscom

2023-07-04 Thread Frederic Barrat
On 04/07/2023 07:42, Joel Stanley wrote: Firmware now warns if booting in LPAR per core mode (PPC bit 62). So this warning doesn't trigger, report the core thread state is 0. Reviewed-by: Cédric Le Goater Signed-off-by: Joel Stanley --- Reviewed-by: Frederic Barrat Fred hw/ppc/pn

Re: [PATCH v2 4/5] ppc/pnv: Add P10 core xscom model

2023-07-04 Thread Frederic Barrat
On 04/07/2023 07:42, Joel Stanley wrote: Like the quad xscoms, add a core model for P10 to allow future differentiation from P9. Signed-off-by: Joel Stanley --- Reviewed-by: Frederic Barrat Fred hw/ppc/pnv_core.c | 44 ++-- 1 file changed,

Re: [PATCH 12/13] ppc440_pcix: Don't use iomem for regs

2023-07-04 Thread BALATON Zoltan
On Tue, 4 Jul 2023, Philippe Mathieu-Daudé wrote: On 4/7/23 11:37, BALATON Zoltan wrote: On Tue, 4 Jul 2023, Philippe Mathieu-Daudé wrote: On 4/7/23 00:02, BALATON Zoltan wrote: The iomem memory region is better used for the PCI IO space but currently used for registers. Stop using it for that

Re: [PATCH qemu v3] aspeed add montblanc bmc reference from fuji

2023-07-04 Thread Cédric Le Goater
On 7/3/23 15:31, Cédric Le Goater wrote: On 7/3/23 15:06, ~ssinprem wrote: From: Sittisak Sinprem - I2C list follow I2C Tree v1.6 20230320 - fru eeprom data use FB FRU format version 4 Signed-off-by: Sittisak Sinprem Super ! Reviewed-by: Cédric Le Goater Taking that back. I missed a

Re: [PATCH v21 02/20] s390x/cpu topology: add topology entries on CPU hotplug

2023-07-04 Thread Thomas Huth
On 30/06/2023 11.17, Pierre Morel wrote: The topology information are attributes of the CPU and are specified during the CPU device creation. On hot plug we: - calculate the default values for the topology for drawers, books and sockets in the case they are not specified. - verify the CPU att

Re: [PATCH v6 5/5] hw/pci: ensure PCIE devices are plugged into only slot 0 of PCIE port

2023-07-04 Thread Ani Sinha
> On 04-Jul-2023, at 11:09 AM, Ani Sinha wrote: > > > >> On 04-Jul-2023, at 10:31 AM, Akihiko Odaki wrote: >> >> On 2023/07/03 15:08, Ani Sinha wrote: On 02-Jul-2023, at 10:29 AM, Michael S. Tsirkin wrote: On Sat, Jul 01, 2023 at 04:09:31PM +0900, Akihiko Odaki wrote:

Re: [PATCH v6 5/5] hw/pci: ensure PCIE devices are plugged into only slot 0 of PCIE port

2023-07-04 Thread Michael S. Tsirkin
On Tue, Jul 04, 2023 at 04:03:54PM +0530, Ani Sinha wrote: > > > > On 04-Jul-2023, at 11:09 AM, Ani Sinha wrote: > > > > > > > >> On 04-Jul-2023, at 10:31 AM, Akihiko Odaki > >> wrote: > >> > >> On 2023/07/03 15:08, Ani Sinha wrote: > On 02-Jul-2023, at 10:29 AM, Michael S. Tsirkin w

Re: [PATCH] vfio: Fix null pointer dereference bug in vfio_bars_finalize()

2023-07-04 Thread Avihai Horon
On 03/07/2023 19:56, Philippe Mathieu-Daudé wrote: External email: Use caution opening links or attachments On 3/7/23 18:39, Avihai Horon wrote: vfio_realize() has the following flow: 1. vfio_bars_prepare() -- sets VFIOBAR->size. 2. msix_early_setup(). 3. vfio_bars_register() -- allocates VF

Re: [RISC-V] ERROR:../accel/tcg/cpu-exec.c:1028:cpu_exec_setjmp: assertion failed: (cpu == current_cpu)

2023-07-04 Thread Andreas Schwab
I think the issue is that the value returned from brk(0) is no longer page aligned. $ ./qemu-riscv64 -strace ../exe1 18329 brk(NULL) = 0x00303000 18329 faccessat(AT_FDCWD,"/etc/ld.so.preload",R_OK,0x3010d0) = -1 errno=2 (No such file or directory) 18329 openat(AT_FDCWD,"/etc/ld.so.cache"

[PATCH qemu v4] aspeed add montblanc bmc reference from fuji

2023-07-04 Thread ~ssinprem
From: Sittisak Sinprem - I2C list follow I2C Tree v1.6 20230320 - fru eeprom data use FB FRU format version 4 Signed-off-by: Sittisak Sinprem --- docs/system/arm/aspeed.rst | 1 + hw/arm/aspeed.c| 63 ++ hw/arm/aspeed_eeprom.c | 50 +

Re: [PATCH qemu v4] aspeed add montblanc bmc reference from fuji

2023-07-04 Thread Sittisak Sinprem
Hi Cédric, Please stop this patch, after the test, the eeprom content is incorrect, root@bmc:~# weutil -l bmc_eeprom/sys/bus/i2c/devices/i2c-8/8-0051/eeprom chassis_eeprom/sys/bus/i2c/devices/i2c-6/6-0053/eeprom dummy_eeprom/etc/weutil/meta_eeprom_v4_sample.bin scm_eeprom/sys/bus/

Re: [PATCH v6 5/5] hw/pci: ensure PCIE devices are plugged into only slot 0 of PCIE port

2023-07-04 Thread Ani Sinha
> On 04-Jul-2023, at 4:06 PM, Michael S. Tsirkin wrote: > > On Tue, Jul 04, 2023 at 04:03:54PM +0530, Ani Sinha wrote: >> >> >>> On 04-Jul-2023, at 11:09 AM, Ani Sinha wrote: >>> >>> >>> On 04-Jul-2023, at 10:31 AM, Akihiko Odaki wrote: On 2023/07/03 15:08, Ani Sin

[PATCH qemu v5] aspeed add montblanc bmc reference from fuji

2023-07-04 Thread ~ssinprem
From: Sittisak Sinprem - I2C list follow I2C Tree v1.6 20230320 - fru eeprom data use FB FRU format version 4 Signed-off-by: Sittisak Sinprem --- docs/system/arm/aspeed.rst | 1 + hw/arm/aspeed.c| 65 ++ hw/arm/aspeed_eeprom.c | 50 +

  1   2   3   4   >