[PATCH v2] backends/cryptodev-vhost-user: Fix local_error leaks

2024-12-27 Thread Gabriel Barrantes
>From 532af9eecee4695abb02b40f2c18b711370aa7d2 Mon Sep 17 00:00:00 2001 From: Gabriel Barrantes Date: Fri, 27 Dec 2024 18:02:32 -0600 Subject: [PATCH v2] backends/cryptodev-vhost-user: Fix local_error leaks Do not propagate error to the upper, directly output the error to avoid leaks. Resolves:

[PATCH v3] target/hppa: Add CPU reset method

2024-12-27 Thread Helge Deller
Add the CPU reset method, which resets all CPU registers and the TLB to zero. Then the CPU will switch to 32-bit mode (PSW_W bit is not set) and start execution at address 0xf004. Although we currently want to zero out all values in the CPUHPPAState struct, add the end_reset_fields marker in ca

Re: [PATCH v2 23/23] config: Add loongarch32-softmmu target

2024-12-27 Thread Jiaxun Yang
在2024年12月27日十二月 上午5:20,Richard Henderson写道: [...] >>> +++ b/configs/targets/loongarch32-softmmu.mak >>> @@ -0,0 +1,7 @@ >>> +TARGET_ARCH=loongarch32 >>> +TARGET_BASE_ARCH=loongarch >>> +TARGET_KVM_HAVE_GUEST_DEBUG=y >>> +TARGET_SUPPORTS_MTTCG=y >>> +TARGET_XML_FILES= gdb-xml/loongarch-base32.xml

[PATCH v2] hw/misc: use extract64 instead of 1 << i

2024-12-27 Thread Tigran Sogomonian
1 << i is casted to uint64_t while bitwise and with val. So this value may become 0x8000 but only 31th "start" bit is required. Use the bitfield extract() API instead. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Tigran Sogomonian --- hw/misc/mps2

Re: [PATCH] hw/misc: cast nand_getio value to uint64_t

2024-12-27 Thread Тигран Согомонян
27/12/24 01:49, Alex Bennée пишет: Tigran Sogomonian writes: s->buswidth = nand_flash_ids[s->chip_id].width >> 3; <= 16 >> 3 <= 2. x <= s->ioaddr[offset] << (s->buswidth << 3) <= max_uint8_t << 16 With x << 24 overflow is possible. Other cases are similar. Thus, need to cast return value to ui

[PATCH v3 4/6] hw/usb/hcd-xhci: Unimplemented/guest error logging for port MMIO

2024-12-27 Thread Phil Dennis-Jordan
The XHCI device code uses tracing rather than logging on various code paths that are so far unimplemented. In some cases, these code paths actually indicate faulty guest software. This patch switches instances in the read and write handlers for the port MMIO region to use qemu_log_mask() with LOG_U

[PATCH v3 1/6] hw/usb/hcd-xhci-pci: Use modulo to select MSI vector as per spec

2024-12-27 Thread Phil Dennis-Jordan
QEMU would crash with a failed assertion if the XHCI controller attempted to raise the interrupt on a higher vector than the highest configured for the device by the guest driver. It turns out the XHCI spec (Implementation Note in section 4.17, "Interrupters") requires that the host controller sig

[PATCH v3 0/6] hw/usb/hcd-xhci: Fixes, improvements, and macOS workaround

2024-12-27 Thread Phil Dennis-Jordan
For a while now, I've been chasing the problem of macOS's XHCI guest driver not working properly with QEMU's PCI XHCI controller when MSI-X is unavailable. I've finally figured out the cause, and I think an acceptable solution. I've explained the problem and quoted the relevant sections of the XHCI

[PATCH v3 3/6] hw/usb/hcd-xhci-pci: Use event ring 0 if mapping unsupported

2024-12-27 Thread Phil Dennis-Jordan
The XHCI specification, section 4.17.1 specifies that "If the Number of Interrupters (MaxIntrs) field is greater than 1, then Interrupter Mapping shall be supported." and "If Interrupter Mapping is not supported, the Interrupter Target field shall be ignored by the xHC and all Events targeted at In

[PATCH v3 6/6] hw/vmapple: XHCI controller's interrupt mapping workaround for macOS

2024-12-27 Thread Phil Dennis-Jordan
This change enables the new conditional interrupt mapping support property on the vmapple machine type's integrated XHCI controller using compat_props. The macOS guest driver attempts to use event rings 1 and 2 on the XHCI controller, despite there being only one (PCI pin) interrupt channel availa

[PATCH v3 2/6] hw/usb/hcd-xhci-pci: Move msi/msix properties from NEC to superclass

2024-12-27 Thread Phil Dennis-Jordan
The NEC XHCI controller exposes the underlying PCI device's msi and msix properties, but the superclass and thus the qemu-xhci device do not. There does not seem to be any obvious reason for this limitation. This change moves these properties to the superclass so they are exposed by both PCI XHCI d

[PATCH v3 5/6] hw/usb/hcd-xhci-pci: Adds property for disabling mapping in IRQ mode

2024-12-27 Thread Phil Dennis-Jordan
This change addresses an edge case that trips up macOS guest drivers for PCI based XHCI controllers. The guest driver would attempt to schedule events to XHCI event rings 1 and 2 even when using PCI pin-based interrupts. Interrupts would therefore be dropped, and events only handled on timeout. So

Re: [PATCH v16 00/14] macOS PV Graphics and new vmapple machine type

2024-12-27 Thread Phil Dennis-Jordan
On Mon, 23 Dec 2024 at 23:58, Philippe Mathieu-Daudé wrote: > On 23/12/24 23:16, Phil Dennis-Jordan wrote: > > This patch set introduces a new ARM and macOS HVF specific machine type > > called "vmapple", as well as a family of display devices based on the > > ParavirtualizedGraphics.framework in

Re: [PATCH v3 1/6] hw/usb/hcd-xhci-pci: Use modulo to select MSI vector as per spec

2024-12-27 Thread Philippe Mathieu-Daudé
On 27/12/24 13:13, Phil Dennis-Jordan wrote: QEMU would crash with a failed assertion if the XHCI controller attempted to raise the interrupt on a higher vector than the highest configured for the device by the guest driver. It turns out the XHCI spec (Implementation Note in section 4.17, "Inter

Re: [PATCH v3 4/6] hw/usb/hcd-xhci: Unimplemented/guest error logging for port MMIO

2024-12-27 Thread Philippe Mathieu-Daudé
On 27/12/24 13:13, Phil Dennis-Jordan wrote: The XHCI device code uses tracing rather than logging on various code paths that are so far unimplemented. In some cases, these code paths actually indicate faulty guest software. This patch switches instances in the read and write handlers for the por

[PATCH] gdbstub/user-target: fix gdbserver int format (%d -> %x)

2024-12-27 Thread Dominik 'Disconnect3d' Czarnota
From: disconnect3d This commit fixes an incorrect format string for formatting integers provided to GDB when debugging a target run in QEMU user mode. The correct format is hexadecimal for both success and errno values, some of which can be seen here [0]. [0] https://github.com/bminor/binutils

Re: [PATCH v2] hw/misc: use extract64 instead of 1 << i

2024-12-27 Thread Alex Bennée
Tigran Sogomonian writes: > 1 << i is casted to uint64_t while bitwise and with val. > So this value may become 0x8000 but only > 31th "start" bit is required. > Use the bitfield extract() API instead. > > Found by Linux Verification Center (linuxtesting.org) with SVACE. > > Signed-of

[PATCH v2 2/6] linux-user: Use unique error messages for cmsg parsing

2024-12-27 Thread deller
From: Helge Deller Avoid using the same error message for two different code paths as it complicates determining the one which actually triggered. Signed-off-by: Helge Deller Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Laurent Vivier --- linux-user/syscall.c | 4 ++-- 1 file changed, 2

[PATCH v2 6/6] linux-user: netlink: Add missing QEMU_IFLA entries

2024-12-27 Thread deller
From: Helge Deller This fixes the following qemu warnings when building debian gupnp package: Unknown host QEMU_IFLA type: 61 Unknown host QEMU_IFLA type: 58 Unknown host QEMU_IFLA type: 59 Unknown host QEMU_IFLA type: 60 Unknown host QEMU_IFLA type: 32820 QEMU_IFLA type 32820 is actually N

[PATCH v2 4/6] linux-user: netlink: Add emulation of IP_MULTICAST_IF

2024-12-27 Thread deller
From: Helge Deller Share code with IP_ADD_MEMBERSHIP/IP_DROP_MEMBERSHIP. Signed-off-by: Helge Deller --- linux-user/syscall.c | 13 +++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index bbe2560927..4360543e20 100644 --- a

[PATCH v2 0/6] linux-user: Add support for various missing netlink sockopt entries

2024-12-27 Thread deller
From: Helge Deller This patchset adds various missing sockopt calls, so that qemu linux-user is able to successfully build the debian gupnp package in a chroot. Tested with a 32-bit big-endian hppa linux-user chroot running on a phyiscal x86-64 little-endian host. This fixes debian's bug report

[PATCH v2 3/6] linux-user: netlink: Add IP_PKTINFO cmsg parsing

2024-12-27 Thread deller
From: Helge Deller Fixes those warnings: Unsupported host ancillary data: 0/8 Signed-off-by: Helge Deller --- linux-user/syscall.c | 12 1 file changed, 12 insertions(+) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 494323efba..bbe2560927 100644 --- a/linux-user

[PATCH v2 1/6] linux-user: netlink: Add missing IFA_PROTO to host_to_target_data_addr_rtattr()

2024-12-27 Thread deller
From: Helge Deller Fixes this warning: Unknown host IFA type: 11 Signed-off-by: Helge Deller --- linux-user/fd-trans.c | 1 + 1 file changed, 1 insertion(+) diff --git a/linux-user/fd-trans.c b/linux-user/fd-trans.c index c04a97c73a..a86ed2f4b4 100644 --- a/linux-user/fd-trans.c +++ b/linux-

[PATCH v2 5/6] linux-user: netlink: add netlink neighbour emulation

2024-12-27 Thread deller
From: Helge Deller Fixes various warnings in the testsuite while building gupnp: gssdp-net-DEBUG: Failed to send netlink message: Operation not supported gupnp-context-DEBUG: Mismatch between host header and host IP (example.com, expected: 127.0.0.1) gupnp-context-DEBUG: Mismatch between host

Re: [PATCH v2] hw/misc: use extract64 instead of 1 << i

2024-12-27 Thread Richard Henderson
On 12/27/24 02:46, Tigran Sogomonian wrote: 1 << i is casted to uint64_t while bitwise and with val. So this value may become 0x8000 but only 31th "start" bit is required. Use the bitfield extract() API instead. Again, I < 32. There is no overflow. The type of value is irrelevant.

Re: [PATCH v16 14/14] hw/vmapple/vmapple: Add vmapple machine type

2024-12-27 Thread Phil Dennis-Jordan
On Fri 27. Dec 2024 at 20:23, Philippe Mathieu-Daudé wrote: > On 23/12/24 23:16, Phil Dennis-Jordan wrote: > > From: Alexander Graf > > > > Apple defines a new "vmapple" machine type as part of its proprietary > > macOS Virtualization.Framework vmm. This machine type is similar to the > > virt o

[PATCH 2/2] hw/intc: Have ARM_GIC select ARM_GICV3 when KVM is not available

2024-12-27 Thread Philippe Mathieu-Daudé
When the KVM accelerator is selected, the Kconfig ARM_GIC key selects the KVM GIC implementation (ARM_GIC_KVM). For other accelerators (TCG, HVF, ...), select the generic implementation. Signed-off-by: Philippe Mathieu-Daudé --- hw/intc/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(

[PATCH 1/2] hw/intc: Remove TCG dependency on ARM_GICV3

2024-12-27 Thread Philippe Mathieu-Daudé
The TYPE_ARM_GICV3 model doesn't have any particular dependency on TCG, remove it. Rename the Kconfig selector ARM_GICV3_TCG -> ARM_GICV3. Fixes: a8a5546798c ("hw/intc/arm_gicv3: Introduce CONFIG_ARM_GIC_TCG Kconfig selector") Signed-off-by: Philippe Mathieu-Daudé --- hw/intc/Kconfig | 6 ++

Re: [PATCH v3 1/6] hw/usb/hcd-xhci-pci: Use modulo to select MSI vector as per spec

2024-12-27 Thread Philippe Mathieu-Daudé
On 27/12/24 20:45, Phil Dennis-Jordan wrote: On Fri 27. Dec 2024 at 18:45, Philippe Mathieu-Daudé > wrote: On 27/12/24 13:13, Phil Dennis-Jordan wrote: > QEMU would crash with a failed assertion if the XHCI controller > attempted to raise the interrupt

[PATCH 0/2] hw/intc: Select generic ARM_GICV3 when KVM is not available

2024-12-27 Thread Philippe Mathieu-Daudé
ARM_GICV3 is not restricted to TCG and can be used on HVF. Philippe Mathieu-Daudé (2): hw/intc: Remove TCG dependency on ARM_GICV3 hw/intc: Have ARM_GIC select ARM_GICV3 when KVM is not available hw/intc/Kconfig | 6 +++--- hw/intc/meson.build | 4 ++-- 2 files changed, 5 insertions(+),

Re: [PATCH v16 14/14] hw/vmapple/vmapple: Add vmapple machine type

2024-12-27 Thread Philippe Mathieu-Daudé
On 23/12/24 23:16, Phil Dennis-Jordan wrote: Known issues: - Keyboard and mouse/tablet input is laggy. The reason for this is that macOS's XHCI driver seems to expect interrupter mapping to be disabled when MSI/MSI-X is unavailable. I have found a workaround but discovered a bunch

Re: [PATCH v16 14/14] hw/vmapple/vmapple: Add vmapple machine type

2024-12-27 Thread Philippe Mathieu-Daudé
On 27/12/24 21:12, Phil Dennis-Jordan wrote: > diff --git a/hw/vmapple/Kconfig b/hw/vmapple/Kconfig > index bcd1be63e3..6a4c4a7fa2 100644 > --- a/hw/vmapple/Kconfig > +++ b/hw/vmapple/Kconfig > @@ -10,3 +10,23 @@ config VMAPPLE_CFG >   config VMAPPLE_VIRTIO_BLK

Re: [PATCH v16 14/14] hw/vmapple/vmapple: Add vmapple machine type

2024-12-27 Thread Philippe Mathieu-Daudé
On 23/12/24 23:16, Phil Dennis-Jordan wrote: From: Alexander Graf Apple defines a new "vmapple" machine type as part of its proprietary macOS Virtualization.Framework vmm. This machine type is similar to the virt one, but with subtle differences in base devices, a few special vmapple device add

Re: [PATCH v3 1/6] hw/usb/hcd-xhci-pci: Use modulo to select MSI vector as per spec

2024-12-27 Thread Phil Dennis-Jordan
On Fri 27. Dec 2024 at 18:45, Philippe Mathieu-Daudé wrote: > On 27/12/24 13:13, Phil Dennis-Jordan wrote: > > QEMU would crash with a failed assertion if the XHCI controller > > attempted to raise the interrupt on a higher vector than the > > highest configured for the device by the guest driver

Re: Why pycotap is mandatory for building qemu?

2024-12-27 Thread Michael Tokarev
27.12.2024 08:22, Paolo Bonzini wrote: The reason is simply that it's a very small dependency, and not worth the complication of installing it in pyvenv/ on demand. Ah, that'd do it. Thank you for the explanation! :) /mjt

Re: [PATCH 1/5] aspeed: Make sdhci_attach_drive and write_boot_rom public

2024-12-27 Thread Cédric Le Goater
On 12/25/24 03:03, Steven Lee wrote: sdhci_attach_drive and write_boot_rom functions may be used by the aspeed machine supporting co-processors. I would move these routines to aspeed_soc_common.c file and rename them with an aspeed_ prefix. Thanks, C. Signed-off-by: Steven Lee --- hw/

Re: [PATCH 2/5] aspeed: ast27x0: Map unimplemented devices in SoC memory

2024-12-27 Thread Cédric Le Goater
Hello, On 12/25/24 03:03, Steven Lee wrote: Maps following unimplemented devices in SoC memory - dpmcu - iomem0 - iomem1 - ltpi - io Could you please add a sentence about what these devices are ? Thanks, C. Signed-off-by: Steven Lee --- hw/arm/aspeed_ast27x0.c | 45

RE: [PATCH 1/5] aspeed: Make sdhci_attach_drive and write_boot_rom public

2024-12-27 Thread Steven Lee
Hi Cédric, > -Original Message- > From: Cédric Le Goater > Sent: Friday, December 27, 2024 3:57 PM > To: Steven Lee ; Peter Maydell > ; Troy Lee ; Jamin Lin > ; Andrew Jeffery > ; Joel Stanley ; open > list:ASPEED BMCs ; open list:All patches CC here > > Cc: Troy Lee ; Yunlin Tang > > S

[PATCH] target/hppa: Speed up hppa_is_pa20()

2024-12-27 Thread Helge Deller
Although the hppa_is_pa20() helper is costly due to string comparisms in object_dynamic_cast(), it is called quite often during memory lookups and at each start of a block of instruction translations. Speed hppa_is_pa20() up by calling object_dynamic_cast() only once at CPU creation and store the r

Re: [PATCH] gdbstub/user-target: fix gdbserver int format (%d -> %x)

2024-12-27 Thread Alex Bennée
Dominik 'Disconnect3d' Czarnota writes: > From: disconnect3d You might want to fix your author attribution here. > > This commit fixes an incorrect format string for formatting integers > provided to GDB when debugging a target run in QEMU user mode. > > The correct format is hexadecimal for b

Re: [PATCH] contrib/plugins/bbv.c: Start bb index from 1

2024-12-27 Thread Alex Bennée
Michael Tokarev writes: > 17.12.2024 17:24, ckf104 wrote: >> Standard simpoint tool reqeusts that index of basic block index starts from >> 1. > > While this patch is a trivial one-liner, but the underlying issue requires at > least > a minimal understanding of what it is all about, what *is* b