Re: [PATCH 1/9] tests: update Debian images to Bookworm

2023-09-14 Thread Thomas Huth
On 14/09/2023 17.54, Alex Bennée wrote: Bookworm has been out a while now. Time to update our containers to the current stable. This requires the latest lcitool repo so update the sub-module too. For some reason the MIPs containers won't build so skip those for now. Signed-off-by: Alex Bennée

Re: [PATCH 2/4] virtio-blk: add lock to protect s->rq

2023-09-14 Thread Eric Blake
On Thu, Sep 14, 2023 at 10:00:59AM -0400, Stefan Hajnoczi wrote: > s->rq is accessed from IO_CODE and GLOBAL_STATE_CODE. Introduce a lock > to protect s->rq and eliminate reliance on the AioContext lock. > > Signed-off-by: Stefan Hajnoczi > --- > include/hw/virtio/virtio-blk.h | 3 +- > hw/bloc

Re: [PATCH 3/4] virtio-blk: don't lock AioContext in the completion code path

2023-09-14 Thread Eric Blake
On Thu, Sep 14, 2023 at 10:01:00AM -0400, Stefan Hajnoczi wrote: > Nothing in the completion code path relies on the AioContext lock > anymore. Virtqueues are only accessed from one thread at any moment and > the s->rq global state is protected by its own lock now. > > Signed-off-by: Stefan Hajnoc

Re: [PATCH v2 22/24] accel/tcg: Remove env_tlb()

2023-09-14 Thread Anton Johansson via
On 9/14/23 17:44, Philippe Mathieu-Daudé wrote: On 14/9/23 04:44, Richard Henderson wrote: From: Anton Johansson The function is no longer used to access the TLB, and has been replaced by cpu->neg.tlb. Signed-off-by: Anton Johansson Message-Id: <20230912153428.17816-9-a...@rev.ng> Reviewed

Re: [PATCH v1 0/7] Validate and test qapi examples

2023-09-14 Thread Victor Toso
Hi, On Fri, Sep 08, 2023 at 09:51:35AM +0200, Philippe Mathieu-Daudé wrote: > On 7/9/23 20:17, Victor Toso wrote: > > Hi, > > > >File "/home/berrange/src/virt/qemu/scripts/qapi/dumpexamples.py", line > > > 118, in parse_examples_of > > > assert((obj.doc is not None)) > > >

Re: QEMU migration-test CI intermittent failure

2023-09-14 Thread Peter Xu
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 worry. It's good to finally iden

Re: [QEMU PATCH v4 10/13] virtio-gpu: Resource UUID

2023-09-14 Thread Akihiko Odaki
On 2023/09/14 17:29, Albert Esteve wrote: On Thu, Sep 14, 2023 at 9:17 AM Akihiko Odaki > wrote: On 2023/09/13 23:18, Albert Esteve wrote: > > > On Wed, Sep 13, 2023 at 3:43 PM Akihiko Odaki mailto:akihiko.od...@daynix.com> >

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

2023-09-14 Thread Karim Taha
Richard Henderson writes: Do I need to enclose `shmdt implmenetation` in a WITH_MMAP_LOCK_GUARD() block? Mr.Warner forwared me a patch series ,that you sent on Sun 20 Aug, for the linux-user, which encloses the implementation in such a block. -- Karim Taha > On 9/9/23 12:37, Karim Taha wrote: >

Re: [PATCH] mem/x86: add processor address space check for VM memory

2023-09-14 Thread Ani Sinha
> On 14-Sep-2023, at 2:07 PM, David Hildenbrand wrote: > > On 14.09.23 07:53, Ani Sinha wrote: >>> On 12-Sep-2023, at 9:04 PM, David Hildenbrand wrote: >>> >>> [...] >>> > diff --git a/hw/i386/pc.c b/hw/i386/pc.c > index 54838c0c41..d187890675 100644 > --- a/hw/i386/pc.c > +

Re: [PATCH v3 03/12] plugins: Check if vCPU is realized

2023-09-14 Thread Akihiko Odaki
On 2023/09/13 15:17, Philippe Mathieu-Daudé wrote: On 13/9/23 00:40, Akihiko Odaki wrote: The created member of CPUState tells if the vCPU thread is started, and will be always false for the user space emulation that manages threads independently. Per the docstring:  /**   * CPUState:   *

Re: [PATCH v3 00/12] gdbstub and TCG plugin improvements

2023-09-14 Thread Philippe Mathieu-Daudé
On 14/9/23 17:56, Alex Bennée wrote: Akihiko Odaki writes: This series extracts fixes and refactorings that can be applied independently from "[PATCH RESEND v5 00/26] plugins: Allow to read registers" as suggested by Nicholas Piggin. Patch "target/ppc: Remove references to gdb_has_xml" is al

Re: [PATCH 2/9] gitlab: fix typo/spelling in comments

2023-09-14 Thread Philippe Mathieu-Daudé
On 14/9/23 17:54, Alex Bennée wrote: Signed-off-by: Alex Bennée --- .gitlab-ci.d/base.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH 4/4] virtio-blk: don't lock AioContext in the submission code path

2023-09-14 Thread Eric Blake
On Thu, Sep 14, 2023 at 10:01:01AM -0400, Stefan Hajnoczi wrote: > There is no need to acquire the AioContext lock around blk_aio_*() or > blk_get_geometry() anymore. I/O plugging (defer_call()) also does not > require the AioContext lock anymore. > > Signed-off-by: Stefan Hajnoczi > --- > hw/bl

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

2023-09-14 Thread Paolo Bonzini
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. Signed-off-by: Jeuk Kim Reviewed-by: Stefan Hajnoczi M

[PATCH 2/6] accel/tcg: Hoist CF_MEMI_ONLY check outside translation loop

2023-09-14 Thread Richard Henderson
The condition checked is loop invariant; check it only once. Signed-off-by: Richard Henderson --- accel/tcg/translator.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/accel/tcg/translator.c b/accel/tcg/translator.c index a3983019a5..b6ab9f3d33 100644 --- a/ac

[PATCH 1/6] accel/tcg: Avoid load of icount_decr if unused

2023-09-14 Thread Richard Henderson
With CF_NOIRQ and without !CF_USE_ICOUNT, the load isn't used. Avoid emitting it. Signed-off-by: Richard Henderson --- accel/tcg/translator.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/accel/tcg/translator.c b/accel/tcg/translator.c index 1a6a5448c8..a3983019

[PATCH 6/6] accel/tcg: Always require can_do_io

2023-09-14 Thread Richard Henderson
Require i/o as the last insn of a TranslationBlock always, not only with icount. This is required for i/o that alters the address space, such as a pci config space write. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1866 Signed-off-by: Richard Henderson --- accel/tcg/translator.c

[PATCH 3/6] accel/tcg: Track current value of can_do_io in the TB

2023-09-14 Thread Richard Henderson
Simplify translator_io_start by recording the current known value of can_do_io within DisasContextBase. Signed-off-by: Richard Henderson --- include/exec/translator.h | 2 ++ accel/tcg/translator.c| 31 ++- 2 files changed, 16 insertions(+), 17 deletions(-) diff

[PATCH 4/6] accel/tcg: Improve setting of can_do_io at start of TB

2023-09-14 Thread Richard Henderson
Initialize can_do_io to true if this the TB has CF_LAST_IO and will consist of a single instruction. This avoids a set to 0 followed immediately by a set to 1. Signed-off-by: Richard Henderson --- accel/tcg/translator.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/acc

[PATCH 5/6] accel/tcg: Always set CF_LAST_IO with CF_NOIRQ

2023-09-14 Thread Richard Henderson
Without this we can get see loops through cpu_io_recompile, in which the cpu makes no progress. Signed-off-by: Richard Henderson --- accel/tcg/cpu-exec.c | 2 +- accel/tcg/tb-maint.c | 6 -- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-e

[PATCH 0/6] accel/tcg: Always require can_do_io (#1866)

2023-09-14 Thread Richard Henderson
The problem exposed by the fix for #1826 (et al) is that the TB that contains the i/o instruction that alters the address space continues on to issue other i/o instructions. Since #1826 deferred the update to the address space, these subsequent i/o instructions do not reference the correct address

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

2023-09-14 Thread Richard Henderson
On 9/14/23 09:55, Karim Taha wrote: Richard Henderson writes: Do I need to enclose `shmdt implmenetation` in a WITH_MMAP_LOCK_GUARD() block? Mr.Warner forwared me a patch series ,that you sent on Sun 20 Aug, for the linux-user, which encloses the implementation in such a block. Yes. All cha

[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 f

[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 int

[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 +- target/i386/trace

[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 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 4

[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 inser

[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 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 fi

[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 insertions(+),

Re: [PATCH v2 13/24] accel/tcg: Replace CPUState.env_ptr with cpu_env()

2023-09-14 Thread Philippe Mathieu-Daudé
On 14/9/23 04:44, Richard Henderson wrote: Signed-off-by: Richard Henderson --- include/exec/cpu-all.h | 1 - include/hw/core/cpu.h| 9 ++--- target/arm/common-semi-target.h | 2 +- accel/tcg/cpu-exec.c | 8 accel/tcg/cput

Re: [PATCH v2 13/24] accel/tcg: Replace CPUState.env_ptr with cpu_env()

2023-09-14 Thread Richard Henderson
On 9/14/23 11:12, Philippe Mathieu-Daudé wrote: On 14/9/23 04:44, Richard Henderson wrote: Signed-off-by: Richard Henderson ---   include/exec/cpu-all.h   |  1 -   include/hw/core/cpu.h    |  9 ++---   target/arm/common-semi-target.h  |  2 +-   accel/tcg/cpu-exec

Re: [PATCH v2 13/24] accel/tcg: Replace CPUState.env_ptr with cpu_env()

2023-09-14 Thread Philippe Mathieu-Daudé
On 14/9/23 20:15, Richard Henderson wrote: On 9/14/23 11:12, Philippe Mathieu-Daudé wrote: On 14/9/23 04:44, Richard Henderson wrote: Signed-off-by: Richard Henderson ---   include/exec/cpu-all.h   |  1 -   include/hw/core/cpu.h    |  9 ++---   target/arm/common-sem

Re: [PATCH v3 2/5] softmmu: Support concurrent bounce buffers

2023-09-14 Thread Stefan Hajnoczi
On Thu, Sep 07, 2023 at 06:04:07AM -0700, Mattias Nissler wrote: > When DMA memory can't be directly accessed, as is the case when > running the device model in a separate process without shareable DMA > file descriptors, bounce buffering is used. > > It is not uncommon for device models to reques

Re: [PATCH v2 13/24] accel/tcg: Replace CPUState.env_ptr with cpu_env()

2023-09-14 Thread Richard Henderson
On 9/14/23 11:38, Philippe Mathieu-Daudé wrote: I presume this is --disable-tcg, since I saw the same thing in CI testing. Yes (I didn't even noticed, I was testing my kvm_only setup). No, we don't remove the check (that would explicit assumptions elsewhere), we adjust the alignment of CPUNeg

[PATCH 01/11] exec: Make EXCP_FOO definitions target agnostic

2023-09-14 Thread Philippe Mathieu-Daudé
The EXCP_* definitions don't need to be target specific, move them to "exec/cpu-common.h". Signed-off-by: Philippe Mathieu-Daudé --- include/exec/cpu-all.h| 7 --- include/exec/cpu-common.h | 7 +++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/exec/cpu-all.h

[PATCH 05/11] accel: Rename accel-common.c -> accel-target.c

2023-09-14 Thread Philippe Mathieu-Daudé
We use the '-common.c' suffix for target agnostic units. This file is target specific, rename it using the '-target' suffix. Signed-off-by: Philippe Mathieu-Daudé --- accel/{accel-common.c => accel-target.c} | 0 accel/meson.build| 2 +- 2 files changed, 1 insertion(+), 1

[PATCH 02/11] exec: Move cpu_loop_foo() target agnostic functions to 'cpu-common.h'

2023-09-14 Thread Philippe Mathieu-Daudé
While these functions are not TCG specific, they are not target specific. Move them to "exec/cpu-common.h" so their callers don't have to be tainted as target specific. Signed-off-by: Philippe Mathieu-Daudé --- include/exec/cpu-common.h | 32 include/exec/exec-al

[PATCH 06/11] exec: Rename cpu.c -> cpu-target.c

2023-09-14 Thread Philippe Mathieu-Daudé
We have exec/cpu code split in 2 files for target agnostic ("common") and specific. Rename 'cpu.c' which is target specific using the '-target' suffix. Update MAINTAINERS. Remove the 's from 'cpus-common.c' to match the API cpu_foo() functions. Signed-off-by: Philippe Mathieu-Daudé --- MAINTAINE

[PATCH 03/11] accel/tcg: Restrict dump_exec_info() declaration

2023-09-14 Thread Philippe Mathieu-Daudé
In commit 00c9a5c2c3 ("accel/tcg: Restrict 'qapi-commands-machine.h' to system emulation") we moved the definition to accel/tcg/ which is where this function is called. No need to expose it outside. Signed-off-by: Philippe Mathieu-Daudé --- accel/tcg/internal.h | 2 ++ include/exec/cpu-all.h |

[PATCH 00/11] accel/tcg: Make more files target agnostic (& exec/ housekeeping)

2023-09-14 Thread Philippe Mathieu-Daudé
While reviewing Anton/Richard series [*] it was a bit hard for me to figure out which headers are target specific and "taint" the source which include them, in that we can not compile them once for all targets. My understanding is -all.h suffix is a target specific header, and -common.c is a targe

[PATCH 08/11] accel/tcg: Rename target-specific 'internal.h' -> 'internal-target.h'

2023-09-14 Thread Philippe Mathieu-Daudé
accel/tcg/internal.h contains target specific declarations. Unit files including it become "target tainted": they can not be compiled as target agnostic. Rename using the '-target' suffix to make this explicit. Signed-off-by: Philippe Mathieu-Daudé --- accel/tcg/{internal.h => internal-target.h}

[PATCH 04/11] accel: Make accel-blocker.o target agnostic

2023-09-14 Thread Philippe Mathieu-Daudé
accel-blocker.c is not target specific, move it to system_ss[]. Signed-off-by: Philippe Mathieu-Daudé --- accel/meson.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/accel/meson.build b/accel/meson.build index 638a9a03ba..76f3cbc530 100644 --- a/accel/meson.build ++

[PATCH 10/11] accel/tcg: Make icount.o a target agnostic unit

2023-09-14 Thread Philippe Mathieu-Daudé
Remove the unused "exec/exec-all.h" header. There is no more target specific code in it: make it target agnostic (rename using the '-common' suffix). Since it is TCG specific, move it to accel/tcg, updating MAINTAINERS. Signed-off-by: Philippe Mathieu-Daudé --- MAINTAINERS

[PATCH 11/11] accel/tcg: Make cpu-exec-common.c a target agnostic unit

2023-09-14 Thread Philippe Mathieu-Daudé
cpu_in_serial_context() is not target specific, move it declaration to "internal-common.h" (which we include in the 4 source files modified). Remove the unused "exec/exec-all.h" header from cpu-exec-common.c. There is no more target specific code in this file: make it target agnostic. Signed-off

[PATCH 07/11] exec: Rename target specific page-vary.c -> page-vary-target.c

2023-09-14 Thread Philippe Mathieu-Daudé
This matches the target agnostic 'page-vary-common.c' counterpart. Signed-off-by: Philippe Mathieu-Daudé --- MAINTAINERS | 2 +- meson.build | 2 +- page-vary.c => page-vary-target.c | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename page-va

[PATCH 09/11] accel/tcg: Make monitor.c a target-agnostic unit

2023-09-14 Thread Philippe Mathieu-Daudé
Move target-agnostic declarations from "internal-target.h" to a new "internal-common.h" header. monitor.c now don't include target specific headers and can be compiled once in system_ss[]. Signed-off-by: Philippe Mathieu-Daudé --- accel/tcg/internal-common.h | 17 + accel/tcg/int

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

2023-09-14 Thread Philippe Mathieu-Daudé
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 for ioctls that were previously implemented in QEMU d

Re: [PATCH v3 4/5] vfio-user: Message-based DMA support

2023-09-14 Thread Stefan Hajnoczi
On Thu, Sep 07, 2023 at 06:04:09AM -0700, Mattias Nissler wrote: > Wire up support for DMA for the case where the vfio-user client does not > provide mmap()-able file descriptors, but DMA requests must be performed > via the VFIO-user protocol. This installs an indirect memory region, > which alrea

Re: [PATCH v1 1/2] target/s390x: introduce "host-recommended" option for model expansion

2023-09-14 Thread Collin Walling
On 9/12/23 02:57, David Hildenbrand wrote: > On 11.09.23 22:52, Collin Walling wrote: > > Patch subject is wrong (should contain "static-recommended") > >> Newer S390 machines may drop support for features completely, rendering >> guests operating with older CPU models incapable of running on sai

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. Byteswapping only works when registers a

[PATCH 0/4] accel/tcg: Stubs cleanups

2023-09-14 Thread Philippe Mathieu-Daudé
- Remove unused stubs, - Guard with tcg_enabled() and remove more, - Reduce tlb_set_dirty() scope? Philippe Mathieu-Daudé (4): accel/tcg: Remove tlb_set_dirty() stub accel/tcg: Remove unused tcg_flush_jmp_cache() stub accel/tcg: Guard tb_flush() with tcg_enabled() and remove the stub accel

[PATCH 2/4] accel/tcg: Remove unused tcg_flush_jmp_cache() stub

2023-09-14 Thread Philippe Mathieu-Daudé
Since commit ba7d3d1858 ("cpu_common_reset: wrap TCG specific code in tcg_enabled()") we protect the single call to tcg_flush_jmp_cache() with a check on tcg_enabled(). The stub isn't needed anymore. Signed-off-by: Philippe Mathieu-Daudé --- accel/stubs/tcg-stub.c | 4 1 file changed, 4 del

[RFC PATCH 3/4] accel/tcg: Guard tb_flush() with tcg_enabled() and remove the stub

2023-09-14 Thread Philippe Mathieu-Daudé
The check on tcg_enabled() make it clearer we want this call under TCG. Signed-off-by: Philippe Mathieu-Daudé --- accel/stubs/tcg-stub.c | 4 cpu.c | 15 +-- gdbstub/softmmu.c | 5 - hw/ppc/spapr_hcall.c | 2 +- 4 files changed, 14 insertions(+), 1

[RFC PATCH 4/4] accel/tcg: Keep tlb_set_dirty() internal

2023-09-14 Thread Philippe Mathieu-Daudé
Since commit 34d49937e4 ("accel/tcg: Handle atomic accesses to notdirty memory correctly") tlb_set_dirty() is only used (once) in the very same file it is defined... Make it static. Signed-off-by: Philippe Mathieu-Daudé --- include/exec/exec-all.h | 1 - accel/tcg/cputlb.c | 2 +- 2 files c

[PATCH 1/4] accel/tcg: Remove tlb_set_dirty() stub

2023-09-14 Thread Philippe Mathieu-Daudé
Since commit 34d49937e4 ("accel/tcg: Handle atomic accesses to notdirty memory correctly") there is only a single call to tlb_set_dirty(), within accel/tcg/cputlb.c itself where the function is defined. Signed-off-by: Philippe Mathieu-Daudé --- accel/stubs/tcg-stub.c | 4 1 file changed, 4

[PATCH v4 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 a/bsd-user/fr

[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 --- a/bsd-user/

[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 000

[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 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 dfe49

[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 a/bsd-user/freebsd/os-m

[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 e4825f2662..

[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: Richar

[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 1

[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 insertions

[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 a/bsd-user/b

[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), shm_unlink(2)

[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 39a9bc8ed

[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 a/bsd-user/bsd

[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 b/bsd-use

[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 a/bsd-

[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 b/bsd-user/bs

[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 b/bsd-user/bsd-me

[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 insertions(+

[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 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, 15

[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 a/bsd-user/bsd-

[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} ceda5688b650646248f269a992c06b11148

[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 +- target/i386/trace

[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 insertions(+),

[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 int

[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 f

[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 fi

[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 4

[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 inser

[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 ++---

[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 sim

[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 of

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 > --

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 +

[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") - ec

[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 9c90616baa..

[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 4deb4fed3

[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 dfe49

[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 000

[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), shm_unlink(2)

<    1   2   3   4   >