Re: [PATCH v3 02/29] hw/core: Declare CPUArchId::cpu as CPUState instead of Object

2024-01-29 Thread Richard Henderson
On 1/30/24 02:44, Philippe Mathieu-Daudé wrote: Do not accept any Object for CPUArchId::cpu field, restrict it to CPUState type. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/boards.h| 2 +- hw/core/machine.c | 4 ++-- hw/i386/x86.c | 2 +-

[PATCH v1] scripts/checkpatch.pl: check for placeholders in cover letter patches

2024-01-29 Thread Manos Pitsidianakis
Check if a file argument is a cover letter patch produced by git-format-patch --cover-letter; It is initialized with subject suffix " *** SUBJECT HERE ***" and body prefix " *** BLURB HERE ***". If they exist, warn the user. Signed-off-by: Manos Pitsidianakis --- scripts/checkpatch.pl | 14

Re: [PATCH v3 01/29] bulk: Access existing variables initialized to >F when available

2024-01-29 Thread Richard Henderson
On 1/30/24 02:44, Philippe Mathieu-Daudé wrote: When a variable is initialized to >field, use it in place. Rationale: while this makes the code more concise, this also helps static analyzers. Mechanical change using the following Coccinelle spatch script: @@ type S, F; identifier s, m,

Re: [PATCH 04/22] target/sparc: Introduce gen_{load,store}_fpr_Q

2024-01-29 Thread Philippe Mathieu-Daudé
On 3/11/23 18:38, Richard Henderson wrote: Use them for trans_FMOVq. Signed-off-by: Richard Henderson --- target/sparc/translate.c | 25 +++-- 1 file changed, 19 insertions(+), 6 deletions(-) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH 03/22] target/sparc: Remove gen_dest_fpr_F

2024-01-29 Thread Philippe Mathieu-Daudé
On 3/11/23 18:38, Richard Henderson wrote: Replace with tcg_temp_new_i32. Signed-off-by: Richard Henderson --- target/sparc/translate.c | 17 ++--- 1 file changed, 6 insertions(+), 11 deletions(-) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH v2 11/14] plugins: remove non per_vcpu inline operation from API

2024-01-29 Thread Pierrick Bouvier
On 1/26/24 20:26, Alex Bennée wrote: Pierrick Bouvier writes: 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

Re: [PATCH v2 14/14] contrib/plugins/execlog: fix new warnings

2024-01-29 Thread Pierrick Bouvier
On 1/26/24 20:31, Alex Bennée wrote: Pierrick Bouvier writes: ‘g_pattern_match_string’ is deprecated, Use 'g_pattern_spec_match_string' instead. Unfortunately this isn't enough as we can still build on older glibs: /* Ask for warnings for anything that was marked deprecated in * the

Re: [PATCH v3 26/29] target/sparc: Prefer fast cpu_env() over slower CPU QOM cast macro

2024-01-29 Thread Philippe Mathieu-Daudé
On 29/1/24 17:45, Philippe Mathieu-Daudé wrote: Mechanical patch produced running the command documented in scripts/coccinelle/cpu_env.cocci_template header. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/sparc/cpu.c | 17 +

Re: [PATCH 01/33] include/hw/core: Add mmu_index to CPUClass

2024-01-29 Thread Richard Henderson
On 1/30/24 17:46, Philippe Mathieu-Daudé wrote: Hi Richard, On 30/1/24 00:30, Richard Henderson wrote: To be used after all targets have populated the hook. Signed-off-by: Richard Henderson ---   include/hw/core/cpu.h | 3 +++   1 file changed, 3 insertions(+) diff --git

Re: [PATCH v2 05/14] tests/plugin: add test plugin for inline operations

2024-01-29 Thread Pierrick Bouvier
On 1/26/24 20:05, Alex Bennée wrote: Pierrick Bouvier writes: 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

Re: Assistance Required for QEMU Hardfault Error with Cortex-M33 on MPS2AN505

2024-01-29 Thread sanjana gogte
I wanted to express my gratitude for your insightful solution concerning the INVSTATE fault I was encountering. After recompiling my code with the -mthumb compiler flag, the exception is no longer being raised, which marks a significant step forward in my project. However, I've encountered

Re: [PATCH 2/4] isa: extract FDC37M81X to a separate file

2024-01-29 Thread Philippe Mathieu-Daudé
On 29/1/24 21:26, Paolo Bonzini wrote: On Mon, Jan 29, 2024 at 8:49 PM Bernhard Beschow wrote: Don't we prefer a macro for below code? While touching the code we could use it. (Sorry I can't recall its name from the top of my head and I don't have access to the code right now). Ah yeah,

Re: [PATCH 01/33] include/hw/core: Add mmu_index to CPUClass

2024-01-29 Thread Philippe Mathieu-Daudé
Hi Richard, On 30/1/24 00:30, Richard Henderson wrote: To be used after all targets have populated the hook. Signed-off-by: Richard Henderson --- include/hw/core/cpu.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index

Re: [PATCH 09/33] target/hppa: Populate CPUClass.mmu_index

2024-01-29 Thread Helge Deller
On 1/30/24 00:30, Richard Henderson wrote: Signed-off-by: Richard Henderson --- target/hppa/cpu.h | 7 ++- target/hppa/cpu.c | 12 2 files changed, 14 insertions(+), 5 deletions(-) Reviewed-by: Helge Deller diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h index

Re: [PATCH v2 02/14] plugins: scoreboard API

2024-01-29 Thread Pierrick Bouvier
On 1/26/24 19:14, Alex Bennée wrote: Pierrick Bouvier writes: 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

[PATCH v3 2/2] hw/block/block.c: improve confusing blk_check_size_and_read_all() error

2024-01-29 Thread Manos Pitsidianakis
In cases where a device tries to read more bytes than the block device contains, the error is vague: "device requires X bytes, block backend provides Y bytes". This patch changes the errors of this function to include the block backend name, the device id and device type name where appropriate.

[PATCH v3 1/2] hw/core/qdev.c: add qdev_get_human_name()

2024-01-29 Thread Manos Pitsidianakis
Add a simple method to return some kind of human readable identifier for use in error messages. Reviewed-by: Stefan Hajnoczi Signed-off-by: Manos Pitsidianakis --- include/hw/qdev-core.h | 14 ++ hw/core/qdev.c | 8 2 files changed, 22 insertions(+) diff --git

[PATCH v3 0/2] hw/block/block.c: improve confusing error

2024-01-29 Thread Manos Pitsidianakis
In cases where a device tries to read more bytes than the block device contains with the blk_check_size_and_read_all() function, the error is vague: "device requires X bytes, block backend provides Y bytes". This patch changes the errors of this function to include the block backend name, the

Re: [PATCH] backends/hostmem: Fix block comments style (checkpatch.pl warnings)

2024-01-29 Thread Xiaoyao Li
On 1/30/2024 2:31 AM, Philippe Mathieu-Daudé wrote: While re-indenting code in host_memory_backend_memory_complete(), we triggered various "Block comments use a leading /* on a separate line" warnings from checkpatch.pl. Correct the comments style. Fixes: e199f7ad4d ("backends: Simplify

Re: [PATCH v2 1/2] hw/smbios: Fix OEM strings table option validation

2024-01-29 Thread Ani Sinha
> On 29-Jan-2024, at 13:33, Akihiko Odaki wrote: > > qemu_smbios_type11_opts did not have the list terminator and that > resulted in out-of-bound memory access. It also needs to have an element > for the type option. > > Cc: qemu-sta...@nongnu.org > Fixes: 2d6dcbf93fb0 ("smbios: support

Re: [PATCH v2 2/2] hw/smbios: Fix port connector option validation

2024-01-29 Thread Ani Sinha
> On 29-Jan-2024, at 13:33, Akihiko Odaki wrote: > > qemu_smbios_type8_opts did not have the list terminator and that > resulted in out-of-bound memory access. It also needs to have an element > for the type option. > > Cc: qemu-sta...@nongnu.org > Fixes: fd8caa253c56 ("hw/smbios: support

Re: [PATCH v5 6/6] tests/qtest/pvpanic: add tests for pvshutdown event

2024-01-29 Thread Thomas Huth
On 29/01/2024 20.28, Thomas Weißschuh wrote: Validate that a shutdown via the pvpanic device emits the correct QMP events. Signed-off-by: Thomas Weißschuh --- tests/qtest/pvpanic-pci-test.c | 39 +++ tests/qtest/pvpanic-test.c | 29

Re: [PATCH v2 3/3] virtio-gpu-rutabaga.c: override resource_destroy method

2024-01-29 Thread Manos Pitsidianakis
On Tue, 30 Jan 2024 03:26, Gurchetan Singh wrote: On Mon, Jan 29, 2024 at 7:46 AM Manos Pitsidianakis < manos.pitsidiana...@linaro.org> wrote: When the Rutabaga GPU device frees resources, it calls rutabaga_resource_unref for that resource_id. However, when the generic VirtIOGPU functions

Re: [PATCH] hw/hyperv: Include missing headers

2024-01-29 Thread Thomas Huth
On 29/01/2024 18.00, Philippe Mathieu-Daudé wrote: Include missing headers in order to avoid when refactoring unrelated headers: hw/hyperv/hyperv.c:33:18: error: field ‘msg_page_mr’ has incomplete type 33 | MemoryRegion msg_page_mr; | ^~~

Re: [PATCH] Make 'uri' optional for migrate QAPI

2024-01-29 Thread Michael Tokarev
30.01.2024 04:35, Peter Xu: .. This seems like a stable material too, - please let me know if it is not. Yes it is. I used to be more careful on copying stable at least in the commit message when I post patches, but forgot to do so when start picking up.. Note that it's already merged in

Re: [PATCH] hw/intc/xics: Include missing 'cpu.h' header

2024-01-29 Thread Thomas Huth
On 29/01/2024 18.05, Philippe Mathieu-Daudé wrote: Include missing headers in order to avoid when refactoring unrelated headers: hw/intc/xics.c: In function 'icp_realize': hw/intc/xics.c:304:5: error: unknown type name 'PowerPCCPU' 304 | PowerPCCPU *cpu; | ^~

RE: [PATCH v2] target/i386/host-cpu: Use iommu phys_bits with VFIO assigned devices on Intel h/w

2024-01-29 Thread Kasireddy, Vivek
Hi Alex, Eric, > > > Recent updates in OVMF and Seabios have resulted in MMIO regions > > > being placed at the upper end of the physical address space. As a > > > result, when a Host device is assigned to the Guest via VFIO, the > > > following mapping failures occur when VFIO tries to map the

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

2024-01-29 Thread Peter Xu
On Mon, Jan 29, 2024 at 02:20:35PM +0200, Avihai Horon wrote: > > On 29/01/2024 6:17, Peter Xu wrote: > > External email: Use caution opening links or attachments > > > > > > On Sun, Jan 28, 2024 at 05:43:52PM +0200, Avihai Horon wrote: > > > On 25/01/2024 22:57, Fabiano Rosas wrote: > > > >

[PATCH v4 3/7] crypto: Modify the qcrypto_block_create to support creation flags

2024-01-29 Thread yong . huang
From: Hyman Huang Expand the signature of qcrypto_block_create to enable the formation of LUKS volumes with detachable headers. To accomplish that, introduce QCryptoBlockCreateFlags to instruct the creation process to set the payload_offset_sector to 0. Signed-off-by: Hyman Huang ---

[PATCH v4 0/7] Support generic Luks encryption

2024-01-29 Thread yong . huang
From: Hyman Huang Sorry for the late post of version 4. The modifications are as follows: v4: - Rebase on master - squash [PATCH v3 02/10] to [PATCH v3 01/10] - refactor the logic of block_crypto_open_generic in [PATCH v3 02/10] as Daniel suggestted: a. drop the invalid parameter check

[PATCH v4 6/7] crypto: Introduce 'detached-header' field in QCryptoBlockInfoLUKS

2024-01-29 Thread yong . huang
From: Hyman Huang When querying the LUKS disk with the qemu-img tool or other APIs, add information about whether the LUKS header is detached. Additionally, update the test case with the appropriate modification. Signed-off-by: Hyman Huang --- crypto/block-luks.c| 2 ++

[PATCH v4 1/7] crypto: Support LUKS volume with detached header

2024-01-29 Thread yong . huang
From: Hyman Huang By enhancing the LUKS driver, it is possible to implement the LUKS volume with a detached header. Normally a LUKS volume has a layout: disk: | header | key material | disk payload data | With a detached LUKS header, you need 2 disks so getting: disk1: | header | key

[PATCH v4 7/7] tests: Add case for LUKS volume with detached header

2024-01-29 Thread yong . huang
From: Hyman Huang Also, add a section to the MAINTAINERS file for detached LUKS header, it only has a test case in it currently. Signed-off-by: Hyman Huang --- MAINTAINERS | 5 + tests/qemu-iotests/tests/luks-detached-header | 218 ++

[PATCH v4 4/7] block: Support detached LUKS header creation using blockdev-create

2024-01-29 Thread yong . huang
From: Hyman Huang Firstly, enable the ability to choose the block device containing a detachable LUKS header by adding the 'header' parameter to BlockdevCreateOptionsLUKS. Secondly, when formatting the LUKS volume with a detachable header, truncate the payload volume to length without a header

[PATCH v4 2/7] qapi: Make parameter 'file' optional for BlockdevCreateOptionsLUKS

2024-01-29 Thread yong . huang
From: Hyman Huang To support detached LUKS header creation, make the existing 'file' field in BlockdevCreateOptionsLUKS optional. Signed-off-by: Hyman Huang Reviewed-by: Daniel P. Berrangé --- block/crypto.c | 21 ++--- qapi/block-core.json | 5 +++-- 2 files changed,

[PATCH v4 5/7] block: Support detached LUKS header creation using qemu-img

2024-01-29 Thread yong . huang
From: Hyman Huang Even though a LUKS header might be created with cryptsetup, qemu-img should be enhanced to accommodate it as well. Add the 'detached-header' option to specify the creation of a detached LUKS header. This is how it is used: $ qemu-img create --object secret,id=sec0,data=abc123

Re: [PATCH] migration/docs: Explain two solutions for VMSD compatibility

2024-01-29 Thread Peter Xu
On Mon, Jan 29, 2024 at 03:51:07PM +, Peter Maydell wrote: > On Mon, 29 Jan 2024 at 15:18, Fabiano Rosas wrote: > > > > Peter Maydell writes: > > > > > On Mon, 29 Jan 2024 at 13:45, Fabiano Rosas wrote: > > >> > > >> Peter Xu writes: > > >> > Fundamentally, IMHO it's because QEMU as a

RE: [RFC v1 3/3] hw/arm/virt-acpi-build.c: Enable CPU cache topology

2024-01-29 Thread JeeHeng Sia
> -Original Message- > From: Jonathan Cameron > Sent: Monday, January 29, 2024 7:08 PM > To: JeeHeng Sia > Cc: qemu-devel@nongnu.org; qemu-...@nongnu.org; qemu-ri...@nongnu.org; > m...@redhat.com; imamm...@redhat.com; > anisi...@redhat.com; shannon.zha...@gmail.com;

RE: [RFC v1 1/3] hw/acpi/aml-build: Add cache structure table creation for PPTT table

2024-01-29 Thread JeeHeng Sia
> -Original Message- > From: Jonathan Cameron > Sent: Monday, January 29, 2024 7:03 PM > To: JeeHeng Sia > Cc: qemu-devel@nongnu.org; qemu-...@nongnu.org; qemu-ri...@nongnu.org; > m...@redhat.com; imamm...@redhat.com; > anisi...@redhat.com; shannon.zha...@gmail.com;

Re: [PATCH] migration/docs: Explain two solutions for VMSD compatibility

2024-01-29 Thread Peter Xu
On Mon, Jan 29, 2024 at 10:44:46AM -0300, Fabiano Rosas wrote: > > Since we're at it, I would also like to know how you think about whether we > > should still suggest people using VMSD versioning, as we know that it won't > > work for backward migrations. > > > > My current thoughts is it is

RE: [PATCH v3 0/4] Live Migration Acceleration with IAA Compression

2024-01-29 Thread Liu, Yuan1
> -Original Message- > From: Peter Xu > Sent: Monday, January 29, 2024 6:43 PM > To: Liu, Yuan1 > Cc: faro...@suse.de; leob...@redhat.com; qemu-devel@nongnu.org; Zou, > Nanhai > Subject: Re: [PATCH v3 0/4] Live Migration Acceleration with IAA > Compression > > On Wed, Jan 03, 2024 at

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

2024-01-29 Thread JeeHeng Sia
> -Original Message- > From: Andrew Jones > Sent: Monday, January 29, 2024 5:19 PM > To: JeeHeng Sia > Cc: qemu-...@nongnu.org; qemu-devel@nongnu.org; qemu-ri...@nongnu.org; > m...@redhat.com; imamm...@redhat.com; > anisi...@redhat.com; peter.mayd...@linaro.org;

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

2024-01-29 Thread JeeHeng Sia
> -Original Message- > From: Sunil V L > Sent: Monday, January 29, 2024 1:13 PM > To: JeeHeng Sia > Cc: qemu-...@nongnu.org; qemu-devel@nongnu.org; qemu-ri...@nongnu.org; > m...@redhat.com; imamm...@redhat.com; > anisi...@redhat.com; peter.mayd...@linaro.org;

Re: [PATCH] target/loongarch: Fix qtest test-hmp error when KVM-only build

2024-01-29 Thread maobibo
With qemu is compiled with option "--target-list=loongarch64-softmmu --disable-tcg", it passes to run with "make check" command. Also gdb debug for LoongArch kvm support depends on this. Tested-by: Bibo Mao On 2024/1/25 下午2:14, Song Gao wrote: The cc->sysemu_ops->get_phys_page_debug() is

Disk migration from qcow2 to SPDK

2024-01-29 Thread 陈孚
Hello everyone, Recently, we are looking to switch the VM’s disks from the qemu driver with the qcow2 format to a vhost-user-blk driver based on SPDK. Currently, we are able to copy data into an SPDK-based target using the blockcopy method. We would like to inquire if there is a theoretical

RE: [PATCH v3 11/29] target/hexagon: Prefer fast cpu_env() over slower CPU QOM cast macro

2024-01-29 Thread Brian Cain
> -Original Message- > From: Philippe Mathieu-Daudé > Sent: Monday, January 29, 2024 10:45 AM > To: qemu-devel@nongnu.org > Cc: qemu-ri...@nongnu.org; qemu-s3...@nongnu.org; Paolo Bonzini > ; k...@vger.kernel.org; qemu-...@nongnu.org; > qemu-...@nongnu.org; Richard Henderson ; > Philippe

Re: [PATCH] Make 'uri' optional for migrate QAPI

2024-01-29 Thread Peter Xu
On Mon, Jan 29, 2024 at 11:30:53PM +0300, Michael Tokarev wrote: > 23.01.2024 09:42, Het Gala: > > 'uri' argument should be optional, as 'uri' and 'channels' > > arguments are mutally exclusive in nature. > > > > Fixes: 074dbce5fcce (migration: New migrate and > > migrate-incoming argument

Re: [PATCH v2 3/3] virtio-gpu-rutabaga.c: override resource_destroy method

2024-01-29 Thread Gurchetan Singh
On Mon, Jan 29, 2024 at 7:46 AM Manos Pitsidianakis < manos.pitsidiana...@linaro.org> wrote: > When the Rutabaga GPU device frees resources, it calls > rutabaga_resource_unref for that resource_id. However, when the generic > VirtIOGPU functions destroys resources, it only removes the >

Re: [PATCH 3/6] target/riscv: add remaining named features

2024-01-29 Thread Alistair Francis
On Fri, Jan 26, 2024 at 5:54 AM Daniel Henrique Barboza wrote: > > The RVA22U64 and RVA22S64 profiles mandates certain extensions that, > until now, we were implying that they were available. > > We can't do this anymore since named features also has a riscv,isa > entry. Let's add them to

Re: [PATCH 2/6] target/riscv: add riscv,isa to named features

2024-01-29 Thread Alistair Francis
On Fri, Jan 26, 2024 at 6:55 AM Daniel Henrique Barboza wrote: > > Further discussions after the introduction of rva22 support in QEMU > revealed that what we've been calling 'named features' are actually > regular extensions, with their respective riscv,isa DTs. This is > clarified in [1]. [2]

Re: [PATCH 1/6] target/riscv/tcg: set 'mmu' with 'satp' in cpu_set_profile()

2024-01-29 Thread Alistair Francis
On Fri, Jan 26, 2024 at 5:54 AM Daniel Henrique Barboza wrote: > > Recent changes in options handling removed the 'mmu' default the bare > CPUs had, meaning that we must enable 'mmu' by hand when using the > rva22s64 profile CPU. > > Given that this profile is setting a satp mode, it already

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

2024-01-29 Thread Alistair Francis
On Sun, Jan 28, 2024 at 6:29 PM Akihiko Odaki wrote: > > This series extracts fixes and refactorings that can be applied > independently from "[PATCH v9 00/23] plugins: Allow to read registers". > > The patch "target/riscv: Move MISA limits to class" was replaced with > patch "target/riscv: Move

Re: [PATCH] kconfig: use "select" to enable semihosting

2024-01-29 Thread Alistair Francis
On Mon, Jan 29, 2024 at 9:59 PM Paolo Bonzini wrote: > > Just like all other dependencies, these can be expressed in Kconfig > files rather than in the default configurations. > > Signed-off-by: Paolo Bonzini Acked-by: Alistair Francis Alistair > --- >

Re: [PATCH 09/10] riscv: Clean up includes

2024-01-29 Thread Alistair Francis
On Fri, Jan 26, 2024 at 2:35 AM Peter Maydell wrote: > > This commit was created with scripts/clean-includes: > ./scripts/clean-includes --git riscv target/riscv/*.[ch] > > All .c should include qemu/osdep.h first. The script performs three > related cleanups: > > * Ensure .c files include

Re: [PATCH 24/33] target/riscv: Populate CPUClass.mmu_index

2024-01-29 Thread Alistair Francis
On Tue, Jan 30, 2024 at 10:03 AM Richard Henderson wrote: > > Signed-off-by: Richard Henderson Reviewed-by: Alistair Francis Alistair > --- > target/riscv/cpu.c | 6 ++ > 1 file changed, 6 insertions(+) > > diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c > index

Re: [PATCH 23/33] target/riscv: Replace cpu_mmu_index with riscv_env_mmu_index

2024-01-29 Thread Alistair Francis
On Tue, Jan 30, 2024 at 9:36 AM Richard Henderson wrote: > > Use the target-specific function name in preference > to the generic name. > > Signed-off-by: Richard Henderson Reviewed-by: Alistair Francis Alistair > --- > target/riscv/cpu_helper.c| 4 ++-- > target/riscv/op_helper.c |

Re: [PATCH 22/33] target/riscv: Rename riscv_cpu_mmu_index to riscv_env_mmu_index

2024-01-29 Thread Alistair Francis
On Tue, Jan 30, 2024 at 9:39 AM Richard Henderson wrote: > > Free up the riscv_cpu_mmu_index name for other usage; > emphasize that the argument is 'env'. > > Signed-off-by: Richard Henderson Reviewed-by: Alistair Francis Alistair > --- > target/riscv/cpu.h| 4 ++-- >

Re: [PATCH v3 22/29] target/riscv: Prefer fast cpu_env() over slower CPU QOM cast macro

2024-01-29 Thread Alistair Francis
On Tue, Jan 30, 2024 at 2:52 AM Philippe Mathieu-Daudé wrote: > > Mechanical patch produced running the command documented > in scripts/coccinelle/cpu_env.cocci_template header. > > Reviewed-by: Richard Henderson > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis Alistair

Re: [PATCH] smc37c669: remove useless is_enabled functions

2024-01-29 Thread Bernhard Beschow
Am 29. Januar 2024 13:34:20 UTC schrieb Paolo Bonzini : >Calls to is_enabled are bounded to indices that actually exist in >the SuperIO device. Therefore, the is_enabled functions in >smc37c669 are not doing anything and they can be removed. Indeed isa_superio_realize() only considers .count

[PATCH] pflash: fix sectors vs bytes confusion in blk_pread_nonzeroes()

2024-01-29 Thread Stefan Hajnoczi
The following expression is incorrect because blk_pread_nonzeroes() deals in units of bytes, not sectors: bytes = MIN(size - offset, BDRV_REQUEST_MAX_SECTORS) ^^^ BDRV_REQUEST_MAX_BYTES is the appropriate constant. Fixes: a4b15a8b9ef2

Re: [PATCH v2 1/2] hw/core/qdev.c: add qdev_get_human_name()

2024-01-29 Thread Stefan Hajnoczi
On Tue, Jan 23, 2024 at 05:35:30PM +0200, Manos Pitsidianakis wrote: > Add a simple method to return some kind of human readable identifier for > use in error messages. > > Signed-off-by: Manos Pitsidianakis > --- > hw/core/qdev.c | 8 > include/hw/qdev-core.h | 14

Re: [PATCH v2 2/2] hw/block/block.c: improve confusing blk_check_size_and_read_all() error

2024-01-29 Thread Stefan Hajnoczi
On Tue, Jan 23, 2024 at 05:35:31PM +0200, Manos Pitsidianakis wrote: > if (blk_len != size) { > -error_setg(errp, "device requires %" HWADDR_PRIu " bytes, " > - "block backend provides %" PRIu64 " bytes", > - size, blk_len); > +dev_id =

[PATCH 33/33] include/exec: Change cpu_mmu_index argument to CPUState

2024-01-29 Thread Richard Henderson
Signed-off-by: Richard Henderson --- include/exec/cpu-all.h| 2 +- include/exec/cpu-common.h | 3 +-- target/sparc/cpu.h| 2 +- accel/tcg/cputlb.c| 22 +--- semihosting/uaccess.c | 2 +- target/cris/translate.c

[PATCH 31/33] target/xtensa: Populate CPUClass.mmu_index

2024-01-29 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/xtensa/cpu.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/target/xtensa/cpu.c b/target/xtensa/cpu.c index 62020b1f33..79f91819df 100644 --- a/target/xtensa/cpu.c +++ b/target/xtensa/cpu.c @@ -74,6 +74,11 @@ static bool

[PATCH 29/33] target/sparc: Populate CPUClass.mmu_index

2024-01-29 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/sparc/cpu.h | 34 ++ target/sparc/cpu.c | 29 + 2 files changed, 35 insertions(+), 28 deletions(-) diff --git a/target/sparc/cpu.h b/target/sparc/cpu.h index 12a11ecb26..92c58c92c1 100644 ---

[PATCH 05/33] target/arm: Populate CPUClass.mmu_index

2024-01-29 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/cpu.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 6a96b245f2..1f9ea622bd 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -133,6 +133,11 @@ static bool arm_cpu_has_work(CPUState *cs)

[PATCH 32/33] include/exec: Implement cpu_mmu_index generically

2024-01-29 Thread Richard Henderson
For user-only mode, use MMU_USER_IDX. For system mode, use CPUClass.mmu_index. Signed-off-by: Richard Henderson --- include/exec/cpu-all.h| 4 include/exec/cpu-common.h | 19 +++ target/alpha/cpu.h| 5 - target/arm/cpu.h | 13 -

[PATCH 14/33] target/microblaze: Populate CPUClass.mmu_index

2024-01-29 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/microblaze/cpu.h | 13 ++--- target/microblaze/cpu.c | 18 +- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/target/microblaze/cpu.h b/target/microblaze/cpu.h index b5374365f5..90ab796de9 100644 ---

[PATCH 25/33] target/rx: Populate CPUClass.mmu_index

2024-01-29 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/rx/cpu.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/target/rx/cpu.c b/target/rx/cpu.c index 353132dac2..5205167da1 100644 --- a/target/rx/cpu.c +++ b/target/rx/cpu.c @@ -64,6 +64,11 @@ static bool rx_cpu_has_work(CPUState *cs)

[PATCH 09/33] target/hppa: Populate CPUClass.mmu_index

2024-01-29 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/hppa/cpu.h | 7 ++- target/hppa/cpu.c | 12 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h index 6a153405d2..04439f247d 100644 --- a/target/hppa/cpu.h +++ b/target/hppa/cpu.h @@

[PATCH 30/33] target/tricore: Populate CPUClass.mmu_index

2024-01-29 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/tricore/cpu.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/target/tricore/cpu.c b/target/tricore/cpu.c index e6d91c74b5..74e8a22b86 100644 --- a/target/tricore/cpu.c +++ b/target/tricore/cpu.c @@ -89,6 +89,11 @@ static bool

Re: [PULL 06/15] tests/qtest/migration: Don't use -cpu max for aarch64

2024-01-29 Thread Fabiano Rosas
Fabiano Rosas writes: > Peter Xu writes: > >> On Fri, Jan 26, 2024 at 11:54:32AM -0300, Fabiano Rosas wrote: >>> Peter Maydell writes: >>> >>> > On Fri, 26 Jan 2024 at 14:36, Fabiano Rosas wrote: >>> >> >>> >> pet...@redhat.com writes: >>> >> >>> >> > From: Fabiano Rosas >>> >> > >>> >> >

[PATCH 28/33] target/sh4: Populate CPUClass.mmu_index

2024-01-29 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/sh4/cpu.h | 16 ++-- target/sh4/cpu.c | 16 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/target/sh4/cpu.h b/target/sh4/cpu.h index 0e6fa65bae..9c5e2b349e 100644 --- a/target/sh4/cpu.h +++

[PATCH 10/33] target/i386: Populate CPUClass.mmu_index

2024-01-29 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/i386/cpu.h | 13 ++--- target/i386/cpu.c | 10 ++ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 7f0786e8b9..62bdb02378 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h

[PATCH 17/33] target/mips: Populate CPUClass.mmu_index

2024-01-29 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/mips/cpu.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/target/mips/cpu.c b/target/mips/cpu.c index df544ab39b..d644adbc77 100644 --- a/target/mips/cpu.c +++ b/target/mips/cpu.c @@ -182,6 +182,11 @@ static bool mips_cpu_has_work(CPUState

[PATCH 26/33] target/s390x: Split out s390x_env_mmu_index

2024-01-29 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/s390x/cpu.h| 4 +++- target/s390x/tcg/mem_helper.c | 34 ++ 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h index fa3aac4f97..f0fed5d6ad 100644 ---

[PATCH 15/33] target/mips: Pass ptw_mmu_idx down from mips_cpu_tlb_fill

2024-01-29 Thread Richard Henderson
Rather than adjust env->hflags so that the value computed by cpu_mmu_index() changes, compute the mmu_idx that we want directly and pass it down. Introduce symbolic constants for MMU_{KERNEL,ERL}_IDX. Signed-off-by: Richard Henderson --- target/mips/cpu.h | 4 +++-

[PATCH 04/33] target/arm: Split out arm_env_mmu_index

2024-01-29 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/internals.h | 5 + target/arm/helper.c | 2 +- target/arm/tcg/helper-a64.c | 4 ++-- target/arm/tcg/mte_helper.c | 18 +- target/arm/tcg/sve_helper.c | 8 target/arm/tcg/tlb_helper.c | 2 +- 6 files

[PATCH 20/33] target/ppc: Split out ppc_env_mmu_index

2024-01-29 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/ppc/cpu.h| 7 ++- target/ppc/cpu_init.c | 2 +- target/ppc/mem_helper.c | 10 +- target/ppc/mmu_common.c | 4 ++-- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h index

[PATCH 02/33] target/alpha: Split out alpha_env_mmu_index

2024-01-29 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/alpha/cpu.h | 7 ++- target/alpha/translate.c | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/target/alpha/cpu.h b/target/alpha/cpu.h index ce806587ca..3beff2738a 100644 --- a/target/alpha/cpu.h +++ b/target/alpha/cpu.h

[PATCH 23/33] target/riscv: Replace cpu_mmu_index with riscv_env_mmu_index

2024-01-29 Thread Richard Henderson
Use the target-specific function name in preference to the generic name. Signed-off-by: Richard Henderson --- target/riscv/cpu_helper.c| 4 ++-- target/riscv/op_helper.c | 4 ++-- target/riscv/vector_helper.c | 9 + 3 files changed, 9 insertions(+), 8 deletions(-) diff --git

[PATCH 07/33] target/cris: Cache mem_index in DisasContext

2024-01-29 Thread Richard Henderson
Compute this value once for each translation. Signed-off-by: Richard Henderson --- target/cris/translate.c | 14 +- target/cris/translate_v10.c.inc | 6 ++ 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/target/cris/translate.c b/target/cris/translate.c

[PATCH 08/33] target/cris: Populate CPUClass.mmu_index

2024-01-29 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/cris/cpu.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/target/cris/cpu.c b/target/cris/cpu.c index 6349148b65..163fb05d58 100644 --- a/target/cris/cpu.c +++ b/target/cris/cpu.c @@ -56,6 +56,11 @@ static bool cris_cpu_has_work(CPUState

[PATCH 06/33] target/avr: Populate CPUClass.mmu_index

2024-01-29 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/avr/cpu.h | 4 +--- target/avr/cpu.c | 6 ++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/target/avr/cpu.h b/target/avr/cpu.h index 7d5dd42575..4595c6bb18 100644 --- a/target/avr/cpu.h +++ b/target/avr/cpu.h @@ -184,9 +184,7 @@

[PATCH 16/33] target/mips: Split out mips_env_mmu_index

2024-01-29 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/mips/cpu.h | 7 ++- target/mips/sysemu/physaddr.c | 2 +- target/mips/tcg/msa_helper.c| 10 +- target/mips/tcg/sysemu/cp0_helper.c | 2 +- target/mips/tcg/sysemu/special_helper.c | 2 +-

[PATCH 22/33] target/riscv: Rename riscv_cpu_mmu_index to riscv_env_mmu_index

2024-01-29 Thread Richard Henderson
Free up the riscv_cpu_mmu_index name for other usage; emphasize that the argument is 'env'. Signed-off-by: Richard Henderson --- target/riscv/cpu.h| 4 ++-- target/riscv/cpu_helper.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/target/riscv/cpu.h

[PATCH 11/33] target/loongarch: Populate CPUClass.mmu_index

2024-01-29 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/loongarch/cpu.h | 6 ++ target/loongarch/cpu.c | 11 +++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/target/loongarch/cpu.h b/target/loongarch/cpu.h index 0fa5e0ca93..5dfcfeb3a4 100644 --- a/target/loongarch/cpu.h +++

[PATCH 13/33] target/m68k: Populate CPUClass.mmu_index

2024-01-29 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/m68k/cpu.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/target/m68k/cpu.c b/target/m68k/cpu.c index 44000f5869..8a8392e694 100644 --- a/target/m68k/cpu.c +++ b/target/m68k/cpu.c @@ -56,6 +56,11 @@ static bool m68k_cpu_has_work(CPUState

[PATCH 19/33] target/openrisc: Populate CPUClass.mmu_index

2024-01-29 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/openrisc/cpu.h | 10 ++ target/openrisc/cpu.c | 13 + 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/target/openrisc/cpu.h b/target/openrisc/cpu.h index b454014ddd..7dbed8d8be 100644 --- a/target/openrisc/cpu.h +++

[PATCH 27/33] target/s390x: Populate CPUClass.mmu_index

2024-01-29 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/s390x/cpu.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c index 7f123863dc..49a2341acc 100644 --- a/target/s390x/cpu.c +++ b/target/s390x/cpu.c @@ -142,6 +142,11 @@ static bool

[PATCH 18/33] target/nios2: Populate CPUClass.mmu_index

2024-01-29 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/nios2/cpu.h | 12 ++-- target/nios2/cpu.c | 7 +++ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/target/nios2/cpu.h b/target/nios2/cpu.h index 2d79b5b298..9965ff74c1 100644 --- a/target/nios2/cpu.h +++

[PATCH 03/33] target/alpha: Populate CPUClass.mmu_index

2024-01-29 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/alpha/cpu.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/target/alpha/cpu.c b/target/alpha/cpu.c index de705c3703..bf70173a25 100644 --- a/target/alpha/cpu.c +++ b/target/alpha/cpu.c @@ -64,6 +64,11 @@ static bool

[PATCH 21/33] target/ppc: Populate CPUClass.mmu_index

2024-01-29 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/ppc/cpu_init.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c index 86c8031765..9931372a08 100644 --- a/target/ppc/cpu_init.c +++ b/target/ppc/cpu_init.c @@ -7105,6 +7105,11 @@ static bool

[PATCH 24/33] target/riscv: Populate CPUClass.mmu_index

2024-01-29 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/riscv/cpu.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 8cbfc7e781..be21fa09c6 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -867,6 +867,11 @@ static bool

[PATCH 00/33] hw/core: Introduce CPUClass hook for mmu_index

2024-01-29 Thread Richard Henderson
While the primary use of mmu_index is for the softmmu index for system-mode tcg, it has a secondary use in encoding cpu state for the page table walker, and thus depending on the target may also be used by memory_rw_debug with kvm et al. This is why I placed the hook in CPUClass not TCGCPUOps.

[PATCH 12/33] target/loongarch: Rename MMU_IDX_*

2024-01-29 Thread Richard Henderson
The expected form is MMU_FOO_IDX, not MMU_IDX_FOO. Rename to match generic code. Signed-off-by: Richard Henderson --- target/loongarch/cpu.h | 8 target/loongarch/cpu.c | 2 +- target/loongarch/tcg/tlb_helper.c

[PATCH 01/33] include/hw/core: Add mmu_index to CPUClass

2024-01-29 Thread Richard Henderson
To be used after all targets have populated the hook. Signed-off-by: Richard Henderson --- include/hw/core/cpu.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 2c284d6397..4385ce54c9 100644 --- a/include/hw/core/cpu.h +++

[PULL 20/31] accel/tcg: Rename tcg_ss[] -> tcg_specific_ss[] in meson

2024-01-29 Thread Richard Henderson
From: Philippe Mathieu-Daudé tcg_ss[] source set contains target-specific units. Rename it as 'tcg_specific_ss[]' for clarity. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Anton Johansson Message-Id: <20240124101639.30056-2-phi...@linaro.org>

[PULL 30/31] accel/tcg: Introduce TCGCPUOps::cpu_exec_halt() handler

2024-01-29 Thread Richard Henderson
From: Philippe Mathieu-Daudé In order to make accel/tcg/ target agnostic, introduce the cpu_exec_halt() handler. Reviewed-by: Anton Johansson Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20240124101639.30056-9-phi...@linaro.org> Signed-off-by: Richard

[PULL 23/31] accel/tcg: Un-inline icount_exit_request() for clarity

2024-01-29 Thread Richard Henderson
From: Philippe Mathieu-Daudé Convert packed logic to dumb icount_exit_request() helper. No functional change intended. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Anton Johansson Message-Id: <20240124101639.30056-5-phi...@linaro.org> Signed-off-by:

  1   2   3   4   >