Re: [PATCH 3/3] ci: Update comment for migration-compat-aarch64

2024-02-06 Thread Daniel P . Berrangé
On Tue, Feb 06, 2024 at 02:31:51PM +0800, pet...@redhat.com wrote: > From: Peter Xu > > It turns out that we may not be able to enable this test even for the > upcoming v9.0. Document what we're still missing. > > Signed-off-by: Peter Xu > --- > .gitlab-ci.d/buildtest.yml | 7 --- > 1 fil

Re: [PATCH 2/3] ci: Remove tag dependency for build-previous-qemu

2024-02-06 Thread Daniel P . Berrangé
On Tue, Feb 06, 2024 at 02:31:50PM +0800, pet...@redhat.com wrote: > From: Peter Xu > > The new build-previous-qemu job relies on QEMU release tag being present, > while that may not be always true for personal git repositories since by > default tag is not pushed. The job can fail on those CI k

Re: [PATCH 1/3] tests/migration-test: Stick with gicv3 in aarch64 test

2024-02-06 Thread Daniel P . Berrangé
On Tue, Feb 06, 2024 at 02:31:49PM +0800, pet...@redhat.com wrote: > From: Peter Xu > > Recently we introduced cross-binary migration test. It's always wanted > that migration-test uses stable guest ABI for both QEMU binaries in this > case, so that both QEMU binaries will be compatible on the m

[RFC PATCH 0/4] Confidential Guest Support: Introduce kvm_init() and kvm_reset() virtual functions

2024-02-06 Thread Xiaoyao Li
This series is inspired and suggested by Daniel: https://lore.kernel.org/qemu-devel/zbfoqseuv6_zw...@redhat.com/ Currently, different confidential VMs in different architectures have their own specific *_kvm_init() (and some have *_kvm_reset()) exposed for KVM stuff when it's a confidential VM. e.

[RFC PATCH 2/4] i386/sev: Switch to use confidential_guest_kvm_init()

2024-02-06 Thread Xiaoyao Li
Use confidential_guest_kvm_init() instead of calling SEV specific sev_kvm_init(). As a bouns, it fits to future TDX when TDX implements its own confidential_guest_support and .kvm_init(). Move the "TypeInfo sev_guest_info" definition and related functions to the end of the file, to avoid declaring

[RFC PATCH 3/4] ppc/pef: switch to use confidential_guest_kvm_init/reset()

2024-02-06 Thread Xiaoyao Li
Use the unified interface to call confidential guest related kvm_init() and kvm_reset(), to avoid exposing pef specific functions. remove perf.h since it is now blank.. Signed-off-by: Xiaoyao Li --- hw/ppc/pef.c | 9 ++--- hw/ppc/spapr.c | 6 +++--- include/hw/ppc/pef.h | 17

[RFC PATCH 4/4] s390: Switch to use confidential_guest_kvm_init()

2024-02-06 Thread Xiaoyao Li
Use unified confidential_guest_kvm_init(), to avoid exposing specific functions. Signed-off-by: Xiaoyao Li --- hw/s390x/s390-virtio-ccw.c | 3 ++- target/s390x/kvm/pv.c | 8 target/s390x/kvm/pv.h | 14 -- 3 files changed, 10 insertions(+), 15 deletions(-) diff -

[RFC PATCH 1/4] confidential guest support: Add kvm_init() and kvm_reset() in class

2024-02-06 Thread Xiaoyao Li
Different confidential VMs in different architectures all have the same needs to do their specific initialization (and maybe resetting) stuffs with KVM. Currently each of them exposes individual *_kvm_init() functions and let machine code or kvm code to call it. To make it more object oriented, ad

Re: [PATCH 2/3] ci: Remove tag dependency for build-previous-qemu

2024-02-06 Thread Peter Xu
On Tue, Feb 06, 2024 at 08:11:58AM +, Daniel P. Berrangé wrote: > On Tue, Feb 06, 2024 at 02:31:50PM +0800, pet...@redhat.com wrote: > > From: Peter Xu > > > > The new build-previous-qemu job relies on QEMU release tag being present, > > while that may not be always true for personal git repo

Re: Re: [PATCH] vdpa-dev: Fix initialisation order to restore VDUSE compatibility

2024-02-06 Thread Stefano Garzarella
On Tue, Feb 06, 2024 at 10:47:40AM +0800, Jason Wang wrote: On Mon, Feb 5, 2024 at 6:51 PM Stefano Garzarella wrote: On Fri, Feb 02, 2024 at 02:25:21PM +0100, Kevin Wolf wrote: >VDUSE requires that virtqueues are first enabled before the DRIVER_OK >status flag is set; with the current API of t

Re: [PATCH v11 0/3] gdbstub and TCG plugin improvements

2024-02-06 Thread Akihiko Odaki
On 2024/02/05 18:31, Alex Bennée wrote: Akihiko Odaki writes: On 2024/02/03 22:58, Alex Bennée wrote: Akihiko Odaki writes: On 2024/02/03 20:08, Alex Bennée wrote: Akihiko Odaki writes: This series extracts fixes and refactorings that can be applied independently from "[PATCH v9 00/

Re: [PATCH v5 2/4] target/s390x: Emulate CVB, CVBY and CVBG

2024-02-06 Thread Thomas Huth
On 05/02/2024 21.54, Ilya Leoshkevich wrote: Convert to Binary - counterparts of the already implemented Convert to Decimal (CVD*) instructions. Example from the Principles of Operation: 25594C becomes 63FA. Co-developed-by: Pavel Zbitskiy Signed-off-by: Ilya Leoshkevich --- target/s390x/hel

Re: [PATCH v2 1/6] migration/multifd: Join the TLS thread

2024-02-06 Thread Daniel P . Berrangé
On Mon, Feb 05, 2024 at 04:49:24PM -0300, Fabiano Rosas wrote: > We're currently leaking the resources of the TLS thread by not joining > it and also overwriting the p->thread pointer altogether. AFAICS, it is not ovewriting 'p->thread' because at the time when the TLS thread is created, the main

Re: [PATCH v3 4/4] meson: Link with libinotify on FreeBSD

2024-02-06 Thread Thomas Huth
On 06/02/2024 01.22, Ilya Leoshkevich wrote: make vm-build-freebsd fails with: ld: error: undefined symbol: inotify_init1 >>> referenced by filemonitor-inotify.c:183 (../src/util/filemonitor-inotify.c:183) >>> util_filemonitor-inotify.c.o:(qemu_file_monitor_new) in

Re: [PATCH v2 1/6] migration/multifd: Join the TLS thread

2024-02-06 Thread Peter Xu
On Tue, Feb 06, 2024 at 08:53:45AM +, Daniel P. Berrangé wrote: > AFAICS, it is not ovewriting 'p->thread' because at the time when the > TLS thread is created, the main 'send thread' has not yet been > created. The TLS thread and send thread execution times are mutually > exclusive. IIUC it'l

Re: [PATCH] tests/cdrom-test: Add cdrom test for LoongArch virt machine

2024-02-06 Thread Thomas Huth
On 06/02/2024 03.29, maobibo wrote: Hi Philippe, On 2024/2/5 下午8:58, Philippe Mathieu-Daudé wrote: Hi Bibo, On 5/2/24 03:13, Bibo Mao wrote: The cdrom test skips to execute on LoongArch system with command "make check", this patch enables cdrom test for LoongArch virt machine platform. With

[PATCH v3 04/17] cpu: call plugin init hook asynchronously

2024-02-06 Thread Pierrick Bouvier
This ensures we run during a cpu_exec, which allows to call start/end exclusive from this init hook (needed for new scoreboard API introduced later). async work is run before any tb is translated/executed, so we can guarantee plugin init will be called before any other hook. The previous change m

[PATCH v3 03/17] plugins: fix order of init/idle/resume callback

2024-02-06 Thread Pierrick Bouvier
We found that vcpu_init_hook was called *after* idle callback. vcpu_init is called from cpu_realize_fn, while idle/resume cb are called from qemu_wait_io_event (in vcpu thread). This change ensures we only call idle and resume cb only once a plugin was init for a given vcpu. Next change in the se

[PATCH v3 00/17] TCG Plugin inline operation enhancement

2024-02-06 Thread Pierrick Bouvier
This series adds a new thread-safe API to declare inline operation inside plugins. As well, it removes the existing non thread-safe API, and migrates all existing plugins to use it. Tested on Linux (user, system) for i386, x86_64 and aarch64. To give some context, this a long term series of work

[PATCH v3 07/17] plugins: implement inline operation relative to cpu_index

2024-02-06 Thread Pierrick Bouvier
Instead of working on a fixed memory location, allow to address it based on cpu_index, an element size and a given offset. Result address: ptr + offset + cpu_index * element_size. With this, we can target a member in a struct array from a base pointer. Current semantic is not modified, thus inlin

[PATCH v3 02/17] plugins: add qemu_plugin_num_vcpus function

2024-02-06 Thread Pierrick Bouvier
We now keep track of how many vcpus were started. This way, a plugin can easily query number of any vcpus at any point of execution, which unifies user and system mode workflows. Signed-off-by: Pierrick Bouvier --- include/qemu/qemu-plugin.h | 3 +++ plugins/plugin.h | 4 plug

[PATCH v3 08/17] plugins: add inline operation per vcpu

2024-02-06 Thread Pierrick Bouvier
Extends API with three new functions: qemu_plugin_register_vcpu_{tb, insn, mem}_exec_inline_per_vcpu(). Those functions takes a qemu_plugin_u64_t as input. This allows to have a thread-safe and type-safe version of inline operations. Reviewed-by: Alex Bennée Signed-off-by: Pierrick Bouvier ---

[PATCH v3 13/17] contrib/plugins/hotblocks: migrate to new per_vcpu API

2024-02-06 Thread Pierrick Bouvier
Signed-off-by: Pierrick Bouvier --- contrib/plugins/hotblocks.c | 50 ++--- 1 file changed, 30 insertions(+), 20 deletions(-) diff --git a/contrib/plugins/hotblocks.c b/contrib/plugins/hotblocks.c index 4de1b134944..02bc5078bdd 100644 --- a/contrib/plugins/hotbloc

[PATCH v3 05/17] plugins: scoreboard API

2024-02-06 Thread Pierrick Bouvier
We introduce a cpu local storage, automatically managed (and extended) by QEMU itself. Plugin allocate a scoreboard, and don't have to deal with how many cpus are launched. This API will be used by new inline functions but callbacks can benefit from this as well. This way, they can operate without

[PATCH v3 12/17] tests/plugin/bb: migrate to new per_vcpu API

2024-02-06 Thread Pierrick Bouvier
Signed-off-by: Pierrick Bouvier --- tests/plugin/bb.c | 63 +++ 1 file changed, 26 insertions(+), 37 deletions(-) diff --git a/tests/plugin/bb.c b/tests/plugin/bb.c index df50d1fd3bc..36776dee1e1 100644 --- a/tests/plugin/bb.c +++ b/tests/plugin/bb.c @

[PATCH v3 06/17] docs/devel: plugins can trigger a tb flush

2024-02-06 Thread Pierrick Bouvier
When scoreboards need to be reallocated. Signed-off-by: Pierrick Bouvier --- docs/devel/multi-thread-tcg.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/devel/multi-thread-tcg.rst b/docs/devel/multi-thread-tcg.rst index 7302c3bf534..1420789fff3 100644 --- a/docs/devel/multi-thread-t

[PATCH v3 14/17] contrib/plugins/howvec: migrate to new per_vcpu API

2024-02-06 Thread Pierrick Bouvier
Signed-off-by: Pierrick Bouvier --- contrib/plugins/howvec.c | 53 1 file changed, 38 insertions(+), 15 deletions(-) diff --git a/contrib/plugins/howvec.c b/contrib/plugins/howvec.c index 644a7856bb2..2d10c87e0fb 100644 --- a/contrib/plugins/howvec.c +++

[PATCH v3 16/17] plugins: cleanup codepath for previous inline operation

2024-02-06 Thread Pierrick Bouvier
Signed-off-by: Pierrick Bouvier --- plugins/plugin.h | 5 - accel/tcg/plugin-gen.c | 13 - plugins/core.c | 29 - 3 files changed, 8 insertions(+), 39 deletions(-) diff --git a/plugins/plugin.h b/plugins/plugin.h index 8e485cfbd58..ba52a

[PATCH v3 11/17] tests/plugin/insn: migrate to new per_vcpu API

2024-02-06 Thread Pierrick Bouvier
Signed-off-by: Pierrick Bouvier --- tests/plugin/insn.c | 106 +--- 1 file changed, 50 insertions(+), 56 deletions(-) diff --git a/tests/plugin/insn.c b/tests/plugin/insn.c index 5fd3017c2b3..0d0a4cd1c34 100644 --- a/tests/plugin/insn.c +++ b/tests/plugin/

[PATCH v3 17/17] MAINTAINERS: Add myself as reviewer for TCG Plugins

2024-02-06 Thread Pierrick Bouvier
Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Pierrick Bouvier --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index dfaca8323e9..80528d3dc63 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3676,6 +3676,7 @@ TCG Plugins

[PATCH v3 10/17] tests/plugin/mem: migrate to new per_vcpu API

2024-02-06 Thread Pierrick Bouvier
Signed-off-by: Pierrick Bouvier --- tests/plugin/mem.c | 40 +--- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/tests/plugin/mem.c b/tests/plugin/mem.c index 44e91065ba7..d4729f5e015 100644 --- a/tests/plugin/mem.c +++ b/tests/plugin/mem.c @@

[PATCH v3 09/17] tests/plugin: add test plugin for inline operations

2024-02-06 Thread Pierrick Bouvier
For now, it simply performs instruction, bb and mem count, and ensure that inline vs callback versions have the same result. Later, we'll extend it when new inline operations are added. Use existing plugins to test everything works is a bit cumbersome, as different events are treated in different

[PATCH v3 15/17] plugins: remove non per_vcpu inline operation from API

2024-02-06 Thread Pierrick Bouvier
Now we have a thread-safe equivalent of inline operation, and that all plugins were changed to use it, there is no point to keep the old API. In more, it will help when we implement more functionality (conditional callbacks), as we can assume that we operate on a scoreboard. Bump API version as i

[PATCH v3 01/17] plugins: remove previous n_vcpus functions from API

2024-02-06 Thread Pierrick Bouvier
This information is already accessible using qemu_info_t during plugin install. We will introduce another function (qemu_plugin_num_vcpus) which represent how many cpus were enabled, by tracking new cpu indexes. It's a breaking change, so we bump API version. Signed-off-by: Pierrick Bouvier ---

Re: [PATCH] hw: riscv: Allow large kernels to boot by moving the initrd further way in RAM

2024-02-06 Thread Alexandre Ghiti
Hi Daniel, On Mon, Feb 5, 2024 at 2:36 PM Alexandre Ghiti wrote: > > Hi Daniel, > > On Mon, Feb 5, 2024 at 1:17 PM Daniel Henrique Barboza > wrote: > > > > > > > > On 2/5/24 04:00, Alexandre Ghiti wrote: > > > Currently, the initrd is placed at 128MB, which overlaps with the kernel > > > when it

Re: [PATCH 00/17] migration: Add new migration channel connect and TLS upgrade APIs

2024-02-06 Thread Peter Xu
On Thu, Jan 25, 2024 at 06:25:11PM +0200, Avihai Horon wrote: > Hello, > > Today there are several types of migration channels that can be used > during migration: main migration channel, multifd channels and postcopy > preempt channel. Each channel type has its own code to connect and to > TLS up

Re: [PATCH v2 1/6] migration/multifd: Join the TLS thread

2024-02-06 Thread Daniel P . Berrangé
On Tue, Feb 06, 2024 at 05:15:07PM +0800, Peter Xu wrote: > On Tue, Feb 06, 2024 at 08:53:45AM +, Daniel P. Berrangé wrote: > > AFAICS, it is not ovewriting 'p->thread' because at the time when the > > TLS thread is created, the main 'send thread' has not yet been > > created. The TLS thread an

Re: [PATCH 04/17] migration/multifd: Set p->running = true in the right place

2024-02-06 Thread Peter Xu
On Tue, Jan 30, 2024 at 08:44:19PM +0200, Avihai Horon wrote: > > On 30/01/2024 7:57, Peter Xu wrote: > > External email: Use caution opening links or attachments > > > > > > On Mon, Jan 29, 2024 at 02:20:35PM +0200, Avihai Horon wrote: > > > On 29/01/2024 6:17, Peter Xu wrote: > > > > External

[PULL 09/12] tests/vm: Set UseDNS=no in the sshd configuration

2024-02-06 Thread Thomas Huth
From: Ilya Leoshkevich make vm-build-freebsd sometimes fails with "Connection timed out during banner exchange". The client strace shows: 13:59:30 write(3, "SSH-2.0-OpenSSH_9.3\r\n", 21) = 21 13:59:30 getpid() = 252655 13:59:30 poll([{fd=3, events=POLLIN}], 1, 5

[PULL 01/12] hw/scsi/lsi53c895a: add missing decrement of reentrancy counter

2024-02-06 Thread Thomas Huth
From: Sven Schnelle When the maximum count of SCRIPTS instructions is reached, the code stops execution and returns, but fails to decrement the reentrancy counter. This effectively renders the SCSI controller unusable because on next entry the reentrancy counter is still above the limit. This bu

[PULL 11/12] test-util-filemonitor: Adapt to the FreeBSD inotify rename semantics

2024-02-06 Thread Thomas Huth
From: Ilya Leoshkevich Unlike on Linux, on FreeBSD renaming a file when the destination already exists results in an IN_DELETE event for that existing file: $ FILEMONITOR_DEBUG=1 build/tests/unit/test-util-filemonitor Rename /tmp/test-util-filemonitor-K13LI2/fish/one.txt -> /tmp/test-ut

[PULL 06/12] tests/tcg/s390x: Test CONVERT TO DECIMAL

2024-02-06 Thread Thomas Huth
From: Ilya Leoshkevich Check the CVD's, CVDY's, and CVDG's corner cases. Reviewed-by: Thomas Huth Signed-off-by: Ilya Leoshkevich Message-ID: <20240205205830.6425-4-...@linux.ibm.com> Signed-off-by: Thomas Huth --- tests/tcg/s390x/cvd.c | 63 + tests

[PULL 05/12] target/s390x: Emulate CVB, CVBY and CVBG

2024-02-06 Thread Thomas Huth
From: Ilya Leoshkevich Convert to Binary - counterparts of the already implemented Convert to Decimal (CVD*) instructions. Example from the Principles of Operation: 25594C becomes 63FA. Co-developed-by: Pavel Zbitskiy Signed-off-by: Ilya Leoshkevich Reviewed-by: Thomas Huth Message-ID: <20240

[PULL 08/12] target/s390x: Prefer fast cpu_env() over slower CPU QOM cast macro

2024-02-06 Thread Thomas Huth
From: Philippe Mathieu-Daudé Mechanical patch produced running the command documented in scripts/coccinelle/cpu_env.cocci_template header. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth Message-ID: <20240129164514.73104-25-phi...@linaro.org> Sign

[PULL 07/12] tests/tcg/s390x: Test CONVERT TO BINARY

2024-02-06 Thread Thomas Huth
From: Ilya Leoshkevich Check the CVB's, CVBY's, and CVBG's corner cases. Co-developed-by: Pavel Zbitskiy Reviewed-by: Thomas Huth Tested-by: Thomas Huth Signed-off-by: Ilya Leoshkevich Message-ID: <20240205205830.6425-5-...@linux.ibm.com> Signed-off-by: Thomas Huth --- tests/tcg/s390x/cvb.

[PULL 04/12] target/s390x: Emulate CVDG

2024-02-06 Thread Thomas Huth
From: Ilya Leoshkevich CVDG is the same as CVD, except that it converts 64 bits into 128, rather than 32 into 64. Create a new helper, which uses Int128 wrappers. Reported-by: Ido Plat Reviewed-by: Richard Henderson Signed-off-by: Ilya Leoshkevich Message-ID: <20240205205830.6425-2-...@linux.

[PULL 02/12] target/ppc/cpu-models: Rename power5+ and power7+ for new QOM naming rules

2024-02-06 Thread Thomas Huth
The character "+" is now forbidden in QOM device names (see commit b447378e1217 - "Limit type names to alphanumerical and some few special characters"). For the "power5+" and "power7+" CPU names, there is currently a hack in type_name_is_valid() to still allow them for compatibility reasons. Howeve

[PULL 10/12] tests/vm/freebsd: Reload the sshd configuration

2024-02-06 Thread Thomas Huth
From: Ilya Leoshkevich After console_sshd_config(), the SSH server needs to be nudged to pick up the new configs. The scripts for the other BSD flavors already do this with a reboot, but a simple reload is sufficient. Reviewed-by: Thomas Huth Signed-off-by: Ilya Leoshkevich Message-ID: <202402

[PULL 00/12] s390x, tests and misc. patches

2024-02-06 Thread Thomas Huth
The following changes since commit 39a6e4f87e7b75a45b08d6dc8b8b7c2954c87440: Merge tag 'pull-qapi-2024-02-03' of https://repo.or.cz/qemu/armbru into staging (2024-02-03 13:31:58 +) are available in the Git repository at: https://gitlab.com/thuth/qemu.git tags/pull-request-2024-02-06 fo

[PULL 03/12] docs/about: Deprecate the old "power5+" and "power7+" CPU names

2024-02-06 Thread Thomas Huth
For consistency we should drop the names with a "+" in it in the long run. Message-ID: <20240117141054.73841-3-th...@redhat.com> Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Cédric Le Goater Reviewed-by: Harsh Prateek Bora Signed-off-by: Thomas Huth --- docs/about/deprecated.rst | 9 +

[PULL 12/12] meson: Link with libinotify on FreeBSD

2024-02-06 Thread Thomas Huth
From: Ilya Leoshkevich make vm-build-freebsd fails with: ld: error: undefined symbol: inotify_init1 >>> referenced by filemonitor-inotify.c:183 (../src/util/filemonitor-inotify.c:183) >>> util_filemonitor-inotify.c.o:(qemu_file_monitor_new) in archive libqemuutil.a O

Re: ui/dbus-display1.[ch] are not properly listed in dependencies

2024-02-06 Thread Marc-André Lureau
Hi Michael On Sat, Feb 3, 2024 at 5:41 PM Michael Tokarev wrote: > > Doing a build of just a single target with --enable modules results in build > error: > > > rm -rf b; cd b > ../configure --enable-modules --target-list=x86_64-softmmu > ninja qemu-system-x86_64 > >In file included fro

Re: [PATCH] hw/net/tulip: add chip status register values

2024-02-06 Thread Philippe Mathieu-Daudé
On 5/2/24 20:47, Sven Schnelle wrote: Netbsd isn't able to detect a link on the emulated tulip card. That's because netbsd reads the Chip Status Register of the Phy (address 0x14). The default phy data in the qemu tulip driver is all zero, which means no link is established and autonegotation isn

Re: [PATCH] hw: riscv: Allow large kernels to boot by moving the initrd further way in RAM

2024-02-06 Thread Daniel Henrique Barboza
On 2/6/24 06:41, Alexandre Ghiti wrote: Hi Daniel, On Mon, Feb 5, 2024 at 2:36 PM Alexandre Ghiti wrote: Hi Daniel, On Mon, Feb 5, 2024 at 1:17 PM Daniel Henrique Barboza wrote: On 2/5/24 04:00, Alexandre Ghiti wrote: Currently, the initrd is placed at 128MB, which overlaps with the

Re: [PATCH v2 5/6] migration/multifd: Unify multifd and TLS connection paths

2024-02-06 Thread Avihai Horon
On 05/02/2024 21:49, Fabiano Rosas wrote: External email: Use caution opening links or attachments During multifd channel creation (multifd_send_new_channel_async) when TLS is enabled, the multifd_channel_connect function is called twice, once to create the TLS handshake thread and another ti

Re: [PATCH 00/17] migration: Add new migration channel connect and TLS upgrade APIs

2024-02-06 Thread Avihai Horon
On 06/02/2024 12:04, Peter Xu wrote: External email: Use caution opening links or attachments On Thu, Jan 25, 2024 at 06:25:11PM +0200, Avihai Horon wrote: Hello, Today there are several types of migration channels that can be used during migration: main migration channel, multifd channels

[PATCH] target/riscv: Update $pc after linking to $ra in trans_cm_jalt()

2024-02-06 Thread Jason Chien
The original implementation sets $pc to the address read from the jump vector table first and links $ra with the address of the next instruction after the updated $pc. After jumping to the updated $pc and executing the next ret instruction, the program jumps to $ra, which is in the same function cu

hw/usb/hcd-ohci: Fix #1510, #303: pid not IN or OUT

2024-02-06 Thread Cord Amfmgm
This changes the ohci validation to not assert if invalid data is fed to the ohci controller. The poc suggested in https://bugs.launchpad.net/qemu/+bug/1907042 migrated to #303 does the following to feed it a SETUP pid and EndPt of 1: uint32_t MaxPacket = 64; uint32_t TDFormat = 0;

hw/usb/hcd-ohci: Fix #1510, #303: pid not IN or OUT

2024-02-06 Thread Cord Amfmgm
This changes the ohci validation to not assert if invalid data is fed to the ohci controller. The poc suggested in https://bugs.launchpad.net/qemu/+bug/1907042 and then migrated to bug #303 does the following to feed it a SETUP pid and EndPt of 1: uint32_t MaxPacket = 64; uint32_t

Re: hw/usb/hcd-ohci: Fix #1510, #303: pid not IN or OUT

2024-02-06 Thread Cord Amfmgm
Attempting to resend with both files in the patch this time: This changes the ohci validation to not assert if invalid data is fed to the ohci controller. The poc suggested in https://bugs.launchpad.net/qemu/+bug/1907042 migrated to #303 does the following to feed it a SETUP pid and EndPt of 1:

[PATCH 03/13] target/arm: Add Cortex-R52 IMPDEF sysregs

2024-02-06 Thread Peter Maydell
Add the Cortex-R52 IMPDEF sysregs, by defining them here and also by enabling the AUXCR feature which defines the ACTLR and HACTLR registers. As is our usual practice, we make these simple reads-as-zero stubs for now. Signed-off-by: Peter Maydell --- target/arm/tcg/cpu32.c | 108

[PATCH 05/13] hw/misc/mps2-scc: Fix condition for CFG3 register

2024-02-06 Thread Peter Maydell
We currently guard the CFG3 register read with (scc_partno(s) == 0x524 && scc_partno(s) == 0x547) which is clearly wrong as it is never true. This register is present on all board types except AN524 and AN527; correct the condition. Fixes: 6ac80818941829c0 ("hw/misc/mps2-scc: Implement changes f

[PATCH 08/13] hw/arm/mps3r: Initial skeleton for mps3-an536 board

2024-02-06 Thread Peter Maydell
The AN536 is another FPGA image for the MPS3 development board. Unlike the existing FPGA images we already model, this board uses a Cortex-R family CPU, and it does not use any equivalent to the M-profile "Subsystem for Embedded" SoC-equivalent that we model in hw/arm/armsse.c. It's therefore more

[PATCH 13/13] docs: Add documentation for the mps3-an536 board

2024-02-06 Thread Peter Maydell
Add documentation for the mps3-an536 board type. Signed-off-by: Peter Maydell --- docs/system/arm/mps2.rst | 37 ++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/docs/system/arm/mps2.rst b/docs/system/arm/mps2.rst index 8a75beb3a08..a305935cc49

[PATCH 04/13] target/arm: Allow access to SPSR_hyp from hyp mode

2024-02-06 Thread Peter Maydell
Architecturally, the AArch32 MSR/MRS to/from banked register instructions are UNPREDICTABLE for attempts to access a banked register that the guest could access in a more direct way (e.g. using this insn to access r8_fiq when already in FIQ mode). QEMU has chosen to UNDEF on all of these. However

[PATCH 02/13] target/arm: The Cortex-R52 has a read-only CBAR

2024-02-06 Thread Peter Maydell
The Cortex-R52 implements the Configuration Base Address Register (CBAR), as a read-only register. Add ARM_FEATURE_CBAR_RO to this CPU type, so that our implementation provides the register and the associated qdev property. Signed-off-by: Peter Maydell --- target/arm/tcg/cpu32.c | 1 + 1 file c

[PATCH 07/13] hw/misc/mps2-scc: Make changes needed for AN536 FPGA image

2024-02-06 Thread Peter Maydell
The MPS2 SCC device is broadly the same for all FPGA images, but has minor differences in the behaviour of the CFG registers depending on the image. In many cases we don't really care about the functionality controlled by these registers and a reads-as-written or similar behaviour is sufficient for

[PATCH 09/13] hw/arm/mps3r: Add CPUs, GIC, and per-CPU RAM

2024-02-06 Thread Peter Maydell
Create the CPUs, the GIC, and the per-CPU RAM block for the mps3-an536 board. Signed-off-by: Peter Maydell --- Some parts of this might need to end up parameterisable if/when we add another machine type to this source file, but rather than trying to guess which parts, I stuck with the simple code

[PATCH 06/13] hw/misc/mps2-scc: Factor out which-board conditionals

2024-02-06 Thread Peter Maydell
The MPS SCC device has a lot of different flavours for the various different MPS FPGA images, which look mostly similar but have differences in how particular registers are handled. Currently we deal with this with a lot of open-coded checks on scc_partno(), but as we add more board types this is

[PATCH 12/13] hw/arm/mps3r: Add remaining devices

2024-02-06 Thread Peter Maydell
Add the remaining devices (or unimplemented-device stubs) for this board: SPI controllers, SCC, FPGAIO, I2S, RTC, the QSPI write-config block, and ethernet. Signed-off-by: Peter Maydell --- hw/arm/mps3r.c | 74 ++ 1 file changed, 74 insertions(+)

[PATCH 01/13] target/arm: Use new CBAR encoding for all v8 CPUs, not all aarch64 CPUs

2024-02-06 Thread Peter Maydell
We support two different encodings for the AArch32 IMPDEF CBAR register -- older cores like the Cortex A9, A7, A15 have this at 4, c15, c0, 0; newer cores like the Cortex A35, A53, A57 and A72 have it at 1 c15 c0 0. When we implemented this we picked which encoding to use based on whether the CPU

[PATCH 11/13] hw/arm/mps3r: Add GPIO, watchdog, dual-timer, I2C devices

2024-02-06 Thread Peter Maydell
Add the GPIO, watchdog, dual-timer and I2C devices to the mps3-an536 board. These are all simple devices that just need to be created and wired up. Signed-off-by: Peter Maydell --- hw/arm/mps3r.c | 59 ++ 1 file changed, 59 insertions(+) diff --g

[PATCH 10/13] hw/arm/mps3r: Add UARTs

2024-02-06 Thread Peter Maydell
This board has a lot of UARTs: there is one UART per CPU in the per-CPU peripheral part of the address map, whose interrupts are connected as per-CPU interrupt lines. Then there are 4 UARTs in the normal part of the peripheral space, whose interrupts are shared peripheral interrupts. Connect and

[PATCH 00/13] hw/arm: Implement new machine mps3-an536 (Cortex-R52 MPS3 AN536 FPGA image)

2024-02-06 Thread Peter Maydell
This patchset implements a new machine type, mps3-an536. This is similar to our existing mps2-* and mps3-* machine types in that it is a model of an FPGA image for the Arm MPS3 development board. It differs from our current machine types in being based around an R-profile CPU, the Cortex-R52, rat

Re: [PATCH V2] loongarch: Change the UEFI loading mode to loongarch

2024-02-06 Thread Andrea Bolognani
On Tue, Feb 06, 2024 at 10:10:02AM +0800, Xianglai Li wrote: > The UEFI loading mode in loongarch is very different > from that in other architectures:loongarch's UEFI code > is in rom, while other architectures' UEFI code is in flash. > > loongarch UEFI can be loaded as follows: > -machine virt,pf

Re: [PATCH] hw/arm/xilinx_zynq: Wire FIQ between CPU <> GIC

2024-02-06 Thread Peter Maydell
On Tue, 30 Jan 2024 at 15:25, Philippe Mathieu-Daudé wrote: > > Similarly to commits dadbb58f59..5ae79fe825 for other ARM boards, > connect FIQ output of the GIC CPU interfaces to the CPU. > > Signed-off-by: Philippe Mathieu-Daudé > --- > hw/arm/xilinx_zynq.c | 2 ++ > 1 file changed, 2 insertio

Re: [PATCH] docs/style: allow C99 mixed declarations

2024-02-06 Thread Stefan Hajnoczi
On Mon, 5 Feb 2024 at 12:19, Stefan Hajnoczi wrote: > > C99 mixed declarations support interleaving of local variable > declarations and code. > > The coding style "generally" forbids C99 mixed declarations with some > exceptions to the rule. This rule is not checked by checkpatch.pl and > natural

[PATCH v3 0/5] Generate x86 cpu features

2024-02-06 Thread Tim Wiederhake
Synchronizing the list of cpu features and models with qemu is a recurring task in libvirt. For x86, this is done by reading qom-list-properties for max-x86_64-cpu and manually filtering out everthing that does not look like a feature name, as well as parsing target/i386/cpu.c for cpu models. This

[PATCH v3 3/5] target/i386: Remove comments from feature_word_info.c.inc

2024-02-06 Thread Tim Wiederhake
The comments are preserved in the yaml file. Signed-off-by: Tim Wiederhake --- target/i386/feature_word_info.c.inc | 56 - 1 file changed, 15 insertions(+), 41 deletions(-) diff --git a/target/i386/feature_word_info.c.inc b/target/i386/feature_word_info.c.inc index

[PATCH v3 5/5] target/i386: Generate feature_word_info.c.inc

2024-02-06 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake --- target/i386/feature_word_info.c.inc | 30 ++-- target/i386/feature_word_info.py| 71 + target/i386/feature_word_info.yaml | 2 + 3 files changed, 99 insertions(+), 4 deletions(-) create mode 100755 target/i386/feature_wo

[PATCH v3 2/5] target/i386: Translate feature_word_info to yaml

2024-02-06 Thread Tim Wiederhake
This is the data file that will be used to generate the C code. All information, including the comments, is preserved. Signed-off-by: Tim Wiederhake --- target/i386/feature_word_info.yaml | 699 + 1 file changed, 699 insertions(+) create mode 100644 target/i386/featu

[PATCH v3 4/5] target/i386: Fix feature_word_info.c.inc formatting

2024-02-06 Thread Tim Wiederhake
Make the formatting of the file more regular. This reduces the diff to the generated version. Signed-off-by: Tim Wiederhake --- target/i386/feature_word_info.c.inc | 136 ++-- 1 file changed, 86 insertions(+), 50 deletions(-) diff --git a/target/i386/feature_word_info.c.

[PATCH v3 1/5] target/i386: Split out feature_word_info

2024-02-06 Thread Tim Wiederhake
The isolated part will be generated by a script. Signed-off-by: Tim Wiederhake --- target/i386/cpu.c | 679 +--- target/i386/feature_word_info.c.inc | 678 +++ 2 files changed, 679 insertions(+), 678 deletions(-) create mode 1006

[RFC] hw/i386/multiboot2: add multiboot2 support

2024-02-06 Thread Jens Nyberg
This is the first very rough version of what is supposed to be support for multiboot2. This is a continuation of work that was started years ago but never saw fruition for reasons unknown. This is submitted as an RFC only for now. It would be nice if someone would be willing to guide me into furth

[PATCH] build-sys: add the D-Bus generated header to the dependency

2024-02-06 Thread marcandre . lureau
From: Marc-André Lureau Fixes: rm -rf b; cd b ../configure --enable-modules --target-list=x86_64-softmmu ninja qemu-system-x86_64 In file included from ../ui/dbus-chardev.c:34: ../ui/dbus.h:34:10: fatal error: ui/dbus-display1.h: No such file or directory 34 | #include "ui/dbus-

[PATCH] virtio-blk: do not use C99 mixed declarations

2024-02-06 Thread Stefan Hajnoczi
QEMU's coding style generally forbids C99 mixed declarations. Signed-off-by: Stefan Hajnoczi --- hw/block/virtio-blk.c | 25 ++--- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c index 227d83569f..f6009cd9b3 100644

Re: [RFC PATCH 1/4] confidential guest support: Add kvm_init() and kvm_reset() in class

2024-02-06 Thread Daniel P . Berrangé
On Tue, Feb 06, 2024 at 03:28:49AM -0500, Xiaoyao Li wrote: > Different confidential VMs in different architectures all have the same > needs to do their specific initialization (and maybe resetting) stuffs > with KVM. Currently each of them exposes individual *_kvm_init() > functions and let machi

Re: [RFC PATCH 2/4] i386/sev: Switch to use confidential_guest_kvm_init()

2024-02-06 Thread Daniel P . Berrangé
On Tue, Feb 06, 2024 at 03:28:50AM -0500, Xiaoyao Li wrote: > Use confidential_guest_kvm_init() instead of calling SEV specific > sev_kvm_init(). As a bouns, it fits to future TDX when TDX implements > its own confidential_guest_support and .kvm_init(). > > Move the "TypeInfo sev_guest_info" defin

Re: [RFC PATCH 0/4] Confidential Guest Support: Introduce kvm_init() and kvm_reset() virtual functions

2024-02-06 Thread Daniel P . Berrangé
On Tue, Feb 06, 2024 at 03:28:48AM -0500, Xiaoyao Li wrote: > This series is inspired and suggested by Daniel: > https://lore.kernel.org/qemu-devel/zbfoqseuv6_zw...@redhat.com/ > > Currently, different confidential VMs in different architectures have > their own specific *_kvm_init() (and some hav

Re: [PATCH v2 1/6] linux-user/aarch64: Extend PR_SET_TAGGED_ADDR_CTRL for FEAT_MTE3

2024-02-06 Thread Peter Maydell
On Tue, 6 Feb 2024 at 03:06, Richard Henderson wrote: > > When MTE3 is supported, the kernel maps > PR_MTE_TCF_ASYNC | PR_MTE_TCF_SYNC > to > MTE_CTRL_TCF_ASYMM > and from there to > SCTLR_EL1.TCF0 = 3 This depends on the setting of /sys/devices/system/cpu/cpu/mte_tcf_preferred : I think yo

Re: [PATCH v2 5/6] migration/multifd: Unify multifd and TLS connection paths

2024-02-06 Thread Fabiano Rosas
Avihai Horon writes: > On 05/02/2024 21:49, Fabiano Rosas wrote: >> External email: Use caution opening links or attachments >> >> >> During multifd channel creation (multifd_send_new_channel_async) when >> TLS is enabled, the multifd_channel_connect function is called twice, >> once to create th

Re: [PATCH v2 5/6] migration/multifd: Unify multifd and TLS connection paths

2024-02-06 Thread Avihai Horon
On 06/02/2024 16:30, Fabiano Rosas wrote: External email: Use caution opening links or attachments Avihai Horon writes: On 05/02/2024 21:49, Fabiano Rosas wrote: External email: Use caution opening links or attachments During multifd channel creation (multifd_send_new_channel_async) whe

Re: [PATCH v2 2/6] target/arm: Fix nregs computation in do_ld_zpa

2024-02-06 Thread Peter Maydell
On Tue, 6 Feb 2024 at 03:06, Richard Henderson wrote: > > The field is encoded as [0-3], which is convenient for > indexing our array of function pointers, but the true > value is [1-4]. Adjust before calling do_mem_zpa. > > Add an assert, and move the comment re passing ZT to > the helper back n

Re: [PATCH v2 3/6] target/arm: Adjust and validate mtedesc sizem1

2024-02-06 Thread Peter Maydell
On Tue, 6 Feb 2024 at 03:07, Richard Henderson wrote: > > When we added SVE_MTEDESC_SHIFT, we effectively limited the > maximum size of MTEDESC. Adjust SIZEM1 to consume the remaining > bits (32 - 10 - 5 - 12 == 5). Assert that the data to be stored > fits within the field (expecting 8 * 4 - 1 =

Re: [PATCH v2 4/6] target/arm: Split out make_svemte_desc

2024-02-06 Thread Peter Maydell
On Tue, 6 Feb 2024 at 03:06, Richard Henderson wrote: > > Share code that creates mtedesc and embeds within simd_desc. > > Signed-off-by: Richard Henderson > --- > target/arm/tcg/translate-a64.h | 2 ++ > target/arm/tcg/translate-sme.c | 15 +++ > target/arm/tcg/translate-sve.c | 47 +++

Re: [PATCH v2 5/6] target/arm: Handle mte in do_ldrq, do_ldro

2024-02-06 Thread Peter Maydell
On Tue, 6 Feb 2024 at 03:06, Richard Henderson wrote: > > These functions "use the standard load helpers", but > fail to clean_data_tbi or populate mtedesc. > > Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell thanks -- PMM

Re: [PATCH v2 6/6] target/arm: Fix SVE/SME gross MTE suppression checks

2024-02-06 Thread Peter Maydell
On Tue, 6 Feb 2024 at 03:06, Richard Henderson wrote: > > The TBI and TCMA bits are located within mtedesc, not desc. > > Signed-off-by: Richard Henderson > --- Reviewed-by: Peter Maydell thanks -- PMM

Re: [PATCH v2 0/6] target/arm: assorted mte fixes

2024-02-06 Thread Peter Maydell
On Tue, 6 Feb 2024 at 03:07, Richard Henderson wrote: > > The first patch is unchanged from > > Supercedes: <20240131003557.176486-1-richard.hender...@linaro.org> > > while the remaining patches replace > > Supercedes: <20240205023948.25476-1-richard.hender...@linaro.org> > > While digging through

Re: Re: [PATCH] vdpa-dev: Fix initialisation order to restore VDUSE compatibility

2024-02-06 Thread Stefano Garzarella
On Tue, Feb 6, 2024 at 9:31 AM Stefano Garzarella wrote: > > On Tue, Feb 06, 2024 at 10:47:40AM +0800, Jason Wang wrote: > >On Mon, Feb 5, 2024 at 6:51 PM Stefano Garzarella > >wrote: > >> > >> On Fri, Feb 02, 2024 at 02:25:21PM +0100, Kevin Wolf wrote: > >> >VDUSE requires that virtqueues are f

Re: [PATCH 1/5] virtio-blk: enforce iothread-vq-mapping validation

2024-02-06 Thread Hanna Czenczek
On 05.02.24 18:26, Stefan Hajnoczi wrote: Hanna Czenczek noticed that the safety of `vq_aio_context[vq->value] = ctx;` with user-defined vq->value inputs is not obvious. The code is structured in validate() + apply() steps so input validation is there, but it happens way earlier and there is no

  1   2   3   >