Re: [RFC PATCH 0/4] hw/i386: Factor out PXB parts of DSDT into an SSDT table

2023-04-07 Thread Michael S. Tsirkin
On Thu, Apr 06, 2023 at 11:25:47AM +0100, Jonathan Cameron wrote: > On Fri, 17 Mar 2023 16:54:36 + > Jonathan Cameron via wrote: > > > Michael Tsirkin raised that we have recently had churn in the > > bios-tables-test > > and perhaps it was worth factoring some parts of DSDT out as SSDT file

Re: [RFC PATCH v2 30/44] target/loongarch: Implement vclo vclz

2023-04-07 Thread gaosong
在 2023/4/2 上午11:34, Richard Henderson 写道: On 3/27/23 20:06, Song Gao wrote: +#define DO_CLO_B(N)  (clz32((uint8_t)~N) - 24) +#define DO_CLO_H(N)  (clz32((uint16_t)~N) - 16) I think this is wrong. It is wried,  the result is always right. :-\ and  (clz32(~N) - 24)  or (clz32((uint32_t)~N) -

Re: [PATCH 1/2] Fix libvhost-user.c compilation.

2023-04-07 Thread Michael S. Tsirkin
On Wed, Apr 05, 2023 at 02:59:19PM +0200, David 'Digit' Turner wrote: > The source file uses VIRTIO_F_VERSION_1 which is > not defined by on Debian 10. > > The system-provided which > does not include the macro definition is included > through , so fix the issue by including > the standard-heade

Re: [PATCH 1/3] Fix libvhost-user.c compilation.

2023-04-07 Thread Michael S. Tsirkin
If you are reposting, please version patchsets, E.g. -v2 flag for git format-patch will enerate [PATCH v2] for you. Repeating what I said on previous version: On Wed, Apr 05, 2023 at 07:21:07PM +0200, David 'Digit' Turner wrote: > The source file uses VIRTIO_F_VERSION_1 which is > not defined by

[PATCH v9 4/4] block: add some trace events for zone append

2023-04-07 Thread Sam Li
Signed-off-by: Sam Li Reviewed-by: Dmitry Fomichev Reviewed-by: Stefan Hajnoczi --- block/file-posix.c | 3 +++ block/trace-events | 2 ++ 2 files changed, 5 insertions(+) diff --git a/block/file-posix.c b/block/file-posix.c index 4e26641ce0..da986a33fd 100644 --- a/block/file-posix.c +++ b/bl

[PATCH v9 3/4] qemu-iotests: test zone append operation

2023-04-07 Thread Sam Li
The patch tests zone append writes by reporting the zone wp after the completion of the call. "zap -p" option can print the sector offset value after completion, which should be the start sector where the append write begins. Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi --- qemu-io-cmds.c

[PATCH v9 2/4] block: introduce zone append write for zoned devices

2023-04-07 Thread Sam Li
A zone append command is a write operation that specifies the first logical block of a zone as the write position. When writing to a zoned block device using zone append, the byte offset of the call may point at any position within the zone to which the data is being appended. Upon completion the d

[PATCH v9 0/4] Add zone append write for zoned device

2023-04-07 Thread Sam Li
This patch series add zone append operation based on the previous zoned device support part. The file-posix driver is modified to add zone append emulation using regular writes. v9: - address review comments [Stefan] * fix get_zones_wp() for wrong offset index * fix misuses of QEMU_LOCK_GUARD(

[PATCH v9 1/4] file-posix: add tracking of the zone write pointers

2023-04-07 Thread Sam Li
Since Linux doesn't have a user API to issue zone append operations to zoned devices from user space, the file-posix driver is modified to add zone append emulation using regular writes. To do this, the file-posix driver tracks the wp location of all zones of the device. It uses an array of uint64_

[PATCH v10 0/5] Add zoned storage emulation to virtio-blk driver

2023-04-07 Thread Sam Li
This patch adds zoned storage emulation to the virtio-blk driver. It implements the virtio-blk ZBD support standardization that is recently accepted by virtio-spec. The link to related commit is at https://github.com/oasis-tcs/virtio-spec/commit/b4e8efa0fa6c8d844328090ad15db65af8d7d981 The Linux

[PATCH v10 3/5] block: add accounting for zone append operation

2023-04-07 Thread Sam Li
Taking account of the new zone append write operation for zoned devices, BLOCK_ACCT_ZONE_APPEND enum is introduced as other I/O request type (read, write, flush). Signed-off-by: Sam Li --- block/qapi-sysemu.c| 11 ++ block/qapi.c | 18 ++ hw/block/virtio-blk.c

[PATCH v10 5/5] docs/zoned-storage:add zoned emulation use case

2023-04-07 Thread Sam Li
Add the documentation about the example of using virtio-blk driver to pass the zoned block devices through to the guest. Signed-off-by: Sam Li --- docs/devel/zoned-storage.rst | 17 + 1 file changed, 17 insertions(+) diff --git a/docs/devel/zoned-storage.rst b/docs/devel/zoned-s

[PATCH v10 1/5] include: update virtio_blk headers to v6.3-rc1

2023-04-07 Thread Sam Li
Use scripts/update-linux-headers.sh to update headers to 6.3-rc1. Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi Reviewed-by: Dmitry Fomichev --- include/standard-headers/drm/drm_fourcc.h| 12 +++ include/standard-headers/linux/ethtool.h | 48 - include/standard-headers/l

[PATCH v10 4/5] virtio-blk: add some trace events for zoned emulation

2023-04-07 Thread Sam Li
Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi --- hw/block/trace-events | 7 +++ hw/block/virtio-blk.c | 12 2 files changed, 19 insertions(+) diff --git a/hw/block/trace-events b/hw/block/trace-events index 2c45a62bd5..34be8b9135 100644 --- a/hw/block/trace-events +++ b/

[PATCH v10 2/5] virtio-blk: add zoned storage emulation for zoned devices

2023-04-07 Thread Sam Li
This patch extends virtio-blk emulation to handle zoned device commands by calling the new block layer APIs to perform zoned device I/O on behalf of the guest. It supports Report Zone, four zone oparations (open, close, finish, reset), and Append Zone. The VIRTIO_BLK_F_ZONED feature bit will only

Re: [PATCH for-8.1] qemu-coroutine: remove qatomic_mb_read()

2023-04-07 Thread Paolo Bonzini
Il gio 6 apr 2023, 12:55 Stefan Hajnoczi ha scritto: > On Thu, 6 Apr 2023 at 06:09, Paolo Bonzini wrote: > > > > Replace with an explicit barrier and a comment. > > > > Signed-off-by: Paolo Bonzini > > --- > > util/qemu-coroutine.c | 10 +++--- > > 1 file changed, 7 insertions(+), 3 deleti

assert !temp_readonly(ts) in tcg_reg_alloc_op

2023-04-07 Thread Nicholas Piggin
I get a crash running a powerpc64 TCG machine on x86. It can be triggered by booting a custom vmlinux patched to use powerpc prefix instructions and pcrel addressing, I don't know if that's related or coincidence. I can give Linux patches or a vmlinux file to reproduce if needed, or I can test pat

Re: [PATCH 1/3] Fix libvhost-user.c compilation.

2023-04-07 Thread David Turner
The of glib-2.17 begins with: #ifndef _LINUX_VHOST_H #define _LINUX_VHOST_H /* Userspace interface for in-kernel virtio accelerators. */ /* vhost is used to reduce the number of system calls involved in virtio. * * Existing virtio net code is used in the guest without modification. * * This h

Re: [PATCH 1/3] Fix libvhost-user.c compilation.

2023-04-07 Thread David Turner
I meant glibc-2.17, I am using a sysroot to ensure the generated binaries run on older Linux distributions. On Fri, Apr 7, 2023 at 11:24 AM David Turner wrote: > The of glib-2.17 begins with: > > #ifndef _LINUX_VHOST_H > #define _LINUX_VHOST_H > /* Userspace interface for in-kernel virtio accel

Re: [PATCH 1/3] Fix libvhost-user.c compilation.

2023-04-07 Thread David Turner
So it looks like that for some reason, the QEMU linux-headers directory is not in the include search path for this compilation command, and that the system-or-sysroot provided is picked instead. Fixing this might be a better long-term fix than what I am proposing in this patch. I am not sure how t

Re: [PATCH 1/3] Fix libvhost-user.c compilation.

2023-04-07 Thread Michael S. Tsirkin
On Fri, Apr 07, 2023 at 11:29:46AM +0200, David Turner wrote: > So it looks like that for some reason, the QEMU linux-headers directory is not > in the include search path for this compilation command, and that the > system-or-sysroot provided is picked instead. Fixing this > might > be a better

Re: [PATCH 1/3] Fix libvhost-user.c compilation.

2023-04-07 Thread David Turner
Digging a little further, the top-level meson.build for qemu has the following: if targetos == 'linux' add_project_arguments('-isystem', meson.current_source_dir() / 'linux-headers', '-isystem', 'linux-headers', language: all_languages) endif But

Re: [PATCH 1/3] Fix libvhost-user.c compilation.

2023-04-07 Thread David Turner
On Fri, Apr 7, 2023 at 11:46 AM Michael S. Tsirkin wrote: > On Fri, Apr 07, 2023 at 11:29:46AM +0200, David Turner wrote: > > So it looks like that for some reason, the QEMU linux-headers directory > is not > > in the include search path for this compilation command, and that the > > system-or-sy

Re: [PATCH 1/3] Fix libvhost-user.c compilation.

2023-04-07 Thread Michael S. Tsirkin
On Fri, Apr 07, 2023 at 11:47:50AM +0200, David Turner wrote: > Digging a little further, the top-level meson.build for qemu has the > following: > > > if targetos == 'linux' >   add_project_arguments('-isystem', meson.current_source_dir() / > 'linux-headers', >                  

Re: assert !temp_readonly(ts) in tcg_reg_alloc_op

2023-04-07 Thread Nicholas Piggin
On Fri Apr 7, 2023 at 7:02 PM AEST, Nicholas Piggin wrote: > I get a crash running a powerpc64 TCG machine on x86. > > It can be triggered by booting a custom vmlinux patched to use powerpc > prefix instructions and pcrel addressing, I don't know if that's related > or coincidence. I can give Linux

Re: [PATCH v12 02/10] target/riscv: add support for Zca extension

2023-04-07 Thread Daniel Henrique Barboza
On 4/6/23 22:14, liweiwei wrote: On 2023/4/7 04:22, Daniel Henrique Barboza wrote: Hi, This patch is going to break the sifive_u boot if I rebase "[PATCH v6 0/9] target/riscv: rework CPU extensions validation​" on top of it, as it is the case today with the current riscv-to-apply.next. T

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

2023-04-07 Thread Claudio Fontana
On 4/6/23 18:46, Fabiano Rosas wrote: > Peter Xu writes: > >> On Tue, Apr 04, 2023 at 05:10:52PM +0200, Claudio Fontana wrote: >>> On 4/4/23 16:53, Peter Xu wrote: On Tue, Apr 04, 2023 at 10:00:16AM +0200, Claudio Fontana wrote: > Hi Peter, Hi, Claudio, > > On 4/3/

Re: [PATCH v12 02/10] target/riscv: add support for Zca extension

2023-04-07 Thread liweiwei
On 2023/4/7 18:28, Daniel Henrique Barboza wrote: On 4/6/23 22:14, liweiwei wrote: On 2023/4/7 04:22, Daniel Henrique Barboza wrote: Hi, This patch is going to break the sifive_u boot if I rebase "[PATCH v6 0/9] target/riscv: rework CPU extensions validation​" on top of it, as it is the

Re: [PATCH] target/riscv: Mask the implicitly enabled extensions in isa_string based on priv version

2023-04-07 Thread Daniel Henrique Barboza
On 4/7/23 00:30, Weiwei Li wrote: Using implicitly enabled extensions such as Zca/Zcf/Zcd instead of their super extensions can simplify the extension related check. However, they may have higher priv version than their super extensions. So we should mask them in the isa_string based on priv v

Re: [PATCH v3] target/i386: Change wrong XFRM value

2023-04-07 Thread Yang Zhong
On Thu, Apr 06, 2023 at 02:05:06PM +0200, Paolo Bonzini wrote: > Queued, thanks. > Paolo, thanks! Yang > Paolo > >

Re: [PATCH for-8.1] qemu-coroutine: remove qatomic_mb_read()

2023-04-07 Thread Stefan Hajnoczi
On Fri, Apr 07, 2023 at 10:32:39AM +0200, Paolo Bonzini wrote: > Il gio 6 apr 2023, 12:55 Stefan Hajnoczi ha scritto: > > > On Thu, 6 Apr 2023 at 06:09, Paolo Bonzini wrote: > > > > > > Replace with an explicit barrier and a comment. > > > > > > Signed-off-by: Paolo Bonzini > > > --- > > > uti

Re: [PATCH] target/riscv: Mask the implicitly enabled extensions in isa_string based on priv version

2023-04-07 Thread liweiwei
On 2023/4/7 18:58, Daniel Henrique Barboza wrote: On 4/7/23 00:30, Weiwei Li wrote: Using implicitly enabled extensions such as Zca/Zcf/Zcd instead of their super extensions can simplify the extension related check. However, they may have higher priv version than their super extensions. So w

[PATCH] docs: explain effect of smp_read_barrier_depends() on modern architectures

2023-04-07 Thread Paolo Bonzini
The documentation for smp_read_barrier_depends() does not mention the architectures for which it is an optimization, for example ARM and PPC. As a result, it is not clear to the reader why one would use it. Relegate Alpha to a footnote together with other architectures where it is equivalent to

[PATCH 2/2] Raise crash-test-debian timeout to 90 minutes

2023-04-07 Thread Camilla Conte
When running on the Kubernetes runner, this CI job is timing out. Raise the limit to give the job enough time to run. Signed-off-by: Camilla Conte --- .gitlab-ci.d/buildtest.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml index ba6f

[PATCH 1/2] Add CI configuration for Kubernetes

2023-04-07 Thread Camilla Conte
Configure Gitlab CI to run on Kubernetes according to the official documentation. https://docs.gitlab.com/ee/ci/docker/using_docker_build.html#docker-in-docker-with-tls-enabled-in-kubernetes These changes are needed because of the CI jobs using Docker-in-Docker (dind). As soon as Docker-in-Docker

Re: [PATCH] docs: explain effect of smp_read_barrier_depends() on modern architectures

2023-04-07 Thread Peter Maydell
On Fri, 7 Apr 2023 at 14:41, Paolo Bonzini wrote: > > The documentation for smp_read_barrier_depends() does not mention the > architectures > for which it is an optimization, for example ARM and PPC. As a result, it is > not > clear to the reader why one would use it. Relegate Alpha to a footn

[PATCH 7/8] block-backend: ignore inserted state in blk_co_nb_sectors

2023-04-07 Thread Paolo Bonzini
All callers of blk_co_nb_sectors (and blk_nb_sectors) are able to handle a non-inserted CD-ROM as a zero-length file, they do not need to raise an error. Not using blk_co_is_available() aligns the function with blk_co_get_geometry(), which becomes a simple wrapper for blk_co_nb_sectors(). It will

[PATCH 8/8] block, block-backend: write some hot coroutine wrappers by hand

2023-04-07 Thread Paolo Bonzini
The introduction of the graph lock is causing blk_get_geometry, a hot function used in the I/O path, to create a coroutine. However, the only part that really needs to run in coroutine context is the call to bdrv_co_refresh_total_sectors, which in turn only happens in the rare case of host CD-ROM

[PATCH 8.0 regression 0/8] block: remove bdrv_co_get_geometry coroutines from I/O hot path

2023-04-07 Thread Paolo Bonzini
The introduction of the graph lock is causing blk_get_geometry, a hot function used in the I/O path, to create a coroutine for the call to bdrv_co_refresh_total_sectors. In theory the call to bdrv_co_refresh_total_sectors should only matter in the rare case of host CD-ROM devices, whose size chang

[PATCH v2] target/riscv: Fix Guest Physical Address Translation

2023-04-07 Thread Irina Ryapolova
Before changing the flow check for sv39/48/57. According to specification (for Supervisor mode): Sv39 implementations support a 39-bit virtual address space, divided into 4 KiB pages. Instruction fetch addresses and load and store effective addresses, which are 64 bits, must have bits 63–39 all

[PATCH 1/8] block: move has_variable_length to BlockLimits

2023-04-07 Thread Paolo Bonzini
At the protocol level, has_variable_length only needs to be true in the very special case of host CD-ROM drives, so that they do not need an explicit monitor command to read the new size when a disc is loaded in the tray. However, at the format level has_variable_length has to be true for all raw

[PATCH 3/8] block: refresh bs->total_sectors on reopen

2023-04-07 Thread Paolo Bonzini
After reopening a BlockDriverState, it's possible that the size of the underlying file has changed. This for example is covered by test 171. Right now, this is handled by the raw driver's has_variable_length = true setting. Since this will be removed by the next patch, handle it on reopen instea

[PATCH 6/8] block-backend: inline bdrv_co_get_geometry

2023-04-07 Thread Paolo Bonzini
bdrv_co_get_geometry is only used in blk_co_get_geometry. Inline it in there, to reduce the number of wrappers for bs->total_sectors. Signed-off-by: Paolo Bonzini --- block.c | 10 -- block/block-backend.c| 8 ++-- include/block/block-io.h | 3 --- 3 files cha

[PATCH 2/8] block: remove has_variable_length from filters

2023-04-07 Thread Paolo Bonzini
Filters automatically get has_variable_length from their underlying BlockDriverState. There is no need to mark them as variable-length in the BlockDriver. Signed-off-by: Paolo Bonzini --- block/copy-on-read.c| 1 - block/filter-compress.c | 1 - block/preallocate.c | 1 - block/replicat

[PATCH 4/8] block: remove has_variable_length from BlockDriver

2023-04-07 Thread Paolo Bonzini
Fill in the field in BlockLimits directly for host devices, and copy it from there for the raw format. Signed-off-by: Paolo Bonzini --- block/file-posix.c | 12 block/file-win32.c | 2 +- block/io.c | 2 -- block/raw-format.c

[PATCH 5/8] migration/block: replace uses of blk_nb_sectors that do not check result

2023-04-07 Thread Paolo Bonzini
Uses of blk_nb_sectors must check whether the result is negative. Otherwise, underflow can happen. Fortunately, alloc_aio_bitmap() and bmds_aio_inflight() both have an alternative way to retrieve the number of sectors in the file. Signed-off-by: Paolo Bonzini --- migration/block.c | 5 ++--- 1

clean after distclean gobbles source files

2023-04-07 Thread Steven Sistare
Run 'make distclean', and GNUmakefile is removed. But, GNUmakefile is where we cd to build/. Run 'make distclean' or 'make clean' again, and Makefile applies the clean actions, such as this one, at the top level of the tree: find . \( -name '*.so' -o -name '*.dll' -o \ -name '*.[oda]

Re: [PATCH v3 2/3] target/riscv: Use PRV_RESERVED instead of PRV_H

2023-04-07 Thread Richard Henderson
On 4/6/23 18:47, Weiwei Li wrote: PRV_H has no real meaning, but just a reserved privilege mode currently. Signed-off-by: Weiwei Li Signed-off-by: Junqiang Wang --- target/riscv/cpu.h | 2 +- target/riscv/cpu_bits.h | 2 +- target/riscv/gdbstub.c | 2 +- target/riscv/op_helper.c |

Re: [PATCH v3 3/3] target/riscv: Legalize MPP value in write_mstatus

2023-04-07 Thread Richard Henderson
On 4/6/23 18:47, Weiwei Li wrote: mstatus.MPP field is a WARL field since priv version 1.11, so we remain it unchanged if an invalid value is written into it. And after this, RVH shouldn't be passed to riscv_cpu_set_mode(). Signed-off-by: Weiwei Li Signed-off-by: Junqiang Wang --- target/riscv

Re: [PATCH] docs: explain effect of smp_read_barrier_depends() on modern architectures

2023-04-07 Thread Stefan Hajnoczi
On Fri, Apr 7, 2023, 09:41 Paolo Bonzini wrote: > The documentation for smp_read_barrier_depends() does not mention the > architectures > for which it is an optimization, for example ARM and PPC. As a result, it > is not > clear to the reader why one would use it. Relegate Alpha to a footnote >

Re: [RFC PATCH v2 30/44] target/loongarch: Implement vclo vclz

2023-04-07 Thread Richard Henderson
On 4/7/23 00:40, gaosong wrote: 在 2023/4/2 上午11:34, Richard Henderson 写道: On 3/27/23 20:06, Song Gao wrote: +#define DO_CLO_B(N)  (clz32((uint8_t)~N) - 24) +#define DO_CLO_H(N)  (clz32((uint16_t)~N) - 16) I think this is wrong. It is wried,  the result is always right. :-\ and  (clz32(~N)

Re: assert !temp_readonly(ts) in tcg_reg_alloc_op

2023-04-07 Thread Richard Henderson
On 4/7/23 03:24, Nicholas Piggin wrote: On Fri Apr 7, 2023 at 7:02 PM AEST, Nicholas Piggin wrote: I get a crash running a powerpc64 TCG machine on x86. It can be triggered by booting a custom vmlinux patched to use powerpc prefix instructions and pcrel addressing, I don't know if that's relate

Re: [PATCH 19/41] compiler.h: replace QEMU_NORETURN with G_NORETURN

2023-04-07 Thread Stefan Weil via
Please excuse the late report, but this old patch causes a build failure for me: Am 20.04.22 um 15:26 schrieb marcandre.lur...@redhat.com: From: Marc-André Lureau G_NORETURN was introduced in glib 2.68, fallback to G_GNUC_NORETURN in glib-compat. Note that this attribute must be placed befor

Re: [PATCH 19/41] compiler.h: replace QEMU_NORETURN with G_NORETURN

2023-04-07 Thread Stefan Weil via
Am 07.04.23 um 19:01 schrieb Stefan Weil: Please excuse the late report, but this old patch causes a build failure for me: I just noticed that this is already fixed in latest code (I tested the build with v8.0.0-rc0). So nothing to do. Sorry for the noise. Stefan

Re: [PATCH V9 00/46] Live Update

2023-04-07 Thread Michael Galaxy
Hey Steven, Have you done any "back-to-back" live update testing before? I am still doing extensive testing on this myself. I am running into a bug that I have not yet diagnosed. It involves the following: 1. Perform a live update (I'm using kexec + PMEM-based live updates). => VM comes bac

[PATCH for-8.0] target/ppc: Fix temp usage in gen_op_arith_modw

2023-04-07 Thread Richard Henderson
Fix a crash writing to 't3', which is now a constant. Instead, write the result of the remu to 'ret'. Fixes: 7058ff5231a ("target/ppc: Avoid tcg_const_* in translate.c") Reported-by: Nicholas Piggin Signed-off-by: Richard Henderson --- target/ppc/translate.c | 4 ++-- 1 file changed, 2 insertio

[PATCH 2/2] target/arm: Copy guarded bit in combine_cacheattrs

2023-04-07 Thread Richard Henderson
The guarded bit comes from the stage1 walk. Fixes: Coverity CID 1507929 Signed-off-by: Richard Henderson --- target/arm/ptw.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/arm/ptw.c b/target/arm/ptw.c index 58a6de09bc..6d72950a79 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c

[PATCH for-8.0? 0/2] target/arm: BTI guarded bit fixes

2023-04-07 Thread Richard Henderson
As reported by Coverity and triaged by Peter. r~ Richard Henderson (2): target/arm: PTE bit GP only applies to stage1 target/arm: Copy guarded bit in combine_cacheattrs target/arm/ptw.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) -- 2.34.1

[PATCH 1/2] target/arm: PTE bit GP only applies to stage1

2023-04-07 Thread Richard Henderson
Only perform the extract of GP during the stage1 walk. Reported-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/ptw.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/target/arm/ptw.c b/target/arm/ptw.c index ec3f51782a..58a6de09bc 100644 --- a/ta

Re: [PATCH for-8.0] target/ppc: Fix temp usage in gen_op_arith_modw

2023-04-07 Thread Anton Johansson via
On 4/7/23 20:36, Richard Henderson wrote: Fix a crash writing to 't3', which is now a constant. Instead, write the result of the remu to 'ret'. Fixes: 7058ff5231a ("target/ppc: Avoid tcg_const_* in translate.c") Reported-by: Nicholas Piggin Signed-off-by: Richard Henderson --- target/ppc/t

[PATCH for-8.0] tcg/i386: Adjust assert in tcg_out_addi_ptr

2023-04-07 Thread Richard Henderson
We can arrive here on _WIN64 because Int128 is passed by reference. Change the assert to check that the immediate is in range, instead of attempting to check the host ABI. Fixes: 6a6d772e30d ("tcg: Introduce tcg_out_addi_ptr") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1581 Signed-off

Re: [PATCH v12 02/10] target/riscv: add support for Zca extension

2023-04-07 Thread Daniel Henrique Barboza
On 4/7/23 00:34, liweiwei wrote: On 2023/4/7 09:14, liweiwei wrote: On 2023/4/7 04:22, Daniel Henrique Barboza wrote: Hi, This patch is going to break the sifive_u boot if I rebase "[PATCH v6 0/9] target/riscv: rework CPU extensions validation​" on top of it, as it is the case today wit

Re: [PATCH 1/8] block: move has_variable_length to BlockLimits

2023-04-07 Thread Eric Blake
On Fri, Apr 07, 2023 at 05:32:56PM +0200, Paolo Bonzini wrote: > At the protocol level, has_variable_length only needs to be true in the > very special case of host CD-ROM drives, so that they do not need an > explicit monitor command to read the new size when a disc is loaded > in the tray. > > H

Re: [PATCH 2/8] block: remove has_variable_length from filters

2023-04-07 Thread Eric Blake
On Fri, Apr 07, 2023 at 05:32:57PM +0200, Paolo Bonzini wrote: > Filters automatically get has_variable_length from their underlying > BlockDriverState. There is no need to mark them as variable-length > in the BlockDriver. > > Signed-off-by: Paolo Bonzini > --- > block/copy-on-read.c| 1 -

Re: [PATCH 3/8] block: refresh bs->total_sectors on reopen

2023-04-07 Thread Eric Blake
On Fri, Apr 07, 2023 at 05:32:58PM +0200, Paolo Bonzini wrote: > After reopening a BlockDriverState, it's possible that the size of the > underlying file has changed. This for example is covered by test 171. > > Right now, this is handled by the raw driver's has_variable_length = true > setting.

Re: [PATCH 4/8] block: remove has_variable_length from BlockDriver

2023-04-07 Thread Eric Blake
On Fri, Apr 07, 2023 at 05:32:59PM +0200, Paolo Bonzini wrote: > Fill in the field in BlockLimits directly for host devices, and > copy it from there for the raw format. > > Signed-off-by: Paolo Bonzini > --- > block/file-posix.c | 12 > block/file-win32.c

Re: [PATCH 5/8] migration/block: replace uses of blk_nb_sectors that do not check result

2023-04-07 Thread Eric Blake
On Fri, Apr 07, 2023 at 05:33:00PM +0200, Paolo Bonzini wrote: > Uses of blk_nb_sectors must check whether the result is negative. > Otherwise, underflow can happen. Fortunately, alloc_aio_bitmap() > and bmds_aio_inflight() both have an alternative way to retrieve the > number of sectors in the fi

Re: [PATCH 6/8] block-backend: inline bdrv_co_get_geometry

2023-04-07 Thread Eric Blake
On Fri, Apr 07, 2023 at 05:33:01PM +0200, Paolo Bonzini wrote: > bdrv_co_get_geometry is only used in blk_co_get_geometry. Inline it in > there, to reduce the number of wrappers for bs->total_sectors. > > Signed-off-by: Paolo Bonzini > --- > block.c | 10 -- > block/blo

Re: [PATCH 7/8] block-backend: ignore inserted state in blk_co_nb_sectors

2023-04-07 Thread Eric Blake
On Fri, Apr 07, 2023 at 05:33:02PM +0200, Paolo Bonzini wrote: > All callers of blk_co_nb_sectors (and blk_nb_sectors) are able to > handle a non-inserted CD-ROM as a zero-length file, they do not need > to raise an error. > > Not using blk_co_is_available() aligns the function with > blk_co_get_g

Re: [PATCH 8/8] block, block-backend: write some hot coroutine wrappers by hand

2023-04-07 Thread Eric Blake
On Fri, Apr 07, 2023 at 05:33:03PM +0200, Paolo Bonzini wrote: > The introduction of the graph lock is causing blk_get_geometry, a hot function > used in the I/O path, to create a coroutine. However, the only part that > really > needs to run in coroutine context is the call to > bdrv_co_refresh

Re: [PATCH 8/8] block, block-backend: write some hot coroutine wrappers by hand

2023-04-07 Thread Paolo Bonzini
Il ven 7 apr 2023, 22:04 Eric Blake ha scritto: > On Fri, Apr 07, 2023 at 05:33:03PM +0200, Paolo Bonzini wrote: > > The introduction of the graph lock is causing blk_get_geometry, a hot > function > > used in the I/O path, to create a coroutine. However, the only part > that really > > needs to

[PATCH] Hexagon (target/hexagon) Remove unused slot variable in helpers

2023-04-07 Thread Taylor Simpson
The slot variable in helpers was only passed to log_reg_write function where the argument is unused. - Remove declaration from generated helper functions - Remove slot argument from log_reg_write Signed-off-by: Taylor Simpson --- target/hexagon/macros.h| 2 +- target/hexagon/op_helpe

[PATCH] do not lockdown github PRs submitted to forks of official mirror

2023-04-07 Thread lauren
From: "Lauren N. Liberda" qemu forks on github are typically the way of work on changes to be upstreamed later, such as support for new devices. currently, the workflow prevents any external contributors from submitting code changes, and blindly points them to upstream instead. Signed-off-by: La

[PATCH] Hexagon (target/hexagon) Additional instructions handled by idef-parser

2023-04-07 Thread Taylor Simpson
Currently, idef-parser skips all floating point instructions. However, there are some floating point instructions that can be handled. The following instructions are now parsed F2_sfimm_p F2_sfimm_n F2_dfimm_p F2_dfimm_n F2_dfmpyll F2_dfmpylh To make these instructions wo

Re: [PULL 5/6] edk2: replace build scripts

2023-04-07 Thread Olaf Hering
Mon, 20 Mar 2023 10:38:46 +0100 Gerd Hoffmann : > Remove Makefile.edk2 and the edk2*.sh scripts and replace them > with a python script (which already handles fedora rpm builds) > and a config file for it. This breaks 'make roms efirom' (in case this happens to be a valid make target). Olaf pg

Re: [PATCH 01/14] accel: Document generic accelerator headers

2023-04-07 Thread Richard Henderson
On 4/5/23 03:17, Philippe Mathieu-Daudé wrote: These headers are meant to be include by any file to check the availability of accelerators, thus are not accelerator specific. Signed-off-by: Philippe Mathieu-Daudé --- include/sysemu/hax.h | 2 ++ include/sysemu/kvm.h | 2 ++ include/sysemu/

Re: [PATCH 03/14] accel: Fix a leak on Windows HAX

2023-04-07 Thread Richard Henderson
On 4/5/23 03:18, Philippe Mathieu-Daudé wrote: hThread is only used on the error path in hax_kick_vcpu_thread(). Fixes: b0cb0a66d6 ("Plumb the HAXM-based hardware acceleration support") Signed-off-by: Philippe Mathieu-Daudé --- target/i386/hax/hax-all.c | 3 +++ 1 file changed, 3 insertions(+

Re: [PATCH 02/14] accel: Remove unused hThread variable on TCG/WHPX

2023-04-07 Thread Richard Henderson
On 4/5/23 03:17, Philippe Mathieu-Daudé wrote: On Windows hosts, cpu->hThread is assigned but never accessed: remove it. Signed-off-by: Philippe Mathieu-Daudé --- accel/tcg/tcg-accel-ops-mttcg.c | 4 accel/tcg/tcg-accel-ops-rr.c | 3 --- target/i386/whpx/whpx-accel-ops.c | 3 ---

Re: [PATCH 05/14] accel: Rename 'hax_vcpu' as 'accel' in CPUState

2023-04-07 Thread Richard Henderson
On 4/5/23 03:18, Philippe Mathieu-Daudé wrote: All accelerators will share a single opaque context in CPUState. Start by renaming 'hax_vcpu' as 'accelCPUState'. Pasto in 'accel' here. Reviewed-by: Richard Henderson r~

Re: [PATCH 07/14] accel: Rename struct hax_vcpu_state -> struct AccelvCPUState

2023-04-07 Thread Richard Henderson
On 4/5/23 03:18, Philippe Mathieu-Daudé wrote: We want all accelerators to share the same opaque pointer in CPUState. Start with the HAX context, renaming its forward declarated structure 'hax_vcpu_state' as 'AccelvCPUState'. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/cpu.h

Re: [PATCH 08/14] accel: Move HAX hThread to accelerator context

2023-04-07 Thread Richard Henderson
On 4/5/23 03:18, Philippe Mathieu-Daudé wrote: hThread variable is only used by the HAX accelerator, so move it to the accelerator specific context. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/cpu.h | 1 - target/i386/hax/hax-i386.h | 3 +++ target/i386/hax/hax-a

Re: [PATCH 07/14] accel: Rename struct hax_vcpu_state -> struct AccelvCPUState

2023-04-07 Thread Richard Henderson
On 4/5/23 03:18, Philippe Mathieu-Daudé wrote: +struct AccelvCPUState; Missing typedef? r~

Re: [PATCH 10/14] accel: Rename NVMM struct qemu_vcpu -> struct AccelvCPUState

2023-04-07 Thread Richard Henderson
On 4/5/23 03:18, Philippe Mathieu-Daudé wrote: -struct qemu_vcpu *qcpu = get_qemu_vcpu(cpu); +struct AccelvCPUState *qcpu = get_qemu_vcpu(cpu); With the typedef in hw/core/cpu.h, you can drop the 'struct' at the same time. Otherwise, Reviewed-by: Richard Henderson -qcpu = g_try_

Re: [PATCH 11/14] accel: Inline NVMM get_qemu_vcpu()

2023-04-07 Thread Richard Henderson
On 4/5/23 03:18, Philippe Mathieu-Daudé wrote: No need for this helper to access the CPUState::accel field. Signed-off-by: Philippe Mathieu-Daudé --- target/i386/nvmm/nvmm-all.c | 28 +++- 1 file changed, 11 insertions(+), 17 deletions(-) Reviewed-by: Richard Henders

Re: [PATCH 12/14] accel: Rename WHPX struct whpx_vcpu -> struct AccelvCPUState

2023-04-07 Thread Richard Henderson
On 4/5/23 03:18, Philippe Mathieu-Daudé wrote: We want all accelerators to share the same opaque pointer in CPUState. Rename WHPX 'whpx_vcpu' as 'AccelvCPUState'. Signed-off-by: Philippe Mathieu-Daudé --- target/i386/whpx/whpx-all.c | 30 +++--- 1 file changed, 15 ins

Re: [PATCH 13/14] accel: Inline WHPX get_whpx_vcpu()

2023-04-07 Thread Richard Henderson
On 4/5/23 03:18, Philippe Mathieu-Daudé wrote: No need for this helper to access the CPUState::accel field. Signed-off-by: Philippe Mathieu-Daudé --- target/i386/whpx/whpx-all.c | 29 ++--- 1 file changed, 10 insertions(+), 19 deletions(-) Reviewed-by: Richard Hender

Re: [PATCH 14/14] accel: Rename HVF struct hvf_vcpu_state -> struct AccelvCPUState

2023-04-07 Thread Richard Henderson
On 4/5/23 03:18, Philippe Mathieu-Daudé wrote: We want all accelerators to share the same opaque pointer in CPUState. Rename the 'hvf_vcpu_state' structure as 'AccelvCPUState'. Use the generic 'accel' field of CPUState instead of 'hvf'. Replace g_malloc0() by g_new0() for readability. Signed-

[PATCH V3] tracing: install trace events file only if necessary

2023-04-07 Thread casantos
From: Carlos Santos It is not useful when configuring with --enable-trace-backends=nop. Signed-off-by: Carlos Santos --- Changes v1->v2: Install based on chosen trace backend, not on chosen emulators. Changes v2->v3: Add missing comma --- trace/meson.build | 2 +- 1 file changed, 1 inserti

Re: [PATCH 1/2] accel/stubs: Remove kvm_flush_coalesced_mmio_buffer() stub

2023-04-07 Thread Richard Henderson
On 4/5/23 09:13, Philippe Mathieu-Daudé wrote: kvm_flush_coalesced_mmio_buffer() is only called from qemu_flush_coalesced_mmio_buffer() where it is protected by a kvm_enabled() check. When KVM is not available, the call is elided, there is no need for a stub definition. Reviewed-by: Richard Hen

Re: [PATCH 2/2] accel/stubs: Build HAX/KVM/XEN stubs once

2023-04-07 Thread Richard Henderson
On 4/5/23 09:13, Philippe Mathieu-Daudé wrote: +softmmu_ss.add_all(when: ['CONFIG_SOFTMMU'], if_true: sysemu_stubs_ss) This when is redundant. You can drop sysemu_stubs_ss and add each stub file directly to softmmu_ss. r~

Re: [PATCH 01/10] sysemu/kvm: Remove unused headers

2023-04-07 Thread Richard Henderson
On 4/5/23 09:04, Philippe Mathieu-Daudé wrote: All types used are forward-declared in "qemu/typedefs.h". Signed-off-by: Philippe Mathieu-Daudé --- include/sysemu/kvm.h | 3 --- 1 file changed, 3 deletions(-) Reviewed-by: Richard Henderson r~

Re: [PATCH 02/10] accel/kvm: Declare kvm_direct_msi_allowed in stubs

2023-04-07 Thread Richard Henderson
On 4/5/23 09:04, Philippe Mathieu-Daudé wrote: Avoid when calling kvm_direct_msi_enabled() from arm_gicv3_its_common.c the next commit: Undefined symbols for architecture arm64: "_kvm_direct_msi_allowed", referenced from: _its_class_name in hw_intc_arm_gicv3_its_common.c.o ld

[PATCH] target/arm: Fix debugging of ARMv8M Secure code

2023-04-07 Thread pbartell
From: Paul Bartell Revert changes to arm_cpu_get_phys_page_attrs_debug made in commit 4a35855682cebb89f9630b07aa9fd37c4e8c733b. Commit 4a35855682 modifies the arm_cpu_get_phys_page_attrs_debug function so that it calls get_phys_addr_with_struct rather than get_phys_addr, which leads to a variety

[PATCH] block/vhdx: fix dynamic VHDX BAT corruption

2023-04-07 Thread Lukas Tschoke
The corruption occurs when a BAT entry aligned to 4096 bytes is changed. Specifically, the corruption occurs during the creation of the LOG Data Descriptor. The incorrect behavior involves copying 4088 bytes from the original 4096 bytes aligned offset to `tmp[8..4096]` and then copying the new val

[PATCH V4] tracing: install trace events file only if necessary

2023-04-07 Thread casantos
From: Carlos Santos It is not useful when configuring with --enable-trace-backends=nop. Signed-off-by: Carlos Santos --- Changes v1->v2: Install based on chosen trace backend, not on chosen emulators. Changes v2->v3: Add missing comma Changes v3->v4: Fix array comparison: get_option('

Re: [PATCH v12 02/10] target/riscv: add support for Zca extension

2023-04-07 Thread liweiwei
On 2023/4/8 03:25, Daniel Henrique Barboza wrote: On 4/7/23 00:34, liweiwei wrote: On 2023/4/7 09:14, liweiwei wrote: On 2023/4/7 04:22, Daniel Henrique Barboza wrote: Hi, This patch is going to break the sifive_u boot if I rebase "[PATCH v6 0/9] target/riscv: rework CPU extensions val

[PATCH for-8.0] tcg/i386: Adjust assert in tcg_out_addi_ptr

2023-04-07 Thread Richard Henderson
We can arrive here on _WIN64 because Int128 is passed by reference. Change the assert to check that the immediate is in range, instead of attempting to check the host ABI. Fixes: 6a6d772e30d ("tcg: Introduce tcg_out_addi_ptr") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1581 Signed-off

[PATCH 03/42] tcg: Split out tcg_out_ext8s

2023-04-07 Thread Richard Henderson
We will need a backend interface for performing 8-bit sign-extend. Use it in tcg_reg_alloc_op in the meantime. Signed-off-by: Richard Henderson --- tcg/tcg.c| 21 - tcg/aarch64/tcg-target.c.inc | 11 +++ tcg/arm/tcg-target.c.inc | 1

[PATCH 26/42] tcg/s390x: Pass TCGType to tcg_out_qemu_{ld,st}

2023-04-07 Thread Richard Henderson
We need to set this in TCGLabelQemuLdst, so plumb this all the way through from tcg_out_op. Signed-off-by: Richard Henderson --- tcg/s390x/tcg-target.c.inc | 22 ++ 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/tcg/s390x/tcg-target.c.inc b/tcg/s390x/tcg-targe

[PATCH 30/42] tcg: Introduce tcg_out_ld_helper_args

2023-04-07 Thread Richard Henderson
Centralize the logic to call the helper_ldN_mmu functions. This loses out slightly on mips by not filling the delay slot, but the result is more maintainable. Signed-off-by: Richard Henderson --- tcg/tcg.c| 187 +++ tcg/aarch64/tcg-target.c.inc

  1   2   >