Re: [PATCH v5 1/9] target/riscv: fix henvcfg potentially containing stale bits

2024-11-27 Thread Clément Léger
On 28/11/2024 02:37, Alistair Francis wrote: > On Thu, Nov 21, 2024 at 6:28 PM Clément Léger wrote: >> >> >> >> On 20/11/2024 06:02, Alistair Francis wrote: >>> On Tue, Nov 19, 2024 at 9:27 PM Clément Léger wrote: On 19/11/2024 05:16, Alistair Francis wrote: > On Thu, N

[PATCH v2] riscv/gdb: add virt mode debug interface

2024-11-27 Thread Yanfeng Liu
This adds `virt` virtual register on debug interface so that users can access current virtualization mode for debugging purposes. Signed-off-by: Yanfeng Liu --- gdb-xml/riscv-32bit-virtual.xml | 1 + gdb-xml/riscv-64bit-virtual.xml | 1 + target/riscv/gdbstub.c | 18 --

Re: [PATCH] include virtualization mode as part of priv

2024-11-27 Thread Yanfeng
On Thu, 2024-11-28 at 14:46 +1000, Alistair Francis wrote: > On Thu, Nov 28, 2024 at 2:27 PM Yanfeng wrote: > > > > On Thu, 2024-11-28 at 14:10 +1000, Alistair Francis wrote: > > > On Thu, Nov 28, 2024 at 2:05 PM Yanfeng wrote: > > > > > > > > Alistair. > > > > > > > > My initial `git send-ema

Re: [PATCH] tests/functional: Fix the running test case causes loongarch64 to hang

2024-11-27 Thread Thomas Huth
On 28/11/2024 02.35, bibo mao wrote: Hi Thomas and Philippe, Could you do me a favor to merge this bugfix? Gao Song is offline and cannot work on computer. I have no merge permission and I am applying maintainer permission. Sure, I've put it in my current pull request! Regards, Thomas

Re: [RFC PATCH 0/5] support unaligned access to xHCI Capability

2024-11-27 Thread Tomoyuki HIROSE
Hi, thank you for your comment. On 2024/11/27 20:23, Peter Maydell wrote: On Wed, 27 Nov 2024 at 04:34, Tomoyuki HIROSE wrote: I would be happy to receive your comments. ping. Hi; this one is on my to-review list (along, sadly, with 23 other series); I had a quick look a while back and it see

Re: [PATCH-for-10.0] system/qtest: Access memory using cpu_physical_memory_rw() API

2024-11-27 Thread Philippe Mathieu-Daudé
On 27/11/24 23:35, Richard Henderson wrote: On 11/27/24 13:19, Philippe Mathieu-Daudé wrote: There is no vCPU within the QTest accelerator (well, they are stubs doing nothing, see dummy_cpu_thread_fn). Directly use the cpu_physical_memory_rw() API -- which amusingly prefixed 'cpu_' does not use

RE: [PATCH v3 0/3] Introduce a new Write Protected pin inverted property

2024-11-27 Thread Jamin Lin
Hi Philippe, > Subject: Re: [PATCH v3 0/3] Introduce a new Write Protected pin inverted > property > > On 27/11/24 10:44, Cédric Le Goater wrote: > > On 11/14/24 10:48, Jamin Lin wrote: > >> change from v1: > >> 1. Support RTC for AST2700. > >> 2. Support SDHCI write protected pin inverted for AS

Re: [PATCH] include virtualization mode as part of priv

2024-11-27 Thread Alistair Francis
On Thu, Nov 28, 2024 at 2:27 PM Yanfeng wrote: > > On Thu, 2024-11-28 at 14:10 +1000, Alistair Francis wrote: > > On Thu, Nov 28, 2024 at 2:05 PM Yanfeng wrote: > > > > > > Alistair. > > > > > > My initial `git send-email" on Ubuntu 22.04 wasn't lukcy: > > > > > > ```shell > > > $ git send-email

Re: [RFC PATCH 2/5] hw/arm/smmuv3: Add initial support for SMMUv3 Nested device

2024-11-27 Thread Nicolin Chen
On Wed, Nov 27, 2024 at 11:29:06PM -0500, Donald Dutile wrote: > On 11/27/24 5:21 AM, Shameerali Kolothum Thodi wrote: > > > > W.r.t naming, maybe something related to "hardware-accelerated"? > > > > > > > Given that 'accel' has been used for hw-acceleration elsewhere, that seems > > > like a reas

Re: [RFC PATCH 2/5] hw/arm/smmuv3: Add initial support for SMMUv3 Nested device

2024-11-27 Thread Donald Dutile
On 11/27/24 5:21 AM, Shameerali Kolothum Thodi wrote: -Original Message- From: Donald Dutile Sent: Tuesday, November 26, 2024 6:29 PM To: Nicolin Chen ; Eric Auger Cc: Shameerali Kolothum Thodi ; qemu-...@nongnu.org; qemu-devel@nongnu.org; peter.mayd...@linaro.org; j...@nvidia.com

Re: [PATCH] include virtualization mode as part of priv

2024-11-27 Thread Yanfeng
On Thu, 2024-11-28 at 14:10 +1000, Alistair Francis wrote: > On Thu, Nov 28, 2024 at 2:05 PM Yanfeng wrote: > > > > Alistair. > > > > My initial `git send-email" on Ubuntu 22.04 wasn't lukcy: > > > > ```shell > > $ git send-email > > git: 'send-email' is not a git command. See 'git --help'. > >

Re: [PATCH] include virtualization mode as part of priv

2024-11-27 Thread Yanfeng
Alistair. My initial `git send-email" on Ubuntu 22.04 wasn't lukcy: ```shell $ git send-email git: 'send-email' is not a git command. See 'git --help'. ``` I need time to find a solution. As for seperate `virt` thing, my concern is that though the V and P status looks orthogonal, they are not

Re: [PATCH] include virtualization mode as part of priv

2024-11-27 Thread Alistair Francis
On Thu, Nov 28, 2024 at 2:05 PM Yanfeng wrote: > > Alistair. > > My initial `git send-email" on Ubuntu 22.04 wasn't lukcy: > > ```shell > $ git send-email > git: 'send-email' is not a git command. See 'git --help'. > ``` > > I need time to find a solution. You will need to install git-send-email

Re: [RFC PATCH 2/5] hw/arm/smmuv3: Add initial support for SMMUv3 Nested device

2024-11-27 Thread Zhangfei Gao
Hi, Eric On Thu, 28 Nov 2024 at 00:06, Eric Auger wrote: > > Yeah, there is no live migration support yet in the SMMU qmeu driver, > > AFAIK? > the non accelerated SMMU QEMU device does support migration. Could you clarify more about this? The migration is not supported if using viommu (SMMU QE

Re: [PATCH v4 00/15] vfio: VFIO migration support with vIOMMU

2024-11-27 Thread Zhangfei Gao
Hi, Joao On Fri, Jun 23, 2023 at 5:51 AM Joao Martins wrote: > > Hey, > > This series introduces support for vIOMMU with VFIO device migration, > particurlarly related to how we do the dirty page tracking. > > Today vIOMMUs serve two purposes: 1) enable interrupt remaping 2) > provide dma transla

Re: [PATCH v2 2/3] docs/devel/style: add a section about bitfield, and disallow them for packed structures

2024-11-27 Thread Richard Henderson
On 11/27/24 19:01, Pierrick Bouvier wrote: On 11/27/24 09:46, Richard Henderson wrote: On 11/26/24 18:15, Pierrick Bouvier wrote: Except for saving memory in *very* specific case (a structure allocated tens of millions times for example), I hardly see a benefit vs using integer types. Even t

Re: [PATCH] include virtualization mode as part of priv

2024-11-27 Thread Alistair Francis
On Thu, Nov 28, 2024 at 11:43 AM Yanfeng wrote: > > On Thu, 2024-11-28 at 10:39 +1000, Alistair Francis wrote: > > On Thu, Nov 28, 2024 at 12:09 AM Yanfeng wrote: > > > > > > > > > When debugging hypervisor extension based programs, it is convenient to > > > see > > > the > > > current virtualiz

[PATCH 1/5] hw/intc/loongson_ipi: Add more output parameter for cpu_by_arch_id

2024-11-27 Thread Bibo Mao
Add logic cpu index output parameter for function cpu_by_arch_id, CPUState::cpu_index is logic cpu slot index for possible_cpus. However it is logic cpu index with LoongsonIPICommonState::IPICore, here hide access for CPUState::cpu_index directly, it comes from function cpu_by_arch_id(). Signed-of

[PATCH 5/5] hw/intc/loongarch_ipi: Optimize function cpu_by_arch_id

2024-11-27 Thread Bibo Mao
There is cpu mapping from physical cpu id inside, cpu_by_arch_id can be optimized from cpu mapping table. Signed-off-by: Bibo Mao --- hw/intc/loongarch_ipi.c | 47 ++--- 1 file changed, 11 insertions(+), 36 deletions(-) diff --git a/hw/intc/loongarch_ipi.c b/

[PATCH 4/5] hw/intc/loongarch_ipi: Implment cpu hotplug interface

2024-11-27 Thread Bibo Mao
Add logic cpu allocation and cpu mapping with cpu hotplug interface. When cpu is added, connect ipi gpio irq to CPU IRQ_IPI irq pin. Also use hotplug_handler_plug() to nofity ipi object when cold-plug is created. Signed-off-by: Bibo Mao --- hw/intc/loongarch_ipi.c | 46 +

[PATCH 2/5] hw/intc/loongarch_ipi: Add basic hotplug framework

2024-11-27 Thread Bibo Mao
LoongArch ipi can send interrupt to multiple CPUs, interrupt routing to CPU comes from destination physical cpu id. Here hotplug interface is added for IPI object, sot that logic cpu mapping from physical cpu id can be setup. Here only basic hotplug framework is added, it is stub function. Signed

[PATCH 0/5] hw/intc/loongarch_ipi: Enhance multiple CPU irq routing

2024-11-27 Thread Bibo Mao
LoongArch IPI can send intterrupt to multiple CPUs, physical cpu id is used to route interrupt for CPUs. With cpu hotplug feature in future, logic cpu index depends on CPUState::cpu_index heavily. Here add cpu hotplug notification interface in IPI driver, cpu mapping logic is created inside. CPUSt

[PATCH 3/5] hw/intc/loongarch_ipi: Add cpu map table from physical cpu id

2024-11-27 Thread Bibo Mao
Bitmap table present_cpu_map is added, it is to allocate logical cpu when CPU object is created. Also present_cpu array is added to get logical cpu from physical cpu id. Signed-off-by: Bibo Mao --- hw/intc/loongarch_ipi.c | 24 include/hw/intc/loongarch_ipi.h |

Re: [PATCH] include virtualization mode as part of priv

2024-11-27 Thread Yanfeng
On Thu, 2024-11-28 at 10:39 +1000, Alistair Francis wrote: > On Thu, Nov 28, 2024 at 12:09 AM Yanfeng wrote: > > > > > > When debugging hypervisor extension based programs, it is convenient to see > > the > > current virtualization mode from GDB debugger. > > > > This patch shares the virtualiz

Re: [PATCH v5 1/9] target/riscv: fix henvcfg potentially containing stale bits

2024-11-27 Thread Alistair Francis
On Thu, Nov 21, 2024 at 6:28 PM Clément Léger wrote: > > > > On 20/11/2024 06:02, Alistair Francis wrote: > > On Tue, Nov 19, 2024 at 9:27 PM Clément Léger wrote: > >> > >> > >> > >> On 19/11/2024 05:16, Alistair Francis wrote: > >>> On Thu, Nov 14, 2024 at 7:14 PM Clément Léger wrote: > >

Re: [PATCH] tests/functional: Fix the running test case causes loongarch64 to hang

2024-11-27 Thread bibo mao
Hi Thomas and Philippe, Could you do me a favor to merge this bugfix? Gao Song is offline and cannot work on computer. I have no merge permission and I am applying maintainer permission. Regards Bibo Mao On 2024/11/27 上午9:34, Xianglai Li wrote: There is a bug in the process of resolving the

Re: Request for Technical Guidance on Custom RISC-V64 Architecture with Linux OS

2024-11-27 Thread Alistair Francis
On Mon, Nov 25, 2024 at 10:38 PM Mohammad Javad Sekonji wrote: > > Dear QEMU developer team > > I hope this email finds you well. My name is Mohammad Javad Sekonji, and I am > a master’s student specializing in electronic digital systems. I am currently > working on a project involving the insta

Re: [PATCH v5] hw/riscv: Add Microblaze V generic board

2024-11-27 Thread Alistair Francis
On Mon, Nov 25, 2024 at 11:47 PM Sai Pavan Boddu wrote: > > Add a basic board with interrupt controller (intc), timer, serial > (uartlite), small memory called LMB@0 (128kB) and DDR@0x8000 > (configured via command line eg. -m 2g). > This is basic configuration which matches HW generated out o

Re: [PATCH v2 2/3] docs/devel/style: add a section about bitfield, and disallow them for packed structures

2024-11-27 Thread Pierrick Bouvier
On 11/27/24 09:46, Richard Henderson wrote: On 11/26/24 18:15, Pierrick Bouvier wrote: Except for saving memory in *very* specific case (a structure allocated tens of millions times for example), I hardly see a benefit vs using integer types. Even then, 'uint32_t flags' can be just as easy to

Re: [PATCH v2 2/3] docs/devel/style: add a section about bitfield, and disallow them for packed structures

2024-11-27 Thread Pierrick Bouvier
On 11/26/24 22:38, Thomas Huth wrote: On 26/11/2024 22.17, Pierrick Bouvier wrote: Signed-off-by: Pierrick Bouvier --- docs/devel/style.rst | 10 ++ 1 file changed, 10 insertions(+) diff --git a/docs/devel/style.rst b/docs/devel/style.rst index 2f68b500798..13cb1ef626b 100644 ---

Re: [PATCH v5] hw/riscv: Add Microblaze V generic board

2024-11-27 Thread Alistair Francis
On Mon, Nov 25, 2024 at 11:47 PM Sai Pavan Boddu wrote: > > Add a basic board with interrupt controller (intc), timer, serial > (uartlite), small memory called LMB@0 (128kB) and DDR@0x8000 > (configured via command line eg. -m 2g). > This is basic configuration which matches HW generated out o

Re: [PATCH v2 1/3] win32: remove usage of attribute gcc_struct

2024-11-27 Thread Pierrick Bouvier
On 11/27/24 01:20, Stefano Garzarella wrote: On Tue, Nov 26, 2024 at 01:17:34PM -0800, Pierrick Bouvier wrote: This attribute is not recognized by clang. An investigation has been performed to ensure this attribute has no effect on layout of structures we use in QEMU [1], so it's safe to remove

Re: [PATCH v2 0/7] Pointer Masking update for Zjpm v1.0

2024-11-27 Thread Alistair Francis
On Wed, Nov 27, 2024 at 3:38 PM Alexey Baturo wrote: > > Hi Daniel, > > Thanks for the suggestion. I've resubmitted it with the v11 tag and put some > reviewed-bys. Thanks! It's a lot of time and effort to review code, so it's helpful to keep existing tags. Note that it's fine (and you should) t

Re: [PATCH v13 1/2] generic-loader: Add a generic loader

2024-11-27 Thread Alistair Francis
On Thu, Nov 28, 2024 at 2:09 AM Philippe Mathieu-Daudé wrote: > > Hi, > > [very old patch merged as commit e481a1f63c93] > > On 30/9/16 02:25, Alistair Francis wrote: > > Add a generic loader to QEMU which can be used to load images or set > > memory values. > > > > Internally inside QEMU this is

Re: [PATCH] include virtualization mode as part of priv

2024-11-27 Thread Alistair Francis
On Thu, Nov 28, 2024 at 12:09 AM Yanfeng wrote: > > > When debugging hypervisor extension based programs, it is convenient to see > the > current virtualization mode from GDB debugger. > > This patch shares the virtualization mode as part of the existing "priv" > virtual > register, or more spec

Re: [RFC PATCH 2/5] hw/arm/smmuv3: Add initial support for SMMUv3 Nested device

2024-11-27 Thread Donald Dutile
On 11/27/24 11:00 AM, Jason Gunthorpe wrote: On Wed, Nov 27, 2024 at 10:21:24AM +, Shameerali Kolothum Thodi wrote: For SMMUv3, NVIDIA-specific vCMDQ, it needs a parameter to state that specifically, since I'm concluding from reading the SMMUv3 version G.a spec, that ECMDQ was added to be

Re: [PATCH-for-10.0] system/qtest: Access memory using cpu_physical_memory_rw() API

2024-11-27 Thread Richard Henderson
On 11/27/24 13:19, Philippe Mathieu-Daudé wrote: There is no vCPU within the QTest accelerator (well, they are stubs doing nothing, see dummy_cpu_thread_fn). Directly use the cpu_physical_memory_rw() API -- which amusingly prefixed 'cpu_' does not use vCPU -- to access memory. This reduces access

Re: [PATCH v3 08/24] migration: Add thread pool of optional load threads

2024-11-27 Thread Maciej S. Szmigiero
On 27.11.2024 10:13, Cédric Le Goater wrote: On 11/17/24 20:20, Maciej S. Szmigiero wrote: From: "Maciej S. Szmigiero" Some drivers might want to make use of auxiliary helper threads during VM state loading, for example to make sure that their blocking (sync) I/O operations don't block the res

Re: [PATCH] tests/qtest: add TIMEOUT_MULTIPLIER

2024-11-27 Thread Philippe Mathieu-Daudé
On 27/11/24 19:44, Pierrick Bouvier wrote: On 11/26/24 23:40, Дмитрий Фролов wrote: Hello, Daniel On 26.11.2024 21:32, Daniel P. Berrangé wrote: On Wed, Nov 13, 2024 at 12:43:40PM +0300, Dmitry Frolov wrote: Some tests need more time when qemu is built with "--enable-asan --enable-ubsan" As

[PATCH-for-10.0] system/qtest: Access memory using cpu_physical_memory_rw() API

2024-11-27 Thread Philippe Mathieu-Daudé
There is no vCPU within the QTest accelerator (well, they are stubs doing nothing, see dummy_cpu_thread_fn). Directly use the cpu_physical_memory_rw() API -- which amusingly prefixed 'cpu_' does not use vCPU -- to access memory. This reduces accesses to the global 'first_cpu'. Signed-off-by: Phili

[PATCH v3 03/17] tests/migration: Disambiguate guestperf vs. a-b

2024-11-27 Thread Fabiano Rosas
The current build structure for migration tests is confusing. There is the tests/migration directory, which contains two different guest code implementations, one for the qtests (a-b-{bootblock|kernel}.S) and another for the guestperf script (stress.c). One uses a Makefile, while the other uses mes

Re: [PATCH] plugins: optimize cpu_index code generation

2024-11-27 Thread Pierrick Bouvier
On 11/27/24 10:27, Richard Henderson wrote: On 11/27/24 11:57, Pierrick Bouvier wrote: I noticed that it was redundant (for user-mode at least), but it seemed too implicit to rely on this. As well, I didn't observe such a flush in system-mode, does it work the same as user-mode (regarding the

Re: [PATCH] tests/qtest: add TIMEOUT_MULTIPLIER

2024-11-27 Thread Pierrick Bouvier
On 11/26/24 23:40, Дмитрий Фролов wrote: Hello, Daniel On 26.11.2024 21:32, Daniel P. Berrangé wrote: On Wed, Nov 13, 2024 at 12:43:40PM +0300, Dmitry Frolov wrote: Some tests need more time when qemu is built with "--enable-asan --enable-ubsan" As was discussed here: https://patchew.org/QEMU

[PATCH v3 05/17] tests/qtest/migration: Move qmp helpers to a separate file

2024-11-27 Thread Fabiano Rosas
We current have a bunch of non-test functions in migration-test.c and some others in migration-helpers.c. In order to split migration-test.c into separate test binaries, these helpers need to go somewhere else. To avoid making migration-helpers even larger, move all QMP-related functions into a ne

[PATCH v3 10/17] tests/qtest/migration: Move common test code

2024-11-27 Thread Fabiano Rosas
The migration tests have a set of core infrastructure routines. These are functions that are called by (almost) all tests and centralize the common operations of: starting migration on both sides, waiting for guests to boot, performing guest initialization and teardown, guest memory validation, etc

[PATCH v3 02/17] tests/qtest/migration: Stop calling everything "test"

2024-11-27 Thread Fabiano Rosas
Test frameworks usually prefix "test_" to the entry point of the test code. Having every function prefixed with test_ makes it hard to understand the code and to grep for the actual tests. Remove the "test" prefix from everything that is not a test. In order to still keep some namespacing, stick

[PATCH v3 01/17] tests/qtest/migration: Standardize hook names

2024-11-27 Thread Fabiano Rosas
Standardize the hook names: - change the names to .start|end_hook to match test_migrate_start|end() - use the migrate_hook_start_ and migrate_hook_end_ prefixes Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas --- tests/qtest/migration-test.c | 342 ++- 1 f

Re: [PULL 15/42] tests/functional: enable pre-emptive caching of assets

2024-11-27 Thread Pierrick Bouvier
On 11/27/24 01:06, Daniel P. Berrangé wrote: On Tue, Nov 26, 2024 at 04:54:18PM -0600, Richard Henderson wrote: On 11/26/24 11:52, Thomas Huth wrote: I think we want to continue to maek failing downloads as test failures, otherwise we'll never notice when an asset is not available from the inte

[PATCH v3 08/17] tests/qtest/migration: Move kvm_dirty_ring_supported to utils

2024-11-27 Thread Fabiano Rosas
Move kvm_dirty_ring_supported() to migration-util.c. Similarly to ufd_version_check(), this function is used during test definition so put it in the utils file. Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas --- tests/qtest/migration-test.c | 29 -- tests/q

[PATCH v3 12/17] tests/qtest/migration: Split compression tests from migration-test.c

2024-11-27 Thread Fabiano Rosas
Continuing the split of groups of tests from migration-test.c, split the compression tests into their own file. Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas --- tests/qtest/meson.build | 1 + tests/qtest/migration-test.c | 161 +-- tests/qtest/

[PATCH v3 17/17] tests/qtest/migration: Split validation tests + misc

2024-11-27 Thread Fabiano Rosas
Move the remaining tests into a misc-tests.c file. These tests are mostly about validation of input and should be in the future replaced by unit testing. Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas --- tests/qtest/meson.build| 1 + tests/qtest/migration-test.c | 278 +

[PATCH v3 16/17] tests/qtest/migration: Split CPR tests

2024-11-27 Thread Fabiano Rosas
Move the mode/reboot test into a separate file to hold all the CPR tests. Currently there's just one test, but we're adding more CPR modes and the feature is different enough from live migration that it's worth it to have a separate file for it. Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas

[PATCH v3 07/17] tests/qtest/migration: Move ufd_version_check to utils

2024-11-27 Thread Fabiano Rosas
Move ufd_version_check() to migration-util.c file. This is a helper function that is used during tests definition so it should be available outside of migration-test.c Since the function is moving to another file, change it to stop accessing the global uffd_feature_thread_id and take it as argumen

[PATCH v3 00/17] tests/qtest: migration-test refactoring

2024-11-27 Thread Fabiano Rosas
v3: - Fixed some more hook names I had missed; - Move addition of migration-qmp.c in meson to correct patch; - Moved QEMU_ENV_* variables to framework.c where they are used; - patch 7: improve commit message; - s/test-framework/framework/ - meson.build style changes; - d

[PATCH v3 06/17] tests/qtest/migration: Rename migration-helpers.c

2024-11-27 Thread Fabiano Rosas
Rename migration-helpers.c to migration-util.c to make its purpose more explicit and avoid the "helper" terminology. Move the file to the qtest/migration/ directory along with the rest of the migration files. Signed-off-by: Fabiano Rosas --- tests/qtest/meson.build

[PATCH v3 14/17] tests/qtest/migration: Split file tests

2024-11-27 Thread Fabiano Rosas
Split the file tests from migration-test.c. These are being moved to their own file due to being special enough compared with the regular stream migration. There is also the entire mapped-ram feature which depends on file migration. Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas --- tests/q

[PATCH v3 11/17] tests/qtest/migration: Split TLS tests from migration-test.c

2024-11-27 Thread Fabiano Rosas
The migration-test.c file has become unwieldy large. It's quite confusing to navigate with all the test definitions mixed with hook definitions. The TLS tests make this worse with ifdef'ery. Since we're planning on having a smaller set of tests to run as smoke testing on all architectures, I'm tak

[PATCH v3 04/17] tests/qtest/migration: Move bootfile code to its own file

2024-11-27 Thread Fabiano Rosas
Move the code that creates the guest binary out of migration-test and into the qtest/migration/ directory, along with the rest of the a-b-kernel code. That code is part of the basic infrastructure of migration tests, it shouldn't be among the tests themselves. Also take the chance and rename migr

[PATCH v3 13/17] tests/qtest/migration: Split postcopy tests

2024-11-27 Thread Fabiano Rosas
Split the next group of tests from migration-test.c, the postcopy tests. This is another well-defined group of tests and postcopy is a unique enough feature that it deserves it's own file. Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas --- tests/qtest/meson.build| 1 + tes

[PATCH v3 09/17] tests/qtest/migration: Isolate test initialization

2024-11-27 Thread Fabiano Rosas
We currently have some environment validation to perform and flags to set during the initialization of the tests. To be able to add more migration test binaries, we'll need these tasks to be in their own function so they can be called from more than one place. Move the initialization code to a fun

[PATCH v3 15/17] tests/qtest/migration: Split precopy tests

2024-11-27 Thread Fabiano Rosas
Split the precopy tests from migration-test.c. This is the largest group of tests and the more difficult one to break into smaller groups, so move all of it. Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas --- tests/qtest/meson.build |1 + tests/qtest/migration-test.c

Re: [PATCH] plugins: optimize cpu_index code generation

2024-11-27 Thread Richard Henderson
On 11/27/24 11:57, Pierrick Bouvier wrote: I noticed that it was redundant (for user-mode at least), but it seemed too implicit to rely on this. As well, I didn't observe such a flush in system-mode, does it work the same as user-mode (regarding the CF_PARALLEL flag)? Yes, we set CF_PARALLEL f

Re: [PULL 15/42] tests/functional: enable pre-emptive caching of assets

2024-11-27 Thread Richard Henderson
On 11/27/24 00:29, Thomas Huth wrote: On 26/11/2024 23.54, Richard Henderson wrote: On 11/26/24 11:52, Thomas Huth wrote: I think we want to continue to maek failing downloads as test failures, otherwise we'll never notice when an asset is not available from the internet anymore (since SKIPs ju

Re: [PATCH-for-10.0 2/6] accel/tcg: Declare local tcg_ops variable in tcg_exec_realizefn()

2024-11-27 Thread Richard Henderson
On 11/27/24 06:16, Philippe Mathieu-Daudé wrote: bool tcg_exec_realizefn(CPUState *cpu, Error **errp) { -static bool tcg_target_initialized; Error removing this variable before patch 6. r~ +const TCGCPUOps *tcg_ops = cpu->cc->tcg_ops; if (!tcg_target_initialized) {

Re: [PATCH] plugins: optimize cpu_index code generation

2024-11-27 Thread Pierrick Bouvier
Hi Richard, On 11/27/24 09:53, Richard Henderson wrote: On 11/26/24 13:02, Pierrick Bouvier wrote: @@ -266,6 +266,19 @@ static void qemu_plugin_vcpu_init__async(CPUState *cpu, run_on_cpu_data unused) assert(cpu->cpu_index != UNASSIGNED_CPU_INDEX); qemu_rec_mutex_lock(&plugin

Re: [PATCH] plugins: optimize cpu_index code generation

2024-11-27 Thread Richard Henderson
On 11/26/24 13:02, Pierrick Bouvier wrote: @@ -266,6 +266,19 @@ static void qemu_plugin_vcpu_init__async(CPUState *cpu, run_on_cpu_data unused) assert(cpu->cpu_index != UNASSIGNED_CPU_INDEX); qemu_rec_mutex_lock(&plugin.lock); + +/* + * We want to flush tb when a second c

Re: [PATCH v2 2/3] docs/devel/style: add a section about bitfield, and disallow them for packed structures

2024-11-27 Thread Richard Henderson
On 11/26/24 18:15, Pierrick Bouvier wrote: Except for saving memory in *very* specific case (a structure allocated tens of millions times for example), I hardly see a benefit vs using integer types. Even then, 'uint32_t flags' can be just as easy to use as unsigned foo:1, bar:1, etc:1. Plus yo

Re: [PATCH-for-10.0 6/6] accel/tcg: Allow tcg_exec_realizefn() initialize multiple frontends

2024-11-27 Thread Anton Johansson via
On 27/11/24, Philippe Mathieu-Daudé wrote: > Rather than initializing the first random target architecture > and ignore the following ones when a global boolean is set, > use a bitmask allowing different frontend targets to be > initialized. > > Signed-off-by: Philippe Mathieu-Daudé > --- > acce

Re: [PATCH 4/5] migration: Activate block devices if VM is paused when migrating

2024-11-27 Thread Andrey Drobyshev
On 11/25/24 4:46 PM, Fabiano Rosas wrote: > Currently a VM that has been target of a migration using > late-block-activate will crash at the end of a new migration (with it > as source) when releasing ownership of the disks due to the VM having > never taken ownership of the disks in the first plac

Re: [PATCH-for-10.0 6/6] accel/tcg: Allow tcg_exec_realizefn() initialize multiple frontends

2024-11-27 Thread Richard Henderson
On 11/27/24 11:28, Anton Johansson wrote: On 27/11/24, Philippe Mathieu-Daudé wrote: Rather than initializing the first random target architecture and ignore the following ones when a global boolean is set, use a bitmask allowing different frontend targets to be initialized. Signed-off-by: Phil

Re: [PATCH 4/5] migration: Activate block devices if VM is paused when migrating

2024-11-27 Thread Andrey Drobyshev
On 11/25/24 7:07 PM, Peter Xu wrote: > On Mon, Nov 25, 2024 at 11:46:11AM -0300, Fabiano Rosas wrote: >> Currently a VM that has been target of a migration using >> late-block-activate will crash at the end of a new migration (with it >> as source) when releasing ownership of the disks due to the V

Re: [PATCH-for-10.0 5/6] accel/tcg: Add TCGCPUOps::arch_id field

2024-11-27 Thread Richard Henderson
On 11/27/24 06:16, Philippe Mathieu-Daudé wrote: When using multiple TCG frontends concurrently, we need to be able to discriminate by target architecture. While we can infer that from the CPUClass, Can we? I thought the only place this got set is arch_type in system/arch_init.c. it can be

Re: [PATCH-for-10.0 5/6] accel/tcg: Add TCGCPUOps::arch_id field

2024-11-27 Thread Anton Johansson via
On 27/11/24, Philippe Mathieu-Daudé wrote: > When using multiple TCG frontends concurrently, we need to > be able to discriminate by target architecture. While we > can infer that from the CPUClass, it can be quicker to get > it from a direct field in TCGCPUOps. > > Signed-off-by: Philippe Mathieu

[RFC PATCH] target/arm: implement SEL2 physical and virtual timers

2024-11-27 Thread Alex Bennée
When FEAT_SEL2 was implemented the SEL2 timers where missed. This shows up when building the latest Hafnium with SPMC_AT_EL=2. The actual implementation utilises the same logic as the rest of the timers so all we need to do is: - define the timers and their access functions - conditionally add

Re: [PATCH-for-10.0 4/6] include: Expose QemuArch in 'qemu/arch_id.h'

2024-11-27 Thread Richard Henderson
On 11/27/24 06:25, Philippe Mathieu-Daudé wrote: Alternatively we can restrict TCGCPUOps::arch_id to system emulation, using in the next patch: -- >8 -- diff --git a/include/hw/core/tcg-cpu-ops.h b/include/hw/core/tcg-cpu-ops.h index ec3d2b50a9e..6fe0e1a7e97 100644 --- a/include/hw/core/tcg-cpu-

Re: [PATCH-for-10.0 4/6] include: Expose QemuArch in 'qemu/arch_id.h'

2024-11-27 Thread Richard Henderson
On 11/27/24 06:16, Philippe Mathieu-Daudé wrote: While QEMU architecture bitmask values are only used by system emulation code, they can be used in generic code like TCG accelerator. Move the declarations to "qemu/arch_id.h" and add the QemuArch type definition. Signed-off-by: Philippe Mathieu-

Re: [PATCH-for-10.0 3/6] accel/tcg: Rename TCGCPUOps::initialize() as initialize_once()

2024-11-27 Thread Richard Henderson
On 11/27/24 06:16, Philippe Mathieu-Daudé wrote: While this handler can be called multiple times, it will only be run once. Clarify by renaming the handler name. Signed-off-by: Philippe Mathieu-Daudé --- We could "optimize" TGC frontends memory use by passing a CPUClass argument, and each initia

Re: [PATCH-for-10.0 2/6] accel/tcg: Declare local tcg_ops variable in tcg_exec_realizefn()

2024-11-27 Thread Richard Henderson
On 11/27/24 06:16, Philippe Mathieu-Daudé wrote: Ease reading code by declaring a local 'tcg_ops' variable. Signed-off-by: Philippe Mathieu-Daudé --- accel/tcg/cpu-exec.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) Reviewed-by: Richard Henderson r~ diff --git a/accel

Re: [PATCH-for-10.0 1/6] target/ppc: Indent ppc_tcg_ops[] with 4 spaces

2024-11-27 Thread Richard Henderson
On 11/27/24 06:16, Philippe Mathieu-Daudé wrote: Signed-off-by: Philippe Mathieu-Daudé Acked-by: Nicholas Piggin --- target/ppc/cpu_init.c | 29 ++--- 1 file changed, 14 insertions(+), 15 deletions(-) Reviewed-by: Richard Henderson r~

Re: [PATCH-for-10.0 2/6] accel/tcg: Declare local tcg_ops variable in tcg_exec_realizefn()

2024-11-27 Thread Anton Johansson via
On 27/11/24, Philippe Mathieu-Daudé wrote: > Ease reading code by declaring a local 'tcg_ops' variable. > > Signed-off-by: Philippe Mathieu-Daudé > --- > accel/tcg/cpu-exec.c | 8 > 1 file changed, 4 insertions(+), 4 deletions(-) Reviewed-by: Anton Johansson

Re: [PATCH-for-10.0 1/6] target/ppc: Indent ppc_tcg_ops[] with 4 spaces

2024-11-27 Thread Anton Johansson via
On 27/11/24, Philippe Mathieu-Daudé wrote: > Signed-off-by: Philippe Mathieu-Daudé > Acked-by: Nicholas Piggin > --- > target/ppc/cpu_init.c | 29 ++--- > 1 file changed, 14 insertions(+), 15 deletions(-) Reviewed-by: Anton Johansson

Re: [PATCH v13 1/2] generic-loader: Add a generic loader

2024-11-27 Thread Philippe Mathieu-Daudé
Hi, [very old patch merged as commit e481a1f63c93] On 30/9/16 02:25, Alistair Francis wrote: Add a generic loader to QEMU which can be used to load images or set memory values. Internally inside QEMU this is a device. It is a strange device that provides no hardware interface but allows QEMU t

Re: [PATCH v11 6/7] target/riscv: Apply pointer masking for virtualized memory accesses

2024-11-27 Thread Richard Henderson
On 11/26/24 23:35, baturo.ale...@gmail.com wrote: From: Alexey Baturo Signed-off-by: Alexey Baturo --- target/riscv/cpu.h | 2 ++ target/riscv/cpu_helper.c | 19 +++ target/riscv/insn_trans/trans_rvh.c.inc | 11 +++ target/riscv/

Re: [RFC PATCH 2/5] hw/arm/smmuv3: Add initial support for SMMUv3 Nested device

2024-11-27 Thread Eric Auger
On 11/27/24 17:00, Jason Gunthorpe wrote: > On Wed, Nov 27, 2024 at 10:21:24AM +, Shameerali Kolothum Thodi wrote: >>> For SMMUv3, NVIDIA-specific vCMDQ, it needs a parameter to state that >>> specifically, >>> since I'm concluding from reading the SMMUv3 version G.a spec, that >>> ECMDQ was

Re: [PATCH for-9.2 0/4] fixes for hw/nvme

2024-11-27 Thread Jesper Wendel Devantier
On 11/18/24 11:14, Klaus Jensen wrote: A set of misc fixes related to SR-IOV compliance and MSI-X. Signed-off-by: Klaus Jensen --- Klaus Jensen (4): hw/nvme: fix msix_uninit with exclusive bar hw/nvme: fix use/unuse of msix vectors hw/nvme: SR-IOV VFs must hardwire pci inter

Re: [RFC PATCH 2/5] hw/arm/smmuv3: Add initial support for SMMUv3 Nested device

2024-11-27 Thread Jason Gunthorpe
On Wed, Nov 27, 2024 at 10:21:24AM +, Shameerali Kolothum Thodi wrote: > > For SMMUv3, NVIDIA-specific vCMDQ, it needs a parameter to state that > > specifically, > > since I'm concluding from reading the SMMUv3 version G.a spec, that > > ECMDQ was added > > to be able to assign an ECMDQ to a V

[PATCH v11 13/15] hw/vmapple/virtio-blk: Add support for apple virtio-blk

2024-11-27 Thread Phil Dennis-Jordan
From: Alexander Graf Apple has its own virtio-blk PCI device ID where it deviates from the official virtio-pci spec slightly: It puts a new "apple type" field at a static offset in config space and introduces a new barrier command. This patch first creates a mechanism for virtio-blk downstream c

[PATCH v11 11/15] hw/vmapple/bdif: Introduce vmapple backdoor interface

2024-11-27 Thread Phil Dennis-Jordan
From: Alexander Graf The VMApple machine exposes AUX and ROOT block devices (as well as USB OTG emulation) via virtio-pci as well as a special, simple backdoor platform device. This patch implements this backdoor platform device to the best of my understanding. I left out any USB OTG parts; they

[PATCH v11 01/15] ui & main loop: Redesign of system-specific main thread event handling

2024-11-27 Thread Phil Dennis-Jordan
macOS's Cocoa event handling must be done on the initial (main) thread of the process. Furthermore, if library or application code uses libdispatch, the main dispatch queue must be handling events on the main thread as well. So far, this has affected Qemu in both the Cocoa and SDL UIs, although in

[PATCH v11 05/15] MAINTAINERS: Add myself as maintainer for apple-gfx, reviewer for HVF

2024-11-27 Thread Phil Dennis-Jordan
I'm happy to take responsibility for the macOS PV graphics code. As HVF patches don't seem to get much attention at the moment, I'm also adding myself as designated reviewer for HVF and x86 HVF to try and improve that. I anticipate that the resulting workload should be covered by the funding I'm r

[PATCH v11 15/15] hw/vmapple/vmapple: Add vmapple machine type

2024-11-27 Thread Phil Dennis-Jordan
From: Alexander Graf Apple defines a new "vmapple" machine type as part of its proprietary macOS Virtualization.Framework vmm. This machine type is similar to the virt one, but with subtle differences in base devices, a few special vmapple device additions and a vastly different boot chain. This

[PATCH v11 14/15] hw/block/virtio-blk: Replaces request free function with g_free

2024-11-27 Thread Phil Dennis-Jordan
The virtio_blk_free_request() function has been a 1-liner forwarding to g_free() for a while now. We may as well call g_free on the request pointer directly. Signed-off-by: Phil Dennis-Jordan Reviewed-by: Akihiko Odaki --- hw/block/virtio-blk.c | 43 +++---

[PATCH v11 12/15] hw/vmapple/cfg: Introduce vmapple cfg region

2024-11-27 Thread Phil Dennis-Jordan
From: Alexander Graf Instead of device tree or other more standardized means, VMApple passes platform configuration to the first stage boot loader in a binary encoded format that resides at a dedicated RAM region in physical address space. This patch models this configuration space as a qdev dev

[PATCH v11 03/15] hw/display/apple-gfx: Adds PCI implementation

2024-11-27 Thread Phil Dennis-Jordan
This change wires up the PCI variant of the paravirtualised graphics device, mainly useful for x86-64 macOS guests, implemented by macOS's ParavirtualizedGraphics.framework. It builds on code shared with the vmapple/mmio variant of the PVG device. Signed-off-by: Phil Dennis-Jordan --- v4: * Th

[PATCH v11 07/15] hw/misc/pvpanic: Add MMIO interface

2024-11-27 Thread Phil Dennis-Jordan
From: Alexander Graf In addition to the ISA and PCI variants of pvpanic, let's add an MMIO platform device that we can use in embedded arm environments. Signed-off-by: Alexander Graf Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Signed-off-by: Phil Dennis-Jordan Revie

[PATCH v11 10/15] hw/vmapple/aes: Introduce aes engine

2024-11-27 Thread Phil Dennis-Jordan
From: Alexander Graf VMApple contains an "aes" engine device that it uses to encrypt and decrypt its nvram. It has trivial hard coded keys it uses for that purpose. Add device emulation for this device model. Signed-off-by: Alexander Graf Signed-off-by: Phil Dennis-Jordan Reviewed-by: Akihiko

[PATCH v11 08/15] hvf: arm: Ignore writes to CNTP_CTL_EL0

2024-11-27 Thread Phil Dennis-Jordan
From: Alexander Graf MacOS unconditionally disables interrupts of the physical timer on boot and then continues to use the virtual one. We don't really want to support a full physical timer emulation, so let's just ignore those writes. Signed-off-by: Alexander Graf Signed-off-by: Phil Dennis-Jo

[PATCH v11 09/15] gpex: Allow more than 4 legacy IRQs

2024-11-27 Thread Phil Dennis-Jordan
From: Alexander Graf Some boards such as vmapple don't do real legacy PCI IRQ swizzling. Instead, they just keep allocating more board IRQ lines for each new legacy IRQ. Let's support that mode by giving instantiators a new "nr_irqs" property they can use to support more than 4 legacy IRQ lines.

[PATCH v11 06/15] hw: Add vmapple subdir

2024-11-27 Thread Phil Dennis-Jordan
From: Alexander Graf We will introduce a number of devices that are specific to the vmapple target machine. To keep them all tidily together, let's put them into a single target directory. Signed-off-by: Alexander Graf Signed-off-by: Phil Dennis-Jordan Reviewed-by: Akihiko Odaki --- MAINTAIN

[PATCH v11 04/15] hw/display/apple-gfx: Adds configurable mode list

2024-11-27 Thread Phil Dennis-Jordan
This change adds a property 'display_modes' on the graphics device which permits specifying a list of display modes. (screen resolution and refresh rate) The property is an array of a custom type to make the syntax slightly less awkward to use, for example: -device '{"driver":"apple-gfx-pci", "di

  1   2   >