Re: [PATCH 2/8] python/qapi: change "FIXME" to "TODO"

2024-08-30 Thread Markus Armbruster
John Snow writes: > On Fri, Aug 30, 2024 at 7:09 AM Markus Armbruster wrote: > >> John Snow writes: >> >> > qemu.git/python/setup.cfg disallows checking in any code with "XXX", >> > "FIXME" or "TODO" in the comments. Soften the restriction to only >> > prohibit "FIXME", and change the two occur

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

2024-08-30 Thread Akihiko Odaki
On 2024/08/31 0:05, Peter Xu wrote: On Fri, Aug 30, 2024 at 03:11:38PM +0900, Akihiko Odaki wrote: On 2024/08/30 4:48, Peter Xu wrote: On Thu, Aug 29, 2024 at 01:39:36PM +0900, Akihiko Odaki wrote: I am calling the fact that embedded memory regions are accessible in instance_finalize() "live".

[PATCH v1] linux-user: Add option to run `execve`d programs through QEMU

2024-08-30 Thread Noah Goldstein
The new option '-qemu-children' makes it so that on `execve` the child process will be launch by the same `qemu` executable that is currently running along with its current commandline arguments. The motivation for the change is to make it so that plugins running through `qemu` can continue to run

Re: [PATCH v1] linux-user: Add option to run `execve`d programs through QEMU

2024-08-30 Thread Noah Goldstein
On Fri, Aug 30, 2024 at 3:36 PM Noah Goldstein wrote: > > The new option '-qemu-children' makes it so that on `execve` the child > process will be launch by the same `qemu` executable that is currently > running along with its current commandline arguments. > > The motivation for the change is to

Re: [PATCH 9/9] tests/unit: add test-fifo unit test

2024-08-30 Thread Octavian Purdila
On Wed, Aug 28, 2024 at 5:23 AM Mark Cave-Ayland wrote: > > This tests the Fifo8 implementation for basic operations as well as testing > for > the correct *_bufptr() including handling wraparound of the internal FIFO > buffer. > > Signed-off-by: Mark Cave-Ayland Reviewed-by: Octavian Purdila

Re: [PATCH 7/9] fifo8: add fifo8_peek_buf() function

2024-08-30 Thread Octavian Purdila
On Wed, Aug 28, 2024 at 5:23 AM Mark Cave-Ayland wrote: > > This is a wrapper function around fifo8_peekpop_buf() that allows the caller > to > peek into FIFO, including handling the case where there is a wraparound of the > internal FIFO buffer. > > Signed-off-by: Mark Cave-Ayland Reviewed-by:

Re: [PATCH 8/9] fifo8: introduce fifo8_peek() function

2024-08-30 Thread Octavian Purdila
On Wed, Aug 28, 2024 at 5:23 AM Mark Cave-Ayland wrote: > > This allows uses to peek the byte at the current head of the FIFO. > > Signed-off-by: Mark Cave-Ayland Reviewed-by: Octavian Purdila > --- > include/qemu/fifo8.h | 11 +++ > util/fifo8.c | 6 ++ > 2 files changed

Re: [PATCH 6/9] fifo8: honour do_pop argument in fifo8_peekpop_buf()

2024-08-30 Thread Octavian Purdila
On Wed, Aug 28, 2024 at 5:23 AM Mark Cave-Ayland wrote: > > Pass the do_pop value from fifo8_peekpop_buf() to fifo8_peekpop_bufptr() to > allow peeks to the FIFO buffer, including adjusting the skip parameter to > handle the case where the internal FIFO buffer wraps around. > > Signed-off-by: Mark

Re: [PATCH 5/9] fifo8: rename fifo8_pop_buf() to fifo8_peekpop_buf()

2024-08-30 Thread Octavian Purdila
On Wed, Aug 28, 2024 at 5:23 AM Mark Cave-Ayland wrote: > > The fifo8_pop_buf() function will soon also be used for peek operations, so > rename > the function accordingly. Create a new fifo8_pop_buf() wrapper function that > can > be used by existing callers. > > Signed-off-by: Mark Cave-Ayland

Re: [PATCH 4/9] fifo8: replace fifo8_pop_bufptr() with fifo8_peekpop_bufptr() in fifo8_pop_buf()

2024-08-30 Thread Octavian Purdila
On Wed, Aug 28, 2024 at 5:23 AM Mark Cave-Ayland wrote: > > The upcoming peek functionality will require passing a non-zero value to > fifo8_peekpop_bufptr(). > > Signed-off-by: Mark Cave-Ayland Reviewed-by: Octavian Purdila > --- > util/fifo8.c | 4 ++-- > 1 file changed, 2 insertions(+), 2

Re: [PATCH 3/9] fifo8: add skip parameter to fifo8_peekpop_bufptr()

2024-08-30 Thread Octavian Purdila
On Wed, Aug 28, 2024 at 5:23 AM Mark Cave-Ayland wrote: > > The skip parameter specifies the number of bytes to be skipped from the > current > FIFO head before the peek or pop operation. > > Signed-off-by: Mark Cave-Ayland Reviewed-by: Octavian Purdila > --- > util/fifo8.c | 12 +++-

Re: [PATCH 2/9] fifo8: introduce head variable for fifo8_peekpop_bufptr()

2024-08-30 Thread Octavian Purdila
On Wed, Aug 28, 2024 at 5:23 AM Mark Cave-Ayland wrote: > > Rather than operate on fifo->head directly, introduce a new head variable > which is > set to the value of fifo->head and use it instead. This is to allow future > adjustment of the head position within the internal FIFO buffer. > > Sign

Re: [PATCH 1/9] fifo8: rename fifo8_peekpop_buf() to fifo8_peekpop_bufptr()

2024-08-30 Thread Octavian Purdila
On Wed, Aug 28, 2024 at 5:23 AM Mark Cave-Ayland wrote: > > This is to emphasise that the function returns a pointer to the internal FIFO > buffer. > > Signed-off-by: Mark Cave-Ayland Reviewed-by: Octavian Purdila > --- > util/fifo8.c | 8 > 1 file changed, 4 insertions(+), 4 deletio

[PATCH v9 5/5] tests/migration: Add integration test for 'qatzip' compression method

2024-08-30 Thread Yichen Wang
From: Bryan Zhang Adds an integration test for 'qatzip'. Reviewed-by: Fabiano Rosas Signed-off-by: Bryan Zhang Signed-off-by: Hao Xiang Signed-off-by: Yichen Wang --- tests/qtest/migration-test.c | 27 +++ 1 file changed, 27 insertions(+) diff --git a/tests/qtest/mi

[PATCH v9 1/5] docs/migration: add qatzip compression feature

2024-08-30 Thread Yichen Wang
From: Yuan Liu add Intel QATzip compression method introduction Reviewed-by: Nanhai Zou Reviewed-by: Peter Xu Reviewed-by: Fabiano Rosas Signed-off-by: Yuan Liu Signed-off-by: Yichen Wang --- docs/devel/migration/features.rst | 1 + docs/devel/migration/qatzip-compression.rst |

[PATCH v9 3/5] migration: Add migration parameters for QATzip

2024-08-30 Thread Yichen Wang
From: Bryan Zhang Adds support for migration parameters to control QATzip compression level. Acked-by: Markus Armbruster Signed-off-by: Bryan Zhang Signed-off-by: Hao Xiang Signed-off-by: Yichen Wang --- migration/migration-hmp-cmds.c | 4 migration/options.c| 34 +

[PATCH v9 2/5] meson: Introduce 'qatzip' feature to the build system

2024-08-30 Thread Yichen Wang
From: Bryan Zhang Add a 'qatzip' feature, which is automatically disabled, and which depends on the QATzip library if enabled. Reviewed-by: Fabiano Rosas Signed-off-by: Bryan Zhang Signed-off-by: Hao Xiang Signed-off-by: Yichen Wang --- meson.build | 10 ++ meson_o

[PATCH v9 0/5] Implement QATzip compression method

2024-08-30 Thread Yichen Wang
v9: - Rebase changes on top of cec99171931ea79215c79661d33423ac84e63b6e; - Address comments and add Review-by in commit messages; v8: - Rebase changes on top of 2eefd4fcec4b8fe41ceee2a8f00cdec1fe81b75c; - Fix typo and grammars in documentation and comments; v7: - Rebase changes on top of 0173b9

[PATCH v9 4/5] migration: Introduce 'qatzip' compression method

2024-08-30 Thread Yichen Wang
From: Bryan Zhang Adds support for 'qatzip' as an option for the multifd compression method parameter, and implements using QAT for 'qatzip' compression and decompression. Acked-by: Markus Armbruster Reviewed-by: Fabiano Rosas Reviewed-by: Prasad Pandit Signed-off-by: Bryan Zhang Signed-off-

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

2024-08-30 Thread Gustavo Romero
Hi Richard, On 8/29/24 7:16 PM, Richard Henderson wrote: On 8/30/24 06:13, Gustavo Romero wrote:    1 .text 1e60  40001000  40001000  00011000  2**12    4 .data 00012000  4020  4020  0002  2**12 4040 g   .data    00

Re: [PATCH 3/3] hw/nubus/nubus-device: Range check 'slot' property

2024-08-30 Thread Thomas Huth
Am Fri, 30 Aug 2024 18:34:52 +0100 schrieb Peter Maydell : > The TYPE_NUBUS_DEVICE class lets the user specify the nubus slot > using an int32 "slot" QOM property. Its realize method doesn't do > any range checking on this value, which Coverity notices by way of > the possibility that 'nd->slot *

Re: [PATCH 2/3] hw/m68k/mcf5208: Add URLs for datasheets

2024-08-30 Thread Thomas Huth
Am Fri, 30 Aug 2024 18:34:51 +0100 schrieb Peter Maydell : > The datasheets for the SoC and board we model here are still > available from the NXP website; add their URLs and titles for > future reference. > > Signed-off-by: Peter Maydell > --- > hw/m68k/mcf5208.c | 8 > 1 file changed

Re: [PATCH 1/3] hw/m68k/mcf5208: Avoid shifting off end of integer

2024-08-30 Thread Thomas Huth
Am Fri, 30 Aug 2024 18:34:50 +0100 schrieb Peter Maydell : > In m5208_sys_read(), we have a loop of n from 0 to 31, and we > calculate (2u << n). For the n == 31 iteration this will shift off > the top of the unsigned 32 bit integer. > > This is harmless, because we're going to stop the loop wit

Re: [RFC 1/2] vhost-vdpa: Decouple the IOVA allocator

2024-08-30 Thread Si-Wei Liu
On 8/30/2024 1:05 AM, Eugenio Perez Martin wrote: On Fri, Aug 30, 2024 at 6:20 AM Si-Wei Liu wrote: On 8/29/2024 9:53 AM, Eugenio Perez Martin wrote: On Wed, Aug 21, 2024 at 2:56 PM Jonah Palmer wrote: Decouples the IOVA allocator from the IOVA->HVA tree and instead adds the allocated I

Re: [edk2-devel] [RFC PATCH 1/1] MdePkg/IndustryStandard: add definitions for ACPI 6.4 CEDT

2024-08-30 Thread Rebecca Cran
Also, leading underscores are supposed to be reserved for compiler implementations (and there only needs to be a single trailing underscore) so it should really be: __CXL_Early_Discovery_TABLE_H__ -> CXL_EARLY_DISCOVERY_TABLE_H_ -- Rebecca On 8/30/2024 12:06 PM, Michael D Kinney via groups.

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

2024-08-30 Thread Fabiano Rosas
"Maciej S. Szmigiero" writes: > From: "Maciej S. Szmigiero" > > Add a basic support for receiving device state via multifd channels - > channels that are shared with RAM transfers. > > To differentiate between a device state and a RAM packet the packet > header is read first. > > Depending wheth

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

2024-08-30 Thread Guenter Roeck
On Fri, Aug 30, 2024 at 10:09:25AM +0200, Cédric Le Goater wrote: > Hello, > > > > > > I solved the problem by adding support for IBM Bonnell (which > > > > instantiates > > > > the TPM chip through its devicetree file, similar to tacoma-bmc) to my > > > > local > > > > copy of qemu. > > > > >

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

2024-08-30 Thread Pierrick Bouvier
And by the way, feel free to integrate this with your other series (as it's a very similar topic) in a v3, so we can review both at the same time. Thanks, Pierrick On 8/30/24 12:30, Pierrick Bouvier wrote: Hi Rowan, thanks for this good complement on the virt address read function. However,

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

2024-08-30 Thread Pierrick Bouvier
Hi Rowan, thanks for this good complement on the virt address read function. However, to be able to merge a new plugins API function, we must have a concrete usage of it, through one of the existing plugin. What could be a good demonstration of value brought by being able to read a physical ad

Re: [PATCH v2 08/17] migration: Add load_finish handler and associated functions

2024-08-30 Thread Fabiano Rosas
"Maciej S. Szmigiero" writes: > From: "Maciej S. Szmigiero" > > load_finish SaveVMHandler allows migration code to poll whether > a device-specific asynchronous device state loading operation had finished. > > In order to avoid calling this handler needlessly the device is supposed > to notify t

Re: [RFC PATCH] tests/tcg: add a system test to check memory instrumentation

2024-08-30 Thread Pierrick Bouvier
On 8/30/24 08:25, Alex Bennée wrote: At first I thought I could compile the user-mode test for system mode however we already have a fairly comprehensive test case for system mode in "memory" so lets use that. First we extend the test to report where the test_data region is. Then we expand the p

Re: [PATCH v7 6/6] tests/tcg/multiarch: add test for plugin memory access

2024-08-30 Thread Pierrick Bouvier
On 8/29/24 02:03, Alex Bennée wrote: Pierrick Bouvier writes: Add an explicit test to check expected memory values are read/written. 8,16,32 load/store are tested for all arch. 64,128 load/store are tested for aarch64/x64. atomic operations (8,16,32,64) are tested for x64 only. By default, at

Re: [PATCH v2 07/17] migration: Add qemu_loadvm_load_state_buffer() and its handler

2024-08-30 Thread Fabiano Rosas
"Maciej S. Szmigiero" writes: > From: "Maciej S. Szmigiero" > > qemu_loadvm_load_state_buffer() and its load_state_buffer > SaveVMHandler allow providing device state buffer to explicitly > specified device via its idstr and instance id. > > Signed-off-by: Maciej S. Szmigiero Reviewed-by: Fabi

Re: [PATCH v2 13/17] migration/multifd: Add migration_has_device_state_support()

2024-08-30 Thread Fabiano Rosas
"Maciej S. Szmigiero" writes: > From: "Maciej S. Szmigiero" > > Since device state transfer via multifd channels requires multifd > channels with packets and is currently not compatible with multifd > compression add an appropriate query function so device can learn > whether it can actually mak

[PATCH v2] target/arm/tcg: refine cache descriptions with a wrapper

2024-08-30 Thread Alireza Sanaee via
This patch allows for easier manipulation of the cache description register, CCSIDR. Which is helpful for testing as well. Currently numbers get hard-coded and might be prone to errors. Therefore, this patch adds wrappers for different types of CPUs available in tcg to decribe caches. Two function

Re: [PATCH] target/arm/tcg: refine cache descriptions with a wrapper

2024-08-30 Thread Alireza Sanaee via
On Fri, 30 Aug 2024 17:29:59 +0100 Peter Maydell wrote: > On Fri, 30 Aug 2024 at 17:19, Alireza Sanaee > wrote: > > > > Add wrapper for different types of CPUs available in tcg to decribe > > caches. Two functions `make_ccsidr32` and `make_ccsidr64` > > describing descriptions. The 32 bit versio

Re: [PATCH 2/8] python/qapi: change "FIXME" to "TODO"

2024-08-30 Thread John Snow
On Fri, Aug 30, 2024 at 7:09 AM Markus Armbruster wrote: > John Snow writes: > > > qemu.git/python/setup.cfg disallows checking in any code with "XXX", > > "FIXME" or "TODO" in the comments. Soften the restriction to only > > prohibit "FIXME", and change the two occurrences of "FIXME" in qapi to

Re: [PATCH 7/8] python/qapi: move scripts/qapi to python/qemu/qapi

2024-08-30 Thread John Snow
On Fri, Aug 30, 2024 at 7:20 AM Markus Armbruster wrote: > John Snow writes: > > > This is being done for the sake of unifying the linting and static type > > analysis configurations between scripts/qapi and python/qemu/*. > > > > With this change, the qapi module will now be checked by mypy, fl

Re: [PATCH v2 10/17] migration/multifd: Convert multifd_send()::next_channel to atomic

2024-08-30 Thread Fabiano Rosas
"Maciej S. Szmigiero" writes: > From: "Maciej S. Szmigiero" > > This is necessary for multifd_send() to be able to be called > from multiple threads. > > Signed-off-by: Maciej S. Szmigiero > --- > migration/multifd.c | 24 ++-- > 1 file changed, 18 insertions(+), 6 deletion

RE: [edk2-devel] [RFC PATCH 1/1] MdePkg/IndustryStandard: add definitions for ACPI 6.4 CEDT

2024-08-30 Thread Kinney, Michael D
For this MdePkg change to add an ACPI table type, do you mind opening a PR? There are some minor code style issues that need to be addressed. Structure type names and define names should be all upper case. __CXL_Early_Discovery_TABLE_H__ -> __CXL_EARLY_DISCOVERY_TABLE_H__ File names sho

[PATCH] hw/gpio/aspeed_gpio: Avoid shift into sign bit

2024-08-30 Thread Peter Maydell
In aspeed_gpio_update() we calculate "mask = 1 << gpio", where gpio can be between 0 and 31. Coverity complains about this because 1 << 31 won't fit in a signed integer. For QEMU this isn't an error because we enable -fwrapv, but we can keep Coverity happy by doing the shift on unsigned numbers.

Re: [PATCH 7/8] python/qapi: move scripts/qapi to python/qemu/qapi

2024-08-30 Thread John Snow
On Fri, Aug 30, 2024 at 7:29 AM Daniel P. Berrangé wrote: > On Fri, Aug 30, 2024 at 01:20:35PM +0200, Markus Armbruster wrote: > > John Snow writes: > > > > > This is being done for the sake of unifying the linting and static type > > > analysis configurations between scripts/qapi and python/qem

Re: [PATCH] target/riscv: Stop timer with infinite timecmp

2024-08-30 Thread Vladimir Isaev
30.08.2024 17:50, Andrew Jones пишет: > On Fri, Aug 30, 2024 at 02:05:05PM GMT, Vladimir Isaev wrote: >> Hi Andrew, >> >> 29.08.2024 11:40, Andrew Jones wrote: >>> While the spec doesn't state it, setting timecmp to UINT64_MAX is >>> another way to stop a timer, as it's considered setting the ne

[PATCH 3/3] hw/nubus/nubus-device: Range check 'slot' property

2024-08-30 Thread Peter Maydell
The TYPE_NUBUS_DEVICE class lets the user specify the nubus slot using an int32 "slot" QOM property. Its realize method doesn't do any range checking on this value, which Coverity notices by way of the possibility that 'nd->slot * NUBUS_SUPER_SLOT_SIZE' might overflow the 32-bit arithmetic it is u

[PATCH 0/3] m68k: Fix a couple of Coverity nits

2024-08-30 Thread Peter Maydell
This patchset fixes a couple of very minor Coverity issues: one "shift off top of integer", and one "overflow in multiplication". Neither will happen in normal use. I would not bother backporting either fix to stable. I threw in also a patch adding a comment to mcf5208.c giving the URLs of the da

[PATCH 1/3] hw/m68k/mcf5208: Avoid shifting off end of integer

2024-08-30 Thread Peter Maydell
In m5208_sys_read(), we have a loop of n from 0 to 31, and we calculate (2u << n). For the n == 31 iteration this will shift off the top of the unsigned 32 bit integer. This is harmless, because we're going to stop the loop with n == 31 anyway, but we can avoid the error by using 64-bit arithmeti

[PATCH 2/3] hw/m68k/mcf5208: Add URLs for datasheets

2024-08-30 Thread Peter Maydell
The datasheets for the SoC and board we model here are still available from the NXP website; add their URLs and titles for future reference. Signed-off-by: Peter Maydell --- hw/m68k/mcf5208.c | 8 1 file changed, 8 insertions(+) diff --git a/hw/m68k/mcf5208.c b/hw/m68k/mcf5208.c index

Re: [PATCH 11/13] pnv/xive: Update PIPR when updating CPPR

2024-08-30 Thread Mike Kowal
On 8/30/2024 3:25 AM, Cédric Le Goater wrote: On 8/29/24 22:35, Mike Kowal wrote: On 8/29/2024 7:29 AM, Cédric Le Goater wrote: On 8/1/24 22:30, Michael Kowal wrote: From: Glenn Miles Current code was updating the PIPR inside the xive_tctx_accept() function instead of the xive_tctx_set_c

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

2024-08-30 Thread Deepak Gupta
v13 for riscv zicfilp and zicfiss extensions support in qemu. zicfilp and zicfiss spec pdf https://github.com/riscv/riscv-cfi/releases/download/v1.0/riscv-cfi.pdf github sources to spec https://github.com/riscv/riscv-cfi I have kept names of `cpu_get_bcfien` or `cpu_get_fcfien` same and didn't c

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

2024-08-30 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 v13 05/20] target/riscv: additional code information for sw check

2024-08-30 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 v13 02/20] target/riscv: Add zicfilp extension

2024-08-30 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 v13 19/20] disas/riscv: enable disassembly for compressed sspush/sspopchk

2024-08-30 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 Acked-by: Alistair Francis --- disas/riscv.c | 19 +

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

2024-08-30 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 v13 16/20] target/riscv: implement zicfiss instructions

2024-08-30 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 v13 06/20] target/riscv: tracking indirect branches (fcfi) for zicfilp

2024-08-30 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 v13 20/20] target/riscv: Expose zicfiss extension as a cpu property

2024-08-30 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 c5ebcefeb5..2592465e24 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -1485,6 +1485,7 @@ const RISCVCPUM

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

2024-08-30 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

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

2024-08-30 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 v13 12/20] target/riscv: tb flag for shadow stack instructions

2024-08-30 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 v13 18/20] disas/riscv: enable disassembly for zicfiss instructions

2024-08-30 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 Acked-by: Alistair Francis --- disas/riscv.c | 40 +++- disas/riscv.h | 1 + 2 files changed, 40 inser

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

2024-08-30 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 v13 14/20] target/riscv: AMO operations always raise store/AMO fault

2024-08-30 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 v13 09/20] target/riscv: Expose zicfilp extension as a cpu property

2024-08-30 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 v13 01/20] target/riscv: expose *envcfg csr and priv to qemu-user as well

2024-08-30 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

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

2024-08-30 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 v13 13/20] target/riscv: mmu changes for zicfiss shadow stack protection

2024-08-30 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 v13 15/20] target/riscv: update `decode_save_opc` to store extra word2

2024-08-30 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. Resolves: https://gitlab.com/qemu-project/

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

2024-08-30 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

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

2024-08-30 Thread Deepak Gupta
On Thu, Aug 29, 2024 at 10:56:41PM -0700, Deepak Gupta wrote: On Fri, Aug 30, 2024 at 03:20:04PM +1000, Richard Henderson wrote: On 8/30/24 09:34, Deepak Gupta wrote: +bool cpu_get_bcfien(CPURISCVState *env) It occurs to me that a better name would be "cpu_get_sspen". The backward cfi is mere

Re: [PATCH] target/arm/tcg: refine cache descriptions with a wrapper

2024-08-30 Thread Peter Maydell
On Fri, 30 Aug 2024 at 17:19, Alireza Sanaee wrote: > > Add wrapper for different types of CPUs available in tcg to decribe > caches. Two functions `make_ccsidr32` and `make_ccsidr64` > describing descriptions. The 32 bit version receives extra parameters > that became unknown later in 64 bit. > >

Re: [PATCH v9 11/12] target/arm: add an experimental mpidr arm cpu property object

2024-08-30 Thread Peter Maydell
On Mon, 26 Aug 2024 at 04:12, Mauro Carvalho Chehab wrote: > > Em Sun, 25 Aug 2024 12:34:14 +0100 > Peter Maydell escreveu: > > > On Sun, 25 Aug 2024 at 04:46, Mauro Carvalho Chehab > > wrote: > > > > > > Accurately injecting an ARM Processor error ACPI/APEI GHES > > > error record requires the

[PATCH] target/arm/tcg: refine cache descriptions with a wrapper

2024-08-30 Thread Alireza Sanaee via
Add wrapper for different types of CPUs available in tcg to decribe caches. Two functions `make_ccsidr32` and `make_ccsidr64` describing descriptions. The 32 bit version receives extra parameters that became unknown later in 64 bit. For CCSIDR register, 32 bit version follows specification [1]. Co

[PATCH v3 1/1] linux-user: add openat2 support in linux-user

2024-08-30 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

[PATCH v3 0/1] linux-user: add openat2 support in linux-user

2024-08-30 Thread Michael Vogt
From: Michael Vogt Hi, This is v3 of the openat2 support in linux-user. Thanks again for the excellent second round of feedback from Richard Henderson. This version tries to be closer to the kernels behavior, i.e. now do_openat2() uses a new copy_struct_from_user() helper that is very similar

tests/avocado/riscv_opensbi.py does not work reliable

2024-08-30 Thread Thomas Huth
Hi! While running a lot of tests (i.e. with a very loaded machine), I noticed that tests/avocado/riscv_opensbi.py is very flaky when the host machine is slow. I can easily reproduce the problem when running a big compilation job on all CPUs in the background and then run the riscv_opensbi.p

[RFC PATCH] tests/tcg: add a system test to check memory instrumentation

2024-08-30 Thread Alex Bennée
At first I thought I could compile the user-mode test for system mode however we already have a fairly comprehensive test case for system mode in "memory" so lets use that. First we extend the test to report where the test_data region is. Then we expand the pdot() function to track the total numbe

[PATCH] target/arm: Correct names of VFP VFNMA and VFNMS insns

2024-08-30 Thread Peter Maydell
In vfp.decode we have the names of the VFNMA and VFNMS instructions the wrong way around. The architecture says that bit 6 is the 'op' bit, which is 1 for VFNMA and 1 for VFNMS, but we label these two lines of decode the other way around. This doesn't cause any user-visible problem because in the

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

2024-08-30 Thread Peter Xu
On Fri, Aug 30, 2024 at 03:11:38PM +0900, Akihiko Odaki wrote: > On 2024/08/30 4:48, Peter Xu wrote: > > On Thu, Aug 29, 2024 at 01:39:36PM +0900, Akihiko Odaki wrote: > > > > > I am calling the fact that embedded memory regions are accessible in > > > > > instance_finalize() "live". A device can p

[PATCH v2 03/11] target/s390: Convert CPU to Resettable interface

2024-08-30 Thread Peter Maydell
Convert the s390 CPU to the Resettable interface. This is slightly more involved than the other CPU types were (see commits 9130cade5fc22..d66e64dd006df) because S390 has its own set of different kinds of reset with different behaviours that it needs to trigger. We handle this by adding these res

[PATCH v2 01/11] hw/s390/ccw-device: Convert to three-phase reset

2024-08-30 Thread Peter Maydell
Convert the TYPE_CCW_DEVICE to three-phase reset. This is a device class which is subclassed, so it needs to be three-phase before we can convert the subclass. Signed-off-by: Peter Maydell --- hw/s390x/ccw-device.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/s39

[PATCH v2 11/11] hw/core/resettable: Remove transitional_function machinery

2024-08-30 Thread Peter Maydell
We used to need the transitional_function machinery to handle bus classes and device classes which still used their legacy reset handling. We have now converted all bus classes to three phase reset, and simplified the device class legacy reset so it is just an adapting wrapper function around regi

[PATCH v2 10/11] hw/core/qdev: Simplify legacy_reset handling

2024-08-30 Thread Peter Maydell
Now that all devices which still implement a the legacy reset method register it via device_class_legacy_reset(), we can simplify the handling of these devices. Instead of using the complex Resettable::get_transitional_function machinery, we register a hold phase method which invokes the DeviceCla

[PATCH v2 02/11] hw/s390/virtio-ccw: Convert to three-phase reset

2024-08-30 Thread Peter Maydell
Convert the virtio-ccw code to three-phase reset. This allows us to remove a call to device_class_set_parent_reset(), replacing it with the three-phase equivalent resettable_class_set_parent_phases(). Removing all the device_class_set_parent_reset() uses will allow us to remove some of the glue co

[PATCH v2 09/11] hw: Remove device_phases_reset()

2024-08-30 Thread Peter Maydell
Currently we have transitional machinery between legacy reset and three phase reset that works in two directions: * if you invoke three phase reset on a device which has set the DeviceClass::legacy_reset method, we detect this in device_get_transitional_reset() and arrange that we call th

[PATCH v2 08/11] hw: Rename DeviceClass::reset field to legacy_reset

2024-08-30 Thread Peter Maydell
Rename the DeviceClass::reset field to legacy_reset; this is helpful both in flagging up that it's best not used in new code and in making it easy to search for where it's being used still. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- incl

[PATCH v2 05/11] target/alpha, hppa: Remove unused parent_reset fields

2024-08-30 Thread Peter Maydell
The Alpha and HPPA CPU class structs include a 'parent_reset' field which is never used; delete them. (These targets don't seem to implement reset at all; if they did they should do it using the three-phase reset mechanism, which uses a 'ResettablePhases parent_phases' field instead of the old 'De

[PATCH v2 04/11] hw: Remove device_class_set_parent_reset()

2024-08-30 Thread Peter Maydell
There are no callers of device_class_set_parent_reset() left in the tree, as they've all been converted to use three-phase reset and the corresponding resettable_class_set_parent_phases() function. Remove device_class_set_parent_reset(). Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-

[PATCH v2 00/11] s390: Convert virtio-ccw, cpu to three-phase reset, and followup cleanup

2024-08-30 Thread Peter Maydell
The main aim of this patchseries is to remove the two remaining uses of device_class_set_parent_reset() in the tree, which are virtio-ccw and the s390 CPU class. Doing that lets us do some followup cleanup. (The diffstat looks alarming but is almost all coccinelle automated changes.) Changes v1->v

[PATCH v2 06/11] hw: Define new device_class_set_legacy_reset()

2024-08-30 Thread Peter Maydell
Define a device_class_set_legacy_reset() function which sets the DeviceClass::reset field. This serves two purposes: * it makes it clearer to the person writing code that DeviceClass::reset is now legacy and they should look for the new alternative (which is Resettable) * it makes it easier

Re: [PATCH] target/riscv: Stop timer with infinite timecmp

2024-08-30 Thread Andrew Jones
On Fri, Aug 30, 2024 at 02:05:05PM GMT, Vladimir Isaev wrote: > Hi Andrew, > > 29.08.2024 11:40, Andrew Jones wrote: > > While the spec doesn't state it, setting timecmp to UINT64_MAX is > > another way to stop a timer, as it's considered setting the next > > timer event to occur at infinity. >

Re: [RFC 1/2] vhost-vdpa: Decouple the IOVA allocator

2024-08-30 Thread Eugenio Perez Martin
On Fri, Aug 30, 2024 at 3:52 PM Jonah Palmer wrote: > > > > On 8/30/24 4:05 AM, Eugenio Perez Martin wrote: > > On Fri, Aug 30, 2024 at 6:20 AM Si-Wei Liu wrote: > >> > >> > >> > >> On 8/29/2024 9:53 AM, Eugenio Perez Martin wrote: > >>> On Wed, Aug 21, 2024 at 2:56 PM Jonah Palmer > >>> wrote:

Re: [RFC 2/2] vhost-vdpa: Implement GPA->IOVA & IOVA->SVQ HVA trees

2024-08-30 Thread Eugenio Perez Martin
On Fri, Aug 30, 2024 at 3:58 PM Jonah Palmer wrote: > > > > On 8/29/24 12:55 PM, Eugenio Perez Martin wrote: > > On Wed, Aug 21, 2024 at 2:56 PM Jonah Palmer > > wrote: > >> > >> Implements a GPA->IOVA and IOVA->SVQ HVA tree for handling mapping, > >> unmapping, and translations for guest and ho

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

2024-08-30 Thread Sunil V L
On Wed, Aug 28, 2024 at 06:59:20PM -0700, Sia Jee Heng wrote: > 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

Re: [RFC 2/2] vhost-vdpa: Implement GPA->IOVA & IOVA->SVQ HVA trees

2024-08-30 Thread Jonah Palmer
On 8/29/24 12:55 PM, Eugenio Perez Martin wrote: On Wed, Aug 21, 2024 at 2:56 PM Jonah Palmer wrote: Implements a GPA->IOVA and IOVA->SVQ HVA tree for handling mapping, unmapping, and translations for guest and host-only memory, respectively. By splitting up a full IOVA->HVA tree (containi

Re: [RFC 1/2] vhost-vdpa: Decouple the IOVA allocator

2024-08-30 Thread Jonah Palmer
On 8/30/24 4:05 AM, Eugenio Perez Martin wrote: On Fri, Aug 30, 2024 at 6:20 AM Si-Wei Liu wrote: On 8/29/2024 9:53 AM, Eugenio Perez Martin wrote: On Wed, Aug 21, 2024 at 2:56 PM Jonah Palmer wrote: Decouples the IOVA allocator from the IOVA->HVA tree and instead adds the allocated IO

[PATCH v5 29/44] tests/functional: Convert the acpi-bits test into a standalone test

2024-08-30 Thread Thomas Huth
Mostly a straight-forward conversion. Looks like we can simply drop the avocado datadrainer stuff when not using the avocado framework anymore. Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Signed-off-by: Thomas Huth --- MAINTAINERS |

[PATCH v5 22/44] tests/functional: Convert the microblaze avocado tests into standalone tests

2024-08-30 Thread Thomas Huth
The machine_microblaze.py file contained two tests, one for each endianness. Since we only support one QEMU target binary per file in the new functional test environment, we have to split this file up into two files now. Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Signe

[PATCH v5 38/44] tests/functional: Convert ARM bFLT linux-user avocado test

2024-08-30 Thread Thomas Huth
From: Philippe Mathieu-Daudé Straight forward conversion. Update the SHA1 hashes to SHA256 hashes since SHA1 should not be used anymore nowadays. Expose cpio_extract() in qemu_test.utils for possible reuse. Signed-off-by: Philippe Mathieu-Daudé Message-ID: <20240822104238.75045-3-phi...@linaro.

[PATCH v5 43/44] docs/devel/testing: Rename avocado_qemu.Test class

2024-08-30 Thread Thomas Huth
The avocado_qemu.Test class has been renamed a while back in commit 2283b627bc ("tests/avocado: Rename avocado_qemu.Test -> QemuSystemTest"), so we should reflect this now in the documentation, too. Reviewed-by: Daniel P. Berrangé Signed-off-by: Thomas Huth --- docs/devel/testing/avocado.rst |

  1   2   >