Re: [PATCH 26/36] next-cube: don't use rtc phase value of -1

2024-11-08 Thread Thomas Huth
Am Wed, 23 Oct 2024 09:58:42 +0100 schrieb Mark Cave-Ayland : > The rtc phase value of -1 is directly equivalent to using a phase value of 0 > so > simplify the logic to use an initial rtc phase of 0. > > Signed-off-by: Mark Cave-Ayland > --- > hw/m68k/next-cube.c | 5 + > 1 file changed,

Re: [PATCH 25/36] next-cube: use named gpio to read RTC data bit in scr2

2024-11-08 Thread Thomas Huth
Am Wed, 23 Oct 2024 09:58:41 +0100 schrieb Mark Cave-Ayland : > This is in preparation for moving NeXTRTC to its own separate device. > > Signed-off-by: Mark Cave-Ayland > --- > hw/m68k/next-cube.c | 169 > 1 file changed, 92 insertions(+), 77 deleti

Re: [PATCH 24/36] next-cube: use named gpio to set RTC data bit in scr2

2024-11-08 Thread Thomas Huth
Am Wed, 23 Oct 2024 09:58:40 +0100 schrieb Mark Cave-Ayland : > This is in preparation for moving NeXTRTC to its own separate device. > > Signed-off-by: Mark Cave-Ayland > --- > hw/m68k/next-cube.c | 25 + > 1 file changed, 21 insertions(+), 4 deletions(-) Reviewed-by:

Re: [Stable-7.2.15 v1 00/33] Patch Round-up for stable 7.2.15, freeze on 2024-11-18

2024-11-08 Thread Michael Tokarev
09.11.2024 10:38, Paolo Bonzini wrote: On 11/9/24 07:38, Michael Tokarev wrote: 12 64e0e63ea16a Tom Dohrmann:     accel/kvm: check for KVM_CAP_READONLY_MEM on VM This only matters for SEV-SNP support, so it's not needed before 9.1. But it's not harmful either. Aha. Thank you for letting me

Re: [Stable-7.2.15 v1 00/33] Patch Round-up for stable 7.2.15, freeze on 2024-11-18

2024-11-08 Thread Paolo Bonzini
On 11/9/24 07:38, Michael Tokarev wrote: 12 64e0e63ea16a Tom Dohrmann: accel/kvm: check for KVM_CAP_READONLY_MEM on VM This only matters for SEV-SNP support, so it's not needed before 9.1. But it's not harmful either. 13 d9280ea31747 Stefan Berger: tests: Wait for migration completi

[PULL v2 06/13] eif: cope with huge section sizes

2024-11-08 Thread Paolo Bonzini
Check for overflow as well as allocation failure. Resolves Coverity CID 1564859. Reviewed-by: Pierrick Bouvier Reviewed-by: Dorjoy Chowdhury Signed-off-by: Paolo Bonzini --- hw/core/eif.c | 48 +--- 1 file changed, 41 insertions(+), 7 deletions(-)

[PULL v2 00/13] (Almost entirely) bugfix changes for QEMU 9.2 hard freeze

2024-11-08 Thread Paolo Bonzini
The following changes since commit a1dacb66915eb7d08a0596cc97068a37c39930d3: Merge tag 'for-upstream-rust' of https://gitlab.com/bonzini/qemu into staging (2024-11-06 21:27:47 +) are available in the Git repository at: https://gitlab.com/bonzini/qemu.git tags/for-upstream for you to fe

Re: [PATCH] hw/igd: fix calculation of graphics stolen memory

2024-11-08 Thread Cédric Le Goater
On 11/8/24 13:49, Corvin Köhne wrote: From: Corvin Köhne When copying the calculation of the stolen memory size for Intels integrated graphics device of gen 9 and later from the Linux kernel [1], we missed subtracting 0xf0 from the graphics mode select value for values above 0xf0. This leads to

Re: [PATCH] vfio/igd: add pci id for Coffee Lake

2024-11-08 Thread Cédric Le Goater
On 11/8/24 13:48, Corvin Köhne wrote: From: Corvin Köhne I've tested and verified that Coffee Lake devices are working properly. Signed-off-by: Corvin Köhne Applied to vfio-next. Thanks, C.

Re: [PATCH v3 2/6] ui/sdl2: Implement dpy dmabuf functions

2024-11-08 Thread Dmitry Osipenko
Accidentally missed this email a week ago. Thanks again for all the reviews! On 10/31/24 10:32, Akihiko Odaki wrote: ... >>   +# libx11 presents together with SDL or GTK libs on systems that >> support X11 >> +xlib = dependency('x11', required: false) > > There is a line saying: > x11 = dependenc

[Stable-7.2.15 10/33] hw/audio/hda: free timer on exit

2024-11-08 Thread Michael Tokarev
From: Marc-André Lureau Fixes: 280c1e1cd ("audio/hda: create millisecond timers that handle IO") Signed-off-by: Marc-André Lureau Reviewed-by: Akihiko Odaki Message-ID: <20241008125028.1177932-2-marcandre.lur...@redhat.com> (cherry picked from commit f27206ceedbe2efae37c8d143c5eb2db05251508) S

[Stable-7.2.15 v1 00/33] Patch Round-up for stable 7.2.15, freeze on 2024-11-18

2024-11-08 Thread Michael Tokarev
The following patches are queued for QEMU stable v7.2.15: https://gitlab.com/qemu-project/qemu/-/commits/staging-7.2 Patch freeze is 2024-11-18, and the release is planned for 2024-11-20: https://wiki.qemu.org/Planning/7.2 Please respond here or CC qemu-sta...@nongnu.org on any additional p

[Stable-7.2.15 12/33] accel/kvm: check for KVM_CAP_READONLY_MEM on VM

2024-11-08 Thread Michael Tokarev
From: Tom Dohrmann KVM_CAP_READONLY_MEM used to be a global capability, but with the introduction of AMD SEV-SNP confidential VMs, this extension is not always available on all VM types [1,2]. Query the extension on the VM level instead of on the KVM level. [1] https://patchwork.kernel.org/pro

[Stable-7.2.15 14/33] raw-format: Fix error message for invalid offset/size

2024-11-08 Thread Michael Tokarev
From: Kevin Wolf s->offset and s->size are only set at the end of the function and still contain the old values when formatting the error message. Print the parameters with the new values that we actually checked instead. Fixes: 500e2434207d ('raw-format: Split raw_read_options()') Signed-off-by

[Stable-7.2.15 16/33] target/i386: Avoid unreachable variable declaration in mmu_translate()

2024-11-08 Thread Michael Tokarev
From: Peter Maydell Coverity complains (CID 1507880) that the declaration "int error_code;" in mmu_translate() is unreachable code. Since this is only a declaration, this isn't actually a bug, but: * it's a bear-trap for future changes, because if it was changed to include an initialization '

[Stable-7.2.15 21/33] net/tap-win32: Fix gcc 14 format truncation errors

2024-11-08 Thread Michael Tokarev
From: Bernhard Beschow The patch fixes the following errors generated by GCC 14.2: ../src/net/tap-win32.c:343:19: error: '%s' directive output may be truncated writing up to 255 bytes into a region of size 176 [-Werror=format-truncation=] 343 | "%s\\%s\\Connection", |

[Stable-7.2.15 15/33] tcg: Reset data_gen_ptr correctly

2024-11-08 Thread Michael Tokarev
From: Richard Henderson This pointer needs to be reset after overflow just like code_buf and code_ptr. Cc: qemu-sta...@nongnu.org Fixes: 57a269469db ("tcg: Infrastructure for managing constant pools") Acked-by: Alistair Francis Reviewed-by: Pierrick Bouvier Reviewed-by: LIU Zhiwei Signed-off-

[Stable-7.2.15 09/33] hw/intc/arm_gicv3_cpuif: Add cast to match the documentation

2024-11-08 Thread Michael Tokarev
From: Alexandra Diupina The result of 1 << regbit with regbit==31 has a 1 in the 32nd bit. When cast to uint64_t (for further bitwise OR), the 32 most significant bits will be filled with 1s. However, the documentation states that the upper 32 bits of ICH_AP[0/1]R_EL2 are reserved. Add an explic

[Stable-7.2.15 02/33] target/ppc: Fix lxvx/stxvx facility check

2024-11-08 Thread Michael Tokarev
From: Fabiano Rosas The XT check for the lxvx/stxvx instructions is currently inverted. This was introduced during the move to decodetree. >From the ISA: Chapter 7. Vector-Scalar Extension Facility Load VSX Vector Indexed X-form lxvx XT,RA,RB if TX=0 & MSR.VSX=0 then VSX_Unavailable()

[Stable-7.2.15 33/33] 9pfs: fix crash on 'Treaddir' request

2024-11-08 Thread Michael Tokarev
From: Christian Schoenebeck A bad (broken or malicious) 9p client (guest) could cause QEMU host to crash by sending a 9p 'Treaddir' request with a numeric file ID (FID) that was previously opened for a file instead of an expected directory: #0 0x762aff8f4919 in __GI___rewinddir (dirp=0xf)

[Stable-7.2.15 26/33] target/riscv: Set vtype.vill on CPU reset

2024-11-08 Thread Michael Tokarev
From: Rob Bradford The RISC-V unprivileged specification "31.3.11. State of Vector Extension at Reset" has a note that recommends vtype.vill be set on reset as part of ensuring that the vector extension have a consistent state at reset. This change now makes QEMU consistent with Spike which sets

[Stable-7.2.15 24/33] target/riscv: Correct SXL return value for RV32 in RV64 QEMU

2024-11-08 Thread Michael Tokarev
From: TANG Tiancheng Ensure that riscv_cpu_sxl returns MXL_RV32 when runningRV32 in an RV64 QEMU. Signed-off-by: TANG Tiancheng Fixes: 05e6ca5e156 ("target/riscv: Ignore reserved bits in PTE for RV64") Reviewed-by: Liu Zhiwei Reviewed-by: Alistair Francis Message-ID: <20240919055048.562-4-zhi

[Stable-7.2.15 08/33] scsi: fetch unit attention when creating the request

2024-11-08 Thread Michael Tokarev
From: Stefano Garzarella Commit 1880ad4f4e ("virtio-scsi: Batched prepare for cmd reqs") split calls to scsi_req_new() and scsi_req_enqueue() in the virtio-scsi device. No ill effects were observed until commit 8cc5583abe ("virtio-scsi: Send "REPORTED LUNS CHANGED" sense data upon disk hotplug ev

[Stable-7.2.15 29/33] target/riscv: Fix vcompress with rvv_ta_all_1s

2024-11-08 Thread Michael Tokarev
From: Anton Blanchard vcompress packs vl or less fields into vd, so the tail starts after the last packed field. This could be more clearly expressed in the ISA, but for now this thread helps to explain it: https://github.com/riscv/riscv-v-spec/issues/796 Signed-off-by: Anton Blanchard Reviewe

[Stable-7.2.15 17/33] target/i386: Walk NPT in guest real mode

2024-11-08 Thread Michael Tokarev
From: Alexander Graf When translating virtual to physical address with a guest CPU that supports nested paging (NPT), we need to perform every page table walk access indirectly through the NPT, which we correctly do. However, we treat real mode (no page table walk) special: In that case, we curr

[Stable-7.2.15 22/33] target/arm: Don't assert in regime_is_user() for E10 mmuidx values

2024-11-08 Thread Michael Tokarev
From: Peter Maydell In regime_is_user() we assert if we're passed an ARMMMUIdx_E10_* mmuidx value. This used to make sense because we only used this function in ptw.c and would never use it on this kind of stage 1+2 mmuidx, only for an individual stage 1 or stage 2 mmuidx. However, when we imple

[Stable-7.2.15 32/33] hw/nvme: fix handling of over-committed queues

2024-11-08 Thread Michael Tokarev
From: Klaus Jensen If a host chooses to use the SQHD "hint" in the CQE to know if there is room in the submission queue for additional commands, it may result in a situation where there are not enough internal resources (struct NvmeRequest) available to process the command. For a lack of a better

[Stable-7.2.15 31/33] target/arm: Fix SVE SDOT/UDOT/USDOT (4-way, indexed)

2024-11-08 Thread Michael Tokarev
From: Peter Maydell Our implementation of the indexed version of SVE SDOT/UDOT/USDOT got the calculation of the inner loop terminator wrong. Although we correctly account for the element size when we calculate the terminator for the first iteration: intptr_t segend = MIN(16 / sizeof(TYPED), o

[Stable-7.2.15 25/33] hw/intc: Don't clear pending bits on IRQ lowering

2024-11-08 Thread Michael Tokarev
From: Sergey Makarov According to PLIC specification (chapter 5), there is only one case, when interrupt is claimed. Fix PLIC controller to match this behavior. Signed-off-by: Sergey Makarov Reviewed-by: Alistair Francis Message-ID: <20240918140229.124329-3-s.maka...@syntacore.com> Signed-off-

[Stable-7.2.15 19/33] gitlab: make check-[dco|patch] a little more verbose

2024-11-08 Thread Michael Tokarev
From: Alex Bennée When git fails the rather terse backtrace only indicates it failed without some useful context. Add some to make the log a little more useful. Reviewed-by: Daniel P. Berrangé Signed-off-by: Alex Bennée Message-Id: <20241023113406.1284676-11-alex.ben...@linaro.org> (cherry pic

[Stable-7.2.15 30/33] target/ppc: Set ctx->opcode for decode_insn32()

2024-11-08 Thread Michael Tokarev
From: Ilya Leoshkevich divdu (without a dot) sometimes updates cr0, even though it shouldn't. The reason is that gen_op_arith_divd() checks Rc(ctx->opcode), which is not initialized. This field is initialized only for instructions that go through decode_legacy(), and not decodetree. There alread

[Stable-7.2.15 28/33] hw/intc/riscv_aplic: Check and update pending when write sourcecfg

2024-11-08 Thread Michael Tokarev
From: Yong-Xuan Wang The section 4.5.2 of the RISC-V AIA specification says that any write to a sourcecfg register of an APLIC might (or might not) cause the corresponding interrupt-pending bit to be set to one if the rectified input value is high (= 1) under the new source mode. If an interrupt

[Stable-7.2.15 05/33] tracetool: avoid invalid escape in Python string

2024-11-08 Thread Michael Tokarev
From: Paolo Bonzini This is an error in Python 3.12; fix it by using a raw string literal. Cc: qemu-sta...@nongnu.org Signed-off-by: Paolo Bonzini (cherry picked from commit e6d8e5e6e366ab4c9ed7d8ed1572f98c6ad6a38e) Signed-off-by: Michael Tokarev diff --git a/scripts/tracetool/__init__.py b/s

[Stable-7.2.15 20/33] Fix calculation of minimum in colo_compare_tcp

2024-11-08 Thread Michael Tokarev
From: Stefan Weil GitHub's CodeQL reports a critical error which is fixed by using the MIN macro: Unsigned difference expression compared to zero Signed-off-by: Stefan Weil Cc: qemu-sta...@nongnu.org Reviewed-by: Zhang Chen Signed-off-by: Jason Wang (cherry picked from commit e29bc931e16

Re: [PATCH 4/5] hw/openrisc: Mark devices as big-endian

2024-11-08 Thread Thomas Huth
Am Wed, 6 Nov 2024 18:46:11 + schrieb Philippe Mathieu-Daudé : > These devices are only used by the OpenRISC target, which is > only built as big-endian. Therefore the DEVICE_NATIVE_ENDIAN > definition expand to DEVICE_BIG_ENDIAN (besides, the > DEVICE_LITTLE_ENDIAN case isn't tested). Simpli

[Stable-7.2.15 23/33] target/riscv/csr.c: Fix an access to VXSAT

2024-11-08 Thread Michael Tokarev
From: Evgenii Prokopiev The register VXSAT should be RW only to the first bit. The remaining bits should be 0. The RISC-V Instruction Set Manual Volume I: Unprivileged Architecture The vxsat CSR has a single read-write least-significant bit (vxsat[0]) that indicates if a fixed-point instruction

[Stable-7.2.15 18/33] linux-user/ppc: Fix sigmask endianness issue in sigreturn

2024-11-08 Thread Michael Tokarev
From: Ilya Leoshkevich do_setcontext() copies the target sigmask without endianness handling and then uses target_to_host_sigset_internal(), which expects a byte-swapped one. Use target_to_host_sigset() instead. Fixes: bcd4933a23f1 ("linux-user: ppc signal handling") Signed-off-by: Ilya Leoshkev

[Stable-7.2.15 27/33] hw/intc/riscv_aplic: Fix in_clrip[x] read emulation

2024-11-08 Thread Michael Tokarev
From: Anup Patel The reads to in_clrip[x] registers return rectified input values of the interrupt sources. A rectified input value of an interrupt source is defined by the section "4.5.2 Source configurations (sourcecfg[1]–sourcecfg[1023])" of the RISC-V AIA specification as: "rectified input v

Re: [PATCH 1/5] hw/i386: Mark devices as little-endian

2024-11-08 Thread Thomas Huth
Am Wed, 6 Nov 2024 18:46:08 + schrieb Philippe Mathieu-Daudé : > These devices are only used by the X86 targets, which are only > built as little-endian. Therefore the DEVICE_NATIVE_ENDIAN > definition expand to DEVICE_LITTLE_ENDIAN (besides, the > DEVICE_BIG_ENDIAN case isn't tested). Simpli

[Stable-7.2.15 06/33] linux-user/flatload: Take mmap_lock in load_flt_binary()

2024-11-08 Thread Michael Tokarev
From: Philippe Mathieu-Daudé load_flt_binary() calls load_flat_file() -> page_set_flags(). page_set_flags() must be called with the mmap_lock held, otherwise it aborts: $ qemu-arm -L stm32/lib/ stm32/bin/busybox qemu-arm: ../accel/tcg/user-exec.c:505: page_set_flags: Assertion `have_mmap_l

[Stable-7.2.15 11/33] KVM: Dynamic sized kvm memslots array

2024-11-08 Thread Michael Tokarev
From: Peter Xu Zhiyi reported an infinite loop issue in VFIO use case. The cause of that was a separate discussion, however during that I found a regression of dirty sync slowness when profiling. Each KVMMemoryListerner maintains an array of kvm memslots. Currently it's statically allocated to

[Stable-7.2.15 07/33] linux-user: Fix parse_elf_properties GNU0_MAGIC check

2024-11-08 Thread Michael Tokarev
From: Richard Henderson Comparing a string of 4 bytes only works in little-endian. Adjust bulk bswap to only apply to the note payload. Perform swapping of the note header manually; the magic is defined so that it does not need a runtime swap. Fixes: 83f990eb5adb ("linux-user/elfload: Parse NT_

[Stable-7.2.15 13/33] tests: Wait for migration completion on destination QEMU to avoid failures

2024-11-08 Thread Michael Tokarev
From: Stefan Berger Rather than waiting for the completion of migration on the source side, wait for it on the destination QEMU side to avoid accessing the TPM TIS memory mapped registers before QEMU could restore their state. This error condition could be triggered on busy systems where the dest

[Stable-7.2.15 04/33] fuzz: disable leak-detection for oss-fuzz builds

2024-11-08 Thread Michael Tokarev
From: Alexander Bulekov When we are building for OSS-Fuzz, we want to ensure that the fuzzer targets are actually created, regardless of leaks. Leaks will be detected by the subsequent tests of the individual fuzz-targets. Signed-off-by: Alexander Bulekov Reviewed-by: Philippe Mathieu-Daudé Me

[Stable-7.2.15 01/33] softmmu/physmem.c: Keep transaction attribute in address_space_map()

2024-11-08 Thread Michael Tokarev
From: "Fea.Wang" The follow-up transactions may use the data in the attribution, so keep the value of attribution from the function parameter just as flatview_translate() above. Signed-off-by: Fea.Wang Cc: qemu-sta...@nongnu.org Fixes: f26404fbee ("Make address_space_map() take a MemTxAttrs arg

[Stable-7.2.15 03/33] block/reqlist: allow adding overlapping requests

2024-11-08 Thread Michael Tokarev
From: Fiona Ebner Allow overlapping request by removing the assert that made it impossible. There are only two callers: 1. block_copy_task_create() It already asserts the very same condition before calling reqlist_init_req(). 2. cbw_snapshot_read_lock() There is no need to have read requests

Re: [PATCH 2/5] hw/tricore: Mark devices as little-endian

2024-11-08 Thread Thomas Huth
Am Wed, 6 Nov 2024 18:46:09 + schrieb Philippe Mathieu-Daudé : > These devices are only used by the TriCore target, which is > only built as little-endian. Therefore the DEVICE_NATIVE_ENDIAN > definition expand to DEVICE_LITTLE_ENDIAN (besides, the > DEVICE_BIG_ENDIAN case isn't tested). Simp

[PATCH v4 1/4] vhost_vdpa : Add a new parameter to enable check mac address

2024-11-08 Thread Cindy Lu
When using a VDPA device, it's important to ensure that the MAC address is correctly set. Add a new parameter in qemu cmdline to enable this check, default value is false The usage is: -netdev type=vhost-vdpa,vhostdev=/dev/vhost-vdpa-0,id=vhost-vdpa0,check-mac=true\ -device virtio-net-pci,ne

[PATCH v4 4/4] virtio_net: Add third acceptable configuration for MAC setup.

2024-11-08 Thread Cindy Lu
For VDPA devices, Allow configurations where both the hardware MAC address and QEMU command line MAC address are zero. Signed-off-by: Cindy Lu --- hw/net/virtio-net.c | 13 + 1 file changed, 13 insertions(+) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index f74aa4f8db..66

[PATCH v4 2/4] virtio_net: Add the check for vdpa's mac address

2024-11-08 Thread Cindy Lu
When using a VDPA device, it is important to ensure that the MAC address is correctly set. The MAC address in the hardware should match the MAC address from the QEMU command line. This is a recommended configuration and will allow the system to boot. Signed-off-by: Cindy Lu --- hw/net/virtio-net

[PATCH v4 3/4] virtio_net: Add second acceptable configuration for MAC setup

2024-11-08 Thread Cindy Lu
For VDPA devices, Allow configurations where the hardware MAC address is non-zero while the MAC address in the QEMU command line is zero. Signed-off-by: Cindy Lu --- hw/net/virtio-net.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c

[PATCH v4 0/4] virtio_net: Add the check for vdpa's mac address

2024-11-08 Thread Cindy Lu
When using a VDPA device, it is important to ensure that the MAC address is correctly set. In this patch series, we add a new parameter to enable this check. Only three MAC setup configurations are acceptable; any other will fail to boot. The usage is: -netdev type=vhost-vdpa,vhostdev=/dev/v

Re: [PATCH 3/5] hw/m68k: Mark devices as big-endian

2024-11-08 Thread Thomas Huth
Am Wed, 6 Nov 2024 18:46:10 + schrieb Philippe Mathieu-Daudé : > These devices are only used by the M68K target, which is only > built as big-endian. Therefore the DEVICE_NATIVE_ENDIAN > definition expand to DEVICE_BIG_ENDIAN (besides, the > DEVICE_LITTLE_ENDIAN case isn't tested). Simplify d

[PATCH v1 1/2] virtio-balloon: Enable free page hinting during PRECOPY_NOTIFY_SETUP

2024-11-08 Thread Hyman Huang
PRECOPY_NOTIFY_AFTER_BITMAP_SYNC was interpreted by free page hinting optimization as an indication to begin freeing pages. But there's no assurance that a sync is required when beginning a migration. Therefore, during PRECOPY_NOTIFY_SETUP, as well as PRECOPY_NOTIFY_AFTER_BITMAP_SYNC, enable free p

[PATCH v1 2/2] migration: Do not perform RAMBlock dirty sync during the first iteration

2024-11-08 Thread Hyman Huang
The first iteration's RAMBlock dirty sync can be omitted because QEMU always initializes the RAMBlock's bmap to all 1s by default. Signed-off-by: Hyman Huang --- migration/cpu-throttle.c | 2 +- migration/ram.c | 11 --- 2 files changed, 9 insertions(+), 4 deletions(-) diff --

[PATCH v1 0/2] migration: Skip the first dirty sync

2024-11-08 Thread Hyman Huang
The first iteration's RAMBlock dirty sync can be omitted because QEMU always initializes the RAMBlock's bmap to all 1s by default. Prior to that, a pre-requisite patch was offered to maintain the free page optimizing behavior. For more details, please refers to: https://lore.kernel.org/qemu-devel

Re: [PATCH] migration: Do not perform RAMBlock dirty sync during the first iteration

2024-11-08 Thread Yong Huang
On Fri, Nov 8, 2024 at 9:50 PM Peter Xu wrote: > On Fri, Nov 08, 2024 at 02:03:47PM +0800, Yong Huang wrote: > > On Fri, Nov 8, 2024 at 12:28 AM Peter Xu wrote: > > > > > On Thu, Nov 07, 2024 at 05:56:50PM +0800, yong.hu...@smartx.com wrote: > > > > From: Hyman Huang > > > > > > > > The first i

[PATCH V2 2/3] Fix: CPUs presence logic in _STA for x86 backward compatability

2024-11-08 Thread Salil Mehta via
Checking `is_present` first can break x86 migration from new Qemu version to old Qemu. This is because CPRS Bit is not defined in the older Qemu register block and will always be 0 resulting in check always failing. Remove CPU_PRESENT Bit to preserve older ABI. -If ((\_SB.PCI0.PRES

[PATCH V2 3/3] tests/qtest/bios-tables-test: Fix DSDT golden masters for x86/{pc, q35}

2024-11-08 Thread Salil Mehta via
Update the DSDT golden master files for the x86/pc and x86/q35 platforms to address recent changes in the architecture-agnostic CPU AML code, which impacted the backward compatibility of the migration feature on the x86 platform. Additionally, initialize CPU's presence statically within the CPU AML

[PATCH V2 1/3] qtest: allow ACPI DSDT Table changes

2024-11-08 Thread Salil Mehta via
list changed files in tests/qtest/bios-tables-test-allowed-diff.h Suggested-by: Igor Mammedov Message-ID: <20241106100047.18901...@imammedo.users.ipa.redhat.com> Signed-off-by: Salil Mehta --- tests/qtest/bios-tables-test-allowed-diff.h | 41 + 1 file changed, 41 insertions(

[PATCH V2 0/3] Fixes CPUs AML & acpi-bios-tables to be x86 backward compatible

2024-11-08 Thread Salil Mehta via
Fixes the the CPUs AML code and its corresponding golden masters ACPI tables files for backward compatability of live migration on x86 platforms i.e. when newer Qemu is migrated to older Qemu without `CPRS` Bit present in the register block. This also reverts the ACPI ABI change introduced for chec

Re: [PATCH] hw/timer: fix possible int overflow

2024-11-08 Thread Евгений Воеводин
Hey guys, I can't remember details about this particular work which has been done more than decade ago, but I guess that these uint32_t variables reflect the architectural state of the HW, so if it might overflow over time, there is high probability that this is what was architecturally going to ha

[PATCH] target/riscv: Add Tenstorrent Ascalon CPU

2024-11-08 Thread Anton Blanchard
Add a CPU entry for the Tenstorrent Ascalon CPU, a series of 2 wide to 8 wide RV64 cores. Signed-off-by: Anton Blanchard --- target/riscv/cpu-qom.h | 1 + target/riscv/cpu.c | 67 ++ 2 files changed, 68 insertions(+) diff --git a/target/riscv/cpu-qom

[PATCH] hw/i386/elfboot: allocate "header" in heap

2024-11-08 Thread slp
From: Sergio Lopez In x86_load_linux(), we were using a stack-allocated array as data for fw_cfg_add_bytes(). Since the latter just takes a reference to the pointer instead of copying the data, it can happen that the contents have been overridden by the time the guest attempts to access them. In

Re: [PULL 06/13] eif: cope with huge section sizes

2024-11-08 Thread Paolo Bonzini
Il ven 8 nov 2024, 18:48 Dorjoy Chowdhury ha scritto: > I was looking into doing some changes on top of the original patch and > this check above should be if (!(*cmdline)), right? > Oops, yes it should. I will send a new pull request tomorrow morning. Paolo Regards, > Dorjoy > >

Re: [PATCH] hw/igd: fix calculation of graphics stolen memory

2024-11-08 Thread Alex Williamson
On Fri, 8 Nov 2024 13:49:04 +0100 Corvin Köhne wrote: > From: Corvin Köhne > > When copying the calculation of the stolen memory size for Intels integrated * Intel's > graphics device of gen 9 and later from the Linux kernel [1], we missed > subtracting 0xf0 from the graphics mode select val

Re: [PATCH] vfio/igd: add pci id for Coffee Lake

2024-11-08 Thread Alex Williamson
On Fri, 8 Nov 2024 13:48:30 +0100 Corvin Köhne wrote: > From: Corvin Köhne > > I've tested and verified that Coffee Lake devices are working properly. > > Signed-off-by: Corvin Köhne > --- > hw/vfio/igd.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/hw/vfio/igd.c b/hw/vfio/i

Re: [PATCH v4 7/7] target/i386: Add EPYC-Genoa model to support Zen 4 processor series

2024-11-08 Thread Moger, Babu
Hi Maxim, Thanks for looking into this. I will fix the bits I mentioned below in upcoming Genoa/Turin model update. I have few comments below. On 11/8/2024 12:15 PM, Maksim Davydov wrote: Hi! I compared EPYC-Genoa CPU model with CPUID output from real EPYC Genoa host. I found some mismatche

[PULL 13/13] hw/i386/pc: Don't try to init PCI NICs if there is no PCI bus

2024-11-08 Thread Paolo Bonzini
From: Peter Maydell The 'isapc' machine type has no PCI bus, but pc_nic_init() still calls pci_init_nic_devices() passing it a NULL bus pointer. This causes the clang sanitizer to complain: $ ./build/clang/qemu-system-i386 -M isapc ../../hw/pci/pci.c:1866:39: runtime error: member access within

Re: [PATCH v4 1/2] next-kbd: convert to use qemu_input_handler_register()

2024-11-08 Thread BALATON Zoltan
On Fri, 8 Nov 2024, Philippe Mathieu-Daudé wrote: On 8/11/24 13:13, BALATON Zoltan wrote: On Fri, 8 Nov 2024, Thomas Huth wrote: On 06/11/2024 21.32, BALATON Zoltan wrote: On Wed, 6 Nov 2024, Philippe Mathieu-Daudé wrote: On 6/11/24 13:00, BALATON Zoltan wrote: On Wed, 6 Nov 2024, Mark Cave-

Re: [PATCH v10 0/8] memory: prevent dma-reentracy issues

2024-11-08 Thread Alexander Bulekov
On 230427 1710, Alexander Bulekov wrote: > These patches aim to solve two types of DMA-reentrancy issues: > > 1.) mmio -> dma -> mmio case > To solve this, we track whether the device is engaged in io by > checking/setting a reentrancy-guard within APIs used for MMIO access. > > 2.) bh -> dma w

[PATCH 1/1] pc-bios/s390x: Initialize cdrom type to false for each IPL device

2024-11-08 Thread jrossi
From: Jared Rossi Clear information about cdrom type so that current IPL device isn't tainted by stale data from previous devices. Signed-off-by: Jared Rossi --- pc-bios/s390-ccw/main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c index

Re: [PULL 10/29] hw/core: Check smp cache topology support for machine

2024-11-08 Thread Peter Maydell
On Tue, 5 Nov 2024 at 22:49, Philippe Mathieu-Daudé wrote: > > From: Zhao Liu > > Add cache_supported flags in SMPCompatProps to allow machines to > configure various caches support. > > And check the compatibility of the cache properties with the > machine support in machine_parse_smp_cache().

[PATCH 2/3] tests/qtest/cmsdk-apb-watchdog-test: Parameterize tests

2024-11-08 Thread Roque Arcudia Hernandez
Currently the CMSDK APB watchdog tests target an specialized version of the device (luminaris using the lm3s811evb machine) that prevents the development of tests for the more generic device documented in: https://developer.arm.com/documentation/ddi0479/d/apb-components/apb-watchdog/programmers-mo

[PATCH 0/3] Make WDOGCONTROL.INTEN the counter enable of the CMSDK APB Watchdog

2024-11-08 Thread Roque Arcudia Hernandez
The following patchset tries to address an issue where the watchdog counter was running as soon as the device is out of reset. This created a few problems with the firmware under test. It was pointed out that the firmware under test was already working on an emulator using the real RTL. Further rev

Re: qemu-r...@nongnu.org mailing list created

2024-11-08 Thread Manos Pitsidianakis
On Fri, Nov 8, 2024 at 4:51 PM Daniel P. Berrangé wrote: > > On Fri, Nov 08, 2024 at 03:13:58PM +, Peter Maydell wrote: > > One of the things suggested at the KVM Forum Rust BoF was creating > > a qemu-rust mailing list. This is going to be one of our usual > > qemu-foo lists along the lines o

[PATCH 3/3] tests/qtest/cmsdk-apb-watchdog-test: Test INTEN as counter enable

2024-11-08 Thread Roque Arcudia Hernandez
The following tests focus on making sure the counter is not running out of reset and the proper use of INTEN as the counter enable. As described in: https://developer.arm.com/documentation/ddi0479/d/apb-components/apb-watchdog/programmers-model The new tests have to target an MPS2 machine because

[PATCH 1/3] hw/watchdog/cmsdk_apb_watchdog: Fix INTEN issues

2024-11-08 Thread Roque Arcudia Hernandez
Current watchdog is free running out of reset, this combined with the fact that current implementation also ensures the counter is running when programing WDOGLOAD creates issues when the firmware defer the programing of WDOGCONTROL.INTEN much later after WDOGLOAD. Arm Programmer's Model documentat

Re: [PULL 09/29] qapi/qom: Define cache enumeration and properties for machine

2024-11-08 Thread Peter Maydell
On Tue, 5 Nov 2024 at 22:49, Philippe Mathieu-Daudé wrote: > > From: Zhao Liu > > The x86 and ARM need to allow user to configure cache properties > (current only topology): > * For x86, the default cache topology model (of max/host CPU) does not >always match the Host's real physical cache

Re: [PATCH v4 7/7] target/i386: Add EPYC-Genoa model to support Zen 4 processor series

2024-11-08 Thread Maksim Davydov
Hi! I compared EPYC-Genoa CPU model with CPUID output from real EPYC Genoa host. I found some mismatches that confused me. Could you help me to understand them? On 5/4/23 23:53, Babu Moger wrote: Adds the support for AMD EPYC Genoa generation processors. The model display for the new processo

Re: [RFC PATCH 11/11] rust: ci: add job that runs Rust tools

2024-11-08 Thread Daniel P . Berrangé
On Fri, Nov 08, 2024 at 07:01:39PM +0100, Paolo Bonzini wrote: > Code checks, as well as documentation generation, are not yet tied > to "make check" because they need new version of the Rust toolchain > (even nightly in the case of "rustfmt"). Run them in CI using the > existing nightly-Rust cont

[RFC PATCH 02/11] rust: build: move rustc_args.py invocation to individual crates

2024-11-08 Thread Paolo Bonzini
Only qemu-api needs access to the symbols in config-host.h. Remove the temptation to use them by limiting the --cfg arguments to the qemu-api crate. Signed-off-by: Paolo Bonzini --- meson.build | 54 +-- rust/qemu-api/meson.build | 4 +++ 2 fil

[RFC PATCH 05/11] rust: cargo: store desired warning levels in workspace Cargo.toml

2024-11-08 Thread Paolo Bonzini
An extra benefit of workspaces is that they allow to place lint level settings in a single Cargo.toml; the settings are then inherited by packages in the workspace. Correspondingly, teach rustc_build_args.py to get the unexpected_cfgs configuration from the workspace Cargo.toml. Note that it is s

Re: [PATCH 5/7] target/i386/kvm: reset AMD PMU registers during VM reset

2024-11-08 Thread dongli . zhang
Hi Maksim, On 11/8/24 6:07 AM, Maksim Davydov wrote: > > [snip] + +    num_pmu_gp_counters = AMD64_NUM_COUNTERS_CORE; +} >>> >>> It seems that AMD implementation has one issue. >>> KVM has parameter `enable_pmu`. So vPMU can be disabled in another way, not >>> only >>> via KVM_

[RFC PATCH 08/11] rust: build: establish a baseline of lints across all crates

2024-11-08 Thread Paolo Bonzini
Many lints that default to allow can be helpful in detecting bugs or keeping the code style homogeneous. Add them liberally, though perhaps not as liberally as in hw/char/pl011/src/lib.rs. In particular, enabling entire groups can be problematic because of bitrot when new links are added in the f

[RFC PATCH 11/11] rust: ci: add job that runs Rust tools

2024-11-08 Thread Paolo Bonzini
Code checks, as well as documentation generation, are not yet tied to "make check" because they need new version of the Rust toolchain (even nightly in the case of "rustfmt"). Run them in CI using the existing nightly-Rust container. Signed-off-by: Paolo Bonzini --- .gitlab-ci.d/buildtest-templ

[RFC PATCH 07/11] rust: fix a couple style issues from clippy

2024-11-08 Thread Paolo Bonzini
These are reported as clippy::semicolon_inside_block and clippy::as_ptr_cast_mut. Signed-off-by: Paolo Bonzini --- rust/hw/char/pl011/src/device.rs | 6 -- rust/hw/char/pl011/src/memory_ops.rs | 4 +++- rust/qemu-api/tests/tests.rs | 2 +- 3 files changed, 8 insertions(+), 4 del

[RFC PATCH 01/11] rust: qemu_api: do not disable lints outside bindgen-generated code

2024-11-08 Thread Paolo Bonzini
rust/qemu-api/src/lib.rs is disabling lints that cause problems with code generated by bindgen. Instead, include the bindgen code via include!(...) and move the #![allow()] directives into the bindings module. Add MESON_BUILD_ROOT to the devenv, so that it's easy for build.rs to find the include

[RFC PATCH 04/11] rust: build: generate warning flags from Cargo.toml

2024-11-08 Thread Paolo Bonzini
Cargo.toml makes it possible to describe the desired lint level settings in a nice format. We can extend this to Meson-built crates, by teaching rustc_args.py to fetch lint and --check-cfg arguments from Cargo.toml. Start with qemu-api, since it already has a [lints.rust] table and an invocation

[RFC PATCH 06/11] rust: build: move strict lints handling to rustc_args.py

2024-11-08 Thread Paolo Bonzini
Make Cargo use unknown_lints = "allow" as well. This is more future proof as we might add new lints to rust/Cargo.toml that are not supported by older versions of rustc or clippy. Signed-off-by: Paolo Bonzini --- meson.build| 12 rust/Cargo.toml| 6

[RFC PATCH 09/11] rust: build: add "make clippy", "make rustfmt"

2024-11-08 Thread Paolo Bonzini
Abstract common invocations of "cargo", that do not require copying the generated bindgen file or setting up MESON_BUILD_ROOT. In the future these could also do completely without cargo and invoke the underlying programs directly. Signed-off-by: Paolo Bonzini --- rust/meson.build | 14 +++

[RFC PATCH 10/11] rust: fix doc test syntax

2024-11-08 Thread Paolo Bonzini
Allow "cargo test --doc" to pass. Signed-off-by: Paolo Bonzini --- rust/qemu-api/src/zeroable.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rust/qemu-api/src/zeroable.rs b/rust/qemu-api/src/zeroable.rs index 13cdb2ccba5..6125aeed8b4 100644 --- a/rust/qemu-api/src/z

[RFC PATCH 03/11] rust: build: restrict --cfg generation to only required symbols

2024-11-08 Thread Paolo Bonzini
Parse the Cargo.toml file, looking for the unexpected_cfgs configuration. When generating --cfg options from the config-host.h file, only use those that are included in the configuration. Signed-off-by: Paolo Bonzini --- rust/qemu-api/meson.build | 2 +- scripts/rust/rustc_args.py | 61 ++

[RFC PATCH 00/11] rust: improved integration with cargo

2024-11-08 Thread Paolo Bonzini
While we're not sure where we'll be going in the future, for now using cargo remains an important part of developing QEMU Rust code. This is because cargo is the easiest way to run clippy, rustfmt, rustdoc. Cargo also allows working with doc tests, though there are pretty much none yet, and provid

[PATCH qemu] hw/cxl: Check for zero length features in cmd_features_set_feature()

2024-11-08 Thread Jonathan Cameron via
Zero length data for features doesn't make any sense so exclude that case early. This fixes the undefined behavior reported by coverity for a zero length memcpy(). Resolves CID 1564900 and 1564901 Reported-by: Peter Maydell Signed-off-by: Jonathan Cameron --- hw/cxl/cxl-mailbox-utils.c | 4 +++

Re: [PULL 06/13] eif: cope with huge section sizes

2024-11-08 Thread Dorjoy Chowdhury
On Fri, Nov 8, 2024 at 11:38 PM Paolo Bonzini wrote: > > Check for overflow as well as allocation failure. Resolves Coverity CID > 1564859. > > Reviewed-by: Pierrick Bouvier > Reviewed-by: Dorjoy Chowdhury > Signed-off-by: Paolo Bonzini > --- > hw/core/eif.c | 48

[PULL 00/13] (Almost entirely) bugfix changes for QEMU 9.2 hard freeze

2024-11-08 Thread Paolo Bonzini
The following changes since commit a1dacb66915eb7d08a0596cc97068a37c39930d3: Merge tag 'for-upstream-rust' of https://gitlab.com/bonzini/qemu into staging (2024-11-06 21:27:47 +) are available in the Git repository at: https://gitlab.com/bonzini/qemu.git tags/for-upstream for you to fe

[PULL 08/13] i386/hvf: Fix for UB in handling CPUID function 0xD

2024-11-08 Thread Paolo Bonzini
From: Phil Dennis-Jordan The handling for CPUID function 0xD (supported XSAVE features) was improved in a recent patch. Unfortunately, this appears to have introduced undefined behaviour for cases where ecx > 30, as the result of (1 << idx) is undefined if idx > 30. Per Intel SDM section 13.2, t

[PULL 06/13] eif: cope with huge section sizes

2024-11-08 Thread Paolo Bonzini
Check for overflow as well as allocation failure. Resolves Coverity CID 1564859. Reviewed-by: Pierrick Bouvier Reviewed-by: Dorjoy Chowdhury Signed-off-by: Paolo Bonzini --- hw/core/eif.c | 48 +--- 1 file changed, 41 insertions(+), 7 deletions(-)

[PULL 05/13] eif: cope with huge section offsets

2024-11-08 Thread Paolo Bonzini
Check for overflow to avoid that fseek() receives a sign-extended value. Cc: Dorjoy Chowdhury Signed-off-by: Paolo Bonzini --- include/qemu/osdep.h | 4 hw/core/eif.c| 4 2 files changed, 8 insertions(+) diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index fe7c3c5f6

  1   2   3   >