[PATCH] ui/sdl: Mouse event optimization

2024-10-24 Thread Lei Huang
Use a convergence factor to make the VM's input global coordinates more closely approach the global coordinates of DOM0. Change-Id: I2c3f12f1fe7dfb9306d1fc40c4fd4d299937f4c6 Signed-off-by: Lei Huang --- ui/sdl2.c | 32 ++-- 1 file changed, 30 insertions(+), 2 deletion

Re: [PATCH 0/2] arm: Add collie and sx functional tests

2024-10-24 Thread Cédric Le Goater
On 10/24/24 19:59, Philippe Mathieu-Daudé wrote: Cc'ing Jan. On 22/10/24 12:04, Guenter Roeck wrote: On 10/21/24 21:09, Philippe Mathieu-Daudé wrote: Hi Guenter, On 21/10/24 11:02, Guenter Roeck wrote: Unrelated to this, but I found that the sd emulation in 9.1 is also broken for loongarch

RE: [PATCH v4 00/17] intel_iommu: Enable stage-1 translation for emulated device

2024-10-24 Thread Duan, Zhenzhong
Hi All, Kindly ping, any more comments? Thanks Zhenzhong >-Original Message- >From: Duan, Zhenzhong >Sent: Monday, September 30, 2024 5:26 PM >Subject: [PATCH v4 00/17] intel_iommu: Enable stage-1 translation for emulated >device > >Hi, > >Per Jason Wang's suggestion, iommufd nesting se

[PATCH] hw/nvme : remove dead code

2024-10-24 Thread Arun Kumar
remove dead code which always returns success, since prchk will have a value of zero Signed-off-by: Arun Kumar --- hw/nvme/dif.c | 5 - 1 file changed, 5 deletions(-) diff --git a/hw/nvme/dif.c b/hw/nvme/dif.c index 01b19c3373..2805128498 100644 --- a/hw/nvme/dif.c +++ b/hw/nvme/dif.c @@ -5

Re: [PATCH v4 02/15] hw/display/apple-gfx: Introduce ParavirtualizedGraphics.Framework support

2024-10-24 Thread Akihiko Odaki
On 2024/10/24 19:28, Phil Dennis-Jordan wrote: MacOS provides a framework (library) that allows any vmm to implement a paravirtualized 3d graphics passthrough to the host metal stack called ParavirtualizedGraphics.Framework (PVG). The library abstracts away almost every aspect of the paravirtuali

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

2024-10-24 Thread Mark Cave-Ayland
On 23/10/2024 11:37, BALATON Zoltan wrote: On Wed, 23 Oct 2024, Mark Cave-Ayland wrote: 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

[PATCH v18 13/13] virtio-gpu: Support Venus context

2024-10-24 Thread Dmitry Osipenko
From: Antonio Caggiano Request Venus when initializing VirGL and if venus=true flag is set for virtio-gpu-gl device. Signed-off-by: Antonio Caggiano Signed-off-by: Huang Rui Signed-off-by: Dmitry Osipenko --- docs/system/devices/virtio-gpu.rst | 11 +++ hw/display/virtio-gpu-gl.c

[PATCH] target/mips: Introduce disas_mt_available()

2024-10-24 Thread Philippe Mathieu-Daudé
Similarly to commit 17c2c320f3c ("Introduce ase_mt_available helper"), introduce the disas_mt_available() one which takes a DisasContext argument to determine whether Multi-Threading is available by checking the MT bit of the CP0_Config3 register. Remove the then unused ASE_MT definition. Signed-

Re: [PATCH] softmmu: Support concurrent bounce buffers

2024-10-24 Thread Michael Tokarev
26.09.2024 11:12, Michael S. Tsirkin wrote: On Thu, Sep 26, 2024 at 10:58:57AM +0300, Michael Tokarev wrote: 25.09.2024 13:23, Mattias Nissler wrote: On Wed, Sep 25, 2024 at 12:03 PM Michael Tokarev wrote: .. So, the issue has now become CVE-2024-8612 (information leak), with this commit (v9

Re: [PATCH 1/2] hw/riscv: Support to load DTB after 3GB memory on 64-bit system.

2024-10-24 Thread Daniel Henrique Barboza
On 10/23/24 7:19 AM, Jim Shu wrote: On Mon, Oct 21, 2024 at 9:42 PM Daniel Henrique Barboza wrote: On 10/21/24 1:09 AM, Jim Shu wrote: Larger initrd image will overlap the DTB at 3GB address. Since 64-bit system doesn't have 32-bit addressable issue, we just load DTB to the end of dram i

Re: [PATCH] target/mips: Introduce disas_mt_available()

2024-10-24 Thread Philippe Mathieu-Daudé
On 24/10/24 16:54, Philippe Mathieu-Daudé wrote: Similarly to commit 17c2c320f3c ("Introduce ase_mt_available helper"), introduce the disas_mt_available() one which takes a DisasContext argument to determine whether Multi-Threading is available by checking the MT bit of the CP0_Config3 register.

[PATCH v18 03/13] virtio-gpu: Move print_stats timer to VirtIOGPUGL

2024-10-24 Thread Dmitry Osipenko
Move print_stats timer to VirtIOGPUGL for consistency with cmdq_resume_bh and fence_poll that are used only by GL device. Signed-off-by: Dmitry Osipenko --- hw/display/virtio-gpu-virgl.c | 10 ++ include/hw/virtio/virtio-gpu.h | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) d

[PATCH 1/8] gdbstub: Allow the %d placeholder in the socket path

2024-10-24 Thread Ilya Leoshkevich
Just like for QEMU_LOG_FILENAME, replace %d with PID in the GDB socket path. This allows running multi-process applications with, e.g., export QEMU_GDB=/tmp/qemu-%d.sock. Currently this is not possible, since the first process will cause the subsequent ones to fail due to not being able to bind() t

Re: [PATCH v4 01/15] ui & main loop: Redesign of system-specific main thread event handling

2024-10-24 Thread Akihiko Odaki
On 2024/10/24 19:27, Phil Dennis-Jordan wrote: macOS's Cocoa event handling must be done on the initial (main) thread of the process. Furthermore, if library or application code uses libdispatch, the main dispatch queue must be handling events on the main thread as well. So far, this has affecte

[PATCH 1/1] target/arm: Fix arithmetic underflow in SETM instruction

2024-10-24 Thread Ido Plat
Pass the stage size to step function callback, otherwise do_setm would hang when size is larger then page size because stage size would underflow. This fix changes do_setm to be more inline with do_setp. Fixes: 0e92818887dee ("target/arm: Implement the SET* instructions") Signed-off-by: Ido Plat

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

2024-10-24 Thread Dmitry Osipenko
From: Pierre-Eric Pelloux-Prayer If EGL is used, we can rely on dmabuf to import textures without doing copies. To get this working on X11, we use the existing SDL hint: SDL_HINT_VIDEO_X11_FORCE_EGL (because dmabuf can't be used with GLX). Signed-off-by: Pierre-Eric Pelloux-Prayer Signed-off-b

[PATCH v18 05/13] virtio-gpu: Unrealize GL device

2024-10-24 Thread Dmitry Osipenko
Even though GL GPU doesn't support hotplugging today, free virgl resources when GL device is unrealized. For consistency. Signed-off-by: Dmitry Osipenko --- hw/display/virtio-gpu-gl.c | 17 + 1 file changed, 17 insertions(+) diff --git a/hw/display/virtio-gpu-gl.c b/hw/display/v

[PATCH v18 10/13] virtio-gpu: Support suspension of commands processing

2024-10-24 Thread Dmitry Osipenko
Check whether command processing has been finished; otherwise, stop processing commands and retry the command again next time. This allows us to support asynchronous execution of non-fenced commands needed for unmapping host blobs safely. Suggested-by: Akihiko Odaki Signed-off-by: Dmitry Osipenko

[PATCH v3 1/8] migration: Take migration object refcount earlier for threads

2024-10-24 Thread Peter Xu
Both migration thread or background snapshot thread will take a refcount of the migration object at the entrace of the thread function. That makes sense, because it protects the object from being freed by the main thread in migration_shutdown() later, but it might still race with it if the thread

[PATCH v3 6/6] virtio-gpu: Support DRM native context

2024-10-24 Thread Dmitry Osipenko
Add support for DRM native contexts to VirtIO-GPU. DRM context is enabled using a new virtio-gpu-gl device option "drm=on". Unlike Virgl and Venus contexts that operate on application API level, DRM native contexts work on a kernel UAPI level. This lower level results in a lightweight context impl

[PATCH 8/8] tests/tcg: Add late gdbstub attach test

2024-10-24 Thread Ilya Leoshkevich
Add a small test to prevent regressions. Make sure that host_interrupt_signal is not visible to the guest. Signed-off-by: Ilya Leoshkevich --- tests/guest-debug/run-test.py | 15 ++-- tests/tcg/multiarch/Makefile.target| 9 - tests/tcg/multiarch/gdbstub/late-attach.

[PATCH 4/8] user: Introduce host_interrupt_signal

2024-10-24 Thread Ilya Leoshkevich
Attaching to the gdbstub of a running process requires stopping its threads. For threads that run on a CPU, cpu_exit() is enough, but the only way to grab attention of a thread that is stuck in a long-running syscall is to interrupt it with a signal. Reserve a host realtime signal for this, just l

Re: [PATCH v2] i386/cpu: Drop the check of phys_bits in host_cpu_realizefn()

2024-10-24 Thread Xiaoyao Li
Ping. Paolo, this is a simple clean up. On 9/29/2024 4:57 PM, Xiaoyao Li wrote: The check of cpu->phys_bits to be in range between [32, TARGET_PHYS_ADDR_SPACE_BITS] in host_cpu_realizefn() is duplicated with check in x86_cpu_realizefn(). Since the ckeck in x86_cpu_realizefn() is called later a

[PATCH 1/2] MAINTAINERS: Remove myself from the PowerNV machines

2024-10-24 Thread Cédric Le Goater
It's been an amazing experience working on PowerNV systems all these years. Now it's time for IBM to take the lead on the QEMU machine and shape its future. I'm stepping back as the maintainer of PowerNV. Cc: Nicholas Piggin Cc: Frédéric Barrat Signed-off-by: Cédric Le Goater --- MAINTAINERS |

[PATCH] target/arm: kvm: require KVM_CAP_DEVICE_CTRL

2024-10-24 Thread Paolo Bonzini
The device control API was added in 2013, assume that it is present. Signed-off-by: Paolo Bonzini --- target/arm/kvm_arm.h | 16 +++- hw/intc/arm_gic_kvm.c | 9 + target/arm/kvm.c | 17 + 3 files changed, 13 insertions(+), 29 deletions(-) diff --git a/

[PATCH v3 2/8] migration: Unexport dirty_bitmap_mig_init()

2024-10-24 Thread Peter Xu
It's only used within migration/, so it shouldn't be exported. Reviewed-by: Cédric Le Goater Signed-off-by: Peter Xu --- include/migration/misc.h | 3 --- migration/migration.h| 4 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/migration/misc.h b/include/migrati

[PATCH 2/4] i386/hvf: Fixes startup memory leak (vmcs caps)

2024-10-24 Thread Phil Dennis-Jordan
The hvf_caps data structure only exists once as part of the hvf accelerator state, but it is initialised during vCPU initialisation. This change therefore adds a check to ensure memory for it is only allocated once. Signed-off-by: Phil Dennis-Jordan --- target/i386/hvf/hvf.c | 4 +++- 1 file cha

[PATCH v3 0/8] Migration: Make misc.h helpers available for whole VM lifecycle

2024-10-24 Thread Peter Xu
Based-on: <20241024165627.1372621-1-pet...@redhat.com> CI: https://gitlab.com/peterx/qemu/-/pipelines/1511349805 This is a follow up of below patch from Avihai as a replacement: https://lore.kernel.org/qemu-devel/20241020130108.27148-3-avih...@nvidia.com/ This is v3 of the series, and it h

[PATCH 0/2] MAINTAINERS: Remove myself from ppc subsystems

2024-10-24 Thread Cédric Le Goater
Hello, My experience with PPC has been over for a few years and now, I'm moving away from PowerNV and XIVE. I wish you the best ! Cheers, C. Cédric Le Goater (2): MAINTAINERS: Remove myself from the PowerNV machines MAINTAINERS: Remove myself from XIVE MAINTAINERS | 2 -- 1 file changed,

[PATCH v3 4/6] virtio-gpu: Handle virgl fence creation errors

2024-10-24 Thread Dmitry Osipenko
Print out error messages when virgl fence creation fails to aid debugging of the fence-related bugs. Signed-off-by: Dmitry Osipenko --- hw/display/virtio-gpu-virgl.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/hw/display/virtio-gpu-virgl.c b/hw/display/virtio

[PATCH v3 1/6] ui/sdl2: Restore original context after new context creation

2024-10-24 Thread Dmitry Osipenko
SDL API changes GL context to a newly created GL context, which differs from other GL providers that don't switch context. Change SDL backend to restore the original GL context. This allows Qemu's virtio-gpu to support new virglrenderer async-fencing feature for Virgl contexts, otherwise virglrende

[PATCH v3 3/6] linux-headers: Update to Linux v6.12-rc1

2024-10-24 Thread Dmitry Osipenko
Update kernel headers to bring new VirtIO-GPU DRM capset. Signed-off-by: Dmitry Osipenko --- include/standard-headers/drm/drm_fourcc.h | 43 include/standard-headers/linux/const.h| 17 ++ include/standard-headers/linux/ethtool.h | 226 ++ include/standard-

[PATCH v3 0/6] Support virtio-gpu DRM native context

2024-10-24 Thread Dmitry Osipenko
This patchset adds DRM native context support to VirtIO-GPU on Qemu. It's based on the pending Venus v18 patches [1] that bring host blobs support to virtio-gpu-gl device. Based-on: 20241024210311.118220-1-dmitry.osipe...@collabora.com [1] https://lore.kernel.org/qemu-devel/20241024210311.118220

Re: [PATCH v2 5/8] Add micromips to P5600

2024-10-24 Thread Philippe Mathieu-Daudé
Hi Aleksandar, On 18/10/24 10:20, Aleksandar Rakic wrote: Add micromips to P5600. Cherry-picked d7bf2c2f7f2e03b55c6e9c57eec5c3e6207005a0 from https://github.com/MIPS/gnutools-qemu Signed-off-by: Faraz Shahbazker Signed-off-by: Matthew Fortune Signed-off-by: Aleksandar Rakic --- target/mip

[PATCH v3 6/8] migration: Drop migration_is_device()

2024-10-24 Thread Peter Xu
This only checks the DEVICE stage, which is a very special stage, and only checked together with ACTIVE+POSTCOPY_ACTIVE. It's debatable why this needs a separate helper just to be exported. Theoretically speaking, DEVICE stage is also part of ACTIVE stage, where we're reaching the switchover phase

[PATCH v3 5/7] target/i386: Expose bits related to SRSO vulnerability

2024-10-24 Thread Babu Moger
Add following bits related Speculative Return Stack Overflow (SRSO). Guests can make use of these bits if supported. These bits are reported via CPUID Fn8000_0021_EAX. === Bit Feature Description ==

[PATCH 3/8] user: Introduce user/signal.h

2024-10-24 Thread Ilya Leoshkevich
gdbstub needs target_to_host_signal(), so move its declaration to a public header. Signed-off-by: Ilya Leoshkevich --- bsd-user/signal-common.h | 1 - bsd-user/signal.c | 1 + include/user/signal.h | 23 +++ linux-user/signal-common.h | 1 - linux-user/sign

[PATCH v3 4/7] target/i386: Enable perfmon-v2 and RAS feature bits on EPYC-Genoa

2024-10-24 Thread Babu Moger
Following feature bits are added on EPYC-Genoa-v2 model. perfmon-v2: Allow guests to make use of the PerfMonV2 features. SUCCOR: Software uncorrectable error containment and recovery capability. The processor supports software containment of uncorrectable errors throug

[PATCH v3 1/7] target/i386: Fix minor typo in NO_NESTED_DATA_BP feature bit

2024-10-24 Thread Babu Moger
Rename CPUID_8000_0021_EAX_No_NESTED_DATA_BP to CPUID_8000_0021_EAX_NO_NESTED_DATA_BP. No functional change intended. Signed-off-by: Babu Moger --- v3: New patch. --- target/i386/cpu.c | 2 +- target/i386/cpu.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/target

[PATCH v3 3/8] migration: Unexport ram_mig_init()

2024-10-24 Thread Peter Xu
It's only used within migration/. Signed-off-by: Peter Xu --- include/migration/misc.h | 1 - migration/ram.h | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/include/migration/misc.h b/include/migration/misc.h index df57be6b5e..e8490e3af5 100644 --- a/include/migrati

[PATCH v3 5/8] migration: Drop migration_is_idle()

2024-10-24 Thread Peter Xu
Now with the current migration_is_running(), it will report exactly the opposite of what will be reported by migration_is_idle(). Drop migration_is_idle(), instead use "!migration_is_running()" which should be identical on functionality. In reality, most of the idle check is inverted, so it's eve

[PATCH v3 7/8] migration: Unexport migration_is_active()

2024-10-24 Thread Peter Xu
We have two outside users of this API, so it's exported. Is it really necessary? Does it matter whether it must be ACTIVE/POSTCOPY_ACTIVE/DEVICE? I guess no. The external user is trying to detect whether migration is running or not, as simple as that. To make the migration_is*() APIs even shor

[PATCH v18 09/13] virtio-gpu: Add virgl resource management

2024-10-24 Thread Dmitry Osipenko
From: Huang Rui In a preparation to adding host blobs support to virtio-gpu, add virgl resource management that allows to retrieve resource based on its ID and virgl resource wrapper on top of simple resource that will be contain fields specific to virgl. Signed-off-by: Huang Rui Reviewed-by: A

[PATCH v18 12/13] virtio-gpu: Register capsets dynamically

2024-10-24 Thread Dmitry Osipenko
From: Pierre-Eric Pelloux-Prayer virtio_gpu_virgl_get_num_capsets will return "num_capsets", but we can't assume that capset_index 1 is always VIRGL2 once we'll support more capsets, like Venus and DRM capsets. Register capsets dynamically to avoid that problem. Reviewed-by: Manos Pitsidianakis

[PATCH v18 02/13] virtio-gpu: Move fence_poll timer to VirtIOGPUGL

2024-10-24 Thread Dmitry Osipenko
Move fence_poll timer to VirtIOGPUGL for consistency with cmdq_resume_bh that are used only by GL device. Signed-off-by: Dmitry Osipenko --- hw/display/virtio-gpu-virgl.c | 8 +--- include/hw/virtio/virtio-gpu.h | 3 ++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/hw/disp

Re: [RFC V1 00/14] precreate phase

2024-10-24 Thread Steven Sistare
On 10/23/2024 12:31 PM, Paolo Bonzini wrote: On 10/17/24 17:14, Steve Sistare wrote: Define a new qemu initialization phase called 'precreate' which occurs before most backends or devices have been created.  The only exception is monitor and qtest devices and their associated chardevs. QEMU run

Re: [PATCH v42 51/98] hw/sd/sdcard: Add spi_cmd_SEND_CSD/CID handlers (CMD9 & CMD10)

2024-10-24 Thread Guenter Roeck
On 10/24/24 12:13, Guenter Roeck wrote: On 10/24/24 10:53, Philippe Mathieu-Daudé wrote: Hi Guenter, On 24/10/24 01:04, Guenter Roeck wrote: On 10/23/24 20:27, Philippe Mathieu-Daudé wrote: Hi Guenter, On 23/10/24 19:24, Guenter Roeck wrote: Hi, On Fri, Jun 28, 2024 at 09:01:27AM +0200, Ph

[PATCH v18 07/13] virtio-gpu: Support context-init feature with virglrenderer

2024-10-24 Thread Dmitry Osipenko
From: Huang Rui Patch "virtio-gpu: CONTEXT_INIT feature" has added the context_init feature flags. Expose this feature and support creating virglrenderer context with flags using context_id if libvirglrenderer is new enough. Originally-by: Antonio Caggiano Signed-off-by: Huang Rui Reviewed-by:

[PATCH v18 11/13] virtio-gpu: Handle resource blob commands

2024-10-24 Thread Dmitry Osipenko
From: Robert Beckett Support BLOB resources creation, mapping, unmapping and set-scanout by calling the new stable virglrenderer 0.10 interface. Only enabled when available and via the blob config. E.g. -device virtio-vga-gl,blob=true Signed-off-by: Antonio Caggiano Signed-off-by: Robert Becket

[PATCH v18 01/13] virtio-gpu: Use trace events for tracking number of in-flight fences

2024-10-24 Thread Dmitry Osipenko
Replace printf's used for tracking of in-flight fence inc/dec events with tracing, for consistency with the rest of virtio-gpu code that uses tracing. Suggested-by: Marc-André Lureau Signed-off-by: Dmitry Osipenko --- hw/display/trace-events | 2 ++ hw/display/virtio-gpu-virgl.c | 2 +- h

[PATCH v18 06/13] virtio-gpu: Use pkgconfig version to decide which virgl features are available

2024-10-24 Thread Dmitry Osipenko
New virglrerenderer features were stabilized with release of v1.0.0. Presence of symbols in virglrenderer.h doesn't guarantee ABI compatibility with pre-release development versions of libvirglerender. Use virglrenderer version to decide reliably which virgl features are available. Reviewed-by: Al

Re: [PATCH 1/4] qom: TYPE_SINGLETON interface

2024-10-24 Thread Peter Xu
On Thu, Oct 24, 2024 at 05:02:19PM -0300, Philippe Mathieu-Daudé wrote: > Hi Peter, Hi, Phil, Thanks for the quick reviews! > > (Cc'ing Mark) > > On 24/10/24 13:56, Peter Xu wrote: > > Signed-off-by: Peter Xu > > --- > > include/qom/object_interfaces.h | 47 +

Re: [PATCH 4/4] migration: Reset current_migration properly

2024-10-24 Thread Fabiano Rosas
Peter Xu writes: > On Thu, Oct 24, 2024 at 04:34:44PM -0300, Fabiano Rosas wrote: >> > + * here it means migration object is gone. Clear the global reference >> > + * to reflect that. >> >> Not really gone at this point. The free only happens when this function >> returns. > > How about

Re: [PATCH 4/4] migration: Reset current_migration properly

2024-10-24 Thread Peter Xu
On Thu, Oct 24, 2024 at 04:34:44PM -0300, Fabiano Rosas wrote: > > + * here it means migration object is gone. Clear the global reference > > + * to reflect that. > > Not really gone at this point. The free only happens when this function > returns. How about "is going away"? -- Peter

Re: [PATCH 1/4] qom: TYPE_SINGLETON interface

2024-10-24 Thread Philippe Mathieu-Daudé
Hi Peter, (Cc'ing Mark) On 24/10/24 13:56, Peter Xu wrote: Signed-off-by: Peter Xu --- include/qom/object_interfaces.h | 47 + qom/object.c| 3 +++ qom/object_interfaces.c | 24 + qom/qom-qmp-cmds.c

[PATCH 2/8] gdbstub: Try unlinking the unix socket before binding

2024-10-24 Thread Ilya Leoshkevich
In case an emulated process execve()s another emulated process, bind() will fail, because the socket already exists. So try deleting it. Note that it is not possible to handle this in do_execv(): deleting gdbserver_user_state.socket_path before safe_execve() is not correct, because the latter may

[PATCH 7/8] docs/user: Document the %d placeholder and suspend=n QEMU_GDB features

2024-10-24 Thread Ilya Leoshkevich
Signed-off-by: Ilya Leoshkevich --- docs/user/main.rst | 16 +--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/docs/user/main.rst b/docs/user/main.rst index 7a126ee8093..8dcb1d90a8b 100644 --- a/docs/user/main.rst +++ b/docs/user/main.rst @@ -50,7 +50,7 @@ Command li

[PATCH 6/8] gdbstub: Allow late attachment

2024-10-24 Thread Ilya Leoshkevich
Allow debugging individual processes in multi-process applications by starting them with export QEMU_GDB=/tmp/qemu-%d.sock,suspend=n. Currently one would have to attach to every process to ensure the app makes progress. In case suspend=n is not specified, the flow remains unchanged. If it is speci

[PATCH 0/4] i386/hvf: x2apic support and some small fixes

2024-10-24 Thread Phil Dennis-Jordan
This is a loose collection of patches against the x86 hvf accel. They can be applied/pulled independently from one another. Patch 1 is a repost of a patch I've submitted a bunch of times already. It wires up and enables x2APIC mode in conjunction with HVF - the software APIC implementation in QEMU

[PATCH 3/4] i386/hvf: Raise exception on error setting APICBASE

2024-10-24 Thread Phil Dennis-Jordan
When setting the APICBASE MSR to an illegal value, the APIC implementation will return an error. This change forwards that report to the guest as an exception rather than ignoring it when using the hvf accelerator. Signed-off-by: Phil Dennis-Jordan --- target/i386/hvf/x86_emu.c | 11 +--

[PATCH 1/4] i386/hvf: Integrates x2APIC support with hvf accel

2024-10-24 Thread Phil Dennis-Jordan
Support for x2APIC mode was recently introduced in the software emulated APIC implementation for TCG. Enabling it when using macOS’s hvf accelerator is useful and significantly helps performance, as Qemu currently uses the emulated APIC when running on hvf as well. This change wires up the read &

Re: [PATCH 4/4] migration: Reset current_migration properly

2024-10-24 Thread Fabiano Rosas
Peter Xu writes: > current_migration is never reset, even if the migration object is freed > already. It means anyone references that can trigger UAF and it'll be hard > to debug. > > Properly clear the pointer now, so far the only way to do is via > finalize() as we know there's only one instan

Re: [PATCH 3/4] migration: Make migration object a singleton object

2024-10-24 Thread Fabiano Rosas
Peter Xu writes: > This makes the migration object a singleton unit. After this, we can do > something slightly tricky later on with the guarantee that nobody will be > able to create the object twice. > > Signed-off-by: Peter Xu > --- > migration/migration.c | 13 + > 1 file chang

Re: [PATCH 0/2] arm: Add collie and sx functional tests

2024-10-24 Thread Philippe Mathieu-Daudé
Cc'ing Jan. On 22/10/24 12:04, Guenter Roeck wrote: On 10/21/24 21:09, Philippe Mathieu-Daudé wrote: Hi Guenter, On 21/10/24 11:02, Guenter Roeck wrote: Unrelated to this, but I found that the sd emulation in 9.1 is also broken for loongarch and sifive_u, and partially for ast2600-evb (it h

Re: [PATCH] hw/s390x: Re-enable the pci-bridge device on s390x

2024-10-24 Thread Philippe Mathieu-Daudé
On 24/10/24 10:04, Thomas Huth wrote: Commit e779e5c05a ("hw/pci-bridge: Add a Kconfig switch for the normal PCI bridge") added a config switch for the pci-bridge, so that the device is not included in the s390x target anymore (since the pci-bridge is not really useful on s390x). However, it see

Re: [PATCH v2 0/6] Support virtio-gpu DRM native context

2024-10-24 Thread Dmitry Osipenko
On 10/24/24 15:45, Alex Bennée wrote: > Dmitry Osipenko writes: > >> On 10/24/24 13:09, Alex Bennée wrote: >>> Dmitry Osipenko writes: >>> This patchset adds DRM native context support to VirtIO-GPU on Qemu. It's based on the pending Venus v17 patches [1] that bring host blobs sup

Re: [PATCH 06/11] rust/pl011: add TYPE_PL011_LUMINARY device

2024-10-24 Thread Zhao Liu
On Thu, Oct 24, 2024 at 05:03:04PM +0300, Manos Pitsidianakis wrote: > Date: Thu, 24 Oct 2024 17:03:04 +0300 > From: Manos Pitsidianakis > Subject: [PATCH 06/11] rust/pl011: add TYPE_PL011_LUMINARY device > X-Mailer: b4 0.15-dev-12fc5 > > Add a device specialization for the Luminary UART device.

Re: [PATCH v2 07/13] rust: build integration test for the qemu_api crate

2024-10-24 Thread Zhao Liu
On Mon, Oct 21, 2024 at 06:35:32PM +0200, Paolo Bonzini wrote: > Date: Mon, 21 Oct 2024 18:35:32 +0200 > From: Paolo Bonzini > Subject: [PATCH v2 07/13] rust: build integration test for the qemu_api > crate > X-Mailer: git-send-email 2.46.2 > > Adjust the integration test to compile with a subse

Re: [PATCH 03/11] rust/qemu-api-macros: introduce Device proc macro

2024-10-24 Thread Manos Pitsidianakis
On Thu, 24 Oct 2024 at 18:14, Alex Bennée wrote: > > Manos Pitsidianakis writes: > > > Add a new derive procedural macro to declare device models. Add > > corresponding DeviceImpl trait after already existing ObjectImpl trait. > > At the same time, add instance_init, instance_post_init, > > insta

[PATCH 3/4] migration: Make migration object a singleton object

2024-10-24 Thread Peter Xu
This makes the migration object a singleton unit. After this, we can do something slightly tricky later on with the guarantee that nobody will be able to create the object twice. Signed-off-by: Peter Xu --- migration/migration.c | 13 + 1 file changed, 13 insertions(+) diff --git a

[PATCH 1/4] qom: TYPE_SINGLETON interface

2024-10-24 Thread Peter Xu
Signed-off-by: Peter Xu --- include/qom/object_interfaces.h | 47 + qom/object.c| 3 +++ qom/object_interfaces.c | 24 + qom/qom-qmp-cmds.c | 22 --- system/qdev-monitor.c | 7 + 5

[PATCH 0/4] QOM: Singleton interface

2024-10-24 Thread Peter Xu
This patchset introduces the singleton interface for QOM. The singleton interface is as simple as "this class can only create one instance". We used to have similar demand when working on all kinds of vIOMMUs, because in most cases that I am aware of, vIOMMU must be a singleton as it's closely bo

[PATCH 2/4] x86/iommu: Make x86-iommu a singleton object

2024-10-24 Thread Peter Xu
X86 IOMMUs cannot be created more than one on a system yet. Make it a singleton so it guards the system from accidentally create yet another IOMMU object when one already presents. Now if someone tries to create more than one, e.g., via: ./qemu -M q35 -device intel-iommu -device intel-iommu T

Re: [PATCH 1/2] target/i386: fix hang when using slow path for ptw_setl

2024-10-24 Thread Richard Henderson
On 10/23/24 23:20, Pierrick Bouvier wrote: When instrumenting memory accesses for plugin, we force memory accesses to use the slow path for mmu. [1] This create a situation where we end up calling ptw_setl_slow. Since this function gets called during a cpu_exec, start_exclusive then hangs. This

[PATCH 07/11] rust/pl011: move pub callback decl to local scope

2024-10-24 Thread Manos Pitsidianakis
extern "C" callbacks in instance_init() do not need to be public. Move them to local function scope instead. No functional change. Signed-off-by: Manos Pitsidianakis --- rust/hw/char/pl011/src/device.rs | 104 +++ 1 file changed, 50 insertions(+), 54 deletion

[PATCH 05/11] rust/pl011: move CLK_NAME static to function scope

2024-10-24 Thread Manos Pitsidianakis
We do not need to have CLK_NAME public nor a static. No functional change. Signed-off-by: Manos Pitsidianakis --- rust/hw/char/pl011/src/device.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/rust/hw/char/pl011/src/device.rs b/rust/hw/char/pl011/src/device.rs index 5

Re: [PATCH 1/2] Revert "Remove the unused sh4eb target"

2024-10-24 Thread Daniel P . Berrangé
On Thu, Oct 24, 2024 at 10:27:34AM +0200, Thomas Huth wrote: > This reverts commit 73ceb12960e686b763415f0880cc5171ccce01cf. > > The "r2d" machine can work in big endian mode, see: > > > https://lore.kernel.org/qemu-devel/d6755445-1060-48a8-82b6-2f392c21f...@landley.net/ > > So the reasoning f

Re: [PATCH] raw-format: Fix error message for invalid offset/size

2024-10-24 Thread Michael Tokarev
29.08.2024 21:55, Kevin Wolf wrote: 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_option

Re: [PATCH 2/2] hw/riscv: Support different address-cells for initrd

2024-10-24 Thread Conor Dooley
On Mon, Oct 21, 2024 at 04:30:11PM -0300, Daniel Henrique Barboza wrote: > > > On 10/21/24 1:09 AM, Jim Shu wrote: > > The cells of 'initrd-start/end' should follow the '#address-cell'. > > QEMU API could support 1 and 2 cells. > > > > Signed-off-by: Jim Shu > > --- > > hw/riscv/boot.c | 14 +

Re: [PATCH 03/11] rust/qemu-api-macros: introduce Device proc macro

2024-10-24 Thread Alex Bennée
Manos Pitsidianakis writes: > Add a new derive procedural macro to declare device models. Add > corresponding DeviceImpl trait after already existing ObjectImpl trait. > At the same time, add instance_init, instance_post_init, > instance_finalize methods to the ObjectImpl trait and call them from

Re: [PULL 00/14] Misc fixes patches

2024-10-24 Thread Peter Maydell
On Tue, 22 Oct 2024 at 16:24, Daniel P. Berrangé wrote: > > The following changes since commit cc5adbbd50d81555b8eb73602ec16fde40b55be4: > > Merge tag 'pull-tpm-2024-10-18-1' of > https://github.com/stefanberger/qemu-tpm into staging (2024-10-18 15:45:02 > +0100) > > are available in the Git r

[PATCH 11/11] rust/pl011: log guest/unimp errors

2024-10-24 Thread Manos Pitsidianakis
Use the qemu_log_mask() functions introduced in previous commit to log errors like the C pl011 device does. Signed-off-by: Manos Pitsidianakis --- rust/hw/char/pl011/src/device.rs | 37 +++-- 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/rust/hw/c

[PATCH 10/11] rust/qemu-api: add log module

2024-10-24 Thread Manos Pitsidianakis
Logging in QEMU is done by function-like C macros, which we cannot use directly from Rust with bindgen. This commit adds a new qemu_api module, `log`, that provides the following interfaces: - a `LogMask` enum type that uses the mask values from the generated bindings, and makes sure the rust e

[PATCH 04/11] rust: add support for migration in device models

2024-10-24 Thread Manos Pitsidianakis
This commit adds support for declaring migration state to device models in Rust. This is done through different but related parts: - The Device derive macro gains new attributes `vmstate_fields` and `vmstate_subsections`. This allows the device declaration to include the vmstate fields directl

Re: [PATCH 03/36] next-cube: remove overlap between next.dma and next.mmio memory regions

2024-10-24 Thread Philippe Mathieu-Daudé
On 23/10/24 05:58, Mark Cave-Ayland wrote: Change the start of the next.mmio memory region so that it follows on directly after the next.dma memory region, adjusting the address offsets in next_mmio_read() and next_mmio_write() accordingly. Signed-off-by: Mark Cave-Ayland --- hw/m68k/next-cub

Re: [PATCH] hw/s390x: Re-enable the pci-bridge device on s390x

2024-10-24 Thread Cédric Le Goater
On 10/24/24 15:04, Thomas Huth wrote: Commit e779e5c05a ("hw/pci-bridge: Add a Kconfig switch for the normal PCI bridge") added a config switch for the pci-bridge, so that the device is not included in the s390x target anymore (since the pci-bridge is not really useful on s390x). However, it see

[PATCH] hw/s390x: Re-enable the pci-bridge device on s390x

2024-10-24 Thread Thomas Huth
Commit e779e5c05a ("hw/pci-bridge: Add a Kconfig switch for the normal PCI bridge") added a config switch for the pci-bridge, so that the device is not included in the s390x target anymore (since the pci-bridge is not really useful on s390x). However, it seems like libvirt is still adding pci-brid

Re: [PATCH v2 0/6] Support virtio-gpu DRM native context

2024-10-24 Thread Alex Bennée
Dmitry Osipenko writes: > On 10/24/24 13:09, Alex Bennée wrote: >> Dmitry Osipenko writes: >> >>> This patchset adds DRM native context support to VirtIO-GPU on Qemu. >>> It's based on the pending Venus v17 patches [1] that bring host blobs >>> support to virtio-gpu-gl device. >>> >>> Based-on:

[PULL 3/8] tests: add 'rust' and 'bindgen' to CI package list

2024-10-24 Thread Paolo Bonzini
From: Daniel P. Berrangé Although we're not enabling rust by default yet, we can still add rust and bindgen to the CI package list. This demonstrates that we're not accidentally triggering unexpected build behaviour merely from Rust being present. When we do dev work to enable rust by default, t

Re: [PATCH v5 2/3] hw/acpi: Upgrade ACPI SPCR table to support SPCR table revision 4 format

2024-10-24 Thread maobibo
On 2024/8/29 上午9:59, Sia Jee Heng wrote: Update the SPCR table to accommodate the SPCR Table revision 4 [1]. The SPCR table has been modified to adhere to the revision 4 format [2]. [1]: https://learn.microsoft.com/en-us/windows-hardware/drivers/serports/serial-port-console-redirection-table

[PULL 8/8] qdev: make properties array "const"

2024-10-24 Thread Paolo Bonzini
Constify all accesses to qdev properties, except for the ObjectPropertyAccessor itself. This makes it possible to place them in read-only memory, and also lets Rust bindings switch from "static mut" arrays to "static"; which is advantageous, because mutable statics are highly discouraged. Reviewe

[PULL 4/8] ci: enable rust in the Fedora system build job

2024-10-24 Thread Paolo Bonzini
From: Daniel P. Berrangé We previously added a new job running Fedora with nightly rust toolchain. The standard rust toolchain distributed by Fedora is new enough, however, to let us enable a CI build with that too. Signed-off-by: Daniel P. Berrangé Link: https://lore.kernel.org/r/202410151339

[PULL 1/8] stubs: avoid duplicate symbols in libqemuutil.a

2024-10-24 Thread Paolo Bonzini
qapi_event_send_device_deleted is always included (together with the rest of QAPI) in libqemuutil.a if either system-mode emulation or tools are being built, and in that case the stub causes a duplicate symbol to appear in libqemuutil.a. Add the symbol only if events are not being requested. Cc:

[PULL 5/8] configure: Replace literally printed '\n' with newline

2024-10-24 Thread Paolo Bonzini
From: Kevin Wolf The idea here was to leave an empty line before the message, but by default, echo prints '\n' literally instead of interpreting it. Use a separate echo without parameter instead like in other places in the script. Fixes: 6fdc5bc173188f5e4942616b16d589500b874a15 Signed-off-by: Ke

[PULL 2/8] sockets: Remove deadcode

2024-10-24 Thread Paolo Bonzini
From: "Dr. David Alan Gilbert" socket_remote_address hasn't been used since it was added in 17c55decec ("sockets: add helpers for creating SocketAddress from a socket") inet_connect hasn't been used since 2017's 8ecc2f9eab ("sheepdog: Use SocketAddress and socket_connect()") Remove them. S

[PULL 7/8] scripts: remove erroneous file that breaks git clone on Windows

2024-10-24 Thread Paolo Bonzini
From: Pierrick Bouvier This file was created by mistake in recent ed7667188 (9p: remove 'proxy' filesystem backend driver). When cloning the repository using native git for windows, we see this: Error: error: invalid path 'scripts/meson-buildoptions.' Error: The process 'C:\Program Files\Git\bin

[PULL 0/8] Misc fixes for 2024-10-24

2024-10-24 Thread Paolo Bonzini
The following changes since commit f1dd640896ee2b50cb34328f2568aad324702954: Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging (2024-10-18 10:42:56 +0100) are available in the Git repository at: https://gitlab.com/bonzini/qemu.git tags/for-upstream for you to fetch c

Re: [PATCH] stubs: avoid duplicate symbols in libqemuutil.a

2024-10-24 Thread Alex Bennée
Paolo Bonzini writes: > qapi_event_send_device_deleted is always included (together with the > rest of QAPI) in libqemuutil.a if either system-mode emulation or tools > are being built, and in that case the stub causes a duplicate symbol > to appear in libqemuutil.a. > > Add the symbol only if ev

Re: [PATCH v3 0/5] Guestperf: miscellaneous refinement and enrichment

2024-10-24 Thread Peter Xu
On Thu, Oct 24, 2024 at 10:06:51AM +0800, Yong Huang wrote: > Indeed, we could document how to build and use the guestperf, > refining it to be more convenient to use. If to do so, please feel free to add a "test" entry in devel/migration too no matter to put the doc there, or just add a reference

Re: [PATCH v2 0/6] Support virtio-gpu DRM native context

2024-10-24 Thread Dmitry Osipenko
On 10/24/24 13:09, Alex Bennée wrote: > Dmitry Osipenko writes: > >> This patchset adds DRM native context support to VirtIO-GPU on Qemu. >> It's based on the pending Venus v17 patches [1] that bring host blobs >> support to virtio-gpu-gl device. >> >> Based-on: 20240822185110.1757429-1-dmitry.os

  1   2   >