Re: [PATCH 2/4] target/arm: Tidy sve_exception_el for CPACR_EL1 access

2022-01-28 Thread Zenghui Yu via
On 2022/1/27 14:34, Richard Henderson wrote: Extract entire fields for ZEN and FPEN, rather than testing specific bits. This makes it easier to follow the code versus the ARM spec. Signed-off-by: Richard Henderson Reviewed-by: Zenghui Yu

Re: [PATCH 3/4] target/arm: Fix {fp,sve}_exception_el for VHE mode running

2022-01-28 Thread Zenghui Yu via
Hi Richard, On 2022/1/27 14:34, Richard Henderson wrote: +if (el <= 2) { +if (hcr_el2 & HCR_E2H) { +/* Check CPTR_EL2.ZEN. */ +switch (extract32(env->cp15.cptr_el[2], 16, 2)) { +case 1: +if (el != 0 || !(hcr_el2 & HCR_TGE)) { It

Re: [RFC 4/5] target/riscv: Add *envcfg* CSRs support

2022-01-28 Thread angell1518
在 2022/1/29 上午9:28, Atish Patra 写道: On Wed, Jan 26, 2022 at 12:37 AM Weiwei Li > wrote: 在 2022/1/21 上午4:07, Atish Patra 写道: > The RISC-V privileged specification v1.12 defines few execution > environment configuration CSRs that can be used enable/dis

Re: [PATCH 1/4] target/arm: Fix sve_zcr_len_for_el for VHE mode running

2022-01-28 Thread Zenghui Yu via
On 2022/1/27 14:34, Richard Henderson wrote: When HCR_EL2.{E2H,TGE} == '11', ZCR_EL1 is unused. Reported-by: Zenghui Yu Signed-off-by: Richard Henderson Reviewed-by: Zenghui Yu

[RFC PATCH] spapr: Add SPAPR_CAP_AIL_MODES for supported AIL modes for H_SET_MODE hcall

2022-01-28 Thread Nicholas Piggin
The behaviour of the Address Translation Mode on Interrupt resource is not consistently supported by all CPU versions or all KVM versions. In particular KVM HV only supports mode 0 on POWER7 processors, and does not support mode 2 on any processors. KVM PR only supports mode 0. TCG can support all

Re: [RFC 4/5] target/riscv: Add *envcfg* CSRs support

2022-01-28 Thread Atish Patra
On Wed, Jan 26, 2022 at 12:37 AM Weiwei Li wrote: > > 在 2022/1/21 上午4:07, Atish Patra 写道: > > The RISC-V privileged specification v1.12 defines few execution > > environment configuration CSRs that can be used enable/disable > > extensions per privilege levels. > > > > Add the basic support for t

Re: [RFC 1/5] target/riscv: Add the privileged spec version 1.12.0

2022-01-28 Thread Atish Kumar Patra
On Sun, Jan 23, 2022 at 11:59 PM Richard Henderson < richard.hender...@linaro.org> wrote: > On 1/21/22 7:07 AM, Atish Patra wrote: > > Add the definition for ratified privileged specification version v1.12 > > > > Signed-off-by: Atish Patra > > --- > > target/riscv/cpu.h | 1 + > > 1 file chan

Re: [RFC 2/5] target/riscv: Introduce privilege version field in the CSR ops.

2022-01-28 Thread Atish Kumar Patra
On Sun, Jan 23, 2022 at 11:56 PM Richard Henderson < richard.hender...@linaro.org> wrote: > On 1/21/22 7:07 AM, Atish Patra wrote: > > +[CSR_VSTART] = { "vstart", vs, read_vstart, write_vstart, > NULL, > > + NULL, NULL, > PRIV_VERSION_1_12_0 }

Re: [PATCH 00/11] target/ppc: powerpc_excp improvements [BookE] (6/n)

2022-01-28 Thread BALATON Zoltan
On Fri, 28 Jan 2022, Fabiano Rosas wrote: This series handles the BookE exception code. Tested the following machines/CPUs: == bamboo == 440ep, 460ex, 440-xilinx-w-dfpu == sam460ex == 440ep, 460ex, 440-xilinx-w-dfpu What OS did you test with? Other than the 460ex may not make much sense on

[PATCH v3 30/40] bsd-user/signal.c: sigset manipulation routines.

2022-01-28 Thread Warner Losh
target_sigemptyset: resets a set to having no bits set target_sigaddset: adds a signal to a set target_sigismember: returns true when signal is a member host_to_target_sigset_internal: convert host sigset to target host_to_target_sigset: convert host sigset to target target_to_host_sigset_interna

[PATCH v3 40/40] bsd-user/freebsd/target_os_ucontext.h: Prefer env as arg name for CPUArchState args

2022-01-28 Thread Warner Losh
Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/freebsd/target_os_ucontext.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bsd-user/freebsd/target_os_ucontext.h b/bsd-user/freebsd/target_os_ucontext.h index 41b28b2c150..b196b1c629f 100644 --- a

[PATCH v3 27/40] bsd-user/strace.c: print_taken_signal

2022-01-28 Thread Warner Losh
print_taken_signal() prints signals when we're tracing signals. Signed-off-by: Stacey Son Signed-off-by: Kyle Evans Signed-off-by: Warner Losh Reviewed-by: Peter Maydell Reviewed-by: Richard Henderson --- bsd-user/qemu.h | 10 + bsd-user/strace.c | 97 ++

[PATCH v3 31/40] bsd-user/signal.c: setup_frame

2022-01-28 Thread Warner Losh
setup_frame sets up a signalled stack frame. Associated routines to extract the pointer to the stack frame and to support alternate stacks. Signed-off-by: Stacey Son Signed-off-by: Kyle Evans Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/main.c | 5 +++ bsd-user/qe

[PATCH v3 32/40] bsd-user/signal.c: handle_pending_signal

2022-01-28 Thread Warner Losh
Handle a queued signal. Signed-off-by: Stacey Son Signed-off-by: Kyle Evans Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/qemu.h | 7 bsd-user/signal.c | 87 +++ 2 files changed, 94 insertions(+) diff --git a/bsd-us

[PATCH v3 22/40] bsd-user: Add host signals to the build

2022-01-28 Thread Warner Losh
Start to add the host signal functionality to the build. Signed-off-by: Warner Losh Reviewed-by: Peter Maydell Reviewed-by: Richard Henderson --- bsd-user/signal.c | 1 + meson.build | 1 + 2 files changed, 2 insertions(+) diff --git a/bsd-user/signal.c b/bsd-user/signal.c index ad8437a

[PATCH v3 36/40] bsd-user/signal.c: implement do_sigaction

2022-01-28 Thread Warner Losh
Implement the meat of the sigaction(2) system call with do_sigaction and helper routiner block_signals (which is also used to implemement signal masking so it's global). Signed-off-by: Stacey Son Signed-off-by: Kyle Evans Signed-off-by: Warner Losh --- bsd-user/signal-common.h | 22 +++

[PATCH v3 17/40] bsd-user/signal.c: Implement signal_init()

2022-01-28 Thread Warner Losh
Initialize the signal state for the emulator. Setup a set of sane default signal handlers, mirroring the host's signals. For fatal signals (those that exit by default), establish our own set of signal handlers. Stub out the actual signal handler we use for the moment. Signed-off-by: Stacey Son Si

[PATCH v3 28/40] bsd-user/signal.c: Implement dump_core_and_abort

2022-01-28 Thread Warner Losh
Force delivering a signal and generating a core file. It's a global function for the moment... Signed-off-by: Stacey Son Signed-off-by: Kyle Evans Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/signal.c | 76 + bsd-user/sys

[PATCH v3 21/40] bsd-user/host/x86_64/host-signal.h: Implement host_signal_*

2022-01-28 Thread Warner Losh
Implement host_signal_pc, host_signal_set_pc and host_signal_write for x86_64. Signed-off-by: Kyle Evans Signed-off-by: Warner Losh Reviewed-by: Peter Maydell Reviewed-by: Richard Henderson --- bsd-user/host/x86_64/host-signal.h | 37 ++ 1 file changed, 37 insertio

[PATCH v3 35/40] bsd-user/signal.c: implement do_sigreturn

2022-01-28 Thread Warner Losh
Implements the meat of a sigreturn(2) system call via do_sigreturn, and helper reset_signal_mask. Fix the prototype of do_sigreturn in qemu.h and remove do_rt_sigreturn since it's linux only. Signed-off-by: Stacey Son Signed-off-by: Kyle Evans Signed-off-by: Warner Losh --- bsd-user/signal-com

[PATCH v3 38/40] MAINTAINERS: Add tests/vm/*bsd to the list to get reviews on

2022-01-28 Thread Warner Losh
tests/vm/*bsd (especailly tests/vm/freebsd) are adjacent to the bsd-user stuff and we're keen on keeping them working as well. Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index e4b3a4bcdf

[PATCH v3 16/40] bsd-user/signal.c: implement abstract target / host signal translation

2022-01-28 Thread Warner Losh
Implement host_to_target_signal and target_to_host_signal. Signed-off-by: Stacey Son Signed-off-by: Kyle Evans Signed-off-by: Warner Losh Reviewed-by: Peter Maydell Reviewed-by: Richard Henderson --- bsd-user/signal-common.h | 2 ++ bsd-user/signal.c| 16 2 files ch

[PATCH v3 37/40] bsd-user/signal.c: do_sigaltstack

2022-01-28 Thread Warner Losh
Implement the meat of the sigaltstack(2) system call with do_sigaltstack. With that, all the stubbed out routines are complete, so remove now-incorrect comment. Signed-off-by: Stacey Son Signed-off-by: Kyle Evans Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/signal.c

[PATCH v3 20/40] bsd-user/host/i386/host-signal.h: Implement host_signal_*

2022-01-28 Thread Warner Losh
Implement host_signal_pc, host_signal_set_pc and host_signal_write for i386. Signed-off-by: Kyle Evans Signed-off-by: Warner Losh Reviewed-by: Peter Maydell Reviewed-by: Richard Henderson --- bsd-user/host/i386/host-signal.h | 37 1 file changed, 37 insertions

[PATCH v3 26/40] bsd-user/signal.c: Implement host_signal_handler

2022-01-28 Thread Warner Losh
Implement host_signal_handler to handle signals generated by the host and to do safe system calls. Signed-off-by: Stacey Son Signed-off-by: Kyle Evans Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/signal.c | 105 ++ 1 file c

[PATCH v3 39/40] bsd-user: Rename arg name for target_cpu_reset to env

2022-01-28 Thread Warner Losh
Rename the parameter name for target_cpu_reset's CPUArchState * arg from cpu to env. Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/arm/target_arch_cpu.h| 2 +- bsd-user/i386/target_arch_cpu.h | 4 ++-- bsd-user/x86_64/target_arch_cpu.h | 4 ++-- 3 files changed, 5

[PATCH v3 23/40] bsd-user: Add trace events for bsd-user

2022-01-28 Thread Warner Losh
Add the bsd-user specific events and infrastructure. Only include the linux-user trace events for linux-user, not bsd-user. Signed-off-by: Stacey Son Signed-off-by: Kyle Evans Signed-off-by: Warner Losh Reviewed-by: Peter Maydell Reviewed-by: Richard Henderson --- bsd-user/signal.c | 1

[PATCH v3 34/40] bsd-user/signal.c: process_pending_signals

2022-01-28 Thread Warner Losh
Process the currently queued signals. Signed-off-by: Stacey Son Signed-off-by: Kyle Evans Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/signal.c | 56 ++- 1 file changed, 55 insertions(+), 1 deletion(-) diff --git a/bsd-use

[PATCH v3 13/40] bsd-user/arm/target_arch_cpu.h: Correct code pointer

2022-01-28 Thread Warner Losh
The code has moved in FreeBSD since the emulator was started, update the comment to reflect that change. Signed-off-by: Warner Losh Reviewed-by: Peter Maydell Reviewed-by: Richard Henderson --- bsd-user/arm/target_arch_cpu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b

[PATCH v3 33/40] bsd-user/signal.c: tswap_siginfo

2022-01-28 Thread Warner Losh
Convert siginfo from targer to host. Signed-off-by: Stacey Son Signed-off-by: Kyle Evans Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/signal.c | 53 +++ 1 file changed, 53 insertions(+) diff --git a/bsd-user/signal.c b/bsd

[PATCH v3 25/40] bsd-user/signal.c: Implement rewind_if_in_safe_syscall

2022-01-28 Thread Warner Losh
Signed-off-by: Kyle Evans Signed-off-by: Warner Losh Reviewed-by: Peter Maydell Reviewed-by: Richard Henderson --- bsd-user/qemu.h | 2 ++ bsd-user/signal.c | 13 - 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h index 49f01932a53

[PATCH v3 29/40] bsd-user/signal.c: Fill in queue_signal

2022-01-28 Thread Warner Losh
Fill in queue signal implementation, as well as routines allocate and delete elements of the signal queue. Signed-off-by: Stacey Son Signed-off-by: Kyle Evans Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/qemu.h | 5 + bsd-user/signal.c | 13 - 2 fi

[PATCH v3 18/40] bsd-user/signal.c: Add si_type argument to queue_signal

2022-01-28 Thread Warner Losh
Mirror the linux-user practice and add a si_type argument to queue signal. This will be transported as the upper 8 bits in the si_type element of siginfo so that we know what bits of the structure are valid and so we can properly implement host_to_target_siginfo_noswap and tswap_siginfo. Adapt the

[PATCH v3 11/40] bsd-user/signal.c: implement cpu_loop_exit_sigbus

2022-01-28 Thread Warner Losh
First attempt at implementing cpu_loop_exit_sigbus, mostly copied from linux-user version of this function. Signed-off-by: Stacey Son Signed-off-by: Kyle Evans Signed-off-by: Warner Losh Reviewed-by: Peter Maydell Reviewed-by: Richard Henderson --- bsd-user/signal.c | 12 +--- 1 file

[PATCH v3 15/40] bsd-user/arm/target_arch_cpu.h: Implement data faults

2022-01-28 Thread Warner Losh
Update for the richer set of data faults that are now possible. Copied largely from linux-user/arm/cpu_loop.c, with minor typo fixes. Signed-off-by: Warner Losh Reviewed-by: Peter Maydell Reviewed-by: Richard Henderson --- bsd-user/arm/target_arch_cpu.h | 45 ++

[PATCH v3 24/40] bsd-user/signal.c: host_to_target_siginfo_noswap

2022-01-28 Thread Warner Losh
Implement conversion of host to target siginfo. Signed-off-by: Stacey Son Signed-off-by: Kyle Evans Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/signal.c | 113 ++ 1 file changed, 113 insertions(+) diff --git a/bsd-user/si

[PATCH v3 19/40] bsd-user/host/arm/host-signal.h: Implement host_signal_*

2022-01-28 Thread Warner Losh
Implement host_signal_pc, host_signal_set_pc and host_signal_write for arm. Signed-off-by: Kyle Evans Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/host/arm/host-signal.h | 35 + 1 file changed, 35 insertions(+) create mode 100644 bsd-u

[PATCH v3 09/40] bsd-user/signal-common.h: Move signal functions prototypes to here

2022-01-28 Thread Warner Losh
Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/arm/target_arch_cpu.h| 1 + bsd-user/i386/target_arch_cpu.h | 1 + bsd-user/qemu.h | 8 bsd-user/signal-common.h | 6 ++ bsd-user/x86_64/target_arch_cpu.h | 1 + 5 files changed,

[PATCH v3 12/40] bsd-user/arm/arget_arch_cpu.h: Move EXCP_DEBUG and EXCP_BKPT together

2022-01-28 Thread Warner Losh
Implement EXCP_DEBUG and EXCP_BKPT the same, as is done in linux-user. The prior adjustment of register 15 isn't needed, so remove that. Remove a redunant comment (that code in FreeBSD never handled break points). It's unclear why BKPT was an alias for system calls, but FreeBSD doesn't do that toda

[PATCH v3 14/40] bsd-user/arm/target_arch_cpu.h: Use force_sig_fault for EXCP_UDEF

2022-01-28 Thread Warner Losh
Use force_sig_fault to implement unknown opcode. This just uninlines that function, so simplify things by using it. Fold in EXCP_NOCP and EXCP_INVSTATE, as is done in linux-user. Make a note about slight differences with FreeBSD in case any of them turn out to be important later. Signed-off-by: Wa

[PATCH v3 10/40] bsd-user/signal.c: Implement cpu_loop_exit_sigsegv

2022-01-28 Thread Warner Losh
First attempt at implementing cpu_loop_exit_sigsegv, mostly copied from linux-user version of this function. Signed-off-by: Stacey Son Signed-off-by: Kyle Evans Signed-off-by: Warner Losh Reviewed-by: Peter Maydell Reviewed-by: Richard Henderson --- bsd-user/signal.c | 15 --- 1

[PATCH v3 08/40] bsd-user/signal.c: implement force_sig_fault

2022-01-28 Thread Warner Losh
Start to implement the force_sig_fault code. This currently just calls queue_signal(). The bsd-user fork version of that will handle this the synchronous nature of this call. Add signal-common.h to hold signal helper functions like force_sig_fault. Signed-off-by: Stacey Son Signed-off-by: Kyle Ev

[PATCH v3 07/40] bsd-user/arm/target_arch_cpu.h: Move EXCP_ATOMIC to match linux-user

2022-01-28 Thread Warner Losh
Move the EXCP_ATOMIC case to match linux-user/arm/cpu_loop.c:cpu_loop ordering. Signed-off-by: Warner Losh Reviewed-by: Peter Maydell Reviewed-by: Richard Henderson --- bsd-user/arm/target_arch_cpu.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bsd-user/arm/target_

[PATCH v3 00/40] bsd-user: upstream signal implementation

2022-01-28 Thread Warner Losh
Upstream the bsd-user fork signal implementation, for the most part. This series of commits represents nearly all of the infrastructure that surround signals, except the actual system call glue (that was also reworked in the fork and needs its own series). In addition, this adds the sigsegv and si

[PATCH v3 04/40] bsd-user/arm/signal.c: get_mcontext should zero vfp data

2022-01-28 Thread Warner Losh
FreeBSD's get_mcontext doesn't return any vfp data. Instead, it zeros out the vfp feilds (and all the spare fields). Impelement this behavior. We're still missing the sysarch(ARM_GET_VFPCONTEXT) syscall, though. Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/arm/signal.c

[PATCH v3 06/40] bsd-user: Bring in docs from linux-user for signal_pending

2022-01-28 Thread Warner Losh
This is currently unused, so no code adjustments are needed. Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/qemu.h | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h index 4dd209e402d..671b26f00cc 100644 --- a/bs

[PATCH v3 02/40] bsd-user: Create setup_sigframe_arch to setup sigframe context

2022-01-28 Thread Warner Losh
Define setup_sigframe_arch whose job it is to setup the mcontext for the sigframe. Implement for x86 to just call mcontext. Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/freebsd/target_os_signal.h | 3 +++ bsd-user/i386/signal.c | 13 + bsd-use

[PATCH v3 05/40] bsd-user: Remove vestiges of signal queueing code

2022-01-28 Thread Warner Losh
bsd-user was copied from linux-user at a time when it queued signals. Remove those vestiges of thse code. Retain the init function, even though it's now empty since other stuff will likely be added there. Make it static since it's not called from outside of main.c Signed-off-by: Warner Losh Revie

[PATCH v3 03/40] bsd-user/arm/signal.c: Implement setup_sigframe_arch for arm

2022-01-28 Thread Warner Losh
Fix the broken context setting for arm. FreeBSD's get_mcontext does not fill in the vfp info. It's filled in in sigframe(). This corresponds to the new setup_sigframe_arch which fills in mcontext, then adjusts it to point to the vfp context in the sigframe and fills in that context as well. Add poi

[PATCH v3 01/40] bsd-user: Complete FreeBSD siginfo

2022-01-28 Thread Warner Losh
Fill in the missing FreeBSD siginfo fields, and add some comments. Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/freebsd/target_os_siginfo.h | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/bsd-user/freebsd/target_os_siginfo.h b/bsd-u

[PULL 4/4] iotests/block-status-cache: New test

2022-01-28 Thread Eric Blake
From: Hanna Reitz Add a new test to verify that want_zero=false block-status calls do not pollute the block-status cache for want_zero=true calls. We check want_zero=true calls and their results using `qemu-img map` (over NBD), and want_zero=false calls also using `qemu-img map` over NBD, but us

[PULL 3/4] block/io: Update BSC only if want_zero is true

2022-01-28 Thread Eric Blake
From: Hanna Reitz We update the block-status cache whenever we get new information from a bdrv_co_block_status() call to the block driver. However, if we have passed want_zero=false to that call, it may flag areas containing zeroes as data, and so we would update the block-status cache with wron

[PULL 2/4] qapi/block: Cosmetic change in BlockExportType schema

2022-01-28 Thread Eric Blake
From: Philippe Mathieu-Daude Fix long line introduced in commit bb01ea73110 ("qapi/block: Restrict vhost-user-blk to CONFIG_VHOST_USER_BLK_SERVER"). Suggested-by: Markus Armbruster Acked-by: Markus Armbruster Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20220119121439.214821-1-f4...@ams

Re: [PATCH v13 2/7] net/vmnet: add vmnet backends to qapi/net

2022-01-28 Thread Akihiko Odaki
On Fri, Jan 28, 2022 at 11:30 PM Vladislav Yaroshchuk wrote: > > > > пт, 21 янв. 2022 г. в 16:03, Akihiko Odaki : >> >> On Fri, Jan 21, 2022 at 9:19 PM Vladislav Yaroshchuk >> wrote: >> > >> > >> > чт, 20 янв. 2022 г. в 11:32, Roman Bolshakov : >> >> >> >> On Thu, Jan 13, 2022 at 08:22:14PM +0300

Re: [PATCH v2 2/2] iotests/block-status-cache: New test

2022-01-28 Thread Eric Blake
On Fri, Jan 28, 2022 at 02:50:51PM -0600, Eric Blake wrote: > On Tue, Jan 18, 2022 at 06:00:00PM +0100, Hanna Reitz wrote: > > Add a new test to verify that want_zero=false block-status calls do not > > pollute the block-status cache for want_zero=true calls. > > > > We check want_zero=true calls

[PULL 1/4] nbd/server.c: Remove unused field

2022-01-28 Thread Eric Blake
From: Nir Soffer NBDRequestData struct has unused QSIMPLEQ_ENTRY field. It seems that this field exists since the first git commit and was never used. Signed-off-by: Nir Soffer Message-Id: <2022094313.581486-1-nsof...@redhat.com> Reviewed-by: Philippe Mathieu-Daudé Fixes: d9a73806 ("qemu-n

[PULL 0/4] NBD patches for 2022-01-28

2022-01-28 Thread Eric Blake
The following changes since commit 7a1043cef91739ff4b59812d30f1ed2850d3d34e: Merge remote-tracking branch 'remotes/bonzini-gitlab/tags/for-upstream' into staging (2022-01-28 14:04:01 +) are available in the Git repository at: https://repo.or.cz/qemu/ericb.git tags/pull-nbd-2022-01-28 f

[PATCH 11/11] target/ppc: booke: System Reset exception cleanup

2022-01-28 Thread Fabiano Rosas
There is no MSR_HV in BookE, so remove all of the HV logic. Signed-off-by: Fabiano Rosas --- target/ppc/excp_helper.c | 18 ++ 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c index 7c228dac58..7d7d0a08b5 100644 --

[PATCH 05/11] target/ppc: booke: Data Storage exception cleanup

2022-01-28 Thread Fabiano Rosas
There is no DSISR or DAR in BookE. Change to ESR and DEAR. Signed-off-by: Fabiano Rosas --- target/ppc/excp_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c index 4753b81527..c8bd78d5cb 100644 --- a/target/ppc/excp_h

[PATCH 07/11] target/ppc: booke: External interrupt cleanup

2022-01-28 Thread Fabiano Rosas
There is no LPES0 in BookE and no MSR_HV. Signed-off-by: Fabiano Rosas --- target/ppc/excp_helper.c | 33 - 1 file changed, 33 deletions(-) diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c index 8340146902..6d86ae04eb 100644 --- a/target/ppc/excp_

[PATCH 09/11] target/ppc: booke: System Call exception cleanup

2022-01-28 Thread Fabiano Rosas
QEMU does not support BookE as a hypervisor. Signed-off-by: Fabiano Rosas --- target/ppc/excp_helper.c | 21 ++--- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c index dfcb9995b8..a5134e360c 100644 --- a/target/p

[PATCH 08/11] target/ppc: booke: Alignment interrupt cleanup

2022-01-28 Thread Fabiano Rosas
BookE has no DSISR or DAR. The proper registers ESR and DEAR were already set at this point. Signed-off-by: Fabiano Rosas --- target/ppc/excp_helper.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c index 6d86ae04eb..dfcb9995b8 100644

[PATCH 06/11] target/ppc: booke: Instruction storage exception cleanup

2022-01-28 Thread Fabiano Rosas
The SRR1 should be set to the MSR value. There are no diagnostic bits in the SRR1 for BookE. Note that this fixes a bug where MSR_GS would be set and Linux would go into KVM code when there's no KVM guest. Signed-off-by: Fabiano Rosas --- target/ppc/excp_helper.c | 1 - 1 file changed, 1 deleti

[PATCH 10/11] target/ppc: booke: Watchdog Timer interrupt

2022-01-28 Thread Fabiano Rosas
Remove the switch as this function applies to BookE only. Signed-off-by: Fabiano Rosas --- target/ppc/excp_helper.c | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c index a5134e360c..7c228dac58 100644 --- a/target

[PATCH 04/11] target/ppc: booke: Machine Check cleanups

2022-01-28 Thread Fabiano Rosas
There's no MSR_HV in BookE. Also remove 40x code. Signed-off-by: Fabiano Rosas --- target/ppc/excp_helper.c | 29 ++--- 1 file changed, 6 insertions(+), 23 deletions(-) diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c index 8a656ace6f..4753b81527 100644

[PATCH 02/11] target/ppc: Simplify powerpc_excp_booke

2022-01-28 Thread Fabiano Rosas
Differences from the generic powerpc_excp code: - No MSR bits are cleared at interrupt dispatch; - No MSR_HV; - No power saving states; - No Hypervisor Emulation Assistance; - SPEU needs special handling; - Big endian only; - Both 64 and 32 bits; - No System call vectored; - No Alternate Interrupt

[PATCH 01/11] target/ppc: Introduce powerpc_excp_booke

2022-01-28 Thread Fabiano Rosas
Introduce a new powerpc_excp function specific for BookE CPUs. This commit copies powerpc_excp_legacy verbatim so the next one has a clean diff. Signed-off-by: Fabiano Rosas --- target/ppc/excp_helper.c | 474 +++ 1 file changed, 474 insertions(+) diff --git

[PATCH 00/11] target/ppc: powerpc_excp improvements [BookE] (6/n)

2022-01-28 Thread Fabiano Rosas
This series handles the BookE exception code. Tested the following machines/CPUs: == bamboo == 440ep, 460ex, 440-xilinx-w-dfpu == sam460ex == 440ep, 460ex, 440-xilinx-w-dfpu == mpc8544ds == e500v1, e500v2 == ppce500 == e500mc, e5500, e6500 About the remaining CPUs: - The 440x4 have been part

[PATCH 03/11] target/ppc: booke: Critical exception cleanup

2022-01-28 Thread Fabiano Rosas
Remove 40x and G2 code. Signed-off-by: Fabiano Rosas --- target/ppc/excp_helper.c | 17 ++--- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c index 596c16a678..8a656ace6f 100644 --- a/target/ppc/excp_helper.c +++ b/ta

[PATCH v2] 9pfs: Fix segfault in do_readdir_many caused by struct dirent overread

2022-01-28 Thread Vitaly Chikunov
`struct dirent' returned from readdir(3) could be shorter than `sizeof(struct dirent)', thus memcpy of sizeof length will overread into unallocated page causing SIGSEGV. Example stack trace: #0 0x559ebeed v9fs_co_readdir_many (/usr/bin/qemu-system-x86_64 + 0x497eed) #1 0x559ec

[PATCH] target/ppc: Remove 440x4 CPU

2022-01-28 Thread Fabiano Rosas
This CPU was partially removed due to lack of support in 2017 by commit aef7796057 ("ppc: remove non implemented cpu models"). Signed-off-by: Fabiano Rosas --- target/ppc/cpu_init.c | 83 --- 1 file changed, 83 deletions(-) diff --git a/target/ppc/cpu_ini

Re: Block alignment of qcow2 compress driver

2022-01-28 Thread Eric Blake
Adding libnbd list (libguestfs) in cc On Fri, Jan 28, 2022 at 11:56:19AM +, Richard W.M. Jones wrote: > > I hacked nbdcopy to ignore block alignment (the error actually comes > from libnbd refusing to send the unaligned request, not from > qemu-nbd), and indeed qemu-nbd accepts the unaligned

Re: [RFC] block/nbd: Move s->ioc on AioContext change

2022-01-28 Thread Eric Blake
On Fri, Jan 28, 2022 at 04:51:30PM +0100, Hanna Reitz wrote: > s->ioc must always be attached to the NBD node's AioContext. If that > context changes, s->ioc must be attached to the new context. Eww. Good catch; and looks like it is not the first time where we've run into issues (a quick grep fo

Re: Block alignment of qcow2 compress driver

2022-01-28 Thread Eric Blake
On Fri, Jan 28, 2022 at 01:30:53PM +, Richard W.M. Jones wrote: > > > > In qcow2, only the whole cluster can be compressed, so writing > > compressed data means having to write the whole cluster.  qcow2 > > could implement the padding by itself, but we decided to just leave > > the burden of o

Re: [PATCH] target/ppc: Remove support for the PowerPC 602 CPU

2022-01-28 Thread Cédric Le Goater
diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h index 66e13075c3df..b9119479958c 100644 --- a/target/ppc/cpu.h +++ b/target/ppc/cpu.h In cpu.h you could probably remove the MSR_AP and MSR_SA bit definitions as well. And the code in ppc_cpu_reset that sets them. done ! @@ -2142,8 +2142,6 @

Re: [PATCH] qapi/block: Cosmetic change in BlockExportType schema

2022-01-28 Thread Eric Blake
On Wed, Jan 19, 2022 at 01:14:39PM +0100, Philippe Mathieu-Daudé wrote: > From: Philippe Mathieu-Daude > > From: Philippe Mathieu-Daudé The doubled From: looks odd here. I'll double-check that git doesn't mess up the actual commit once I apply the patch. > > Fix long line introduced in commi

[PATCH v15 00/10] acpi: Error Record Serialization Table, ERST, support for QEMU

2022-01-28 Thread Eric DeVolder
This patchset introduces support for the ACPI Error Record Serialization Table, ERST. For background and implementation information, please see docs/specs/acpi_erst.rst, which is patch 2/10. Suggested-by: Konrad Wilk Signed-off-by: Eric DeVolder --- v15: 28jan2022 - Changes to build_erst() an

[PATCH v15 08/10] ACPI ERST: qtest for ERST

2022-01-28 Thread Eric DeVolder
This change provides a qtest that locates and then does a simple interrogation of the ERST feature within the guest. Signed-off-by: Eric DeVolder Reviewed-by: Ani Sinha --- tests/qtest/erst-test.c | 172 tests/qtest/meson.build | 2 + 2 files c

Re: [PATCH] target/ppc: Remove support for the PowerPC 602 CPU

2022-01-28 Thread Cédric Le Goater
On 1/28/22 15:13, Víctor Colombo wrote: On 28/01/2022 10:12, Cédric Le Goater wrote: The 602 was derived from the PowerPC 603, for the gaming market it seems. It was hardly used and no firmware supporting the CPU could be found. Drop support. Signed-off-by: Cédric Le Goater Hello Cédric! I a

[PATCH v15 09/10] ACPI ERST: bios-tables-test testcase

2022-01-28 Thread Eric DeVolder
This change implements the test suite checks for the ERST table. Signed-off-by: Eric DeVolder Reviewed-by: Ani Sinha --- tests/qtest/bios-tables-test.c | 54 ++ 1 file changed, 54 insertions(+) diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bi

Re: [PATCH v2 2/2] iotests/block-status-cache: New test

2022-01-28 Thread Eric Blake
On Tue, Jan 18, 2022 at 06:00:00PM +0100, Hanna Reitz wrote: > Add a new test to verify that want_zero=false block-status calls do not > pollute the block-status cache for want_zero=true calls. > > We check want_zero=true calls and their results using `qemu-img map` > (over NBD), and want_zero=fal

[PATCH v15 07/10] ACPI ERST: create ACPI ERST table for pc/x86 machines

2022-01-28 Thread Eric DeVolder
This change exposes ACPI ERST support for x86 guests. Signed-off-by: Eric DeVolder Reviewed-by: Ani Sinha --- hw/i386/acpi-build.c | 15 +++ hw/i386/acpi-microvm.c | 15 +++ include/hw/acpi/erst.h | 5 + 3 files changed, 35 insertions(+) diff --git a/hw/i386/acpi

[PATCH v15 06/10] ACPI ERST: build the ACPI ERST table

2022-01-28 Thread Eric DeVolder
This builds the ACPI ERST table to inform OSPM how to communicate with the acpi-erst device. Signed-off-by: Eric DeVolder Reviewed-by: Ani Sinha --- hw/acpi/erst.c | 211 + 1 file changed, 211 insertions(+) diff --git a/hw/acpi/erst.c b/h

Re: [PATCH v2 1/2] block/io: Update BSC only if want_zero is true

2022-01-28 Thread Eric Blake
On Tue, Jan 18, 2022 at 05:59:59PM +0100, Hanna Reitz wrote: > We update the block-status cache whenever we get new information from a > bdrv_co_block_status() call to the block driver. However, if we have > passed want_zero=false to that call, it may flag areas containing zeroes > as data, and so

[PATCH v15 04/10] ACPI ERST: header file for ERST

2022-01-28 Thread Eric DeVolder
This change introduces the public defintions for ACPI ERST. Signed-off-by: Eric DeVolder Reviewed-by: Ani Sinha --- include/hw/acpi/erst.h | 19 +++ 1 file changed, 19 insertions(+) create mode 100644 include/hw/acpi/erst.h diff --git a/include/hw/acpi/erst.h b/include/hw/acpi

[PATCH v15 05/10] ACPI ERST: support for ACPI ERST feature

2022-01-28 Thread Eric DeVolder
This implements a PCI device for ACPI ERST. This implements the non-NVRAM "mode" of operation for ERST as it is supported by Linux and Windows. Signed-off-by: Eric DeVolder Reviewed-by: Ani Sinha --- hw/acpi/Kconfig | 6 + hw/acpi/erst.c | 844 ++

[PATCH v15 10/10] ACPI ERST: step 6 of bios-tables-test.c

2022-01-28 Thread Eric DeVolder
Following the guidelines in tests/qtest/bios-tables-test.c, this is step 6. Below is the disassembly of tests/data/acpi/pc/ERST.acpierst. /* * Intel ACPI Component Architecture * AML/ASL+ Disassembler version 20180508 (64-bit version) * Copyright (c) 2000 - 2018 Intel Corporation * * D

[PATCH v15 01/10] ACPI ERST: bios-tables-test.c steps 1 and 2

2022-01-28 Thread Eric DeVolder
Following the guidelines in tests/qtest/bios-tables-test.c, this change adds empty placeholder files per step 1 for the new ERST table, and excludes resulting changed files in bios-tables-test-allowed-diff.h per step 2. Signed-off-by: Eric DeVolder Acked-by: Igor Mammedov --- tests/data/acpi/mi

[PATCH v15 02/10] ACPI ERST: specification for ERST support

2022-01-28 Thread Eric DeVolder
Information on the implementation of the ACPI ERST support. Signed-off-by: Eric DeVolder Acked-by: Ani Sinha --- docs/specs/acpi_erst.rst | 200 +++ 1 file changed, 200 insertions(+) create mode 100644 docs/specs/acpi_erst.rst diff --git a/docs/spec

[PATCH v15 03/10] ACPI ERST: PCI device_id for ERST

2022-01-28 Thread Eric DeVolder
This change reserves the PCI device_id for the new ACPI ERST device. Signed-off-by: Eric DeVolder Acked-by: Igor Mammedov Acked-by: Ani Sinha --- include/hw/pci/pci.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h index 023abc0..c3f3c90 100644 -

[PULL 31/36] migration: Tally pre-copy, downtime and post-copy bytes independently

2022-01-28 Thread Juan Quintela
From: David Edmondson Provide information on the number of bytes copied in the pre-copy, downtime and post-copy phases of migration. Signed-off-by: David Edmondson Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Juan Quintela Signed-off-by: Juan Quintela --- qapi/migration.json | 13

[PULL 32/36] migration: No off-by-one for pss->page update in host page size

2022-01-28 Thread Juan Quintela
From: Peter Xu We used to do off-by-one fixup for pss->page when finished one host huge page transfer. That seems to be unnecesary at all. Drop it. Cc: Keqian Zhu Cc: Kunkun Jiang Cc: Andrey Gruzdev Signed-off-by: Peter Xu Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Juan Quintela Si

[PULL 29/36] migration: Don't return for postcopy_send_discard_bm_ram()

2022-01-28 Thread Juan Quintela
From: Philippe Mathieu-Daudé postcopy_send_discard_bm_ram() always return zero. Since it can't fail, simplify and do not return anything. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: David Edmondson Reviewed-by: Juan Quintela Signed-off-by: Juan Quintela --- migration/ram.c | 6 +-

[PULL 36/36] migration: Move temp page setup and cleanup into separate functions

2022-01-28 Thread Juan Quintela
From: Peter Xu Temp pages will need to grow if we want to have multiple channels for postcopy, because each channel will need its own temp page to cache huge page data. Before doing that, cleanup the related code. No functional change intended. Since at it, touch up the errno handling a little

[PULL 35/36] migration: Simplify unqueue_page()

2022-01-28 Thread Juan Quintela
From: Peter Xu This patch simplifies unqueue_page() on both sides of it (itself, and caller). Firstly, due to the fact that right after unqueue_page() returned true, we'll definitely send a huge page (see ram_save_huge_page() call - it will _never_ exit before finish sending that huge page), so

[PULL 24/36] migration: Drop dead code of ram_debug_dump_bitmap()

2022-01-28 Thread Juan Quintela
From: Peter Xu I planned to add "#ifdef DEBUG_POSTCOPY" around the function too because otherwise it'll be compiled into qemu binary even if it'll never be used. Then I found that maybe it's easier to just drop it for good.. Signed-off-by: Peter Xu Reviewed-by: Philippe Mathieu-Daudé Reviewed

[PULL 30/36] migration: Introduce ram_transferred_add()

2022-01-28 Thread Juan Quintela
From: David Edmondson Replace direct manipulation of ram_counters.transferred with a function. Signed-off-by: David Edmondson Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Juan Quintela Signed-off-by: Juan Quintela --- migration/ram.c | 23 ++- 1 file changed, 14 inse

[PULL 22/36] migration: Report the error returned when save_live_iterate fails

2022-01-28 Thread Juan Quintela
From: David Edmondson Should qemu_savevm_state_iterate() encounter a failure when calling a particular save_live_iterate function, report the error code returned by the function. Signed-off-by: David Edmondson Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Juan Quintela Signed-off-by: Juan

[PULL 25/36] migration: Don't return for postcopy_chunk_hostpages()

2022-01-28 Thread Juan Quintela
From: Peter Xu It always return zero, because it just can't go wrong so far. Simplify the code with no functional change. Signed-off-by: Peter Xu Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Juan Quintela Signed-off-by: Juan Quintela --- migration/r

[PULL 18/36] Remove unnecessary minimum_version_id_old fields

2022-01-28 Thread Juan Quintela
From: Peter Maydell The migration code will not look at a VMStateDescription's minimum_version_id_old field unless that VMSD has set the load_state_old field to something non-NULL. (The purpose of minimum_version_id_old is to specify what migration version is needed for the code in the function

  1   2   3   4   >