[PULL 35/36] bsd-user: Add getdents and fcntl related system calls

2023-08-28 Thread Warner Losh
Add glue to call the following syscalls to the freebsd_syscall: freebsd11_getdents getdirentries freebsd11_getdirentries fcntl Signed-off-by: Warner Losh Signed-off-by: Karim Taha Reviewed-by: Richard Henderson Signed-off-by: Warner Losh --- bsd-user/freebsd/os-syscall.c | 16 +++

[PULL 06/36] bsd-user; Update the definitions of __put_user and __get_user macros

2023-08-28 Thread Warner Losh
Use __builtin_choose_expr to avoid type promotion from ?: in __put_user_e and __get_user_e macros. Copied from linux-user/qemu.h, originally by Blue Swirl. Signed-off-by: Warner Losh Signed-off-by: Karim Taha Reviewed-by: Richard Henderson --- bsd-user/qemu.h | 81 ---

[PULL 12/36] bsd-user: Add struct target_freebsd_fhandle and fcntl flags

2023-08-28 Thread Warner Losh
From: Stacey Son Add struct target_freebsd_fhandle and fcntl flags to bsd-user/syscall_defs.h Signed-off-by: Stacey Son Signed-off-by: Karim Taha Acked-by: Richard Henderson Reviewed-by: Warner Losh Signed-off-by: Warner Losh --- bsd-user/syscall_defs.h | 51 +++

[PULL 14/36] bsd-user: Rename target_freebsd_time_t to target_time_t

2023-08-28 Thread Warner Losh
This is necessary for future code using target_time_t, in bsd-user/syscall_defs. Signed-off-by: Warner Losh Signed-off-by: Karim Taha Reviewed-by: Richard Henderson --- bsd-user/syscall_defs.h | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bsd-user/syscall_defs.h b

[PULL 36/36] bsd-user: Add missing break after do_bsd_preadv

2023-08-28 Thread Warner Losh
Without it, we'd call preadv, then write with weird parameters, which is clearly not ideal... Signed-off-by: Warner Losh Reviewed-by: Philippe Mathieu-Daudé Fixes: 770d8abae7 ("bsd-user/bsd-file.h: Meat of the write system calls") Reviewed-by: Richard Henderson Message-Id: <20230820045419.89691

[PULL 30/36] bsd-user: Implement do_freebsd_realpathat syscall

2023-08-28 Thread Warner Losh
From: Mikaël Urankar Signed-off-by: Mikaël Urankar Signed-off-by: Karim Taha Reviewed-by: Richard Henderson Signed-off-by: Warner Losh --- bsd-user/freebsd/os-stat.h | 26 ++ 1 file changed, 26 insertions(+) diff --git a/bsd-user/freebsd/os-stat.h b/bsd-user/freebsd/

[PULL 07/36] bsd-user: Declarations of h2t and t2h conversion functions.

2023-08-28 Thread Warner Losh
From: Stacey Son Declarations of functions that convert between host and target structs. Co-authored-by: Michal Meloun Signed-off-by: Stacey Son Signed-off-by: Karim Taha Reviewed-by: Richard Henderson Signed-off-by: Warner Losh --- bsd-user/freebsd/qemu-os.h | 50

[PULL 32/36] bsd-user: Add glue for the freebsd11_stat syscalls

2023-08-28 Thread Warner Losh
Add glue to call the freebsd11_stat syscalls to the freebsd_syscall: freebsd11_stat freebsd11_lstat freebsd11_fstat freebsd11_fstatat freebsd11_nstat, freebsd11_nfstat, freebsd11_nlstat fstatat fstat Signed-off-by: Warner Losh Signed-off-by: Karim Taha Reviewed-by: Richard Henderson Signed-off

[PULL 28/36] bsd-user: Implement freebsd11 getdirents related syscalls

2023-08-28 Thread Warner Losh
From: Michal Meloun Implement the freebsd11 variant of the following syscalls: getdirentries(2) Co-authored-by: Stacey Son Signed-off-by: Stacey Son Signed-off-by: Michal Meloun Signed-off-by: Karim Taha Reviewed-by: Richard Henderson Signed-off-by: Warner Losh --- bsd-user/freebsd/os-sta

[PULL 29/36] bsd-user: Implement freebsd11 netbsd stat related syscalls

2023-08-28 Thread Warner Losh
From: Michal Meloun Forward declaration of the nstat syscalls: nstat nlstat nfstat Co-authored-by: Stacey Son Signed-off-by: Stacey Son Signed-off-by: Michal Meloun Signed-off-by: Karim Taha Reviewed-by: Richard Henderson Signed-off-by: Warner Losh --- bsd-user/freebsd/os-stat.h | 7 +

[PULL 18/36] bsd-user: Implement target_to_host_fcntl_cmd

2023-08-28 Thread Warner Losh
From: Stacey Son Implement the stat conversion functions: target_to_host_fcntl_cmd Signed-off-by: Stacey Son Signed-off-by: Karim Taha Reviewed-by: Richard Henderson Signed-off-by: Warner Losh --- bsd-user/freebsd/os-stat.c | 8 1 file changed, 8 insertions(+) diff --git a/bsd-use

[PULL 27/36] bsd-user: Implement freebsd11 statfs related syscalls

2023-08-28 Thread Warner Losh
From: Michal Meloun Implement the freebsd11 variant of the following syscalls: statfs(2) fstatfs(2) getfsstat(2) Co-authored-by: Stacey Son Signed-off-by: Stacey Son Signed-off-by: Michal Meloun Signed-off-by: Karim Taha Reviewed-by: Richard Henderson Signed-off-by: Warner Losh --- bsd-us

[PULL 34/36] bsd-user: Add glue for statfs related system calls

2023-08-28 Thread Warner Losh
Add glue to call the following syscalls to the freebsd_syscall: freebsd11_statfs statfs freebsd11_fstatfs fstatfs freebsd11_getfsstat getfsstat Signed-off-by: Warner Losh Signed-off-by: Karim Taha Reviewed-by: Richard Henderson --- bsd-user/freebsd/os-syscall.c | 24

[PULL 33/36] bsd-user: Add glue for getfh and related syscalls

2023-08-28 Thread Warner Losh
Add glue to call the following syscalls to the freebsd_syscall: getfh lgetfh fhopen freebsd11_fhstat freebsd11_fhstatfs fhstat fhstatfs Signed-off-by: Warner Losh Signed-off-by: Karim Taha Reviewed-by: Richard Henderson --- bsd-user/freebsd/os-syscall.c | 28 1 fi

Re: [QEMU][PATCH v3 1/2] xen_arm: Create virtio-mmio devices during initialization

2023-08-28 Thread Stefano Stabellini
On Fri, 25 Aug 2023, Vikram Garhwal wrote: > From: Oleksandr Tyshchenko > > In order to use virtio backends we need to allocate virtio-mmio > parameters (irq and base) and register corresponding buses. > > Use the constants defined in public header arch-arm.h to be > aligned with the toolstack.

Re: [QEMU][PATCH v3 2/2] xen_arm: Initialize RAM and add hi/low memory regions

2023-08-28 Thread Stefano Stabellini
On Fri, 25 Aug 2023, Vikram Garhwal wrote: > From: Oleksandr Tyshchenko > > In order to use virtio backends we need to initialize RAM for the > xen-mapcache (which is responsible for mapping guest memory using foreign > mapping) to work. Calculate and add hi/low memory regions based on > machine-

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

2023-08-28 Thread Gurchetan Singh
From: Antonio Caggiano The feature can be enabled when a backend wants it. Signed-off-by: Antonio Caggiano Signed-off-by: Gurchetan Singh Tested-by: Alyssa Ross Tested-by: Akihiko Odaki Reviewed-by: Marc-André Lureau Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Akihiko Odaki --- hw/d

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

2023-08-28 Thread Gurchetan Singh
This modifies the common virtio-gpu.h file have the fields and defintions needed by gfxstream/rutabaga, by VirtioGpuRutabaga. Signed-off-by: Gurchetan Singh Tested-by: Alyssa Ross Tested-by: Emmanouil Pitsidianakis Tested-by: Akihiko Odaki Reviewed-by: Emmanouil Pitsidianakis Reviewed-by: Ant

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

2023-08-28 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 Tested-by: Alyssa Ross Tested-by: Emmanouil Pitsidianakis Tested-by: Akihiko Odaki

[PATCH v13 0/9] rutabaga_gfx + gfxstream

2023-08-28 Thread Gurchetan Singh
From: Gurchetan Singh Changes since v12: - Added r-b tags from Antonio Caggiano and Akihiko Odaki - Removed review version from commit messages - I think we're good to merge since we've had multiple people test and review this series?? How to build both rutabaga and gfxstream guest/host libs:

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

2023-08-28 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 A

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

2023-08-28 Thread Gurchetan Singh
From: Gerd Hoffmann Use VIRTIO_GPU_SHM_ID_HOST_VISIBLE as id for virtio-gpu. Signed-off-by: Antonio Caggiano Tested-by: Alyssa Ross Tested-by: Akihiko Odaki Acked-by: Michael S. Tsirkin Reviewed-by: Akihiko Odaki --- hw/display/virtio-gpu-pci.c| 14 ++ hw/display/virtio-gpu

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

2023-08-28 Thread Gurchetan Singh
This change enables rutabaga to receive virtio-gpu-3d hypercalls when it is active. Signed-off-by: Gurchetan Singh Tested-by: Alyssa Ross Tested-by: Emmanouil Pitsidianakis Tested-by: Akihiko Odaki Reviewed-by: Antonio Caggiano Reviewed-by: Emmanouil Pitsidianakis Reviewed-by: Akihiko Odaki

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

2023-08-28 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 Tested-by: Alyssa Ross Tested-by: Emmanouil Pitsidianakis Tested-by: Akihiko Odaki Reviewed-by: Emmanouil Pitsidianakis Reviewed-by: Antonio Caggiano R

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

2023-08-28 Thread Gurchetan Singh
This adds basic documentation for virtio-gpu. Suggested-by: Akihiko Odaki Signed-off-by: Gurchetan Singh Tested-by: Alyssa Ross Tested-by: Emmanouil Pitsidianakis Tested-by: Akihiko Odaki Reviewed-by: Emmanouil Pitsidianakis Reviewed-by: Antonio Caggiano Reviewed-by: Akihiko Odaki --- doc

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

2023-08-28 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 Android

Re: [PATCH v11 0/9] rutabaga_gfx + gfxstream

2023-08-28 Thread Gurchetan Singh
On Fri, Aug 25, 2023 at 12:37 PM Alyssa Ross wrote: > Alyssa Ross writes: > > > Gurchetan Singh writes: > > > >> On Fri, Aug 25, 2023 at 12:11 AM Alyssa Ross wrote: > >> > >>> Gurchetan Singh writes: > >>> > >>> > On Wed, Aug 23, 2023 at 4:07 AM Alyssa Ross wrote: > >>> > > >>> >> Gurchetan

[PATCH] accel/tcg: mttcg remove false-negative halted assertion

2023-08-28 Thread Nicholas Piggin
mttcg asserts that an execution ending with EXCP_HALTED must have cpu->halted. However between the event or instruction that sets cpu->halted and requests exit and the assertion here, an asynchronous event could clear cpu->halted. This leads to crashes running AIX on ppc/pseries because it uses H_

[RESEND] memory: avoid updating ioeventfds for some address_space

2023-08-28 Thread hongmianquan
When updating ioeventfds, we need to iterate all address spaces, but some address spaces do not register eventfd_add|del call when memory_listener_register() and they do nothing when updating ioeventfds. So we can skip these AS in address_space_update_ioeventfds(). The overhead of memory_region_tr

Re: [RFC PATCH v2 0/6] Add API for list cpu extensions

2023-08-28 Thread LIU Zhiwei
On 2023/8/28 21:58, Igor Mammedov wrote: On Mon, 28 Aug 2023 16:45:30 +0800 LIU Zhiwei wrote: Some times we want to know what is the really mean of one cpu option. For example, in RISC-V, we usually specify a cpu in this way: -cpu rv64,v=on If we don't look into the source code, we can't ge

[PATCH v4 2/2] target/i386: Avoid overflow of the cache parameter enumerated by leaf 4

2023-08-28 Thread Qian Wen
According to SDM, CPUID.0x4:EAX[31:26] indicates the Maximum number of addressable IDs for processor cores in the physical package. If we launch over 64 cores VM, the 6-bit field will overflow, and the wrong core_id number will be reported. Since the HW reports 0x3f when the intel processor has ov

[PATCH v4 0/2] Fix overflow of the max number of IDs for logic processor and core

2023-08-28 Thread Qian Wen
CPUID.1.EBX[23:16]: Maximum number of addressable IDs for logical processors in this physical package. CPUID.4:EAX[31:26]: Maximum number of addressable IDs for processor cores in the physical package. The current qemu code doesn't limit the value written to these two fields. If the guest has a hu

[PATCH v4 1/2] target/i386: Avoid cpu number overflow in legacy topology

2023-08-28 Thread Qian Wen
The legacy topology enumerated by CPUID.1.EBX[23:16] is defined in SDM Vol2: Bits 23-16: Maximum number of addressable IDs for logical processors in this physical package. When threads_per_socket > 255, it will 1) overwrite bits[31:24] which is apic_id, 2) bits [23:16] get truncated. Specificall

[PATCH v4 0/8] vdpa: Send all CVQ state load commands in parallel

2023-08-28 Thread Hawkins Jiawei
This patchset allows QEMU to delay polling and checking the device used buffer until either the SVQ is full or control commands shadow buffers are full, instead of polling and checking immediately after sending each SVQ control command, so that QEMU can send all the SVQ control commands in parallel

[PATCH v4 2/8] vdpa: Use iovec for vhost_vdpa_net_cvq_add()

2023-08-28 Thread Hawkins Jiawei
Next patches in this series will no longer perform an immediate poll and check of the device's used buffers for each CVQ state load command. Consequently, there will be multiple pending buffers in the shadow VirtQueue, making it a must for every control command to have its own buffer. To achieve t

[PATCH v4 7/8] vdpa: Introduce cursors to vhost_vdpa_net_loadx()

2023-08-28 Thread Hawkins Jiawei
This patch introduces two new arugments, `out_cursor` and `in_cursor`, to vhost_vdpa_net_loadx(). Addtionally, it includes a helper function vhost_vdpa_net_load_cursor_reset() for resetting these cursors. Furthermore, this patch refactors vhost_vdpa_net_load_cmd() so that vhost_vdpa_net_load_cmd()

[PATCH v4 1/8] vhost: Add count argument to vhost_svq_poll()

2023-08-28 Thread Hawkins Jiawei
Next patches in this series will no longer perform an immediate poll and check of the device's used buffers for each CVQ state load command. Instead, they will send CVQ state load commands in parallel by polling multiple pending buffers at once. To achieve this, this patch refactoring vhost_svq_po

[PATCH v4 6/8] vdpa: Move vhost_svq_poll() to the caller of vhost_vdpa_net_cvq_add()

2023-08-28 Thread Hawkins Jiawei
This patch moves vhost_svq_poll() to the caller of vhost_vdpa_net_cvq_add() and introduces a helper funtion. By making this change, next patches in this series is able to refactor vhost_vdpa_net_load_x() only to delay the polling and checking process until either the SVQ is full or control command

[PATCH v4 4/8] vdpa: Avoid using vhost_vdpa_net_load_*() outside vhost_vdpa_net_load()

2023-08-28 Thread Hawkins Jiawei
Next patches in this series will refactor vhost_vdpa_net_load_cmd() to iterate through the control commands shadow buffers, allowing QEMU to send CVQ state load commands in parallel at device startup. Considering that QEMU always forwards the CVQ command serialized outside of vhost_vdpa_net_load()

[PATCH v4 8/8] vdpa: Send cvq state load commands in parallel

2023-08-28 Thread Hawkins Jiawei
This patch enables sending CVQ state load commands in parallel at device startup by following steps: * Refactor vhost_vdpa_net_load_cmd() to iterate through the control commands shadow buffers. This allows different CVQ state load commands to use their own unique buffers. * Delay the polling

[PATCH v4 5/8] vdpa: Check device ack in vhost_vdpa_net_load_rx_mode()

2023-08-28 Thread Hawkins Jiawei
Considering that vhost_vdpa_net_load_rx_mode() is only called within vhost_vdpa_net_load_rx() now, this patch refactors vhost_vdpa_net_load_rx_mode() to include a check for the device's ack, simplifying the code and improving its maintainability. Signed-off-by: Hawkins Jiawei Acked-by: Eugenio Pé

[PATCH v4 3/8] vhost: Expose vhost_svq_available_slots()

2023-08-28 Thread Hawkins Jiawei
Next patches in this series will delay the polling and checking of buffers until either the SVQ is full or control commands shadow buffers are full, no longer perform an immediate poll and check of the device's used buffers for each CVQ state load command. To achieve this, this patch exposes vhost

Re: [PATCH v2 3/4] qcow2: add zoned emulation capability

2023-08-28 Thread Damien Le Moal
On 8/28/23 20:55, Sam Li wrote: >>> +/* close one implicitly open zones to make it available */ >>> +for (int i = s->zoned_header.zone_nr_conv; >>> +i < bs->bl.nr_zones; ++i) { >>> +uint64_t *wp = &s->wps->wp[i]; >>> +if (qcow2_get

Re: [PATCH v2 00/48] tcg patch queue

2023-08-28 Thread Bastian Koppelmann
On Mon, Aug 28, 2023 at 06:52:42PM -0400, Stefan Hajnoczi wrote: > On Thu, 24 Aug 2023 at 14:29, Richard Henderson > wrote: > > > > The following changes since commit 50e7a40af372ee5931c99ef7390f5d3d6fbf6ec4: > > > > Merge tag 'pull-target-arm-20230824' of > > https://git.linaro.org/people/pmay

Re: [PATCH for-8.2] target/s390x/kvm: Simplify the GPRs, ACRs, CRs and prefix synchronization code

2023-08-28 Thread Cédric Le Goater
Hello Thomas, On 8/28/23 20:20, Thomas Huth wrote: On 14/08/2023 21.06, Thomas Huth wrote: KVM_SYNC_GPRS, KVM_SYNC_ACRS, KVM_SYNC_CRS and KVM_SYNC_PREFIX are available since kernel 3.10. Since we already require at least kernel 3.15 in the s390x KVM code, we can assume that the KVM_CAP_SYNC_REG

Re: [PATCH v2 3/4] qcow2: add zoned emulation capability

2023-08-28 Thread Sam Li
Damien Le Moal 于2023年8月29日周二 14:06写道: > > On 8/28/23 20:55, Sam Li wrote: > >>> +/* close one implicitly open zones to make it available */ > >>> +for (int i = s->zoned_header.zone_nr_conv; > >>> +i < bs->bl.nr_zones; ++i) { > >>> +uint64_t *wp =

Re: [PATCH v2 3/8] machine: Print supported CPU models instead of typenames

2023-08-28 Thread Gavin Shan
Hi Igor, On 8/29/23 00:46, Igor Mammedov wrote: On Mon, 31 Jul 2023 15:07:30 +1000 Gavin Shan wrote: On 7/27/23 19:00, Igor Mammedov wrote: On Thu, 27 Jul 2023 15:16:18 +1000 Gavin Shan wrote: On 7/27/23 09:08, Richard Henderson wrote: On 7/25/23 17:32, Gavin Shan wrote: -static const

Re: [PATCH v2 2/3] qemu-img: map: report compressed data blocks

2023-08-28 Thread Andrey Drobyshev
On 8/25/23 17:14, Hanna Czenczek wrote: > On 06.07.23 18:30, Andrey Drobyshev wrote: >> Right now "qemu-img map" reports compressed blocks as containing data >> but having no host offset.  This is not very informative.  Instead, >> let's add another boolean field named "compressed" in case JSON out

<    1   2   3   4