Re: [PATCH v2 2/2] vhost-user: add a request-reply lock

2024-08-28 Thread Michael S. Tsirkin
On Thu, Aug 29, 2024 at 11:09:44AM +0530, Prasad Pandit wrote: > On Wed, 28 Aug 2024 at 16:45, Michael S. Tsirkin wrote: > > > - Place QEMU_LOCK_GUARD near the vhost_user_write() calls, holding > > >the lock for longer fails some tests during rpmbuild(8). > > > > what do you mean fails rpmbui

[PATCH] docs/devel: Prohibit calling object_unparent() for memory region

2024-08-28 Thread Akihiko Odaki
Previously it was allowed to call object_unparent() for a memory region in instance_finalize() of its parent. However, such a call typically has no effect because child objects get unparented before instance_finalize(). Worse, memory regions typically gets finalized when they get unparented before

Re: [PATCH v2 2/2] vhost-user: add a request-reply lock

2024-08-28 Thread Prasad Pandit
On Wed, 28 Aug 2024 at 16:45, Michael S. Tsirkin wrote: > > - Place QEMU_LOCK_GUARD near the vhost_user_write() calls, holding > >the lock for longer fails some tests during rpmbuild(8). > > what do you mean fails rpmbuild? that qemu with this patch can not be > compiled? * In V1 of this pa

Re: [PATCH v4 6/7] memory: Do not create circular reference with subregion

2024-08-28 Thread Akihiko Odaki
On 2024/08/29 0:56, Peter Xu wrote: On Wed, Aug 28, 2024 at 11:02:06PM +0900, Akihiko Odaki wrote: On 2024/08/28 22:09, Peter Xu wrote: On Wed, Aug 28, 2024 at 02:33:59PM +0900, Akihiko Odaki wrote: On 2024/08/28 1:11, Peter Xu wrote: On Tue, Aug 27, 2024 at 01:14:51PM +0900, Akihiko Odaki wr

Re: qemu-hppa-user: crashes immediately in hppa chroot

2024-08-28 Thread Richard Henderson
On 8/29/24 03:12, Helge Deller wrote: Hi Richard, I tested qemu-user from v9.1-rc4 for hppa and noticed that it crashes immediately when starting a hppa chroot. I was able to bisect the segfault back to commit 081a0ed188d8d9d9038f00337d331d185a7ae331 Author: Richard Henderson Date: Wed Mar 2

[PATCH v5 2/3] hw/acpi: Upgrade ACPI SPCR table to support SPCR table revision 4 format

2024-08-28 Thread Sia Jee Heng
Update the SPCR table to accommodate the SPCR Table revision 4 [1]. The SPCR table has been modified to adhere to the revision 4 format [2]. [1]: https://learn.microsoft.com/en-us/windows-hardware/drivers/serports/serial-port-console-redirection-table [2]: https://github.com/acpica/acpica/pull/93

[PATCH v5 3/3] tests/qtest/bios-tables-test: Update virt SPCR golden reference for RISC-V

2024-08-28 Thread Sia Jee Heng
Update the virt SPCR golden reference file for RISC-V to accommodate the SPCR Table revision 4 [1], utilizing the iasl binary compiled from the latest ACPICA repository. The SPCR table has been modified to adhere to the revision 4 format [2]. [1]: https://learn.microsoft.com/en-us/windows-hardwar

[PATCH v5 1/3] qtest: allow SPCR acpi table changes

2024-08-28 Thread Sia Jee Heng
Signed-off-by: Sia Jee Heng Reviewed-by: Sunil V L Acked-by: Alistair Francis --- tests/qtest/bios-tables-test-allowed-diff.h | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h index dfb8523c8b..aae97304

[PATCH v5 0/3] Upgrade ACPI SPCR table to support SPCR table revision 4 format

2024-08-28 Thread Sia Jee Heng
Update the SPCR table to accommodate the SPCR Table revision 4 [1]. The SPCR table has been modified to adhere to the revision 4 format [2]. Meanwhile, the virt SPCR golden reference file for RISC-V have been updated to accommodate the SPCR Table revision 4. [1]: https://learn.microsoft.com/en-u

Re: [PATCH v11 12/20] target/riscv: tb flag for shadow stack instructions

2024-08-28 Thread Richard Henderson
On 8/29/24 03:47, Deepak Gupta wrote: --- a/target/riscv/cpu_helper.c +++ b/target/riscv/cpu_helper.c @@ -169,6 +169,10 @@ void cpu_get_tb_cpu_state(CPURISCVState *env, vaddr *pc, flags = FIELD_DP32(flags, TB_FLAGS, FCFI_ENABLED, 1); } +if (cpu_get_bcfien(env)) { +

Re: [PATCH] linux-user: add openat2 support in linux-user

2024-08-28 Thread Richard Henderson
On 8/29/24 00:42, Michael Vogt wrote: This commit adds support for the `openat2()` syscall in the `linux-user` userspace emulator. It is implemented by extracting a new helper `maybe_do_fake_open()` out of the exiting `do_guest_openat()` and share that with the new `do_guest_openat2()`. Unfortun

Re: [PATCH v2 00/17] Multifd 🔀 device state transfer support with VFIO consumer

2024-08-28 Thread Fabiano Rosas
"Maciej S. Szmigiero" writes: > On 28.08.2024 22:46, Fabiano Rosas wrote: >> "Maciej S. Szmigiero" writes: >> >>> From: "Maciej S. Szmigiero" >>> >>> This is an updated v2 patch series of the v1 series located here: >>> https://lore.kernel.org/qemu-devel/cover.1718717584.git.maciej.szmigi...@o

Re: [PATCH v3 4/4] tests/tcg/aarch64: Extend MTE gdbstub tests to system mode

2024-08-28 Thread Richard Henderson
On 8/28/24 04:01, Gustavo Romero wrote:  SECTIONS  { -    /* virt machine, RAM starts at 1gb */ +    /* Skip first 1 GiB on virt machine: RAM starts at 1 GiB. */ . = (1 << 30); Better is to use MEMORY { RAM (rwx) : ORIGIN = 1 << 30, LENGTH = 16M } (or whatever minimum length seems r

Re: [PATCH v2 12/17] migration/multifd: Device state transfer support - send side

2024-08-28 Thread Fabiano Rosas
"Maciej S. Szmigiero" writes: > From: "Maciej S. Szmigiero" > > A new function multifd_queue_device_state() is provided for device to queue > its state for transmission via a multifd channel. > > Signed-off-by: Maciej S. Szmigiero > --- > include/migration/misc.h | 4 ++ > migration/m

Re: [PATCH v11 13/20] target/riscv: mmu changes for zicfiss shadow stack protection

2024-08-28 Thread Deepak Gupta
On Thu, Aug 29, 2024 at 10:03:04AM +1000, Alistair Francis wrote: On Thu, Aug 29, 2024 at 9:45 AM Deepak Gupta wrote: On Thu, Aug 29, 2024 at 09:29:49AM +1000, Alistair Francis wrote: >On Thu, Aug 29, 2024 at 3:49 AM Deepak Gupta wrote: >> >> prot |= PAGE_WRITE; >> } >> -if

Re: [PATCH v11 16/20] target/riscv: implement zicfiss instructions

2024-08-28 Thread Deepak Gupta
On Thu, Aug 29, 2024 at 10:07:15AM +1000, Alistair Francis wrote: On Thu, Aug 29, 2024 at 10:06 AM Deepak Gupta wrote: On Thu, Aug 29, 2024 at 10:01:30AM +1000, Alistair Francis wrote: >On Thu, Aug 29, 2024 at 3:53 AM Deepak Gupta wrote: >> >> zicfiss has following instructions >> - sspopchk

Re: [PATCH v11 16/20] target/riscv: implement zicfiss instructions

2024-08-28 Thread Alistair Francis
On Thu, Aug 29, 2024 at 10:06 AM Deepak Gupta wrote: > > On Thu, Aug 29, 2024 at 10:01:30AM +1000, Alistair Francis wrote: > >On Thu, Aug 29, 2024 at 3:53 AM Deepak Gupta wrote: > >> > >> zicfiss has following instructions > >> - sspopchk: pops a value from shadow stack and compares with x1/x5.

Re: [PATCH v11 20/20] target/riscv: Expose zicfiss extension as a cpu property

2024-08-28 Thread Alistair Francis
On Thu, Aug 29, 2024 at 3:52 AM Deepak Gupta wrote: > > Signed-off-by: Deepak Gupta Reviewed-by: Alistair Francis Alistair > --- > target/riscv/cpu.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c > index c5ebcefeb5..2592465e24 100644 > --- a

Re: [PATCH v11 19/20] disas/riscv: enable disassembly for compressed sspush/sspopchk

2024-08-28 Thread Alistair Francis
On Thu, Aug 29, 2024 at 3:53 AM Deepak Gupta wrote: > > sspush and sspopchk have equivalent compressed encoding taken from zcmop. > cmop.1 is sspush x1 while cmop.5 is sspopchk x5. Due to unusual encoding > for both rs1 and rs2 from space bitfield, this required a new codec. > > Signed-off-by: Dee

Re: [PATCH v11 16/20] target/riscv: implement zicfiss instructions

2024-08-28 Thread Deepak Gupta
On Thu, Aug 29, 2024 at 10:01:30AM +1000, Alistair Francis wrote: On Thu, Aug 29, 2024 at 3:53 AM Deepak Gupta wrote: zicfiss has following instructions - sspopchk: pops a value from shadow stack and compares with x1/x5. If they dont match, reports a sw check exception with tval = 3. - ss

Re: [PATCH v11 18/20] disas/riscv: enable disassembly for zicfiss instructions

2024-08-28 Thread Alistair Francis
On Thu, Aug 29, 2024 at 3:52 AM Deepak Gupta wrote: > > Enable disassembly for sspush, sspopchk, ssrdp & ssamoswap. > Disasembly is only enabled if zimop and zicfiss ext is set to true. > > Signed-off-by: Deepak Gupta Acked-by: Alistair Francis Alistair > --- > disas/riscv.c | 40 +++

Re: [PATCH v11 17/20] target/riscv: compressed encodings for sspush and sspopchk

2024-08-28 Thread Alistair Francis
On Thu, Aug 29, 2024 at 3:50 AM Deepak Gupta wrote: > > sspush/sspopchk have compressed encodings carved out of zcmops. > compressed sspush is designated as c.mop.1 while compressed sspopchk > is designated as c.mop.5. > > Note that c.sspush x1 exists while c.sspush x5 doesn't. Similarly > c.sspop

Re: [PATCH v11 13/20] target/riscv: mmu changes for zicfiss shadow stack protection

2024-08-28 Thread Alistair Francis
On Thu, Aug 29, 2024 at 9:45 AM Deepak Gupta wrote: > > On Thu, Aug 29, 2024 at 09:29:49AM +1000, Alistair Francis wrote: > >On Thu, Aug 29, 2024 at 3:49 AM Deepak Gupta wrote: > >> > >> zicfiss protects shadow stack using new page table encodings PTE.W=1, > >> PTE.R=0 and PTE.X=0. This encoding

Re: [PATCH v11 16/20] target/riscv: implement zicfiss instructions

2024-08-28 Thread Alistair Francis
On Thu, Aug 29, 2024 at 3:53 AM Deepak Gupta wrote: > > zicfiss has following instructions > - sspopchk: pops a value from shadow stack and compares with x1/x5. >If they dont match, reports a sw check exception with tval = 3. > - sspush: pushes value in x1/x5 on shadow stack > - ssrdp: read

Re: [PATCH v11 13/20] target/riscv: mmu changes for zicfiss shadow stack protection

2024-08-28 Thread Deepak Gupta
On Thu, Aug 29, 2024 at 09:29:49AM +1000, Alistair Francis wrote: On Thu, Aug 29, 2024 at 3:49 AM Deepak Gupta wrote: zicfiss protects shadow stack using new page table encodings PTE.W=1, PTE.R=0 and PTE.X=0. This encoding is reserved if zicfiss is not implemented or if shadow stack are not en

Re: [PATCH v11 15/20] target/riscv: update `decode_save_opc` to store extra word2

2024-08-28 Thread Alistair Francis
On Thu, Aug 29, 2024 at 3:51 AM Deepak Gupta wrote: > > Extra word 2 is stored during tcg compile and `decode_save_opc` needs > additional argument in order to pass the value. This will be used during > unwind to get extra information about instruction like how to massage > exceptions. Updated all

Re: [PATCH v1 15/15] tcg/riscv: Enable vector TCG host-native

2024-08-28 Thread Richard Henderson
On 8/27/24 18:31, LIU Zhiwei wrote: We will use this one. But probe the vlen in util/cpuinfo-riscv.c has no meaning as we sometimes use the compiler settings or hw_probe API. In these cases, the vlen detected in util/cpuinfo-riscv.c is zero. Pardon? While you might check __riscv_zve64x at com

Re: [PATCH v11 14/20] target/riscv: AMO operations always raise store/AMO fault

2024-08-28 Thread Alistair Francis
On Thu, Aug 29, 2024 at 3:49 AM Deepak Gupta wrote: > > This patch adds one more word for tcg compile which can be obtained during > unwind time to determine fault type for original operation (example AMO). > Depending on that, fault can be promoted to store/AMO fault. > > Signed-off-by: Deepak Gu

Re: [PATCH v11 13/20] target/riscv: mmu changes for zicfiss shadow stack protection

2024-08-28 Thread Alistair Francis
On Thu, Aug 29, 2024 at 3:49 AM Deepak Gupta wrote: > > zicfiss protects shadow stack using new page table encodings PTE.W=1, > PTE.R=0 and PTE.X=0. This encoding is reserved if zicfiss is not > implemented or if shadow stack are not enabled. > Loads on shadow stack memory are allowed while stores

Re: [PATCH v11 11/20] target/riscv: introduce ssp and enabling controls for zicfiss

2024-08-28 Thread Alistair Francis
On Thu, Aug 29, 2024 at 3:54 AM Deepak Gupta wrote: > > zicfiss introduces a new state ssp ("shadow stack register") in cpu. > ssp is expressed as a new unprivileged csr (CSR_SSP=0x11) and holds > virtual address for shadow stack as programmed by software. > > Shadow stack (for each mode) is enabl

Re: [PULL 3/6] qemu/osdep: Split qemu_close_all_open_fd() and add fallback

2024-08-28 Thread Richard Henderson
On 8/28/24 22:48, Daniel P. Berrangé wrote: dir = opendir("/proc/self/fd"); IIUC from previous threads this is valid on Linux and on Solaris. On FreeBSD & macOS, you need /dev/fd though. Fair, but importantly, it doesn't do anything *incorrect* those systems: it merely skips this meth

Re: [PULL 0/1] QAPI patches patches for 2024-08-27

2024-08-28 Thread Richard Henderson
On 8/27/24 20:35, Markus Armbruster wrote: I'm nominating this fix for v9.1 because it can only affect generated documentation, and CI should protect us from surprise build breaks. Feel free to delay it to v9.2 if you think even that is too much risk or simply too much trouble to be worthwhile.

Re: [PATCH v2 00/17] Multifd 🔀 device state transfer support with VFIO consumer

2024-08-28 Thread Maciej S. Szmigiero
On 28.08.2024 22:46, Fabiano Rosas wrote: "Maciej S. Szmigiero" writes: From: "Maciej S. Szmigiero" This is an updated v2 patch series of the v1 series located here: https://lore.kernel.org/qemu-devel/cover.1718717584.git.maciej.szmigi...@oracle.com/ Changes from v1: * Extended the QEMU thr

Re: [PATCH v2 00/17] Multifd 🔀 device state transfer support with VFIO consumer

2024-08-28 Thread Fabiano Rosas
"Maciej S. Szmigiero" writes: > From: "Maciej S. Szmigiero" > > This is an updated v2 patch series of the v1 series located here: > https://lore.kernel.org/qemu-devel/cover.1718717584.git.maciej.szmigi...@oracle.com/ > > Changes from v1: > * Extended the QEMU thread-pool with non-AIO (generic) p

Re: [PATCH RFC V3 00/29] Support of Virtual CPU Hotplug for ARMv8 Arch

2024-08-28 Thread Gustavo Romero
Hi Salil, On 6/13/24 8:36 PM, Salil Mehta via wrote: PROLOGUE To assist in review and set the right expectations from this RFC, please first read the sections *APPENDED AT THE END* of this cover letter: 1. Important *DISCLAIMER* [Section (X)] 2. Work presented at KVMForum Conference (

Re: [PATCH RFC V3 24/29] target/arm: Add support of *unrealize* ARMCPU during vCPU Hot-unplug

2024-08-28 Thread Gustavo Romero
Hi Salil, On 8/19/24 9:35 AM, Salil Mehta via wrote: Hi Alex, From: Alex Bennée Sent: Friday, August 16, 2024 4:37 PM To: Salil Mehta Salil Mehta writes: > vCPU Hot-unplug will result in QOM CPU object unrealization which will > do away with all the vCPU thread creations,

Re: [PATCH v2 02/17] migration/ram: Add load start trace event

2024-08-28 Thread Maciej S. Szmigiero
On 28.08.2024 20:44, Fabiano Rosas wrote: "Maciej S. Szmigiero" writes: From: "Maciej S. Szmigiero" There's a RAM load complete trace event but there wasn't its start equivalent. Signed-off-by: Maciej S. Szmigiero --- migration/ram.c| 1 + migration/trace-events | 1 + 2 files

Re: [PATCH v5 5/8] device/virtio-nsm: Support for Nitro Secure Module device

2024-08-28 Thread Michael S. Tsirkin
On Thu, Aug 29, 2024 at 01:04:05AM +0600, Dorjoy Chowdhury wrote: > On Thu, Aug 29, 2024 at 12:28 AM Michael S. Tsirkin wrote: > > > > On Thu, Aug 22, 2024 at 09:08:46PM +0600, Dorjoy Chowdhury wrote: > > > Nitro Secure Module (NSM)[1] device is used in AWS Nitro Enclaves[2] > > > for stripped dow

Re: [PATCH v5 5/8] device/virtio-nsm: Support for Nitro Secure Module device

2024-08-28 Thread Dorjoy Chowdhury
On Thu, Aug 29, 2024 at 12:28 AM Michael S. Tsirkin wrote: > > On Thu, Aug 22, 2024 at 09:08:46PM +0600, Dorjoy Chowdhury wrote: > > Nitro Secure Module (NSM)[1] device is used in AWS Nitro Enclaves[2] > > for stripped down TPM functionality like cryptographic attestation. > > The requests to and

Re: [PATCH v2 06/17] migration: Add save_live_complete_precopy_{begin,end} handlers

2024-08-28 Thread Fabiano Rosas
"Maciej S. Szmigiero" writes: > From: "Maciej S. Szmigiero" > > These SaveVMHandlers help device provide its own asynchronous > transmission of the remaining data at the end of a precopy phase. > > In this use case the save_live_complete_precopy_begin handler might > be used to mark the stream b

Re: [PATCH v2 03/17] migration/multifd: Zero p->flags before starting filling a packet

2024-08-28 Thread Fabiano Rosas
"Maciej S. Szmigiero" writes: > From: "Maciej S. Szmigiero" > > This way there aren't stale flags there. > > p->flags can't contain SYNC to be sent at the next RAM packet since syncs > are now handled separately in multifd_send_thread. > > Signed-off-by: Maciej S. Szmigiero Reviewed-by: Fabian

Re: [PATCH v2 02/17] migration/ram: Add load start trace event

2024-08-28 Thread Fabiano Rosas
"Maciej S. Szmigiero" writes: > From: "Maciej S. Szmigiero" > > There's a RAM load complete trace event but there wasn't its start equivalent. > > Signed-off-by: Maciej S. Szmigiero > --- > migration/ram.c| 1 + > migration/trace-events | 1 + > 2 files changed, 2 insertions(+) > > dif

Re: [PATCH v5 5/8] device/virtio-nsm: Support for Nitro Secure Module device

2024-08-28 Thread Michael S. Tsirkin
On Thu, Aug 22, 2024 at 09:08:46PM +0600, Dorjoy Chowdhury wrote: > Nitro Secure Module (NSM)[1] device is used in AWS Nitro Enclaves[2] > for stripped down TPM functionality like cryptographic attestation. > The requests to and responses from NSM device are CBOR[3] encoded. > > This commit adds s

[PATCH v11 11/20] target/riscv: introduce ssp and enabling controls for zicfiss

2024-08-28 Thread Deepak Gupta
zicfiss introduces a new state ssp ("shadow stack register") in cpu. ssp is expressed as a new unprivileged csr (CSR_SSP=0x11) and holds virtual address for shadow stack as programmed by software. Shadow stack (for each mode) is enabled via bit3 in *envcfg CSRs. Shadow stack can be enabled for a m

[PATCH v11 10/20] target/riscv: Add zicfiss extension

2024-08-28 Thread Deepak Gupta
zicfiss [1] riscv cpu extension enables backward control flow integrity. This patch sets up space for zicfiss extension in cpuconfig. And imple- ments dependency on A, zicsr, zimop and zcmop extensions. [1] - https://github.com/riscv/riscv-cfi Signed-off-by: Deepak Gupta Co-developed-by: Jim Sh

Re: [PATCH v11 00/20] riscv support for control flow integrity extensions

2024-08-28 Thread Deepak Gupta
On Wed, Aug 28, 2024 at 10:47:18AM -0700, Deepak Gupta wrote: v11 for riscv zicfilp and zicfiss extensions support in qemu. Sorry once again, some problem in my work-flow and it missed picked up below " zicfilp and zicfiss spec pdf https://github.com/riscv/riscv-cfi/releases/download/v1.0/risc

[PATCH v11 12/20] target/riscv: tb flag for shadow stack instructions

2024-08-28 Thread Deepak Gupta
Shadow stack instructions can be decoded as zimop / zcmop or shadow stack instructions depending on whether shadow stack are enabled at current privilege. This requires a TB flag so that correct TB generation and correct TB lookup happens. `DisasContext` gets a field indicating whether bcfi is enab

[PATCH v11 15/20] target/riscv: update `decode_save_opc` to store extra word2

2024-08-28 Thread Deepak Gupta
Extra word 2 is stored during tcg compile and `decode_save_opc` needs additional argument in order to pass the value. This will be used during unwind to get extra information about instruction like how to massage exceptions. Updated all callsites as well. Signed-off-by: Deepak Gupta Reviewed-by:

[PATCH v11 04/20] target/riscv: save and restore elp state on priv transitions

2024-08-28 Thread Deepak Gupta
elp state is recorded in *status on trap entry (less privilege to higher privilege) and restored in elp from *status on trap exit (higher to less privilege). Additionally this patch introduces a forward cfi helper function to determine if current privilege has forward cfi is enabled or not based o

[PATCH v11 06/20] target/riscv: tracking indirect branches (fcfi) for zicfilp

2024-08-28 Thread Deepak Gupta
zicfilp protects forward control flow (if enabled) by enforcing all indirect call and jmp must land on a landing pad instruction `lpad`. If target of an indirect call or jmp is not `lpad` then cpu/hart must raise a sw check exception with tval = 2. This patch implements the mechanism using TCG. Ta

[PATCH v11 09/20] target/riscv: Expose zicfilp extension as a cpu property

2024-08-28 Thread Deepak Gupta
Signed-off-by: Deepak Gupta Reviewed-by: Alistair Francis --- target/riscv/cpu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 55754cb374..c9aeffee4e 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -1481,6 +1481,7 @@ const RISCVCPUM

[PATCH v11 20/20] target/riscv: Expose zicfiss extension as a cpu property

2024-08-28 Thread Deepak Gupta
Signed-off-by: Deepak Gupta --- target/riscv/cpu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index c5ebcefeb5..2592465e24 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -1485,6 +1485,7 @@ const RISCVCPUMultiExtConfig riscv_cpu_extensi

[PATCH v11 08/20] disas/riscv: enable `lpad` disassembly

2024-08-28 Thread Deepak Gupta
Signed-off-by: Deepak Gupta Co-developed-by: Jim Shu Co-developed-by: Andy Chiu Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis --- disas/riscv.c | 18 +- disas/riscv.h | 2 ++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/disas/riscv.c b/disas/r

[PATCH v11 19/20] disas/riscv: enable disassembly for compressed sspush/sspopchk

2024-08-28 Thread Deepak Gupta
sspush and sspopchk have equivalent compressed encoding taken from zcmop. cmop.1 is sspush x1 while cmop.5 is sspopchk x5. Due to unusual encoding for both rs1 and rs2 from space bitfield, this required a new codec. Signed-off-by: Deepak Gupta --- disas/riscv.c | 19 ++- disas/ri

[PATCH v11 07/20] target/riscv: zicfilp `lpad` impl and branch tracking

2024-08-28 Thread Deepak Gupta
Implements setting lp expected when `jalr` is encountered and implements `lpad` instruction of zicfilp. `lpad` instruction is taken out of auipc x0, . This is an existing HINTNOP space. If `lpad` is target of an indirect branch, cpu checks for 20 bit value in x7 upper with 20 bit value embedded in

[PATCH v11 02/20] target/riscv: Add zicfilp extension

2024-08-28 Thread Deepak Gupta
zicfilp [1] riscv cpu extension enables forward control flow integrity. If enabled, all indirect calls must land on a landing pad instruction. This patch sets up space for zicfilp extension in cpuconfig. zicfilp is dependend on zicsr. [1] - https://github.com/riscv/riscv-cfi Signed-off-by: Deepa

[PATCH v11 17/20] target/riscv: compressed encodings for sspush and sspopchk

2024-08-28 Thread Deepak Gupta
sspush/sspopchk have compressed encodings carved out of zcmops. compressed sspush is designated as c.mop.1 while compressed sspopchk is designated as c.mop.5. Note that c.sspush x1 exists while c.sspush x5 doesn't. Similarly c.sspopchk x5 exists while c.sspopchk x1 doesn't. Signed-off-by: Deepak

[PATCH v11 00/20] riscv support for control flow integrity extensions

2024-08-28 Thread Deepak Gupta
v11 for riscv zicfilp and zicfiss extensions support in qemu. Links for previous versions [1] - v1 https://lists.nongnu.org/archive/html/qemu-devel/2024-07/msg06017.html [2] - v2 https://lore.kernel.org/all/ed23bcbc-fdc4-4492-803c-daa958803...@linaro.org/T/ [3] - v3 https://lists.nongnu.org/archi

[PATCH v11 16/20] target/riscv: implement zicfiss instructions

2024-08-28 Thread Deepak Gupta
zicfiss has following instructions - sspopchk: pops a value from shadow stack and compares with x1/x5. If they dont match, reports a sw check exception with tval = 3. - sspush: pushes value in x1/x5 on shadow stack - ssrdp: reads current shadow stack - ssamoswap: swaps contents of shadow sta

[PATCH v11 18/20] disas/riscv: enable disassembly for zicfiss instructions

2024-08-28 Thread Deepak Gupta
Enable disassembly for sspush, sspopchk, ssrdp & ssamoswap. Disasembly is only enabled if zimop and zicfiss ext is set to true. Signed-off-by: Deepak Gupta --- disas/riscv.c | 40 +++- disas/riscv.h | 1 + 2 files changed, 40 insertions(+), 1 deletion(-) dif

[PATCH v11 14/20] target/riscv: AMO operations always raise store/AMO fault

2024-08-28 Thread Deepak Gupta
This patch adds one more word for tcg compile which can be obtained during unwind time to determine fault type for original operation (example AMO). Depending on that, fault can be promoted to store/AMO fault. Signed-off-by: Deepak Gupta Suggested-by: Richard Henderson Reviewed-by: Richard Hende

[PATCH v11 05/20] target/riscv: additional code information for sw check

2024-08-28 Thread Deepak Gupta
sw check exception support was recently added. This patch further augments sw check exception by providing support for additional code which is provided in *tval. Adds `sw_check_code` field in cpuarchstate. Whenever sw check exception is raised *tval gets the value deposited in `sw_check_code`. Si

[PATCH v11 03/20] target/riscv: Introduce elp state and enabling controls for zicfilp

2024-08-28 Thread Deepak Gupta
zicfilp introduces a new state elp ("expected landing pad") in cpu. During normal execution, elp is idle (NO_LP_EXPECTED) i.e not expecting landing pad. On an indirect call, elp moves LP_EXPECTED. When elp is LP_EXPECTED, only a subsquent landing pad instruction can set state back to NO_LP_EXPECTED

[PATCH v11 13/20] target/riscv: mmu changes for zicfiss shadow stack protection

2024-08-28 Thread Deepak Gupta
zicfiss protects shadow stack using new page table encodings PTE.W=1, PTE.R=0 and PTE.X=0. This encoding is reserved if zicfiss is not implemented or if shadow stack are not enabled. Loads on shadow stack memory are allowed while stores to shadow stack memory leads to access faults. Shadow stack ac

[PATCH v11 01/20] target/riscv: expose *envcfg csr and priv to qemu-user as well

2024-08-28 Thread Deepak Gupta
Execution environment config CSR controlling user env and current privilege state shouldn't be limited to qemu-system only. *envcfg CSRs control enabling of features in next lesser mode. In some cases bits *envcfg CSR can be lit up by kernel as part of kernel policy or software (user app) can choos

qemu-hppa-user: crashes immediately in hppa chroot

2024-08-28 Thread Helge Deller
Hi Richard, I tested qemu-user from v9.1-rc4 for hppa and noticed that it crashes immediately when starting a hppa chroot. I was able to bisect the segfault back to commit 081a0ed188d8d9d9038f00337d331d185a7ae331 Author: Richard Henderson Date: Wed Mar 27 13:04:00 2024 -1000 target/hppa: D

Re: [PATCH v3 3/3] Do not access /dev/mem in MSI-X PCI passthrough on Xen

2024-08-28 Thread Anthony PERARD
On Mon, May 06, 2024 at 02:33:22AM +0200, Marek Marczykowski-Górecki wrote: > diff --git a/hw/xen/xen_pt_msi.c b/hw/xen/xen_pt_msi.c > index 09cca4e..836cc9c 100644 > --- a/hw/xen/xen_pt_msi.c > +++ b/hw/xen/xen_pt_msi.c > @@ -493,7 +501,12 @@ static uint64_t pci_msix_read(void *opaque, hwaddr addr

Re: [RFC qemu 0/6] hw/cxl: Link speed and width control

2024-08-28 Thread Jonathan Cameron via
On Fri, 12 Jul 2024 13:24:08 +0100 Jonathan Cameron wrote: > Based-on: [PATCH v5 00/13] acpi: NUMA nodes for CXL HB as GP + complex NUMA > test > Based-on: Message-ID: 20240712110837.1439736-1-jonathan.came...@huawei.com Hi All, I'd like to get this missing piece in 9.2. So if anyone has time

Re: [PATCH v3 2/3] Update Xen's features.h header

2024-08-28 Thread Anthony PERARD
On Mon, May 06, 2024 at 02:33:21AM +0200, Marek Marczykowski-Górecki wrote: > Update it to get XENFEAT_dm_msix_all_writes for the next patch. > > Signed-off-by: Marek Marczykowski-Górecki Reviewed-by: Anthony PERARD Thanks, -- Anthony Perard | Vates XCP-ng Developer XCP-ng & Xen Orchestra -

Re: [PATCH v5 10/13] hw/acpi: Generic Port Affinity Structure support

2024-08-28 Thread Jonathan Cameron via
On Mon, 15 Jul 2024 16:48:41 +0200 Igor Mammedov wrote: > On Fri, 12 Jul 2024 12:08:14 +0100 > Jonathan Cameron wrote: > > > These are very similar to the recently added Generic Initiators > > but instead of representing an initiator of memory traffic they > > represent an edge point beyond whi

Re: [PATCH v3 1/3] hw/xen/xen_pt: Save back data only for declared registers

2024-08-28 Thread Anthony PERARD
On Mon, May 06, 2024 at 02:33:20AM +0200, Marek Marczykowski-Górecki wrote: > Call pci_default_write_config() only after resolving any handlers from > XenPTRegInfo structures, and only with a value updated with those > handlers. This is important for two reasons: > 1. XenPTRegInfo has ro_mask which

Re: [PATCH v2] softmmu/physmem: fix memory leak in dirty_memory_extend()

2024-08-28 Thread Peter Xu
On Wed, Aug 28, 2024 at 11:07:43AM +0200, David Hildenbrand wrote: > As reported by Peter, we might be leaking memory when removing the > highest RAMBlock (in the weird ram_addr_t space), and adding a new one. > > We will fail to realize that we already allocated bitmaps for more > dirty memory bl

Re: [PATCH 1/1] include/qemu/bitops.h: Add deposit8 for uint8_t bit operation

2024-08-28 Thread Peter Maydell
On Wed, 28 Aug 2024 at 16:59, Jason Fan wrote: > > Re-send this to include the original mail-list. > > Hi Peter, > I am working on a i3c target model which requires bitops on the uint8_t > registers. > deposit8 can help to check incorrect length or start input for 8 bit value. > You are right tha

Re: [PATCH v7 2/4] migration/multifd: Fix p->iov leak in multifd-uadk.c

2024-08-28 Thread Peter Xu
On Wed, Aug 28, 2024 at 11:56:48AM -0300, Fabiano Rosas wrote: > The send_cleanup() hook should free the p->iov that was allocated at > send_setup(). This was missed because the UADK code is conditional on > the presence of the accelerator, so it's not tested by default. > > Fixes: 819dd20636 ("mi

Re: [PATCH v7 4/4] migration/multifd: Add documentation for multifd methods

2024-08-28 Thread Peter Xu
On Wed, Aug 28, 2024 at 11:56:50AM -0300, Fabiano Rosas wrote: > Add documentation clarifying the usage of the multifd methods. The > general idea is that the client code calls into multifd to trigger > send/recv of data and multifd then calls these hooks back from the > worker threads at opportune

Re: [PATCH v7 3/4] migration/multifd: Add a couple of asserts for p->iov

2024-08-28 Thread Peter Xu
On Wed, Aug 28, 2024 at 11:56:49AM -0300, Fabiano Rosas wrote: > Check that p->iov is indeed always allocated and freed by the > MultiFDMethods hooks. > > Suggested-by: Peter Xu > Signed-off-by: Fabiano Rosas Reviewed-by: Peter Xu -- Peter Xu

Re: [PATCH 1/1] include/qemu/bitops.h: Add deposit8 for uint8_t bit operation

2024-08-28 Thread Jason Fan
Re-send this to include the original mail-list. Hi Peter, I am working on a i3c target model which requires bitops on the uint8_t registers. deposit8 can help to check incorrect length or start input for 8 bit value. You are right that desposit32 should also work if we always pass the correct argu

Re: [PATCH v7 1/4] migration/multifd: Stop changing the packet on recv side

2024-08-28 Thread Peter Xu
On Wed, Aug 28, 2024 at 11:56:47AM -0300, Fabiano Rosas wrote: > As observed by Philippe, the multifd_ram_unfill_packet() function > currently leaves the MultiFDPacket structure with mixed > endianness. This is harmless, but ultimately not very clean. > > Stop touching the received packet and do t

Re: [PATCH v4 6/7] memory: Do not create circular reference with subregion

2024-08-28 Thread Peter Xu
On Wed, Aug 28, 2024 at 11:02:06PM +0900, Akihiko Odaki wrote: > On 2024/08/28 22:09, Peter Xu wrote: > > On Wed, Aug 28, 2024 at 02:33:59PM +0900, Akihiko Odaki wrote: > > > On 2024/08/28 1:11, Peter Xu wrote: > > > > On Tue, Aug 27, 2024 at 01:14:51PM +0900, Akihiko Odaki wrote: > > > > > On 2024

Re: [PULL 17/20] target/arm: Do memory type alignment check when translation disabled

2024-08-28 Thread Peter Maydell
On Wed, 28 Aug 2024 at 08:22, Michael Tokarev wrote: > > 05.03.2024 16:52, Peter Maydell wrote: > > From: Richard Henderson > > > > If translation is disabled, the default memory type is Device, which > > requires alignment checking. This is more optimally done early via > > the MemOp given to t

Re: [PATCH v5 7/8] machine/nitro-enclave: New machine type for AWS Nitro Enclaves

2024-08-28 Thread Dorjoy Chowdhury
Hi Daniel, On Wed, Aug 28, 2024 at 9:39 PM Daniel P. Berrangé wrote: > > On Thu, Aug 22, 2024 at 09:08:48PM +0600, Dorjoy Chowdhury wrote: > > AWS nitro enclaves[1] is an Amazon EC2[2] feature that allows creating > > isolated execution environments, called enclaves, from Amazon EC2 > > instances

Re: [PATCH for-9.2 00/10] s390: Convert virtio-ccw, cpu to three-phase reset, and followup cleanup

2024-08-28 Thread Peter Maydell
On Wed, 28 Aug 2024 at 09:13, Nico Boehr wrote: > > Quoting Nico Boehr (2024-08-26 14:08:20) > > There was a little hickup without the fixup to patch 2, but after Nina > > pushed the fixup, we did not observe any failures related to your > > changes in our CI. Thanks! > > Peter, after a few CI run

Re: [PATCH 2/2] chardev: Remove __-prefixed names

2024-08-28 Thread Peter Maydell
On Wed, 28 Aug 2024 at 05:33, Nicholas Piggin wrote: > > Peter points out double underscore prefix names tend to be reserved > for the system. Clean these up. > > Suggested-by: Peter Maydell > Signed-off-by: Nicholas Piggin > --- > chardev/char.c | 20 +++- > 1 file changed, 11

Re: [PATCH 1/2] chardev: Fix record/replay error path NULL deref in device creation

2024-08-28 Thread Peter Maydell
On Wed, 28 Aug 2024 at 05:33, Nicholas Piggin wrote: > > qemu_chardev_set_replay() was being called in chardev creation to > set up replay parameters even if the chardev is NULL. > > A segfault can be reproduced by specifying '-serial chardev:bad' with > an rr=record mode. > > Fix this with a NULL

Re: [PATCH v5 6/8] hw/core: Add Enclave Image Format (EIF) related helpers

2024-08-28 Thread Daniel P . Berrangé
On Thu, Aug 22, 2024 at 09:08:47PM +0600, Dorjoy Chowdhury wrote: > An EIF (Enclave Image Format)[1] file is used to boot an AWS nitro > enclave[2] virtual machine. The EIF file contains the necessary kernel, > cmdline, ramdisk(s) sections to boot. > > Some helper functions have been introduced fo

Re: [PATCH v5 7/8] machine/nitro-enclave: New machine type for AWS Nitro Enclaves

2024-08-28 Thread Daniel P . Berrangé
On Thu, Aug 22, 2024 at 09:08:48PM +0600, Dorjoy Chowdhury wrote: > AWS nitro enclaves[1] is an Amazon EC2[2] feature that allows creating > isolated execution environments, called enclaves, from Amazon EC2 > instances which are used for processing highly sensitive data. Enclaves > have no persiste

Re: [PATCH RESEND] hw/openrisc/openrisc_sim: keep serial@90000000 as default

2024-08-28 Thread Peter Maydell
On Tue, 27 Aug 2024 at 19:53, Stafford Horne wrote: > > On Sun, Aug 25, 2024 at 03:09:20PM +0100, Peter Maydell wrote: > > On Sun, 25 Aug 2024 at 12:35, Jason A. Donenfeld wrote: > > > > > > On Fri, Aug 23, 2024 at 07:28:43AM +0100, Stafford Horne wrote: > > > > Also, I will wait to see if Jason

Re: [PATCH v5 4/8] tests/lcitool: Update libvirt-ci and add libcbor dependency

2024-08-28 Thread Daniel P . Berrangé
On Thu, Aug 22, 2024 at 09:08:45PM +0600, Dorjoy Chowdhury wrote: > libcbor dependecy is necessary for adding virtio-nsm and nitro-enclave > machine support in the following commits. libvirt-ci has already been > updated with the dependency upstream and this commit updates libvirt-ci > submodule in

Re: [PATCH v5 1/8] crypto: Define macros for hash algorithm digest lengths

2024-08-28 Thread Daniel P . Berrangé
On Thu, Aug 22, 2024 at 09:08:42PM +0600, Dorjoy Chowdhury wrote: > Signed-off-by: Dorjoy Chowdhury > --- > crypto/hash.c | 14 +++--- > include/crypto/hash.h | 8 > 2 files changed, 15 insertions(+), 7 deletions(-) Reviewed-by: Daniel P. Berrangé With regards, Danie

Re: [PATCH v2] aspeed: Deprecate the tacoma-bmc machine

2024-08-28 Thread Guenter Roeck
On 8/28/24 05:35, Cédric Le Goater wrote: On 8/26/24 20:50, Guenter Roeck wrote: Hi, On 8/26/24 02:58, Cédric Le Goater wrote: Hello Guenter, On 8/9/24 00:05, Guenter Roeck wrote: Hi, On Tue, Jun 25, 2024 at 09:08:30AM +0200, Cédric Le Goater wrote: The tacoma-bmc machine was a board inclu

[PATCH v7 0/4] migration/multifd: Remove multifd_send_state->pages (leftovers)

2024-08-28 Thread Fabiano Rosas
Hi, I queued the rest of the series to migration-staging, these are the few leftovers that still needed attention. v6: https://lore.kernel.org/r/20240827174606.10352-1-faro...@suse.de v5: https://lore.kernel.org/r/20240826195322.165

[PATCH v7 1/4] migration/multifd: Stop changing the packet on recv side

2024-08-28 Thread Fabiano Rosas
As observed by Philippe, the multifd_ram_unfill_packet() function currently leaves the MultiFDPacket structure with mixed endianness. This is harmless, but ultimately not very clean. Stop touching the received packet and do the necessary work using stack variables instead. While here tweak the er

[PATCH v7 3/4] migration/multifd: Add a couple of asserts for p->iov

2024-08-28 Thread Fabiano Rosas
Check that p->iov is indeed always allocated and freed by the MultiFDMethods hooks. Suggested-by: Peter Xu Signed-off-by: Fabiano Rosas --- migration/multifd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/migration/multifd.c b/migration/multifd.c index 2a8cd9174c..9b200f4ad9 100644 ---

[PATCH v7 4/4] migration/multifd: Add documentation for multifd methods

2024-08-28 Thread Fabiano Rosas
Add documentation clarifying the usage of the multifd methods. The general idea is that the client code calls into multifd to trigger send/recv of data and multifd then calls these hooks back from the worker threads at opportune moments so the client can process a portion of the data. Suggested-by

[PATCH v7 2/4] migration/multifd: Fix p->iov leak in multifd-uadk.c

2024-08-28 Thread Fabiano Rosas
The send_cleanup() hook should free the p->iov that was allocated at send_setup(). This was missed because the UADK code is conditional on the presence of the accelerator, so it's not tested by default. Fixes: 819dd20636 ("migration/multifd: Add UADK initialization") Reported-by: Peter Xu Signed-

qemu-system-hppa HP-UX 64 bit working?

2024-08-28 Thread David Bonham via
Documented here: https://github.com/hdeller/qemu-hppa/issues/2 I'm unable to get the master version of qemu-system-hppa 9.0.5 which was compiled from source to boot the HP-UX 11.23 or 11.31 install disk. But HP-UX 11.11 install starts, but does a panic: again using -machine C3700, using an 11.

[PATCH] linux-user: add openat2 support in linux-user

2024-08-28 Thread Michael Vogt
This commit adds support for the `openat2()` syscall in the `linux-user` userspace emulator. It is implemented by extracting a new helper `maybe_do_fake_open()` out of the exiting `do_guest_openat()` and share that with the new `do_guest_openat2()`. Unfortunatly we cannot just make do_guest_openat

Re: [PATCH 1/1] plugins: add API to read guest CPU memory from hwaddr

2024-08-28 Thread Rowan Hart
> + qemu_plugin_read_cpu_memory_hwaddr; > + qemu_plugin_read_io_memory_hwaddr; This second symbol name should be removed, I initially wanted to implement for IO as well but there is no good generic way I can see to access a list of IO AddressSpace to read from.

Re: [PATCH v3 2/2] vl: use qmp_device_add() in qemu_create_cli_devices()

2024-08-28 Thread Daniel P . Berrangé
On Tue, Aug 27, 2024 at 03:27:51PM -0400, Stefan Hajnoczi wrote: > qemu_create_cli_devices() should use qmp_device_add() to match the > behavior of the QMP monitor. A comment explained that libvirt changes > implementing strict CLI syntax were needed. > > Peter Krempa has confirmed that modern li

Re: [PATCH v3 1/2] qdev-monitor: avoid QemuOpts in QMP device_add

2024-08-28 Thread Daniel P . Berrangé
On Tue, Aug 27, 2024 at 03:27:50PM -0400, Stefan Hajnoczi wrote: > The QMP device_add monitor command converts the QDict arguments to > QemuOpts and then back again to QDict. This process only supports scalar > types. Device properties like virtio-blk-pci's iothread-vq-mapping (an > array of object

  1   2   3   >