Re: [RFC PATCH 1/4] target/riscv/kvm: add software breakpoints support

2024-04-18 Thread Chao Du
On 2024-04-16 17:23, Daniel Henrique Barboza wrote: > > On 12/21/23 06:49, Chao Du wrote: > > This patch implements insert/remove software breakpoint process: > > > > Add an input parameter for kvm_arch_insert_sw_breakpoint() and > > kvm_arch_remove_sw_breakpoint() to pass the length

Re: [PATCH] virtio-pci: Fix the failure process in kvm_virtio_pci_vector_use_one()

2024-04-18 Thread Cindy Lu
On Wed, Apr 17, 2024 at 2:38 AM Michael S. Tsirkin wrote: > > On Tue, Apr 16, 2024 at 02:14:57PM +0100, Peter Maydell wrote: > > On Tue, 16 Apr 2024 at 13:41, Cindy Lu wrote: > > > > > > On Tue, Apr 16, 2024 at 8:30 PM Peter Maydell > > > wrote: > > > > > > > > On Tue, 16 Apr 2024 at 13:29,

Re: [PATCH] vhost-user-test: no set non-blocking for cal fd less than 0.

2024-04-18 Thread Thomas Huth
On 11/04/2024 09.35, Yuxue Liu yuxue@jaguarmicro.com wrote: From: Yuxue Liu In the scenario where vhost-user sets eventfd to -1, qemu_chr_fe_get_msgfds retrieves fd as -1. When vhost_user_read receives, it does not perform blocking operations on the descriptor with fd=-1, so non-blocking

Re: [PATCH 3/3] hw/cxl/cxl-cdat: Make cxl_doe_cdat_init() return boolean

2024-04-18 Thread Philippe Mathieu-Daudé
On 18/4/24 12:04, Zhao Liu wrote: From: Zhao Liu As error.h suggested, the best practice for callee is to return something to indicate success / failure. With returned boolean, there's no need to dereference @errp to check failure case. Suggested-by: Markus Armbruster Signed-off-by: Zhao

Re: [PATCH 0/3] hw/cxl/cxl-cdat: Make cxl_doe_cdat_init() return boolean

2024-04-18 Thread Philippe Mathieu-Daudé
On 18/4/24 12:04, Zhao Liu wrote: From: Zhao Liu --- Zhao Liu (3): hw/cxl/cxl-cdat: Make ct3_load_cdat() return boolean hw/cxl/cxl-cdat: Make ct3_build_cdat() return boolean hw/cxl/cxl-cdat: Make cxl_doe_cdat_init() return boolean Series: Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH RFC 00/26] Multifd  device state transfer support with VFIO consumer

2024-04-18 Thread Daniel P . Berrangé
On Thu, Apr 18, 2024 at 11:50:12AM +0200, Maciej S. Szmigiero wrote: > On 17.04.2024 18:35, Daniel P. Berrangé wrote: > > On Wed, Apr 17, 2024 at 02:11:37PM +0200, Maciej S. Szmigiero wrote: > > > On 17.04.2024 10:36, Daniel P. Berrangé wrote: > > > > On Tue, Apr 16, 2024 at 04:42:39PM +0200,

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

2024-04-18 Thread Peter Maydell
Temir: yeah, this was our fault, apologies for not responding. Michael, David, Raphael -- looks like we unfortunately lost track of this patchset -- could one of you have a look and review it, please? thanks -- PMM On Sun, 4 Feb 2024 at 09:42, Тимур wrote: > > Hello, I am very sorry for

Re: [PATCH 0/3] hw/cxl/cxl-cdat: Make cxl_doe_cdat_init() return boolean

2024-04-18 Thread Jonathan Cameron via
On Thu, 18 Apr 2024 14:06:39 +0200 Philippe Mathieu-Daudé wrote: > On 18/4/24 12:04, Zhao Liu wrote: > > From: Zhao Liu > > > > --- > > Zhao Liu (3): > >hw/cxl/cxl-cdat: Make ct3_load_cdat() return boolean > >hw/cxl/cxl-cdat: Make ct3_build_cdat() return boolean > >

[RFC PATCH 2/3] target/riscv: add Ssdbltrp extension support

2024-04-18 Thread Clément Léger
The Ssdbltrp extension allows handling trap when being in non-reentrant state (mainly during exception handling) for S-mode [1]. This patch add support for this extension as an experimental extension. Link: https://github.com/riscv/riscv-double-trap/releases/download/v0.56/riscv-double-trap.pdf

[RFC PATCH 0/3] target/riscv: Add support for Smdbltrp and Ssdbltrp extensions

2024-04-18 Thread Clément Léger
A double trap typically arises during a sensitive phase in trap handling operations — when an exception or interrupt occurs while the trap handler (the component responsible for managing these events) is in a non-reentrant state. This non-reentrancy usually occurs in the early phase of trap

[PATCH 2/3] hw/cxl/cxl-cdat: Make ct3_build_cdat() return boolean

2024-04-18 Thread Zhao Liu
From: Zhao Liu As error.h suggested, the best practice for callee is to return something to indicate success / failure. So make ct3_build_cdat() return boolean, and this is the preparation for cxl_doe_cdat_init() returning boolean. Suggested-by: Markus Armbruster Signed-off-by: Zhao Liu ---

[PATCH 0/3] hw/cxl/cxl-cdat: Make cxl_doe_cdat_init() return boolean

2024-04-18 Thread Zhao Liu
From: Zhao Liu Hi list, This series is the followup of the previous fix [1] to improve the error handling. As error.h suggested, the best practice for callee is to return something to indicate success / failure instead of dereferencing @errp. Thus make cxl_doe_cdat_init() as well as

Re: [PATCH RFC 00/26] Multifd  device state transfer support with VFIO consumer

2024-04-18 Thread Maciej S. Szmigiero
On 17.04.2024 18:35, Daniel P. Berrangé wrote: On Wed, Apr 17, 2024 at 02:11:37PM +0200, Maciej S. Szmigiero wrote: On 17.04.2024 10:36, Daniel P. Berrangé wrote: On Tue, Apr 16, 2024 at 04:42:39PM +0200, Maciej S. Szmigiero wrote: From: "Maciej S. Szmigiero" VFIO device state transfer is

Re: [PATCH v5 3/3] Add support for RAPL MSRs in KVM/Qemu

2024-04-18 Thread Anthony Harivel
Hi Zhao, Zhao Liu, Apr 17, 2024 at 12:07: > Hi Anthony, > > May I ask what your usage scenario is? Is it to measure Guest's energy > consumption and to charged per watt consumed? ;-) See previous email from Daniel. > On Thu, Apr 11, 2024 at 02:14:34PM +0200, Anthony Harivel wrote: > > Date:

Re: [PATCH] accel/tcg/icount-common: Consolidate the use of warn_report_once()

2024-04-18 Thread Paolo Bonzini
Queued, thanks. Paolo

Re: [PATCH 09/21] semihosting/uaccess: Avoid including 'cpu.h'

2024-04-18 Thread Philippe Mathieu-Daudé
On 17/4/24 21:14, Richard Henderson wrote: On 4/17/24 11:27, Philippe Mathieu-Daudé wrote: "semihosting/uaccess.h" only requires declarations from "exec/cpu-defs.h". Avoid including the huge "cpu.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id:

Re: [RFC PATCH v2 04/13] hw/arm/smmuv3: Translate CD and TT using stage-2 table

2024-04-18 Thread Eric Auger
Hi Mostafa, On 4/8/24 16:08, Mostafa Saleh wrote: > According to the user manual (ARM IHI 0070 F.b), s/user manual/ARM SMMU architecture specification > In "5.2 Stream Table Entry": > [51:6] S1ContextPtr > If Config[1] == 1 (stage 2 enabled), this pointer is an IPA translated by > stage 2 and

[PATCH] tcg: Fix the overflow in indexing tcg_ctx->temps

2024-04-18 Thread Zhiwei Jiang
Sometimes, when the address of the passed TCGTemp *ts variable is the same as tcg_ctx, the index calculated in the temp_idx function, i.e., ts - tcg_ctx->temps, can result in a particularly large value, causing overflow in the subsequent array access. 0 0x7f79590132ac in test_bit (addr=,

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

2024-04-18 Thread Daniel P . Berrangé
On Sat, Jan 13, 2024 at 04:27:40AM +0300, Temir Zharaspayev wrote: > When zero-copy usage of indirect descriptors buffer table isn't > possible, library gather scattered memory chunks in a local copy. > This commit fixes the issue with pointer arithmetic for the local copy > buffer. > >

Re: [PATCH] migration: do not exit on incoming failure

2024-04-18 Thread Fabiano Rosas
Vladimir Sementsov-Ogievskiy writes: > We do set MIGRATION_FAILED state, but don't give a chance to > orchestrator to query migration state and get the error. > > Let's report an error through QAPI like we do on outgoing migration. > > migration-test is updated correspondingly. > >

[PATCH 1/3] hw/cxl/cxl-cdat: Make ct3_load_cdat() return boolean

2024-04-18 Thread Zhao Liu
From: Zhao Liu As error.h suggested, the best practice for callee is to return something to indicate success / failure. So make ct3_load_cdat() return boolean, and this is the preparation for cxl_doe_cdat_init() returning boolean. Suggested-by: Markus Armbruster Signed-off-by: Zhao Liu ---

[PATCH 3/3] hw/cxl/cxl-cdat: Make cxl_doe_cdat_init() return boolean

2024-04-18 Thread Zhao Liu
From: Zhao Liu As error.h suggested, the best practice for callee is to return something to indicate success / failure. With returned boolean, there's no need to dereference @errp to check failure case. Suggested-by: Markus Armbruster Signed-off-by: Zhao Liu --- hw/cxl/cxl-cdat.c

[PATCH] pythondeps.toml: warn about updates needed to docs/requirements.txt

2024-04-18 Thread Paolo Bonzini
docs/requirements.txt is expected by readthedocs and should be in sync with pythondeps.toml. Add a comment to both. Signed-off-by: Paolo Bonzini --- docs/requirements.txt | 3 +++ pythondeps.toml | 1 + 2 files changed, 4 insertions(+) diff --git a/docs/requirements.txt

[PATCH v3 08/13] Remove glib compatibility code that is not required anymore

2024-04-18 Thread Thomas Huth
Now that we bumped the minumum glib version to 2.66, we can drop the old code. Suggested-by: Paolo Bonzini Reviewed-by: Daniel P. Berrangé Signed-off-by: Thomas Huth --- qga/commands-posix-ssh.c | 8 util/error-report.c | 10 -- 2 files changed, 18 deletions(-) diff

[PATCH v3 11/13] block/nfs: Use URI parsing code from glib

2024-04-18 Thread Thomas Huth
Since version 2.66, glib has useful URI parsing functions, too. Use those instead of the QEMU-internal ones to be finally able to get rid of the latter. While we're at it, slightly rephrase one of the error messages: Use "Invalid value..." instead of "Illegal value..." since the latter rather

[PATCH v3 09/13] block/gluster: Use URI parsing code from glib

2024-04-18 Thread Thomas Huth
Since version 2.66, glib has useful URI parsing functions, too. Use those instead of the QEMU-internal ones to be finally able to get rid of the latter. Since g_uri_get_path() returns a const pointer, we also need to tweak the parameter of parse_volume_options() (where we use the result of

[PATCH v3 03/13] tests/docker/dockerfiles: Run lcitool-refresh after the lcitool update

2024-04-18 Thread Thomas Huth
This update adds the removing of the EXTERNALLY-MANAGED marker files that has been added to the lcitool recently. Quoting Daniel: "For those who don't know, python now commonly blocks the ability to run 'pip install' outside of a venv. This generally makes sense for a precious installation

[PATCH v3 02/13] tests/lcitool/libvirt-ci: Update to the latest master branch

2024-04-18 Thread Thomas Huth
We need the latest fixes for the lcitool to be able to properly update our CentOS docker file to CentOS Stream 9. Reviewed-by: Daniel P. Berrangé Signed-off-by: Thomas Huth --- tests/lcitool/libvirt-ci | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/lcitool/libvirt-ci

[PATCH v3 12/13] block/ssh: Use URI parsing code from glib

2024-04-18 Thread Thomas Huth
Since version 2.66, glib has useful URI parsing functions, too. Use those instead of the QEMU-internal ones to be finally able to get rid of the latter. While we're at it, also emit a warning when encountering unknown parameters in the URI, so that the users have a chance to detect their typos or

[PATCH v3 05/13] .travis.yml: Update the jobs to Ubuntu 22.04

2024-04-18 Thread Thomas Huth
According to our support policy, we'll soon drop our official support for Ubuntu 20.04 ("Focal Fossa") in QEMU. Thus we should update the Travis jobs now to a newer release (Ubuntu 22.04 - "Jammy Jellyfish") for future testing. Since all jobs are using this release now, we can drop the entries

[PATCH v3 06/13] ci: move external build environment setups to CentOS Stream 9

2024-04-18 Thread Thomas Huth
From: Paolo Bonzini RHEL 9 (and thus also the derivatives) are available since two years now, so according to QEMU's support policy, we can drop the active support for the previous major version 8 now. Thus upgrade our CentOS Stream build environment playbooks to major version 9 now.

Re: [RFC PATCH v2 05/13] hw/arm/smmu-common: Support nested translation

2024-04-18 Thread Eric Auger
Hi Mostafa, On 4/8/24 16:08, Mostafa Saleh wrote: > When nested translation is requested, do the following: > > - Translate stage-1 IPA using stage-2 to a physical address. > - Translate stage-1 PTW walks using stage-2. > - Combine both to create a single TLB entry, for that we choose > the

Re: [PATCH 13/21] accel/tcg: Un-inline retaddr helpers to 'user-retaddr.h'

2024-04-18 Thread Philippe Mathieu-Daudé
On 17/4/24 21:30, Richard Henderson wrote: On 4/17/24 11:27, Philippe Mathieu-Daudé wrote: set_helper_retaddr() is only used in accel/tcg/user-exec.c. clear_helper_retaddr() is only used in accel/tcg/user-exec.c Here should be "accel/tcg/cpu-exec.c", fixed. and accel/tcg/user-exec.c.

Re: [PATCH RFC v3 00/49] Add AMD Secure Nested Paging (SEV-SNP) support

2024-04-18 Thread Ani Sinha
> On 20 Mar 2024, at 14:08, Michael Roth wrote: > > These patches implement SEV-SNP base support along with CPUID enforcement > support for QEMU, and are also available at: > > https://github.com/amdese/qemu/commits/snp-v3-rfc > > they are based on top of the following patchset from Paolo:

Re: Deprecation/removal of nios2 target support

2024-04-18 Thread Marek Vasut
On 4/18/24 7:53 AM, Thomas Huth wrote: On 18/04/2024 05.27, Sandra Loosemore wrote: Tomorrow I plan to push patches to mark the nios2 target as obsolete in GCC 14. Background: Intel has EOL'ed the Nios II processor IP and is now directing their FPGA customers to a RISC-V platform instead.

Re: [PATCH-for-9.1 v2 2/3] target/nios2: Remove the deprecated Nios II target

2024-04-18 Thread Marek Vasut
On 4/18/24 1:10 PM, Philippe Mathieu-Daudé wrote: On 27/3/24 15:48, Philippe Mathieu-Daudé wrote: The Nios II target is deprecated since v8.2 in commit 9997771bc1 ("target/nios2: Deprecate the Nios II architecture"). Remove: - Buildsys / CI infra - User emulation - System emulation (10m50-ghrd

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

2024-04-18 Thread Daniel P . Berrangé
Adding Michael back to the CC, since he's the designated maintainer for libvhost-user/ Michael, could you give these patches a review since they've been pending for many months now. On Sun, Feb 04, 2024 at 12:41:31PM +0300, Тимур wrote: > Hello, I am very sorry for bothering community on a such

Re: [PATCH v3 2/2] cxl/core: add poison creation event handler

2024-04-18 Thread Shiyang Ruan via
在 2024/4/18 1:30, Dave Jiang 写道: On 4/17/24 12:50 AM, Shiyang Ruan wrote: Currently driver only traces cxl events, poison creation (for both vmem and pmem type) on cxl memdev is silent. OS needs to be notified then it could handle poison pages in time. Per CXL spec, the device error

Re: Hermetic virtio-vsock in QEMU

2024-04-18 Thread Daniel P . Berrangé
On Wed, Apr 17, 2024 at 12:31:41PM -0700, Roman Kiryanov wrote: > Hi Daniel, > > thank you for looking into this. I checked how VHOST_USER_VSOCK and it > refers to the vhost-user protocol. It is implemented in the > subprojects/libvhost-user library, but this library depends on poll.h > and

[PATCH] accel/tcg/icount-common: Consolidate the use of warn_report_once()

2024-04-18 Thread Zhao Liu
From: Zhao Liu Use warn_report_once() to get rid of the static local variable "notified". Signed-off-by: Zhao Liu --- Note: After cleaning up similar uses in x86, only icount-common.c and virtio-mem.c still have "only once" usage with static variables. However, virtio-mem.c uses

Re: [PATCH-for-9.1 v2 2/3] target/nios2: Remove the deprecated Nios II target

2024-04-18 Thread Philippe Mathieu-Daudé
On 27/3/24 15:48, Philippe Mathieu-Daudé wrote: The Nios II target is deprecated since v8.2 in commit 9997771bc1 ("target/nios2: Deprecate the Nios II architecture"). Remove: - Buildsys / CI infra - User emulation - System emulation (10m50-ghrd & nios2-generic-nommu machines) - Tests Cc: Marek

[PATCH v3 04/13] tests: Update our CI to use CentOS Stream 9 instead of 8

2024-04-18 Thread Thomas Huth
RHEL 9 (and thus also the derivatives) are available since two years now, so according to QEMU's support policy, we can drop the active support for the previous major version 8 now. Another reason for doing this is that Centos Stream 8 will go EOL soon:

[PATCH v3 13/13] util/uri: Remove the old URI parsing code

2024-04-18 Thread Thomas Huth
Now that we switched all consumers of the URI code to use the URI parsing functions from glib instead, we can remove our internal URI parsing code since it is not used anymore. Reviewed-by: Eric Blake Signed-off-by: Thomas Huth --- include/qemu/uri.h | 99 --- util/uri.c | 1466

[PATCH v3 07/13] Bump minimum glib version to v2.66

2024-04-18 Thread Thomas Huth
Now that we dropped support for CentOS 8 and Ubuntu 20.04, we can look into bumping the glib version to a new minimum for further clean-ups. According to repology.org, available versions are: CentOS Stream 9: 2.66.7 Debian 11: 2.66.8 Fedora 38: 2.74.1 Freebsd:

[PATCH v3 00/13] Drop old distros, bump glib and switch to glib URI parsing code

2024-04-18 Thread Thomas Huth
In the QEMU 9.1 development cycle, we can drop the support for Ubuntu 20.04 and CentOS 8 since the following major versions of these distributions are available since 2 years already. This allows us to bump the minimum version of glib to 2.66 which comes with a nice set of URI parsing functions.

[PATCH v3 01/13] tests: Remove Ubuntu 20.04 container

2024-04-18 Thread Thomas Huth
Since Ubuntu 22.04 is now available since two years, we can stop actively supporting the previous LTS version of Ubuntu now. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Thomas Huth --- tests/docker/dockerfiles/ubuntu2004.docker | 157 - tests/lcitool/refresh

[PATCH v3 10/13] block/nbd: Use URI parsing code from glib

2024-04-18 Thread Thomas Huth
Since version 2.66, glib has useful URI parsing functions, too. Use those instead of the QEMU-internal ones to be finally able to get rid of the latter. The g_uri_get_host() also takes care of removing the square brackets from IPv6 addresses, so we can drop that part of the QEMU code now, too.

Re: [PATCH 3/3] hw/cxl/cxl-cdat: Make cxl_doe_cdat_init() return boolean

2024-04-18 Thread Zhao Liu
Hi Philippe, On Thu, Apr 18, 2024 at 02:06:15PM +0200, Philippe Mathieu-Daudé wrote: [snip] > > diff --git a/include/hw/cxl/cxl_component.h b/include/hw/cxl/cxl_component.h > > index 5012fab6f763..945ee6ffd045 100644 > > --- a/include/hw/cxl/cxl_component.h > > +++

[RFC PATCH 3/3] target/riscv: add Smdbltrp extension support

2024-04-18 Thread Clément Léger
The Smdbltrp extension allows to generate M-mode targeted double trap exceptions [1]. Such exceptions are generated if a trap is taken while mstatus.sdt is set to 1. The specification states that if the Smnrmi extension is implemented, then the hart enters a critical-error state and generate a

[RFC PATCH 1/3] target/riscv: change RISCV_EXCP_SEMIHOST exception number

2024-04-18 Thread Clément Léger
The double trap specification defines the double trap exception number to be 16 which is actually used by the internal semihosting one. Change it to some other value. Signed-off-by: Clément Léger --- target/riscv/cpu_bits.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

Re: [PATCH] migration: do not exit on incoming failure

2024-04-18 Thread Daniel P . Berrangé
On Thu, Apr 18, 2024 at 01:13:29AM +0300, Vladimir Sementsov-Ogievskiy wrote: > We do set MIGRATION_FAILED state, but don't give a chance to > orchestrator to query migration state and get the error. > > Let's report an error through QAPI like we do on outgoing migration. > > migration-test is

Re: [RFC PATCH v2 06/13] hw/arm/smmu: Support nesting in smmuv3_range_inval()

2024-04-18 Thread Eric Auger
Hi Mostafa, On 4/8/24 16:08, Mostafa Saleh wrote: > With nesting, we would need to invalidate IPAs without > over-invalidating stage-1 IOVAs. This can be done by > distinguishing IPAs in the TLBs by having ASID=-1. > To achieve that, rework the invalidation for IPAs to have a > separate function,

Re: [PATCH] migration: do not exit on incoming failure

2024-04-18 Thread Daniel P . Berrangé
On Thu, Apr 18, 2024 at 06:40:38PM +0300, Vladimir Sementsov-Ogievskiy wrote: > On 18.04.24 17:37, Daniel P. Berrangé wrote: > > On Thu, Apr 18, 2024 at 01:13:29AM +0300, Vladimir Sementsov-Ogievskiy > > wrote: > > > We do set MIGRATION_FAILED state, but don't give a chance to > > > orchestrator

[PATCH 2/2] accel/tcg: Rename load-extract/store-insert headers using .h.inc suffix

2024-04-18 Thread Philippe Mathieu-Daudé
Since commit 139c1837db ("meson: rename included C source files to .c.inc"), QEMU standard procedure for included C files is to use *.c.inc. Besides, since commit 6a0057aa22 ("docs/devel: make a statement about includes") this is documented in the Coding Style: If you do use template header

[PATCH 1/2] hw/elf_ops: Rename elf_ops.h -> elf_ops.h.inc

2024-04-18 Thread Philippe Mathieu-Daudé
Since commit 139c1837db ("meson: rename included C source files to .c.inc"), QEMU standard procedure for included C files is to use *.c.inc. Besides, since commit 6a0057aa22 ("docs/devel: make a statement about includes") this is documented in the Coding Style: If you do use template header

Re: [PATCH v3 08/16] aspeed/smc: support 64 bits dma dram address

2024-04-18 Thread Cédric Le Goater
Hello Jamin, On 4/16/24 11:18, Jamin Lin wrote: AST2700 support the maximum dram size is 8GiB and has a "DMA DRAM Side Address High Part(0x7C)" register to support 64 bits dma dram address. Add helper routines functions to compute the dma dram address, new features and update trace-event to

[PATCH 0/2] include: Rename some expanded headers using '.h.inc' suffix

2024-04-18 Thread Philippe Mathieu-Daudé
Per our Coding Style: If you do use template header files they should be named with the ``.c.inc`` or ``.h.inc`` suffix to make it clear they are being included for expansion. Rename elf_ops.h and host/load-extract/store-insert headers. Philippe Mathieu-Daudé (2): hw/elf_ops: Rename

Re: [PATCH v5 3/3] Add support for RAPL MSRs in KVM/Qemu

2024-04-18 Thread Daniel P . Berrangé
On Thu, Apr 11, 2024 at 02:14:34PM +0200, Anthony Harivel wrote: > Starting with the "Sandy Bridge" generation, Intel CPUs provide a RAPL > interface (Running Average Power Limit) for advertising the accumulated > energy consumption of various power domains (e.g. CPU packages, DRAM, > etc.). > >

Re: [PATCH] migration: do not exit on incoming failure

2024-04-18 Thread Peter Xu
On Thu, Apr 18, 2024 at 06:47:31PM +0300, Vladimir Sementsov-Ogievskiy wrote: > On 18.04.24 18:43, Daniel P. Berrangé wrote: > > On Thu, Apr 18, 2024 at 06:40:38PM +0300, Vladimir Sementsov-Ogievskiy > > wrote: > > > On 18.04.24 17:37, Daniel P. Berrangé wrote: > > > > On Thu, Apr 18, 2024 at

Re: Deprecation/removal of nios2 target support

2024-04-18 Thread Jeff Law
On 4/18/24 9:57 AM, Joel Sherrill wrote: On Thu, Apr 18, 2024 at 10:46 AM Joseph Myers > wrote: On Wed, 17 Apr 2024, Sandra Loosemore wrote: > Therefore I'd like to mark Nios II as obsolete in GCC 14 now, and remove > support from all

Re: Deprecation/removal of nios2 target support

2024-04-18 Thread Joseph Myers
On Wed, 17 Apr 2024, Sandra Loosemore wrote: > Therefore I'd like to mark Nios II as obsolete in GCC 14 now, and remove > support from all toolchain components after the release is made. I'm not sure > there is an established process for obsoleting/removing support in other > components; besides

Re: Deprecation/removal of nios2 target support

2024-04-18 Thread Joel Sherrill
On Thu, Apr 18, 2024 at 10:46 AM Joseph Myers wrote: > On Wed, 17 Apr 2024, Sandra Loosemore wrote: > > > Therefore I'd like to mark Nios II as obsolete in GCC 14 now, and remove > > support from all toolchain components after the release is made. I'm > not sure > > there is an established

[Stable-8.2.3 v2 000/116] Patch Round-up for stable 8.2.3, freeze on 2024-04-20

2024-04-18 Thread Michael Tokarev
The following patches are queued for QEMU stable v8.2.3: https://gitlab.com/qemu-project/qemu/-/commits/staging-8.2 Patch freeze is 2024-04-20, and the release is planned for 2024-04-22: https://wiki.qemu.org/Planning/8.2 Please respond here or CC qemu-sta...@nongnu.org on any additional

[Stable-8.2.3 104/116] hw/misc/applesmc: Fix memory leak in reset() handler

2024-04-18 Thread Michael Tokarev
From: Philippe Mathieu-Daudé AppleSMCData is allocated with g_new0() in applesmc_add_key(): release it with g_free(). Leaked since commit 1ddda5cd36 ("AppleSMC device emulation"). Cc: qemu-sta...@nongnu.org Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2272 Reported-by: Zheyu Ma

[Stable-8.2.3 108/116] hw/sd/sdhci: Do not update TRNMOD when Command Inhibit (DAT) is set

2024-04-18 Thread Michael Tokarev
From: Philippe Mathieu-Daudé Per "SD Host Controller Standard Specification Version 3.00": * 2.2.5 Transfer Mode Register (Offset 00Ch) Writes to this register shall be ignored when the Command Inhibit (DAT) in the Present State register is 1. Do not update the TRNMOD register when

[Stable-8.2.3 093/116] target/sh4: Fix mac.w with saturation enabled

2024-04-18 Thread Michael Tokarev
From: Zack Buhman The saturation arithmetic logic in helper_macw is not correct. I tested and verified this behavior on a SH7091. Reviewd-by: Yoshinori Sato Signed-off-by: Zack Buhman Message-Id: <20240405233802.29128-3-z...@buhman.org> [rth: Reformat helper_macw, add a test case.]

[Stable-8.2.3 106/116] hw/net/lan9118: Replace magic '2048' value by MIL_TXFIFO_SIZE definition

2024-04-18 Thread Michael Tokarev
From: Philippe Mathieu-Daudé The magic 2048 is explained in the LAN9211 datasheet (DS2414A) in chapter 1.4, "10/100 Ethernet MAC": The MAC Interface Layer (MIL), within the MAC, contains a 2K Byte transmit and a 128 Byte receive FIFO which is separate from the TX and RX FIFOs. [...]

[Stable-8.2.3 103/116] hw/block/nand: Fix out-of-bound access in NAND block buffer

2024-04-18 Thread Michael Tokarev
From: Philippe Mathieu-Daudé nand_command() and nand_getio() don't check @offset points into the block, nor the available data length (s->iolen) is not negative. In order to fix: - check the offset is in range in nand_blk_load_NAND_PAGE_SIZE(), - do not set @iolen if blk_load() failed.

[Stable-8.2.3 100/116] qemu-options: Fix CXL Fixed Memory Window interleave-granularity typo

2024-04-18 Thread Michael Tokarev
From: Yuquan Wang Fix the unit typo of interleave-granularity of CXL Fixed Memory Window in qemu-option.hx. Fixes: 03b39fcf64 ("hw/cxl: Make the CFMW a machine parameter.") Signed-off-by: Yuquan Wang wangyuquan1...@phytium.com.cn Message-ID:

[Stable-8.2.3 105/116] backends/cryptodev: Do not abort for invalid session ID

2024-04-18 Thread Michael Tokarev
From: Philippe Mathieu-Daudé Instead of aborting when a session ID is invalid, return VIRTIO_CRYPTO_INVSESS ("Invalid session id"). Reproduced using: $ cat << EOF | qemu-system-i386 -display none \ -machine q35,accel=qtest -m 512M -nodefaults \ -object

Re: [PATCH v6 10/12] hw/mem/cxl_type3: Add dpa range validation for accesses to DC regions

2024-04-18 Thread Gregory Price
On Wed, Apr 17, 2024 at 12:59:51PM +0100, Jonathan Cameron wrote: > On Tue, 16 Apr 2024 09:37:09 -0700 > fan wrote: > > > > > Currently, we do not allow releasing an extent when it is still pending, > > which aligns with the case you mentioned above "not release for reuse", I > > think. > > Can

[PATCH 02/24] exec: Declare CPUBreakpoint/CPUWatchpoint type in 'breakpoint.h' header

2024-04-18 Thread Philippe Mathieu-Daudé
The CPUBreakpoint and CPUWatchpoint structures are declared in "hw/core/cpu.h", which contains declarations related to CPUState and CPUClass. Some source files only require the BP/WP definitions and don't need to pull in all CPU* API. In order to simplify, create a new "exec/breakpoint.h" header.

[PATCH 00/24] include/exec: Rework (part 2)

2024-04-18 Thread Philippe Mathieu-Daudé
Reordering exec/, second round. Mostly splitting: - TCG LDST API (to "exec/cpu_ldst.h") - CPU TLB APIs (to "exec/cputlb.h") from "exec/cpu-all.h" and "exec/exec-all.h", and reducing inclusions of "hw/core/cpu.h". Based-on: <20240417182806.69446-1-phi...@linaro.org> or

Re: [PATCH] tcg: Fix the overflow in indexing tcg_ctx->temps

2024-04-18 Thread Richard Henderson
On 4/18/24 03:27, Zhiwei Jiang wrote: Sometimes, when the address of the passed TCGTemp *ts variable is the same as tcg_ctx, Pardon? When would TCGTemp *ts == TCGContext *tcg_ctx? the index calculated in the temp_idx function, i.e., ts - tcg_ctx->temps, can result in a particularly large

Re: [PATCH 2/5] target/arm: Enable FEAT_CSV2_3 for -cpu max

2024-04-18 Thread Philippe Mathieu-Daudé
On 18/4/24 17:20, Peter Maydell wrote: FEAT_CSV2_3 adds a mechanism to identify if hardware cannot disclose information about whether branch targets and branch history trained in one hardware described context can control speculative execution in a different hardware context. There is no branch

Re: [PATCH] migration: do not exit on incoming failure

2024-04-18 Thread Daniel P . Berrangé
On Thu, Apr 18, 2024 at 12:43:42PM -0400, Peter Xu wrote: > On Thu, Apr 18, 2024 at 06:47:31PM +0300, Vladimir Sementsov-Ogievskiy wrote: > > On 18.04.24 18:43, Daniel P. Berrangé wrote: > > > On Thu, Apr 18, 2024 at 06:40:38PM +0300, Vladimir Sementsov-Ogievskiy > > > wrote: > > > > On 18.04.24

Re: [PATCH v5 3/3] Add support for RAPL MSRs in KVM/Qemu

2024-04-18 Thread Anthony Harivel
Hi Daniel, Daniel P. Berrangé, Apr 18, 2024 at 18:42: > On Thu, Apr 11, 2024 at 02:14:34PM +0200, Anthony Harivel wrote: > > Starting with the "Sandy Bridge" generation, Intel CPUs provide a RAPL > > interface (Running Average Power Limit) for advertising the accumulated > > energy consumption

[Stable-8.2.3 095/116] target/m68k: Map FPU exceptions to FPSR register

2024-04-18 Thread Michael Tokarev
From: Keith Packard Add helpers for reading/writing the 68881 FPSR register so that changes in floating point exception state can be seen by the application. Call these helpers in pre_load/post_load hooks to synchronize exception state. Signed-off-by: Keith Packard Reviewed-by: Richard

[Stable-8.2.3 096/116] hw/virtio: Introduce virtio_bh_new_guarded() helper

2024-04-18 Thread Michael Tokarev
From: Philippe Mathieu-Daudé Introduce virtio_bh_new_guarded(), similar to qemu_bh_new_guarded() but using the transport memory guard, instead of the device one (there can only be one virtio device per virtio bus). Inspired-by: Gerd Hoffmann Reviewed-by: Gerd Hoffmann Acked-by: Michael S.

[Stable-8.2.3 090/116] target/sh4: mac.w: memory accesses are 16-bit words

2024-04-18 Thread Michael Tokarev
From: Zack Buhman Before this change, executing a code sequence such as: mova tblm,r0 movr0,r1 mova tbln,r0 clrs clrmac mac.w @r0+,@r1+ mac.w @r0+,@r1+ .align 4 tblm:.word 0x1234

[Stable-8.2.3 092/116] target/sh4: Fix mac.l with saturation enabled

2024-04-18 Thread Michael Tokarev
From: Zack Buhman The saturation arithmetic logic in helper_macl is not correct. I tested and verified this behavior on a SH7091. Signed-off-by: Zack Buhman Message-Id: <20240404162641.27528-2-z...@buhman.org> [rth: Reformat helper_macl, add a test case.] Signed-off-by: Richard Henderson

[Stable-8.2.3 098/116] hw/char/virtio-serial-bus: Protect from DMA re-entrancy bugs

2024-04-18 Thread Michael Tokarev
From: Philippe Mathieu-Daudé Replace qemu_bh_new_guarded() by virtio_bh_new_guarded() so the bus and device use the same guard. Otherwise the DMA-reentrancy protection can be bypassed. Fixes: CVE-2024-3446 Cc: qemu-sta...@nongnu.org Suggested-by: Alexander Bulekov Reviewed-by: Gerd Hoffmann

[Stable-8.2.3 107/116] hw/net/lan9118: Fix overflow in MIL TX FIFO

2024-04-18 Thread Michael Tokarev
From: Philippe Mathieu-Daudé When the MAC Interface Layer (MIL) transmit FIFO is full, truncate the packet, and raise the Transmitter Error (TXE) flag. Broken since model introduction in commit 2a42499017 ("LAN9118 emulation"). When using the reproducer from

[Stable-8.2.3 094/116] target/sh4: add missing CHECK_NOT_DELAY_SLOT

2024-04-18 Thread Michael Tokarev
From: Zack Buhman CHECK_NOT_DELAY_SLOT is correctly applied to the branch-related instructions, but not to the PC-relative mov* instructions. I verified the existence of an illegal slot exception on a SH7091 when any of these instructions are attempted inside a delay slot. This also matches

[Stable-8.2.3 102/116] hw/block/nand: Have blk_load() take unsigned offset and return boolean

2024-04-18 Thread Michael Tokarev
From: Philippe Mathieu-Daudé Negative offset is meaningless, use unsigned type. Return a boolean value indicating success. Reviewed-by: Richard Henderson Reviewed-by: Kevin Wolf Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20240409135944.24997-3-phi...@linaro.org> (cherry picked from

[Stable-8.2.3 091/116] target/sh4: Merge mach and macl into a union

2024-04-18 Thread Michael Tokarev
From: Richard Henderson Allow host access to the entire 64-bit accumulator. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson (cherry picked from commit 7d95db5e78a24d3315e3112d26909a7262355cb7) Signed-off-by: Michael Tokarev diff --git a/target/sh4/cpu.h

Re: [RFC PATCH v2 00/13] SMMUv3 nested translation support

2024-04-18 Thread Eric Auger
Hi Mostafa, On 4/8/24 16:08, Mostafa Saleh wrote: > Currently, QEMU supports emulating either stage-1 or stage-2 SMMUs > but not nested instances. > This patch series adds support for nested translation in SMMUv3, > this is controlled by property “arm-smmuv3.stage=nested”, and > advertised to

[PATCH 18/24] plugins: Include missing 'qemu/bitmap.h' header

2024-04-18 Thread Philippe Mathieu-Daudé
"qemu/plugin.h" uses DECLARE_BITMAP(), which is declared in "qemu/bitmap.h". Signed-off-by: Philippe Mathieu-Daudé --- include/qemu/plugin.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/qemu/plugin.h b/include/qemu/plugin.h index 12a96cea2a..41db748eda 100644 ---

[PATCH 12/24] exec: Move CPUTLBEntry helpers to cputlb.c

2024-04-18 Thread Philippe Mathieu-Daudé
The following CPUTLBEntry helpers are only used in accel/tcg/cputlb.c: - tlb_index() - tlb_entry() - tlb_read_idx() - tlb_addr_write() Move them to this file, allowing to remove the huge "cpu.h" header inclusion from "exec/cpu_ldst.h". Signed-off-by: Philippe Mathieu-Daudé ---

[PATCH 10/24] exec: Reduce tlb_set_dirty() declaration scope

2024-04-18 Thread Philippe Mathieu-Daudé
tlb_set_dirty() is only used in accel/tcg/cputlb.c, where it is defined. Declare it statically, removing the stub. Signed-off-by: Philippe Mathieu-Daudé --- include/exec/exec-all.h | 1 - accel/stubs/tcg-stub.c | 4 accel/tcg/cputlb.c | 2 +- 3 files changed, 1 insertion(+), 6

[PATCH 22/24] exec: Remove 'exec/tswap.h' from 'exec/cpu-all.h'

2024-04-18 Thread Philippe Mathieu-Daudé
"exec/cpu-all.h" doesn't require "exec/tswap.h". Remove it, including it in the sources when required. Signed-off-by: Philippe Mathieu-Daudé --- hw/xtensa/bootparam.h | 1 + include/exec/cpu-all.h | 1 - accel/tcg/translator.c | 1 + hw/arm/boot.c | 1 +

[PATCH 14/24] exec: Rename 'exec/user/guest-base.h' as 'user/guest-base.h'

2024-04-18 Thread Philippe Mathieu-Daudé
The include/user/ directory contains the user-emulation specific headers. Move guest-base.h there too. Signed-off-by: Philippe Mathieu-Daudé --- include/exec/cpu-all.h | 2 +- include/{exec => }/user/guest-base.h | 4 ++-- tcg/tcg.c| 2 +- 3 files

Re: [PATCH 02/24] exec: Declare CPUBreakpoint/CPUWatchpoint type in 'breakpoint.h' header

2024-04-18 Thread Philippe Mathieu-Daudé
On 18/4/24 21:25, Philippe Mathieu-Daudé wrote: The CPUBreakpoint and CPUWatchpoint structures are declared in "hw/core/cpu.h", which contains declarations related to CPUState and CPUClass. Some source files only require the BP/WP definitions and don't need to pull in all CPU* API. In order to

[PATCH 24/24] exec: Remove unnecessary inclusions of 'hw/core/cpu.h'

2024-04-18 Thread Philippe Mathieu-Daudé
When "hw/core/cpu.h" is not required, remove it. Signed-off-by: Philippe Mathieu-Daudé --- include/exec/cpu-all.h| 1 - include/exec/cpu-defs.h | 1 - include/hw/boards.h | 1 - include/hw/ppc/openpic.h | 1 - include/sysemu/hw_accel.h | 1 - 5 files changed, 5 deletions(-) diff

[PATCH 21/24] plugins: Un-inline qemu_plugin_disable_mem_helpers()

2024-04-18 Thread Philippe Mathieu-Daudé
"qemu/plugin.h" only include the huge "hw/core/cpu.h" because qemu_plugin_disable_mem_helpers() accesses CPUState::plugin_mem_cbs. In order to avoid including it, un-inline qemu_plugin_disable_mem_helpers(). Signed-off-by: Philippe Mathieu-Daudé --- include/qemu/plugin.h | 6 +-

[PATCH 19/24] gdbstub: Avoid including 'cpu.h' in 'gdbstub/helpers.h'

2024-04-18 Thread Philippe Mathieu-Daudé
We only need the "exec/tswap.h" and "cpu-param.h" headers. Only include "cpu.h" in the target gdbstub.c source files. Signed-off-by: Philippe Mathieu-Daudé --- include/gdbstub/helpers.h | 3 ++- target/avr/gdbstub.c | 1 + target/tricore/gdbstub.c | 1 + 3 files changed, 4 insertions(+),

Re: [PATCH] vhost-user-test: no set non-blocking for cal fd less than 0.

2024-04-18 Thread Michael S. Tsirkin
On Thu, Apr 11, 2024 at 03:35:55PM +0800, Yuxue Liu yuxue@jaguarmicro.com wrote: > From: Yuxue Liu > > In the scenario where vhost-user sets eventfd to -1, > qemu_chr_fe_get_msgfds retrieves fd as -1. When vhost_user_read > receives, it does not perform blocking operations on the descriptor

Re: [PATCH 6/7] target/i386: Introduce cpu_compute_eflags_ccop

2024-04-18 Thread Pierrick Bouvier
On 4/15/24 21:06, Richard Henderson wrote: This is a generalization of cpu_compute_eflags, with a dynamic value of cc_op, and is thus tcg specific. Signed-off-by: Richard Henderson --- target/i386/cpu.h | 2 ++ target/i386/tcg/cc_helper.c | 10 ++ 2 files changed, 12

Re: [PATCH 7/7] target/i386: Implement TCGCPUOps for plugin register reads

2024-04-18 Thread Pierrick Bouvier
On 4/15/24 21:06, Richard Henderson wrote: Signed-off-by: Richard Henderson --- target/i386/tcg/tcg-cpu.c | 72 ++- 1 file changed, 56 insertions(+), 16 deletions(-) diff --git a/target/i386/tcg/tcg-cpu.c b/target/i386/tcg/tcg-cpu.c index

Re: [PATCH 5/7] target/i386: Split out gdb-internal.h

2024-04-18 Thread Pierrick Bouvier
On 4/15/24 21:06, Richard Henderson wrote: Signed-off-by: Richard Henderson --- target/i386/gdb-internal.h | 65 ++ target/i386/gdbstub.c | 1 + 2 files changed, 66 insertions(+) create mode 100644 target/i386/gdb-internal.h diff --git

  1   2   3   >