Re: [PATCH] vdpa: fix gcc cvq_isolated uninitialized variable warning

2023-09-14 Thread Jason Wang
On Tue, Sep 12, 2023 at 5:54 AM Stefan Hajnoczi wrote: > > gcc 13.2.1 emits the following warning: > > net/vhost-vdpa.c: In function ‘net_vhost_vdpa_init.constprop’: > net/vhost-vdpa.c:1394:25: error: ‘cvq_isolated’ may be used uninitialized > [-Werror=maybe-uninitialized] >1394 |

Re: [PATCH v3 14/14] RFC tcg/ppc: Disable TCG_REG_TB for Power9/Power10

2023-09-14 Thread Jordan Niethe
On Wed, Aug 16, 2023 at 5:57 AM Richard Henderson wrote: > > This may or may not improve performance. > It appears to result in slightly larger code, > but perhaps not enough to matter. I have collected some power9 macro performance data for an smp compile workload: Setup - - Power9

Re: [RFC PATCH v2 02/21] RAMBlock: Add support of KVM private gmem

2023-09-14 Thread Xiaoyao Li
On 9/15/2023 10:04 AM, Wang, Lei wrote: On 9/14/2023 11:50, Xiaoyao Li wrote: From: Chao Peng Add KVM gmem support to RAMBlock so both normal hva based memory and kvm gmem fd based private memory can be associated in one RAMBlock. Introduce new flag RAM_KVM_GMEM. It calls KVM ioctl to create

Re: [RFC PATCH v2 00/21] QEMU gmem implemention

2023-09-14 Thread Xiaoyao Li
On 9/14/2023 9:09 PM, David Hildenbrand wrote: On 14.09.23 05:50, Xiaoyao Li wrote: It's the v2 RFC of enabling KVM gmem[1] as the backend for private memory. For confidential-computing, KVM provides gmem/guest_mem interfaces for userspace, like QEMU, to allocate user-unaccesible private

Re: [PATCH v2 1/1] migration: skip poisoned memory pages on "ram saving" phase

2023-09-14 Thread Zhijian Li (Fujitsu)
On 15/09/2023 04:20, “William Roche wrote: > From: William Roche > > A memory page poisoned from the hypervisor level is no longer readable. > Thus, it is now treated as a zero-page for the ram saving migration phase. > > The migration of a VM will crash Qemu when it tries to read the >

RE: [PATCH v1 02/22] Update linux-header to support iommufd cdev and hwpt alloc

2023-09-14 Thread Duan, Zhenzhong
Hi Eric, >-Original Message- >From: Eric Auger >Sent: Thursday, September 14, 2023 10:46 PM >Subject: Re: [PATCH v1 02/22] Update linux-header to support iommufd cdev and >hwpt alloc > >Hi Zhenzhong, > >On 8/30/23 12:37, Zhenzhong Duan wrote: >> From

Re: [PATCH v2] target/riscv: update checks on writing pmpcfg for Smepmp version 1.0

2023-09-14 Thread 張哲嘉
> On Fri, Sep 08, 2023 at 04:38:34PM +0800, Alvin Chang wrote: > > Current checks on writing pmpcfg for Smepmp follows Smepmp version > > 0.9.1. However, Smepmp specification has already been ratified, and > > there are some differences between version 0.9.1 and 1.0. In this > > commit we

Re: [PATCH v2 04/10] Introduce the CPU address space destruction function

2023-09-14 Thread lixianglai
Hi David Hildenbrand: Hi David Hildenbrand: On 14.09.23 15:00, lixianglai wrote: Hi David: Hi! On 12.09.23 04:11, xianglai li wrote: Introduce new function to destroy CPU address space resources for cpu hot-(un)plug. How do other archs handle that? Or how are they able to get away

Re: [PATCH v2 04/10] Introduce the CPU address space destruction function

2023-09-14 Thread lixianglai
Hi David Hildenbrand: On 14.09.23 15:00, lixianglai wrote: Hi David: Hi! On 12.09.23 04:11, xianglai li wrote: Introduce new function to destroy CPU address space resources for cpu hot-(un)plug. How do other archs handle that? Or how are they able to get away without destroying?

[PATCH v1 0/4] vfio: report NUMA nodes for device memory

2023-09-14 Thread ankita
From: Ankit Agrawal For devices which allow CPU to cache coherently access their memory, it is sensible to expose such memory as NUMA nodes separate from the sysmem node. Qemu currently do not provide a mechanism for creation of NUMA nodes associated with a vfio-pci device. Implement a

[PATCH v1 1/4] vfio: new command line params for device memory NUMA nodes

2023-09-14 Thread ankita
From: Ankit Agrawal The CPU cache coherent device memory can be added as a set of NUMA nodes distinct from the system memory nodes. The Qemu currently do not provide a mechanism to support node creation for a vfio-pci device. Introduce new command line parameters to allow host admin provide the

[PATCH v1 4/4] acpi/gpex: patch guest DSDT for dev mem information

2023-09-14 Thread ankita
From: Ankit Agrawal To add the memory in the guest as NUMA nodes, it needs the PXM node index and the total count of nodes associated with the memory. The range of proximity domains are communicated to the VM as part of the guest ACPI using the nvidia,gpu-mem-pxm-start and

[PATCH v1 3/4] hw/arm/virt-acpi-build: patch guest SRAT for NUMA nodes

2023-09-14 Thread ankita
From: Ankit Agrawal During bootup, Linux kernel parse the ACPI SRAT to determine the PXM ids. This allows for the creation of NUMA nodes for each unique id. Insert a series of the unique PXM ids in the VM SRAT ACPI table. The range of nodes can be determined from the "dev_mem_pxm_start" and

[PATCH v1 2/4] vfio: assign default values to node params

2023-09-14 Thread ankita
From: Ankit Agrawal It may be desirable for some deployments to have QEMU automatically pick a range and create the NUMA nodes. So the admin need not care about passing any additional params. Another advantage is that the feature is not dependent on newer libvirt that support the new parameters

Re: [RFC PATCH v2 02/21] RAMBlock: Add support of KVM private gmem

2023-09-14 Thread Wang, Lei
On 9/14/2023 11:50, Xiaoyao Li wrote: > From: Chao Peng > > Add KVM gmem support to RAMBlock so both normal hva based memory > and kvm gmem fd based private memory can be associated in one RAMBlock. > > Introduce new flag RAM_KVM_GMEM. It calls KVM ioctl to create private > gmem for the

Re: QEMU migration-test CI intermittent failure

2023-09-14 Thread Fabiano Rosas
Peter Xu writes: > On Thu, Sep 14, 2023 at 07:54:17PM -0300, Fabiano Rosas wrote: >> Fabiano Rosas writes: >> >> > Peter Xu writes: >> > >> >> On Thu, Sep 14, 2023 at 12:57:08PM -0300, Fabiano Rosas wrote: >> >>> I managed to reproduce it. It's not the return path error. In hindsight >> >>>

Re: [PATCH 4/4] target/ppc: Add migration support for BHRB

2023-09-14 Thread Nicholas Piggin
On Wed Sep 13, 2023 at 6:25 AM AEST, Glenn Miles wrote: > Adds migration support for Branch History Rolling > Buffer (BHRB) internal state. > > Signed-off-by: Glenn Miles > --- > target/ppc/machine.c | 23 +++ > 1 file changed, 23 insertions(+) > > diff --git

Re: [PATCH 3/4] target/ppc: Add clrbhrb and mfbhrbe instructions

2023-09-14 Thread Nicholas Piggin
On Wed Sep 13, 2023 at 6:24 AM AEST, Glenn Miles wrote: > Add support for the clrbhrb and mfbhrbe instructions. > > Since neither instruction is believed to be critical to > performance, both instructions were implemented using helper > functions. > > Access to both instructions is controlled by

Re: [RFC PATCH v2 00/21] QEMU gmem implemention

2023-09-14 Thread Sean Christopherson
On Thu, Sep 14, 2023, David Hildenbrand wrote: > On 14.09.23 05:50, Xiaoyao Li wrote: > > It's the v2 RFC of enabling KVM gmem[1] as the backend for private > > memory. > > > > For confidential-computing, KVM provides gmem/guest_mem interfaces for > > userspace, like QEMU, to allocate

Re: [PATCH 2/4] target/ppc: Add recording of taken branches to BHRB

2023-09-14 Thread Nicholas Piggin
On Wed Sep 13, 2023 at 6:24 AM AEST, Glenn Miles wrote: > This commit continues adding support for the Branch History > Rolling Buffer (BHRB) as is provided starting with the P8 > processor and continuing with its successors. This commit > is limited to the recording and filtering of taken

Re: [PATCH 1/4] target/ppc: Add new hflags to support BHRB

2023-09-14 Thread Nicholas Piggin
On Wed Sep 13, 2023 at 6:23 AM AEST, Glenn Miles wrote: > This commit is preparatory to the addition of Branch History > Rolling Buffer (BHRB) functionality, which is being provided > today starting with the P8 processor. > > BHRB uses several SPR register fields to control whether or not > a

Re: [RFC PATCH 0/8] i386/sev: Use C API of Rust SEV library

2023-09-14 Thread Tyler Fanelli
On 9/14/23 3:04 PM, Philippe Mathieu-Daudé wrote: Hi Tyler, On 14/9/23 19:58, Tyler Fanelli wrote: These patches are submitted as an RFC mainly because I'm a relative newcomer to QEMU with no knowledge of the community's views on including Rust code, nor it's preference of using library APIs

Re: [PATCH] tests/avocado: Fix console data loss

2023-09-14 Thread Nicholas Piggin
On Wed Sep 13, 2023 at 6:51 PM AEST, Alex Bennée wrote: > > Nicholas Piggin writes: > > > Occasionally some avocado tests will fail waiting for console line > > despite the machine running correctly. Console data goes missing, as can > > be seen in the console log. This is due to

Re: QEMU migration-test CI intermittent failure

2023-09-14 Thread Peter Xu
On Thu, Sep 14, 2023 at 07:54:17PM -0300, Fabiano Rosas wrote: > Fabiano Rosas writes: > > > Peter Xu writes: > > > >> On Thu, Sep 14, 2023 at 12:57:08PM -0300, Fabiano Rosas wrote: > >>> I managed to reproduce it. It's not the return path error. In hindsight > >>> that's obvious because that

Re: QEMU migration-test CI intermittent failure

2023-09-14 Thread Fabiano Rosas
Fabiano Rosas writes: > Peter Xu writes: > >> On Thu, Sep 14, 2023 at 12:57:08PM -0300, Fabiano Rosas wrote: >>> I managed to reproduce it. It's not the return path error. In hindsight >>> that's obvious because that error happens in the 'recovery' test and this >>> one in the 'plain' one.

[PATCH 0/1] hw/arm/sse-timer: Add CNTFRQ reset property

2023-09-14 Thread Joe Komlodi
Hi all, This patch just adds an object property to initialize the reset value of CNTFRQ. We noticed that Linux would complain that CNTFRQ would have a mismatch compared to an expected value, and this was because TF-A was assuming that CNTFRQ was initialized to a different value out of reset.

[PATCH 1/1] hw/timer/sse-timer: Add CNTFRQ reset property

2023-09-14 Thread Joe Komlodi
This can have a non-zero reset value, and cause the kernel to complain about a CNTFRQ mismatch if TF-A (or firmware in general) does not initialize it (because it expects the value to be non-zero out of reset). To fix this, we'll just add an object property that people can use to initialize the

Re: [PULL 3/5] hw/ufs: Support for Query Transfer Requests

2023-09-14 Thread Jeuk Kim
On 23. 9. 14. 23:40, Peter Maydell wrote: On Thu, 7 Sept 2023 at 19:17, Stefan Hajnoczi wrote: From: Jeuk Kim This commit makes the UFS device support query and nop out transfer requests. The next patch would be support for UFS logical unit and scsi command transfer request.

Re: [PULL 4/5] hw/ufs: Support for UFS logical unit

2023-09-14 Thread Jeuk Kim
On 23. 9. 15. 02:31, Paolo Bonzini wrote: On 9/7/23 20:16, Stefan Hajnoczi wrote: From: Jeuk Kim This commit adds support for ufs logical unit. The LU handles processing for the SCSI command, unit descriptor query request. This commit enables the UFS device to process IO requests.

Re: [PATCH v2 0/1] Qemu crashes on VM migration after an handled memory error

2023-09-14 Thread Peter Xu
On Thu, Sep 14, 2023 at 08:20:53PM +, “William Roche wrote: > From: William Roche > > A Qemu VM can survive a memory error, as qemu can relay the error to the > VM kernel which could also deal with it -- poisoning/off-lining the impacted > page. > This situation creates a hole in the VM

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

2023-09-14 Thread Andrey Drobyshev
On 9/15/23 00:17, Eric Blake wrote: > On Fri, Sep 08, 2023 at 12:02:26AM +0300, 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

Re: [PATCH] target/hppa: Optimize ldcw/ldcd instruction translation

2023-09-14 Thread Helge Deller
Hi Richard, On 9/13/23 22:30, Richard Henderson wrote: On 9/13/23 10:19, Helge Deller wrote: On 9/13/23 18:55, Richard Henderson wrote: On 9/13/23 07:47, Helge Deller wrote: +    haddr = (uint32_t *)((uintptr_t)vaddr); +    old = *haddr; This is horribly incorrect, both for

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

2023-09-14 Thread Eric Blake
On Fri, Sep 08, 2023 at 12:02:26AM +0300, 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 output > mode is

Re: QEMU migration-test CI intermittent failure

2023-09-14 Thread Fabiano Rosas
Peter Xu writes: > On Thu, Sep 14, 2023 at 12:57:08PM -0300, Fabiano Rosas wrote: >> I managed to reproduce it. It's not the return path error. In hindsight >> that's obvious because that error happens in the 'recovery' test and this >> one in the 'plain' one. Sorry about the noise. > > No

Re: [PATCH v4 02/14] simpletrace: annotate magic constants from QEMU code

2023-09-14 Thread Stefan Hajnoczi
On Wed, Aug 23, 2023 at 10:54:17AM +0200, Mads Ynddal wrote: > From: Mads Ynddal > > It wasn't clear where the constants and structs came from, so I added > comments to help. > > Signed-off-by: Mads Ynddal > --- > scripts/simpletrace.py | 5 + > 1 file changed, 5 insertions(+)

Re: [PATCH v4 01/14] simpletrace: add __all__ to define public interface

2023-09-14 Thread Stefan Hajnoczi
On Wed, Aug 23, 2023 at 10:54:16AM +0200, Mads Ynddal wrote: > From: Mads Ynddal > > It was unclear what was the supported public interface. I.e. when > refactoring the code, what functions/classes are important to retain. > > Signed-off-by: Mads Ynddal > --- > scripts/simpletrace.py | 2 ++ >

Re: [PATCH v6 3/3] hw/nvme: add nvme management interface model

2023-09-14 Thread Corey Minyard
On Thu, Sep 14, 2023 at 11:53:43AM +0200, Klaus Jensen wrote: > From: Klaus Jensen > > Add the 'nmi-i2c' device that emulates an NVMe Management Interface > controller. > > Initial support is very basic (Read NMI DS, Configuration Get). > > This is based on previously posted code by Padmakar

Re: [PATCH v6 2/3] hw/i2c: add mctp core

2023-09-14 Thread Corey Minyard
On Thu, Sep 14, 2023 at 11:53:42AM +0200, Klaus Jensen wrote: > From: Klaus Jensen > > Add an abstract MCTP over I2C endpoint model. This implements MCTP > control message handling as well as handling the actual I2C transport > (packetization). > > Devices are intended to derive from this and

Re: [PATCH v6 1/3] hw/i2c: add smbus pec utility function

2023-09-14 Thread Corey Minyard
On Thu, Sep 14, 2023 at 11:53:41AM +0200, Klaus Jensen wrote: > From: Klaus Jensen > > Add i2c_smbus_pec() to calculate the SMBus Packet Error Code for a > message. Seems fine. Acked-by: Corey Minyard > > Reviewed-by: Jonathan Cameron > Signed-off-by: Klaus Jensen > --- >

[PATCH v5 11/23] bsd-user: Introduce bsd-mem.h to the source tree

2023-09-14 Thread Karim Taha
From: Stacey Son Preserve the copyright notice and help with the 'Author' info for subsequent changes to the file. Signed-off-by: Stacey Son Signed-off-by: Karim Taha Reviewed-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/bsd-mem.h| 64

[PATCH v5 08/23] bsd-user: Implement target_set_brk function in bsd-mem.c instead of os-syscall.c

2023-09-14 Thread Karim Taha
From: Stacey Son The definitions and variables names matches the corresponding ones in linux-user/syscall.c, for making later implementation of do_obreak easier Co-authored-by: Mikaël Urankar Signed-off-by: Mikaël Urankar Signed-off-by: Karim Taha Reviewed-by: Warner Losh Reviewed-by:

[PATCH v5 10/23] bsd-user: Implement shmid_ds conversion between host and target.

2023-09-14 Thread Karim Taha
From: Stacey Son Signed-off-by: Stacey Son Signed-off-by: Karim Taha Reviewed-by: Richard Henderson --- bsd-user/bsd-mem.c | 47 ++ 1 file changed, 47 insertions(+) diff --git a/bsd-user/bsd-mem.c b/bsd-user/bsd-mem.c index 46cda8eb5c..2ab1334b70

[PATCH v5 20/23] bsd-user: Implement shm_unlink(2) and shmget(2)

2023-09-14 Thread Karim Taha
From: Stacey Son Signed-off-by: Stacey Son Signed-off-by: Karim Taha Reviewed-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/bsd-mem.h| 23 +++ bsd-user/freebsd/os-syscall.c | 8 2 files changed, 31 insertions(+) diff --git

[PATCH v5 12/23] bsd-user: Implement mmap(2) and munmap(2)

2023-09-14 Thread Karim Taha
From: Stacey Son Signed-off-by: Stacey Son Signed-off-by: Karim Taha Reviewed-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/bsd-mem.h| 20 bsd-user/freebsd/os-syscall.c | 9 + 2 files changed, 29 insertions(+) diff --git

[PATCH v5 13/23] bsd-user: Implement mprotect(2)

2023-09-14 Thread Karim Taha
From: Stacey Son Signed-off-by: Stacey Son Signed-off-by: Karim Taha Reviewed-by: Richard Henderson Reviewed-by: Warner Losh --- bsd-user/bsd-mem.h| 7 +++ bsd-user/freebsd/os-syscall.c | 4 2 files changed, 11 insertions(+) diff --git a/bsd-user/bsd-mem.h

[PATCH v5 17/23] bsd-user: Implement mincore(2)

2023-09-14 Thread Karim Taha
From: Stacey Son Signed-off-by: Stacey Son Signed-off-by: Karim Taha Reviewed-by: Richard Henderson --- bsd-user/bsd-mem.h| 23 +++ bsd-user/freebsd/os-syscall.c | 4 2 files changed, 27 insertions(+) diff --git a/bsd-user/bsd-mem.h b/bsd-user/bsd-mem.h

[PATCH v5 22/23] bsd-user: Implement shmat(2) and shmdt(2)

2023-09-14 Thread Karim Taha
From: Stacey Son Use `WITH_MMAP_LOCK_GUARD` instead of mmap_lock() and mmap_unlock(), to match linux-user implementation, according to the following commits: 69fa2708a216df715ba5102a0f98468b540a464e linux-user: Use WITH_MMAP_LOCK_GUARD in target_{shmat,shmdt}

[PATCH v5 19/23] bsd-user: Implement shm_open(2)

2023-09-14 Thread Karim Taha
From: Stacey Son Co-authored-by: Kyle Evans Signed-off-by: Stacey Son Signed-off-by: Kyle Evans Signed-off-by: Karim Taha Reviewed-by: Richard Henderson --- bsd-user/bsd-mem.h| 25 + bsd-user/freebsd/os-syscall.c | 4 2 files changed, 29

[PATCH v5 09/23] bsd-user: Implement ipc_perm conversion between host and target.

2023-09-14 Thread Karim Taha
From: Stacey Son Signed-off-by: Stacey Son Signed-off-by: Karim Taha Reviewed-by: Richard Henderson --- bsd-user/bsd-mem.c | 25 + 1 file changed, 25 insertions(+) diff --git a/bsd-user/bsd-mem.c b/bsd-user/bsd-mem.c index 8834ab2e58..46cda8eb5c 100644 ---

[PATCH v5 14/23] bsd-user: Implement msync(2)

2023-09-14 Thread Karim Taha
From: Stacey Son Co-authored-by: Kyle Evans Signed-off-by: Stacey Son Signed-off-by: Kyle Evans Signed-off-by: Karim Taha Reviewed-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/bsd-mem.h| 11 +++ bsd-user/freebsd/os-syscall.c | 4 2 files changed,

[PATCH v5 23/23] bsd-user: Add stubs for vadvise(), sbrk() and sstk()

2023-09-14 Thread Karim Taha
From: Warner Losh The above system calls are not supported by qemu. Signed-off-by: Warner Losh Signed-off-by: Karim Taha Reviewed-by: Richard Henderson --- bsd-user/bsd-mem.h| 18 ++ bsd-user/freebsd/os-syscall.c | 12 2 files changed, 30

[PATCH v5 16/23] bsd-user: Implment madvise(2) to match the linux-user implementation.

2023-09-14 Thread Karim Taha
Signed-off-by: Karim Taha Reviewed-by: Richard Henderson --- bsd-user/bsd-mem.h| 53 +++ bsd-user/freebsd/os-syscall.c | 4 +++ bsd-user/syscall_defs.h | 2 ++ 3 files changed, 59 insertions(+) diff --git a/bsd-user/bsd-mem.h

[PATCH v5 05/23] bsd-user: Implement shm_open2(2) system call

2023-09-14 Thread Karim Taha
Signed-off-by: Kyle Evans Signed-off-by: Karim Taha Reviewed-by: Richard Henderson --- bsd-user/freebsd/os-misc.h| 42 +++ bsd-user/freebsd/os-syscall.c | 10 + 2 files changed, 52 insertions(+) diff --git a/bsd-user/freebsd/os-misc.h

[PATCH v5 15/23] bsd-user: Implement mlock(2), munlock(2), mlockall(2), munlockall(2), minherit(2)

2023-09-14 Thread Karim Taha
From: Stacey Son Signed-off-by: Stacey Son Signed-off-by: Karim Taha Reviewed-by: Richard Henderson --- bsd-user/bsd-mem.h| 37 +++ bsd-user/freebsd/os-syscall.c | 20 +++ 2 files changed, 57 insertions(+) diff --git

[PATCH v5 04/23] bsd-user: Introduce freebsd/os-misc.h to the source tree

2023-09-14 Thread Karim Taha
From: Stacey Son To preserve the copyright notice and help with the 'Author' info for subsequent changes to the file. Signed-off-by: Stacey Son Signed-off-by: Karim Taha Reviewed-by: Richard Henderson Reviewed-by: Warner Losh --- bsd-user/freebsd/os-misc.h | 28

[PATCH v5 03/23] bsd-user: Declarations for ipc_perm and shmid_ds conversion functions

2023-09-14 Thread Karim Taha
From: Stacey Son Signed-off-by: Stacey Son Signed-off-by: Karim Taha Reviewed-by: Richard Henderson Reviewed-by: Warner Losh --- bsd-user/qemu-bsd.h | 45 + 1 file changed, 45 insertions(+) create mode 100644 bsd-user/qemu-bsd.h diff --git

[PATCH v5 06/23] bsd-user: Implement shm_rename(2) system call

2023-09-14 Thread Karim Taha
From: Kyle Evans Signed-off-by: Kyle Evans Signed-off-by: Karim Taha Reviewed-by: Richard Henderson Reviewed-by: Warner Losh --- bsd-user/freebsd/os-misc.h| 24 bsd-user/freebsd/os-syscall.c | 6 ++ 2 files changed, 30 insertions(+) diff --git

[PATCH v5 21/23] bsd-user: Implement shmctl(2)

2023-09-14 Thread Karim Taha
From: Stacey Son Signed-off-by: Stacey Son Signed-off-by: Karim Taha Reviewed-by: Richard Henderson --- bsd-user/bsd-mem.h| 39 +++ bsd-user/freebsd/os-syscall.c | 4 2 files changed, 43 insertions(+) diff --git a/bsd-user/bsd-mem.h

[PATCH v5 00/23] bsd-user: Implement mmap related system calls for FreeBSD.

2023-09-14 Thread Karim Taha
Upstream the implementation of the following mmap system calls, from the qemu-bsd-user fork: mmap(2), munmap(2), mprotect(2), msync(2), mlock(2), munlock(2), mlockall(2), munlockall(2), mincore(2), madvise(2), minherit(2), shm_open(2),shm_open2(2), shm_rename2(2),

[PATCH v5 07/23] bsd-user: Add bsd-mem.c to meson.build

2023-09-14 Thread Karim Taha
Signed-off-by: Karim Taha Reviewed-by: Richard Henderson Reviewed-by: Warner Losh --- bsd-user/bsd-mem.c | 0 bsd-user/meson.build | 1 + 2 files changed, 1 insertion(+) create mode 100644 bsd-user/bsd-mem.c diff --git a/bsd-user/bsd-mem.c b/bsd-user/bsd-mem.c new file mode 100644 index

[PATCH v5 18/23] bsd-user: Implement do_obreak function

2023-09-14 Thread Karim Taha
From: Stacey Son Match linux-user, by manually applying the following commits, in order: d28b3c90cfad1a7e211ae2bce36ecb9071086129 linux-user: Make sure initial brk(0) is page-aligned 15ad98536ad9410fb32ddf1ff09389b677643faa linux-user: Fix qemu brk() to not zero bytes on current page

[PATCH v5 02/23] bsd-user: Implement struct target_shmid_ds

2023-09-14 Thread Karim Taha
From: Stacey Son Signed-off-by: Stacey Son Signed-off-by: Karim Taha Reviewed-by: Richard Henderson Reviewed-by: Warner Losh --- bsd-user/syscall_defs.h | 20 1 file changed, 20 insertions(+) diff --git a/bsd-user/syscall_defs.h b/bsd-user/syscall_defs.h index

[PATCH v5 01/23] bsd-user: Implement struct target_ipc_perm

2023-09-14 Thread Karim Taha
From: Stacey Son Signed-off-by: Stacey Son Signed-off-by: Karim Taha Reviewed-by: Richard Henderson Reviewed-by: Warner Losh --- bsd-user/syscall_defs.h | 17 + 1 file changed, 17 insertions(+) diff --git a/bsd-user/syscall_defs.h b/bsd-user/syscall_defs.h index

[PATCH] pc-bios/canyonlands.dts: Fix some DeviceTree warnings

2023-09-14 Thread Philippe Mathieu-Daudé
canyonlands.dts was imported in 2018, in commit 4b387f9ee1 ("ppc: Add aCube Sam460ex board"). The file content is based on Linux file arch/powerpc/boot/dts/canyonlands.dts from commit 5edc2aae16bc. Then Linux added 2 commits on top: - 86bc917d2ac1 ("powerpc/boot/dts: Fix dtc "pciex" warnings") -

Re: [PATCH v3 5/5] vfio-user: Fix config space access byte order

2023-09-14 Thread Philippe Mathieu-Daudé
On 7/9/23 15:04, Mattias Nissler wrote: PCI config space is little-endian, so on a big-endian host we need to perform byte swaps for values as they are passed to and received from the generic PCI config space access machinery. Signed-off-by: Mattias Nissler --- hw/remote/vfio-user-obj.c | 4

Re: [PATCH v3 5/5] vfio-user: Fix config space access byte order

2023-09-14 Thread Stefan Hajnoczi
On Thu, Sep 07, 2023 at 06:04:10AM -0700, Mattias Nissler wrote: > PCI config space is little-endian, so on a big-endian host we need to > perform byte swaps for values as they are passed to and received from > the generic PCI config space access machinery. > > Signed-off-by: Mattias Nissler >

[PATCH v2 0/1] Qemu crashes on VM migration after an handled memory error

2023-09-14 Thread “William Roche
From: William Roche A Qemu VM can survive a memory error, as qemu can relay the error to the VM kernel which could also deal with it -- poisoning/off-lining the impacted page. This situation creates a hole in the VM memory address space that the VM kernel knows about (an unreadable page or set

[PATCH v2 1/1] migration: skip poisoned memory pages on "ram saving" phase

2023-09-14 Thread “William Roche
From: William Roche A memory page poisoned from the hypervisor level is no longer readable. Thus, it is now treated as a zero-page for the ram saving migration phase. The migration of a VM will crash Qemu when it tries to read the memory address space and stumbles on the poisoned page with a

[RFC PATCH 4/8] i386/sev: Replace UPDATE_DATA ioctl with sev library equivalent

2023-09-14 Thread Tyler Fanelli
UPDATE_DATA takes the VM's file descriptor, a guest memory region to be encrypted, as well as the size of the aforementioned guest memory region. If this API ioctl call fails, fw_error will be set accordingly. Signed-off-by: Tyler Fanelli --- target/i386/sev.c | 31

[RFC PATCH 8/8] i386/sev: Replace LAUNCH_FINISH ioctl with sev library equivalent

2023-09-14 Thread Tyler Fanelli
The LAUNCH_FINISH ioctl finishes the guest launch flow and transitions the guest into a state ready to be run. If this API ioctl call fails, fw_error will be set accordingly. Signed-off-by: Tyler Fanelli --- target/i386/sev.c | 38 -- 1 file changed, 16

[RFC PATCH 7/8] i386/sev: Replace LAUNCH_SECRET ioctl with sev library equivalent

2023-09-14 Thread Tyler Fanelli
The LAUNCH_SECRET API can inject a secret into the VM once the measurement has been retrieved. If this API ioctl call fails, fw_error will be set accordingly. Signed-off-by: Tyler Fanelli --- target/i386/sev.c | 105 -- target/i386/sev.h | 2 - 2

[RFC PATCH 6/8] i386/sev: Replace LAUNCH_MEASURE ioctl with sev library equivalent

2023-09-14 Thread Tyler Fanelli
The LAUNCH_MEASURE API returns the measurement of the launched guest's memory pages (and VMCB save areas if ES is enabled). The caller is responsible for ensuring that the pointer (identified as the "data" argument) is a valid pointer that can hold the guest's measurement (a measurement in SEV is

[RFC PATCH 1/8] Add SEV Rust library as dependency with CONFIG_SEV

2023-09-14 Thread Tyler Fanelli
The Rust sev library provides a type-safe implementation of the AMD Secure Encrypted Virtualization (SEV) APIs. Signed-off-by: Tyler Fanelli --- meson.build | 7 +++ meson_options.txt | 2 ++ scripts/meson-buildoptions.sh | 3 +++ target/i386/meson.build

[RFC PATCH 3/8] i386/sev: Replace LAUNCH_START ioctl with sev library equivalent

2023-09-14 Thread Tyler Fanelli
The sev library offers an equivalent API for SEV_LAUNCH_START. The library contains some internal state for each VM it's currently running, and organizes the internal state for each VM via it's file descriptor. Therefore, the VM's file descriptor must be provided as input. If this API ioctl call

[RFC PATCH 0/8] i386/sev: Use C API of Rust SEV library

2023-09-14 Thread Tyler Fanelli
These patches are submitted as an RFC mainly because I'm a relative newcomer to QEMU with no knowledge of the community's views on including Rust code, nor it's preference of using library APIs for ioctls that were previously implemented in QEMU directly. Recently, the Rust sev library [0] has

[RFC PATCH 5/8] i386/sev: Replace LAUNCH_UPDATE_VMSA ioctl with sev library equivalent

2023-09-14 Thread Tyler Fanelli
The LAUNCH_UPDATE_VMSA API takes the VM's file descriptor, as well as a field for any firmware errors as input. If this API ioctl call fails, fw_error will be set accordingly. Signed-off-by: Tyler Fanelli --- target/i386/sev.c | 29 + 1 file changed, 9

[RFC PATCH 2/8] i386/sev: Replace INIT and ES_INIT ioctls with sev library equivalents

2023-09-14 Thread Tyler Fanelli
The sev library offers APIs for SEV_INIT and SEV_ES_INIT, both taking the file descriptors of the encrypting VM and /dev/sev as input. If this API ioctl call fails, fw_error will be set accordingly. Signed-off-by: Tyler Fanelli --- target/i386/sev.c| 14 +-

[PATCH v4 22/23] bsd-user: Implement shmat(2) and shmdt(2)

2023-09-14 Thread Karim Taha
From: Stacey Son Use `WITH_MMAP_LOCK_GUARD` instead of mmap_lock() and mmap_unlock(), to match linux-user implementation, according to the following commits: 69fa2708a216df715ba5102a0f98468b540a464e linux-user: Use WITH_MMAP_LOCK_GUARD in target_{shmat,shmdt}

[PATCH v4 14/23] bsd-user: Implement msync(2)

2023-09-14 Thread Karim Taha
From: Stacey Son Co-authored-by: Kyle Evans Signed-off-by: Stacey Son Signed-off-by: Kyle Evans Signed-off-by: Karim Taha Reviewed-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/bsd-mem.h| 11 +++ bsd-user/freebsd/os-syscall.c | 4 2 files changed,

[PATCH v4 15/23] bsd-user: Implement mlock(2), munlock(2), mlockall(2), munlockall(2), minherit(2)

2023-09-14 Thread Karim Taha
From: Stacey Son Signed-off-by: Stacey Son Signed-off-by: Karim Taha Reviewed-by: Richard Henderson --- bsd-user/bsd-mem.h| 37 +++ bsd-user/freebsd/os-syscall.c | 20 +++ 2 files changed, 57 insertions(+) diff --git

[PATCH v4 04/23] bsd-user: Introduce freebsd/os-misc.h to the source tree

2023-09-14 Thread Karim Taha
From: Stacey Son To preserve the copyright notice and help with the 'Author' info for subsequent changes to the file. Signed-off-by: Stacey Son Signed-off-by: Karim Taha Reviewed-by: Richard Henderson Reviewed-by: Warner Losh --- bsd-user/freebsd/os-misc.h | 28

[PATCH v4 23/23] bsd-user: Add stubs for vadvise(), sbrk() and sstk()

2023-09-14 Thread Karim Taha
From: Warner Losh The above system calls are not supported by qemu. Signed-off-by: Warner Losh Signed-off-by: Karim Taha Reviewed-by: Richard Henderson --- bsd-user/bsd-mem.h| 18 ++ bsd-user/freebsd/os-syscall.c | 12 2 files changed, 30

[PATCH v4 16/23] bsd-user: Implment madvise(2) to match the linux-user implementation.

2023-09-14 Thread Karim Taha
Signed-off-by: Karim Taha Reviewed-by: Richard Henderson --- bsd-user/bsd-mem.h| 53 +++ bsd-user/freebsd/os-syscall.c | 4 +++ bsd-user/syscall_defs.h | 2 ++ 3 files changed, 59 insertions(+) diff --git a/bsd-user/bsd-mem.h

[PATCH v4 17/23] bsd-user: Implement mincore(2)

2023-09-14 Thread Karim Taha
From: Stacey Son Signed-off-by: Stacey Son Signed-off-by: Karim Taha Reviewed-by: Richard Henderson --- bsd-user/bsd-mem.h| 23 +++ bsd-user/freebsd/os-syscall.c | 4 2 files changed, 27 insertions(+) diff --git a/bsd-user/bsd-mem.h b/bsd-user/bsd-mem.h

[PATCH v4 13/23] bsd-user: Implement mprotect(2)

2023-09-14 Thread Karim Taha
From: Stacey Son Signed-off-by: Stacey Son Signed-off-by: Karim Taha Reviewed-by: Richard Henderson Reviewed-by: Warner Losh --- bsd-user/bsd-mem.h| 7 +++ bsd-user/freebsd/os-syscall.c | 4 2 files changed, 11 insertions(+) diff --git a/bsd-user/bsd-mem.h

[PATCH v4 03/23] bsd-user: Declarations for ipc_perm and shmid_ds conversion functions

2023-09-14 Thread Karim Taha
From: Stacey Son Signed-off-by: Stacey Son Signed-off-by: Karim Taha Reviewed-by: Richard Henderson Reviewed-by: Warner Losh --- bsd-user/qemu-bsd.h | 45 + 1 file changed, 45 insertions(+) create mode 100644 bsd-user/qemu-bsd.h diff --git

[PATCH v4 21/23] bsd-user: Implement shmctl(2)

2023-09-14 Thread Karim Taha
From: Stacey Son Signed-off-by: Stacey Son Signed-off-by: Karim Taha Reviewed-by: Richard Henderson --- bsd-user/bsd-mem.h| 39 +++ bsd-user/freebsd/os-syscall.c | 4 2 files changed, 43 insertions(+) diff --git a/bsd-user/bsd-mem.h

[PATCH v4 12/23] bsd-user: Implement mmap(2) and munmap(2)

2023-09-14 Thread Karim Taha
From: Stacey Son Signed-off-by: Stacey Son Signed-off-by: Karim Taha Reviewed-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/bsd-mem.h| 20 bsd-user/freebsd/os-syscall.c | 9 + 2 files changed, 29 insertions(+) diff --git

[PATCH v4 02/23] bsd-user: Implement struct target_shmid_ds

2023-09-14 Thread Karim Taha
From: Stacey Son Signed-off-by: Stacey Son Signed-off-by: Karim Taha Reviewed-by: Richard Henderson Reviewed-by: Warner Losh --- bsd-user/syscall_defs.h | 20 1 file changed, 20 insertions(+) diff --git a/bsd-user/syscall_defs.h b/bsd-user/syscall_defs.h index

[PATCH v4 20/23] bsd-user: Implement shm_unlink(2) and shmget(2)

2023-09-14 Thread Karim Taha
From: Stacey Son Signed-off-by: Stacey Son Signed-off-by: Karim Taha Reviewed-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/bsd-mem.h| 23 +++ bsd-user/freebsd/os-syscall.c | 8 2 files changed, 31 insertions(+) diff --git

[PATCH v4 00/23] bsd-user: Implement mmap related system calls for FreeBSD.

2023-09-14 Thread Karim Taha
Upstream the implementation of the following mmap system calls, from the qemu-bsd-user fork: mmap(2), munmap(2), mprotect(2), msync(2), mlock(2), munlock(2), mlockall(2), munlockall(2), mincore(2), madvise(2), minherit(2), shm_open(2),shm_open2(2), shm_rename2(2),

[PATCH v4 19/23] bsd-user: Implement shm_open(2)

2023-09-14 Thread Karim Taha
From: Stacey Son Co-authored-by: Kyle Evans Signed-off-by: Stacey Son Signed-off-by: Kyle Evans Signed-off-by: Karim Taha Reviewed-by: Richard Henderson --- bsd-user/bsd-mem.h| 25 + bsd-user/freebsd/os-syscall.c | 4 2 files changed, 29

[PATCH v4 10/23] bsd-user: Implement shmid_ds conversion between host and target.

2023-09-14 Thread Karim Taha
From: Stacey Son Signed-off-by: Stacey Son Signed-off-by: Karim Taha Reviewed-by: Richard Henderson --- bsd-user/bsd-mem.c | 47 ++ 1 file changed, 47 insertions(+) diff --git a/bsd-user/bsd-mem.c b/bsd-user/bsd-mem.c index 46cda8eb5c..2ab1334b70

[PATCH v4 08/23] bsd-user: Implement target_set_brk function in bsd-mem.c instead of os-syscall.c

2023-09-14 Thread Karim Taha
From: Stacey Son The definitions and variables names matches the corresponding ones in linux-user/syscall.c, for making later implementation of do_obreak easier Co-authored-by: Mikaël Urankar Signed-off-by: Mikaël Urankar Signed-off-by: Karim Taha Reviewed-by: Warner Losh Reviewed-by:

[PATCH v4 01/23] bsd-user: Implement struct target_ipc_perm

2023-09-14 Thread Karim Taha
From: Stacey Son Signed-off-by: Stacey Son Signed-off-by: Karim Taha Reviewed-by: Richard Henderson Reviewed-by: Warner Losh --- bsd-user/syscall_defs.h | 17 + 1 file changed, 17 insertions(+) diff --git a/bsd-user/syscall_defs.h b/bsd-user/syscall_defs.h index

[PATCH v4 05/23] bsd-user: Implement shm_open2(2) system call

2023-09-14 Thread Karim Taha
From: Kyle Evans Signed-off-by: Kyle Evans Signed-off-by: Karim Taha Reviewed-by: Richard Henderson --- bsd-user/freebsd/os-misc.h| 42 +++ bsd-user/freebsd/os-syscall.c | 13 +++ 2 files changed, 55 insertions(+) diff --git

[PATCH v4 18/23] bsd-user: Implement do_obreak function

2023-09-14 Thread Karim Taha
From: Stacey Son Match linux-user, by manually applying the following commits, in order: d28b3c90cfad1a7e211ae2bce36ecb9071086129 linux-user: Make sure initial brk(0) is page-aligned 15ad98536ad9410fb32ddf1ff09389b677643faa linux-user: Fix qemu brk() to not zero bytes on current page

[PATCH v4 11/23] bsd-user: Introduce bsd-mem.h to the source tree

2023-09-14 Thread Karim Taha
From: Stacey Son Preserve the copyright notice and help with the 'Author' info for subsequent changes to the file. Signed-off-by: Stacey Son Signed-off-by: Karim Taha Reviewed-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/bsd-mem.h| 64

[PATCH v4 07/23] bsd-user: Add bsd-mem.c to meson.build

2023-09-14 Thread Karim Taha
Signed-off-by: Karim Taha Reviewed-by: Richard Henderson Reviewed-by: Warner Losh --- bsd-user/bsd-mem.c | 0 bsd-user/meson.build | 1 + 2 files changed, 1 insertion(+) create mode 100644 bsd-user/bsd-mem.c diff --git a/bsd-user/bsd-mem.c b/bsd-user/bsd-mem.c new file mode 100644 index

[PATCH v4 09/23] bsd-user: Implement ipc_perm conversion between host and target.

2023-09-14 Thread Karim Taha
From: Stacey Son Signed-off-by: Stacey Son Signed-off-by: Karim Taha Reviewed-by: Richard Henderson --- bsd-user/bsd-mem.c | 25 + 1 file changed, 25 insertions(+) diff --git a/bsd-user/bsd-mem.c b/bsd-user/bsd-mem.c index 8834ab2e58..46cda8eb5c 100644 ---

  1   2   3   4   >