[RESEND PATCH] hw/i386/vmmouse:add relative packet flag for button status

2023-07-31 Thread Zongmin Zhou
The buttons value use macros instead of direct numbers. If request relative mode, have to add this for guest vmmouse driver to judge this is a relative packet. otherwise,vmmouse driver will not match the condition 'status & VMMOUSE_RELATIVE_PACKET', and can't report events on the

Re: [PATCH 0/5] linux-user: brk/mmap fixes

2023-07-31 Thread Joel Stanley
On Mon, 31 Jul 2023 at 18:24, Helge Deller wrote: > > I re-read the thread again. As it seems Joel already tried the latest > > version from me? Sadly I can't test myself on ppc64le (static binary > > needs klibc-PupSAGgtpafMlSLXOLgje1kXFo8.so in /usr/lib which I can't > > install on a debian

Re: [PULL 00/10] tcg patch queue for rc2

2023-07-31 Thread Richard Henderson
On 7/31/23 14:02, Richard Henderson wrote: The following changes since commit 234320cd0573f286b5f5c95ee6d757cf003999e7: Merge tag 'pull-target-arm-20230731' of https://git.linaro.org/people/pmaydell/qemu-arm into staging (2023-07-31 08:33:44 -0700) are available in the Git repository

Re: [PATCH 0/7] Enable vdpa net migration with features depending on CVQ

2023-07-31 Thread Jason Wang
On Mon, Jul 31, 2023 at 6:15 PM Eugenio Perez Martin wrote: > > On Mon, Jul 31, 2023 at 8:41 AM Jason Wang wrote: > > > > On Sat, Jul 29, 2023 at 1:20 AM Eugenio Pérez wrote: > > > > > > At this moment the migration of net features that depends on CVQ is not > > > possible, as there is no

Re: [PATCH] target/riscv: Fix page_check_range use in fault-only-first

2023-07-31 Thread LIU Zhiwei
On 2023/7/30 5:18, Richard Henderson wrote: On 7/28/23 20:16, LIU Zhiwei wrote: Commit bef6f008b98(accel/tcg: Return bool from page_check_range) converts integer return value to bool type. However, it wrongly converted the use of the API in riscv fault-only-first, where page_check_range < =

Re: [PATCH] vdpa: set old virtio status at cvq isolation probing end

2023-07-31 Thread Jason Wang
On Mon, Jul 31, 2023 at 5:41 PM Eugenio Perez Martin wrote: > > On Mon, Jul 31, 2023 at 10:42 AM Jason Wang wrote: > > > > On Mon, Jul 31, 2023 at 4:05 PM Eugenio Perez Martin > > wrote: > > > > > > On Mon, Jul 31, 2023 at 8:36 AM Jason Wang wrote: > > > > > > > > On Wed, Jul 26, 2023 at 2:27 

Re: [PATCH v2 06/11] tpm_crb: move ACPI table building to device interface

2023-07-31 Thread Joelle van Dyne
On Mon, Jul 17, 2023 at 6:42 AM Igor Mammedov wrote: > > On Fri, 14 Jul 2023 13:21:33 -0400 > Stefan Berger wrote: > > > On 7/14/23 03:09, Joelle van Dyne wrote: > > > This logic is similar to TPM TIS ISA device. Since TPM CRB can only > > > support TPM 2.0 backends, we check for this in

Re: [PATCH] hw/riscv: split RAM into low and high memory

2023-07-31 Thread Wu, Fei
On 8/1/2023 6:46 AM, Daniel Henrique Barboza wrote: > > > On 7/30/23 22:53, Fei Wu wrote: >> riscv virt platform's memory started at 0x8000 and >> straddled the 4GiB boundary. Curiously enough, this choice >> of a memory layout will prevent from launching a VM with >> a bit more than 2000MiB

Re: [RFC PATCH 00/19] QEMU gmem implemention

2023-07-31 Thread Xiaoyao Li
On 8/1/2023 1:10 AM, Isaku Yamahata wrote: On Mon, Jul 31, 2023 at 12:21:42PM -0400, Xiaoyao Li wrote: This is the first RFC version of enabling KVM gmem[1] as the backend for private memory of KVM_X86_PROTECTED_VM. It adds the support to create a specific KVM_X86_PROTECTED_VM type VM, and

Re: [PATCH v2 05/11] tpm_crb: use the ISA bus

2023-07-31 Thread Joelle van Dyne
On Tue, Jul 18, 2023 at 7:16 AM Stefan Berger wrote: > > > > On 7/17/23 09:46, Igor Mammedov wrote: > > On Fri, 14 Jul 2023 00:09:21 -0700 > > Joelle van Dyne wrote: > > > >> Since this device is gated to only build for targets with the PC > >> configuration, we should use the ISA bus like with

Re: [RFC PATCH 00/19] QEMU gmem implemention

2023-07-31 Thread Xiaoyao Li
On 8/1/2023 12:51 AM, Daniel P. Berrangé wrote: On Mon, Jul 31, 2023 at 12:21:42PM -0400, Xiaoyao Li wrote: This is the first RFC version of enabling KVM gmem[1] as the backend for private memory of KVM_X86_PROTECTED_VM. It adds the support to create a specific KVM_X86_PROTECTED_VM type VM,

[PATCH v2 6/9] gfxstream + rutabaga: add initial support for gfxstream

2023-07-31 Thread Gurchetan Singh
This adds initial support for gfxstream and cross-domain. Both features rely on virtio-gpu blob resources and context types, which are also implemented in this patch. gfxstream has a long and illustrious history in Android graphics paravirtualization. It has been powering graphics in the

[PATCH v2 7/9] gfxstream + rutabaga: meson support

2023-07-31 Thread Gurchetan Singh
- Add meson detection of rutabaga_gfx - Build virtio-gpu-rutabaga.c + associated vga/pci files when present Signed-off-by: Gurchetan Singh --- hw/display/meson.build| 22 ++ meson.build | 7 +++ meson_options.txt | 2 ++

[PATCH v2 1/9] virtio: Add shared memory capability

2023-07-31 Thread Gurchetan Singh
From: "Dr. David Alan Gilbert" Define a new capability type 'VIRTIO_PCI_CAP_SHARED_MEMORY_CFG' to allow defining shared memory regions with sizes and offsets of 2^32 and more. Multiple instances of the capability are allowed and distinguished by a device-specific 'id'. Signed-off-by: Dr. David

[PATCH v2 4/9] virtio-gpu: blob prep

2023-07-31 Thread Gurchetan Singh
From: Antonio Caggiano This adds preparatory functions needed to: - decode blob cmds - tracking iovecs Signed-off-by: Antonio Caggiano Signed-off-by: Dmitry Osipenko Signed-off-by: Gurchetan Singh --- hw/display/virtio-gpu.c | 11 +++

[PATCH v2 8/9] gfxstream + rutabaga: enable rutabaga

2023-07-31 Thread Gurchetan Singh
This change enables rutabaga to receive virtio-gpu-3d hypercalls when it is active. Signed-off-by: Gurchetan Singh --- hw/display/virtio-gpu-base.c | 3 ++- hw/display/virtio-gpu.c | 5 +++-- softmmu/qdev-monitor.c | 3 +++ softmmu/vl.c | 1 + 4 files changed, 9

[PATCH v2 2/9] virtio-gpu: CONTEXT_INIT feature

2023-07-31 Thread Gurchetan Singh
From: Antonio Caggiano The feature can be enabled when a backend wants it. Signed-off-by: Antonio Caggiano Reviewed-by: Marc-André Lureau Signed-off-by: Gurchetan Singh Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Akihiko Odaki --- hw/display/virtio-gpu-base.c | 3 +++

[PATCH v2 0/9] gfxstream + rutabaga_gfx

2023-07-31 Thread Gurchetan Singh
Latest iteration of rutabaga_gfx + gfxstream patches. Previous versions available here: https://patchew.org/QEMU/20230711025649.708-1-gurchetansi...@chromium.org/ https://patchew.org/QEMU/20230421011223.718-1-gurchetansi...@chromium.org/ Changes since v1: - New error callback hooked into QEMU

[PATCH v2 3/9] virtio-gpu: hostmem

2023-07-31 Thread Gurchetan Singh
From: Gerd Hoffmann Use VIRTIO_GPU_SHM_ID_HOST_VISIBLE as id for virtio-gpu. Signed-off-by: Antonio Caggiano Acked-by: Michael S. Tsirkin --- hw/display/virtio-gpu-pci.c| 14 ++ hw/display/virtio-gpu.c| 1 + hw/display/virtio-vga.c| 33

[PATCH v2 9/9] docs/system: add basic virtio-gpu documentation

2023-07-31 Thread Gurchetan Singh
This adds basic documentation for virtio-gpu. Suggested-by: Akihiko Odaki Signed-off-by: Gurchetan Singh --- v2: - Incorporated suggestions by Akihiko Odaki - Listed the currently supported capset_names (Bernard) docs/system/device-emulation.rst | 1 +

[PATCH v2 5/9] gfxstream + rutabaga prep: added need defintions, fields, and options

2023-07-31 Thread Gurchetan Singh
This modifies the common virtio-gpu.h file have the fields and defintions needed by gfxstream/rutabaga, by VirtioGpuRutabaga. The command to run these would be: -device virtio-vga-rutabaga,capset_names=gfxstream-vulkan:cross-domain, \

Re: [RFC PATCH 04/19] memory: Introduce memory_region_can_be_private()

2023-07-31 Thread Peter Xu
On Mon, Jul 31, 2023 at 05:36:37PM -0400, Michael S. Tsirkin wrote: > On Mon, Jul 31, 2023 at 02:34:22PM -0700, Sean Christopherson wrote: > > On Mon, Jul 31, 2023, Peter Xu wrote: > > > On Mon, Jul 31, 2023 at 12:21:46PM -0400, Xiaoyao Li wrote: > > > > +bool

RE: [PATCH 0/3] hw/ufs: fix compilation warnings

2023-07-31 Thread Jeuk Kim
On 7/28/2023, Mike Maslenkin wrote: > This patchset contains a trivial compilation fixes for UFS support > applied to block-next tree. > > Cc: Jeuk Kim > Cc: Stefan Hajnoczi > Signed-off-by: Mike Maslenkin Thanks for letting me know. Reviewed-by: Jeuk Kim To Stefan, Could you please add

[PATCH] target/nios2: Fix semihost lseek offset computation

2023-07-31 Thread Keith Packard via
The arguments for deposit64 are (value, start, length, fieldval); this appears to have thought they were (value, fieldval, start, length). Reorder the parameters to match the actual function. Signed-off-by: Keith Packard --- target/nios2/nios2-semi.c | 2 +- 1 file changed, 1 insertion(+), 1

Re: [PATCH v3 5/5] vhost-user-scsi: start vhost when guest kicks

2023-07-31 Thread Raphael Norwitz
> On Jul 31, 2023, at 8:10 AM, Li Feng wrote: > > Let's keep the same behavior as vhost-user-blk. > > Some old guests kick virtqueue before setting VIRTIO_CONFIG_S_DRIVER_OK. > > Signed-off-by: Li Feng Reviewed-by: Raphael Norwitz > --- > hw/scsi/vhost-user-scsi.c | 48

Re: [PATCH v3 4/5] vhost-user-scsi: support reconnect to backend

2023-07-31 Thread Raphael Norwitz
> On Jul 31, 2023, at 8:10 AM, Li Feng wrote: > > If the backend crashes and restarts, the device is broken. > This patch adds reconnect for vhost-user-scsi. > > Tested with spdk backend. > > Signed-off-by: Li Feng Reviewed-by: Raphael Norwitz > --- > hw/scsi/vhost-user-scsi.c

Re: [PATCH v3 2/5] vhost-user-common: send get_inflight_fd once

2023-07-31 Thread Raphael Norwitz
> On Jul 31, 2023, at 8:10 AM, Li Feng wrote: > > Currently the get_inflight_fd will be sent every time the device is started, > and > the backend will allocate shared memory to save the inflight state. If the > backend finds that it receives the second get_inflight_fd, it will release the >

Re: [PATCH v2 2/4] vhost-user-common: send get_inflight_fd once

2023-07-31 Thread Raphael Norwitz
> On Jul 31, 2023, at 7:38 AM, Li Feng wrote: > > > >> 2023年7月31日 06:13,Raphael Norwitz 写道: >> >>> >>> On Jul 28, 2023, at 3:49 AM, Li Feng wrote: >>> >>> >>> 2023年7月28日 下午2:04,Michael S. Tsirkin 写道: On Tue, Jul 25, 2023 at 06:42:45PM +0800, Li Feng wrote: >

Re: [PATCH] hw/riscv: split RAM into low and high memory

2023-07-31 Thread Daniel Henrique Barboza
On 7/30/23 22:53, Fei Wu wrote: riscv virt platform's memory started at 0x8000 and straddled the 4GiB boundary. Curiously enough, this choice of a memory layout will prevent from launching a VM with a bit more than 2000MiB and PCIe pass-thru on an x86 host, due to identity mapping

Re: [PATCH 5/5] linux-user: Do not align brk with host page size

2023-07-31 Thread Akihiko Odaki
On 2023/08/01 0:51, Helge Deller wrote: On 7/31/23 10:03, Akihiko Odaki wrote: do_brk() minimizes calls into target_mmap() by aligning the address with host page size, which is potentially larger than the target page size. Keep in mind, that host page size can be smaller than target page size

[PATCH] target/nios2: Pass semihosting arg to exit

2023-07-31 Thread Keith Packard via
Instead of using the function number (which is always zero), fetch the application-provided exit code argument and pass that to the two exit functions. Signed-off-by: Keith Packard --- target/nios2/nios2-semi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git

[PATCH v2 0/4] virtio-net: add USO feature (UDP segmentation offload)

2023-07-31 Thread Yuri Benditovich
Starting from 6.2 the kernel supports UDP segmentation offload, it uses GSO_UDP_L4 to mark packets with UDP sermentation request v1->v2: Enable USO features by default starting from 8.1 Move command-line parameters to the last patch Andrew Melnychenko (2): tap: Add USO support to tap device.

[PATCH v2 4/4] virtio-net: Add support for USO features

2023-07-31 Thread Yuri Benditovich
USO features of virtio-net device depend on kernel ability to support them, for backward compatibility by default the features are disabled on 8.0 and earlier. Signed-off-by: Yuri Benditovich Signed-off-by: Andrew Melnychecnko --- hw/core/machine.c | 4 hw/net/virtio-net.c | 31

[PATCH v2 1/4] tap: Add USO support to tap device.

2023-07-31 Thread Yuri Benditovich
From: Andrew Melnychenko Passing additional parameters (USOv4 and USOv6 offloads) when setting TAP offloads Signed-off-by: Yuri Benditovich Signed-off-by: Andrew Melnychenko --- hw/net/e1000e_core.c | 2 +- hw/net/igb_core.c| 2 +- hw/net/virtio-net.c | 4 +++- hw/net/vmxnet3.c |

[PATCH v2 3/4] virtio-net: Add USO flags to vhost support.

2023-07-31 Thread Yuri Benditovich
From: Andrew Melnychenko New features are subject to check with vhost-user and vdpa. Signed-off-by: Yuri Benditovich Signed-off-by: Andrew Melnychenko --- hw/net/vhost_net.c | 3 +++ net/vhost-vdpa.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/hw/net/vhost_net.c

[PATCH v2 2/4] tap: Add check for USO features

2023-07-31 Thread Yuri Benditovich
Tap indicates support for USO features according to capabilities of current kernel module. Signed-off-by: Yuri Benditovich Signed-off-by: Andrew Melnychecnko --- include/net/net.h | 3 +++ net/net.c | 9 + net/tap-bsd.c | 5 + net/tap-linux.c | 12

[PATCH 0/1] Added support for the MMU node in the RHCT

2023-07-31 Thread Lilly Anderson
The specification was recently updated so I thought I'd submit a patch. This does not add support for the CMO node, as I am unsure whether its pre-requisites are implemented. Lilly Anderson (1): Added support for the MMU node in the RHCT hw/riscv/virt-acpi-build.c | 17 ++--- 1

[PATCH 1/1] Added support for the MMU node in the RHCT

2023-07-31 Thread Lilly Anderson
--- hw/riscv/virt-acpi-build.c | 17 ++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/hw/riscv/virt-acpi-build.c b/hw/riscv/virt-acpi-build.c index 7331248f59..cb36e52169 100644 --- a/hw/riscv/virt-acpi-build.c +++ b/hw/riscv/virt-acpi-build.c @@ -119,7 +119,8 @@

Re: [RFC PATCH 04/19] memory: Introduce memory_region_can_be_private()

2023-07-31 Thread Michael S. Tsirkin
On Mon, Jul 31, 2023 at 02:34:22PM -0700, Sean Christopherson wrote: > On Mon, Jul 31, 2023, Peter Xu wrote: > > On Mon, Jul 31, 2023 at 12:21:46PM -0400, Xiaoyao Li wrote: > > > +bool memory_region_can_be_private(MemoryRegion *mr) > > > +{ > > > +return mr->ram_block && mr->ram_block->gmem_fd

Re: [RFC PATCH 04/19] memory: Introduce memory_region_can_be_private()

2023-07-31 Thread Sean Christopherson
On Mon, Jul 31, 2023, Peter Xu wrote: > On Mon, Jul 31, 2023 at 12:21:46PM -0400, Xiaoyao Li wrote: > > +bool memory_region_can_be_private(MemoryRegion *mr) > > +{ > > +return mr->ram_block && mr->ram_block->gmem_fd >= 0; > > +} > > This is not really MAP_PRIVATE, am I right? If so, is there

Re: [RFC PATCH 04/19] memory: Introduce memory_region_can_be_private()

2023-07-31 Thread Michael S. Tsirkin
On Mon, Jul 31, 2023 at 05:23:55PM -0400, Peter Xu wrote: > On Mon, Jul 31, 2023 at 12:21:46PM -0400, Xiaoyao Li wrote: > > +bool memory_region_can_be_private(MemoryRegion *mr) > > +{ > > +return mr->ram_block && mr->ram_block->gmem_fd >= 0; > > +} > > This is not really MAP_PRIVATE, am I

Re: [RFC PATCH 04/19] memory: Introduce memory_region_can_be_private()

2023-07-31 Thread Peter Xu
On Mon, Jul 31, 2023 at 12:21:46PM -0400, Xiaoyao Li wrote: > +bool memory_region_can_be_private(MemoryRegion *mr) > +{ > +return mr->ram_block && mr->ram_block->gmem_fd >= 0; > +} This is not really MAP_PRIVATE, am I right? If so, is there still chance we rename it (it seems to be also in

Re: [PATCH 1/3] migration: Stop marking RP bad after shutdown

2023-07-31 Thread Fabiano Rosas
Fabiano Rosas writes: > Peter Xu writes: > >> On Fri, Jul 28, 2023 at 09:15:14AM -0300, Fabiano Rosas wrote: >>> When waiting for the return path (RP) thread to finish, there is >>> really nothing wrong in the RP if the destination end of the migration >>> stops responding, leaving it stuck.

[PULL 00/10] tcg patch queue for rc2

2023-07-31 Thread Richard Henderson
The following changes since commit 234320cd0573f286b5f5c95ee6d757cf003999e7: Merge tag 'pull-target-arm-20230731' of https://git.linaro.org/people/pmaydell/qemu-arm into staging (2023-07-31 08:33:44 -0700) are available in the Git repository at: https://gitlab.com/rth7680/qemu.git tags

[PATCH v2] target/openrisc: Set EPCR to next PC on FPE exceptions

2023-07-31 Thread Stafford Horne
The architecture specification calls for the EPCR to be set to "Address of next not executed instruction" when there is a floating point exception (FPE). This was not being done, so fix it by using the same pattern as syscall. Also, we move this logic down to be done for instructions not in the

[PULL 05/10] accel/tcg: Clear tcg_ctx->gen_tb on buffer overflow

2023-07-31 Thread Richard Henderson
On overflow of code_gen_buffer, we unlock the guest pages we had been translating, but failed to clear gen_tb. On restart, if we cannot allocate a TB, we exit to the main loop to perform the flush of all TBs as soon as possible. With garbage in gen_tb, we hit an assert:

[PULL 07/10] bsd-user: Specify host page alignment if none specified

2023-07-31 Thread Richard Henderson
From: Warner Losh We're hitting an assert when we pass in alignment == 0 since that's not a power of two. so pass in the ideal page size. Signed-off-by: Warner Losh Message-Id: <20230728162927.5009-1-...@bsdimp.com> Reviewed-by: Richard Henderson Signed-off-by: Richard Henderson ---

[PULL 01/10] util/interval-tree: Use qatomic_read for left/right while searching

2023-07-31 Thread Richard Henderson
Fixes a race condition (generally without optimization) in which the subtree is re-read after the protecting if condition. Cc: qemu-sta...@nongnu.org Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- util/interval-tree.c | 15 +-- 1 file changed, 9 insertions(+), 6

[PULL 09/10] linux-user/armeb: Fix __kernel_cmpxchg() for armeb

2023-07-31 Thread Richard Henderson
From: Helge Deller Commit 7f4f0d9ea870 ("linux-user/arm: Implement __kernel_cmpxchg with host atomics") switched to use qatomic_cmpxchg() to swap a word with the memory content, but missed to endianess-swap the oldval and newval values when emulating an armeb CPU, which expects words to be

Re: [PATCH 1/3] migration: Stop marking RP bad after shutdown

2023-07-31 Thread Fabiano Rosas
Peter Xu writes: > On Fri, Jul 28, 2023 at 09:15:14AM -0300, Fabiano Rosas wrote: >> When waiting for the return path (RP) thread to finish, there is >> really nothing wrong in the RP if the destination end of the migration >> stops responding, leaving it stuck. >> >> Stop returning an error at

[PULL 10/10] target/s390x: Move trans_exc_code update to do_program_interrupt

2023-07-31 Thread Richard Henderson
This solves a problem in which the store to LowCore during tlb_fill triggers a clean-page TB invalidation for page0 during translation, which results in an assertion failure for locked pages. By delaying the store until after the exception has been raised, we will have unwound the pages locked

[PULL 06/10] bsd-user: Allocate guest virtual address space

2023-07-31 Thread Richard Henderson
With reserved_va, mmap.c expects to have pre-allocated host address space for the entire guest address space. When combined with the -B command-line option, ensure that the chosen address does not overlap anything else. Ensure that mmap_next_start is within reserved_va, as we use it within

[PULL 08/10] target/ppc: Disable goto_tb with architectural singlestep

2023-07-31 Thread Richard Henderson
The change to use translator_use_goto_tb went too far, as the CF_SINGLE_STEP flag managed by the translator only handles gdb single stepping and not the architectural single stepping modeled in DisasContext.singlestep_enabled. Fixes: 6e9cc373ec5 ("target/ppc: Use translator_use_goto_tb")

[PULL 04/10] util/interval-tree: Use qatomic_read/set for rb_parent_color

2023-07-31 Thread Richard Henderson
While less susceptible to optimization problems than left and right, interval_tree_iter_next also reads rb_parent(), so make sure that stores and loads are atomic. This goes further than technically required, changing all loads to be atomic, rather than simply the ones in the iteration side. But

[PULL 03/10] util/interval-tree: Introduce pc_parent

2023-07-31 Thread Richard Henderson
Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- util/interval-tree.c | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/util/interval-tree.c b/util/interval-tree.c index 759562db7d..d86c0752db 100644 --- a/util/interval-tree.c +++

[PULL 02/10] util/interval-tree: Use qatomic_set_mb in rb_link_node

2023-07-31 Thread Richard Henderson
Ensure that the stores to rb_left and rb_right are complete before inserting the new node into the tree. Otherwise a concurrent reader could see garbage in the new leaf. Cc: qemu-sta...@nongnu.org Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- util/interval-tree.c | 6 +-

Re: [RFC PATCH 4/6] hw/i386/intel_iommu: Fix VTD_IR_TableEntry for ms_struct layout

2023-07-31 Thread Michael S. Tsirkin
On Mon, Jul 31, 2023 at 04:26:44PM -0400, Peter Xu wrote: > On Mon, Jul 31, 2023 at 10:20:40AM +0200, Thomas Huth wrote: > > On 28/07/2023 16.37, Daniel P. Berrangé wrote: > > > On Fri, Jul 28, 2023 at 04:27:46PM +0200, Thomas Huth wrote: > > > > We might want to compile QEMU with Clang on Windows

Re: assert fails in s390x TCG

2023-07-31 Thread Claudio Fontana
On 7/31/23 13:31, Claudio Fontana wrote: > On 7/21/23 11:08, Claudio Fontana wrote: >> >> Hello Cornelia, Richard, >> >> I had some strange behavior in an s390x TCG VM that I am debugging, >> >> and configured latest upstream QEMU with --enable-debug --enable-debug-tcg >> >> and I am running the

Re: [PATCH] target/openrisc: Set EPCR to next PC on FPE exceptions

2023-07-31 Thread Stafford Horne
On Sun, Jul 30, 2023 at 10:43:45AM -0700, Richard Henderson wrote: > On 7/29/23 14:08, Stafford Horne wrote: > > The architecture specification calls for the EPCR to be set to "Address > > of next not executed instruction" when there is a floating point > > exception (FPE). This was not being

Re: [PATCH] disas/riscv: Further correction to LUI disassembly

2023-07-31 Thread Richard Henderson
On 7/31/23 11:33, Richard Bagley wrote: The recent commit 36df75a0a9 corrected one aspect of LUI disassembly by recovering the immediate argument from the result of LUI with a shift right by 12. However, the shift right will left-fill with the sign. By applying a mask we recover an unsigned

[PATCH] block-migration: Ensure we don't crash during migration cleanup

2023-07-31 Thread Fabiano Rosas
We can fail the blk_insert_bs() at init_blk_migration(), leaving the BlkMigDevState without a dirty_bitmap and BlockDriverState. Account for the possibly missing elements when doing cleanup. Fix the following crashes: Thread 1 "qemu-system-x86" received signal SIGSEGV, Segmentation fault.

Re: [RFC PATCH 4/6] hw/i386/intel_iommu: Fix VTD_IR_TableEntry for ms_struct layout

2023-07-31 Thread Peter Xu
On Mon, Jul 31, 2023 at 10:20:40AM +0200, Thomas Huth wrote: > On 28/07/2023 16.37, Daniel P. Berrangé wrote: > > On Fri, Jul 28, 2023 at 04:27:46PM +0200, Thomas Huth wrote: > > > We might want to compile QEMU with Clang on Windows - but it > > > does not support the __attribute__((gcc_struct))

Re: [PATCH] migration/calc-dirty-rate: millisecond precision period

2023-07-31 Thread Peter Xu
Hi, Andrei, On Mon, Jul 31, 2023 at 05:51:49PM +0300, gudkov.and...@huawei.com wrote: > On Mon, Jul 17, 2023 at 03:08:37PM -0400, Peter Xu wrote: > > On Tue, Jul 11, 2023 at 03:38:18PM +0300, gudkov.and...@huawei.com wrote: > > > On Thu, Jul 06, 2023 at 03:23:43PM -0400, Peter Xu wrote: > > > >

Re: [PATCH v2] target/riscv: don't read write-only CSR

2023-07-31 Thread Daniel Henrique Barboza
Patch looks correct IMHO. I have a few cosmetic suggestions: On 7/27/23 05:17, Nikita Shubin wrote: From: Nikita Shubin In case of write-only CSR don't return illegal inst error when CSR is written and lacks read op. It's worth citing the ISA bits you put down below in the commit msg. It

[PATCH] disas/riscv: Further correction to LUI disassembly

2023-07-31 Thread Richard Bagley
The recent commit 36df75a0a9 corrected one aspect of LUI disassembly by recovering the immediate argument from the result of LUI with a shift right by 12. However, the shift right will left-fill with the sign. By applying a mask we recover an unsigned representation of the 20-bit field (which

Re: [PATCH 0/5] linux-user: brk/mmap fixes

2023-07-31 Thread Helge Deller
On 7/31/23 19:43, Helge Deller wrote: On 7/31/23 18:47, Helge Deller wrote: On 7/31/23 12:23, Akihiko Odaki wrote: On 2023/07/31 19:17, Joel Stanley wrote: On Mon, 31 Jul 2023 at 09:31, Michael Tokarev wrote: 31.07.2023 11:03, Akihiko Odaki wrote: linux-user was failing on M2 MacBook Air.

Re: [PULL 0/6] target-arm queue

2023-07-31 Thread Richard Henderson
ccb86f079a9e4d94918086a9df18c1844347aff8: Merge tag 'pull-nbd-2023-07-28' ofhttps://repo.or.cz/qemu/ericb into staging (2023-07-28 09:56:57 -0700) are available in the Git repository at: https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20230731 for you to fetch changes up

Re: [PATCH 0/5] linux-user: brk/mmap fixes

2023-07-31 Thread Helge Deller
On 7/31/23 18:47, Helge Deller wrote: On 7/31/23 12:23, Akihiko Odaki wrote: On 2023/07/31 19:17, Joel Stanley wrote: On Mon, 31 Jul 2023 at 09:31, Michael Tokarev wrote: 31.07.2023 11:03, Akihiko Odaki wrote: linux-user was failing on M2 MacBook Air. Digging into the details, I found

Re: [RFC PATCH 5/6] include/qemu/compiler: Fix problem with gcc_struct and Clang

2023-07-31 Thread Daniel P . Berrangé
On Mon, Jul 31, 2023 at 04:10:36PM +0200, Philippe Mathieu-Daudé wrote: > On 31/7/23 11:32, Daniel P. Berrangé wrote: > > > I was surprised to see that we're not using ccache in gitlab CI. It wouldn't > > help the from-clean compile time, but thereafter it ought to help. I'm doing > > some tests

Re: [RFC PATCH 08/19] HostMem: Add private property to indicate to use kvm gmem

2023-07-31 Thread Markus Armbruster
Xiaoyao Li writes: > From: Isaku Yamahata > > Signed-off-by: Isaku Yamahata > Signed-off-by: Xiaoyao Li [...] > diff --git a/qapi/qom.json b/qapi/qom.json > index 7f92ea43e8e1..e0b2044e3d20 100644 > --- a/qapi/qom.json > +++ b/qapi/qom.json > @@ -605,6 +605,9 @@ > # @reserve: if true,

Re: qemu-img cache modes with Linux cgroup v1

2023-07-31 Thread Daniel P . Berrangé
On Mon, Jul 31, 2023 at 11:40:36AM -0400, Stefan Hajnoczi wrote: > Hi, > qemu-img -t writeback -T writeback is not designed to run with the Linux > cgroup v1 memory controller because dirtying too much page cache leads > to process termination instead of usual non-cgroup and cgroup v2 > throttling

Re: [RFC PATCH 00/19] QEMU gmem implemention

2023-07-31 Thread Isaku Yamahata
On Mon, Jul 31, 2023 at 12:21:42PM -0400, Xiaoyao Li wrote: > This is the first RFC version of enabling KVM gmem[1] as the backend for > private memory of KVM_X86_PROTECTED_VM. > > It adds the support to create a specific KVM_X86_PROTECTED_VM type VM, > and introduces 'private' property for

Re: [PATCH 2/3] migration: Simplify calling of await_return_path_close_on_source

2023-07-31 Thread Peter Xu
On Mon, Jul 31, 2023 at 09:42:27AM -0300, Fabiano Rosas wrote: > They are made redundant by > trace_await_return_path_close_on_source_joining() and > trace_await_return_path_close_on_source_close() which already exist in > the function. Oh.. that's okay then. Thanks, -- Peter Xu

Re: [RFC PATCH 00/19] QEMU gmem implemention

2023-07-31 Thread Daniel P . Berrangé
On Mon, Jul 31, 2023 at 12:21:42PM -0400, Xiaoyao Li wrote: > This is the first RFC version of enabling KVM gmem[1] as the backend for > private memory of KVM_X86_PROTECTED_VM. > > It adds the support to create a specific KVM_X86_PROTECTED_VM type VM, > and introduces 'private' property for

Re: [PATCH 0/5] linux-user: brk/mmap fixes

2023-07-31 Thread Helge Deller
On 7/31/23 12:23, Akihiko Odaki wrote: On 2023/07/31 19:17, Joel Stanley wrote: On Mon, 31 Jul 2023 at 09:31, Michael Tokarev wrote: 31.07.2023 11:03, Akihiko Odaki wrote: linux-user was failing on M2 MacBook Air. Digging into the details, I found several bugs in brk and mmap so here are

[RFC PATCH 08/19] HostMem: Add private property to indicate to use kvm gmem

2023-07-31 Thread Xiaoyao Li
From: Isaku Yamahata Signed-off-by: Isaku Yamahata Signed-off-by: Xiaoyao Li --- backends/hostmem.c | 18 ++ include/sysemu/hostmem.h | 2 +- qapi/qom.json| 4 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/backends/hostmem.c

[RFC PATCH 09/19] i386/kvm: Create gmem fd for KVM_X86_SW_PROTECTED_VM

2023-07-31 Thread Xiaoyao Li
Register a memory listener for KVM_X86_SW_PROVTED_VM. It creates gmem for the backend who sets the private property. Signed-off-by: Xiaoyao Li --- include/exec/memory.h | 1 + target/i386/kvm/kvm.c | 38 ++ 2 files changed, 39 insertions(+) diff --git

[RFC PATCH 17/19] pci-host/q35: Move PAM initialization above SMRAM initialization

2023-07-31 Thread Xiaoyao Li
From: Isaku Yamahata In mch_realize(), process PAM initialization before SMRAM initialization so that later patch can skill all the SMRAM related with a single check. Signed-off-by: Isaku Yamahata Signed-off-by: Xiaoyao Li --- hw/pci-host/q35.c | 19 ++- 1 file changed, 10

[RFC PATCH 16/19] trace/kvm: Add trace for page convertion between shared and private

2023-07-31 Thread Xiaoyao Li
From: Isaku Yamahata Signed-off-by: Isaku Yamahata Signed-off-by: Xiaoyao Li --- accel/kvm/kvm-all.c| 1 + accel/kvm/trace-events | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 72d50b923bf2..c9f3aab5e587 100644 ---

[RFC PATCH 13/19] physmem: replace function name with __func__ in ram_block_discard_range()

2023-07-31 Thread Xiaoyao Li
Signed-off-by: Xiaoyao Li --- softmmu/physmem.c | 34 +++--- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/softmmu/physmem.c b/softmmu/physmem.c index 8f64128de0b5..05c981e5c18e 100644 --- a/softmmu/physmem.c +++ b/softmmu/physmem.c @@ -3430,16

[RFC PATCH 18/19] q35: Introduce smm_ranges property for q35-pci-host

2023-07-31 Thread Xiaoyao Li
From: Isaku Yamahata Add a q35 property to check whether or not SMM ranges, e.g. SMRAM, TSEG, etc... exist for the target platform. TDX doesn't support SMM and doesn't play nice with QEMU modifying related guest memory ranges. Signed-off-by: Isaku Yamahata Co-developed-by: Sean Christopherson

[RFC PATCH 15/19] kvm: handle KVM_EXIT_MEMORY_FAULT

2023-07-31 Thread Xiaoyao Li
From: Chao Peng Currently only KVM_MEMORY_EXIT_FLAG_PRIVATE in flags is valid when KVM_EXIT_MEMORY_FAULT happens. It indicates userspace needs to do the memory conversion on the RAMBlock to turn the memory into desired attribute, i.e., private/shared. Note, KVM_EXIT_MEMORY_FAULT makes sense

[RFC PATCH 14/19] physmem: Add ram_block_convert_range

2023-07-31 Thread Xiaoyao Li
From: Chao Peng This new routine adds support for memory conversion between shared/private memory for gmem fd based private ram_block. Signed-off-by: Chao Peng Signed-off-by: Xiaoyao Li --- include/exec/cpu-common.h | 2 ++ softmmu/physmem.c | 61

[RFC PATCH 07/19] target/i386: Implement mc->kvm_type() to get VM type

2023-07-31 Thread Xiaoyao Li
Implement mc->kvm_type() for i386 machines. It provides a way for user to create SW_PROTECTE_VM. Signed-off-by: Xiaoyao Li --- hw/i386/x86.c | 27 +++ include/hw/i386/x86.h | 4 target/i386/kvm/kvm.c | 38

[RFC PATCH 06/19] i386/pc: Drop pc_machine_kvm_type()

2023-07-31 Thread Xiaoyao Li
pc_machine_kvm_type() was introduced by commit e21be724eaf5 ("i386/xen: add pc_machine_kvm_type to initialize XEN_EMULATE mode") to do Xen specific initialization by utilizing kvm_type method. commit eeedfe6c6316 ("hw/xen: Simplify emulated Xen platform init") moves the Xen specific

[RFC PATCH 11/19] kvm/memory: Introduce the infrastructure to set the default shared/private value

2023-07-31 Thread Xiaoyao Li
Introduce new flags for MemoryRegion to indicate the default attribute, private or not. And update the attribute if default private. Originated-from: Isaku Yamahata Signed-off-by: Xiaoyao Li --- accel/kvm/kvm-all.c | 10 ++ include/exec/memory.h | 6 ++ softmmu/memory.c |

[RFC PATCH 10/19] kvm: Introduce support for memory_attributes

2023-07-31 Thread Xiaoyao Li
Introcude the helper functions to set the attributes of a range of memory to private and shared. Signed-off-by: Xiaoyao Li --- accel/kvm/kvm-all.c | 43 +++ include/sysemu/kvm.h | 3 +++ 2 files changed, 46 insertions(+) diff --git

[RFC PATCH 12/19] i386/kvm: Set memory to default private for KVM_X86_SW_PROTECTED_VM

2023-07-31 Thread Xiaoyao Li
Signed-off-by: Xiaoyao Li --- target/i386/kvm/kvm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index df3a5f89396e..a96640512dbc 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c @@ -2614,6 +2614,7 @@ static void

[RFC PATCH 05/19] kvm: Enable KVM_SET_USER_MEMORY_REGION2 for memslot

2023-07-31 Thread Xiaoyao Li
From: Chao Peng Switch to KVM_SET_USER_MEMORY_REGION2 when supported by KVM. With KVM_SET_USER_MEMORY_REGION2, QEMU can set up memory region that backen'ed both by hva-based shared memory and gmem fd based private memory. Signed-off-by: Chao Peng Codeveloped-by: Xiaoyao Li Signed-off-by:

[RFC PATCH 03/19] RAMBlock: Support KVM gmemory

2023-07-31 Thread Xiaoyao Li
From: Chao Peng Add KVM gmem support to RAMBlock so we can have both normal hva based memory and gmem fd based memory in one RAMBlock. The gmem part is represented by the gmem_fd. Signed-off-by: Chao Peng Signed-off-by: Xiaoyao Li --- include/exec/memory.h | 8

[RFC PATCH 04/19] memory: Introduce memory_region_can_be_private()

2023-07-31 Thread Xiaoyao Li
Signed-off-by: Xiaoyao Li --- include/exec/memory.h | 9 + softmmu/memory.c | 5 + 2 files changed, 14 insertions(+) diff --git a/include/exec/memory.h b/include/exec/memory.h index 61e31c7b9874..e119d3ce1a1d 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@

Re: [PULL 0/1] hw/nvme fixes

2023-07-31 Thread Richard Henderson
On 7/30/23 12:29, Klaus Jensen wrote: From: Klaus Jensen Hi, This should also fix coverity cid 1518067 and 1518066. The following changes since commit ccb86f079a9e4d94918086a9df18c1844347aff8: Merge tag 'pull-nbd-2023-07-28' ofhttps://repo.or.cz/qemu/ericb into staging (2023-07-28

[RFC PATCH 19/19] i386: Disable SMM mode for X86_SW_PROTECTED_VM

2023-07-31 Thread Xiaoyao Li
Signed-off-by: Xiaoyao Li --- target/i386/kvm/kvm.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index a96640512dbc..62f237068a3a 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c @@ -2654,6 +2654,13 @@ int

[RFC PATCH 02/19] *** HACK *** linux-headers: Update headers to pull in gmem APIs

2023-07-31 Thread Xiaoyao Li
This patch needs to be updated by script scripts/update-linux-headers.sh once gmem fd support is upstreamed in Linux kernel. Signed-off-by: Xiaoyao Li --- linux-headers/asm-x86/kvm.h | 3 +++ linux-headers/linux/kvm.h | 50 + 2 files changed, 53

[RFC PATCH 00/19] QEMU gmem implemention

2023-07-31 Thread Xiaoyao Li
This is the first RFC version of enabling KVM gmem[1] as the backend for private memory of KVM_X86_PROTECTED_VM. It adds the support to create a specific KVM_X86_PROTECTED_VM type VM, and introduces 'private' property for memory backend. When the vm type is KVM_X86_PROTECTED_VM and memory backend

[RFC PATCH 01/19] trace/kvm: Split address space and slot id in trace_kvm_set_user_memory()

2023-07-31 Thread Xiaoyao Li
The upper 16 bits of kvm_userspace_memory_region::slot are address space id. Parse it separately in trace_kvm_set_user_memory(). Signed-off-by: Xiaoyao Li --- accel/kvm/kvm-all.c| 5 +++-- accel/kvm/trace-events | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git

Re: qemu-img cache modes with Linux cgroup v1

2023-07-31 Thread Richard W.M. Jones
On Mon, Jul 31, 2023 at 11:40:36AM -0400, Stefan Hajnoczi wrote: > 3. Using buffered I/O because O_DIRECT is not universally supported? > > If you can't use O_DIRECT, then qemu-img could be extended to manage its > dirty page cache set carefully. This consists of picking a budget and > writing

Re: [PATCH 5/5] linux-user: Do not align brk with host page size

2023-07-31 Thread Helge Deller
On 7/31/23 10:03, Akihiko Odaki wrote: do_brk() minimizes calls into target_mmap() by aligning the address with host page size, which is potentially larger than the target page size. Keep in mind, that host page size can be smaller than target page size too. That's the reason why host brk

Re: virtio-blk using a single iothread

2023-07-31 Thread Stefan Hajnoczi
On Sun, Jun 11, 2023 at 03:27:57PM +0300, Sagi Grimberg wrote: > Maybe I'm doing something wrong? Didn't expect to find a regression > against mainline on the default setup. Hi Sagi, I ran the latest branch against ed8ad9728a where it forked off master. master achieves fewer IOPS. It looks like

Re: [PATCH 3/5] linux-user: Use MAP_FIXED_NOREPLACE for do_brk()

2023-07-31 Thread Richard Henderson
On 7/31/23 06:32, Akihiko Odaki wrote: On 2023/07/31 20:44, Peter Maydell wrote: On Mon, 31 Jul 2023 at 09:04, Akihiko Odaki wrote: MAP_FIXED_NOREPLACE can ensure the mapped address is fixed without concerning that the new mapping overwrites something else. MAP_FIXED_NOREPLACE only came in

  1   2   3   >