[PATCH 09/16] target/riscv: Expose some 'trigger' prototypes from debug.c

2023-06-26 Thread Philippe Mathieu-Daudé
We want to extract TCG-specific code from debug.c, but some functions call get_trigger_type() / do_trigger_action(). Expose these prototypes in "debug.h". Signed-off-by: Philippe Mathieu-Daudé --- target/riscv/debug.h | 4 target/riscv/debug.c | 5 ++--- 2 files changed, 6 insertions(+), 3

[PATCH 14/16] target/riscv: Move sysemu-specific code to sysemu/cpu_helper.c

2023-06-26 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- target/riscv/cpu_helper.c| 859 +- target/riscv/sysemu/cpu_helper.c | 863 +++ target/riscv/sysemu/meson.build | 1 + 3 files changed, 865 insertions(+), 858 deletions(-) create mode 1006

[PATCH 15/16] target/riscv: Restrict TCG-specific prototype declarations

2023-06-26 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- target/riscv/cpu.h | 3 +++ target/riscv/cpu.c | 11 +++ 2 files changed, 14 insertions(+) diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h index 5945e13fe0..8f16655041 100644 --- a/target/riscv/cpu.h +++ b/target/riscv/cpu.h @@ -474,7 +474,

[PATCH 02/16] target/riscv: Restrict KVM-specific fields from ArchCPU

2023-06-26 Thread Philippe Mathieu-Daudé
These fields shouldn't be accessed when KVM is not available. Restrict the KVM timer migration state. Rename the KVM timer post_load() handler accordingly, because cpu_post_load() is too generic. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Daniel Henrique Barboza --- target/riscv/cpu.h

[PATCH 16/16] gitlab-ci.d/crossbuilds: Add KVM riscv64 cross-build jobs

2023-06-26 Thread Philippe Mathieu-Daudé
Add a new job to cross-build the riscv64 target without the TCG accelerator (IOW: only KVM accelerator enabled). Signed-off-by: Philippe Mathieu-Daudé --- .gitlab-ci.d/crossbuilds.yml | 8 1 file changed, 8 insertions(+) diff --git a/.gitlab-ci.d/crossbuilds.yml b/.gitlab-ci.d/crossbui

[PATCH 05/16] target/riscv: Move sysemu-specific files to target/riscv/sysemu/

2023-06-26 Thread Philippe Mathieu-Daudé
Move sysemu-specific files to the a new 'sysemu' sub-directory, adapt meson rules. Signed-off-by: Philippe Mathieu-Daudé --- target/riscv/cpu.h | 2 +- target/riscv/{ => sysemu}/instmap.h| 0 target/riscv/{ => sysemu}/kvm_riscv.h | 0 target/riscv/{ => sys

[RFC PATCH 13/16] target/riscv: Move TCG/sysemu-specific code to tcg/sysemu/cpu_helper.c

2023-06-26 Thread Philippe Mathieu-Daudé
Move TCG/sysemu-specific code and restrict the corresponding prototypes to TCG, adapting meson rules. Signed-off-by: Philippe Mathieu-Daudé --- RFC due to riscv_cpu_get_phys_page_debug() target/riscv/cpu.h | 15 +- target/riscv/cpu_helper.c| 745 --

[PATCH 01/16] target/riscv: Remove unused 'instmap.h' header in translate.c

2023-06-26 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- target/riscv/translate.c | 1 - 1 file changed, 1 deletion(-) diff --git a/target/riscv/translate.c b/target/riscv/translate.c index 8a33da811e..bd33bc3f51 100644 --- a/target/riscv/translate.c +++ b/target/riscv/translate.c @@ -30,7 +30,6 @@ #include "

[PATCH 11/16] target/riscv: Move sysemu-specific debug files to target/riscv/sysemu/

2023-06-26 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- target/riscv/cpu.h| 2 +- target/riscv/{ => sysemu}/debug.h | 0 target/riscv/cpu_helper.c | 2 +- target/riscv/{ => sysemu}/debug.c | 0 target/riscv/meson.build | 4 target/riscv/sysemu/meson.build | 1 + 6 files

[PATCH 00/16] target/riscv: Allow building without TCG (KVM-only so far)

2023-06-26 Thread Philippe Mathieu-Daudé
Hi, this series reorder TCG specific code in order to easily build a KVM-only binary. sysemu specific code is also moved around, to help noticing invalid uses from user emulation. Last patch adds a new job to our CI to avoid this to bitrot. Please review, Phil. Philippe Mathieu-Daudé (16): ta

Re: [PATCH 0/4] target/ppc: Catch invalid real address accesses

2023-06-26 Thread Nicholas Piggin
On Mon Jun 26, 2023 at 11:35 PM AEST, Cédric Le Goater wrote: > On 6/23/23 14:37, Cédric Le Goater wrote: > > On 6/23/23 11:10, Peter Maydell wrote: > >> On Fri, 23 Jun 2023 at 09:21, Nicholas Piggin wrote: > >>> > >>> ppc has always silently ignored access to real (physical) addresses > >>> with

Re: [PATCH RFC] icount: don't adjust virtual time backwards after warp

2023-06-26 Thread Nicholas Piggin
On Mon Jun 26, 2023 at 9:09 PM AEST, Paolo Bonzini wrote: > On Mon, Jun 26, 2023 at 1:08 PM Paolo Bonzini wrote: > > Queued, thanks. > > Hmm, almost, can you provide the Signed-off-by? Sure, give me a bit and I'll make up a better changelog and patch. Thanks, Nick

[PATCH v2] virtio-gpu: OUT_OF_MEMORY if failing to create udmabuf

2023-06-26 Thread Dongwon Kim
Respond with VIRTIO_GPU_RESP_ERR_OUT_OF_MEMORY if it fails to create an udmabuf for the blob resource. v2: consolidated return statments and removed an unnecessary style change Cc: Gerd Hoffmann Cc: Marc-André Lureau Cc: Vivek Kasireddy Signed-off-by: Dongwon Kim --- hw/display/virtio-gpu.c

Re: [PATCH] migrate/multifd: fix coredump when the multifd thread cleanup

2023-06-26 Thread chenyuhui (A)
On 2023/6/26 21:16, chenyuhui (A) wrote: > > On 2023/6/21 22:22, Fabiano Rosas wrote: >> Jianguo Zhang via writes: >> >>> From: Yuhui Chen >>> >>> There is a coredump while trying to destroy mutex when >>> p->running is false but p->mutex is not unlock. >>> Make sure all mutexes has been rele

[PATCH v2] ui/gtk: making dmabuf NULL when it's released.

2023-06-26 Thread Dongwon Kim
Set vc->gfx.guest_fb.dmabuf to NULL to prevent any further access to it after the dmabuf is released. v2: move declaration of vc inside ifdef Cc: Gerd Hoffmann Cc: Marc-André Lureau Cc: Vivek Kasireddy Signed-off-by: Dongwon Kim --- ui/gtk.c | 5 + 1 file changed, 5 insertions(+) diff -

Re: [PATCH v1 0/5] target/arm: Handle psci calls in userspace

2023-06-26 Thread Shaoqin Huang
Hi Salil, On 6/26/23 21:42, Salil Mehta wrote: From: Shaoqin Huang Sent: Monday, June 26, 2023 7:49 AM To: qemu-devel@nongnu.org; qemu-...@nongnu.org Cc: oliver.up...@linux.dev; Salil Mehta ; james.mo...@arm.com; gs...@redhat.com; Shaoqin Huang ; Cornelia Huck ; k...@vger.kernel.org; Michael S.

RE: [PATCH v3 1/3] vfio/pci: Fix resource leak in vfio_realize

2023-06-26 Thread Duan, Zhenzhong
>-Original Message- >From: Joao Martins >Sent: Monday, June 26, 2023 6:08 PM >To: Duan, Zhenzhong >Cc: alex.william...@redhat.com; c...@redhat.com; qemu-devel@nongnu.org; >avih...@nvidia.com; Peng, Chao P >Subject: Re: [PATCH v3 1/3] vfio/pci: Fix resource leak in vfio_realize > >On 26/0

RE: [PATCH v3 3/3] vfio/migration: vfio/migration: Refactor and fix print of "Migration disabled"

2023-06-26 Thread Duan, Zhenzhong
>-Original Message- >From: Avihai Horon >Sent: Monday, June 26, 2023 5:35 PM >To: Duan, Zhenzhong ; qemu- >de...@nongnu.org >Cc: alex.william...@redhat.com; c...@redhat.com; Martins, Joao >; Peng, Chao P >Subject: Re: [PATCH v3 3/3] vfio/migration: vfio/migration: Refactor and fix >prin

Re: [PATCH] net: add initial support for AF_XDP network backend

2023-06-26 Thread Jason Wang
On Mon, Jun 26, 2023 at 9:17 PM Ilya Maximets wrote: > > On 6/26/23 08:32, Jason Wang wrote: > > On Sun, Jun 25, 2023 at 3:06 PM Jason Wang wrote: > >> > >> On Fri, Jun 23, 2023 at 5:58 AM Ilya Maximets wrote: > >>> > >>> AF_XDP is a network socket family that allows communication directly > >>>

RE: [PATCH v3 3/3] vfio/migration: vfio/migration: Refactor and fix print of "Migration disabled"

2023-06-26 Thread Duan, Zhenzhong
>-Original Message- >From: Joao Martins >Sent: Monday, June 26, 2023 6:19 PM >To: Avihai Horon ; Duan, Zhenzhong > >Cc: alex.william...@redhat.com; c...@redhat.com; Peng, Chao P >; qemu-devel@nongnu.org >Subject: Re: [PATCH v3 3/3] vfio/migration: vfio/migration: Refactor and fix >print

Re: [PATCH 1/7] target/i386: Add FEAT_7_1_EDX to adjust feature level

2023-06-26 Thread Tao Su
On Mon, Jun 26, 2023 at 02:39:15PM +0200, Igor Mammedov wrote: > On Fri, 16 Jun 2023 11:23:05 +0800 > Tao Su wrote: > > > Considering the case of FEAT_7_1_EAX being 0 and FEAT_7_1_EDX being > > non-zero, > Can you clarify when/why that happens? When start a VM on GraniteRapids using '-cpu host',

Re: [PATCH 3/7] target/i386: Allow MCDT_NO if host supports

2023-06-26 Thread Tao Su
On Mon, Jun 26, 2023 at 03:03:12PM +0200, Igor Mammedov wrote: > On Fri, 16 Jun 2023 11:23:07 +0800 > Tao Su wrote: > > > MCDT_NO bit indicates HW contains the security fix and doesn't need to > > be mitigated to avoid data-dependent behaviour for certain instructions. > > It needs no hypervisor

Re: [PULL 53/53] vhost-vdpa: do not cleanup the vdpa/vhost-net structures if peer nic is present

2023-06-26 Thread Ani Sinha
> On 26-Jun-2023, at 9:23 PM, Michael Tokarev wrote: > > 26.06.2023 15:30, Michael S. Tsirkin wrote: >> From: Ani Sinha >> When a peer nic is still attached to the vdpa backend, it is too early to >> free >> up the vhost-net and vdpa structures. If these structures are freed here, >> then >

Re: Re: [PATCH 1/5] throttle: introduce enum ThrottleTimerType

2023-06-26 Thread zhenwei pi
On 6/27/23 05:24, Alberto Garcia wrote: On Sun 25 Jun 2023 04:56:27 PM +08, zhenwei pi wrote: Use enum ThrottleTimerType instead of number index. +typedef enum { +THROTTLE_TIMER_READ = 0, +THROTTLE_TIMER_WRITE, +THROTTLE_TIMER_MAX +} ThrottleTimerType; If you're doing this I

Re: Re: [PATCH 3/5] throttle: support read-only and write-only

2023-06-26 Thread zhenwei pi
On 6/27/23 05:38, Alberto Garcia wrote: On Sun 25 Jun 2023 04:56:29 PM +08, zhenwei pi wrote: void throttle_timers_attach_aio_context(ThrottleTimers *tt, AioContext *new_context) { -tt->timers[THROTTLE_TIMER_READ] = -aio_timer_new(new_

Re: [PATCH 6/7] target/i386: Add new CPU model EmeraldRapids

2023-06-26 Thread Xiaoyao Li
On 6/26/2023 8:56 PM, Igor Mammedov wrote: On Fri, 16 Jun 2023 11:23:10 +0800 Tao Su wrote: From: Qian Wen Emerald Rapids (EMR) is the next generation of Xeon server processor after Sapphire Rapids (SPR). Currently, regarding the feature set that can be exposed to guest, there isn't any one

Re: [PATCH 5/7] target/i386: Add few security fix bits in ARCH_CAPABILITIES into SapphireRapids CPU model

2023-06-26 Thread Xiaoyao Li
On 6/26/2023 9:15 PM, Igor Mammedov wrote: On Fri, 16 Jun 2023 11:23:09 +0800 Tao Su wrote: From: Lei Wang Latest stepping (8) of SapphireRapids has bit 13, 14 and 15 of MSR_IA32_ARCH_CAPABILITIES enabled, which are related to some security fixes. Add version 2 of SapphireRapids CPU model w

[PATCH] icount: don't adjust virtual time backwards after warp

2023-06-26 Thread Nicholas Piggin
The icount-based QEMU_CLOCK_VIRTUAL runs ahead of the RT clock at times. When warping, it is possible it is still ahead at the end of the warp, which causes icount adaptive mode to adjust it backward. This can result in the machine observing time going backwards. Prevent this by clamping adaptive

Re: which CPUs should call aarch64_add_{sve, pauth, sme}_properties() ?

2023-06-26 Thread Richard Henderson
On 6/26/23 18:54, Peter Maydell wrote: At the moment: * aarch64_a64fx_initfn() calls aarch64_add_sve_properties() * aarch64_max_tcg_initfn() calls all of aarch64_add_pauth_properties(), aarch64_add_sve_properties(), aarch64_add_sme_properties() and it happens that (ignoring 'max') we

Re: [PATCH v8] Emulate dip switch language layout settings on SUN keyboard

2023-06-26 Thread Mark Cave-Ayland
On 23/06/2023 19:30, Henrik Carlqvist wrote: SUN Type 4, 5 and 5c keyboards have dip switches to choose the language layout of the keyboard. Solaris makes an ioctl to query the value of the dipswitches and uses that value to select keyboard layout. Also the SUN bios like the one in the file ss5

Re: Reducing vdpa migration downtime because of memory pin / maps

2023-06-26 Thread Si-Wei Liu
On 6/9/2023 7:32 AM, Eugenio Perez Martin wrote: On Fri, Jun 9, 2023 at 12:39 AM Si-Wei Liu wrote: On 6/7/23 01:08, Eugenio Perez Martin wrote: On Wed, Jun 7, 2023 at 12:43 AM Si-Wei Liu wrote: Sorry for reviving this old thread, I lost the best timing to follow up on this while I was on

Re: [PATCH v2 0/8] target/sparc: Use tcg_gen_lookup_and_goto_ptr

2023-06-26 Thread Mark Cave-Ayland
On 22/06/2023 13:26, Mark Cave-Ayland wrote: On 21/06/2023 19:05, Richard Henderson wrote: Changes from v1:    * Split into teeny weeny pieces.    * It turns out the sparc_tr_tb_stop hunk of v1 was buggy, in that things that are not simple branches use DYNAMIC_PC, e.g. the RETT (ret

Re: [PATCH] Revert "hw/sparc64/niagara: Use blk_name() instead of open-coding it"

2023-06-26 Thread Mark Cave-Ayland
On 15/05/2023 16:11, Markus Armbruster wrote: This reverts commit 1881f336a33a8a99cb17ab1c57ed953682e8e107. This commit breaks "-drive if=pflash,readonly=on,file=image.iso". It claims to merely replace an open-coded version of blk_name() by a call, but that's not the case. Sorry for the incon

Re: [PATCH 0/4] target/ppc: Catch invalid real address accesses

2023-06-26 Thread Cédric Le Goater
It seems it broke the "mac99" and  powernv10 machines, using the qemu-ppc-boot images which are mostly buildroot. See below for logs. Adding Mark for further testing on Mac OS. Mac OS 9.2 fails to boot with a popup saying : Sorry, a system error occured. "Soun

Re: [PATCH v2 06/26] qemu-keymap: properly check return from xkb_keymap_mod_get_index

2023-06-26 Thread Thomas Huth
On 26/06/2023 23.59, Alex Bennée wrote: We can return XKB_MOD_INVALID which rightly gets flagged by sanitisers as an overly wide shift attempt. Signed-off-by: Alex Bennée --- qemu-keymap.c | 24 1 file changed, 16 insertions(+), 8 deletions(-) Reviewed-by: Thomas H

Re: [PATCH v2 06/26] qemu-keymap: properly check return from xkb_keymap_mod_get_index

2023-06-26 Thread Richard Henderson
On 6/26/23 23:59, Alex Bennée wrote: We can return XKB_MOD_INVALID which rightly gets flagged by sanitisers as an overly wide shift attempt. Signed-off-by: Alex Bennée --- qemu-keymap.c | 24 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/qemu-keymap.

Re: [PATCH 3/4] pc-bios/s390-ccw: Move the stack array into start.S

2023-06-26 Thread Thomas Huth
On 26/06/2023 17.25, Richard Henderson wrote: On 6/26/23 16:54, Christian Borntraeger wrote: Am 26.06.23 um 15:21 schrieb Thomas Huth: diff --git a/pc-bios/s390-ccw/start.S b/pc-bios/s390-ccw/start.S index 29b0a9ece0..47ef6e8aa8 100644 --- a/pc-bios/s390-ccw/start.S +++ b/pc-bios/s390-ccw/sta

<    1   2   3   4   5   6