[PULL 0/5] qtest timeouts and ROP mitigation

2024-01-15 Thread Thomas Huth
Hi Peter! The following changes since commit 977542ded7e6b28d2bc077bcda24568c716e393c: Merge tag 'pull-testing-updates-120124-2' of https://gitlab.com/stsquad/qemu into staging (2024-01-12 14:02:53 +) are available in the Git repository at: https://gitlab.com/thuth/qemu.git

[PULL 1/5] tests/qtest/meson.build: Bump the boot-serial-test timeout to 4 minutes

2024-01-15 Thread Thomas Huth
When running with TCI, the boot-serial-test can take longer than 3 minutes: https://gitlab.com/qemu-project/qemu/-/jobs/5890481086#L4774 Bump the timeout to 4 minutes to avoid CI failures here. Message-ID: <20240115071146.31213-1-th...@redhat.com> Reviewed-by: "Daniel P. Berrangé"

[PULL 3/5] qtest: Bump npcm7xx_watchdog_timer-test timeout to 2 minutes

2024-01-15 Thread Thomas Huth
The npcm7xx_watchdog_timer-test can take more than 60 seconds in SPEED=slow mode on a loaded host system. Bumping to 2 minutes will give more headroom. Message-ID: <20240112164717.1063954-1-th...@redhat.com> Reviewed-by: "Daniel P. Berrangé" Signed-off-by: Thomas Huth ---

[PULL 5/5] meson: mitigate against use of uninitialize stack for exploits

2024-01-15 Thread Thomas Huth
From: Daniel P. Berrangé When variables are used without being initialized, there is potential to take advantage of data that was pre-existing on the stack from an earlier call, to drive an exploit. It is good practice to always initialize variables, and the compiler can warn about flaws when

[PULL 4/5] meson: mitigate against ROP exploits with -fzero-call-used-regs

2024-01-15 Thread Thomas Huth
From: Daniel P. Berrangé To quote wikipedia: "Return-oriented programming (ROP) is a computer security exploit technique that allows an attacker to execute code in the presence of security defenses such as executable space protection and code signing. In this technique, an

[PULL 2/5] tests/qtest/npcm7xx_watchdog_timer: Only test the corner cases by default

2024-01-15 Thread Thomas Huth
The test_prescaler() part in the npcm7xx_watchdog_timer test is quite repetitive, testing all possible combinations of the WTCLK and WTIS bitfields. Since each test spins up a new instance of QEMU, this is rather an expensive test, especially on loaded host systems. For the normal quick test mode,

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

2024-01-15 Thread Pierrick Bouvier
On 1/15/24 13:04, Alex Bennée wrote:> Pierrick Bouvier writes:> On 1/13/24 21:16, Alex Bennée wrote: Pierrick Bouvier writes: 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

[PATCH v2 5/9] hw/core: Cleanup unused included header in machine-qmp-cmds.c

2024-01-15 Thread Zhao Liu
From: Zhao Liu Remove unused header (qemu/main-loop.h) in machine-qmp-cmds.c. Tested by "./configure" and then "make". Signed-off-by: Zhao Liu --- hw/core/machine-qmp-cmds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/core/machine-qmp-cmds.c

[PATCH v2 3/9] hw/core: Reorder included headers in cpu-common.c

2024-01-15 Thread Zhao Liu
From: Zhao Liu Reorder the header files (except qemu/osdep.h) in alphabetical order. Tested by "./configure" and then "make". Signed-off-by: Zhao Liu --- hw/core/cpu-common.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/hw/core/cpu-common.c

[PATCH v2 7/9] hw/core: Reorder included headers in null-machine.c

2024-01-15 Thread Zhao Liu
From: Zhao Liu Reorder the header files (except qemu/osdep.h) in alphabetical order. Tested by "./configure" and then "make". Signed-off-by: Zhao Liu --- hw/core/null-machine.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/core/null-machine.c

[PATCH v2 0/9] hw/core: Cleanup and reorder headers

2024-01-15 Thread Zhao Liu
From: Zhao Liu Identify unused headers by full compilation (tested by "./configure" and then "make") and manually checking if it is a direct inclusion. Then reorder headers in alphabetical order. In addition, update a file entry in MAINTAINERS file. --- Changelog: v1: Per Peter and

[PATCH v2 9/9] hw/core: Reorder included headers in numa.c

2024-01-15 Thread Zhao Liu
From: Zhao Liu Reorder the header files (except qemu/osdep.h) in alphabetical order. Tested by "./configure" and then "make". Signed-off-by: Zhao Liu --- hw/core/numa.c | 19 ++- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/hw/core/numa.c b/hw/core/numa.c

[PATCH v2 1/9] MAINTAINERS: Update hw/core/cpu.c entry

2024-01-15 Thread Zhao Liu
From: Zhao Liu The hw/core/cpu.c was split as hw/core/cpu-common.c and hw/core/cpu-sysemu.c in the commit df4fd7d5c8a3 ("cpu: Split as cpu-common / cpu-sysemu"). Update the related entry. Signed-off-by: Zhao Liu Reviewed-by: Philippe Mathieu-Daudé --- MAINTAINERS | 3 ++- 1 file changed, 2

[PATCH v2 2/9] hw/core: Cleanup unused included headers in cpu-common.c

2024-01-15 Thread Zhao Liu
From: Zhao Liu Remove unused headers in cpu-common.c: * qemu/notify.h * exec/cpu-common.h * qemu/error-report.h * qemu/qemu-print.h Tested by "./configure" and then "make". Signed-off-by: Zhao Liu --- hw/core/cpu-common.c | 4 1 file changed, 4 deletions(-) diff --git

[PATCH v2 4/9] hw/core: Reorder included headers in cpu-sysemu.c

2024-01-15 Thread Zhao Liu
From: Zhao Liu Reorder the header files (except qemu/osdep.h) in alphabetical order. Tested by "./configure" and then "make". Signed-off-by: Zhao Liu --- hw/core/cpu-sysemu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/core/cpu-sysemu.c b/hw/core/cpu-sysemu.c

[PATCH v2 6/9] hw/core: Reorder included header in machine.c

2024-01-15 Thread Zhao Liu
From: Zhao Liu Reorder the header files (except qemu/osdep.h) in alphabetical order. Tested by "./configure" and then "make". Signed-off-by: Zhao Liu --- hw/core/machine.c | 21 +++-- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/hw/core/machine.c

[PATCH v2 8/9] hw/core: Cleanup unused included headers in numa.c

2024-01-15 Thread Zhao Liu
From: Zhao Liu Remove unused header in numa.c: * qemu/bitmap.h * hw/core/cpu.h * migration/vmstate.h Note: Though parse_numa_hmat_lb() has the variable named "bitmap_copy", it doesn't use the normal bitmap ops so that it's safe to exclude qemu/bitmap.h header. Tested by "./configure" and then

Re: [PATCH] Fixed '-serial none' usage breaks following '-serial ...' usage

2024-01-15 Thread Markus Armbruster
Peter Maydell writes: > (I've cc'd a few people who might have opinions on possible > command-line compatibility breakage.) > > On Wed, 10 Jan 2024 at 14:38, Bohdan Kostiv wrote: >> >> Hello, >> >> I have faced an issue in using serial ports when I need to skip a couple of >> ports in the CLI.

Re: [RFC PATCH v3 13/30] migration/multifd: Add outgoing QIOChannelFile support

2024-01-15 Thread Peter Xu
On Tue, Jan 16, 2024 at 12:05:57PM +0800, Peter Xu wrote: > On Mon, Nov 27, 2023 at 05:25:55PM -0300, Fabiano Rosas wrote: > > Allow multifd to open file-backed channels. This will be used when > > enabling the fixed-ram migration stream format which expects a > > seekable transport. > > > > The

Re: [PATCH v2 03/19] qapi: create QAPISchemaDefinition

2024-01-15 Thread Markus Armbruster
John Snow writes: > On Mon, Jan 15, 2024 at 8:16 AM Markus Armbruster wrote: >> >> John Snow writes: >> >> > Include entities don't have names, but we generally expect "entities" to >> > have names. Reclassify all entities with names as *definitions*, leaving >> > the nameless include entities

Re: [RFC PATCH v3 17/30] migration/multifd: Decouple recv method from pages

2024-01-15 Thread Peter Xu
On Mon, Nov 27, 2023 at 05:25:59PM -0300, Fabiano Rosas wrote: > Next patch will abstract the type of data being received by the > channels, so do some cleanup now to remove references to pages and > dependency on 'normal_num'. > > Signed-off-by: Fabiano Rosas Reviewed-by: Peter Xu -- Peter

Re: [RFC PATCH v3 16/30] multifd: Rename MultiFDSendParams::data to compress_data

2024-01-15 Thread Peter Xu
On Mon, Nov 27, 2023 at 05:25:58PM -0300, Fabiano Rosas wrote: > Use a more specific name for the compression data so we can use the > generic for the multifd core code. You also modified the recv side. Touch up the subject would be nice to say both. > > Signed-off-by: Fabiano Rosas

Re: [RFC PATCH v3 15/30] io: Add a pwritev/preadv version that takes a discontiguous iovec

2024-01-15 Thread Peter Xu
On Mon, Nov 27, 2023 at 05:25:57PM -0300, Fabiano Rosas wrote: > For the upcoming support to fixed-ram migration with multifd, we need > to be able to accept an iovec array with non-contiguous data. > > Add a pwritev and preadv version that splits the array into contiguous > segments before

Re: [PATCH v2 01/19] qapi: sort pylint suppressions

2024-01-15 Thread Markus Armbruster
John Snow writes: > On Mon, Jan 15, 2024 at 7:18 AM Markus Armbruster wrote: >> >> John Snow writes: >> >> > Suggested-by: Markus Armbruster >> > Signed-off-by: John Snow >> > --- >> > scripts/qapi/pylintrc | 6 +++--- >> > 1 file changed, 3 insertions(+), 3 deletions(-) >> > >> > diff

RE: FW: [PATCH] vhost-user: add VIRTIO_F_IN_ORDER and VIRTIO_F_NOTIFICATION_DATA feature

2024-01-15 Thread Wentao Jia
Hi, Jason The two features was defined before version 8.2, we can found them in qemu 8.2 VIRTIO_F_NOTIFICATION_DATA https://github.com/qemu/qemu/commit/d0bf492f3877d4187d2f7d0c0abb3a2bf3104392 VIRTIO_F_IN_ORDER https://github.com/qemu/qemu/commit/e4082063e47e9731dbeb1c26174c17f6038f577f thank

Re: [RFC PATCH v3 14/30] migration/multifd: Add incoming QIOChannelFile support

2024-01-15 Thread Peter Xu
On Mon, Nov 27, 2023 at 05:25:56PM -0300, Fabiano Rosas wrote: > On the receiving side we don't need to differentiate between main > channel and threads, so whichever channel is defined first gets to be > the main one. And since there are no packets, use the atomic channel > count to index into

Re: [PATCH 5/5] qemu-options: Remove the deprecated -singlestep option

2024-01-15 Thread Markus Armbruster
Daniel P. Berrangé writes: > On Mon, Jan 15, 2024 at 05:39:19PM +, Peter Maydell wrote: >> On Mon, 15 Jan 2024 at 13:54, Thomas Huth wrote: >> > >> > On 12/01/2024 16.39, Philippe Mathieu-Daudé wrote: >> > > Hi Thomas >> > > >> > > +Laurent & Peter >> > > >> > > On 12/1/24 11:00, Thomas

RE: [PATCH v2 0/9] Hexagon (target/hexagon) Make generators object oriented

2024-01-15 Thread Brian Cain
> -Original Message- > From: Taylor Simpson > Sent: Sunday, December 10, 2023 4:07 PM > To: qemu-devel@nongnu.org > Cc: Brian Cain ; Matheus Bernardino (QUIC) > ; Sid Manning ; Marco > Liebel (QUIC) ; richard.hender...@linaro.org; > phi...@linaro.org; a...@rev.ng; a...@rev.ng;

RE: [PATCH v2 0/3] Hexagon (target/hexagon) Use QEMU decodetree

2024-01-15 Thread Brian Cain
> -Original Message- > From: Taylor Simpson > Sent: Monday, January 15, 2024 4:15 PM > To: qemu-devel@nongnu.org > Cc: Brian Cain ; Matheus Bernardino (QUIC) > ; Sid Manning ; Marco > Liebel (QUIC) ; richard.hender...@linaro.org; > phi...@linaro.org; a...@rev.ng; a...@rev.ng;

Re: [PATCH v2 06/12] target/riscv/insn_trans/trans_rvvk.c.inc: use 'vlenb'

2024-01-15 Thread Richard Henderson
On 1/16/24 09:25, Daniel Henrique Barboza wrote: Use s->cfg_ptr->vlenb instead of s->cfg_ptr->vlen / 8. Signed-off-by: Daniel Henrique Barboza --- target/riscv/insn_trans/trans_rvvk.c.inc | 16 1 file changed, 8 insertions(+), 8 deletions(-) Reviewed-by: Richard Henderson

Re: [RFC PATCH v3 13/30] migration/multifd: Add outgoing QIOChannelFile support

2024-01-15 Thread Peter Xu
On Mon, Nov 27, 2023 at 05:25:55PM -0300, Fabiano Rosas wrote: > Allow multifd to open file-backed channels. This will be used when > enabling the fixed-ram migration stream format which expects a > seekable transport. > > The QIOChannel read and write methods will use the preadv/pwritev >

[PULL 06/20] tests/qtest/migration: Print migration incoming errors

2024-01-15 Thread peterx
From: Fabiano Rosas We're currently just asserting when incoming migration fails. Let's print the error message from QMP as well. Signed-off-by: Fabiano Rosas Reviewed-by: Peter Xu Link: https://lore.kernel.org/r/20240104142144.9680-6-faro...@suse.de Signed-off-by: Peter Xu ---

Re: [PATCH 01/29] include: move include/qapi/qmp/ to include/qobject/

2024-01-15 Thread Zhao Liu
On Mon, Jan 08, 2024 at 06:46:38PM +, Daniel P. Berrangé wrote: > Date: Mon, 8 Jan 2024 18:46:38 + > From: "Daniel P. Berrangé" > Subject: Re: [PATCH 01/29] include: move include/qapi/qmp/ to > include/qobject/ > > On Mon, Jan 08, 2024 at 06:23:37PM +, Daniel P. Berrangé wrote: > >

[PULL 13/20] docs/migration: Split "Backwards compatibility" separately

2024-01-15 Thread peterx
From: Peter Xu Split the section from main.rst into a separate file. Reference it in the index.rst. Reviewed-by: Cédric Le Goater Link: https://lore.kernel.org/r/20240109064628.595453-5-pet...@redhat.com Signed-off-by: Peter Xu --- docs/devel/migration/compatibility.rst | 517

[PULL 14/20] docs/migration: Split "Debugging" and "Firmware"

2024-01-15 Thread peterx
From: Peter Xu Move the two sections into a separate file called "best-practices.rst". Add the entry into index. Reviewed-by: Cédric Le Goater Link: https://lore.kernel.org/r/20240109064628.595453-6-pet...@redhat.com Signed-off-by: Peter Xu --- docs/devel/migration/best-practices.rst | 48

[PULL 05/20] migration: Report error in incoming migration

2024-01-15 Thread peterx
From: Fabiano Rosas We're not currently reporting the errors set with migrate_set_error() when incoming migration fails. Signed-off-by: Fabiano Rosas Reviewed-by: Peter Xu Link: https://lore.kernel.org/r/20240104142144.9680-5-faro...@suse.de Signed-off-by: Peter Xu --- migration/migration.c

[PULL 20/20] migration/rdma: define htonll/ntohll only if not predefined

2024-01-15 Thread peterx
From: Nick Briggs Solaris has #defines for htonll and ntohll which cause syntax errors when compiling code that attempts to (re)define these functions.. Signed-off-by: Nick Briggs Link: https://lore.kernel.org/r/65a04a7d.497ab3.3e7be...@gateway.sonic.net Signed-off-by: Peter Xu ---

[PULL 12/20] docs/migration: Convert virtio.txt into rST

2024-01-15 Thread peterx
From: Peter Xu Convert the plain old .txt into .rst, add it into migration/index.rst. Reviewed-by: Cédric Le Goater Link: https://lore.kernel.org/r/20240109064628.595453-4-pet...@redhat.com Signed-off-by: Peter Xu --- docs/devel/migration/index.rst | 1 + docs/devel/migration/virtio.rst |

[PULL 18/20] docs/migration: Further move vfio to be feature of migration

2024-01-15 Thread peterx
From: Peter Xu Move it one layer down, so taking VFIO-migration as a feature for migration. Cc: Alex Williamson Cc: Cédric Le Goater Reviewed-by: Cédric Le Goater Link: https://lore.kernel.org/r/20240109064628.595453-10-pet...@redhat.com Signed-off-by: Peter Xu ---

[PULL 16/20] docs/migration: Split "dirty limit"

2024-01-15 Thread peterx
From: Peter Xu Split that into a separate file, put under "features". Cc: Yong Huang Reviewed-by: Cédric Le Goater Link: https://lore.kernel.org/r/20240109064628.595453-8-pet...@redhat.com Signed-off-by: Peter Xu --- docs/devel/migration/dirty-limit.rst | 71

[PULL 15/20] docs/migration: Split "Postcopy"

2024-01-15 Thread peterx
From: Peter Xu Split postcopy into a separate file. Introduce a head page "features.rst" to keep all the features on top of migration framework. Reviewed-by: Cédric Le Goater Link: https://lore.kernel.org/r/20240109064628.595453-7-pet...@redhat.com Signed-off-by: Peter Xu ---

[PULL 02/20] migration/multifd: Remove MultiFDPages_t::packet_num

2024-01-15 Thread peterx
From: Fabiano Rosas This was introduced by commit 34c55a94b1 ("migration: Create multipage support") and never used. Signed-off-by: Fabiano Rosas Reviewed-by: Peter Xu Link: https://lore.kernel.org/r/20240104142144.9680-2-faro...@suse.de Signed-off-by: Peter Xu --- migration/multifd.h | 2

[PULL 01/20] migration: Simplify initial conditionals in migration for better readability

2024-01-15 Thread peterx
From: Het Gala The inital conditional statements in qmp migration functions is harder to understand than necessary. It is better to get all errors out of the way in the beginning itself to have better readability and error handling. Signed-off-by: Het Gala Suggested-by: Markus Armbruster

[PULL 19/20] docs/migration: Further move virtio to be feature of migration

2024-01-15 Thread peterx
From: Peter Xu Move it one layer down, so taking Virtio-migration as a feature for migration. Cc: "Michael S. Tsirkin" Cc: Jason Wang Reviewed-by: Cédric Le Goater Link: https://lore.kernel.org/r/20240109064628.595453-11-pet...@redhat.com Signed-off-by: Peter Xu ---

[PULL 10/20] docs/migration: Create migration/ directory

2024-01-15 Thread peterx
From: Peter Xu Migration documentation is growing into a single file too large. Create a sub-directory for it for a split. We also already have separate vfio/virtio documentations, move it all over into the directory. Note that the virtio one is still not yet converted to rST. That is a job

[PULL 08/20] tests/qtest/migration: Use the new migration_test_add

2024-01-15 Thread peterx
From: Fabiano Rosas Replace the tests registration with the new function that prints tests names. Signed-off-by: Fabiano Rosas Reviewed-by: Peter Xu Link: https://lore.kernel.org/r/20240104142144.9680-8-faro...@suse.de Signed-off-by: Peter Xu --- tests/qtest/migration-test.c | 215

[PULL 11/20] docs/migration: Create index page

2024-01-15 Thread peterx
From: Peter Xu Create an index page for migration module. Move VFIO migration there too. A trivial touch-up on the title to use lower case there. Since then we'll have "migration" as the top title, make the main doc file renamed to "migration framework". Cc: Alex Williamson Cc: Cédric Le

[PULL 17/20] docs/migration: Organize "Postcopy" page

2024-01-15 Thread peterx
From: Peter Xu Reorganize the page, moving things around, and add a few headlines ("Postcopy internals", "Postcopy features") to cover sub-areas. Reviewed-by: Cédric Le Goater Link: https://lore.kernel.org/r/20240109064628.595453-9-pet...@redhat.com Signed-off-by: Peter Xu ---

[PULL 09/20] tests/qtest: Re-enable multifd cancel test

2024-01-15 Thread peterx
From: Fabiano Rosas We've found the source of flakiness in this test, so re-enable it. Reviewed-by: Juan Quintela Signed-off-by: Fabiano Rosas Link: https://lore.kernel.org/r/20230606144551.24367-4-faro...@suse.de [peterx: rebase to 2a61a6964c, to use migration_test_add()] Signed-off-by:

[PULL 03/20] migration/multifd: Remove QEMUFile from where it is not needed

2024-01-15 Thread peterx
From: Fabiano Rosas Signed-off-by: Fabiano Rosas Reviewed-by: Peter Xu Link: https://lore.kernel.org/r/20240104142144.9680-3-faro...@suse.de Signed-off-by: Peter Xu --- migration/multifd.h | 4 ++-- migration/multifd.c | 12 ++-- migration/ram.c | 15 +++ 3 files

[PULL 07/20] tests/qtest/migration: Add a wrapper to print test names

2024-01-15 Thread peterx
From: Fabiano Rosas Our usage of gtest results in us losing the very basic functionality of "knowing which test failed". The issue is that gtest only prints test names ("paths" in gtest parlance) once the test has finished, but we use asserts in the tests and crash gtest itself before it can

[PULL 04/20] migration/multifd: Change multifd_pages_init argument

2024-01-15 Thread peterx
From: Fabiano Rosas The 'size' argument is actually the number of pages that fit in a multifd packet. Change it to uint32_t and rename. Signed-off-by: Fabiano Rosas Reviewed-by: Peter Xu Link: https://lore.kernel.org/r/20240104142144.9680-4-faro...@suse.de Signed-off-by: Peter Xu ---

[PULL 00/20] Migration 20240116 patches

2024-01-15 Thread peterx
From: Peter Xu The following changes since commit 977542ded7e6b28d2bc077bcda24568c716e393c: Merge tag 'pull-testing-updates-120124-2' of https://gitlab.com/stsquad/qemu into staging (2024-01-12 14:02:53 +) are available in the Git repository at: https://gitlab.com/peterx/qemu.git

[RFC PATCH 1/1] hw/intc/loongarch_extioi: Add virt extension support

2024-01-15 Thread Song Gao
With hardware extioi, irq can be routed to four vcpus with hardware extioi. This patch adds virt extension support, sot that irq can be routed to 256 vcpus. Signed-off-by: Song Gao --- include/hw/intc/loongarch_extioi.h | 24 +- include/hw/loongarch/virt.h| 6 ++

Re: FW: [PATCH] vhost-user: add VIRTIO_F_IN_ORDER and VIRTIO_F_NOTIFICATION_DATA feature

2024-01-15 Thread Jason Wang
On Tue, Jan 16, 2024 at 9:57 AM Wentao Jia wrote: > > Hi, Jason > > I just add two features in vhost user feature bits, The patch was tested in > my environment > I do not know what the compatibility mean For example, if you don't do that, Migrating from 9.0 to 8.2 will break as 8.2 doesn't

RE: FW: [PATCH] vhost-user: add VIRTIO_F_IN_ORDER and VIRTIO_F_NOTIFICATION_DATA feature

2024-01-15 Thread Wentao Jia
Hi, Jason I just add two features in vhost user feature bits, The patch was tested in my environment I do not know what the compatibility mean Wentao -Original Message- From: Jason Wang Sent: Monday, January 15, 2024 8:18 AM To: Wentao Jia Cc: qemu-devel@nongnu.org; m...@redhat.com;

[PATCH v2] configure: Add linux header compile support for LoongArch

2024-01-15 Thread Bibo Mao
When compiling qemu with system KVM mode for LoongArch, header files in directory linux-headers/asm-loongarch should be used firstly. Otherwise it fails to find kvm.h on system with old glibc, since latest kernel header files are not installed. This patch adds linux_arch definition for LoongArch

[PATCH v2 2/2] hw/riscv/virt-acpi-build.c: Generate SPCR table

2024-01-15 Thread Sia Jee Heng
Generate Serial Port Console Redirection Table (SPCR) for RISC-V virtual machine. Signed-off-by: Sia Jee Heng Reviewed-by: Daniel Henrique Barboza --- hw/riscv/virt-acpi-build.c | 39 ++ 1 file changed, 39 insertions(+) diff --git

[PATCH v2 1/2] hw/arm/virt-acpi-build.c: Migrate SPCR creation to common location

2024-01-15 Thread Sia Jee Heng
RISC-V should also generate the SPCR in a manner similar to ARM. Therefore, instead of replicating the code, relocate this function to the common AML build. Signed-off-by: Sia Jee Heng --- hw/acpi/aml-build.c | 51 hw/arm/virt-acpi-build.c| 68

[PATCH v2 0/2] RISC-V: ACPI: Enable SPCR

2024-01-15 Thread Sia Jee Heng
This series focuses on enabling the Serial Port Console Redirection (SPCR) table for the RISC-V virt platform. Considering that ARM utilizes the same function, the initial patch involves migrating the build_spcr function to common code. This consolidation ensures that RISC-V avoids duplicating the

Re: [PATCH 0/6] net: fix non-deterministic failures of the 'netdev-socket' qtest

2024-01-15 Thread Jason Wang
On Mon, Jan 15, 2024 at 6:19 PM Peter Maydell wrote: > > On Mon, 15 Jan 2024 at 02:37, Jason Wang wrote: > > > > On Fri, Jan 5, 2024 at 12:45 AM Stefan Hajnoczi wrote: > > > > > > On Thu, 4 Jan 2024 at 11:30, Daniel P. Berrangé > > > wrote: > > > > > > > > We've previously bumped up the

[PATCH 2/2] tests/tcg: Add the syscall catchpoint gdbstub test

2024-01-15 Thread Ilya Leoshkevich
Check that adding/removing syscall catchpoints works. Signed-off-by: Ilya Leoshkevich --- tests/tcg/multiarch/Makefile.target | 10 +++- tests/tcg/multiarch/catch-syscalls.c | 51 ++ tests/tcg/multiarch/gdbstub/catch-syscalls.py | 52 +++ 3

[PATCH 0/2] gdbstub: Implement catching syscalls

2024-01-15 Thread Ilya Leoshkevich
Based-on: <20240116003551.75168-1-...@linux.ibm.com> ([PATCH v3 0/3] linux-user: Allow gdbstub to ignore page protection) Hi, I noticed that GDB's "catch syscall" does not work with qemu-user. This series adds the missing bits in [1/2] and a test in [2/2]. I'm basing this on my other series,

[PATCH 1/2] gdbstub: Implement catching syscalls

2024-01-15 Thread Ilya Leoshkevich
GDB supports stopping on syscall entry and exit using the "catch syscall" command. It relies on 3 packets, which are currently not supported by QEMU: * qSupported:QCatchSyscalls+ [1] * QCatchSyscalls: [2] * T05syscall_entry: and T05syscall_return: [3] Implement generation and handling of these

[PATCH v3 2/3] tests/tcg: Factor out gdbstub test functions

2024-01-15 Thread Ilya Leoshkevich
Both the report() function as well as the initial gdbstub test sequence are copy-pasted into ~10 files with slight modifications. This indicates that they are indeed generic, so factor them out. While at it, add a few newlines to make the formatting closer to PEP-8. Signed-off-by: Ilya

[PATCH v3 1/3] linux-user: Allow gdbstub to ignore page protection

2024-01-15 Thread Ilya Leoshkevich
gdbserver ignores page protection by virtue of using /proc/$pid/mem. Teach qemu gdbstub to do this too. This will not work if /proc is not mounted; accept this limitation. One alternative is to temporarily grant the missing PROT_* bit, but this is inherently racy. Another alternative is

[PATCH v3 0/3] linux-user: Allow gdbstub to ignore page protection

2024-01-15 Thread Ilya Leoshkevich
v2: https://lists.gnu.org/archive/html/qemu-devel/2024-01/msg01592.html v2 -> v3: Add Richard's R-b on [1/3]. Fix printing the architecture name and the number of failures in test_gdbstub.py. Patches that need review: [2/3] and [3/3]. v1:

[PATCH v3 3/3] tests/tcg: Add the PROT_NONE gdbstub test

2024-01-15 Thread Ilya Leoshkevich
Make sure that qemu gdbstub, like gdbserver, allows reading from and writing to PROT_NONE pages. Signed-off-by: Ilya Leoshkevich --- tests/tcg/multiarch/Makefile.target | 9 +- tests/tcg/multiarch/gdbstub/prot-none.py | 22 + tests/tcg/multiarch/prot-none.c | 40

Re: [PATCH] target/i386/kvm: call kvm_put_vcpu_events() before kvm_put_nested_state()

2024-01-15 Thread Eiichi Tsukata
Ping. > On Nov 8, 2023, at 10:12, Eiichi Tsukata wrote: > > Hi all, appreciate any comments or feedbacks on the patch. > > Thanks, > Eiichi > >> On Nov 1, 2023, at 23:04, Vitaly Kuznetsov wrote: >> >> Eiichi Tsukata writes: >> >>> FYI: The EINVAL in vmx_set_nested_state() is caused by the

Re: [PATCH v3 4/4] [NOT FOR MERGE] tests/qtest/migration: Adapt tests to use older QEMUs

2024-01-15 Thread Peter Xu
On Mon, Jan 15, 2024 at 10:45:33AM -0300, Fabiano Rosas wrote: > > IMHO the n-1 tests are not for this. The new FOO cap can only be enabled > > in n+ versions anyway, so something like above should be covered by the > > normal migration test that anyone would like to propose the new FOO cap. > >

Re: [RFC PATCH v3 00/30] migration: File based migration with multifd and fixed-ram

2024-01-15 Thread Peter Xu
On Mon, Jan 15, 2024 at 04:45:15PM -0300, Fabiano Rosas wrote: > Peter Xu writes: > > > On Thu, Jan 11, 2024 at 03:38:31PM -0300, Fabiano Rosas wrote: > >> Peter Xu writes: > >> > >> > On Mon, Nov 27, 2023 at 05:25:42PM -0300, Fabiano Rosas wrote: > >> >> Hi, > >> >> > >> >> In this v3: > >>

Re: [PATCH 1/2] linux-user/riscv: vdso: fix call frame info in __vdso_rt_sigreturn

2024-01-15 Thread Richard Henderson
On 1/16/24 10:15, Vineet Gupta wrote: When testing gcc testsuite against QEMU v8.2 we found some additional failures vs. v8.1.2. | FAIL: gcc.dg/cleanup-10.c execution test | FAIL: gcc.dg/cleanup-11.c execution test | FAIL: gcc.dg/cleanup-8.c execution test | FAIL: gcc.dg/cleanup-9.c execution

[PATCH 2/2] linux-user/riscv: rebuild vdso binaries after prev fix

2024-01-15 Thread Vineet Gupta
Signed-off-by: Vineet Gupta --- Splitting this from prev patch in case maintainers want to regenerate the vdso at their end. Or if they choose to, this can be squashed with prev change too. --- Signed-off-by: Vineet Gupta --- linux-user/riscv/vdso-32.so | Bin 2900 -> 2836 bytes

[PATCH 1/2] linux-user/riscv: vdso: fix call frame info in __vdso_rt_sigreturn

2024-01-15 Thread Vineet Gupta
When testing gcc testsuite against QEMU v8.2 we found some additional failures vs. v8.1.2. | FAIL: gcc.dg/cleanup-10.c execution test | FAIL: gcc.dg/cleanup-11.c execution test | FAIL: gcc.dg/cleanup-8.c execution test | FAIL: gcc.dg/cleanup-9.c execution test All of these tests involve

Re: [PATCH v2 12/12] target/riscv/cpu.c: remove cpu->cfg.vlen

2024-01-15 Thread Richard Henderson
On 1/16/24 09:25, Daniel Henrique Barboza wrote: There is no need to keep both 'vlen' and 'vlenb'. All existing code that requires 'vlen' is retrieving it via 'vlenb << 3'. Signed-off-by: Daniel Henrique Barboza --- target/riscv/cpu.c | 8 +++- target/riscv/cpu_cfg.h | 1 -

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

2024-01-15 Thread Richard Henderson
On 1/16/24 09:25, Daniel Henrique Barboza wrote: Signed-off-by: Daniel Henrique Barboza --- target/riscv/cpu.h | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h index 11df226a00..7304e478c2 100644 --- a/target/riscv/cpu.h +++

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

2024-01-15 Thread Richard Henderson
On 1/16/24 09:25, Daniel Henrique Barboza wrote: Calculate the maximum vector size possible, 'max_sz', which is the size in bytes 'vlenb' multiplied by the max value of LMUL (LMUL = 8, when s->lmul = 3). 'max_sz' is then shifted right by 'scale', expressed as '3 - s->lmul', which is clearer

Re: [RFC PATCH v3 11/30] migration/multifd: Allow multifd without packets

2024-01-15 Thread Peter Xu
On Mon, Jan 15, 2024 at 03:39:29PM -0300, Fabiano Rosas wrote: > > Maybe multifd_use_packets()? Dropping the migrate_ prefix as this is not a > > global API but multifd-only. Then if multifd_packets() reads too weird and > > unclear, "add" makes it clear. > > We removed all the instances of

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

2024-01-15 Thread Richard Henderson
On 1/16/24 09:25, Daniel Henrique Barboza wrote: Signed-off-by: Daniel Henrique Barboza --- target/riscv/cpu.h | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) Reviewed-by: Richard Henderson r~

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

2024-01-15 Thread Richard Henderson
On 1/16/24 09:25, 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. Adjust the shift to use vlenb. Signed-off-by: Daniel Henrique Barboza --- target/riscv/vector_helper.c | 8

Re: [PATCH v2 07/12] target/riscv/vector_helper.c: use 'vlenb'

2024-01-15 Thread Richard Henderson
On 1/16/24 09:25, Daniel Henrique Barboza wrote: Use 'cpu->cfg.vlenb' instead of 'cpu->cfg.vlen >> 3'. Signed-off-by: Daniel Henrique Barboza --- target/riscv/vector_helper.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) Reviewed-by: Richard Henderson r~

Re: [PATCH v2 05/12] target/riscv/insn_trans/trans_rvv.c.inc: use 'vlenb'

2024-01-15 Thread Richard Henderson
On 1/16/24 09:25, Daniel Henrique Barboza wrote: Use s->cfg_ptr->vlenb instead of "s->cfg_ptr->vlen / 8" and "s->cfg_ptr->vlen >> 3". Signed-off-by: Daniel Henrique Barboza --- target/riscv/insn_trans/trans_rvv.c.inc | 140 1 file changed, 70 insertions(+), 70

Re: [PATCH v2 04/12] target/riscv/insn_trans/trans_rvbf16.c.inc: use cpu->cfg.vlenb

2024-01-15 Thread Richard Henderson
On 1/16/24 09:25, Daniel Henrique Barboza wrote: Use ctx->cfg_ptr->vlenb instead of ctx->cfg_ptr->vlen / 8. Signed-off-by: Daniel Henrique Barboza --- target/riscv/insn_trans/trans_rvbf16.c.inc | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) Reviewed-by: Richard

Re: [PATCH v2 03/12] target/riscv/gdbstub.c: use 'vlenb' instead of shifting 'vlen'

2024-01-15 Thread Richard Henderson
On 1/16/24 09:25, Daniel Henrique Barboza wrote: Signed-off-by: Daniel Henrique Barboza --- target/riscv/gdbstub.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) Reviewed-by: Richard Henderson r~

Re: [PATCH v2 02/12] target/riscv/csr.c: use 'vlenb' instead of 'vlen'

2024-01-15 Thread Richard Henderson
On 1/16/24 09:25, Daniel Henrique Barboza wrote: As a bonus, we're being more idiomatic using cpu->cfg.vlenb when reading CSR_VLENB. Signed-off-by: Daniel Henrique Barboza --- target/riscv/csr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Reviewed-by: Richard Henderson r~

Re: [PATCH v2 01/12] target/riscv: add 'vlenb' field in cpu->cfg

2024-01-15 Thread Richard Henderson
On 1/16/24 09:25, Daniel Henrique Barboza wrote: Our usage of 'vlenb' is overwhelming superior than the use of 'vlen'. We're using 'vlenb' most of the time, having to do 'vlen >> 3' or 'vlen / 8' in every instance. In hindsight we would be better if the 'vlenb' property was introduced instead

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

2024-01-15 Thread Daniel Henrique Barboza
Calculate the maximum vector size possible, 'max_sz', which is the size in bytes 'vlenb' multiplied by the max value of LMUL (LMUL = 8, when s->lmul = 3). 'max_sz' is then shifted right by 'scale', expressed as '3 - s->lmul', which is clearer than doing 'scale = lmul - 3' and then using '-scale'

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

2024-01-15 Thread Daniel Henrique Barboza
Signed-off-by: Daniel Henrique Barboza --- target/riscv/cpu.h | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h index 11df226a00..7304e478c2 100644 --- a/target/riscv/cpu.h +++ b/target/riscv/cpu.h @@ -692,7 +692,11 @@ static inline

[PATCH v2 02/12] target/riscv/csr.c: use 'vlenb' instead of 'vlen'

2024-01-15 Thread Daniel Henrique Barboza
As a bonus, we're being more idiomatic using cpu->cfg.vlenb when reading CSR_VLENB. Signed-off-by: Daniel Henrique Barboza --- target/riscv/csr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/riscv/csr.c b/target/riscv/csr.c index 674ea075a4..5c8d22452b 100644

[PATCH v2 01/12] target/riscv: add 'vlenb' field in cpu->cfg

2024-01-15 Thread Daniel Henrique Barboza
Our usage of 'vlenb' is overwhelming superior than the use of 'vlen'. We're using 'vlenb' most of the time, having to do 'vlen >> 3' or 'vlen / 8' in every instance. In hindsight we would be better if the 'vlenb' property was introduced instead of 'vlen'. That's not what happened, and now we

[PATCH v2 07/12] target/riscv/vector_helper.c: use 'vlenb'

2024-01-15 Thread Daniel Henrique Barboza
Use 'cpu->cfg.vlenb' instead of 'cpu->cfg.vlen >> 3'. Signed-off-by: Daniel Henrique Barboza --- target/riscv/vector_helper.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/target/riscv/vector_helper.c b/target/riscv/vector_helper.c index

[PATCH v2 04/12] target/riscv/insn_trans/trans_rvbf16.c.inc: use cpu->cfg.vlenb

2024-01-15 Thread Daniel Henrique Barboza
Use ctx->cfg_ptr->vlenb instead of ctx->cfg_ptr->vlen / 8. Signed-off-by: Daniel Henrique Barboza --- target/riscv/insn_trans/trans_rvbf16.c.inc | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/target/riscv/insn_trans/trans_rvbf16.c.inc

[PATCH v2 12/12] target/riscv/cpu.c: remove cpu->cfg.vlen

2024-01-15 Thread Daniel Henrique Barboza
There is no need to keep both 'vlen' and 'vlenb'. All existing code that requires 'vlen' is retrieving it via 'vlenb << 3'. Signed-off-by: Daniel Henrique Barboza --- target/riscv/cpu.c | 8 +++- target/riscv/cpu_cfg.h | 1 - target/riscv/tcg/tcg-cpu.c | 4 +++- 3 files changed,

[PATCH v2 03/12] target/riscv/gdbstub.c: use 'vlenb' instead of shifting 'vlen'

2024-01-15 Thread Daniel Henrique Barboza
Signed-off-by: Daniel Henrique Barboza --- target/riscv/gdbstub.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/target/riscv/gdbstub.c b/target/riscv/gdbstub.c index 58b3ace0fe..5ab0abda19 100644 --- a/target/riscv/gdbstub.c +++ b/target/riscv/gdbstub.c @@ -130,7

[PATCH v2 06/12] target/riscv/insn_trans/trans_rvvk.c.inc: use 'vlenb'

2024-01-15 Thread Daniel Henrique Barboza
Use s->cfg_ptr->vlenb instead of s->cfg_ptr->vlen / 8. Signed-off-by: Daniel Henrique Barboza --- target/riscv/insn_trans/trans_rvvk.c.inc | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/target/riscv/insn_trans/trans_rvvk.c.inc

[PATCH v2 11/12] trans_rvv.c.inc: use 'vlenb' to calc vlmax in trans_vrgather_v*()

2024-01-15 Thread Daniel Henrique Barboza
Use the same vext_get_vlmax() logic to retrieve 'vlmax' in trans_vrgather_vi() and trans_vrgather_vx(). Signed-off-by: Daniel Henrique Barboza --- target/riscv/insn_trans/trans_rvv.c.inc | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git

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

2024-01-15 Thread Daniel Henrique Barboza
Use the new 'vlenb' CPU config to validate fractional LMUL. The original comparison is done with 'vlen' and 'sew', both in bits. Adjust the shift to use vlenb. Signed-off-by: Daniel Henrique Barboza --- target/riscv/vector_helper.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-)

[PATCH v2 05/12] target/riscv/insn_trans/trans_rvv.c.inc: use 'vlenb'

2024-01-15 Thread Daniel Henrique Barboza
Use s->cfg_ptr->vlenb instead of "s->cfg_ptr->vlen / 8" and "s->cfg_ptr->vlen >> 3". Signed-off-by: Daniel Henrique Barboza --- target/riscv/insn_trans/trans_rvv.c.inc | 140 1 file changed, 70 insertions(+), 70 deletions(-) diff --git

[PATCH v2 00/12] target/riscv: add 'cpu->cfg.vlenb', remove 'cpu->cfg.vlen'

2024-01-15 Thread Daniel Henrique Barboza
Hi, This v2 contains changes proposed after the review from Richard. Most notable change is in patch 11, where we simplified our lives a bit and just calculated 'vlmax' using 'vlenb' instead of trying to use the TCG global 'cpu_vl'. Patch 10 also changed a bit to avoid the negative shift we were

[PATCH v2 2/3] Hexagon (target/hexagon) Use QEMU decodetree (16-bit instructions)

2024-01-15 Thread Taylor Simpson
Section 10.3 of the Hexagon V73 Programmer's Reference Manual A duplex is encoded as a 32-bit instruction with bits [15:14] set to 00. The sub-instructions that comprise a duplex are encoded as 13-bit fields in the duplex. Create a decoder for each subinstruction class (a, l1, l2, s1, s2).

  1   2   3   >