Re: [PATCH v10 00/10] migration: Modify 'migrate' and 'migrate-incoming' QAPI commands for migration

2023-08-02 Thread Het Gala
Hi, A gentle reminder for Juan and other migration maintainers for the review of this patchset series if any changes are required or give to queue them. There are more patchset series coming after this. As discussed earlier, we have broken down it into 4 different patchset series. This is

Re: [PATCH] Fixed incorrect LLONG alignment for openrisc and cris

2023-08-02 Thread Thomas Huth
On 03/08/2023 02.29, Luca Bonissi wrote: From: Luca Bonissi Date: Thu, 3 Aug 2023 02:15:57 +0200 Subject: [PATCH] Fixed incorrect LLONG alignment for openrisc and cris OpenRISC (or1k) has long long alignment to 4 bytes, but currently not defined in abitypes.h. This lead to incorrect packing of

Re: [PATCH v8 00/15] Add RISC-V vector cryptographic instruction set support

2023-08-02 Thread Max Chou
On 2023/8/2 10:54 PM, Alistair Francis wrote: On Tue, Jul 11, 2023 at 12:59 PM Max Chou wrote: This patchset provides an implementation for Zvbb, Zvbc, Zvkned, Zvknh, Zvksh, Zvkg, and Zvksed of the draft RISC-V vector cryptography extensions as per the v20230620 version of the

[PATCH] target/m68k: Map FPU exceptions to FPSR register

2023-08-02 Thread Keith Packard via
Add helpers for reading/writing the 68881 FPSR register so that changes in floating point exception state can be seen by the application. Call these helpers in pre_load/post_load hooks to synchronize exception state. Signed-off-by: Keith Packard --- target/m68k/cpu.c| 12 +++

Re: [PATCH] target/m68k: Map FPU exceptions to FPSR register

2023-08-02 Thread Keith Packard via
> Good catch. Mostly ok. Thanks much for looking at this. > No need for inline markers. Thanks. > In general it is bad form to call HELPER(foo) directly. In this case > it doesn't hurt, but better form to reverse the implementations. Good point. I had copied this from the arm vfp code

Re: [PATCH v4] block-jobs: flush target at the end of .run()

2023-08-02 Thread Evanzhang
[...] >diff --git a/block/mirror.c b/block/mirror.c >index d3cacd1708..cd19b49f7f 100644 >--- a/block/mirror.c >+++ b/block/mirror.c >@@ -1143,6 +1143,10 @@ immediate_exit: > g_free(s->in_flight_bitmap); > bdrv_dirty_iter_free(s->dbi); > >+if (ret >= 0) { >+ret =

[PATCH 2/2] cryptodev: Handle unexpected request to avoid crash

2023-08-02 Thread zhenwei pi
Generally guest side should discover which services the device is able to offer, then do requests on device. However it's also possible to break this rule in a guest. Handle unexpected request here to avoid NULL pointer dereference. Fixes: e7a775fd ('cryptodev: Account statistics') Cc: Gonglei

[PATCH 0/2] CEV fixes for virtio-crypto

2023-08-02 Thread zhenwei pi
Hi Michael, Lei, Yiming Tao, Yongkang Jia, Xiao Lei(from Zhejiang University) reported issuses and CVEs in the past days. This series fixes a CVE and a BUG for virtio-crypto/cryptodev. Zhenwei Pi (2): virtio-crypto: verify src buffer length for sym request cryptodev: Handle unexpected

[PATCH 1/2] virtio-crypto: verify src buffer length for sym request

2023-08-02 Thread zhenwei pi
For symmetric algorithms, the length of ciphertext must be as same as the plaintext. The missing verification of the src_len and the dst_len in virtio_crypto_sym_op_helper() may lead buffer overflow/divulged. This patch is originally written by Yiming Tao for QEMU-SECURITY, resend it(a few

Re: [PATCH] target/m68k: Map FPU exceptions to FPSR register

2023-08-02 Thread Richard Henderson
On 8/2/23 17:55, Keith Packard via wrote: Add helpers for reading/writing the 68881 FPSR register so that changes in floating point exception state can be seen by the application. Signed-off-by: Keith Packard --- target/m68k/cpu.h| 2 ++ target/m68k/fpu_helper.c | 72

[PATCH v7 07/14] linux-user: Remove last_brk

2023-08-02 Thread Richard Henderson
This variable is unused. Signed-off-by: Richard Henderson --- linux-user/user-mmap.h | 1 - linux-user/mmap.c | 2 -- 2 files changed, 3 deletions(-) diff --git a/linux-user/user-mmap.h b/linux-user/user-mmap.h index 3fc986f92f..7265c2c116 100644 --- a/linux-user/user-mmap.h +++

[PATCH v7 08/14] bsd-user: Remove last_brk

2023-08-02 Thread Richard Henderson
This variable is unused. Signed-off-by: Richard Henderson --- bsd-user/qemu.h | 1 - bsd-user/mmap.c | 2 -- 2 files changed, 3 deletions(-) diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h index edf9602f9b..8f2d6a3c78 100644 --- a/bsd-user/qemu.h +++ b/bsd-user/qemu.h @@ -232,7 +232,6 @@

[PATCH v7 04/14] linux-user: Use MAP_FIXED_NOREPLACE for do_brk()

2023-08-02 Thread Richard Henderson
From: Akihiko Odaki MAP_FIXED_NOREPLACE can ensure the mapped address is fixed without concerning that the new mapping overwrites something else. Signed-off-by: Akihiko Odaki Message-Id: <20230802071754.14876-5-akihiko.od...@daynix.com> [rth: Pass -1 as fd for MAP_ANON] Signed-off-by: Richard

[PATCH v7 12/14] linux-user: Use elf_et_dyn_base for ET_DYN with interpreter

2023-08-02 Thread Richard Henderson
Follow the lead of the linux kernel in fs/binfmt_elf.c, in which an ET_DYN executable which uses an interpreter (usually a PIE executable) is loaded away from where the interpreter itself will be loaded. Signed-off-by: Richard Henderson --- linux-user/elfload.c | 43

[PATCH v7 11/14] linux-user: Add ELF_ET_DYN_BASE

2023-08-02 Thread Richard Henderson
Copy each guest kernel's default value, then bound it against reserved_va or the host address space. Signed-off-by: Richard Henderson --- linux-user/aarch64/target_mman.h | 3 +++ linux-user/alpha/target_mman.h | 3 +++ linux-user/arm/target_mman.h | 3 +++

[PATCH v7 05/14] linux-user: Do nothing if too small brk is specified

2023-08-02 Thread Richard Henderson
From: Akihiko Odaki Linux 6.4.7 does nothing when a value smaller than the initial brk is specified. Fixes: 86f04735ac ("linux-user: Fix brk() to release pages") Reviewed-by: Helge Deller Signed-off-by: Akihiko Odaki Message-Id: <20230802071754.14876-6-akihiko.od...@daynix.com> Signed-off-by:

[PATCH v7 00/14] linux-user: brk fixes

2023-08-02 Thread Richard Henderson
Builds on Helge's v6, incorporating my feedback plus some other minor cleanup. r~ Akihiko Odaki (6): linux-user: Unset MAP_FIXED_NOREPLACE for host linux-user: Fix MAP_FIXED_NOREPLACE on old kernels linux-user: Do not call get_errno() in do_brk() linux-user: Use MAP_FIXED_NOREPLACE for

[PATCH v7 10/14] linux-user: Define TASK_UNMAPPED_BASE in $guest/target_mman.h

2023-08-02 Thread Richard Henderson
Provide default values that are as close as possible to the values used by the guest's kernel. Signed-off-by: Richard Henderson --- linux-user/aarch64/target_mman.h | 10 ++ linux-user/alpha/target_mman.h | 8 linux-user/arm/target_mman.h | 8

[PATCH v7 09/14] linux-user: Adjust task_unmapped_base for reserved_va

2023-08-02 Thread Richard Henderson
Ensure that the chosen values for mmap_next_start and task_unmapped_base are within the guest address space. Signed-off-by: Richard Henderson --- linux-user/user-mmap.h | 18 +- linux-user/main.c | 26 ++ linux-user/mmap.c | 18

[PATCH v7 14/14] linux-user: Properly set image_info.brk in flatload

2023-08-02 Thread Richard Henderson
The heap starts at "brk" not "start_brk". With this fixed, image_info.start_brk is unused and may be removed. Signed-off-by: Richard Henderson --- linux-user/qemu.h | 1 - linux-user/flatload.c | 2 +- linux-user/main.c | 2 -- 3 files changed, 1 insertion(+), 4 deletions(-) diff

[PATCH v7 06/14] linux-user: Do not align brk with host page size

2023-08-02 Thread Richard Henderson
From: Akihiko Odaki do_brk() minimizes calls into target_mmap() by aligning the address with host page size, which is potentially larger than the target page size. However, the current implementation of this optimization has two bugs: - The start of brk is rounded up with the host page size

[PATCH v7 03/14] linux-user: Do not call get_errno() in do_brk()

2023-08-02 Thread Richard Henderson
From: Akihiko Odaki Later the returned value is compared with -1, and negated errno is not expected. Fixes: 00faf08c95 ("linux-user: Don't use MAP_FIXED in do_brk()") Reviewed-by: Helge Deller Signed-off-by: Akihiko Odaki Message-Id: <20230802071754.14876-4-akihiko.od...@daynix.com>

[PATCH v7 02/14] linux-user: Fix MAP_FIXED_NOREPLACE on old kernels

2023-08-02 Thread Richard Henderson
From: Akihiko Odaki The man page states: > Note that older kernels which do not recognize the MAP_FIXED_NOREPLACE > flag will typically (upon detecting a collision with a preexisting > mapping) fall back to a “non-MAP_FIXED” type of behavior: they will > return an address that is different from

[PATCH v7 13/14] linux-user: Adjust initial brk when interpreter is close to executable

2023-08-02 Thread Richard Henderson
From: Helge Deller While we attempt to load a ET_DYN executable far away from TASK_UNMAPPED_BASE, we are not completely in control of the address space layout. If the interpreter lands close to the executable, leaving insufficient heap space, move brk. Signed-off-by: Helge Deller [rth:

[PATCH v7 01/14] linux-user: Unset MAP_FIXED_NOREPLACE for host

2023-08-02 Thread Richard Henderson
From: Akihiko Odaki Passing MAP_FIXED_NOREPLACE to host will fail for reserved_va because the address space is reserved with mmap. Replace it with MAP_FIXED in that case. Signed-off-by: Akihiko Odaki Message-Id: <20230802071754.14876-2-akihiko.od...@daynix.com> [rth: Expand inline

RE: [RFC PATCH v4 00/24] vfio: Adopt iommufd

2023-08-02 Thread Duan, Zhenzhong
>-Original Message- >From: Nicolin Chen >Subject: Re: [RFC PATCH v4 00/24] vfio: Adopt iommufd > >On Tue, Aug 01, 2023 at 08:28:01AM +, Duan, Zhenzhong wrote: > >> Ping, any comments or suggestions are appreciated. > >Zhenzhong, I'd love to, yet haven't got the chance to go through

[PATCH] target/m68k: Map FPU exceptions to FPSR register

2023-08-02 Thread Keith Packard via
Add helpers for reading/writing the 68881 FPSR register so that changes in floating point exception state can be seen by the application. Signed-off-by: Keith Packard --- target/m68k/cpu.h| 2 ++ target/m68k/fpu_helper.c | 72

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

2023-08-02 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

[PATCH] Fixed incorrect LLONG alignment for openrisc and cris

2023-08-02 Thread Luca Bonissi
From: Luca Bonissi Date: Thu, 3 Aug 2023 02:15:57 +0200 Subject: [PATCH] Fixed incorrect LLONG alignment for openrisc and cris OpenRISC (or1k) has long long alignment to 4 bytes, but currently not defined in abitypes.h. This lead to incorrect packing of /epoll_event/ structure and eventually

Re: [PATCH v1] Allowing setting and overriding parameters in smb.conf

2023-08-02 Thread Henrik Carlqvist
On Thu, 3 Aug 2023 01:34:04 +0200 Samuel Thibault wrote: > Henrik Carlqvist, le jeu. 03 août 2023 01:26:02 +0200, a ecrit: > > On Thu, 3 Aug 2023 01:13:24 +0200 > > Samuel Thibault wrote: > > > > > Henrik Carlqvist, le jeu. 03 août 2023 01:09:09 +0200, a ecrit: > > > > On Wed, 2 Aug 2023

Re: [PATCH v3 14/17] i386: Use CPUCacheInfo.share_level to encode CPUID[4]

2023-08-02 Thread Moger, Babu
Hi Zhao, Hitting this error after this patch. ERROR:../target/i386/cpu.c:257:max_processor_ids_for_cache: code should not be reached Bail out! ERROR:../target/i386/cpu.c:257:max_processor_ids_for_cache: code should not be reached Aborted (core dumped) Looks like share_level for all the caches

Re: [PATCH v1] Allowing setting and overriding parameters in smb.conf

2023-08-02 Thread Samuel Thibault
Henrik Carlqvist, le jeu. 03 août 2023 01:26:02 +0200, a ecrit: > On Thu, 3 Aug 2023 01:13:24 +0200 > Samuel Thibault wrote: > > > Henrik Carlqvist, le jeu. 03 août 2023 01:09:09 +0200, a ecrit: > > > On Wed, 2 Aug 2023 21:53:56 +0200 > > > Samuel Thibault wrote: > > > > > > > Henrik

Re: [PATCH v1] Allowing setting and overriding parameters in smb.conf

2023-08-02 Thread Henrik Carlqvist
On Thu, 3 Aug 2023 01:13:24 +0200 Samuel Thibault wrote: > Henrik Carlqvist, le jeu. 03 août 2023 01:09:09 +0200, a ecrit: > > On Wed, 2 Aug 2023 21:53:56 +0200 > > Samuel Thibault wrote: > > > > > Henrik Carlqvist, le mar. 01 août 2023 23:27:25 +0200, a ecrit: > > > > @@ -950,10 +953,11

Re: [PATCH v1] Allowing setting and overriding parameters in smb.conf

2023-08-02 Thread Samuel Thibault
Henrik Carlqvist, le jeu. 03 août 2023 01:09:09 +0200, a ecrit: > On Wed, 2 Aug 2023 21:53:56 +0200 > Samuel Thibault wrote: > > > Henrik Carlqvist, le mar. 01 août 2023 23:27:25 +0200, a ecrit: > > > @@ -950,10 +953,11 @@ static int slirp_smb(SlirpState* s, const char > > > *exported_dir, > >

Re: [PATCH v1] Allowing setting and overriding parameters in smb.conf

2023-08-02 Thread Henrik Carlqvist
On Wed, 2 Aug 2023 21:53:56 +0200 Samuel Thibault wrote: > Henrik Carlqvist, le mar. 01 août 2023 23:27:25 +0200, a ecrit: > > @@ -950,10 +953,11 @@ static int slirp_smb(SlirpState* s, const char > > *exported_dir, > > "printing = bsd\n" > > "disable spoolss = yes\n" >

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

2023-08-02 Thread Isaku Yamahata
On Mon, Jul 31, 2023 at 12:21:48PM -0400, Xiaoyao Li wrote: > 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:

Re: [PATCH v3 0/4] Vhost-vdpa Shadow Virtqueue VLAN support

2023-08-02 Thread Lei Yang
QE tested v3 of this series using the test steps provided by Hawkins and everything works fine. Tested-by: Lei Yang On Sun, Jul 23, 2023 at 8:10 PM Hawkins Jiawei wrote: > > This series enables shadowed CVQ to intercept VLAN commands > through shadowed CVQ, update the virtio NIC device model >

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

2023-08-02 Thread Isaku Yamahata
On Wed, Aug 02, 2023 at 04:14:29PM +0200, David Hildenbrand wrote: > On 02.08.23 10:03, Xiaoyao Li wrote: > > On 8/2/2023 1:21 AM, David Hildenbrand wrote: > > > On 31.07.23 18:21, Xiaoyao Li wrote: > > > > From: Isaku Yamahata > > > > > > > > Signed-off-by: Isaku Yamahata > > > >

Re: [RFC PATCH v4 00/24] vfio: Adopt iommufd

2023-08-02 Thread Nicolin Chen
On Tue, Aug 01, 2023 at 08:28:01AM +, Duan, Zhenzhong wrote: > Ping, any comments or suggestions are appreciated. Zhenzhong, I'd love to, yet haven't got the chance to go through this series. I think that most of us are quite occupied at this moment by the kernel side of the changes. I

Re: [PATCH v3 10/17] i386/cpu: Introduce cluster-id to X86CPU

2023-08-02 Thread Moger, Babu
Hi Zhao, On 8/1/23 05:35, Zhao Liu wrote: > From: Zhuocheng Ding > > We introduce cluster-id other than module-id to be consistent with s/We introduce/Introduce/ Thanks Babu > CpuInstanceProperties.cluster-id, and this avoids the confusion > of parameter names when hotplugging. > >

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

2023-08-02 Thread Isaku Yamahata
On Mon, Jul 31, 2023 at 12:22:01PM -0400, Xiaoyao Li wrote: > 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 > ---

Re: [RFC PATCH 15/19] kvm: handle KVM_EXIT_MEMORY_FAULT

2023-08-02 Thread Isaku Yamahata
On Mon, Jul 31, 2023 at 12:21:57PM -0400, Xiaoyao Li wrote: > 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 >

Re: [PATCH v3 4/5] Add i.MX7 missing TZ devices and memory regions

2023-08-02 Thread Philippe Mathieu-Daudé
On 2/8/23 23:08, Jean-Christophe Dubois wrote: * Add TZASC as unimplemented device. - Allow bare metal application to access this (unimplemented) device * Add CSU as unimplemented device. - Allow bare metal application to access this (unimplemented) device * Add various memory segments

Re: [PATCH v3 2/5] Add i.MX6UL TZ missing devices.

2023-08-02 Thread Philippe Mathieu-Daudé
On 2/8/23 23:08, Jean-Christophe Dubois wrote: * Add TZASC as unimplemented device. - Allow bare metal application to access this (unimplemented) device * Add CSU as unimplemented device. - Allow bare metal application to access this (unimplemented) device Signed-off-by: Jean-Christophe

Re: [PATCH v3 1/5] Refactor i.MX6UL processor code

2023-08-02 Thread Philippe Mathieu-Daudé
Hi Jean-Christophe, On 2/8/23 23:08, Jean-Christophe Dubois wrote: * Add Addr and size definition for all i.MX6UL devices in i.MX6UL header file. I'm OK with your patch, but some addr/size are added, while other are changed. It is hard to review. Having one patch for changes and another for

[ANNOUNCE] QEMU 8.1.0-rc2 is now available

2023-08-02 Thread Michael Roth
Hello, On behalf of the QEMU Team, I'd like to announce the availability of the third release candidate for the QEMU 8.1 release. This release is meant for testing purposes and should not be used in a production environment. http://download.qemu.org/qemu-8.1.0-rc2.tar.xz

Re: [PATCH 5/6] hw/i386/x86-iommu: Fix endianness issue in x86_iommu_irq_to_msi_message()

2023-08-02 Thread Philippe Mathieu-Daudé
On 2/8/23 15:57, Thomas Huth wrote: The values in "msg" are assembled in host endian byte order (the other field are also not swapped), so we must not swap the __addr_head here. Signed-off-by: Thomas Huth --- hw/i386/x86-iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

Re: [PATCH 3/6] hw/i386/intel_iommu: Fix struct VTDInvDescIEC on big endian hosts

2023-08-02 Thread Philippe Mathieu-Daudé
On 2/8/23 15:57, Thomas Huth wrote: On big endian hosts, we need to reverse the bitfield order in the struct VTDInvDescIEC, just like it is already done for the other bitfields in the various structs of the intel-iommu device. Signed-off-by: Thomas Huth --- hw/i386/intel_iommu_internal.h | 9

Re: [PATCH 1/6] hw/i386/intel_iommu: Fix trivial endianness problems

2023-08-02 Thread Philippe Mathieu-Daudé
On 2/8/23 15:57, Thomas Huth wrote: After reading the guest memory with dma_memory_read(), we have to make sure that we byteswap the little endian data to the host's byte order. Signed-off-by: Thomas Huth --- hw/i386/intel_iommu.c | 5 + 1 file changed, 5 insertions(+) Maybe worth

Re: [PATCH 4/6] hw/i386/intel_iommu: Fix index calculation in vtd_interrupt_remap_msi()

2023-08-02 Thread Philippe Mathieu-Daudé
On 2/8/23 15:57, Thomas Huth wrote: The values in "addr" are populated locally in this function in host endian byte order, so we must not swap the index_l field here. Signed-off-by: Thomas Huth --- hw/i386/intel_iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by:

[PATCH v3 3/5] Refactor i.MX7 processor code

2023-08-02 Thread Jean-Christophe Dubois
* Add Addr and size definition for all i.MX7 devices in i.MX7 header file. * Use those newly defined named constants whenever possible. * Standardize the way we init a familly of unimplemented devices - SAI - PWM - CAN * Add/rework few comments Signed-off-by: Jean-Christophe Dubois ---

[PATCH v3 2/5] Add i.MX6UL TZ missing devices.

2023-08-02 Thread Jean-Christophe Dubois
* Add TZASC as unimplemented device. - Allow bare metal application to access this (unimplemented) device * Add CSU as unimplemented device. - Allow bare metal application to access this (unimplemented) device Signed-off-by: Jean-Christophe Dubois --- hw/arm/fsl-imx6ul.c | 12

[PATCH v3 5/5] Add i.MX7 SRC device implementation

2023-08-02 Thread Jean-Christophe Dubois
The SRC device is normaly used to start the secondary CPU. When running Linux directly, Qemu is emulating a PSCI interface that UBOOT is installing at boot time and therefore the fact that the SRC device is unimplemented is hidden as Qemu respond directly to PSCI requets without using the SRC

[PATCH v3 0/5] Complete i.MX6UL and i.MX7 processor for bare metal application.

2023-08-02 Thread Jean-Christophe Dubois
This patch adds a few unimplemented TZ devices (TZASC and CSU) to i.MX6UL and i.MX7 processors to avoid bare metal application to experiment "bus error" when acccessing these devices. It also adds some internal memory segments (OCRAM) to the i.MX7 to allow bare metal application to use them.

[PATCH v3 4/5] Add i.MX7 missing TZ devices and memory regions

2023-08-02 Thread Jean-Christophe Dubois
* Add TZASC as unimplemented device. - Allow bare metal application to access this (unimplemented) device * Add CSU as unimplemented device. - Allow bare metal application to access this (unimplemented) device * Add various memory segments - OCRAM - OCRAM EPDC - OCRAM PXP - OCRAM S -

[PATCH v3 1/5] Refactor i.MX6UL processor code

2023-08-02 Thread Jean-Christophe Dubois
* Add Addr and size definition for all i.MX6UL devices in i.MX6UL header file. * Use those newly defined named constants whenever possible. * Standardize the way we init a familly of unimplemented devices - SAI - PWM (add missing PWM instances) - CAN * Add/rework few comments Signed-off-by:

[PATCH v5 5/5] ebpf: Updated eBPF program and skeleton.

2023-08-02 Thread Andrew Melnychenko
Updated section name, so libbpf should init/gues proper program type without specifications during open/load. Also, added map_flags with explicitly declared BPF_F_MMAPABLE. Signed-off-by: Andrew Melnychenko --- ebpf/rss.bpf.skeleton.h | 1460 ---

[PATCH v5 3/5] virtio-net: Added property to load eBPF RSS with fds.

2023-08-02 Thread Andrew Melnychenko
eBPF RSS program and maps may now be passed during initialization. Initially was implemented for libvirt to launch qemu without permissions, and initialized eBPF program through the helper. Signed-off-by: Andrew Melnychenko --- hw/net/virtio-net.c| 55

[PATCH v5 2/5] ebpf: Added eBPF initialization by fds.

2023-08-02 Thread Andrew Melnychenko
It allows using file descriptors of eBPF provided outside of QEMU. QEMU may be run without capabilities for eBPF and run RSS program provided by management tool(g.e. libvirt). Signed-off-by: Andrew Melnychenko --- ebpf/ebpf_rss-stub.c | 6 ++ ebpf/ebpf_rss.c | 27

Re: sparc64 -- cannot get 'Hello World' to run

2023-08-02 Thread Philippe Mathieu-Daudé
Hi Frederick, On 2/8/23 22:36, Frederick Virchanza Gotham wrote: On Wed, Aug 2, 2023 at 11:04 AM Frederick Virchanza Gotham wrote: I can't get sparc64 to work at all though. Even I make a simple 'Hello World' program in C using only "puts", if I try to use qemu-user to run it, it crashes.

[PATCH v5 4/5] qmp: Added new command to retrieve eBPF blob.

2023-08-02 Thread Andrew Melnychenko
Now, the binary objects may be retrieved by id. It would require for future qmp commands that may require specific eBPF blob. Added command "request-ebpf". This command returns eBPF program encoded base64. The program taken from the skeleton and essentially is an ELF object that can be loaded in

[PATCH v5 1/5] ebpf: Added eBPF map update through mmap.

2023-08-02 Thread Andrew Melnychenko
Changed eBPF map updates through mmaped array. Mmaped arrays provide direct access to map data. It should omit using bpf_map_update_elem() call, which may require capabilities that are not present. Signed-off-by: Andrew Melnychenko --- ebpf/ebpf_rss.c | 117

[PATCH v5 0/5] eBPF RSS through QMP support.

2023-08-02 Thread Andrew Melnychenko
This series of patches provides the ability to retrieve eBPF program through qmp, so management application may load bpf blob with proper capabilities. Now, virtio-net devices can accept eBPF programs and maps through properties as external file descriptors. Access to the eBPF map is direct

Re: [PATCH v2 2/2] migration: Replace the return path retry logic

2023-08-02 Thread Peter Xu
On Wed, Aug 02, 2023 at 05:04:45PM -0300, Fabiano Rosas wrote: > Peter Xu writes: > > >> +if (await_return_path_close_on_source(s)) { > >> +trace_migration_return_path_pause_err(); > >> +return MIG_THR_ERR_FATAL; > >> +} > > > > I see that here on return

Re: [PATCH v2 1/2] migration: Split await_return_path_close_on_source

2023-08-02 Thread Peter Xu
On Wed, Aug 02, 2023 at 04:58:38PM -0300, Fabiano Rosas wrote: > Peter Xu writes: > > > On Wed, Aug 02, 2023 at 11:36:43AM -0300, Fabiano Rosas wrote: > >> This function currently has a straight-forward part which is waiting > >> for the thread to join and a complicated part which is doing a >

Re: [PATCH v6 7/8] linux-user: Optimize memory layout for static and dynamic executables

2023-08-02 Thread Helge Deller
On 8/2/23 21:57, Richard Henderson wrote: On 8/2/23 12:51, Helge Deller wrote: @@ -3159,7 +3140,7 @@ static void load_elf_image(const char *image_name, int image_fd,    */   load_addr = target_mmap(loaddr, (size_t)hiaddr - loaddr + 1, PROT_NONE,  

Re: [PATCH v2 2/2] migration: Replace the return path retry logic

2023-08-02 Thread Fabiano Rosas
Peter Xu writes: >> +if (await_return_path_close_on_source(s)) { >> +trace_migration_return_path_pause_err(); >> +return MIG_THR_ERR_FATAL; >> +} > > I see that here on return path failures we'll bail out, and actually it's > against the instinction (that

Re: [PATCH] Wrong unpacked structure for epoll_event on qemu-or1k (openrisc user-space)

2023-08-02 Thread Richard Henderson
On 8/2/23 12:55, Thomas Huth wrote: On 19/07/2023 14.38, Luca Bonissi wrote: On 19/07/23 10:49, Laurent Vivier wrote: According to linux/glibc sourced, epoll is only packed for x86_64. And, in recent glibc, also for i386, even it seems not necessary: even if the __alignof__(long long) is

Re: [PATCH v2 1/2] migration: Split await_return_path_close_on_source

2023-08-02 Thread Fabiano Rosas
Peter Xu writes: > On Wed, Aug 02, 2023 at 11:36:43AM -0300, Fabiano Rosas wrote: >> This function currently has a straight-forward part which is waiting >> for the thread to join and a complicated part which is doing a >> qemu_file_shutdown() on the return path file. >> >> The shutdown is

Re: [PATCH v6 7/8] linux-user: Optimize memory layout for static and dynamic executables

2023-08-02 Thread Richard Henderson
On 8/2/23 12:51, Helge Deller wrote: @@ -3159,7 +3140,7 @@ static void load_elf_image(const char *image_name, int image_fd,    */   load_addr = target_mmap(loaddr, (size_t)hiaddr - loaddr + 1, PROT_NONE,   MAP_PRIVATE | MAP_ANON | MAP_NORESERVE | -

Re: [PATCH v6 8/8] linux-user: Load pie executables at upper memory

2023-08-02 Thread Helge Deller
On 8/2/23 20:36, Richard Henderson wrote: On 8/1/23 16:27, Helge Deller wrote: +/* where to map binaries? */ +#if HOST_LONG_BITS == 64 && TARGET_ABI_BITS == 64 +# define TASK_UNMAPPED_BASE_PIE 0x55 +# define TASK_UNMAPPED_BASE    0x70 +#elif HOST_LONG_BITS == 64 &&

Re: [PATCH] Wrong unpacked structure for epoll_event on qemu-or1k (openrisc user-space)

2023-08-02 Thread Thomas Huth
On 19/07/2023 14.38, Luca Bonissi wrote: On 19/07/23 10:49, Laurent Vivier wrote: According to linux/glibc sourced, epoll is only packed for x86_64. And, in recent glibc, also for i386, even it seems not necessary: even if the __alignof__(long long) is 8, structures like epoll_event are

Re: [PATCH v1] Allowing setting and overriding parameters in smb.conf

2023-08-02 Thread Samuel Thibault
Henrik Carlqvist, le mar. 01 août 2023 23:27:25 +0200, a ecrit: > @@ -950,10 +953,11 @@ static int slirp_smb(SlirpState* s, const char > *exported_dir, > "printing = bsd\n" > "disable spoolss = yes\n" > "usershare max shares = 0\n" > -"[qemu]\n"

Re: [PATCH v6 7/8] linux-user: Optimize memory layout for static and dynamic executables

2023-08-02 Thread Helge Deller
On 8/2/23 20:25, Richard Henderson wrote: On 8/1/23 16:27, Helge Deller wrote: Reorganize the guest memory layout to get as much memory as possible for heap for the guest application. This patch optimizes the memory layout by loading pie executables into lower memory and shared libs into

Re: [PATCH v6 8/8] linux-user: Load pie executables at upper memory

2023-08-02 Thread Richard Henderson
On 8/1/23 16:27, Helge Deller wrote: +/* where to map binaries? */ +#if HOST_LONG_BITS == 64 && TARGET_ABI_BITS == 64 +# define TASK_UNMAPPED_BASE_PIE 0x55 +# define TASK_UNMAPPED_BASE0x70 +#elif HOST_LONG_BITS == 64 && TARGET_ABI_BITS == 32 +# define TASK_UNMAPPED_BASE_PIE

Re: [PULL 0/5] Misc fixes, for thread-pool, xen, and xen-emulate

2023-08-02 Thread Olaf Hering
Wed, 2 Aug 2023 18:18:01 +0300 Michael Tokarev : > Or if whole thing makes no sense to backport to stable, please > let me know as well. The xen-platform change does not need to be backported IMHO. Olaf pgpcgqotx9y5h.pgp Description: Digitale Signatur von OpenPGP

Re: [PATCH v6 7/8] linux-user: Optimize memory layout for static and dynamic executables

2023-08-02 Thread Richard Henderson
On 8/1/23 16:27, Helge Deller wrote: Reorganize the guest memory layout to get as much memory as possible for heap for the guest application. This patch optimizes the memory layout by loading pie executables into lower memory and shared libs into higher memory (at TASK_UNMAPPED_BASE). This

Re: [PATCH v2 2/3] linux-user: Emulate /proc/cpuinfo on aarch64 and arm

2023-08-02 Thread Richard Henderson
On 8/1/23 16:08, Helge Deller wrote: +#if defined(TARGET_AARCH64) || defined(TARGET_ARM) +static int open_cpuinfo(CPUArchState *cpu_env, int fd) +{ +const int is64 = TARGET_ABI_BITS == 64; +ARMCPU *cpu = ARM_CPU(thread_cpu); +uint64_t midr = cpu->midr; +const int rev = (midr &

[PATCH] target/riscv/kvm.c: fix mvendorid size in vcpu_set_machine_ids()

2023-08-02 Thread Daniel Henrique Barboza
cpu->cfg.mvendorid is a 32 bit field and kvm_set_one_reg() always write a target_ulong val, i.e. a 64 bit field in a 64 bit host. Given that we're passing a pointer to the mvendorid field, the reg is reading 64 bits starting from mvendorid and going 32 bits in the next field, marchid. Here's an

Re: [PATCH v3 08/17] i386: Support modules_per_die in X86CPUTopoInfo

2023-08-02 Thread Moger, Babu
Hi Zhao, On 8/1/23 05:35, Zhao Liu wrote: > From: Zhuocheng Ding > > Support module level in i386 cpu topology structure "X86CPUTopoInfo". > > Since x86 does not yet support the "clusters" parameter in "-smp", > X86CPUTopoInfo.modules_per_die is currently always 1. Therefore, the > module

[PATCH v2 0/6] target/arm: Fixes for RME

2023-08-02 Thread Jean-Philippe Brucker
A few patches to fix RME support and allow booting a realm guest, based on https://lore.kernel.org/qemu-devel/20230714154648.327466-1-peter.mayd...@linaro.org/ Since v1 I fixed patches 1, 2 and 6 following Peter's comments, and added patch 5. Patch 6 now factors the timer IRQ update into a new

[PATCH v2 5/6] target/arm/helper: Check SCR_EL3.{NSE, NS} encoding for AT instructions

2023-08-02 Thread Jean-Philippe Brucker
The AT instruction is UNDEFINED if the {NSE,NS} configuration is invalid. Add a function to check this on all AT instructions that apply to an EL lower than 3. Suggested-by: Peter Maydell Signed-off-by: Jean-Philippe Brucker --- target/arm/helper.c | 36 +--- 1

[PATCH v2 1/6] target/arm/ptw: Load stage-2 tables from realm physical space

2023-08-02 Thread Jean-Philippe Brucker
In realm state, stage-2 translation tables are fetched from the realm physical address space (R_PGRQD). Signed-off-by: Jean-Philippe Brucker --- target/arm/ptw.c | 26 ++ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/target/arm/ptw.c b/target/arm/ptw.c

[PATCH v2 3/6] target/arm: Skip granule protection checks for AT instructions

2023-08-02 Thread Jean-Philippe Brucker
GPC checks are not performed on the output address for AT instructions, as stated by ARM DDI 0487J in D8.12.2: When populating PAR_EL1 with the result of an address translation instruction, granule protection checks are not performed on the final output address of a successful translation.

[PATCH v2 6/6] target/arm/helper: Implement CNTHCTL_EL2.CNT[VP]MASK

2023-08-02 Thread Jean-Philippe Brucker
When FEAT_RME is implemented, these bits override the value of CNT[VP]_CTL_EL0.IMASK in Realm and Root state. Move the IRQ state update into a new gt_update_irq() function and test those bits every time we recompute the IRQ state. Since we're removing the IRQ state from some trace events, add a

[PATCH v2 4/6] target/arm: Pass security space rather than flag for AT instructions

2023-08-02 Thread Jean-Philippe Brucker
At the moment we only handle Secure and Nonsecure security spaces for the AT instructions. Add support for Realm and Root. For AArch64, arm_security_space() gives the desired space. ARM DDI0487J says (R_NYXTL): If EL3 is implemented, then when an address translation instruction that applies

[PATCH v2 2/6] target/arm/helper: Fix tlbmask and tlbbits for TLBI VAE2*

2023-08-02 Thread Jean-Philippe Brucker
When HCR_EL2.E2H is enabled, TLB entries are formed using the EL2&0 translation regime, instead of the EL2 translation regime. The TLB VAE2* instructions invalidate the regime that corresponds to the current value of HCR_EL2.E2H. At the moment we only invalidate the EL2 translation regime. This

Re: [PATCH v3 06/17] i386/cpu: Consolidate the use of topo_info in cpu_x86_cpuid()

2023-08-02 Thread Moger, Babu
Hi Zhao, On 8/1/23 05:35, Zhao Liu wrote: > From: Zhao Liu > > In cpu_x86_cpuid(), there are many variables in representing the cpu > topology, e.g., topo_info, cs->nr_cores/cs->nr_threads. > > Since the names of cs->nr_cores/cs->nr_threads does not accurately > represent its meaning, the use

[PATCH 0/3] target/m68k: Fix a few semihosting bugs

2023-08-02 Thread Keith Packard via
The first two patches mirror similar patches I recently sent for nios2. 1. Use correct parameter for EXIT (d1 instead of d0) 2. Fix use of deposit64 in LSEEK (argument order was incorrect) The second patch has also been submitted by Peter Maydell, it's included here because it was required to

Re: [PATCH] gdbstub: use 0 ("any process") on packets with no PID

2023-08-02 Thread Richard Henderson
On 8/2/23 04:04, Matheus Tavares Bernardino wrote: Ilya Leoshkevich wrote: On Tue, 2023-08-01 at 12:37 -0300, Matheus Tavares Bernardino wrote: Previously, qemu-user would always report PID 1 to GDB. This was changed at dc14a7a6e9 (gdbstub: Report the actual qemu-user pid, 2023-06-30), but

[PATCH 1/3] target/m68k: Pass semihosting arg to exit

2023-08-02 Thread Keith Packard via
Instead of using d0 (the semihost function number), use d1 (the provide exit status). Signed-off-by: Keith Packard --- target/m68k/m68k-semi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/m68k/m68k-semi.c b/target/m68k/m68k-semi.c index 88ad9ba814..12235759c7

[PATCH 3/3] target/m68k: Support semihosting on non-ColdFire targets

2023-08-02 Thread Keith Packard via
According to the m68k semihosting spec: "The instruction used to trigger a semihosting request depends on the m68k processor variant. On ColdFire, "halt" is used; on other processors (which don't implement "halt"), "bkpt #0" may be used." Add support for non-CodeFire processors by matching

Re: [PATCH v2 1/2] migration: Split await_return_path_close_on_source

2023-08-02 Thread Peter Xu
On Wed, Aug 02, 2023 at 11:36:43AM -0300, Fabiano Rosas wrote: > This function currently has a straight-forward part which is waiting > for the thread to join and a complicated part which is doing a > qemu_file_shutdown() on the return path file. > > The shutdown is tricky because all calls to

[PATCH 2/3] target/m68k: Fix semihost lseek offset computation

2023-08-02 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/m68k/m68k-semi.c | 2 +- 1 file changed, 1 insertion(+), 1

Re: [PATCH v8 14/15] crypto: Add SM4 constant parameter CK

2023-08-02 Thread Alistair Francis
On Tue, Jul 11, 2023 at 1:01 PM Max Chou wrote: > > Adds sm4_ck constant for use in sm4 cryptography across different targets. > > Signed-off-by: Max Chou > Reviewed-by: Frank Chang > Signed-off-by: Max Chou Reviewed-by: Alistair Francis Alistair > --- > crypto/sm4.c | 10

Re: [PATCH] Fix SEGFAULT on getting physical address of MMIO region.

2023-08-02 Thread Richard Henderson
On 8/2/23 06:08, Mikhail Tyutin wrote: The fix is to clear TLB_INVALID_MASK bit in tlb_addr, as it happens in other places e.g. load_helper(). Signed-off-by: Dmitriy Solovev Signed-off-by: Mikhail Tyutin ---  accel/tcg/cputlb.c | 2 +-  1 file changed, 1 insertion(+), 1 deletion(-) The

Re: [PATCH v2 2/2] migration: Replace the return path retry logic

2023-08-02 Thread Peter Xu
On Wed, Aug 02, 2023 at 11:36:44AM -0300, Fabiano Rosas wrote: > Replace the return path retry logic with finishing and restarting the > thread. This fixes a race when resuming the migration that leads to a > segfault. > > Currently when doing postcopy we consider that an IO error on the > return

Re: [PATCH v8 08/15] target/riscv: Add Zvbb ISA extension support

2023-08-02 Thread Alistair Francis
On Tue, Jul 11, 2023 at 1:00 PM Max Chou wrote: > > From: Dickon Hood > > This commit adds support for the Zvbb vector-crypto extension, which > consists of the following instructions: > > * vrol.[vv,vx] > * vror.[vv,vx,vi] > * vbrev8.v > * vrev8.v > * vandn.[vv,vx] > * vbrev.v > * vclz.v > *

Re: [PATCH 4/8] gitlab: drop $CI_PROJECT_DIR from cache path

2023-08-02 Thread Thomas Huth
On 01/08/2023 15.03, Daniel P. Berrangé wrote: The gitlab cache is limited to only handle content within the $CI_PROJECT_DIR hierarchy, and as such relative paths are always implicitly relative to $CI_PROJECT_DIR. Signed-off-by: Daniel P. Berrangé --- .gitlab-ci.d/windows.yml | 2 +- 1 file

Re: [PATCH 5/8] gitlab: always populate cache for windows msys jobs

2023-08-02 Thread Thomas Huth
On 01/08/2023 15.04, Daniel P. Berrangé wrote: The cache is used to hold the msys installer. Even if the build phase fails, we should still populate the cache as the installer will be valid for next time. Signed-off-by: Daniel P. Berrangé --- .gitlab-ci.d/windows.yml | 1 + 1 file changed,

  1   2   3   >