Re: [PATCH 08/23] Add Aarch64 sysarch() system call emulation for BSD-USER

2024-06-17 Thread Richard Henderson
On 6/17/24 11:57, Ajeet Singh wrote: From: Stacey Son Initial implementation of sysarch() syscall and a printing function Signed-off-by: Stacey Son Signed-off-by: Ajeet Singh --- bsd-user/aarch64/target_arch_sysarch.h | 42 ++ 1 file changed, 42 insertions(+)

Re: [PATCH 07/23] Add ARM AArch64 TLS Management Prototypes for BSD-User

2024-06-17 Thread Richard Henderson
On 6/17/24 11:57, Ajeet Singh wrote: From: Stacey Son Prototypes for setting and getting TLS( thread local storage) Signed-off-by: Stacey Son Signed-off-by: Ajeet Singh --- bsd-user/aarch64/target_arch.h | 28 1 file changed, 28 insertions(+) create mode

Re: [PATCH 06/23] Add Aarch64 register handling

2024-06-17 Thread Richard Henderson
On 6/17/24 11:57, Ajeet Singh wrote: From: Stacey Son Header file for managing CPU register states in FreeBSD user mode Signed-off-by: Stacey Son Signed-off-by: Ajeet Singh --- bsd-user/aarch64/target_arch_reg.h | 56 ++ 1 file changed, 56 insertions(+)

Re: [PATCH 05/23] Managing CPU register for BSD-USER

2024-06-17 Thread Richard Henderson
On 6/17/24 11:57, Ajeet Singh wrote: From: Stacey Son Added structure for storing register states Signed-off-by: Stacey Son Signed-off-by: Ajeet Singh Co-authored-by: Sean Bruno --- bsd-user/aarch64/target_syscall.h | 51 +++ 1 file changed, 51 insertions(+)

Re: [PATCH 04/23] AArch64 specific CPU for bsd-user

2024-06-17 Thread Richard Henderson
On 6/17/24 11:57, Ajeet Singh wrote: From: Stacey Son Function to set and recieve thread-local-storage value from tpidr_el0 register Signed-off-by: Stacey Son Signed-off-by: Ajeet Singh --- bsd-user/aarch64/target_arch_cpu.c | 34 ++ 1 file changed, 34

Re: [PATCH 03/23] Added function to clone CPU state

2024-06-17 Thread Richard Henderson
On 6/17/24 11:57, Ajeet Singh wrote: From: Stacey Son Function can copy cpu state to create new thread Signed-off-by: Stacey Son Signed-off-by: Ajeet Singh --- bsd-user/aarch64/target_arch_cpu.h | 17 + 1 file changed, 17 insertions(+) Reviewed-by: Richard Henderson r~

Re: [PATCH] hw/usb/dev-mtp: Correctly report free space

2024-06-17 Thread Philippe Mathieu-Daudé
On 18/6/24 02:36, Fabio D'Urso wrote: In order to compute the amount of free space (in bytes), the number of available blocks (f_bavail) should be multiplied by the block size (f_frsize) instead of the total number of blocks (f_blocks). Signed-off-by: Fabio D'Urso --- hw/usb/dev-mtp.c | 2 +-

Re: [PATCH 02/23] Added CPU loop function

2024-06-17 Thread Richard Henderson
On 6/17/24 11:57, Ajeet Singh wrote: +/* + * The carry bit is cleared for no error; set for error. + * See arm64/arm64/vm_machdep.c cpu_set_syscall_retval() + */ +pstate = pstate_read(env); +if (ret >= 0) { +

Re: [PATCH 01/23] Add CPU initialization function

2024-06-17 Thread Richard Henderson
On 6/17/24 11:57, Ajeet Singh wrote: From: Stacey Son Addded function to initialize ARM CPU and to check if it supports 64 bit mode Signed-off-by: Ajeet Singh Signed-off-by: Stacey Son --- bsd-user/aarch64/target_arch_cpu.h | 42 ++ 1 file changed, 42

Re: [PATCH 18/18] tcg/loongarch64: Enable v256 with LASX

2024-06-17 Thread gaosong
在 2024/5/29 下午2:39, Philippe Mathieu-Daudé 写道: On 27/5/24 23:19, Richard Henderson wrote: Signed-off-by: Richard Henderson ---   tcg/loongarch64/tcg-target.h |  2 +-   tcg/loongarch64/tcg-target.c.inc | 11 ---   2 files changed, 9 insertions(+), 4 deletions(-) Reviewed-by:

Re: [PATCH 18/18] tcg/loongarch64: Enable v256 with LASX

2024-06-17 Thread gaosong
在 2024/5/28 上午5:19, Richard Henderson 写道: Signed-off-by: Richard Henderson --- tcg/loongarch64/tcg-target.h | 2 +- tcg/loongarch64/tcg-target.c.inc | 11 --- 2 files changed, 9 insertions(+), 4 deletions(-) Reviewed-by: Song Gao Thanks. Song Gao diff --git

Re: [PATCH 17/18] tcg/loongarch64: Support LASX in tcg_out_vec_op

2024-06-17 Thread gaosong
在 2024/5/28 上午5:19, Richard Henderson 写道: Signed-off-by: Richard Henderson --- tcg/loongarch64/tcg-target.c.inc | 223 +++ 1 file changed, 137 insertions(+), 86 deletions(-) Reviewed-by: Song Gao Thanks. Song Gao

Re: [PATCH 16/18] tcg/loongarch64: Split out vdvjukN in tcg_out_vec_op

2024-06-17 Thread gaosong
在 2024/5/28 上午5:19, Richard Henderson 写道: Fixes a bug in the immediate shifts, because the exact encoding depends on the element size. Signed-off-by: Richard Henderson --- tcg/loongarch64/tcg-target.c.inc | 58 ++-- 1 file changed, 32 insertions(+), 26

Re: [PATCH 15/18] tcg/loongarch64: Remove temp_vec from tcg_out_vec_op

2024-06-17 Thread gaosong
在 2024/5/28 上午5:19, Richard Henderson 写道: Use TCG_VEC_TMP0 directly. Signed-off-by: Richard Henderson --- tcg/loongarch64/tcg-target.c.inc | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) Reviewed-by: Song Gao Thanks. Song Gao diff --git a/tcg/loongarch64/tcg-target.c.inc

Re: [PATCH 14/18] tcg/loongarch64: Support LASX in tcg_out_{mov,ld,st}

2024-06-17 Thread gaosong
在 2024/5/28 上午5:19, Richard Henderson 写道: Signed-off-by: Richard Henderson --- tcg/loongarch64/tcg-target.c.inc | 19 +++ 1 file changed, 19 insertions(+) Reviewed-by: Song Gao Thanks. Song Gao diff --git a/tcg/loongarch64/tcg-target.c.inc

Re: [PATCH 13/18] tcg/loongarch64: Split out vdvjvk in tcg_out_vec_op

2024-06-17 Thread gaosong
在 2024/5/28 上午5:19, Richard Henderson 写道: case INDEX_op_andc_vec: /* * vandn vd, vj, vk: vd = vk & ~vj * andc_vec vd, vj, vk: vd = vj & ~vk - * vk and vk are swapped + * vj and vk are swapped */ -tcg_out_opc_vandn_v(s, a0,

Re: [PATCH 12/18] tcg/loongarch64: Support LASX in tcg_out_addsub_vec

2024-06-17 Thread gaosong
在 2024/5/28 上午5:19, Richard Henderson 写道: Signed-off-by: Richard Henderson --- tcg/loongarch64/tcg-target.c.inc | 36 ++-- 1 file changed, 20 insertions(+), 16 deletions(-) Reviewed-by: Song Gao Thanks. Song Gao diff --git a/tcg/loongarch64/tcg-target.c.inc

Re: linux-user: array overflow in pselect6 emulation

2024-06-17 Thread Richard Henderson
On 6/17/24 03:43, Andreas Schwab wrote: $ cat select.c #include #include #include #include #include #include int main (int argc, char **argv) { int nfds = (argc > 1 ? atoi (argv[1]) : 1031); fd_set *fds = calloc ((nfds + (sizeof (fd_mask) * 8) - 1) / (sizeof

Re: [PATCH 11/18] tcg/loongarch64: Simplify tcg_out_addsub_vec

2024-06-17 Thread gaosong
在 2024/5/28 上午5:19, Richard Henderson 写道: Signed-off-by: Richard Henderson --- tcg/loongarch64/tcg-target.c.inc | 29 +++-- 1 file changed, 15 insertions(+), 14 deletions(-) Reviewed-by: Song Gao Thanks. Song Gao diff --git a/tcg/loongarch64/tcg-target.c.inc

[PATCH] hw/usb/dev-mtp: Correctly report free space

2024-06-17 Thread Fabio D'Urso
In order to compute the amount of free space (in bytes), the number of available blocks (f_bavail) should be multiplied by the block size (f_frsize) instead of the total number of blocks (f_blocks). Signed-off-by: Fabio D'Urso --- hw/usb/dev-mtp.c | 2 +- 1 file changed, 1 insertion(+), 1

Re: [RFC PATCH v2 3/5] rust: add PL011 device model

2024-06-17 Thread Pierrick Bouvier
On 6/17/24 14:04, Manos Pitsidianakis wrote: On Mon, 17 Jun 2024 17:32, Paolo Bonzini wrote: On Mon, Jun 17, 2024 at 4:04 PM Manos Pitsidianakis wrote: I respectfully disagree and recommend taking another look at the code. The device actually performs all logic in non-unsafe methods and is

Re: [RFC PATCH v2 3/5] rust: add PL011 device model

2024-06-17 Thread Pierrick Bouvier
On 6/17/24 07:32, Paolo Bonzini wrote: On Mon, Jun 17, 2024 at 4:04 PM Manos Pitsidianakis wrote: I respectfully disagree and recommend taking another look at the code. The device actually performs all logic in non-unsafe methods and is typed instead of operating on raw integers as

Re: [PATCH 9/9] contrib/plugins: add ips plugin example for cost modeling

2024-06-17 Thread Dr. David Alan Gilbert
* Pierrick Bouvier (pierrick.bouv...@linaro.org) wrote: > On 6/17/24 13:56, Dr. David Alan Gilbert wrote: > > * Pierrick Bouvier (pierrick.bouv...@linaro.org) wrote: > > > On 6/14/24 15:00, Dr. David Alan Gilbert wrote: > > > > * Pierrick Bouvier (pierrick.bouv...@linaro.org) wrote: > > > > > Hi

[PATCH v2] hw/arm/virt-acpi-build: Fix IORT id_count

2024-06-17 Thread Nicolin Chen
The IORT doc defines "Number of IDs" ("id_count" in the virt-acpi-build) to be "the number of IDs in the range minus one". Otherwise, Linux kernel reports "conflicting mapping for input ID" FW_BUG at the overlapped ID. Fixes: 42e0f050e3a5 ("hw/arm/virt-acpi-build: Add IORT support to bypass

Re: [PATCH 9/9] contrib/plugins: add ips plugin example for cost modeling

2024-06-17 Thread Pierrick Bouvier
On 6/17/24 13:56, Dr. David Alan Gilbert wrote: * Pierrick Bouvier (pierrick.bouv...@linaro.org) wrote: On 6/14/24 15:00, Dr. David Alan Gilbert wrote: * Pierrick Bouvier (pierrick.bouv...@linaro.org) wrote: Hi Dave, On 6/12/24 14:02, Dr. David Alan Gilbert wrote: * Alex Bennée

Re: [RFC PATCH v2 3/5] rust: add PL011 device model

2024-06-17 Thread Manos Pitsidianakis
On Mon, 17 Jun 2024 17:32, Paolo Bonzini wrote: On Mon, Jun 17, 2024 at 4:04 PM Manos Pitsidianakis wrote: I respectfully disagree and recommend taking another look at the code. The device actually performs all logic in non-unsafe methods and is typed instead of operating on raw integers as

Re: [PATCH 20/20] qapi: convert "Example" sections to rST

2024-06-17 Thread John Snow
On Fri, Jun 14, 2024 at 10:39 AM Markus Armbruster wrote: > John Snow writes: > > > Eliminate the "Example" sections in QAPI doc blocks, converting them > > into QMP example code blocks. This is generally done by converting > > "Example:" or "Examples:" lines into ".. code-block:: QMP" lines. >

Re: [PATCH v2 08/10] tests/migration-tests: Always enable migration events

2024-06-17 Thread Peter Xu
On Mon, Jun 17, 2024 at 04:51:32PM -0300, Fabiano Rosas wrote: > Peter Xu writes: > > > Libvirt should always enable it, so it'll be nice qtest also cover that for > > all tests. Though this patch only enables it, no extra tests are done on > > these events yet. > > > > Signed-off-by: Peter Xu

Re: [PULL 0/1] Dirty page rate and dirty page limit 20240617 patches

2024-06-17 Thread Richard Henderson
/newfriday/qemu.git tags/dirtylimit-dirtyrate-pull-request-20240617 for you to fetch changes up to e65152d5483b2c847ec7a947ed52650152cfdcc0: migration/dirtyrate: Fix segmentation fault (2024-06-17 23:29:21 +0800) Applied, thanks. Please update https://wiki.qemu.org/ChangeLog/9.1

Re: [PULL v2 00/25] target/i386, SCSI changes for 2024-06-11

2024-06-17 Thread Richard Henderson
On 6/17/24 01:13, Paolo Bonzini wrote: The following changes since commit 80e8f0602168f451a93e71cbb1d59e93d745e62e: Merge tag 'bsd-user-misc-2024q2-pull-request' of gitlab.com:bsdimp/qemu into staging (2024-06-09 11:21:55 -0700) are available in the Git repository at:

[PATCH 3/5] pnv/xive2: Set Translation Table for the NVC port space

2024-06-17 Thread Michael Kowal
From: Frederic Barrat Set Translation Table for the NVC port space is missing. The xive model doesn't take into account the remapping of IO operations via the Set Translation Table but firmware is allowed to define it for the Notify Virtual Crowd (NVC), like it's already done for the other VST

[PATCH 2/5] pnv/xive2: Enable VST NVG and NVC index compression

2024-06-17 Thread Michael Kowal
From: Frederic Barrat Enable NVG and NVC VST tables for index compression which indicates the number of bits the address is shifted to the right for the table accesses. The compression values are defined as: - No compression 0001 - 1 bit shift 0010 - 2 bit shift 1000 - 8

[PATCH 1/5] pnv/xive2: XIVE2 Cache Watch, Cache Flush and Sync Injection support

2024-06-17 Thread Michael Kowal
From: Frederic Barrat XIVE offers a 'cache watch facility', which allows software to read/update a potentially cached table entry with no software lock. There's one such facility in the Virtualization Controller (VC) to update the ESB and END entries and one in the Presentation Controller (PC)

[PATCH 5/5] pnv/xive2: Move xive2_nvp_pic_print_info() to xive2.c

2024-06-17 Thread Michael Kowal
From: Frederic Barrat Moving xive2_nvp_pic_print_info() align with the other "pic_print_info" functions and allows us to call functions internal to xive2.c. In XIVE Gen 2 there were some minor changes to the TIMA header that were updated when printed. Additional END state 'info pic'

[PATCH 0/5] XIVE changes for Cache Watch, VSTs, STT and info pic

2024-06-17 Thread Michael Kowal
These changes provide enhanced support of the External Interrupt Virtualization Engine. The changes are focused on the following areas: - Cache Watch, Cache Flush and Sync Injection - Virtual Structure Tables - Set Translation Table - 'info pic' command data that is dumped Frederic Barrat

[PATCH 4/5] pnv/xive2: Fail VST entry address computation if table has no VSD

2024-06-17 Thread Michael Kowal
From: Frederic Barrat Fail VST entry address computatio if firmware doesn't define a descriptor for one of the Virtualization Structure Tables (VST), there's no point in trying to compute the address of its entry. Abort the operation and log an error. Signed-off-by: Michael Kowal ---

Re: [RFC PATCH v2 2/5] rust: add bindgen step as a meson dependency

2024-06-17 Thread Paolo Bonzini
Just one somewhat larger request, otherwise just a collection of ideas. On Tue, Jun 11, 2024 at 12:34 PM Manos Pitsidianakis wrote: > diff --git a/rust/meson.build b/rust/meson.build > new file mode 100644 > index 00..e9660a3045 > --- /dev/null > +++ b/rust/meson.build > @@ -0,0 +1,91 @@

Re: [PATCH 9/9] contrib/plugins: add ips plugin example for cost modeling

2024-06-17 Thread Dr. David Alan Gilbert
* Pierrick Bouvier (pierrick.bouv...@linaro.org) wrote: > On 6/14/24 15:00, Dr. David Alan Gilbert wrote: > > * Pierrick Bouvier (pierrick.bouv...@linaro.org) wrote: > > > Hi Dave, > > > > > > On 6/12/24 14:02, Dr. David Alan Gilbert wrote: > > > > * Alex Bennée (alex.ben...@linaro.org) wrote: >

Re: [PATCH v2 00/10] migration: New postcopy state, and some cleanups

2024-06-17 Thread Fabiano Rosas
Peter Xu writes: > Hello, > > On Mon, Jun 17, 2024 at 02:15:24PM -0400, Peter Xu wrote: >> v2: >> - Collect tags >> - Patch 3 >> - cover all states in migration_postcopy_is_alive() >> - Patch 4 (old) >> - English changes [Fabiano] >> - Split the migration_incoming_state_setup() cleanup

Re: [RFC PATCH 0/3] target/i386: Reorg push/pop within seg_helper.c

2024-06-17 Thread Paolo Bonzini
On Mon, Jun 17, 2024 at 6:12 PM Richard Henderson wrote: > > Hi Paolo, > > Thanks for offering to do the work to fix the memory access issues > identified by Robert. > > Here is a code dump from this weekend that I noodled with -- it is > prep work only, not intending to change any semantics, but

Re: [PATCH v2 10/10] tests/migration-tests: Cover postcopy failure on reconnect

2024-06-17 Thread Fabiano Rosas
Peter Xu writes: > Make sure there will be an event for postcopy recovery, irrelevant of > whether the reconnect will success, or when the failure happens. > > The added new case is to fail early in postcopy recovery, in which case it > didn't even reach RECOVER stage on src (and in real life

Re: [PATCH 19/20] qapi: convert "Note" sections to plain rST

2024-06-17 Thread John Snow
On Fri, Jun 14, 2024, 9:44 AM Markus Armbruster wrote: > John Snow writes: > > > We do not need a dedicated section for notes. By eliminating a specially > > parsed section, these notes can be treated as normal rST paragraphs in > > the new QMP reference manual, and can be placed and styled

Re: [PATCH v2 09/10] tests/migration-tests: Verify postcopy-recover-setup status

2024-06-17 Thread Fabiano Rosas
Peter Xu writes: > Making sure the postcopy-recover-setup status is present in the postcopy > failure unit test. Note that it only applies to src QEMU not dest. > > This also introduces the tiny but helpful migration_event_wait() helper. > > Signed-off-by: Peter Xu Reviewed-by: Fabiano Rosas

Re: [PATCH v2 08/10] tests/migration-tests: Always enable migration events

2024-06-17 Thread Fabiano Rosas
Peter Xu writes: > Libvirt should always enable it, so it'll be nice qtest also cover that for > all tests. Though this patch only enables it, no extra tests are done on > these events yet. > > Signed-off-by: Peter Xu > --- > tests/qtest/migration-test.c | 7 +++ > 1 file changed, 7

Re: [PATCH v2 07/10] tests/migration-tests: Drop most WIN32 ifdefs for postcopy failure tests

2024-06-17 Thread Fabiano Rosas
Peter Xu writes: > Most of them are not needed, we can stick with one ifdef inside > postcopy_recover_fail() so as to cover the scm right tricks only. > The tests won't run on windows anyway due to has_uffd always false. > > Signed-off-by: Peter Xu Reviewed-by: Fabiano Rosas

Re: [PATCH v2 06/10] migration/docs: Update postcopy recover session for SETUP phase

2024-06-17 Thread Fabiano Rosas
Peter Xu writes: > Firstly, the "Paused" state was added in the wrong place before. The state > machine section was describing PostcopyState, rather than MigrationStatus. > Drop the Paused state descriptions. > > Then in the postcopy recover session, add more information on the state > machine

Re: [PATCH v2 05/10] migration/postcopy: Add postcopy-recover-setup phase

2024-06-17 Thread Fabiano Rosas
Peter Xu writes: > This patch adds a migration state on src called "postcopy-recover-setup". > The new state will describe the intermediate step starting from when the > src QEMU received a postcopy recovery request, until the migration channels > are properly established, but before the

Re: [PATCH v2 04/10] migration: Cleanup incoming migration setup state change

2024-06-17 Thread Fabiano Rosas
Peter Xu writes: > Destination QEMU can setup incoming ports for two purposes: either a fresh > new incoming migration, in which QEMU will switch to SETUP for channel > establishment, or a paused postcopy migration, in which QEMU will stay in > POSTCOPY_PAUSED until kicking off the RECOVER

Re: [PATCH v2 03/10] migration: Use MigrationStatus instead of int

2024-06-17 Thread Fabiano Rosas
Peter Xu writes: > QEMU uses "int" in most cases even if it stores MigrationStatus. I don't > know why, so let's try to do that right and see what blows up.. > > Signed-off-by: Peter Xu Reviewed-by: Fabiano Rosas

Re: [PATCH v2 00/10] migration: New postcopy state, and some cleanups

2024-06-17 Thread Peter Xu
Hello, On Mon, Jun 17, 2024 at 02:15:24PM -0400, Peter Xu wrote: > v2: > - Collect tags > - Patch 3 > - cover all states in migration_postcopy_is_alive() > - Patch 4 (old) > - English changes [Fabiano] > - Split the migration_incoming_state_setup() cleanup into a new patch > [Fabiano] >

Re: [PATCH v3 16/16] tests/qtest/migration: Add a test for mapped-ram with passing of fds

2024-06-17 Thread Peter Xu
On Mon, Jun 17, 2024 at 03:57:31PM -0300, Fabiano Rosas wrote: > Add a multifd test for mapped-ram with passing of fds into QEMU. This > is how libvirt will consume the feature. > > There are a couple of details to the fdset mechanism: > > - multifd needs two distinct file descriptors (not

Re: [PATCH v3 12/16] migration/multifd: Add direct-io support

2024-06-17 Thread Peter Xu
On Mon, Jun 17, 2024 at 03:57:27PM -0300, Fabiano Rosas wrote: > When multifd is used along with mapped-ram, we can take benefit of a > filesystem that supports the O_DIRECT flag and perform direct I/O in > the multifd threads. This brings a significant performance improvement > because direct-io

Re: [PATCH 9/9] contrib/plugins: add ips plugin example for cost modeling

2024-06-17 Thread Pierrick Bouvier
On 6/14/24 15:00, Dr. David Alan Gilbert wrote: * Pierrick Bouvier (pierrick.bouv...@linaro.org) wrote: Hi Dave, On 6/12/24 14:02, Dr. David Alan Gilbert wrote: * Alex Bennée (alex.ben...@linaro.org) wrote: From: Pierrick Bouvier This plugin uses the new time control interface to make

Re: [PATCH v3 01/16] migration: Drop reference to QIOChannel if file seeking fails

2024-06-17 Thread Peter Xu
On Mon, Jun 17, 2024 at 03:57:16PM -0300, Fabiano Rosas wrote: > We forgot to drop the reference to the QIOChannel in the error path of > the offset adjustment. Do it now. > > Signed-off-by: Fabiano Rosas Reviewed-by: Peter Xu -- Peter Xu

Re: [PATCH 9/9] contrib/plugins: add ips plugin example for cost modeling

2024-06-17 Thread Pierrick Bouvier
On 6/16/24 11:43, Alex Bennée wrote: Pierrick Bouvier writes: On 6/13/24 01:54, Philippe Mathieu-Daudé wrote: On 12/6/24 17:35, Alex Bennée wrote: From: Pierrick Bouvier This plugin uses the new time control interface to make decisions about the state of time during the emulation. The

[PATCH 12/23] Add ability to get rval2

2024-06-17 Thread Ajeet Singh
From: Warner Losh Function accesses the x1 register which holds the value Signed-off-by: Warner Losh Signed-off-by: Ajeet Singh --- bsd-user/aarch64/target_arch_vmparam.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/bsd-user/aarch64/target_arch_vmparam.h

[PATCH 06/23] Add Aarch64 register handling

2024-06-17 Thread Ajeet Singh
From: Stacey Son Header file for managing CPU register states in FreeBSD user mode Signed-off-by: Stacey Son Signed-off-by: Ajeet Singh --- bsd-user/aarch64/target_arch_reg.h | 56 ++ 1 file changed, 56 insertions(+) create mode 100644

[PATCH 20/23] Add get_mcontext function for ARM AArch64 in bsd-user

2024-06-17 Thread Ajeet Singh
From: Stacey Son function to retrieve machine context,it populates the provided target_mcontext_t structure with information from the CPUARMState registers Signed-off-by: Stacey Son Signed-off-by: Ajeet Singh Co-authored-by: Kyle Evans --- bsd-user/aarch64/signal.c | 30

[PATCH 22/23] Add set_mcontext function for ARM AArch64 in bsd-user

2024-06-17 Thread Ajeet Singh
From: Stacey Son The function copies register values from the provided target_mcontext_t structure to the CPUARMState registers Signed-off-by: Stacey Son Signed-off-by: Ajeet Singh --- bsd-user/aarch64/signal.c | 22 ++ 1 file changed, 22 insertions(+) diff --git

[PATCH 23/23] Add get_ucontext_sigreturn function

2024-06-17 Thread Ajeet Singh
From: Stacey Son Function checks the processor state to ensure that the current execution mode is EL0 and no flags indicating interrupts or exceptions are set Signed-off-by: Stacey Son Signed-off-by: Ajeet Singh --- bsd-user/aarch64/signal.c | 18 ++ 1 file changed, 18

[PATCH v3 03/16] tests/qtest/migration: Fix file migration offset check

2024-06-17 Thread Fabiano Rosas
When doing file migration, QEMU accepts an offset that should be skipped when writing the migration stream to the file. The purpose of the offset is to allow the management layer to put its own metadata at the start of the file. We have tests for this in migration-test, but only testing that the

[PATCH v3 10/16] io: Stop using qemu_open_old in channel-file

2024-06-17 Thread Fabiano Rosas
We want to make use of the Error object to report fdset errors from qemu_open_internal() and passing the error pointer to qemu_open_old() would require changing all callers. Move the file channel to the new API instead. Reviewed-by: Daniel P. Berrangé Reviewed-by: Peter Xu Signed-off-by:

[PATCH 19/23] Add ARM AArch64 signal trampoline argument setup for bsd-user

2024-06-17 Thread Ajeet Singh
From: Stacey Son function to set up signal handler arguments it populates register values in `CPUARMState` based on the provided signal, signal frame, signal action, and frame address Signed-off-by: Stacey Son Signed-off-by: Ajeet Singh --- bsd-user/aarch64/signal.c | 53

[PATCH 08/23] Add Aarch64 sysarch() system call emulation for BSD-USER

2024-06-17 Thread Ajeet Singh
From: Stacey Son Initial implementation of sysarch() syscall and a printing function Signed-off-by: Stacey Son Signed-off-by: Ajeet Singh --- bsd-user/aarch64/target_arch_sysarch.h | 42 ++ 1 file changed, 42 insertions(+) create mode 100644

[PATCH 03/23] Added function to clone CPU state

2024-06-17 Thread Ajeet Singh
From: Stacey Son Function can copy cpu state to create new thread Signed-off-by: Stacey Son Signed-off-by: Ajeet Singh --- bsd-user/aarch64/target_arch_cpu.h | 17 + 1 file changed, 17 insertions(+) diff --git a/bsd-user/aarch64/target_arch_cpu.h

[PATCH 18/23] Add ARM AArch64 specific signal definitions for bsd-user

2024-06-17 Thread Ajeet Singh
From: Stacey Son Defined register indices and sizes,introduced structures to represent general purpose registers, floating point registers, and machine context Signed-off-by: Stacey Son Signed-off-by: Warner Losh Signed-off-by: Ajeet Singh Co-authored-by: Warner Losh ---

[PATCH 10/23] Add thread initialization for BSD-USER

2024-06-17 Thread Ajeet Singh
From: Stacey Son Initializes thread's register state Signed-off-by: Stacey Son Signed-off-by: Ajeet Singh Co-authored-by: Jessica Clarke --- bsd-user/aarch64/target_arch_thread.h | 16 1 file changed, 16 insertions(+) diff --git a/bsd-user/aarch64/target_arch_thread.h

[PATCH 00/23] ARM AArch64 Support for BSD

2024-06-17 Thread Ajeet Singh
making sure to credit all the authors correctly Stacey Son (18): Add CPU initialization function Added CPU loop function Added function to clone CPU state AArch64 specific CPU for bsd-user Managing CPU register for BSD-USER Add Aarch64 register handling Add ARM AArch64 TLS

[PATCH 09/23] Add thread setup for BSD-USER

2024-06-17 Thread Ajeet Singh
From: Stacey Son Function for setting up thread upcall which will add thread support to BSD-User Signed-off-by: Stacey Son Signed-off-by: Ajeet Singh Co-authored-by: Jessica Clarke --- bsd-user/aarch64/target_arch_thread.h | 45 +++ 1 file changed, 45 insertions(+)

[PATCH 16/23] Add function to retrieve additional ARM AArch64 hwcap

2024-06-17 Thread Ajeet Singh
From: Warner Losh Function to retrieve the extended hardware capability flags Signed-off-by: Warner Losh Signed-off-by: Ajeet Singh --- bsd-user/aarch64/target_arch_elf.h | 29 + 1 file changed, 29 insertions(+) diff --git a/bsd-user/aarch64/target_arch_elf.h

[PATCH v3 04/16] tests/qtest/migration: Add a precopy file test with fdset

2024-06-17 Thread Fabiano Rosas
Add a test for file migration using fdset. The passing of fds is more complex than using a file path. This is also the scenario where it's most important we ensure that the initial migration stream offset is respected because the fdset interface is the one used by the management layer when

[PATCH 07/23] Add ARM AArch64 TLS Management Prototypes for BSD-User

2024-06-17 Thread Ajeet Singh
From: Stacey Son Prototypes for setting and getting TLS( thread local storage) Signed-off-by: Stacey Son Signed-off-by: Ajeet Singh --- bsd-user/aarch64/target_arch.h | 28 1 file changed, 28 insertions(+) create mode 100644 bsd-user/aarch64/target_arch.h diff

[PATCH v3 12/16] migration/multifd: Add direct-io support

2024-06-17 Thread Fabiano Rosas
When multifd is used along with mapped-ram, we can take benefit of a filesystem that supports the O_DIRECT flag and perform direct I/O in the multifd threads. This brings a significant performance improvement because direct-io writes bypass the page cache which would otherwise be thrashed by the

[PATCH v3 08/16] monitor: Simplify fdset and fd removal

2024-06-17 Thread Fabiano Rosas
Remove fds right away instead of setting the ->removed flag. We don't need the extra complexity of having a cleanup function reap the removed entries at a later time. Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas --- monitor/fds.c | 27 ++- 1 file changed, 6

[PATCH v3 15/16] migration: Add documentation for fdset with multifd + file

2024-06-17 Thread Fabiano Rosas
With the last few changes to the fdset infrastructure, we now allow multifd to use an fdset when migrating to a file. This is useful for the scenario where the management layer wants to have control over the migration file. By receiving the file descriptors directly, QEMU can delegate some high

[PATCH 21/23] Add setup_sigframe_arch function for ARM AArch64 in bsd-user

2024-06-17 Thread Ajeet Singh
From: Warner Losh The function utilizes the `get_mcontext` function to retrieve the machine context for the current CPUARMState Signed-off-by: Warner Losh Signed-off-by: Ajeet Singh --- bsd-user/aarch64/signal.c | 14 ++ 1 file changed, 14 insertions(+) diff --git

[PATCH v3 16/16] tests/qtest/migration: Add a test for mapped-ram with passing of fds

2024-06-17 Thread Fabiano Rosas
Add a multifd test for mapped-ram with passing of fds into QEMU. This is how libvirt will consume the feature. There are a couple of details to the fdset mechanism: - multifd needs two distinct file descriptors (not duplicated with dup()) so it can enable O_DIRECT only on the channels that do

[PATCH 17/23] Add ARM AArch64 sigcode setup function for bsd-user

2024-06-17 Thread Ajeet Singh
From: Stacey Son signal trampoline function initializes a sequence of instructions to handle signal returns and exits, and copies this code to the target offset. Signed-off-by: Stacey Son Signed-off-by: Ajeet Singh --- bsd-user/aarch64/target_arch_sigtramp.h | 48 + 1

[PATCH 02/23] Added CPU loop function

2024-06-17 Thread Ajeet Singh
From: Stacey Son CPU loop function to handle exceptions and emulate execution of instructions Signed-off-by: Stacey Son Signed-off-by: Ajeet Singh Co-authored-by: Kyle Evans Co-authored-by: Sean Bruno Co-authored-by: Jessica Clarke --- bsd-user/aarch64/target_arch_cpu.h | 132

[PATCH 05/23] Managing CPU register for BSD-USER

2024-06-17 Thread Ajeet Singh
From: Stacey Son Added structure for storing register states Signed-off-by: Stacey Son Signed-off-by: Ajeet Singh Co-authored-by: Sean Bruno --- bsd-user/aarch64/target_syscall.h | 51 +++ 1 file changed, 51 insertions(+) create mode 100644

[PATCH 14/23] Add ARM AArch64 hardware capability definitions

2024-06-17 Thread Ajeet Singh
From: Warner Losh Defined a huge list of hardware capabilites and added macros for retrieving hwcap flags Signed-off-by: Warner Losh Signed-off-by: Ajeet Singh --- bsd-user/aarch64/target_arch_elf.h | 61 ++ 1 file changed, 61 insertions(+) diff --git

[PATCH v3 11/16] migration: Add direct-io parameter

2024-06-17 Thread Fabiano Rosas
Add the direct-io migration parameter that tells the migration code to use O_DIRECT when opening the migration stream file whenever possible. This is currently only used with the mapped-ram migration that has a clear window guaranteed to perform aligned writes. Acked-by: Markus Armbruster

[PATCH v3 09/16] monitor: Report errors from monitor_fdset_dup_fd_add

2024-06-17 Thread Fabiano Rosas
I'm keeping the EACCES because callers expect to be able to look at errno. Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas --- include/monitor/monitor.h | 2 +- monitor/fds.c | 10 +- stubs/fdset.c | 2 +- util/osdep.c | 10 +- 4 files

[PATCH 15/23] Add function to retrieve ARM AArch64 hardware capabilities

2024-06-17 Thread Ajeet Singh
From: Warner Losh The function initializes default hardware capabilities and finds additional features using the `GET_FEATURE_ID` macro Signed-off-by: Warner Losh Signed-off-by: Ajeet Singh --- bsd-user/aarch64/target_arch_elf.h | 38 ++ 1 file changed, 38

[PATCH 04/23] AArch64 specific CPU for bsd-user

2024-06-17 Thread Ajeet Singh
From: Stacey Son Function to set and recieve thread-local-storage value from tpidr_el0 register Signed-off-by: Stacey Son Signed-off-by: Ajeet Singh --- bsd-user/aarch64/target_arch_cpu.c | 34 ++ 1 file changed, 34 insertions(+) create mode 100644

[PATCH v3 13/16] tests/qtest/migration: Add tests for file migration with direct-io

2024-06-17 Thread Fabiano Rosas
The tests are only allowed to run in systems that know about the O_DIRECT flag and in filesystems which support it. Note: this also brings back migrate_set_parameter_bool() which went away when we removed the compression tests. I copied it verbatim. Signed-off-by: Fabiano Rosas Reviewed-by:

[PATCH v3 02/16] migration: Fix file migration with fdset

2024-06-17 Thread Fabiano Rosas
When the "file:" migration support was added we missed the special case in the qemu_open_old implementation that allows for a particular file name format to be used to refer to a set of file descriptors that have been previously provided to QEMU via the add-fd QMP command. When using this fdset

[PATCH 11/23] Update ARM AArch64 VM parameter definitions for bsd-user

2024-06-17 Thread Ajeet Singh
From: Stacey Son Defined address spaces for FreeBSD/arm64 and added function for getting stack pointer from CPU and setting a return value. Signed-off-by: Stacey Son Signed-off-by: Warner Losh Signed-off-by: Ajeet Singh Co-authored-by: Sean Bruno Co-authored-by: Warner Losh ---

[PATCH v3 07/16] monitor: Stop removing non-duplicated fds

2024-06-17 Thread Fabiano Rosas
monitor_fdsets_cleanup() currently has three responsibilities: 1- Remove the fds that have been marked for removal(->removed=true) by qmp_remove_fd(). This is overly complicated, but ok. 2- Remove any file descriptors that have been passed into QEMU and never duplicated[1,2]. A file

[PATCH v3 14/16] monitor: fdset: Match against O_DIRECT

2024-06-17 Thread Fabiano Rosas
We're about to enable the use of O_DIRECT in the migration code and due to the alignment restrictions imposed by filesystems we need to make sure the flag is only used when doing aligned IO. The migration will do parallel IO to different regions of a file, so we need to use more than one file

[PATCH 01/23] Add CPU initialization function

2024-06-17 Thread Ajeet Singh
From: Stacey Son Addded function to initialize ARM CPU and to check if it supports 64 bit mode Signed-off-by: Ajeet Singh Signed-off-by: Stacey Son --- bsd-user/aarch64/target_arch_cpu.h | 42 ++ 1 file changed, 42 insertions(+) create mode 100644

[PATCH 13/23] Add ARM AArch64 ELF definitions for bsd-user

2024-06-17 Thread Ajeet Singh
From: Stacey Son Defined mmap and dynamic load adresses and set various elf parameters Signed-off-by: Stacey Son Signed-off-by: Ajeet Singh Co-authored-by: Kyle Evans --- bsd-user/aarch64/target_arch_elf.h | 37 ++ 1 file changed, 37 insertions(+) create mode

[PATCH v3 01/16] migration: Drop reference to QIOChannel if file seeking fails

2024-06-17 Thread Fabiano Rosas
We forgot to drop the reference to the QIOChannel in the error path of the offset adjustment. Do it now. Signed-off-by: Fabiano Rosas --- migration/file.c | 1 + 1 file changed, 1 insertion(+) diff --git a/migration/file.c b/migration/file.c index ab18ba505a..2bb8c64092 100644 ---

[PATCH v3 00/16] migration/mapped-ram: Add direct-io support

2024-06-17 Thread Fabiano Rosas
Hi, Not many changes since v2: - new patch 1: drop IOC reference on offset check failure - dropped 2 patches adding direct-io to the single threaded migration. We have agreed to use multifd with 1 channel for that use-case. CI run: https://gitlab.com/farosas/qemu/-/pipelines/1335719164

[PATCH v3 05/16] monitor: Drop monitor_fdset_dup_fd_find/_remove()

2024-06-17 Thread Fabiano Rosas
From: Peter Xu Those functions are not needed, one remove function should already work. Clean it up. Here the code doesn't really care about whether we need to keep that dupfd around if close() failed: when that happens something got very wrong, keeping the dup_fd around the fdsets may not

[PATCH v3 06/16] monitor: Introduce monitor_fdset_*free

2024-06-17 Thread Fabiano Rosas
Introduce new functions to remove and free no longer used fds and fdsets. We need those to decouple the remove/free routines from monitor_fdset_cleanup() which will go away in the next patches. The new functions: - monitor_fdset_free/_if_empty() will be used when a monitor connection closes

Re: [PULL v2 00/19] aspeed queue

2024-06-17 Thread Richard Henderson
://github.com/legoater/qemu/ tags/pull-aspeed-20240617 for you to fetch changes up to 5f44521242d2fdfa190206a6be40577a58a71ef9: MAINTAINERS: Add reviewers for ASPEED BMCs (2024-06-16 21:08:54 +0200) aspeed queue: * Add AST2700 support

Re: [PATCH v2] os-posix: Expand setrlimit() syscall compatibility

2024-06-17 Thread Richard Henderson
On 6/17/24 08:15, Philippe Mathieu-Daudé wrote: On 17/6/24 15:07, Michael Tokarev wrote: 17.06.2024 10:19, Philippe Mathieu-Daudé wrote: Hi Trent, On 14/6/24 23:06, Trent Huber wrote: Darwin uses a subtly different version of the setrlimit() syscall as described in the COMPATIBILITY section

[PATCH v2 04/10] migration: Cleanup incoming migration setup state change

2024-06-17 Thread Peter Xu
Destination QEMU can setup incoming ports for two purposes: either a fresh new incoming migration, in which QEMU will switch to SETUP for channel establishment, or a paused postcopy migration, in which QEMU will stay in POSTCOPY_PAUSED until kicking off the RECOVER phase. Now the state machine

[PATCH v2 07/10] tests/migration-tests: Drop most WIN32 ifdefs for postcopy failure tests

2024-06-17 Thread Peter Xu
Most of them are not needed, we can stick with one ifdef inside postcopy_recover_fail() so as to cover the scm right tricks only. The tests won't run on windows anyway due to has_uffd always false. Signed-off-by: Peter Xu --- tests/qtest/migration-test.c | 10 ++ 1 file changed, 2

  1   2   3   4   >