Re: [PATCH v7 00/46] CXl 2.0 emulation Support

2022-03-10 Thread Peter Xu
On Wed, Mar 09, 2022 at 11:28:27AM +, Jonathan Cameron wrote: > Hi Peter, Hi, Jonathan, > > > > > https://lore.kernel.org/qemu-devel/20220306174137.5707-35-jonathan.came...@huawei.com/ > > > > Having mr->ops set but with memory_access_is_direct() returning true sounds > > weird to me. > >

Re: [RFC PATCH 2/2] tests: Add dirty page rate limit test

2022-03-10 Thread Peter Xu
On Wed, Mar 09, 2022 at 11:58:01PM +0800, huang...@chinatelecom.cn wrote: > From: Hyman Huang(黄勇) > > Add dirty page rate limit test if kernel support dirty ring, > create a standalone file to implement the test case. Thanks for writting this test case. > > Signed-off-by: Hyman Huang(黄勇) > --

Re: [RFC PATCH] tests/tcg: drop -cpu max from s390x sha512-mvx invocation

2022-03-10 Thread Thomas Huth
On 09/03/2022 12.22, Alex Bennée wrote: With -cpu max we get a warning: qemu-s390x: warning: 'msa5-base' requires 'kimd-sha-512'. But dropping the -cpu max and it still runs fine. Signed-off-by: Alex Bennée Cc: Thomas Huth --- tests/tcg/s390x/Makefile.target | 2 -- 1 file changed, 2 d

Re: [PATCH 2/6] tests/9pfs: Twalk with nwname=0

2022-03-10 Thread Christian Schoenebeck
On Mittwoch, 9. März 2022 14:24:24 CET Christian Schoenebeck wrote: > Send Twalk request with nwname=0. In this case no QIDs should > be returned by 9p server; this is equivalent to walking to dot. > > Signed-off-by: Christian Schoenebeck > --- > tests/qtest/virtio-9p-test.c | 22 +++

[PATCH 0/2] Enable notify VM exit

2022-03-10 Thread Chenyi Qiang
Notify VM exit is introduced to mitigate the potential DOS attach from malicious VM. This series is the userspace part to enable this feature through a new KVM capability KVM_CAP_X86_NOTIFY_VMEXIT. The corresponding KVM patch series is available at https://lore.kernel.org/lkml/20220310084001.10235

[PATCH 2/2] i386: Add notify VM exit support

2022-03-10 Thread Chenyi Qiang
There are cases that malicious virtual machine can cause CPU stuck (due to event windows don't open up), e.g., infinite loop in microcode when nested #AC (CVE-2015-5307). No event window means no event (NMI, SMI and IRQ) can be delivered. It leads the CPU to be unavailable to host or other VMs. Not

Re: [PATCH 3/6] tests/9pfs: compare QIDs in fs_walk_none() test

2022-03-10 Thread Christian Schoenebeck
On Mittwoch, 9. März 2022 15:49:04 CET Christian Schoenebeck wrote: > Extend previously added fs_walk_none() test by comparing the QID > of the root fid with the QID of the cloned fid. They should be > equal. > > Signed-off-by: Christian Schoenebeck > --- > tests/qtest/virtio-9p-test.c | 70

[PATCH 1/2] linux-headers: Sync the linux headers

2022-03-10 Thread Chenyi Qiang
Signed-off-by: Chenyi Qiang --- linux-headers/asm-x86/kvm.h | 4 linux-headers/linux/kvm.h | 29 - 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/linux-headers/asm-x86/kvm.h b/linux-headers/asm-x86/kvm.h index 2da3316bb5..44757bd612 100644 ---

Re: [PATCH 4/6] 9pfs: refactor 'name_idx' -> 'nvalid' in v9fs_walk()

2022-03-10 Thread Christian Schoenebeck
On Mittwoch, 9. März 2022 18:12:17 CET Christian Schoenebeck wrote: > The local variable 'name_idx' is used in two loops in function v9fs_walk(). > Let the first loop use its own variable 'nvalid' instead, which we will use > in subsequent patches as the number of (requested) path components > succ

Re: [PATCH 5/6] 9pfs: fix 'Twalk' to only send error if no component walked

2022-03-10 Thread Christian Schoenebeck
On Mittwoch, 9. März 2022 18:57:39 CET Christian Schoenebeck wrote: > Current implementation of 'Twalk' request handling always sends an 'Rerror' > response if any error occured. The 9p2000 protocol spec sais though: > > " > If the first element cannot be walked for any reason, Rerror is retur

Re: [PATCH 2/2] i386: Add notify VM exit support

2022-03-10 Thread Daniel P . Berrangé
On Thu, Mar 10, 2022 at 05:02:05PM +0800, Chenyi Qiang wrote: > There are cases that malicious virtual machine can cause CPU stuck (due > to event windows don't open up), e.g., infinite loop in microcode when > nested #AC (CVE-2015-5307). No event window means no event (NMI, SMI and > IRQ) can be d

Re: [PATCH v2 1/4] util/thread-pool: Fix thread pool freeing locking

2022-03-10 Thread Stefan Hajnoczi
On Thu, Mar 03, 2022 at 03:58:19PM +0100, Nicolas Saenz Julienne wrote: > Upon freeing a thread pool we need to get rid of any remaining worker. > This is achieved by setting the thread pool's topping flag, waking the s/topping/stopping/ > workers up, and waiting for them to exit one by one. The

Re: [PULL 0/9] I²C / SMBus / PMBus patches for 2022-03-08

2022-03-10 Thread Peter Maydell
On Tue, 8 Mar 2022 at 18:22, Philippe Mathieu-Daudé wrote: > > From: Philippe Mathieu-Daudé > > The following changes since commit 9740b907a5363c06ecf61e08b21966a81eb0dab4: > > Merge remote-tracking branch > 'remotes/pmaydell/tags/pull-target-arm-20220307' into staging (2022-03-08 > 15:26:10

Re: [PATCH 2/2] i386: Add notify VM exit support

2022-03-10 Thread Chenyi Qiang
On 3/10/2022 5:17 PM, Daniel P. Berrangé wrote: On Thu, Mar 10, 2022 at 05:02:05PM +0800, Chenyi Qiang wrote: There are cases that malicious virtual machine can cause CPU stuck (due to event windows don't open up), e.g., infinite loop in microcode when nested #AC (CVE-2015-5307). No event win

Re: [PATCH 2/2] i386: Add notify VM exit support

2022-03-10 Thread Daniel P . Berrangé
On Thu, Mar 10, 2022 at 05:53:05PM +0800, Chenyi Qiang wrote: > > > On 3/10/2022 5:17 PM, Daniel P. Berrangé wrote: > > On Thu, Mar 10, 2022 at 05:02:05PM +0800, Chenyi Qiang wrote: > > > There are cases that malicious virtual machine can cause CPU stuck (due > > > to event windows don't open up)

Re: [PATCH v2 1/4] util/thread-pool: Fix thread pool freeing locking

2022-03-10 Thread Nicolas Saenz Julienne
On Thu, 2022-03-10 at 09:20 +, Stefan Hajnoczi wrote: > On Thu, Mar 03, 2022 at 03:58:19PM +0100, Nicolas Saenz Julienne wrote: > > Upon freeing a thread pool we need to get rid of any remaining worker. > > This is achieved by setting the thread pool's topping flag, waking the > > s/topping/st

Re: [PATCH v5 18/20] jobs: protect job.aio_context with BQL and job_mutex

2022-03-10 Thread Emanuele Giuseppe Esposito
Am 08/03/2022 um 14:41 schrieb Stefan Hajnoczi: > It's not clear to me that .get_parent_aio_context() should only be > called from the main thread. The API is read-only so someone might try > to call from I/O code in the future expecting it to work like other > read-only graph APIs that are avai

Re: [RFC v4 01/21] vfio-user: introduce vfio-user protocol specification

2022-03-10 Thread John Levon
On Wed, Mar 09, 2022 at 03:34:53PM -0700, Alex Williamson wrote: > > +The only device-specific region type and subtype supported by vfio-user is > > +``VFIO_REGION_TYPE_MIGRATION`` (3) and ``VFIO_REGION_SUBTYPE_MIGRATION`` > > (1). > > These should be considered deprecated from the kernel interf

Re: [RFC PATCH] tests/tcg: drop -cpu max from s390x sha512-mvx invocation

2022-03-10 Thread Thomas Huth
On 10/03/2022 09.36, Thomas Huth wrote: On 09/03/2022 12.22, Alex Bennée wrote: With -cpu max we get a warning:    qemu-s390x: warning: 'msa5-base' requires 'kimd-sha-512'. But dropping the -cpu max and it still runs fine. Signed-off-by: Alex Bennée Cc: Thomas Huth ---   tests/tcg/s390x/Mak

Re: [PATCH v2 2/4] Introduce event-loop-base abstract class

2022-03-10 Thread Stefan Hajnoczi
On Thu, Mar 03, 2022 at 03:58:20PM +0100, Nicolas Saenz Julienne wrote: > @@ -2935,13 +2947,6 @@ qemu_syms = custom_target('qemu.syms', output: > 'qemu.syms', > capture: true, > command: [undefsym, nm, '@INPUT@']) > > -qom_ss = qom_ss.a

Re: [PATCH v5 19/20] job.c: enable job lock/unlock and remove Aiocontext locks

2022-03-10 Thread Emanuele Giuseppe Esposito
Am 08/03/2022 um 15:04 schrieb Stefan Hajnoczi: > On Tue, Feb 08, 2022 at 09:35:12AM -0500, Emanuele Giuseppe Esposito wrote: >> diff --git a/include/qemu/job.h b/include/qemu/job.h >> index ca46e46f5b..574110a1f2 100644 >> --- a/include/qemu/job.h >> +++ b/include/qemu/job.h >> @@ -75,11 +75,14

Re: [PATCH v2 3/4] util/main-loop: Introduce the main loop into QOM

2022-03-10 Thread Stefan Hajnoczi
On Thu, Mar 03, 2022 at 03:58:21PM +0100, Nicolas Saenz Julienne wrote: > 'event-loop-base' provides basic property handling for all 'AioContext' > based event loops. So let's define a new 'MainLoopClass' that inherits > from it. This will permit tweaking the main loop's properties through > qapi a

Re: [RFC PATCH] tests/tcg: drop -cpu max from s390x sha512-mvx invocation

2022-03-10 Thread Alex Bennée
Thomas Huth writes: > On 09/03/2022 12.22, Alex Bennée wrote: >> With -cpu max we get a warning: >>qemu-s390x: warning: 'msa5-base' requires 'kimd-sha-512'. >> But dropping the -cpu max and it still runs fine. >> Signed-off-by: Alex Bennée >> Cc: Thomas Huth >> --- >> tests/tcg/s390x/Ma

Re: [RFC PATCH] tests/tcg: drop -cpu max from s390x sha512-mvx invocation

2022-03-10 Thread Thomas Huth
On 10/03/2022 11.34, Alex Bennée wrote: Thomas Huth writes: On 09/03/2022 12.22, Alex Bennée wrote: With -cpu max we get a warning: qemu-s390x: warning: 'msa5-base' requires 'kimd-sha-512'. But dropping the -cpu max and it still runs fine. Signed-off-by: Alex Bennée Cc: Thomas Huth ---

Re: [PATCH v2 4/4] util/event-loop-base: Introduce options to set the thread pool size

2022-03-10 Thread Stefan Hajnoczi
On Thu, Mar 03, 2022 at 04:13:07PM +0100, Nicolas Saenz Julienne wrote: > @@ -537,10 +546,19 @@ > # 0 means that the engine will use its default > # (default:0, since 6.1) > # > +# @thread-pool-min: minimum number of threads readily available in the thread > +#

Re: [PATCH 04/18] tests: print newline after QMP response in qtest logs

2022-03-10 Thread Daniel P . Berrangé
On Mon, Mar 07, 2022 at 11:09:37AM +0100, Thomas Huth wrote: > On 07/03/2022 11.06, Daniel P. Berrangé wrote: > > On Mon, Mar 07, 2022 at 02:51:23PM +0800, Peter Xu wrote: > > > On Wed, Mar 02, 2022 at 05:49:18PM +, Daniel P. Berrangé wrote: > > > > The QMP commands have a trailing newline, but

Re: [PATCH 08/18] tests: merge code for UNIX and TCP migration pre-copy tests

2022-03-10 Thread Daniel P . Berrangé
On Mon, Mar 07, 2022 at 11:11:07AM +0100, Thomas Huth wrote: > On 02/03/2022 18.49, Daniel P. Berrangé wrote: > > The test cases differ only in the URI they provide to the migration > > commands, and the ability to set the dirty_ring mode. This code is > > trivially merged into a common helper. > >

Re: MAINTAINERS: macOS host support (was: MAINTAINERS: take edk2)

2022-03-10 Thread Daniel P . Berrangé
On Thu, Mar 10, 2022 at 12:00:35PM +0100, Christian Schoenebeck wrote: > On Mittwoch, 9. März 2022 12:44:16 CET Daniel P. Berrangé wrote: > > On Wed, Mar 09, 2022 at 11:40:42AM +0100, Christian Schoenebeck wrote: > > > On Mittwoch, 9. März 2022 11:05:02 CET Philippe Mathieu-Daudé wrote: > > > > Not

Re: MAINTAINERS: macOS host support (was: MAINTAINERS: take edk2)

2022-03-10 Thread Christian Schoenebeck
On Mittwoch, 9. März 2022 12:44:16 CET Daniel P. Berrangé wrote: > On Wed, Mar 09, 2022 at 11:40:42AM +0100, Christian Schoenebeck wrote: > > On Mittwoch, 9. März 2022 11:05:02 CET Philippe Mathieu-Daudé wrote: > > > Not sure what you have in mind. I'm totally new to the macOS/Darwin > > > world, a

[PATCH v2 5/9] dump: Add more offset variables

2022-03-10 Thread Janosch Frank
Offset calculations are easy enough to get wrong. Let's add a few variables to make moving around elf headers and data sections easier. Signed-off-by: Janosch Frank Reviewed-by: Marc-André Lureau --- dump/dump.c | 35 +++ include/sysemu/dump.h | 4

[PATCH v2 0/9] dump: Cleanup and consolidation

2022-03-10 Thread Janosch Frank
The dump/dump.c file has lots of duplicated code for handling 64 and 32 bit elf files. Additionally there are many instances where code can be improved by adding a variable to avoid having to specify the same calculation or check over and over. This series is the cleanup step onto which my series

[PATCH v2 2/9] dump: Remove the sh_info variable

2022-03-10 Thread Janosch Frank
There's no need to have phdr_num and sh_info at the same time. We can make phdr_num 32 bit and set PN_XNUM when we write the header if phdr_num >= PN_XNUM. Signed-off-by: Janosch Frank --- dump/dump.c | 34 ++ include/sysemu/dump.h | 3 +-- 2 files chan

[PATCH v2 6/9] dump: Introduce dump_is_64bit() helper function

2022-03-10 Thread Janosch Frank
Checking d_class in dump_info leads to lengthy conditionals so let's shorten things a bit by introducing a helper function. Signed-off-by: Janosch Frank --- dump/dump.c | 19 --- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/dump/dump.c b/dump/dump.c index 12b3a1

[PATCH v2 9/9] dump: Consolidate elf note function

2022-03-10 Thread Janosch Frank
Just like with the other write functions let's move the 32/64 bit elf handling to a function to improve readability. Signed-off-by: Janosch Frank --- dump/dump.c | 23 --- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/dump/dump.c b/dump/dump.c index 5542adf7b

[PATCH v2 8/9] dump: Cleanup dump_begin write functions

2022-03-10 Thread Janosch Frank
There's no need to have a gigantic if in there let's move the elf 32/64 bit logic into the section, segment or note code. Signed-off-by: Janosch Frank --- dump/dump.c | 42 +++--- 1 file changed, 11 insertions(+), 31 deletions(-) diff --git a/dump/dump.c b/du

[PATCH v2 4/9] dump: Remove the section if when calculating the memory offset

2022-03-10 Thread Janosch Frank
When s->shdr_num is 0 we'll add 0 bytes of section headers which is equivalent to not adding section headers but with the multiplication we can remove a if/else. Signed-off-by: Janosch Frank --- dump/dump.c | 24 1 file changed, 8 insertions(+), 16 deletions(-) diff --g

qemu-softmmu -cpu help broken

2022-03-10 Thread Max Filippov
Hello, I've noticed that the command qemu-system-xtensa -cpu help no longer prints anything. Apparently because cpu_list is no longer defined in list_cpus inside softmmu/cpus.c Bisection points to the following commit: e0220bb5b200 ("softmmu: Build target-agnostic objects once") Reverting the c

[PATCH v2 7/9] dump: Consolidate phdr note writes

2022-03-10 Thread Janosch Frank
There's no need to have two write functions. Let's rather have two functions that set the data for elf 32/64 and then write it in a common function. Signed-off-by: Janosch Frank --- dump/dump.c | 94 +++-- 1 file changed, 48 insertions(+), 46 delet

[PATCH 3/5] dump: Reorder struct DumpState

2022-03-10 Thread Janosch Frank
Let's move ELF related members into one block and guest memory related ones into another to improve readability. Signed-off-by: Janosch Frank --- include/sysemu/dump.h | 18 +++--- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/include/sysemu/dump.h b/include/sysemu/d

Re: [PATCH 04/18] tests: print newline after QMP response in qtest logs

2022-03-10 Thread Marc-André Lureau
Hi On Thu, Mar 10, 2022 at 2:56 PM Daniel P. Berrangé wrote: > On Mon, Mar 07, 2022 at 11:09:37AM +0100, Thomas Huth wrote: > > On 07/03/2022 11.06, Daniel P. Berrangé wrote: > > > On Mon, Mar 07, 2022 at 02:51:23PM +0800, Peter Xu wrote: > > > > On Wed, Mar 02, 2022 at 05:49:18PM +, Daniel

[PATCH 2/5] dump: Split write of section headers and data and add a prepare step

2022-03-10 Thread Janosch Frank
By splitting the writing of the section headers and (future) section data we prepare for the addition of a string table section and architecture sections. Signed-off-by: Janosch Frank --- dump/dump.c | 112 -- include/sysemu/dump.h | 4 ++ 2 fi

[PATCH v2 3/9] dump: Introduce shdr_num to decrease complexity

2022-03-10 Thread Janosch Frank
Let's move from a boolean to a int variable which will later enable us to store the number of sections that are in the dump file. Signed-off-by: Janosch Frank --- dump/dump.c | 24 include/sysemu/dump.h | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-

[PATCH 1/5] dump: Allocate header

2022-03-10 Thread Janosch Frank
Allocating the header lets us write it at a later time and hence also allows us to change section and segment table offsets until we finally write it. Signed-off-by: Janosch Frank --- dump/dump.c | 115 ++ include/sysemu/dump.h | 1 + 2 files c

[PATCH v2 1/9] dump: Use ERRP_GUARD()

2022-03-10 Thread Janosch Frank
Let's move to the new way of handling errors before changing the dump code. This patch has mostly been generated by the coccinelle script scripts/coccinelle/errp-guard.cocci. Signed-off-by: Janosch Frank --- dump/dump.c | 144 ++-- 1 file changed,

[PATCH 0/5] dump: Add custom arch section support

2022-03-10 Thread Janosch Frank
Architectures already provide custom cpu data via elf notes but there's currently no way for an architecture to add other custom data to dumps. s390x for instance needs to store special data in the dump when dumping protected guests so the vm owner can decrypt the dump and access the vm data. Sim

Re: [PATCH-for-7.0] aspeed: sbc: Correct default reset values

2022-03-10 Thread Philippe Mathieu-Daudé
On 10/3/22 06:21, Joel Stanley wrote: In order to correctly report secure boot running firmware, these values must be set. They are taken from a running machine when secure boot is enabled. We don't yet have documentation from ASPEED on what they mean. Set the raw values for now, and in the futu

[PATCH 5/5] dump/dump: Add arch section support

2022-03-10 Thread Janosch Frank
Add hooks which architectures can use to add arbitrary data to custom sections. Signed-off-by: Janosch Frank --- dump/dump.c| 21 ++--- include/sysemu/dump-arch.h | 27 +++ 2 files changed, 45 insertions(+), 3 deletions(-) diff --git a/dum

[PATCH 0/5] s390x: dump: Add PV dump support

2022-03-10 Thread Janosch Frank
This is the qemu part of the PV dump support where we take the data that the KVM PV dump API gives us and put it into the ELF file for later processing. The encrypted PV cpu state is added as an additional note like the other architecture registers. The storage state and completion data however a

Re: propagating vmgenid outward and upward

2022-03-10 Thread Alexander Graf
On 09.03.22 23:02, Jason A. Donenfeld wrote: Hi Alex, On Wed, Mar 9, 2022 at 3:10 AM Alexander Graf wrote: The vmgenid driver basically works, though it is racy, because that ACPI notification can arrive after the system is already running again. This I believe enough people already pointed

[PATCH v5 05/48] target/nios2: Split out helper for eret instruction

2022-03-10 Thread Richard Henderson
From: Amir Gonnen The implementation of eret will become much more complex with the introduction of shadow registers. Reviewed-by: Peter Maydell Signed-off-by: Amir Gonnen Message-Id: <20220303153906.2024748-3-amir.gon...@neuroblade.ai> [rth: Split out of a larger patch for shadow register set

[PATCH 4/5] dump/dump: Add section string table support

2022-03-10 Thread Janosch Frank
Time to add a bit more descriptiveness to the dumps. Signed-off-by: Janosch Frank --- dump/dump.c | 106 -- include/sysemu/dump.h | 1 + 2 files changed, 94 insertions(+), 13 deletions(-) diff --git a/dump/dump.c b/dump/dump.c index e4198e8f3e

[PATCH v5 06/48] target/nios2: Fix BRET instruction

2022-03-10 Thread Richard Henderson
We had failed to copy BSTATUS back to STATUS, and diagnose supervisor-only. The spec is light on the specifics of the implementation of bret, but it is an easy assumption that the restore into STATUS should work the same as eret. Therefore, reuse the existing helper_eret. Reported-by: Peter Mayd

[PATCH 2/5] s390x: Add protected dump cap

2022-03-10 Thread Janosch Frank
Signed-off-by: Janosch Frank --- target/s390x/kvm/kvm.c | 7 +++ target/s390x/kvm/kvm_s390x.h | 1 + 2 files changed, 8 insertions(+) diff --git a/target/s390x/kvm/kvm.c b/target/s390x/kvm/kvm.c index 6acf14d5ec..56ca5408db 100644 --- a/target/s390x/kvm/kvm.c +++ b/target/s390x/kvm/kvm

[PATCH v5 07/48] target/nios2: Do not create TCGv for control registers

2022-03-10 Thread Richard Henderson
We don't need to reference them often, and when we do it is just as easy to load/store from cpu_env directly. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/nios2/translate.c | 33 ++--- 1 file changed, 26 insertions(+), 7 deletions(-) diff -

[PATCH 1/5] linux header sync

2022-03-10 Thread Janosch Frank
Signed-off-by: Janosch Frank --- linux-headers/linux/kvm.h | 55 +++ 1 file changed, 55 insertions(+) diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h index 00af3bc333..ead1d51cb5 100644 --- a/linux-headers/linux/kvm.h +++ b/linux-headers/lin

[PATCH 5/5] s390x: pv: Add dump support

2022-03-10 Thread Janosch Frank
Sometimes dumping a guest from the outside is the only way to get the data that is needed. This can be the case if a dumping mechanism like KDUMP hasn't been configured or data needs to be fetched at a specific point. Dumping a protected guest from the outside without help from fw/hw doesn't yield

[PATCH v5 08/48] linux-user/nios2: Only initialize SP and PC in target_cpu_copy_regs

2022-03-10 Thread Richard Henderson
Drop the set of estatus in init_thread; it was clearly intended to be setting the value of CR_STATUS for the application, but we never actually performed that copy. However, the proper value is set in nios2_cpu_reset so we don't need to do anything here. We only initialize SP and EA in init_threa

[PATCH v5 31/48] target/nios2: Use tcg_constant_tl

2022-03-10 Thread Richard Henderson
Replace current uses of tcg_const_tl, and remove the frees. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/nios2/translate.c | 30 ++ 1 file changed, 6 insertions(+), 24 deletions(-) diff --git a/target/nios2/translate.c b/target/nios2/transl

[PATCH 3/5] s390x: Introduce PV query interface

2022-03-10 Thread Janosch Frank
Introduce an interface over which we can get information about UV data. Signed-off-by: Janosch Frank --- hw/s390x/pv.c | 61 ++ hw/s390x/s390-virtio-ccw.c | 5 include/hw/s390x/pv.h | 10 +++ 3 files changed, 76 insertions(+) diff

[PATCH v5 11/48] target/nios2: Do not zero the general registers on reset

2022-03-10 Thread Richard Henderson
The bulk of the general register set is undefined on reset. The zero register is for the most part special-cased in translate, but the slot is still exposed to gdbstub and nios2_cpu_dump_state, so continue to make sure that's zeroed. Signed-off-by: Richard Henderson --- target/nios2/cpu.c | 6 +

[PATCH v5 01/48] target/nios2: Check supervisor on eret

2022-03-10 Thread Richard Henderson
From: Amir Gonnen eret instruction is only allowed in supervisor mode. Reviewed-by: Peter Maydell Reviewed-by: Richard Henderson Signed-off-by: Amir Gonnen Message-Id: <20220303153906.2024748-2-amir.gon...@neuroblade.ai> Signed-off-by: Richard Henderson --- target/nios2/translate.c | 2 ++

[PATCH v5 33/48] target/nios2: Drop CR_STATUS_EH from tb->flags

2022-03-10 Thread Richard Henderson
There's nothing about EH that affects translation, so there's no need to include it in tb->flags. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/nios2/cpu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/nios2/cpu.h b/target/nios2/cpu.h index

[PATCH v5 03/48] target/nios2: Add NUM_GP_REGS and NUM_CP_REGS

2022-03-10 Thread Richard Henderson
From: Amir Gonnen Split NUM_CORE_REGS into components that can be used elsewhere. Reviewed-by: Peter Maydell Signed-off-by: Amir Gonnen Message-Id: <20220303153906.2024748-3-amir.gon...@neuroblade.ai> [rth: Split out of a larger patch for shadow register sets.] Signed-off-by: Richard Henderson

[PATCH 4/5] s390x: Add KVM PV dump interface

2022-03-10 Thread Janosch Frank
Let's add a few bits of code which hide the new KVM PV dump API from us via new functions. Signed-off-by: Janosch Frank --- hw/s390x/pv.c | 52 +++ include/hw/s390x/pv.h | 8 +++ 2 files changed, 60 insertions(+) diff --git a/hw/s390x/pv.c b/

[PATCH v5 12/48] target/nios2: Clean up nios2_cpu_dump_state

2022-03-10 Thread Richard Henderson
Do not print control registers for user-only mode. Rename reserved control registers to "resN", where N is the control register index. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/nios2/translate.c | 19 +-- 1 file changed, 9 insertions(+), 10 deletions

[PATCH v5 44/48] target/nios2: Implement EIC interrupt processing

2022-03-10 Thread Richard Henderson
This is the cpu side of the operation. Register one irq line, called EIC. Split out the rather different processing to a separate function. Delay initialization of gpio irqs until realize. We need to provide a window after init in which the board can set eic_present. Signed-off-by: Richard Hen

Re: [PULL 0/9] I²C / SMBus / PMBus patches for 2022-03-08

2022-03-10 Thread Philippe Mathieu-Daudé
On 10/3/22 10:18, Peter Maydell wrote: On Tue, 8 Mar 2022 at 18:22, Philippe Mathieu-Daudé wrote: From: Philippe Mathieu-Daudé The following changes since commit 9740b907a5363c06ecf61e08b21966a81eb0dab4: Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20220307' into

[PATCH v5 14/48] target/nios2: Use hw/registerfields.h for CR_EXCEPTION fields

2022-03-10 Thread Richard Henderson
Use FIELD_DP32 instead of manual shifting and masking. Signed-off-by: Richard Henderson --- target/nios2/cpu.h| 4 target/nios2/helper.c | 37 ++--- 2 files changed, 26 insertions(+), 15 deletions(-) diff --git a/target/nios2/cpu.h b/target/nios2/cpu.h

[PATCH v5 13/48] target/nios2: Use hw/registerfields.h for CR_STATUS fields

2022-03-10 Thread Richard Henderson
Add all fields; retain the helper macros for single bit fields. So far there are no uses of the multi-bit status fields. Signed-off-by: Richard Henderson --- target/nios2/cpu.h | 28 +++- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/target/nios2/cpu.h b/

[PATCH v5 00/48] target/nios2: Shadow register set, EIC and VIC

2022-03-10 Thread Richard Henderson
This has grown quite beyond merely implementing $SUBJECT, which are only the last 8 patches of the set. Version 5 addresses all of the feedback from v4, fixes some further bugs in the base exception handling, implements some missing exceptions. r~ Amir Gonnen (5): target/nios2: Check supervi

[PATCH v5 45/48] hw/intc: Vectored Interrupt Controller (VIC)

2022-03-10 Thread Richard Henderson
From: Amir Gonnen Implement nios2 Vectored Interrupt Controller (VIC). VIC is connected to EIC. It needs to update rha, ril, rrs and rnmi fields on Nios2CPU before raising an IRQ. For that purpose, VIC has a "cpu" property which should refer to the nios2 cpu and set by the board that connects VIC

[PATCH v5 16/48] target/nios2: Use hw/registerfields.h for CR_TLBACC fields

2022-03-10 Thread Richard Henderson
Retain the helper macros for single bit fields as aliases to the longer R_*_MASK names. Use FIELD_EX32 and FIELD_DP32 instead of manually manipulating the fields. Since we're rewriting the references to CR_TLBACC_IGN_* anyway, we correct the name of this field to IG, which is its name in the offi

[PATCH v5 15/48] target/nios2: Use hw/registerfields.h for CR_TLBADDR fields

2022-03-10 Thread Richard Henderson
Use FIELD_EX32 and FIELD_DP32 instead of manual manipulation of the fields. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/nios2/cpu.h | 8 target/nios2/helper.c| 4 ++-- target/nios2/mmu.c | 17 + target/nios2/translate.c | 2

[PATCH v5 47/48] hw/nios2: Move memory regions into Nios2Machine

2022-03-10 Thread Richard Henderson
Convert to contiguous allocation, as much as possible so far. The two timer objects are not exposed for subobject allocation. Reviewed-by: Mark Cave-Ayland Signed-off-by: Richard Henderson --- hw/nios2/10m50_devboard.c | 30 -- 1 file changed, 16 insertions(+), 14 de

[PATCH v5 02/48] target/nios2: Stop generating code if gen_check_supervisor fails

2022-03-10 Thread Richard Henderson
Whether the cpu is in user-mode or not is something that we know at translation-time. We do not need to generate code after having raised an exception. Suggested-by: Peter Maydell Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/nios2/translate.c | 20 +++

[PATCH v5 19/48] target/nios2: Move R_FOO and CR_BAR into enumerations

2022-03-10 Thread Richard Henderson
These symbols become available to the debugger. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/nios2/cpu.h | 72 ++ 1 file changed, 35 insertions(+), 37 deletions(-) diff --git a/target/nios2/cpu.h b/target/nios2/cpu.h index 7

[PATCH v5 17/48] target/nios2: Rename CR_TLBMISC_WR to CR_TLBMISC_WE

2022-03-10 Thread Richard Henderson
WE is the architectural name of the field, not WR. Signed-off-by: Richard Henderson --- target/nios2/cpu.h| 2 +- target/nios2/helper.c | 4 ++-- target/nios2/mmu.c| 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/target/nios2/cpu.h b/target/nios2/cpu.h index 25b77

Re: [PATCH 04/18] tests: print newline after QMP response in qtest logs

2022-03-10 Thread Daniel P . Berrangé
On Thu, Mar 10, 2022 at 03:11:08PM +0400, Marc-André Lureau wrote: > Hi > > On Thu, Mar 10, 2022 at 2:56 PM Daniel P. Berrangé > wrote: > > > On Mon, Mar 07, 2022 at 11:09:37AM +0100, Thomas Huth wrote: > > > On 07/03/2022 11.06, Daniel P. Berrangé wrote: > > > > On Mon, Mar 07, 2022 at 02:51:23

[PATCH v5 20/48] target/nios2: Create EXCP_SEMIHOST for semi-hosting

2022-03-10 Thread Richard Henderson
Decode 'break 1' during translation, rather than doing it again during exception processing. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/nios2/cpu.h | 1 + target/nios2/helper.c| 14 ++ target/nios2/translate.c | 17 - 3 files ch

[PATCH v5 21/48] target/nios2: Clean up nios2_cpu_do_interrupt

2022-03-10 Thread Richard Henderson
Split out do_exception and do_iic_irq to handle bulk of the interrupt and exception processing. Parameterize the changes required to cpu state. The status.EH bit, which protects some data against double-faults, is only present with the MMU. Several exception cases did not check for status.EH bei

[PATCH v5 04/48] target/nios2: Split PC out of env->regs[]

2022-03-10 Thread Richard Henderson
It is cleaner to have a separate name for this variable. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/nios2/cpu.h | 10 +++- linux-user/elfload.c| 2 +- linux-user/nios2/cpu_loop.c | 17 ++--- linux-user/nios2/signal.c | 6 ++--- target

[PATCH v5 32/48] target/nios2: Introduce dest_gpr

2022-03-10 Thread Richard Henderson
Constrain all references to cpu_R[] to load_gpr and dest_gpr. This will be required for supporting shadow register sets. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/nios2/translate.c | 153 ++- 1 file changed, 55 insertions(+), 98 d

[PATCH v5 22/48] target/nios2: Hoist CPU_LOG_INT logging

2022-03-10 Thread Richard Henderson
Performing this early means that we can merge more cases within the non-logging switch statement. Signed-off-by: Richard Henderson --- target/nios2/helper.c | 58 +++ 1 file changed, 47 insertions(+), 11 deletions(-) diff --git a/target/nios2/helper.c b/t

[PATCH v5 09/48] target/nios2: Remove cpu_interrupts_enabled

2022-03-10 Thread Richard Henderson
This function is unused. The real computation of this value is located in nios2_cpu_exec_interrupt. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/nios2/cpu.h | 5 - 1 file changed, 5 deletions(-) diff --git a/target/nios2/cpu.h b/target/nios2/cpu.h index 9be128d63

[PATCH v5 10/48] target/nios2: Split control registers away from general registers

2022-03-10 Thread Richard Henderson
Place the control registers into their own array, env->ctrl[]. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/nios2/cpu.h | 43 target/nios2/cpu.c | 19 +++ target/nios2/helper.c| 106 +++ target/

[PATCH v5 27/48] target/nios2: Implement cpuid

2022-03-10 Thread Richard Henderson
Copy the existing cpu_index into the space reserved for CR_CPUID. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/nios2/cpu.c | 4 1 file changed, 4 insertions(+) diff --git a/target/nios2/cpu.c b/target/nios2/cpu.c index ce2b0c6493..d491360973 100644 --- a/target/n

[PATCH v5 34/48] target/nios2: Enable unaligned traps for system mode

2022-03-10 Thread Richard Henderson
Unaligned traps are optional, but required with an mmu. Turn them on always, because the fallback behaviour is not documented (though presumably it discards low bits). Enable alignment checks in the config file. Unwind the guest pc properly from do_unaligned_access. Signed-off-by: Richard Henders

[PATCH v5 37/48] target/nios2: Use gen_goto_tb for DISAS_TOO_MANY

2022-03-10 Thread Richard Henderson
Depending on the reason for ending the TB, we can chain to the next TB because the PC is constant. Signed-off-by: Richard Henderson --- target/nios2/translate.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/target/nios2/translate.c b/target/nios2/translate.c index 51907

[PATCH v5 26/48] target/nios2: Prevent writes to read-only or reserved control fields

2022-03-10 Thread Richard Henderson
Create an array of masks which detail the writable and readonly bits for each control register. Apply them when writing to control registers, including the write to status during eret. Signed-off-by: Richard Henderson --- target/nios2/cpu.h | 13 ++ target/nios2/cpu.c | 94 +

[PATCH v5 18/48] target/nios2: Use hw/registerfields.h for CR_TLBMISC fields

2022-03-10 Thread Richard Henderson
Use FIELD_EX32 and FIELD_DP32 instead of managing the masking by hand. Signed-off-by: Richard Henderson --- target/nios2/cpu.h | 29 +++-- target/nios2/helper.c| 7 ++- target/nios2/mmu.c | 35 +-- target/nios2/translat

[PATCH v5 23/48] target/nios2: Handle EXCP_UNALIGN and EXCP_UALIGND

2022-03-10 Thread Richard Henderson
These misaligned data and misaligned destination exceptions are defined, but not currently raised. Signed-off-by: Richard Henderson --- target/nios2/helper.c | 8 1 file changed, 8 insertions(+) diff --git a/target/nios2/helper.c b/target/nios2/helper.c index 285f3aae1d..0392c0ea84 100

[PATCH v5 48/48] hw/nios2: Machine with a Vectored Interrupt Controller

2022-03-10 Thread Richard Henderson
From: Amir Gonnen Demonstrate how to use nios2 VIC on a machine. Introduce a new machine property to attach a VIC. When VIC is present, let the CPU know that it should use the External Interrupt Interface instead of the Internal Interrupt Interface. The devices on the machine are attached to the

[PATCH v5 28/48] target/nios2: Implement CR_STATUS.RSIE

2022-03-10 Thread Richard Henderson
Without EIC, this bit is RES1. So set the bit at reset, and add it to the readonly fields of CR_STATUS. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/nios2/cpu.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/target/nios2/cpu.c b/target/nios2/

[PATCH v5 30/48] target/nios2: Support division error exception

2022-03-10 Thread Richard Henderson
Division may (optionally) raise a division exception. Since the linux kernel has been prepared for this for some time, enable it by default. Signed-off-by: Richard Henderson --- target/nios2/cpu.h | 2 ++ target/nios2/helper.h | 2 ++ linux-user/nios2/cpu_loop.c | 4 +++ target

[PATCH v5 24/48] target/nios2: Cleanup set of CR_EXCEPTION for do_interrupt

2022-03-10 Thread Richard Henderson
The register is entirely read-only for software, and we do not implement ECC, so we need not deposit the cause into an existing value; just create a new value from scratch. Furthermore, exception.CAUSE is not written for break exceptions. Signed-off-by: Richard Henderson --- target/nios2/helper

Re: [RFC PATCH] tests/tcg: drop -cpu max from s390x sha512-mvx invocation

2022-03-10 Thread Alex Bennée
Thomas Huth writes: > On 10/03/2022 11.34, Alex Bennée wrote: >> Thomas Huth writes: >> >>> On 09/03/2022 12.22, Alex Bennée wrote: With -cpu max we get a warning: qemu-s390x: warning: 'msa5-base' requires 'kimd-sha-512'. But dropping the -cpu max and it still runs fine. >>

Re: [PATCH 04/18] tests: print newline after QMP response in qtest logs

2022-03-10 Thread Thomas Huth
On 10/03/2022 12.35, Daniel P. Berrangé wrote: On Thu, Mar 10, 2022 at 03:11:08PM +0400, Marc-André Lureau wrote: Hi On Thu, Mar 10, 2022 at 2:56 PM Daniel P. Berrangé wrote: On Mon, Mar 07, 2022 at 11:09:37AM +0100, Thomas Huth wrote: On 07/03/2022 11.06, Daniel P. Berrangé wrote: On Mon,

[PATCH v5 25/48] target/nios2: Clean up handling of tlbmisc in do_exception

2022-03-10 Thread Richard Henderson
The 4 lower bits, D, PERM, BAD, DBL, are unconditionally set on any exception with EH=0, or so says Table 42 (Processor Status After Taking Exception). We currently do not set PERM or BAD at all, and only set/clear DBL for tlb miss, and do not clear DBL for any other exception. It is a bit confus

[PATCH v5 35/48] target/nios2: Create gen_jumpr

2022-03-10 Thread Richard Henderson
Split out a function to perform an indirect branch. Signed-off-by: Richard Henderson --- target/nios2/translate.c | 27 +-- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/target/nios2/translate.c b/target/nios2/translate.c index d5f2e98de9..f61ba92052 100

Re: [PATCH v5 06/48] target/nios2: Fix BRET instruction

2022-03-10 Thread Peter Maydell
On Thu, 10 Mar 2022 at 11:27, Richard Henderson wrote: > > We had failed to copy BSTATUS back to STATUS, and diagnose > supervisor-only. The spec is light on the specifics of the > implementation of bret, but it is an easy assumption that > the restore into STATUS should work the same as eret. >

  1   2   3   4   >