[PATCH] hw/openrisc: Fixed undercounting of TTCR in continuous mode

2024-06-07 Thread Joel Holdsworth via
In the existing design, TTCR is prone to undercounting when running in continuous mode. This manifests as a timer interrupt appearing to trigger a few cycles prior to the deadline set in SPR_TTMR_TP. When the timer triggers, the virtual time delta in nanoseconds between the time when the timer was

[Stable-9.0.1 47/71] hvf: arm: Fix encodings for ID_AA64PFR1_EL1 and debug System registers

2024-06-07 Thread Michael Tokarev
From: Zenghui Yu We wrongly encoded ID_AA64PFR1_EL1 using {3,0,0,4,2} in hvf_sreg_match[] so we fail to get the expected ARMCPRegInfo from cp_regs hash table with the wrong key. Fix it with the correct encoding {3,0,0,4,1}. With that fixed, the Linux guest can properly detect FEAT_SSBS2 on my M1

[Stable-9.0.1 68/71] target/i386: fix SSE and SSE2 feature check

2024-06-07 Thread Michael Tokarev
From: Xinyu Li Features check of CPUID_SSE and CPUID_SSE2 should use cpuid_features, rather than cpuid_ext_features. Signed-off-by: Xinyu Li Reviewed-by: Zhao Liu Message-ID: <20240602100904.2137939-1-lixinyu...@ict.ac.cn> Signed-off-by: Paolo Bonzini (cherry picked from commit da7c95920d027d

[Stable-8.2.5 40/45] target/riscv/kvm.c: Fix the hart bit setting of AIA

2024-06-07 Thread Michael Tokarev
From: Yong-Xuan Wang In AIA spec, each hart (or each hart within a group) has a unique hart number to locate the memory pages of interrupt files in the address space. The number of bits required to represent any hart number is equal to ceil(log2(hmax + 1)), where hmax is the largest hart number a

Re: [PATCH v3 1/6] Add an "info pg" command that prints the current page tables

2024-06-07 Thread Richard Henderson
On 6/6/24 07:02, Don Porter wrote: +/** + * get_pte - Copy the contents of the page table entry at node[i] into pt_entry. + * Optionally, add the relevant bits to the virtual address in + * vaddr_pte. + * + * @cs - CPU state + * @node - physical address of the current page ta

Re: [PATCH v2 0/2] Zynq 7000 Improvements

2024-06-07 Thread Peter Maydell
On Fri, 7 Jun 2024 at 15:28, Sebastian Huber wrote: > > On 30.05.24 12:30, Peter Maydell wrote: > > On Fri, 24 May 2024 at 13:08, Sebastian Huber > > wrote: > >> > >> v2: > >> > >> * Add Kconfig support > >> > >> * Add array of CPUs to ZynqMachineState > >> > >> * Add FIQ support > >> > >> Sebast

[Stable-8.2.5 23/45] gitlab: use 'setarch -R' to workaround tsan bug

2024-06-07 Thread Michael Tokarev
From: Daniel P. Berrangé The TSAN job started failing when gitlab rolled out their latest release. The root cause is a change in the Google COS version used on shared runners. This brings a kernel running with vm.mmap_rnd_bits = 31 which is incompatible with TSAN in LLVM < 18, which only suppo

[RFC v2 5/7] virtio-iommu: Remove the implementation of iommu_set_iova_range

2024-06-07 Thread Eric Auger
Now that we use PCIIOMMUOps to convey information about usable IOVA ranges we do not to implement the iommu_set_iova_ranges IOMMU MR callback. Signed-off-by: Eric Auger --- hw/virtio/virtio-iommu.c | 67 1 file changed, 67 deletions(-) diff --git a/hw/vi

[Stable-9.0.1 56/71] target/riscv/cpu.c: fix Zvkb extension config

2024-06-07 Thread Michael Tokarev
From: Yangyu Chen This code has a typo that writes zvkb to zvkg, causing users can't enable zvkb through the config. This patch gets this fixed. Signed-off-by: Yangyu Chen Fixes: ea61ef7097d0 ("target/riscv: Move vector crypto extensions to riscv_cpu_extensions") Reviewed-by: LIU Zhiwei Revie

[Stable-8.2.5 45/45] target/loongarch: fix a wrong print in cpu dump

2024-06-07 Thread Michael Tokarev
From: lanyanzhi description: loongarch_cpu_dump_state() want to dump all loongarch cpu state registers, but there is a tiny typographical error when printing "PRCFG2". Cc: qemu-sta...@nongnu.org Signed-off-by: lanyanzhi Reviewed-by: Richard Henderson Reviewed-by: Song Gao Message-Id: <202

[Stable-9.0.1 62/71] target/riscv: do not set mtval2 for non guest-page faults

2024-06-07 Thread Michael Tokarev
From: Alexei Filippov Previous patch fixed the PMP priority in raise_mmu_exception() but we're still setting mtval2 incorrectly. In riscv_cpu_tlb_fill(), after pmp check in 2 stage translation part, mtval2 will be set in case of successes 2 stage translation but failed pmp check. In this case w

[PATCH 0/4] target/ppc: Move VSX storage access and compare

2024-06-07 Thread Chinmay Rath
Moving all remaining VSX storage access instructions and all VSX compare instructions of XX3 form with RC field, to decodetree specification. Chinmay Rath (4): target/ppc: Moving VSX scalar storage access insns to decodetree. target/ppc: Move VSX vector with length storage access insns to

[PATCH 3/4] target/ppc: Move VSX vector storage access insns to decodetree.

2024-06-07 Thread Chinmay Rath
Moving the following instructions to decodetree specification: lxv{b16, d2, h8, w4, ds, ws}x : X-form stxv{b16, d2, h8, w4}x : X-form The changes were verified by validating that the tcg-ops generated for those instructions remain the same, which were captured using the '-d in_asm,

Re: [PULL 02/17] crypto: Introduce SM4 symmetric cipher algorithm

2024-06-07 Thread Peter Maydell
On Fri, 9 Feb 2024 at 14:07, Daniel P. Berrangé wrote: > > From: Hyman Huang > > Introduce the SM4 cipher algorithms (OSCCA GB/T 32907-2016). > > SM4 (GBT.32907-2016) is a cryptographic standard issued by the > Organization of State Commercial Administration of China (OSCCA) > as an authorized cr

[Stable-8.2.5 34/45] target/riscv: rvv: Check single width operator for vector fp widen instructions

2024-06-07 Thread Michael Tokarev
From: Max Chou The require_scale_rvf function only checks the double width operator for the vector floating point widen instructions, so most of the widen checking functions need to add require_rvf for single width operator. The vfwcvt.f.x.v and vfwcvt.f.xu.v instructions convert single width in

[Stable-9.0.1 64/71] target/riscv/kvm.c: Fix the hart bit setting of AIA

2024-06-07 Thread Michael Tokarev
From: Yong-Xuan Wang In AIA spec, each hart (or each hart within a group) has a unique hart number to locate the memory pages of interrupt files in the address space. The number of bits required to represent any hart number is equal to ceil(log2(hmax + 1)), where hmax is the largest hart number a

[Stable-9.0.1 71/71] target/loongarch: fix a wrong print in cpu dump

2024-06-07 Thread Michael Tokarev
From: lanyanzhi description: loongarch_cpu_dump_state() want to dump all loongarch cpu state registers, but there is a tiny typographical error when printing "PRCFG2". Cc: qemu-sta...@nongnu.org Signed-off-by: lanyanzhi Reviewed-by: Richard Henderson Reviewed-by: Song Gao Message-Id: <202

[PATCH 2/3] i386/sev: Move SEV_COMMON null check before dereferencing

2024-06-07 Thread Pankaj Gupta
coverity #1546886 fixes: 9861405a8f ("i386/sev: Invoke launch_updata_data() for SEV class") Signed-off-by: Pankaj Gupta --- target/i386/sev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/i386/sev.c b/target/i386/sev.c index 7c9df621de..f18432f58e 100644 --- a/targ

[Stable-9.0.1 63/71] target/riscv: rvzicbo: Fixup CBO extension register calculation

2024-06-07 Thread Michael Tokarev
From: Alistair Francis When running the instruction ``` cbo.flush 0(x0) ``` QEMU would segfault. The issue was in cpu_gpr[a->rs1] as QEMU does not have cpu_gpr[0] allocated. In order to fix this let's use the existing get_address() helper. This also has the benefit of performing pointer m

[Stable-9.0.1 52/71] hw/intc/riscv_aplic: APLICs should add child earlier than realize

2024-06-07 Thread Michael Tokarev
From: "yang.zhang" Since only root APLICs can have hw IRQ lines, aplic->parent should be initialized first. Fixes: e8f79343cf ("hw/intc: Add RISC-V AIA APLIC device emulation") Reviewed-by: Daniel Henrique Barboza Signed-off-by: yang.zhang Cc: qemu-stable Message-ID: <20240409014445.278-1-gao

[Stable-7.2.12 23/29] target/arm: Disable SVE extensions when SVE is disabled

2024-06-07 Thread Michael Tokarev
From: Marcin Juszkiewicz Cc: qemu-sta...@nongnu.org Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2304 Reported-by: Marcin Juszkiewicz Signed-off-by: Richard Henderson Signed-off-by: Marcin Juszkiewicz Message-id: 20240526204551.553282-1-richard.hender...@linaro.org Reviewed-by: Pete

Re: [PATCH v3 1/6] Add an "info pg" command that prints the current page tables

2024-06-07 Thread Richard Henderson
On 6/6/24 07:02, Don Porter wrote: +/** + * _for_each_pte - recursive helper function + * + * @cs - CPU state + * @fn(cs, data, pte, vaddr, height) - User-provided function to call on each + * pte. + * * @cs - pass through cs + * * @data - user-provided, op

[Stable-7.2.12 24/29] hw/intc/riscv_aplic: APLICs should add child earlier than realize

2024-06-07 Thread Michael Tokarev
From: "yang.zhang" Since only root APLICs can have hw IRQ lines, aplic->parent should be initialized first. Fixes: e8f79343cf ("hw/intc: Add RISC-V AIA APLIC device emulation") Reviewed-by: Daniel Henrique Barboza Signed-off-by: yang.zhang Cc: qemu-stable Message-ID: <20240409014445.278-1-gao

[PATCH 1/4] target/ppc: Moving VSX scalar storage access insns to decodetree.

2024-06-07 Thread Chinmay Rath
Moving the following instructions to decodetree specification : lxs{d, iwa, ibz, ihz, iwz, sp}x : X-form stxs{d, ib, ih, iw, sp}x: X-form The changes were verified by validating that the tcg-ops generated by those instructions remain the same, which were ca

Re: [PATCH 1/4] target/ppc: Moving VSX scalar storage access insns to decodetree.

2024-06-07 Thread Richard Henderson
On 6/7/24 07:49, Chinmay Rath wrote: Moving the following instructions to decodetree specification : lxs{d, iwa, ibz, ihz, iwz, sp}x : X-form stxs{d, ib, ih, iw, sp}x: X-form The changes were verified by validating that the tcg-ops generated by those inst

[Stable-9.0.1 53/71] target/riscv/kvm: Fix exposure of Zkr

2024-06-07 Thread Michael Tokarev
From: Andrew Jones The Zkr extension may only be exposed to KVM guests if the VMM implements the SEED CSR. Use the same implementation as TCG. Without this patch, running with a KVM which does not forward the SEED CSR access to QEMU will result in an ILL exception being injected into the guest (

[PATCH 0/3] snp: fix coverity reported issues

2024-06-07 Thread Pankaj Gupta
Pankaj Gupta (3): i386/sev: fix unreachable code coverity issue i386/sev: Move SEV_COMMON null check before dereferencing i386/sev: Return when sev_common is null target/i386/sev.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) -- 2.34.1

[PATCH 3/3] i386/sev: Return when sev_common is null

2024-06-07 Thread Pankaj Gupta
coverity #1546885 fixes: 16dcf200dc ("i386/sev: Introduce "sev-common" type to encapsulate common SEV state") Signed-off-by: Pankaj Gupta --- target/i386/sev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/i386/sev.c b/target/i386/sev.c index f18432f58e..c40562dce3 100644 --- a/tar

[PATCH 1/3] i386/sev: fix unreachable code coverity issue

2024-06-07 Thread Pankaj Gupta
Set 'finish->id_block_en' when block_size read. coverity #1546887 fixes: 7b34df4426 ("i386/sev: Introduce 'sev-snp-guest' object") Signed-off-by: Pankaj Gupta --- target/i386/sev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/i386/sev.c b/target/i386/sev.c index

[Stable-9.0.1 69/71] virtio-gpu: fix v2 migration

2024-06-07 Thread Michael Tokarev
From: Marc-André Lureau Commit dfcf74fa ("virtio-gpu: fix scanout migration post-load") broke forward/backward version migration. Versioning of nested VMSD structures is not straightforward, as the wire format doesn't have nested structures versions. Introduce x-scanout-vmstate-version and a fiel

[Stable-8.2.5 32/45] target/riscv/cpu.c: fix Zvkb extension config

2024-06-07 Thread Michael Tokarev
From: Yangyu Chen This code has a typo that writes zvkb to zvkg, causing users can't enable zvkb through the config. This patch gets this fixed. Signed-off-by: Yangyu Chen Fixes: ea61ef7097d0 ("target/riscv: Move vector crypto extensions to riscv_cpu_extensions") Reviewed-by: LIU Zhiwei Revie

[Stable-7.2.12 00/29] Patch Round-up for stable 7.2.12, frozen at 2024-06-07

2024-06-07 Thread Michael Tokarev
The following patches are queued for QEMU stable v7.2.12: https://gitlab.com/qemu-project/qemu/-/commits/staging-7.2 Patch freeze is 2024-06-07 (frozen), and the release is planned for 2024-06-09: https://wiki.qemu.org/Planning/7.2 Please respond here or CC qemu-sta...@nongnu.org on any add

[Stable-7.2.12 20/29] gitlab: Update msys2-64bit runner tags

2024-06-07 Thread Michael Tokarev
From: Richard Henderson Gitlab has deprecated and removed support for windows-1809 and shared-windows. Update to saas-windows-medium-amd64 per https://about.gitlab.com/blog/2024/01/22/windows-2022-support-for-gitlab-saas-runners/ Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-

[Stable-8.2.5 44/45] ui/sdl2: Allow host to power down screen

2024-06-07 Thread Michael Tokarev
From: Bernhard Beschow By default, SDL disables the screen saver which prevents the host from powering down the screen even if the screen is locked. This results in draining the battery needlessly when the host isn't connected to a wall charger. Fix that by enabling the screen saver. Signed-off-

[Stable-8.2.5 31/45] target/riscv: Fix the element agnostic function problem

2024-06-07 Thread Michael Tokarev
From: Huang Tao In RVV and vcrypto instructions, the masked and tail elements are set to 1s using vext_set_elems_1s function if the vma/vta bit is set. It is the element agnostic policy. However, this function can't deal the big endian situation. This patch fixes the problem by adding handling o

Re: [PATCH v2 18/18] migration/ram: Add direct-io support to precopy file migration

2024-06-07 Thread Fabiano Rosas
Peter Xu writes: > On Thu, May 23, 2024 at 04:05:48PM -0300, Fabiano Rosas wrote: >> We've recently added support for direct-io with multifd, which brings >> performance benefits, but creates a non-uniform user interface by >> coupling direct-io with the multifd capability. This means that users

[Stable-8.2.5 43/45] target/i386: fix SSE and SSE2 feature check

2024-06-07 Thread Michael Tokarev
From: Xinyu Li Features check of CPUID_SSE and CPUID_SSE2 should use cpuid_features, rather than cpuid_ext_features. Signed-off-by: Xinyu Li Reviewed-by: Zhao Liu Message-ID: <20240602100904.2137939-1-lixinyu...@ict.ac.cn> Signed-off-by: Paolo Bonzini (cherry picked from commit da7c95920d027d

[RFC v2 2/7] virtio-iommu: Implement set|unset]_iommu_device() callbacks

2024-06-07 Thread Eric Auger
Implement PCIIOMMUOPs [set|unset]_iommu_device() callbacks. In set(), a VirtioHostIOMMUDevice is allocated which holds a reference to the HostIOMMUDevice. This object is stored in a hash table indexed by PCI BDF. The handle to the Host IOMMU device will allow to retrieve information related to the

Re: [PATCH 0/3] bsd-user: Baby Steps towards eliminating qemu_host_page_size, et al

2024-06-07 Thread Richard Henderson
On 6/6/24 21:25, Warner Losh wrote: Warner Losh (3): linux-user: Adjust comment to reflect the code. bsd-user: port linux-user:ff8a8bbc2ad1 for variable page sizes bsd-user: Catch up to run-time reserved_va math Reviewed-by: Richard Henderson r~

[Stable-7.2.12 21/29] hvf: arm: Fix encodings for ID_AA64PFR1_EL1 and debug System registers

2024-06-07 Thread Michael Tokarev
From: Zenghui Yu We wrongly encoded ID_AA64PFR1_EL1 using {3,0,0,4,2} in hvf_sreg_match[] so we fail to get the expected ARMCPRegInfo from cp_regs hash table with the wrong key. Fix it with the correct encoding {3,0,0,4,1}. With that fixed, the Linux guest can properly detect FEAT_SSBS2 on my M1

Re: [PATCH v4 00/15] vfio: VFIO migration support with vIOMMU

2024-06-07 Thread Joao Martins
On 06/06/2024 16:43, Cédric Le Goater wrote: > Hello Joao, > > On 6/22/23 23:48, Joao Martins wrote: >> Hey, >> >> This series introduces support for vIOMMU with VFIO device migration, >> particurlarly related to how we do the dirty page tracking. >> >> Today vIOMMUs serve two purposes: 1) enable

[Stable-9.0.1 00/71] Patch Round-up for stable 9.0.1, frozen on 2024-06-07

2024-06-07 Thread Michael Tokarev
The following patches are queued for QEMU stable v9.0.1: https://gitlab.com/qemu-project/qemu/-/commits/staging-9.0 Patch freeze is 2024-06-07 (frozen), and the release is planned for 2024-06-09: https://wiki.qemu.org/Planning/9.0 Please respond here or CC qemu-sta...@nongnu.org with any ad

[Stable-9.0.1 66/71] disas/riscv: Decode all of the pmpcfg and pmpaddr CSRs

2024-06-07 Thread Michael Tokarev
From: Alistair Francis Previously we only listed a single pmpcfg CSR and the first 16 pmpaddr CSRs. This patch fixes this to list all 16 pmpcfg and all 64 pmpaddr CSRs are part of the disassembly. Reported-by: Eric DeVolder Signed-off-by: Alistair Francis Fixes: ea10325917 ("RISC-V Disassemble

[RFC v2 6/7] hw/vfio: Remove memory_region_iommu_set_iova_ranges() call

2024-06-07 Thread Eric Auger
As we have just removed the only implementation of iommu_set_iova_ranges IOMMU MR callback in the virtio-iommu, let's remove the call to the memory wrapper. Usable IOVA ranges are now conveyed through the PCIIOMMUOps in VFIO-PCI. Signed-off-by: Eric Auger --- hw/vfio/common.c | 10 -- 1

[Stable-9.0.1 61/71] target/riscv: prioritize pmp errors in raise_mmu_exception()

2024-06-07 Thread Michael Tokarev
From: Daniel Henrique Barboza raise_mmu_exception(), as is today, is prioritizing guest page faults by checking first if virt_enabled && !first_stage, and then considering the regular inst/load/store faults. There's no mention in the spec about guest page fault being a higher priority that PMP f

[Stable-8.2.5 33/45] target/riscv: rvv: Fix Zvfhmin checking for vfwcvt.f.f.v and vfncvt.f.f.w instructions

2024-06-07 Thread Michael Tokarev
From: Max Chou According v spec 18.4, only the vfwcvt.f.f.v and vfncvt.f.f.w instructions will be affected by Zvfhmin extension. And the vfwcvt.f.f.v and vfncvt.f.f.w instructions only support the conversions of * From 1*SEW(16/32) to 2*SEW(32/64) * From 2*SEW(32/64) to 1*SEW(16/32) Signed-off-

Re: [PATCH 4/4] target/ppc: Move VSX fp compare insns to decodetree.

2024-06-07 Thread Richard Henderson
On 6/7/24 07:49, Chinmay Rath wrote: +static bool do_cmp(DisasContext *ctx, arg_XX3_rc *a, +void (*helper)(TCGv_i32, TCGv_ptr, TCGv_ptr, TCGv_ptr, TCGv_ptr)) +{ +TCGv_i32 ignored; +TCGv_ptr xt, xa, xb; +REQUIRE_VSX(ctx); +xt = gen_vsr_ptr(a->xt); +xa = gen_vsr_ptr(

Re: [PATCH 2/4] target/ppc: Move VSX vector with length storage access insns to decodetree.

2024-06-07 Thread Richard Henderson
On 6/7/24 07:49, Chinmay Rath wrote: +static bool do_ld_st_vl(DisasContext *ctx, arg_X *a, +void (*helper)(TCGv_ptr, TCGv, TCGv_ptr, TCGv)) +{ +TCGv EA; +TCGv_ptr xt; +if (a->rt < 32) { +REQUIRE_VSX(ctx); +} else { +REQUIRE_VECTOR(ctx); +

[RFC v2 3/7] HostIOMMUDevice: Introduce get_iova_ranges callback

2024-06-07 Thread Eric Auger
Introduce a new HostIOMMUDevice callback that allows to retrieve the usable IOVA ranges. Implement this callback in the legacy VFIO and IOMMUFD VFIO host iommu devices. This relies on the VFIODevice agent's base container iova_ranges resource. Signed-off-by: Eric Auger --- include/sysemu/host_i

[PATCH 4/4] target/ppc: Move VSX fp compare insns to decodetree.

2024-06-07 Thread Chinmay Rath
Moving the following instructions to decodetree specification: xvcmp{eq, gt, ge, ne}{s, d}p: XX3-form The changes were verified by validating that the tcg-ops generated for those instructions remain the same which were captured using the '-d in_asm,op' flag. Signed-off-by: Chinmay Ra

[Stable-9.0.1 59/71] target/riscv: rvv: Check single width operator for vfncvt.rod.f.f.w

2024-06-07 Thread Michael Tokarev
From: Max Chou The opfv_narrow_check needs to check the single width float operator by require_rvf. Signed-off-by: Max Chou Reviewed-by: Daniel Henrique Barboza Cc: qemu-stable Message-ID: <20240322092600.1198921-4-max.c...@sifive.com> Signed-off-by: Alistair Francis (cherry picked from comm

[Stable-9.0.1 58/71] target/riscv: rvv: Check single width operator for vector fp widen instructions

2024-06-07 Thread Michael Tokarev
From: Max Chou The require_scale_rvf function only checks the double width operator for the vector floating point widen instructions, so most of the widen checking functions need to add require_rvf for single width operator. The vfwcvt.f.x.v and vfwcvt.f.xu.v instructions convert single width in

[Stable-8.2.5 41/45] disas/riscv: Decode all of the pmpcfg and pmpaddr CSRs

2024-06-07 Thread Michael Tokarev
From: Alistair Francis Previously we only listed a single pmpcfg CSR and the first 16 pmpaddr CSRs. This patch fixes this to list all 16 pmpcfg and all 64 pmpaddr CSRs are part of the disassembly. Reported-by: Eric DeVolder Signed-off-by: Alistair Francis Fixes: ea10325917 ("RISC-V Disassemble

[PATCH 2/4] target/ppc: Move VSX vector with length storage access insns to decodetree.

2024-06-07 Thread Chinmay Rath
Moving the following instructions to decodetree specification : {l, st}xvl(l) : X-form The changes were verified by validating that the tcg-ops generated by those instructions remain the same, which were captured using the '-d in_asm,op' flag. Signed-off-by: Chinmay Rath ---

Re: [PATCH v3 6/6] Convert x86_mmu_translate() to use common code.

2024-06-07 Thread Richard Henderson
On 6/6/24 07:02, Don Porter wrote: Signed-off-by: Don Porter --- target/i386/arch_memory_mapping.c| 44 +++- target/i386/cpu.h| 5 +- target/i386/helper.c | 374 +++ target/i386/tcg/sysemu/excp_helper.c | 2 +- 4 files ch

Re: [PATCH 1/5] backends/tpm: Remove newline character in trace event

2024-06-07 Thread Stefan Berger
On 6/6/24 06:39, Philippe Mathieu-Daudé wrote: Split the 'tpm_util_show_buffer' event in two to avoid using a newline character. Signed-off-by: Philippe Mathieu-Daudé --- backends/tpm/tpm_util.c | 5 +++-- backends/tpm/trace-events | 3 ++- 2 files changed, 5 insertions(+), 3 deletions

[Stable-9.0.1 54/71] target/riscv/kvm: tolerate KVM disable ext errors

2024-06-07 Thread Michael Tokarev
From: Daniel Henrique Barboza Running a KVM guest using a 6.9-rc3 kernel, in a 6.8 host that has zkr enabled, will fail with a kernel oops SIGILL right at the start. The reason is that we can't expose zkr without implementing the SEED CSR. Disabling zkr in the guest would be a workaround, but if

[RFC v2 1/7] HostIOMMUDevice: Store the VFIO/VDPA agent

2024-06-07 Thread Eric Auger
Store the agent device (VFIO or VDPA) in the host IOMMU device. This will allow easy access to some of its resources. Signed-off-by: Eric Auger --- include/sysemu/host_iommu_device.h | 1 + hw/vfio/container.c| 1 + hw/vfio/iommufd.c | 2 ++ 3 files changed, 4 in

[Stable-8.2.5 24/45] hvf: arm: Fix encodings for ID_AA64PFR1_EL1 and debug System registers

2024-06-07 Thread Michael Tokarev
From: Zenghui Yu We wrongly encoded ID_AA64PFR1_EL1 using {3,0,0,4,2} in hvf_sreg_match[] so we fail to get the expected ARMCPRegInfo from cp_regs hash table with the wrong key. Fix it with the correct encoding {3,0,0,4,1}. With that fixed, the Linux guest can properly detect FEAT_SSBS2 on my M1

Re: [PULL v2 2/2] hw/ufs: Add support MCQ of UFSHCI 4.0

2024-06-07 Thread Peter Maydell
On Mon, 3 Jun 2024 at 09:38, Jeuk Kim wrote: > > From: Minwoo Im > > This patch adds support for MCQ defined in UFSHCI 4.0. This patch > utilized the legacy I/O codes as much as possible to support MCQ. > > MCQ operation & runtime register is placed at 0x1000 offset of UFSHCI > register statical

[Stable-7.2.12 29/29] target/loongarch: fix a wrong print in cpu dump

2024-06-07 Thread Michael Tokarev
From: lanyanzhi description: loongarch_cpu_dump_state() want to dump all loongarch cpu state registers, but there is a tiny typographical error when printing "PRCFG2". Cc: qemu-sta...@nongnu.org Signed-off-by: lanyanzhi Reviewed-by: Richard Henderson Reviewed-by: Song Gao Message-Id: <202

[Stable-9.0.1 70/71] ui/sdl2: Allow host to power down screen

2024-06-07 Thread Michael Tokarev
From: Bernhard Beschow By default, SDL disables the screen saver which prevents the host from powering down the screen even if the screen is locked. This results in draining the battery needlessly when the host isn't connected to a wall charger. Fix that by enabling the screen saver. Signed-off-

[RFC v2 7/7] memory: Remove IOMMU MR iommu_set_iova_range API

2024-06-07 Thread Eric Auger
Since the host IOVA ranges are now passed through the PCIIOMMUOps set_host_resv_regions and we have removed the only implementation of iommu_set_iova_range() in the virtio-iommu and the only call site in vfio/common, let's retire the IOMMU MR API and its memory wrapper. Signed-off-by: Eric Auger

[Stable-8.2.5 38/45] target/riscv: do not set mtval2 for non guest-page faults

2024-06-07 Thread Michael Tokarev
From: Alexei Filippov Previous patch fixed the PMP priority in raise_mmu_exception() but we're still setting mtval2 incorrectly. In riscv_cpu_tlb_fill(), after pmp check in 2 stage translation part, mtval2 will be set in case of successes 2 stage translation but failed pmp check. In this case w

[Stable-9.0.1 60/71] target/riscv: rvv: Remove redudant SEW checking for vector fp narrow/widen instructions

2024-06-07 Thread Michael Tokarev
From: Max Chou If the checking functions check both the single and double width operators at the same time, then the single width operator checking functions (require_rvf[min]) will check whether the SEW is 8. Signed-off-by: Max Chou Reviewed-by: Daniel Henrique Barboza Cc: qemu-stable Messag

[Stable-8.2.5 39/45] target/riscv: rvzicbo: Fixup CBO extension register calculation

2024-06-07 Thread Michael Tokarev
From: Alistair Francis When running the instruction ``` cbo.flush 0(x0) ``` QEMU would segfault. The issue was in cpu_gpr[a->rs1] as QEMU does not have cpu_gpr[0] allocated. In order to fix this let's use the existing get_address() helper. This also has the benefit of performing pointer m

[Stable-8.2.5 26/45] target/arm: Disable SVE extensions when SVE is disabled

2024-06-07 Thread Michael Tokarev
From: Marcin Juszkiewicz Cc: qemu-sta...@nongnu.org Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2304 Reported-by: Marcin Juszkiewicz Signed-off-by: Richard Henderson Signed-off-by: Marcin Juszkiewicz Message-id: 20240526204551.553282-1-richard.hender...@linaro.org Reviewed-by: Pete

[Stable-7.2.12 26/29] target/i386: fix xsave.flat from kvm-unit-tests

2024-06-07 Thread Michael Tokarev
From: Paolo Bonzini xsave.flat checks that "executing the XSETBV instruction causes a general- protection fault (#GP) if ECX = 0 and EAX[2:1] has the value 10b". QEMU allows that option, so the test fails. Add the condition. Cc: qemu-sta...@nongnu.org Fixes: 892544317fe ("target/i386: implemen

[RFC v2 4/7] virtio-iommu: Compute host reserved regions

2024-06-07 Thread Eric Auger
Compute the host reserved regions in virtio_iommu_set_iommu_device(). The usable IOVA regions are retrieved from the HOSTIOMMUDevice. The virtio_iommu_set_host_iova_ranges() helper turns usable regions into complementary reserved regions while testing the inclusion into existing ones. virtio_iommu_

[Stable-9.0.1 65/71] riscv, gdbstub.c: fix reg_width in ricsv_gen_dynamic_vector_feature()

2024-06-07 Thread Michael Tokarev
From: Daniel Henrique Barboza Commit 33a24910ae changed 'reg_width' to use 'vlenb', i.e. vector length in bytes, when in this context we want 'reg_width' as the length in bits. Fix 'reg_width' back to the value in bits like 7cb59921c05a ("target/riscv/gdbstub.c: use 'vlenb' instead of shifting '

[Stable-8.2.5 36/45] target/riscv: rvv: Remove redudant SEW checking for vector fp narrow/widen instructions

2024-06-07 Thread Michael Tokarev
From: Max Chou If the checking functions check both the single and double width operators at the same time, then the single width operator checking functions (require_rvf[min]) will check whether the SEW is 8. Signed-off-by: Max Chou Reviewed-by: Daniel Henrique Barboza Cc: qemu-stable Messag

[Stable-8.2.5 22/45] gitlab: use $MAKE instead of 'make'

2024-06-07 Thread Michael Tokarev
From: Daniel P. Berrangé The lcitool generated containers have '$MAKE' set to the path of the right 'make' binary. Using the env variable makes it possible to override the choice per job. Signed-off-by: Daniel P. Berrangé Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé Message-ID

[Stable-9.0.1 46/71] gitlab: use 'setarch -R' to workaround tsan bug

2024-06-07 Thread Michael Tokarev
From: Daniel P. Berrangé The TSAN job started failing when gitlab rolled out their latest release. The root cause is a change in the Google COS version used on shared runners. This brings a kernel running with vm.mmap_rnd_bits = 31 which is incompatible with TSAN in LLVM < 18, which only suppo

[Stable-9.0.1 50/71] qio: Inherit follow_coroutine_ctx across TLS

2024-06-07 Thread Michael Tokarev
From: Eric Blake Since qemu 8.2, the combination of NBD + TLS + iothread crashes on an assertion failure: qemu-kvm: ../io/channel.c:534: void qio_channel_restart_read(void *): Assertion `qemu_get_current_aio_context() == qemu_coroutine_get_aio_context(co)' failed. It turns out that when we rem

Re: [PATCH 2/3] plugins: Free CPUPluginState before destroying vCPU state

2024-06-07 Thread Pierrick Bouvier
On 6/6/24 21:53, Philippe Mathieu-Daudé wrote: On 6/6/24 23:14, Pierrick Bouvier wrote: On 6/6/24 05:40, Philippe Mathieu-Daudé wrote: cpu::plugin_state is allocated in cpu_common_initfn() when the vCPU state is created. Release it in cpu_common_finalize() when we are done. Signed-off-by: Phil

[Stable-8.2.5 27/45] qio: Inherit follow_coroutine_ctx across TLS

2024-06-07 Thread Michael Tokarev
From: Eric Blake Since qemu 8.2, the combination of NBD + TLS + iothread crashes on an assertion failure: qemu-kvm: ../io/channel.c:534: void qio_channel_restart_read(void *): Assertion `qemu_get_current_aio_context() == qemu_coroutine_get_aio_context(co)' failed. It turns out that when we rem

Re: [PATCH v2 18/18] migration/ram: Add direct-io support to precopy file migration

2024-06-07 Thread Jim Fehlig
On 6/7/24 12:42 PM, Fabiano Rosas wrote: Peter Xu writes: On Thu, May 23, 2024 at 04:05:48PM -0300, Fabiano Rosas wrote: We've recently added support for direct-io with multifd, which brings performance benefits, but creates a non-uniform user interface by coupling direct-io with the multifd

[Stable-9.0.1 49/71] target/arm: Disable SVE extensions when SVE is disabled

2024-06-07 Thread Michael Tokarev
From: Marcin Juszkiewicz Cc: qemu-sta...@nongnu.org Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2304 Reported-by: Marcin Juszkiewicz Signed-off-by: Richard Henderson Signed-off-by: Marcin Juszkiewicz Message-id: 20240526204551.553282-1-richard.hender...@linaro.org Reviewed-by: Pete

Re: [PATCH 0/4] target/i386: fixes for OS/2 Warp

2024-06-07 Thread Paolo Bonzini
Queued, thanks (with the op->unit assignment removed, to answer your question). Paolo

[Stable-8.2.5 35/45] target/riscv: rvv: Check single width operator for vfncvt.rod.f.f.w

2024-06-07 Thread Michael Tokarev
From: Max Chou The opfv_narrow_check needs to check the single width float operator by require_rvf. Signed-off-by: Max Chou Reviewed-by: Daniel Henrique Barboza Cc: qemu-stable Message-ID: <20240322092600.1198921-4-max.c...@sifive.com> Signed-off-by: Alistair Francis (cherry picked from comm

[Stable-8.2.5 00/45] Patch Round-up for stable 8.2.5, frozen on 2024-06-07

2024-06-07 Thread Michael Tokarev
The following patches are queued for QEMU stable v8.2.5: https://gitlab.com/qemu-project/qemu/-/commits/staging-8.2 Patch freeze is 2024-06-07 (frozen), and the release is planned for 2024-06-09: https://wiki.qemu.org/Planning/8.2 Please respond here or CC qemu-sta...@nongnu.org for any add

Re: [PATCH v3 5/6] Move tcg implementation of x86 get_physical_address into common helper code.

2024-06-07 Thread Richard Henderson
On 6/6/24 07:02, Don Porter wrote: Signed-off-by: Don Porter --- target/i386/cpu.h| 42 ++ target/i386/helper.c | 515 + target/i386/tcg/sysemu/excp_helper.c | 555 +-- 3 files changed, 562 insertions(+), 5

[RFC v2 0/7] VIRTIO-IOMMU/VFIO: Fix host iommu geometry handling for hotplugged devices

2024-06-07 Thread Eric Auger
This series is based on Zhenzhong HostIOMMUDevice: [PATCH v7 00/17] Add a host IOMMU device abstraction to check with vIOMMU https://lore.kernel.org/all/20240605083043.317831-1-zhenzhong.d...@intel.com/ It allows to convey host IOVA reserved regions to the virtio-iommu and uses the HostIOMMUDevic

[Stable-7.2.12 28/29] ui/sdl2: Allow host to power down screen

2024-06-07 Thread Michael Tokarev
From: Bernhard Beschow By default, SDL disables the screen saver which prevents the host from powering down the screen even if the screen is locked. This results in draining the battery needlessly when the host isn't connected to a wall charger. Fix that by enabling the screen saver. Signed-off-

[Stable-8.2.5 37/45] target/riscv: prioritize pmp errors in raise_mmu_exception()

2024-06-07 Thread Michael Tokarev
From: Daniel Henrique Barboza raise_mmu_exception(), as is today, is prioritizing guest page faults by checking first if virt_enabled && !first_stage, and then considering the regular inst/load/store faults. There's no mention in the spec about guest page fault being a higher priority that PMP f

[Stable-8.2.5 42/45] target/i386: fix xsave.flat from kvm-unit-tests

2024-06-07 Thread Michael Tokarev
From: Paolo Bonzini xsave.flat checks that "executing the XSETBV instruction causes a general- protection fault (#GP) if ECX = 0 and EAX[2:1] has the value 10b". QEMU allows that option, so the test fails. Add the condition. Cc: qemu-sta...@nongnu.org Fixes: 892544317fe ("target/i386: implemen

[Stable-9.0.1 57/71] target/riscv: rvv: Fix Zvfhmin checking for vfwcvt.f.f.v and vfncvt.f.f.w instructions

2024-06-07 Thread Michael Tokarev
From: Max Chou According v spec 18.4, only the vfwcvt.f.f.v and vfncvt.f.f.w instructions will be affected by Zvfhmin extension. And the vfwcvt.f.f.v and vfncvt.f.f.w instructions only support the conversions of * From 1*SEW(16/32) to 2*SEW(32/64) * From 2*SEW(32/64) to 1*SEW(16/32) Signed-off-

Re: [PATCH v2 0/2] Zynq 7000 Improvements

2024-06-07 Thread Sebastian Huber
On 30.05.24 12:30, Peter Maydell wrote: On Fri, 24 May 2024 at 13:08, Sebastian Huber wrote: v2: * Add Kconfig support * Add array of CPUs to ZynqMachineState * Add FIQ support Sebastian Huber (2): hw/arm/xilinx_zynq: Add cache controller hw/arm/xilinx_zynq: Support up to two CPU cor

[Stable-9.0.1 55/71] target/riscv: Fix the element agnostic function problem

2024-06-07 Thread Michael Tokarev
From: Huang Tao In RVV and vcrypto instructions, the masked and tail elements are set to 1s using vext_set_elems_1s function if the vma/vta bit is set. It is the element agnostic policy. However, this function can't deal the big endian situation. This patch fixes the problem by adding handling o

[Stable-8.2.5 30/45] target/riscv/kvm: tolerate KVM disable ext errors

2024-06-07 Thread Michael Tokarev
From: Daniel Henrique Barboza Running a KVM guest using a 6.9-rc3 kernel, in a 6.8 host that has zkr enabled, will fail with a kernel oops SIGILL right at the start. The reason is that we can't expose zkr without implementing the SEED CSR. Disabling zkr in the guest would be a workaround, but if

Re: [PATCH 0/6] refactor RDMA live migration based on rsocket API

2024-06-07 Thread Yu Zhang
Hello Gonglei, Jinpu and I have tested your patchset by using our migration test cases on the physical RDMA cards. The result is: among 59 migration test cases, 10 failed. They are successful when using the original RDMA migration coed, but always fail when using the patchset. The syslog on the so

Re: [PATCH v1 0/1] hw/intc/arm_gic: Fix deactivation of SPI lines

2024-06-07 Thread Peter Maydell
On Wed, 5 Jun 2024 at 15:43, Edgar E. Iglesias wrote: > > From: "Edgar E. Iglesias" > > Julien reported that he has seen strange behaviour when running > Xen on QEMU using GICv2. When Xen migrates a guest's vCPU to > another pCPU while the vCPU is handling an interrupt the guest > is unable to pr

[Stable-8.2.5 28/45] iotests: test NBD+TLS+iothread

2024-06-07 Thread Michael Tokarev
From: Eric Blake Prevent regressions when using NBD with TLS in the presence of iothreads, adding coverage the fix to qio channels made in the previous patch. The shell function pick_unused_port() was copied from nbdkit.git/tests/functions.sh.in, where it had all authors from Red Hat, agreeing t

[Stable-8.2.5 20/45] gitlab: Update msys2-64bit runner tags

2024-06-07 Thread Michael Tokarev
From: Richard Henderson Gitlab has deprecated and removed support for windows-1809 and shared-windows. Update to saas-windows-medium-amd64 per https://about.gitlab.com/blog/2024/01/22/windows-2022-support-for-gitlab-saas-runners/ Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-

[Stable-9.0.1 51/71] iotests: test NBD+TLS+iothread

2024-06-07 Thread Michael Tokarev
From: Eric Blake Prevent regressions when using NBD with TLS in the presence of iothreads, adding coverage the fix to qio channels made in the previous patch. The shell function pick_unused_port() was copied from nbdkit.git/tests/functions.sh.in, where it had all authors from Red Hat, agreeing t

Re: [PATCH 3/4] target/ppc: Move VSX vector storage access insns to decodetree.

2024-06-07 Thread Richard Henderson
On 6/7/24 07:49, Chinmay Rath wrote: Moving the following instructions to decodetree specification: lxv{b16, d2, h8, w4, ds, ws}x : X-form stxv{b16, d2, h8, w4}x : X-form The changes were verified by validating that the tcg-ops generated for those instructions remain the same,

[Stable-8.2.5 29/45] hw/intc/riscv_aplic: APLICs should add child earlier than realize

2024-06-07 Thread Michael Tokarev
From: "yang.zhang" Since only root APLICs can have hw IRQ lines, aplic->parent should be initialized first. Fixes: e8f79343cf ("hw/intc: Add RISC-V AIA APLIC device emulation") Reviewed-by: Daniel Henrique Barboza Signed-off-by: yang.zhang Cc: qemu-stable Message-ID: <20240409014445.278-1-gao

[Stable-9.0.1 67/71] target/i386: fix xsave.flat from kvm-unit-tests

2024-06-07 Thread Michael Tokarev
From: Paolo Bonzini xsave.flat checks that "executing the XSETBV instruction causes a general- protection fault (#GP) if ECX = 0 and EAX[2:1] has the value 10b". QEMU allows that option, so the test fails. Add the condition. Cc: qemu-sta...@nongnu.org Fixes: 892544317fe ("target/i386: implemen

[Stable-7.2.12 25/29] disas/riscv: Decode all of the pmpcfg and pmpaddr CSRs

2024-06-07 Thread Michael Tokarev
From: Alistair Francis Previously we only listed a single pmpcfg CSR and the first 16 pmpaddr CSRs. This patch fixes this to list all 16 pmpcfg and all 64 pmpaddr CSRs are part of the disassembly. Reported-by: Eric DeVolder Signed-off-by: Alistair Francis Fixes: ea10325917 ("RISC-V Disassemble

[Stable-7.2.12 27/29] target/i386: fix SSE and SSE2 feature check

2024-06-07 Thread Michael Tokarev
From: Xinyu Li Features check of CPUID_SSE and CPUID_SSE2 should use cpuid_features, rather than cpuid_ext_features. Signed-off-by: Xinyu Li Reviewed-by: Zhao Liu Message-ID: <20240602100904.2137939-1-lixinyu...@ict.ac.cn> Signed-off-by: Paolo Bonzini (cherry picked from commit da7c95920d027d

  1   2   >