[PATCH v2 04/19] qapi/schema: declare type for QAPISchemaObjectTypeMember.type

2024-01-12 Thread John Snow
declare, but don't initialize the type of "type" to be QAPISchemaType - and allow the value to be initialized during check(). This creates a form of delayed initialization for QAPISchemaType objects where the static typing only represents the fully-realized object, which occurs after check() has be

[PATCH v2 16/19] qapi/parser: demote QAPIExpression to Dict[str, Any]

2024-01-12 Thread John Snow
Dict[str, object] is a stricter type, but with the way that code is currently arranged, it is infeasible to enforce this strictness. In particular, although expr.py's entire raison d'être is normalization and type-checking of QAPI Expressions, that type information is not "remembered" in any meani

[PATCH v2 12/19] qapi/schema: assert info is present when necessary

2024-01-12 Thread John Snow
QAPISchemaInfo instances are sometimes defined as an Optional field/argument because built-in definitions don't *have* a source definition. As a consequence, there are a few places where we need to assert that it's present because the root entity definition can only enforce that it is "Optional".

Re: [PATCH 08/13] target/riscv/vector_helper.c: use vlenb in HELPER(vsetvl)

2024-01-12 Thread Richard Henderson
On 1/13/24 08:38, Daniel Henrique Barboza wrote: Use the new 'vlenb' CPU config to validate fractional LMUL. The original comparison is done with 'vlen' and 'sew', both in bits. Use sew/8, or sew in bytes, to do a direct comparison with vlenb. Signed-off-by: Daniel Henrique Barboza --- target

Re: [PATCH 09/13] target/riscv/cpu.h: use 'vlenb' in vext_get_vlmax()

2024-01-12 Thread Richard Henderson
On 1/13/24 08:38, Daniel Henrique Barboza wrote: Signed-off-by: Daniel Henrique Barboza --- target/riscv/cpu.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h index 11df226a00..628ef67d5f 100644 --- a/target/riscv/cpu.h +++ b/targe

Re: [PATCH v3 5/9] hw/hppa: Move software power button address back into PDC

2024-01-12 Thread Helge Deller
> I think it would be better to pass this as a parameter to create_fw_cfg, or > to drop the translated FW_CFG_IO_BASE parameter and merely pass in translate > itself. Like this? The various operating systems (e.g. Linux, NetBSD) have issues mapping the power button when it's stored in page zero.

Re: [PATCH 10/13] target/riscv/insn_trans/trans_rvv.c.inc: use 'vlenb' in MAXSZ()

2024-01-12 Thread Richard Henderson
On 1/13/24 08:38, Daniel Henrique Barboza wrote: MAXSZ() returns the value in bytes. Now that we have access to vlenb we don't need to compensate with a '-3' in the scale to use 'vlen'. MAXSZ() now works as follows: LMUL lmul=scale MAXSZ (vlenb >> -scale) 1 0 vlenb 2 1

[PATCH V4 0/5] string list functions

2024-01-12 Thread Steve Sistare
Add some handy string list functions for general use, and use them in live migration functions. These will also be needed for cpr exec mode. Changes in V4: * added exec migration patch Steve Sistare (5): util: strList_from_string qapi: QAPI_LIST_LENGTH util: strv_from_strList util: str

[PATCH V4 1/5] util: strList_from_string

2024-01-12 Thread Steve Sistare
Generalize hmp_split_at_comma() to take any delimiter string, rename as strList_from_string(), and move it to util/strList.c. No functional change. Signed-off-by: Steve Sistare --- include/monitor/hmp.h | 1 - include/qemu/strList.h | 24 monitor/hmp-cmds.c | 19 -

[PATCH V4 3/5] util: strv_from_strList

2024-01-12 Thread Steve Sistare
Signed-off-by: Steve Sistare Reviewed-by: Marc-André Lureau --- include/qemu/strList.h | 6 ++ util/strList.c | 14 ++ 2 files changed, 20 insertions(+) diff --git a/include/qemu/strList.h b/include/qemu/strList.h index 010237f..4b86aa6 100644 --- a/include/qemu/strList

[PATCH V4 4/5] util: strList unit tests

2024-01-12 Thread Steve Sistare
Signed-off-by: Steve Sistare Reviewed-by: Marc-André Lureau --- tests/unit/meson.build| 1 + tests/unit/test-strList.c | 80 +++ 2 files changed, 81 insertions(+) create mode 100644 tests/unit/test-strList.c diff --git a/tests/unit/meson.build b

[PATCH V4 2/5] qapi: QAPI_LIST_LENGTH

2024-01-12 Thread Steve Sistare
Signed-off-by: Steve Sistare Reviewed-by: Marc-André Lureau --- include/qapi/util.h | 13 + 1 file changed, 13 insertions(+) diff --git a/include/qapi/util.h b/include/qapi/util.h index 81a2b13..e1b8b1d 100644 --- a/include/qapi/util.h +++ b/include/qapi/util.h @@ -56,4 +56,17 @@ in

Re: [PATCH 11/13] trans_rvv.c.inc: remove vlmax arg from vec_element_loadx()

2024-01-12 Thread Richard Henderson
On 1/13/24 08:38, Daniel Henrique Barboza wrote: Signed-off-by: Daniel Henrique Barboza --- target/riscv/insn_trans/trans_rvv.c.inc | 26 + 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/target/riscv/insn_trans/trans_rvv.c.inc b/target/riscv/insn_trans

[PATCH V4 5/5] migration: simplify exec migration functions

2024-01-12 Thread Steve Sistare
Simplify the exec migration code by using list utility functions. As a side effect, this also fixes a minor memory leak. On function return, "g_auto(GStrv) argv" frees argv and each element, which is wrong, because the function does not own the individual elements. To compensate, the code uses g

Re: [PULL 15/21] linux-user/riscv: Add vdso

2024-01-12 Thread Palmer Dabbelt
On Fri, 12 Jan 2024 13:35:39 PST (-0800), Richard Henderson wrote: > On 1/12/24 08:49, Vineet Gupta wrote: >> Hi Richard, Alistair >> >> On 10/30/23 14:17, Richard Henderson wrote: >>> diff --git a/linux-user/riscv/Makefile.vdso b/linux-user/riscv/Makefile.vdso >>> new file mode 100644 >>> index 0

Re: [PATCH v3 5/9] hw/hppa: Move software power button address back into PDC

2024-01-12 Thread Richard Henderson
On 1/13/24 09:44, Helge Deller wrote: I think it would be better to pass this as a parameter to create_fw_cfg, or to drop the translated FW_CFG_IO_BASE parameter and merely pass in translate itself. Like this? The various operating systems (e.g. Linux, NetBSD) have issues mapping the power bu

Re: [PATCH v3 5/9] hw/hppa: Move software power button address back into PDC

2024-01-12 Thread Helge Deller
On 1/13/24 00:11, Richard Henderson wrote: On 1/13/24 09:44, Helge Deller wrote: I think it would be better to pass this as a parameter to create_fw_cfg, or to drop the translated FW_CFG_IO_BASE parameter and merely pass in translate itself. Like this? The various operating systems (e.g. Lin

Re: [PATCH v3 5/9] hw/hppa: Move software power button address back into PDC

2024-01-12 Thread Richard Henderson
On 1/13/24 10:15, Helge Deller wrote: On 1/13/24 00:11, Richard Henderson wrote: On 1/13/24 09:44, Helge Deller wrote: I think it would be better to pass this as a parameter to create_fw_cfg, or to drop the translated FW_CFG_IO_BASE parameter and merely pass in translate itself. Like this?

Re: [PULL 15/21] linux-user/riscv: Add vdso

2024-01-12 Thread Vineet Gupta
On 1/12/24 13:35, Richard Henderson wrote: > On 1/12/24 08:49, Vineet Gupta wrote: >> Hi Richard, Alistair >> >> On 10/30/23 14:17, Richard Henderson wrote: >>> diff --git a/linux-user/riscv/Makefile.vdso b/linux-user/riscv/Makefile.vdso >>> new file mode 100644 >>> index 00..2c257dbfda

Re: [PULL 15/21] linux-user/riscv: Add vdso

2024-01-12 Thread Vineet Gupta
On 1/12/24 15:37, Vineet Gupta wrote: > Now if only I could rebuild vdso/qemu with the revert of following and > the reg size change. > 2021-07-06 468c1bb5cac9 linux-user/riscv: Add vdso   And is there  way to debug qemu internals in this regard, like a developer toggle on steroids or somethi

Re: [PULL 15/21] linux-user/riscv: Add vdso

2024-01-12 Thread Richard Henderson
On 1/13/24 10:37, Vineet Gupta wrote: On 1/12/24 13:35, Richard Henderson wrote: On 1/12/24 08:49, Vineet Gupta wrote: Hi Richard, Alistair On 10/30/23 14:17, Richard Henderson wrote: diff --git a/linux-user/riscv/Makefile.vdso b/linux-user/riscv/Makefile.vdso new file mode 100644 index 000

Re: [PULL 15/21] linux-user/riscv: Add vdso

2024-01-12 Thread Vineet Gupta
On 1/12/24 16:05, Richard Henderson wrote: So by default qemu ships the vdso binary. How can one rebuild it ? From skimming the build files it seems following ought to do it     make update-linux-vdso with a prior configure cmd like below with PATH pointing to the

[PATCH 0/2] Fix pointer arithmetic in indirect read for libvhost-user and libvduse

2024-01-12 Thread Temir Zharaspayev
Hello! I have found a problem with virtqueue_read_indirect_desc function, which was advancing pointer to struct as it was a byte pointer, so every element comming after first chunk would be copied somewhere out of buffer. As I understand this is cold path, but nevertheless worth fixing. Also, exa

[PATCH 2/2] libvduse: Fix pointer arithmetic in indirect read

2024-01-12 Thread Temir Zharaspayev
When zero-copy usage of indirect descriptors buffer table isn't possible, library gather scattered memory chunks in a local copy. This commit fixes the issue with pointer arithmetic for the local copy buffer. Signed-off-by: Temir Zharaspayev --- subprojects/libvduse/libvduse.c | 11 ++-

[PATCH 1/2] libvhost-user: Fix pointer arithmetic in indirect read

2024-01-12 Thread Temir Zharaspayev
When zero-copy usage of indirect descriptors buffer table isn't possible, library gather scattered memory chunks in a local copy. This commit fixes the issue with pointer arithmetic for the local copy buffer. Signed-off-by: Temir Zharaspayev --- subprojects/libvhost-user/libvhost-user.c | 11 +++

Re: Re: Re: [PATCH 1/3] target/riscv: Add infrastructure for 'B' MISA extension

2024-01-12 Thread Ved Shanbhogue
Rob Bradford wrote: I'm using table 27.1 in the published PDF which is the PDF in this release: https://github.com/riscv/riscv-isa-manual/releases/tag/Ratified-IMAFDQC It looks like it was removed in this commit (which is a set of backports): We would retain the previously documented canonical

Re: [PATCH 03/12] tests/plugin: add test plugin for inline operations

2024-01-12 Thread Pierrick Bouvier
On 1/12/24 21:20, Alex Bennée wrote: Pierrick Bouvier writes: On 1/11/24 19:57, Philippe Mathieu-Daudé wrote: Hi Pierrick, On 11/1/24 15:23, Pierrick Bouvier wrote: For now, it simply performs instruction, bb and mem count, and ensure that inline vs callback versions have the same result. La

[PULL 05/10] hw/hppa: Move software power button address back into PDC

2024-01-12 Thread deller
From: Helge Deller The various operating systems (e.g. Linux, NetBSD) have issues mapping the power button when it's stored in page zero. NetBSD even crashes, because it fails to map that page and then accesses unmapped memory. Since we now have a consistent memory mapping of PDC in 32-bit and 6

[PULL 09/10] target/hppa: Fix IOR and ISR on error in probe

2024-01-12 Thread deller
From: Helge Deller Put correct values (depending on CPU arch) into IOR and ISR on fault. Signed-off-by: Helge Deller Reviewed-by: Richard Henderson --- target/hppa/op_helper.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/target/hppa/op_helper.c b/target/hppa/op_hel

[PULL 01/10] hw/hppa/machine: Allow up to 3840 MB total memory

2024-01-12 Thread deller
From: Helge Deller The physical hardware allows DIMMs of 4 MB size and above, allowing up to 3840 MB of memory, but is restricted by setup code to 3 GB. Increase the limit to allow up to the maximum amount of memory. Btw. the memory area from 0xf000. to 0x. is reserved by the archite

[PULL 02/10] hw/hppa/machine: Disable default devices with --nodefaults option

2024-01-12 Thread deller
From: Helge Deller Recognize the qemu --nodefaults option, which will disable the following default devices on hppa: - lsi53c895a SCSI controller, - artist graphics card, - LASI 82596 NIC, - tulip PCI NIC, - second serial PCI card, - USB OHCI controller. Adding this option is very useful to allo

[PULL 03/10] hw/pci-host/astro: Add missing astro & elroy registers for NetBSD

2024-01-12 Thread deller
From: Helge Deller NetBSD accesses some astro and elroy registers which aren't accessed by Linux yet. Add emulation for those registers to allow NetBSD to boot further. Please note that this patch is not sufficient to completely boot up NetBSD on the 64-bit C3700 machine yet. Signed-off-by: Helg

[PULL 06/10] target/hppa: Avoid accessing %gr0 when raising exception

2024-01-12 Thread deller
From: Helge Deller The value of unwind_breg may reference register %r0, but we need to avoid accessing gr0 directly and use the value 0 instead. At runtime I've seen unwind_breg being zero with the Linux kernel when rfi is used to jump to smp_callin(). Signed-off-by: Helge Deller Reviewed-by:

[PULL 04/10] target/hppa: Fix PDC address translation on PA2.0 with PSW.W=0

2024-01-12 Thread deller
From: Helge Deller Fix the address translation for PDC space on PA2.0 if PSW.W=0. Basically, for any address in the 32-bit PDC range from 0xf000 to 0xf100 keep the lower 32-bits and just set the upper 32-bits to 0xfff0. This mapping fixes the emulated power button in PDC space for 32

[PULL 08/10] target/hppa: Fix IOR and ISR on unaligned access trap

2024-01-12 Thread deller
From: Helge Deller Put correct values (depending on CPU arch) into IOR and ISR on fault. Signed-off-by: Helge Deller Reviewed-by: Richard Henderson --- target/hppa/cpu.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index 04de16

[PULL 07/10] target/hppa: Export function hppa_set_ior_and_isr()

2024-01-12 Thread deller
From: Helge Deller Move functionality to set IOR and ISR on fault into own function. This will be used by follow-up patches. Signed-off-by: Helge Deller Reviewed-by: Richard Henderson --- target/hppa/cpu.h| 1 + target/hppa/mem_helper.c | 23 --- 2 files changed,

[PULL 00/10] Hppa fixes 8.2 patches

2024-01-12 Thread deller
From: Helge Deller The following changes since commit 7425b6277f12e82952cede1f531bfc689bf77fb1: Merge tag 'tracing-pull-request' of https://gitlab.com/stefanha/qemu into staging (2023-12-27 05:15:32 -0500) are available in the Git repository at: https://github.com/hdeller/qemu-hppa.git ta

<    1   2   3   4