[PATCH 07/10] tests/tcg/tricore: Add test from 'max' to 'shas'

2023-09-13 Thread Bastian Koppelmann
Signed-off-by: Bastian Koppelmann --- tests/tcg/tricore/asm/macros.h | 13 tests/tcg/tricore/asm/test_arith.S | 105 + 2 files changed, 118 insertions(+) diff --git a/tests/tcg/tricore/asm/macros.h b/tests/tcg/tricore/asm/macros.h index

[PATCH 01/10] tests/tcg/tricore: Extended and non-extened regs now match

2023-09-13 Thread Bastian Koppelmann
RSx for d regs and e regs now use the same numbering. This makes sure that mixing d and e registers in an insn test will not overwrite data between registers. Signed-off-by: Bastian Koppelmann --- tests/tcg/tricore/asm/macros.h | 38 +- 1 file changed, 19

[PATCH 04/10] tests/tcg/tricore: Add test for all arith insns up to addx

2023-09-13 Thread Bastian Koppelmann
Signed-off-by: Bastian Koppelmann --- tests/tcg/tricore/Makefile.softmmu-target | 3 +- tests/tcg/tricore/asm/macros.h| 50 +++ tests/tcg/tricore/asm/test_arith.S| 41 +++ 3 files changed, 93 insertions(+), 1 deletion(-) create mode

[PATCH 03/10] tests/tcg: Reset result register after each test

2023-09-13 Thread Bastian Koppelmann
some insns use the result register implicitly as an input. Thus, we could end up with data from the previous insn spilling over. Signed-off-by: Bastian Koppelmann --- tests/tcg/tricore/asm/macros.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

[PATCH 05/10] tests/tcg/tricore: Add test for and to csub

2023-09-13 Thread Bastian Koppelmann
Signed-off-by: Bastian Koppelmann --- tests/tcg/tricore/asm/macros.h | 11 +++ tests/tcg/tricore/asm/test_arith.S | 47 ++ 2 files changed, 58 insertions(+) diff --git a/tests/tcg/tricore/asm/macros.h b/tests/tcg/tricore/asm/macros.h index

[PATCH 09/10] target/tricore: Remove CSFRs from cpu.h

2023-09-13 Thread Bastian Koppelmann
these are already defined in 'csfr.h.inc'. We don't need to duplicate these registers. Signed-off-by: Bastian Koppelmann --- target/tricore/cpu.h | 143 +++ 1 file changed, 9 insertions(+), 134 deletions(-) diff --git a/target/tricore/cpu.h

[PATCH 08/10] tests/tcg/tricore: Add test from 'shuffle' to 'xor.t'

2023-09-13 Thread Bastian Koppelmann
Signed-off-by: Bastian Koppelmann --- tests/tcg/tricore/asm/test_arith.S | 34 ++ 1 file changed, 34 insertions(+) diff --git a/tests/tcg/tricore/asm/test_arith.S b/tests/tcg/tricore/asm/test_arith.S index 728509cfa9..02637f89f9 100644 ---

[PATCH 02/10] hw/tricore: Log failing test in testdevice

2023-09-13 Thread Bastian Koppelmann
Signed-off-by: Bastian Koppelmann --- hw/tricore/tricore_testdevice.c | 4 1 file changed, 4 insertions(+) diff --git a/hw/tricore/tricore_testdevice.c b/hw/tricore/tricore_testdevice.c index a1563aa568..d0f8db9089 100644 --- a/hw/tricore/tricore_testdevice.c +++

[PATCH 06/10] tests/tcg/tricore: Add from dextr to lt

2023-09-13 Thread Bastian Koppelmann
Signed-off-by: Bastian Koppelmann --- tests/tcg/tricore/asm/macros.h | 51 ++-- tests/tcg/tricore/asm/test_arith.S | 53 ++ 2 files changed, 102 insertions(+), 2 deletions(-) diff --git a/tests/tcg/tricore/asm/macros.h

Re: [PATCH] gitlab: remove unreliable avocado CI jobs

2023-09-13 Thread Daniel P . Berrangé
On Wed, Sep 13, 2023 at 11:35:12AM +0100, Alex Bennée wrote: > > Philippe Mathieu-Daudé writes: > > > On 13/9/23 11:18, Peter Maydell wrote: > >> On Tue, 12 Sept 2023 at 21:00, Thomas Huth wrote: > >>> Please don't remove the whole job! Just disable the failing tests within > >>> the job,

Re: [PATCH] gitlab: remove unreliable avocado CI jobs

2023-09-13 Thread Alex Bennée
Philippe Mathieu-Daudé writes: > On 13/9/23 11:18, Peter Maydell wrote: >> On Tue, 12 Sept 2023 at 21:00, Thomas Huth wrote: >>> Please don't remove the whole job! Just disable the failing tests within >>> the job, e.g.: >>> >>> diff --git a/tests/avocado/replay_kernel.py

Re: [QEMU PATCH v4 10/13] virtio-gpu: Resource UUID

2023-09-13 Thread Akihiko Odaki
On 2023/09/13 16:55, Albert Esteve wrote: Hi Antonio, If I'm not mistaken, this patch is related with: https://lists.gnu.org/archive/html/qemu-devel/2023-09/msg01853.html IMHO, ideally, virtio-gpu and vhost-user-gpu both,

Re: qemu-riscv32 usermode still broken?

2023-09-13 Thread Andreas K. Huettel
Am Mittwoch, 13. September 2023, 10:06:01 CEST schrieb Michael Tokarev: > 13.09.2023 04:41, LIU Zhiwei wrote: > > > > On 2023/9/13 6:31, Andreas K. Huettel wrote: > .. > >> * Something seems wrong in the signal handling (?): > > > > If it is wrong for signal handling and for 32-bit, I guess it

Re: [PATCH v5 0/6] target/i386: Restrict system-specific features from user emulation

2023-09-13 Thread Paolo Bonzini
On 9/13/23 11:30, Philippe Mathieu-Daudé wrote: Since v4: - Addressed Paolo's suggestions (clearly better) Too many system-specific code (and in particular KVM related) is pulled in user-only build. This led to adding unjustified stubs as kludge to unagressive linker non-optimizations. This

[PATCH] hw/cxl: Fix out of bound array access

2023-09-13 Thread Dmitry Frolov
According to cxl_interleave_ways_enc(), fw->num_targets is allowed to be up to 16. This also corresponds to CXL specs. So, the fw->target_hbs[] array is iterated from 0 to 15. But it is staticaly declared of length 8. Thus, out of bound array access may occur. Fixes: c28db9e000 ("hw/pci-bridge:

Re: [PATCH v11 0/9] rutabaga_gfx + gfxstream

2023-09-13 Thread Alyssa Ross
Gurchetan Singh writes: > It's harder to get the attention of the Android build team than the Chrome > build team. Though, there are a few issues with AEMU/gfxstream packaging > we also need to figure out -- see "[PATCH v13 0/9] rutabaga_gfx + > gfxstream" for details -- interested in your

Re: CI container image interference between staging and staging-7.2

2023-09-13 Thread Stefan Hajnoczi
On Wed, Sep 13, 2023, 03:26 Michael Tokarev wrote: > 13.09.2023 02:07, Stefan Hajnoczi wrote: > > Hi, > > TL;DR Michael: Please check that the staging-7.2 branch has Dan's > > commit e28112d00703abd136e2411d23931f4f891c9244 ("gitlab: stable > > staging branches publish containers in a separate

Re: [PATCH] fpu: Add conversions between bfloat16 and [u]int8

2023-09-13 Thread LIU Zhiwei
Hi Richard, Can you pick it to your tree? Thanks, Zhiwei On 2023/5/31 14:54, LIU Zhiwei wrote: We missed these functions when upstreaming the bfloat16 support. Signed-off-by: LIU Zhiwei --- fpu/softfloat.c | 58 + include/fpu/softfloat.h |

[PATCH 0/6] Add Block-TLB support for hppa target

2023-09-13 Thread deller
From: Helge Deller All 32-bit hppa CPUs allow a fixed number of TLB entries to have a different page size than the default 4k. Those are called "Block-TLBs" and are created at startup by the operating system and managed by the firmware of hppa machines through the firmware PDC_BLOCK_TLB call.

[PATCH 5/6] target/hppa: Extract diagnose immediate value

2023-09-13 Thread deller
From: Helge Deller Extract the immediate value given by the diagnose CPU instruction. This will be needed to distinguish the various diagnose calls. Signed-off-by: Helge Deller --- target/hppa/insns.decode | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH 4/6] target/hppa: Add BTLB support to hppa TLB functions

2023-09-13 Thread deller
From: Helge Deller Change the TLB code to store the Block-TLBs at the beginning of the TLB table. New 4k-TLB entries which which are added later shall not overwrite those BTLB entries. Make sure that when the TLB is cleared by the OS via the ptlbe instruction, the Block-TLBs will not be

[PATCH 2/6] target/hppa: Allow up to 16 BTLB entries

2023-09-13 Thread deller
From: Helge Deller Reserve 16 out of the 256 TLB entries for Block-TLBs. Signed-off-by: Helge Deller --- target/hppa/cpu.h | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h index fa13694dab..23852d89b2 100644 ---

[PATCH 6/6] target/hppa: Wire up diag instruction to support BTLB

2023-09-13 Thread deller
From: Helge Deller Wire up the hppa diag instruction to support Block-TLBs when called with the 0x100 value. The diag_btlb() helper function does all necessary steps to emulate the PDC BTLB firmware function, which includes providing BTLB info, adding a new BTLB, deleting a BTLB and removing

[PATCH 3/6] target/hppa: Provide qemu version via fw_cfg to firmware

2023-09-13 Thread deller
From: Helge Deller Report the new number of TLB entries (without BTLBs) to the guest and drop reporting of BTLB entries which weren't used at all. Clear all BTLB and TLB entries at machine reset. Signed-off-by: Helge Deller --- hw/hppa/machine.c | 10 +- 1 file changed, 5

Re: [PATCH 0/4] ci: fix hang of FreeBSD CI jobs

2023-09-13 Thread Philippe Mathieu-Daudé
On 13/9/23 11:02, Thomas Huth wrote: On 13/09/2023 10.48, Alex Bennée wrote: Thomas Huth writes: On 12/09/2023 20.41, Daniel P. Berrangé wrote: This addresses     https://gitlab.com/qemu-project/qemu/-/issues/1882 Which turned out to be a genuine flaw which we missed during merge as the

Re: [PATCH] gitlab: remove unreliable avocado CI jobs

2023-09-13 Thread Philippe Mathieu-Daudé
On 13/9/23 11:18, Peter Maydell wrote: On Tue, 12 Sept 2023 at 21:00, Thomas Huth wrote: Please don't remove the whole job! Just disable the failing tests within the job, e.g.: diff --git a/tests/avocado/replay_kernel.py b/tests/avocado/replay_kernel.py --- a/tests/avocado/replay_kernel.py

[PATCH v5 4/6] target/i386: Move x86_cpu_get_migratable_flags() around

2023-09-13 Thread Philippe Mathieu-Daudé
x86_cpu_get_migratable_flags() is only used once in x86_cpu_get_supported_feature_word(). Move it the code just before its caller, to reduce #ifdef'ry in the next commit, when we restrict both functions to system emulation. Signed-off-by: Philippe Mathieu-Daudé --- target/i386/cpu.c | 46

[RFC PATCH v5 5/6] target/i386: Restrict system-specific code from user emulation

2023-09-13 Thread Philippe Mathieu-Daudé
Restrict calls to: - kvm_arch_get_supported_cpuid() - kvm_arch_get_supported_msr_feature() - kvm_request_xsave_components() - kvm_hyperv_expand_features() so we can remove restrict "kvm/kvm_i386.h" and all its declarations to system emulation (see the next commit). Signed-off-by: Philippe

[PATCH v5 6/6] target/i386: Prohibit target specific KVM prototypes on user emulation

2023-09-13 Thread Philippe Mathieu-Daudé
None of these target-specific prototypes should be used by user emulation. Remove their declaration there, so we get a compile failure if ever used (instead of having to deal with linker and its possible optimizations, such dead code removal). Suggested-by: Kevin Wolf Signed-off-by: Philippe

[PATCH v5 3/6] target/i386: Call accel-agnostic x86_cpu_get_supported_cpuid()

2023-09-13 Thread Philippe Mathieu-Daudé
x86_cpu_get_supported_cpuid() is generic and handles the different accelerators. Use it instead of kvm_arch_get_supported_cpuid(). That fixes a link failure introduced by commit 3adce820cf ("target/i386: Remove unused KVM stubs") when QEMU is configured as: $ ./configure --cc=clang \

[PATCH v5 1/6] target/i386: Check kvm_hyperv_expand_features() return value

2023-09-13 Thread Philippe Mathieu-Daudé
In case more code is added after the kvm_hyperv_expand_features() call, check its return value (since it can fail). Fixes: 071ce4b03b ("i386: expand Hyper-V features during CPU feature expansion time") Signed-off-by: Philippe Mathieu-Daudé --- target/i386/cpu.c | 4 ++-- 1 file changed, 2

[PATCH v5 2/6] target/i386: Drop accel_uses_host_cpuid before x86_cpu_get_supported_cpuid

2023-09-13 Thread Philippe Mathieu-Daudé
x86_cpu_get_supported_cpuid() already checks for KVM/HVF accelerators, so it is not needed to manually check it via a call to accel_uses_host_cpuid() before calling it. Suggested-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daudé --- target/i386/cpu.c | 10 -- 1 file changed, 4

[PATCH v5 0/6] target/i386: Restrict system-specific features from user emulation

2023-09-13 Thread Philippe Mathieu-Daudé
Since v4: - Addressed Paolo's suggestions (clearly better) Too many system-specific code (and in particular KVM related) is pulled in user-only build. This led to adding unjustified stubs as kludge to unagressive linker non-optimizations. This series restrict x86 system-specific features to

Re: [PATCH v4 0/3] target/i386: Restrict system-specific features from user emulation

2023-09-13 Thread Philippe Mathieu-Daudé
On 12/9/23 19:25, Paolo Bonzini wrote: > However, the dependency of user-mode emulation on KVM is really an > implementation detail of QEMU.  It's very much baked into linux-user and > hard to remove, but I'm not sure it's a good idea to add more #ifdef >

Re: [PATCH] gitlab: remove unreliable avocado CI jobs

2023-09-13 Thread Peter Maydell
On Tue, 12 Sept 2023 at 21:00, Thomas Huth wrote: > Please don't remove the whole job! Just disable the failing tests within the > job, e.g.: > > diff --git a/tests/avocado/replay_kernel.py b/tests/avocado/replay_kernel.py > --- a/tests/avocado/replay_kernel.py > +++

Re: [PATCH 4/4] target/ppc: Prohibit target specific KVM prototypes on user emulation

2023-09-13 Thread Daniel Henrique Barboza
On 9/12/23 08:30, Philippe Mathieu-Daudé wrote: None of these target-specific prototypes should be used by user emulation. Remove their declaration there, so we get a compile failure if ever used (instead of having to deal with linker and its possible optimizations, such dead code removal).

[PATCH v4] target/riscv: Clearing the CSR values at reset and syncing the MPSTATE with the host

2023-09-13 Thread liguang.zhang
From: "liguang.zhang" Fix the guest reboot error when using KVM There are two issues when rebooting a guest using KVM 1. When the guest initiates a reboot the host is unable to stop the vcpu 2. When running a SMP guest the qemu monitor system_reset causes a vcpu crash This can be fixed by

Re: [PATCH v3 4/4] hw/cxl: Support 4 HDM decoders at all levels of topology

2023-09-13 Thread Jonathan Cameron via
On Tue, 12 Sep 2023 18:08:44 + Fan Ni wrote: > On Mon, Sep 11, 2023 at 12:43:13PM +0100, Jonathan Cameron wrote: > > > Support these decoders in CXL host bridges (pxb-cxl), CXL Switch USP > > and CXL Type 3 end points. > > > > Signed-off-by: Jonathan Cameron > > > > --- > > One

Re: [RFC PATCH v4 2/3] target/i386: Restrict system-specific features from user emulation

2023-09-13 Thread Philippe Mathieu-Daudé
On 12/9/23 16:05, Paolo Bonzini wrote: On 9/11/23 23:13, Philippe Mathieu-Daudé wrote:   /*    * Only for builtin_x86_defs models initialized with x86_register_cpudef_types.    */ @@ -6163,6 +6195,7 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count,   }  

Re: [PATCH 0/4] ci: fix hang of FreeBSD CI jobs

2023-09-13 Thread Thomas Huth
On 13/09/2023 10.48, Alex Bennée wrote: Thomas Huth writes: On 12/09/2023 20.41, Daniel P. Berrangé wrote: This addresses https://gitlab.com/qemu-project/qemu/-/issues/1882 Which turned out to be a genuine flaw which we missed during merge as the patch hitting master co-incided with the

Re: [PATCH v3 3/4] hw/cxl: Fix and use same calculation for HDM decoder block size everywhere

2023-09-13 Thread Jonathan Cameron via
On Wed, 13 Sep 2023 08:53:55 +0200 Philippe Mathieu-Daudé wrote: > On 11/9/23 13:43, Jonathan Cameron wrote: > > In order to avoid having the size of the per HDM decoder register block > > repeated in lots of places, create the register definitions for HDM > > decoder 1 and use the offset

Re: [PATCH 0/4] ci: fix hang of FreeBSD CI jobs

2023-09-13 Thread Daniel P . Berrangé
On Wed, Sep 13, 2023 at 09:48:34AM +0100, Alex Bennée wrote: > > Thomas Huth writes: > > > On 12/09/2023 20.41, Daniel P. Berrangé wrote: > >> This addresses > >>https://gitlab.com/qemu-project/qemu/-/issues/1882 > >> Which turned out to be a genuine flaw which we missed during merge > >>

Re: [PATCH v3 2/4] hw/cxl: Add utility functions decoder interleave ways and target count.

2023-09-13 Thread Jonathan Cameron via
On Tue, 12 Sep 2023 17:20:05 + Fan Ni wrote: > On Mon, Sep 11, 2023 at 12:43:11PM +0100, Jonathan Cameron wrote: > > > As an encoded version of these key configuration parameters is available > > in a register, provide functions to extract it again so as to avoid > > the need for

Re: [PATCH] tests/avocado: Fix console data loss

2023-09-13 Thread Alex Bennée
Nicholas Piggin writes: > Occasionally some avocado tests will fail waiting for console line > despite the machine running correctly. Console data goes missing, as can > be seen in the console log. This is due to _console_interaction calling > makefile() on the console socket each time it is

Re: [PATCH v2 2/3] hw/cxl: Add QTG _DSM support for ACPI0017 device

2023-09-13 Thread Jonathan Cameron via
On Tue, 12 Sep 2023 21:12:45 + Fan Ni wrote: > On Mon, Sep 04, 2023 at 05:18:46PM +0100, Jonathan Cameron wrote: > > > From: Dave Jiang > > > > Add a simple _DSM call support for the ACPI0017 device to return a fake QTG > > ID value of 0 in all cases. The enabling is for _DSM plumbing

Re: [risu PATCH v2 1/4] s390x: Add basic s390x support to the C code

2023-09-13 Thread Thomas Huth
On 12/09/2023 18.50, Peter Maydell wrote: On Tue, 5 Sept 2023 at 12:50, Thomas Huth wrote: With these changes, it is now possible to compile the "risu" binary for s390x hosts. Acked-by: Ilya Leoshkevich Signed-off-by: Thomas Huth +/* reginfo_init: initialize with a ucontext */ +void

Re: [PATCH 0/4] ci: fix hang of FreeBSD CI jobs

2023-09-13 Thread Alex Bennée
Thomas Huth writes: > On 12/09/2023 20.41, Daniel P. Berrangé wrote: >> This addresses >>https://gitlab.com/qemu-project/qemu/-/issues/1882 >> Which turned out to be a genuine flaw which we missed during merge >> as the patch hitting master co-incided with the FreeBSD CI job >> having an

Re: Re: [PATCH v3] target/riscv: Clearing the CSR values at reset and syncing the MPSTATE with the host

2023-09-13 Thread liguang.zhang
From: "liguang.zhang" > On Mon, Jul 24, 2023 at 2:26 AM liguang.zhang <18622748...@163.com> wrote: > > > > From: "liguang.zhang" > > > > Fix the guest reboot error when using KVM > > There are two issues when rebooting a guest using KVM > > 1. When the guest initiates a reboot the host

Re: [PATCH] hw/i386/pc_piix: Mark the machine types from version 1.4 to 1.7 as deprecated

2023-09-13 Thread Daniel P . Berrangé
On Wed, Sep 13, 2023 at 08:33:01AM +0200, Philippe Mathieu-Daudé wrote: > On 18/1/22 09:49, Thomas Huth wrote: > > On 17/01/2022 21.12, Daniel P. Berrangé wrote: > > > On Mon, Jan 17, 2022 at 08:16:39PM +0100, Thomas Huth wrote: > > > > The list of machine types grows larger and larger each

Various changes "backportability"

2023-09-13 Thread Michael Tokarev
[Added some more active patch reviewers to Cc] Hi! Yesterday I wrote email about picking up changes from master for previous stable release(s). What's interesting is that yesterday, basically in a single day, we've faced numerous examples of subsystem changes which makes such backporting

Re: [PULL v1 1/1] tpm: fix crash when FD >= 1024

2023-09-13 Thread Daniel P . Berrangé
On Wed, Sep 13, 2023 at 09:41:48AM +0300, Michael Tokarev wrote: > 13.09.2023 00:41, Stefan Berger wrote: > > From: Marc-Andr޸ Lureau > > > > Replace select() with poll() to fix a crash when QEMU has a large number > > of FDs. > > > > Fixes: > >

[PATCH v2 09/12] util/reserved-region: Add new ReservedRegion helpers

2023-09-13 Thread Eric Auger
Introduce resv_region_list_insert() helper which inserts a new ReservedRegion into a sorted list of reserved region. In case of overlap, the new region has higher priority and hides the existing overlapped segments. If the overlap is partial, new regions are created for parts which are not

[PATCH v2 10/12] virtio-iommu: Consolidate host reserved regions and property set ones

2023-09-13 Thread Eric Auger
Up to now we were exposing to the RESV_MEM probe requests the reserved memory regions set though the reserved-regions array property. Combine those with the host reserved memory regions if any. Those latter are tagged as RESERVED. We don't have more information about them besides then cannot be

[PATCH v2 01/12] memory: Let ReservedRegion use Range

2023-09-13 Thread Eric Auger
A reserved region is a range tagged with a type. Let's directly use the Range type in the prospect to reuse some of the library helpers shipped with the Range type. Signed-off-by: Eric Auger Reviewed-by: David Hildenbrand Reviewed-by: Philippe Mathieu-Daudé --- v1 -> v2: - Added Philippe and

[PATCH v2 12/12] vfio: Remove 64-bit IOVA address space assumption

2023-09-13 Thread Eric Auger
Now we retrieve the usable IOVA ranges from the host, we now the physical IOMMU aperture and we can remove the assumption of 64b IOVA space when calling vfio_host_win_add(). This works fine in general but in case of an IOMMU memory region this becomes more tricky. For instance the virtio-iommu MR

[PATCH v2 02/12] memory: Introduce memory_region_iommu_set_iova_ranges

2023-09-13 Thread Eric Auger
This helper will allow to convey information about valid IOVA ranges to virtual IOMMUS. Signed-off-by: Eric Auger --- include/exec/memory.h | 26 ++ softmmu/memory.c | 15 +++ 2 files changed, 41 insertions(+) diff --git a/include/exec/memory.h

Re: [PATCH 1/4] microbit: add missing qtest_quit() call

2023-09-13 Thread Daniel P . Berrangé
On Tue, Sep 12, 2023 at 12:10:19PM -0700, Richard Henderson wrote: > On 9/12/23 11:41, Daniel P. Berrangé wrote: > > Without this call, the QEMU process is being left running which on > > FreeBSD 13.2 at least, makes meson think the test is still running, > > and thus execution of "make check"

[PATCH v2 08/12] range: Make range_compare() public

2023-09-13 Thread Eric Auger
Let's expose range_compare() in the header so that it can be reused outside of util/range.c Signed-off-by: Eric Auger Reviewed-by: Philippe Mathieu-Daudé --- v1 -> v2: - Added Philippe's R-b --- include/qemu/range.h | 6 ++ util/range.c | 6 +- 2 files changed, 7

[PATCH v2 06/12] range: Introduce range_inverse_array()

2023-09-13 Thread Eric Auger
This helper reverses an array of regions, turning original regions into holes and original holes into actual regions, covering the whole UINT64_MAX span. Signed-off-by: Eric Auger --- v1 -> v2: - Move range_inverse_array description comment in the header - Take low/high params ---

[PATCH v2 03/12] vfio: Collect container iova range info

2023-09-13 Thread Eric Auger
Collect iova range information if VFIO_IOMMU_TYPE1_INFO_CAP_IOVA_RANGE capability is supported. This allows to propagate the information though the IOMMU MR set_iova_ranges() callback so that virtual IOMMUs get aware of those aperture constraints. Signed-off-by: Eric Auger ---

Re: qemu-riscv32 usermode still broken?

2023-09-13 Thread Michael Tokarev
13.09.2023 04:41, LIU Zhiwei wrote: On 2023/9/13 6:31, Andreas K. Huettel wrote: .. * Something seems wrong in the signal handling (?): If it is wrong for signal handling and for 32-bit, I guess it may be fixed by this patch

[PATCH v2 11/12] test: Add some tests for range and resv-mem helpers

2023-09-13 Thread Eric Auger
Add unit tests for both resv_region_list_insert() and range_inverse_array(). Signed-off-by: Eric Auger --- tests/unit/test-resv-mem.c | 251 + tests/unit/meson.build | 1 + 2 files changed, 252 insertions(+) create mode 100644

[PATCH v2 00/12] VIRTIO-IOMMU/VFIO: Don't assume 64b IOVA space

2023-09-13 Thread Eric Auger
On x86, when assigning VFIO-PCI devices protected with virtio-iommu we encounter the case where the guest tries to map IOVAs beyond 48b whereas the physical VTD IOMMU only supports 48b. This ends up with VFIO_MAP_DMA failures at qemu level because at kernel level, vfio_iommu_iova_dma_valid() check

[PATCH v2 04/12] virtio-iommu: Rename reserved_regions into prop_resv_regions

2023-09-13 Thread Eric Auger
Rename VirtIOIOMMU (nb_)reserved_regions fields with the "prop_" prefix to highlight those fields are set through a property, at machine level. They are IOMMU wide. A subsequent patch will introduce per IOMMUDevice reserved regions that will include both those IOMMU wide property reserved regions

[PATCH v2 05/12] virtio-iommu: Introduce per IOMMUDevice reserved regions

2023-09-13 Thread Eric Auger
For the time being the per device reserved regions are just a duplicate of IOMMU wide reserved regions. Subsequent patches will combine those with host reserved regions, if any. Signed-off-by: Eric Auger --- include/hw/virtio/virtio-iommu.h | 1 + hw/virtio/virtio-iommu.c | 42

[PATCH v2 07/12] virtio-iommu: Implement set_iova_ranges() callback

2023-09-13 Thread Eric Auger
The implementation populates the array of per IOMMUDevice host reserved regions. It is forbidden to have conflicting sets of host IOVA ranges to be applied onto the same IOMMU MR (implied by different host devices). Signed-off-by: Eric Auger --- v1 -> v2: - Forbid conflicting sets of host

Re: [QEMU PATCH v4 10/13] virtio-gpu: Resource UUID

2023-09-13 Thread Albert Esteve
Hi Antonio, If I'm not mistaken, this patch is related with: https://lists.gnu.org/archive/html/qemu-devel/2023-09/msg01853.html IMHO, ideally, virtio-gpu and vhost-user-gpu both, would use the infrastructure from the patch I linked to store the virtio objects, so that they can be later shared

[PATCH] vhost: Add a defensive check in vhost_commit against wrong deallocation

2023-09-13 Thread Eric Auger
In vhost_commit(), it may happen that dev->mem_sections and dev->tmp_sections are equal, in which case, unconditionally freeing old_sections at the end of the function will also free dev->mem_sections used on subsequent call leading to a segmentation fault. Check this situation before

[PATCH v9 09/12] virtio-sound: handle VIRTIO_SND_R_PCM_RELEASE

2023-09-13 Thread Emmanouil Pitsidianakis
Handle the PCM release control request, which is necessary for flushing pending sound IO. No IO is handled yet so currently it only replies to the request. Based-on: https://github.com/OpenSynergy/qemu/commit/5a2f350eec5d157b90d9c7b40a8e603f4da92471 Signed-off-by: Igor Skalkin Signed-off-by:

[PATCH v9 10/12] virtio-sound: implement audio output (TX)

2023-09-13 Thread Emmanouil Pitsidianakis
Handle output IO messages in the transmit (TX) virtqueue. It allocates a VirtIOSoundPCMBlock for each IO message and copies the data buffer to it. When the IO buffer is written to the host's sound card, the guest will be notified that it has been consumed. The lifetime of an IO message is: 1.

[PATCH v9 03/12] virtio-sound: handle control messages and streams

2023-09-13 Thread Emmanouil Pitsidianakis
Receive guest requests in the control (CTRL) queue of the virtio sound device and reply with a NOT SUPPORTED error to all control commands. The receiving handler is virtio_snd_handle_ctrl(). It stores all control messages in the queue in the device's command queue. Then it calls

[PATCH v9 00/12] Add VIRTIO sound card

2023-09-13 Thread Emmanouil Pitsidianakis
This patch series adds an audio device implementing the recent virtio sound spec (1.2) and a corresponding PCI wrapper device. v9 can be found online at: https://gitlab.com/epilys/qemu/-/tree/virtio-snd-v9 Ref 06e6b17186 Main differences with v8 patch series [^v8] : - Addressed [^v8] review

[PATCH v9 11/12] virtio-sound: implement audio capture (RX)

2023-09-13 Thread Emmanouil Pitsidianakis
To perform audio capture we duplicate the TX logic of the previous commit with the following difference: we receive data from the QEMU audio backend and write it in the virt queue IO buffers the guest sends to QEMU. When they are full (i.e. they have `period_bytes` amount of data) or when

[PATCH v9 12/12] docs/system: add basic virtio-snd documentation

2023-09-13 Thread Emmanouil Pitsidianakis
This commit adds basic documentation for using virtio-snd. Signed-off-by: Emmanouil Pitsidianakis --- docs/system/device-emulation.rst | 1 + docs/system/devices/virtio-snd.rst | 49 ++ 2 files changed, 50 insertions(+) create mode 100644

[PATCH v9 06/12] virtio-sound: handle VIRTIO_SND_R_PCM_{START,STOP}

2023-09-13 Thread Emmanouil Pitsidianakis
Handle the start and stop control messages for a stream_id. This request does nothing at the moment except for replying to it. Audio playback or capture will be started/stopped here in follow-up commits. Based-on:

[PATCH v9 05/12] virtio-sound: handle VIRTIO_SND_R_PCM_INFO request

2023-09-13 Thread Emmanouil Pitsidianakis
Respond to the VIRTIO_SND_R_PCM_INFO control request with the parameters of each requested PCM stream. Based-on: https://github.com/OpenSynergy/qemu/commit/5a2f350eec5d157b90d9c7b40a8e603f4da92471 Signed-off-by: Igor Skalkin Signed-off-by: Anton Yakovlev Signed-off-by: Emmanouil Pitsidianakis

[PATCH v9 07/12] virtio-sound: handle VIRTIO_SND_R_PCM_SET_PARAMS

2023-09-13 Thread Emmanouil Pitsidianakis
Handle the set parameters control request. It reconfigures a stream based on a guest's preference if the values are valid and supported. Based-on: https://github.com/OpenSynergy/qemu/commit/5a2f350eec5d157b90d9c7b40a8e603f4da92471 Signed-off-by: Igor Skalkin Signed-off-by: Anton Yakovlev

[PATCH v9 04/12] virtio-sound: set PCM stream parameters

2023-09-13 Thread Emmanouil Pitsidianakis
This commit sets the virtio-snd device's default PCM parameters in virtio_snd_pcm_set_params_impl(). The same function will be used to set parameters from the guest with VIRTIO_SND_R_PCM_SET_PARAMS in a follow-up commit. PCM parameters describe the sound card parameters that the guest's kernel

[PATCH v9 01/12] Add virtio-sound device stub

2023-09-13 Thread Emmanouil Pitsidianakis
Add a new VIRTIO device for the virtio sound device id. Functionality will be added in the following commits. Based-on: https://github.com/OpenSynergy/qemu/commit/5a2f350eec5d157b90d9c7b40a8e603f4da92471 Reviewed-by: Alex Bennée Signed-off-by: Igor Skalkin Signed-off-by: Anton Yakovlev

[PATCH v9 02/12] Add virtio-sound-pci device

2023-09-13 Thread Emmanouil Pitsidianakis
This patch adds a PCI wrapper device for the virtio-sound device. It is necessary to instantiate a virtio-snd device in a guest. All sound logic will be added to the virtio-snd device in the following commits. To add this device with a guest, you'll need a >=5.13 kernel compiled with

[PATCH v9 08/12] virtio-sound: handle VIRTIO_SND_R_PCM_PREPARE

2023-09-13 Thread Emmanouil Pitsidianakis
Handles the PCM prepare control request. It initializes a PCM stream when the guests asks for it. Based-on: https://github.com/OpenSynergy/qemu/commit/5a2f350eec5d157b90d9c7b40a8e603f4da92471 Signed-off-by: Igor Skalkin Signed-off-by: Anton Yakovlev Signed-off-by: Emmanouil Pitsidianakis ---

Re: CI container image interference between staging and staging-7.2

2023-09-13 Thread Michael Tokarev
13.09.2023 02:07, Stefan Hajnoczi wrote: Hi, TL;DR Michael: Please check that the staging-7.2 branch has Dan's commit e28112d00703abd136e2411d23931f4f891c9244 ("gitlab: stable staging branches publish containers in a separate tag"). ... Mea cupla, Stefan. I'm always forgetting about the fact

Re: CI container image interference between staging and staging-7.2

2023-09-13 Thread Philippe Mathieu-Daudé
On 13/9/23 01:07, Stefan Hajnoczi wrote: Hi, TL;DR Michael: Please check that the staging-7.2 branch has Dan's commit e28112d00703abd136e2411d23931f4f891c9244 ("gitlab: stable staging branches publish containers in a separate tag"). I couldn't explain a check-cfi-x86_64 failure

Re: [RFC PATCH 15/19] kvm: handle KVM_EXIT_MEMORY_FAULT

2023-09-13 Thread Xiaoyao Li
On 8/9/2023 11:02 PM, Xu Yilun wrote: On 2023-07-31 at 12:21:57 -0400, Xiaoyao Li wrote: From: Chao Peng Currently only KVM_MEMORY_EXIT_FLAG_PRIVATE in flags is valid when KVM_EXIT_MEMORY_FAULT happens. It indicates userspace needs to do the memory conversion on the RAMBlock to turn the

Re: [RFC PATCH 15/19] kvm: handle KVM_EXIT_MEMORY_FAULT

2023-09-13 Thread Xiaoyao Li
On 8/3/2023 6:25 AM, Isaku Yamahata wrote: On Mon, Jul 31, 2023 at 12:21:57PM -0400, Xiaoyao Li wrote: From: Chao Peng Currently only KVM_MEMORY_EXIT_FLAG_PRIVATE in flags is valid when KVM_EXIT_MEMORY_FAULT happens. It indicates userspace needs to do the memory conversion on the RAMBlock

Re: [PATCH v3 3/4] hw/cxl: Fix and use same calculation for HDM decoder block size everywhere

2023-09-13 Thread Philippe Mathieu-Daudé
On 11/9/23 13:43, Jonathan Cameron wrote: In order to avoid having the size of the per HDM decoder register block repeated in lots of places, create the register definitions for HDM decoder 1 and use the offset between the first registers in HDM decoder 0 and HDM decoder 1 to establish the

Re: [PATCH] gitlab: remove unreliable avocado CI jobs

2023-09-13 Thread Philippe Mathieu-Daudé
On 12/9/23 21:58, Thomas Huth wrote: On 12/09/2023 17.06, Stefan Hajnoczi wrote: The avocado-system-alpine, avocado-system-fedora, and avocado-system-ubuntu jobs are unreliable. I identified them while looking over CI failures from the past week:

Re: [PULL v1 1/1] tpm: fix crash when FD >= 1024

2023-09-13 Thread Michael Tokarev
13.09.2023 00:41, Stefan Berger wrote: From: Marc-Andr޸ Lureau Replace select() with poll() to fix a crash when QEMU has a large number of FDs. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2020133 Please keep these on the same line next time. And there's an UTF8 issue with

Re: [PATCH 0/4] hw/cxl: Minor CXL emulation fixes and cleanup

2023-09-13 Thread Philippe Mathieu-Daudé
Cc'ing qemu-trivial@ On 4/9/23 15:28, Jonathan Cameron wrote: A small set gathering patches that have been posted and reviewed on list over the last few months. Looking to get these upstream before making any significant changes to the CXL emulation for this cycle. More wide spread cleanup

Re: [PATCH] hw/i386/pc_piix: Mark the machine types from version 1.4 to 1.7 as deprecated

2023-09-13 Thread Philippe Mathieu-Daudé
On 18/1/22 09:49, Thomas Huth wrote: On 17/01/2022 21.12, Daniel P. Berrangé wrote: On Mon, Jan 17, 2022 at 08:16:39PM +0100, Thomas Huth wrote: The list of machine types grows larger and larger each release ... and it is unlikely that many people still use the very old ones for live

Re: [PATCH] ppc/xive: Fix uint32_t overflow

2023-09-13 Thread Frederic Barrat
On 13/09/2023 07:56, Cédric Le Goater wrote: As reported by Coverity, "idx << xive->pc_shift" is evaluated using 32-bit arithmetic, and then used in a context expecting a "uint64_t". Add a uint64_t cast. Fixes: Coverity CID 1519049 Fixes: b68147b7a5bf ("ppc/xive: Add support for the PC

Re: [PATCH] ppc/xive: Fix uint32_t overflow

2023-09-13 Thread Philippe Mathieu-Daudé
On 13/9/23 07:56, Cédric Le Goater wrote: As reported by Coverity, "idx << xive->pc_shift" is evaluated using 32-bit arithmetic, and then used in a context expecting a "uint64_t". Add a uint64_t cast. Fixes: Coverity CID 1519049 Fixes: b68147b7a5bf ("ppc/xive: Add support for the PC MMIOs")

Re: [RFC PATCH 2/3] target/ppc: Use FP CR1 update helper more widely

2023-09-13 Thread Philippe Mathieu-Daudé
On 13/9/23 02:58, Nicholas Piggin wrote: Several places open-code this FP CR1 update. Move them to call gen_set_cr1_from_fpscr(). FPSCR_OX = 28 so move that to the symbolic constant while we are here. Signed-off-by: Nicholas Piggin --- target/ppc/translate/fp-impl.c.inc | 16

Re: [BUG] virtio-fs: Corruption when running binaries from virtiofsd-backed fs

2023-09-13 Thread Erik Schilling
On Fri Sep 1, 2023 at 12:37 PM CEST, Erik Schilling wrote: > On Wed Aug 30, 2023 at 10:20 AM CEST, Erik Schilling wrote: > > Hi all! > > > > Some days ago I posted to #virtiofs:matrix.org, describing that I am > > observing what looks like a corruption when executing programs from a > >

Re: [PATCH v3 03/12] plugins: Check if vCPU is realized

2023-09-13 Thread Philippe Mathieu-Daudé
On 13/9/23 00:40, Akihiko Odaki wrote: The created member of CPUState tells if the vCPU thread is started, and will be always false for the user space emulation that manages threads independently. Per the docstring: /** * CPUState: * @created: Indicates whether the CPU thread has been

<    1   2   3   4