Re: [PATCH v11 19/26] linux-user: Add LoongArch signal support

2021-11-23 Thread gaosong
Hi Richard, On 2021/11/24 下午3:27, Richard Henderson wrote: On 11/24/21 3:46 AM, gaosong wrote: Hi Richard, On 2021/11/20 下午6:33, Richard Henderson wrote: On 11/19/21 7:13 AM, Song Gao wrote: + +struct target_sigcontext { +    uint64_t   sc_pc; +    uint64_t   sc_gpr[32]; +    uint64_t  

Re: [PATCH] virtio-balloon: correct used length

2021-11-23 Thread Michael S. Tsirkin
On Wed, Nov 24, 2021 at 12:32:55PM +0800, Jason Wang wrote: > Spec said: > > "and len the total of bytes written into the buffer." > > For inflateq, deflateq and statsq, we don't process in_sg so the used > length should be zero. For free_page_vq, though the free pages are > supplied via in_sgs,

Re: [PATCH] microvm: use MachineState->dumpdtb

2021-11-23 Thread Philippe Mathieu-Daudé
On 11/24/21 08:24, Igor Mammedov wrote: > On Tue, 23 Nov 2021 10:16:48 +0100 > Gerd Hoffmann wrote: > >> There already is a machine property to dumb the device tree for > s/dumb/dump/ > > >> debugging purposes, and the helper function qemu_fdt_dumpdtb() >> implementing the dumbing. Make

Re: [PATCH 2/4] include/sysemu/blockdev.h: rename if_name in block_if_name

2021-11-23 Thread Philippe Mathieu-Daudé
On 11/24/21 07:36, Emanuele Giuseppe Esposito wrote: > In preparation to next patch, where we export it to be used > also in softmmu/vlc.c "vl.c"? :) > > Signed-off-by: Emanuele Giuseppe Esposito > --- > blockdev.c | 14 +++--- > 1 file changed, 7 insertions(+), 7 deletions(-)

Re: [PATCH 4/4] include/sysemu/blockdev.h: remove drive_get_max_devs

2021-11-23 Thread Philippe Mathieu-Daudé
On 11/24/21 07:36, Emanuele Giuseppe Esposito wrote: > Remove drive_get_max_devs, as it is not used by anyone. Maybe complete: Last use was removed in commit 8f2d75e81d5 ("hw: Drop superfluous special checks for orphaned -drive"). > Signed-off-by: Emanuele Giuseppe Esposito > --- >

How to enable virgl in headless mode?

2021-11-23 Thread Yonggang Luo
Here is my command line ``` qemu-system-arm ^ -monitor telnet:127.0.0.1:5318,server=on,wait=off,nodelay=on ^ -serial telnet:127.0.0.1:5319,server=on,wait=on,nodelay=on ^ -parallel none ^ -cpu cortex-a15 -smp 4 -M virt -m 2G ^ -kernel armhf-installed/vmlinuz ^ -initrd

Re: [PATCH v1 1/7] softmmu: fix watchpoint-interrupt races

2021-11-23 Thread Richard Henderson
On 11/23/21 9:57 PM, Alex Bennée wrote: From: Pavel Dovgalyuk Watchpoint may be processed in two phases. First one is detecting the instruction with target memory access. And the second one is executing only one instruction and setting the debug interrupt flag. Hardware interrupts can break

[PATCH v5 28/31] block.c: assert BQL lock held in bdrv_co_invalidate_cache

2021-11-23 Thread Emanuele Giuseppe Esposito
bdrv_co_invalidate_cache is special: it is an I/O function, but uses the block layer permission API, which is GS. Because of this, we can assert that either the function is being called with BQL held, and thus can use the permission API, or make sure that the permission API is not used, by

Re: [RFC PATCH v2 06/44] hw/i386: Introduce kvm-type for TDX guest

2021-11-23 Thread Xiaoyao Li
On 8/26/2021 6:22 PM, Gerd Hoffmann wrote: On Wed, Jul 07, 2021 at 05:54:36PM -0700, isaku.yamah...@gmail.com wrote: From: Xiaoyao Li Introduce a machine property, kvm-type, to allow the user to create a Trusted Domain eXtensions (TDX) VM, a.k.a. a Trusted Domain (TD), e.g.: # $QEMU \

Re: [PATCH 3/4] include/sysemu/blockdev.h: move drive_add and inline drive_def

2021-11-23 Thread Philippe Mathieu-Daudé
On 11/24/21 07:36, Emanuele Giuseppe Esposito wrote: > drive_add is only used in softmmu/vl.c, so it can be a static > function there, and drive_def is only a particular use case of > qemu_opts_parse_noisily, so it can be inlined. > > Also remove drive_mark_claimed_by_board, as it is only defined

[PATCH v5 27/31] job.h: assertions in the callers of JobDriver funcion pointers

2021-11-23 Thread Emanuele Giuseppe Esposito
Also assert that job->run() callback is called in the job aiocontext. Signed-off-by: Emanuele Giuseppe Esposito --- job.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/job.c b/job.c index dbfa67bb0a..bb57ec6887 100644 --- a/job.c +++ b/job.c @@ -380,6 +380,8 @@ void

Re: [PATCH v11 19/26] linux-user: Add LoongArch signal support

2021-11-23 Thread Richard Henderson
On 11/24/21 3:46 AM, gaosong wrote: Hi Richard, On 2021/11/20 下午6:33, Richard Henderson wrote: On 11/19/21 7:13 AM, Song Gao wrote: + +struct target_sigcontext { +    uint64_t   sc_pc; +    uint64_t   sc_gpr[32]; +    uint64_t   sc_fpr[32]; +    uint64_t   sc_fcc; +    uint32_t   sc_fcsr; +  

Re: [PATCH v5 02/18] exec/memop: Adding signed quad and octo defines

2021-11-23 Thread Philippe Mathieu-Daudé
On 11/12/21 15:58, Frédéric Pétrot wrote: > Adding defines to handle signed 64-bit and unsigned 128-bit quantities in > memory accesses. > > Signed-off-by: Frédéric Pétrot > --- > include/exec/memop.h | 7 +++ > 1 file changed, 7 insertions(+) Reviewed-by: Philippe Mathieu-Daudé

[PATCH v5 25/31] block-backend-common.h: split function pointers in BlockDevOps

2021-11-23 Thread Emanuele Giuseppe Esposito
Assertions in the callers of the function pointrs are already added by previous patches. Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Stefan Hajnoczi Reviewed-by: Philippe Mathieu-Daudé --- include/sysemu/block-backend-common.h | 28 ++- 1 file changed, 23

Re: [PATCH v5 07/18] target/riscv: setup everything so that riscv128-softmmu compiles

2021-11-23 Thread Philippe Mathieu-Daudé
Hi Frédéric, On 11/24/21 07:55, Frédéric Pétrot wrote: > On 24/11/2021 07:12, Alistair Francis wrote: >> On Sat, Nov 13, 2021 at 1:16 AM Frédéric Pétrot >> wrote: >>> >>> This patch is kind of a mess because several files have to be slightly >>> modified to allow for a new target. In the current

Re: [PATCH v1 4/7] plugins/meson.build: fix linker issue with weird paths

2021-11-23 Thread Philippe Mathieu-Daudé
On 11/23/21 21:57, Alex Bennée wrote: > Signed-off-by: Alex Bennée > Tested-by: Stefan Weil > Fixes: https://gitlab.com/qemu-project/qemu/-/issues/712 > --- > plugins/meson.build | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH v1 3/7] tests/avocado: fix tcg_plugin mem access count test

2021-11-23 Thread Philippe Mathieu-Daudé
On 11/23/21 21:57, Alex Bennée wrote: > When we cleaned up argument handling the test was missed. > > Fixes: 5ae589faad ("tests/plugins/mem: introduce "track" arg and make args > not positional") > Signed-off-by: Alex Bennée > --- > tests/avocado/tcg_plugins.py | 2 +- > 1 file changed, 1

[PATCH v5 23/31] block_int-common.h: split function pointers in BdrvChildClass

2021-11-23 Thread Emanuele Giuseppe Esposito
Signed-off-by: Emanuele Giuseppe Esposito --- include/block/block_int-common.h | 67 +++- 1 file changed, 40 insertions(+), 27 deletions(-) diff --git a/include/block/block_int-common.h b/include/block/block_int-common.h index 0e63dc694f..3ceb2365a8 100644 ---

[PATCH v5 22/31] block_int-common.h: assertion in the callers of BlockDriver function pointers

2021-11-23 Thread Emanuele Giuseppe Esposito
Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Stefan Hajnoczi --- block.c| 18 ++ block/create.c | 10 ++ 2 files changed, 28 insertions(+) diff --git a/block.c b/block.c index b77ab0a104..180884b8c0 100644 --- a/block.c +++ b/block.c @@ -526,6 +526,7

Re: [PATCH] microvm: use MachineState->dumpdtb

2021-11-23 Thread Igor Mammedov
On Tue, 23 Nov 2021 10:16:48 +0100 Gerd Hoffmann wrote: > There already is a machine property to dumb the device tree for s/dumb/dump/ > debugging purposes, and the helper function qemu_fdt_dumpdtb() > implementing the dumbing. Make microvm use it for consistency. ditto > > Signed-off-by:

Re: [PATCH v5 07/18] target/riscv: setup everything so that riscv128-softmmu compiles

2021-11-23 Thread Frédéric Pétrot
On 24/11/2021 07:12, Alistair Francis wrote: On Sat, Nov 13, 2021 at 1:16 AM Frédéric Pétrot wrote: This patch is kind of a mess because several files have to be slightly modified to allow for a new target. In the current status, we have done our best to have RV64 and RV128 under the same

[PATCH v5 18/31] include/block/snapshot: global state API + assertions

2021-11-23 Thread Emanuele Giuseppe Esposito
Snapshots run also under the BQL lock, so they all are in the global state API. The aiocontext lock that they hold is currently an overkill and in future could be removed. Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Paolo Bonzini Reviewed-by: Stefan Hajnoczi ---

[PATCH v5 30/31] crypto: delegate permission functions to JobDriver .pre_run

2021-11-23 Thread Emanuele Giuseppe Esposito
block_crypto_amend_options_generic_luks uses the block layer permission API, therefore it should be called with the BQL held. However, the same function is being called ib two BlockDriver callbacks: bdrv_amend_options (under BQL) and bdrv_co_amend (I/O). The latter is I/O because it is invoked

[PATCH v5 31/31] block.c: assertions to the block layer permissions API

2021-11-23 Thread Emanuele Giuseppe Esposito
Now that we "covered" the three main cases where the permission API was being used under BQL (fuse, amend and invalidate_cache), we can safely assert for the permission functions implemented in block.c Signed-off-by: Emanuele Giuseppe Esposito --- block.c | 12 1 file changed, 12

[PATCH v5 21/31] block_int-common.h: split function pointers in BlockDriver

2021-11-23 Thread Emanuele Giuseppe Esposito
Similar to the header split, also the function pointers in BlockDriver can be split in I/O and global state. Signed-off-by: Emanuele Giuseppe Esposito --- include/block/block_int-common.h | 440 +-- 1 file changed, 235 insertions(+), 205 deletions(-) diff --git

[PATCH v5 08/31] assertions for block_int global state API

2021-11-23 Thread Emanuele Giuseppe Esposito
Signed-off-by: Emanuele Giuseppe Esposito --- block.c | 15 +++ block/backup.c | 1 + block/block-backend.c | 3 +++ block/commit.c | 2 ++ block/dirty-bitmap.c| 1 + block/io.c |

[PATCH v5 26/31] job.h: split function pointers in JobDriver

2021-11-23 Thread Emanuele Giuseppe Esposito
The job API will be handled separately in another serie. Signed-off-by: Emanuele Giuseppe Esposito --- include/qemu/job.h | 22 ++ 1 file changed, 22 insertions(+) diff --git a/include/qemu/job.h b/include/qemu/job.h index 6e67b6977f..4ea7a4a0cd 100644 ---

[PATCH v5 29/31] jobs: introduce pre_run function in JobDriver

2021-11-23 Thread Emanuele Giuseppe Esposito
.pre_run takes care of doing some initial job setup just before the job is run inside the coroutine. Doing so can be useful to invoke GS functions that require the BQL held. Signed-off-by: Emanuele Giuseppe Esposito --- include/qemu/job.h | 9 + job.c | 13 + 2

[PATCH v5 19/31] block/copy-before-write.h: global state API + assertions

2021-11-23 Thread Emanuele Giuseppe Esposito
copy-before-write functions always run under BQL lock. Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Paolo Bonzini Reviewed-by: Stefan Hajnoczi --- block/copy-before-write.h | 7 +++ block/copy-before-write.c | 2 ++ 2 files changed, 9 insertions(+) diff --git

[PATCH v5 10/31] block.c: modify .attach and .detach callbacks of child_of_bds

2021-11-23 Thread Emanuele Giuseppe Esposito
According to the assertions put in the previous patch, we should first drain and then modify the ->children list. In this way we prevent other iothreads to read the list while it is being updated. In this case, moving the drain won't cause any harm, because child is a parameter of the drain

[PATCH v5 24/31] block_int-common.h: assertions in the callers of BdrvChildClass function pointers

2021-11-23 Thread Emanuele Giuseppe Esposito
Signed-off-by: Emanuele Giuseppe Esposito --- block.c | 9 + 1 file changed, 9 insertions(+) diff --git a/block.c b/block.c index 180884b8c0..a0309f827d 100644 --- a/block.c +++ b/block.c @@ -1491,6 +1491,7 @@ const BdrvChildClass child_of_bds = { AioContext

[PATCH v5 20/31] block/coroutines: I/O API

2021-11-23 Thread Emanuele Giuseppe Esposito
block coroutines functions run in different aiocontext, and are not protected by the BQL. Therefore are I/O. Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Paolo Bonzini Reviewed-by: Stefan Hajnoczi --- block/coroutines.h | 6 ++ 1 file changed, 6 insertions(+) diff --git

[PATCH v5 09/31] block: introduce assert_bdrv_graph_writable

2021-11-23 Thread Emanuele Giuseppe Esposito
We want to be sure that the functions that write the child and parent list of a bs are under BQL and drain. BQL prevents from concurrent writings from the GS API, while drains protect from I/O. TODO: drains are missing in some functions using this assert. Therefore a proper assertion will fail.

[PATCH v5 16/31] include/sysemu/blockdev.h: global state API

2021-11-23 Thread Emanuele Giuseppe Esposito
blockdev functions run always under the BQL lock. Signed-off-by: Emanuele Giuseppe Esposito --- include/sysemu/blockdev.h | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/include/sysemu/blockdev.h b/include/sysemu/blockdev.h index c4b7b8b54e..e53eb91be6 100644

[PATCH v5 13/31] block.c: add assertions to static functions

2021-11-23 Thread Emanuele Giuseppe Esposito
Following the assertion derived from the API split, propagate the assertion also in the static functions. Signed-off-by: Emanuele Giuseppe Esposito --- block.c | 45 - 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/block.c b/block.c

[PATCH v5 15/31] assertions for blockjob.h global state API

2021-11-23 Thread Emanuele Giuseppe Esposito
Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Stefan Hajnoczi --- blockjob.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/blockjob.c b/blockjob.c index 10c807413e..74476af473 100644 --- a/blockjob.c +++ b/blockjob.c @@ -62,6 +62,7 @@ static bool is_block_job(Job

[PATCH v5 17/31] assertions for blockdev.h global state API

2021-11-23 Thread Emanuele Giuseppe Esposito
Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Paolo Bonzini Reviewed-by: Stefan Hajnoczi --- block/block-backend.c | 3 +++ blockdev.c| 15 +++ 2 files changed, 18 insertions(+) diff --git a/block/block-backend.c b/block/block-backend.c index

[PATCH v5 07/31] include/block/block_int: split header into I/O and global state API

2021-11-23 Thread Emanuele Giuseppe Esposito
Similarly to the previous patch, split block_int.h in block_int-io.h and block_int-global-state.h block_int-common.h contains the structures shared between the two headers, and the functions that can't be categorized as I/O or global state. Assertions are added in the next patch. Signed-off-by:

[PATCH v5 11/31] include/block/blockjob_int.h: split header into I/O and GS API

2021-11-23 Thread Emanuele Giuseppe Esposito
Since the I/O functions are not many, keep a single file. Also split the function pointers in BlockJobDriver. Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Stefan Hajnoczi --- include/block/blockjob_int.h | 28 1 file changed, 28 insertions(+) diff --git

[PATCH v5 14/31] include/block/blockjob.h: global state API

2021-11-23 Thread Emanuele Giuseppe Esposito
blockjob functions run always under the BQL lock. Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Stefan Hajnoczi --- include/block/blockjob.h | 9 + 1 file changed, 9 insertions(+) diff --git a/include/block/blockjob.h b/include/block/blockjob.h index d200f33c10..fa0c3f7a47

[PATCH v5 06/31] block/block-backend.c: assertions for block-backend

2021-11-23 Thread Emanuele Giuseppe Esposito
All the global state (GS) API functions will check that qemu_in_main_thread() returns true. If not, it means that the safety of BQL cannot be guaranteed, and they need to be moved to I/O. Signed-off-by: Emanuele Giuseppe Esposito --- block/block-backend.c | 83

[PATCH v5 12/31] assertions for blockjob_int.h

2021-11-23 Thread Emanuele Giuseppe Esposito
Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Stefan Hajnoczi --- blockjob.c | 4 1 file changed, 4 insertions(+) diff --git a/blockjob.c b/blockjob.c index 4bad1408cb..10c807413e 100644 --- a/blockjob.c +++ b/blockjob.c @@ -84,6 +84,7 @@ BlockJob *block_job_get(const char *id)

[PATCH v5 03/31] assertions for block global state API

2021-11-23 Thread Emanuele Giuseppe Esposito
All the global state (GS) API functions will check that qemu_in_main_thread() returns true. If not, it means that the safety of BQL cannot be guaranteed, and they need to be moved to I/O. Signed-off-by: Emanuele Giuseppe Esposito --- block.c| 135

[PATCH v5 05/31] block-backend: special comments for blk_set/get_perm due to fuse

2021-11-23 Thread Emanuele Giuseppe Esposito
Fuse logic can be classified as I/O, so there is no BQL held during its execution. And yet, it uses blk_{get/set}_perm functions, that are classified as BQL and clearly require the BQL lock. Since there is no easy solution for this, add a couple of TODOs and FIXME in the relevant sections of the

[PATCH v5 02/31] include/block/block: split header into I/O and global state API

2021-11-23 Thread Emanuele Giuseppe Esposito
block.h currently contains a mix of functions: some of them run under the BQL and modify the block layer graph, others are instead thread-safe and perform I/O in iothreads. It is not easy to understand which function is part of which group (I/O vs GS), and this patch aims to clarify it. The "GS"

[PATCH v5 00/31] block layer: split block APIs in global state and I/O

2021-11-23 Thread Emanuele Giuseppe Esposito
Currently, block layer APIs like block.h contain a mix of functions that are either running in the main loop and under the BQL, or are thread-safe functions and run in iothreads performing I/O. The functions running under BQL also take care of modifying the block graph, by using drain and/or

[PATCH 4/4] include/sysemu/blockdev.h: remove drive_get_max_devs

2021-11-23 Thread Emanuele Giuseppe Esposito
Remove drive_get_max_devs, as it is not used by anyone. Signed-off-by: Emanuele Giuseppe Esposito --- include/sysemu/blockdev.h | 1 - blockdev.c| 17 - 2 files changed, 18 deletions(-) diff --git a/include/sysemu/blockdev.h b/include/sysemu/blockdev.h index

[PATCH v5 04/31] include/sysemu/block-backend: split header into I/O and global state (GS) API

2021-11-23 Thread Emanuele Giuseppe Esposito
Similarly to the previous patches, split block-backend.h in block-backend-io.h and block-backend-global-state.h In addition, remove "block/block.h" include as it seems it is not necessary anymore, together with "qemu/iov.h" block-backend-common.h contains the structures shared between the two

[PATCH v5 01/31] main-loop.h: introduce qemu_in_main_thread()

2021-11-23 Thread Emanuele Giuseppe Esposito
When invoked from the main loop, this function is the same as qemu_mutex_iothread_locked, and returns true if the BQL is held. When invoked from iothreads or tests, it returns true only if the current AioContext is the Main Loop. This essentially just extends qemu_mutex_iothread_locked to work

[PATCH 3/4] include/sysemu/blockdev.h: move drive_add and inline drive_def

2021-11-23 Thread Emanuele Giuseppe Esposito
drive_add is only used in softmmu/vl.c, so it can be a static function there, and drive_def is only a particular use case of qemu_opts_parse_noisily, so it can be inlined. Also remove drive_mark_claimed_by_board, as it is only defined but not implemented (nor used) anywhere. Signed-off-by:

[PATCH 1/4] block_int: make bdrv_backing_overridden static

2021-11-23 Thread Emanuele Giuseppe Esposito
bdrv_backing_overridden is only used in block.c, so there is no need to leave it in block_int.h Signed-off-by: Emanuele Giuseppe Esposito --- include/block/block_int.h | 3 --- block.c | 4 +++- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git

[PATCH 2/4] include/sysemu/blockdev.h: rename if_name in block_if_name

2021-11-23 Thread Emanuele Giuseppe Esposito
In preparation to next patch, where we export it to be used also in softmmu/vlc.c Signed-off-by: Emanuele Giuseppe Esposito --- blockdev.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/blockdev.c b/blockdev.c index b35072644e..1b6ffbbc73 100644 ---

[PATCH 0/4] block: minor refactoring in preparation to the block layer API split

2021-11-23 Thread Emanuele Giuseppe Esposito
These patches are taken from my old patches and feedback of my series "block layer: split block APIs in global state and I/O". The reason for a separate series is that the original one is already too long, and these patches are just refactoring the code, mainly deleting or moving functions in

Re: [PATCH v5 15/18] target/riscv: adding high part of some csrs

2021-11-23 Thread Alistair Francis
On Sat, Nov 13, 2021 at 1:19 AM Frédéric Pétrot wrote: > > Adding the high part of a very minimal set of csr. > > Signed-off-by: Frédéric Pétrot > Co-authored-by: Fabien Portas > Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis Alistair > --- > target/riscv/cpu.h | 4

Re: [PATCH v5 11/18] target/riscv: support for 128-bit U-type instructions

2021-11-23 Thread Alistair Francis
On Sat, Nov 13, 2021 at 1:12 AM Frédéric Pétrot wrote: > > Adding the 128-bit version of lui and auipc, and introducing to that end > a "set register with immediate" function to handle extension on 128 bits. > > Signed-off-by: Frédéric Pétrot > Co-authored-by: Fabien Portas > Reviewed-by:

Re: [PATCH v5 10/18] target/riscv: support for 128-bit bitwise instructions

2021-11-23 Thread Alistair Francis
On Sat, Nov 13, 2021 at 1:20 AM Frédéric Pétrot wrote: > > The 128-bit bitwise instructions do not need any function prototype change > as the functions can be applied independently on the lower and upper part of > the registers. > > Signed-off-by: Frédéric Pétrot > Co-authored-by: Fabien Portas

Re: [PATCH v5 07/18] target/riscv: setup everything so that riscv128-softmmu compiles

2021-11-23 Thread Alistair Francis
On Sat, Nov 13, 2021 at 1:16 AM Frédéric Pétrot wrote: > > This patch is kind of a mess because several files have to be slightly > modified to allow for a new target. In the current status, we have done > our best to have RV64 and RV128 under the same RV64 umbrella, but there > is still work to

[PATCH] intel-iommu: ignore SNP bit in scalable mode

2021-11-23 Thread Jason Wang
When booting with scalable mode, I hit this error: qemu-system-x86_64: vtd_iova_to_slpte: detected splte reserve non-zero iova=0xf002, level=0x1slpte=0x102681803) qemu-system-x86_64: vtd_iommu_translate: detected translation failure (dev=01:00:00, iova=0xf002) qemu-system-x86_64: New

[PATCH] virtio-balloon: correct used length

2021-11-23 Thread Jason Wang
Spec said: "and len the total of bytes written into the buffer." For inflateq, deflateq and statsq, we don't process in_sg so the used length should be zero. For free_page_vq, though the free pages are supplied via in_sgs, zero used length should still be fine since anyway driver is expected to

Re: [PATCH v11 19/26] linux-user: Add LoongArch signal support

2021-11-23 Thread gaosong
Hi Richard, On 2021/11/20 下午6:33, Richard Henderson wrote: On 11/19/21 7:13 AM, Song Gao wrote: + +struct target_sigcontext { +    uint64_t   sc_pc; +    uint64_t   sc_gpr[32]; +    uint64_t   sc_fpr[32]; +    uint64_t   sc_fcc; +    uint32_t   sc_fcsr; +    uint32_t   sc_flags; +}; Does

Re: [PATCH 0/2] change IVSHMEM endianess to LITTLE_ENDIAN

2021-11-23 Thread Cédric Le Goater
On 11/23/21 22:19, Daniel Henrique Barboza wrote: Hi, This small series fixes an issue reported in Gitlab [1] that affects PowerPC big-endian and little-endian and probably all other big-endians in the wild that might use 'ivshmem'. It's not clear to me who is the maintainer/responsible for

Delay rc2 until 24 Nov

2021-11-23 Thread Richard Henderson
I'm going to delay rc2 from tonight until tomorrow. Hoping for a resolution to the gicv3 issue. Bear in mind that Thursday, 25 Nov starts the Thanksgiving holiday weekend in the US, so I'm officially off until Monday. r~

[PATCH 2/2] ivshmem-test.c: enable test_ivshmem_server for ppc64 arch

2021-11-23 Thread Daniel Henrique Barboza
This test, if enabled by hand, was failing when the ivhsmem device was being declared as DEVICE_NATIVE_ENDIAN with the following error: /ppc64/ivshmem/pair: OK /ppc64/ivshmem/server: ** ERROR:/home/danielhb/qemu/tests/qtest/ivshmem-test.c:367:test_ivshmem_server: assertion failed (ret != 0): (0

[PATCH 1/2] ivshmem.c: change endianness to LITTLE_ENDIAN

2021-11-23 Thread Daniel Henrique Barboza
The ivshmem device, as with most PCI devices, uses little endian byte order. However, the endianess of its mmio_ops is marked as DEVICE_NATIVE_ENDIAN. This presents not only the usual problems with big endian hosts but also with PowerPC little endian hosts as well, since the Power architecture in

[PATCH 0/2] change IVSHMEM endianess to LITTLE_ENDIAN

2021-11-23 Thread Daniel Henrique Barboza
Hi, This small series fixes an issue reported in Gitlab [1] that affects PowerPC big-endian and little-endian and probably all other big-endians in the wild that might use 'ivshmem'. It's not clear to me who is the maintainer/responsible for this device (MAINTAINERS doesn't seem to have any

[PATCH v1 3/7] tests/avocado: fix tcg_plugin mem access count test

2021-11-23 Thread Alex Bennée
When we cleaned up argument handling the test was missed. Fixes: 5ae589faad ("tests/plugins/mem: introduce "track" arg and make args not positional") Signed-off-by: Alex Bennée --- tests/avocado/tcg_plugins.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH v1 5/7] gdbstub: handle a potentially racing TaskState

2021-11-23 Thread Alex Bennée
When dealing with multi-threaded userspace programs there is a race condition with the addition of cpu->opaque (aka TaskState). This is due to cpu_copy calling cpu_create which updates the global vCPU list. However the task state isn't set until later. This shouldn't be a problem because the new

[PATCH v1 7/7] MAINTAINERS: Add section for Aarch64 GitLab custom runner

2021-11-23 Thread Alex Bennée
From: Philippe Mathieu-Daudé Add a MAINTAINERS section to cover the GitLab YAML config file containing the jobs run on the custom runner sponsored by the Works On Arm project [*]. [*] https://developer.arm.com/solutions/infrastructure/works-on-arm Suggested-by: Thomas Huth Signed-off-by:

[PATCH v1 1/7] softmmu: fix watchpoint-interrupt races

2021-11-23 Thread Alex Bennée
From: Pavel Dovgalyuk Watchpoint may be processed in two phases. First one is detecting the instruction with target memory access. And the second one is executing only one instruction and setting the debug interrupt flag. Hardware interrupts can break this sequence when they happen after the

[PATCH v1 6/7] MAINTAINERS: Remove me as a reviewer for the build and test/avocado

2021-11-23 Thread Alex Bennée
From: Willian Rampazzo Remove me as a reviewer for the Build and test automation and the Integration Testing with the Avocado Framework and add Beraldo Leal. Signed-off-by: Willian Rampazzo Reviewed-by: Beraldo Leal Message-Id: <20211122191124.31620-1-willi...@redhat.com> Signed-off-by: Alex

[PATCH v1 2/7] accel/tcg: suppress IRQ check for special TBs

2021-11-23 Thread Alex Bennée
Generally when we set cpu->cflags_next_tb it is because we want to carefully control the execution of the next TB. Currently there is a race that causes cflags_next_tb to get ignored if an IRQ is processed before we execute any actual instructions. To avoid this we introduce a new compiler flag:

[PATCH v1 4/7] plugins/meson.build: fix linker issue with weird paths

2021-11-23 Thread Alex Bennée
Signed-off-by: Alex Bennée Tested-by: Stefan Weil Fixes: https://gitlab.com/qemu-project/qemu/-/issues/712 --- plugins/meson.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/meson.build b/plugins/meson.build index aeb386ebae..b3de57853b 100644 ---

[PATCH for 6.2 v1 0/7] more tcg, plugin, test and build fixes

2021-11-23 Thread Alex Bennée
Hi, As the release process rolls on here if the current state of my for-6.2 tree. There are fixes for TCG, plugins, build and test. The following still need review: - plugins/meson.build: fix linker issue with weird paths - tests/avocado: fix tcg_plugin mem access count test - accel/tcg:

Re: [PATCH] MAINTAINERS: Add section for Aarch64 GitLab custom runner

2021-11-23 Thread Alex Bennée
Philippe Mathieu-Daudé writes: > Add a MAINTAINERS section to cover the GitLab YAML config file > containing the jobs run on the custom runner sponsored by the > Works On Arm project [*]. Queued to for-6.2/tcg-gdb-plugin-fixes, thanks. -- Alex Bennée

Re: [PATCH for-6.2] Revert "arm: tcg: Adhere to SMCCC 1.3 section 5.2"

2021-11-23 Thread Jean-Christophe DUBOIS
Le 19/11/2021 à 17:34, Peter Maydell a écrit : This reverts commit 9fcd15b9193e819b6cc2fd0a45e3506148812bb4. This change turns out to cause regressions, for instance on the imx6ul boards as described here: https://lore.kernel.org/qemu-devel/c8b89685-7490-328b-51a3-48711c140...@tribudubois.net/

RE: [for-6.2] hw/intc/arm_gicv3: Update cached state after acknowledging LPI

2021-11-23 Thread Shashi Mallela
Since LPIs do not have an active or active and pending state,the current implementation only clears the LPI pending state from the pending table once ICC_IAR1_EL1 acknowledges the interrupt.But, as part of gicv3_lpi_pending() processing, cs->hpplpi is updated with the next best priotiy lpi (only

Re: [for-6.2] hw/intc/arm_gicv3: Update cached state after acknowledging LPI

2021-11-23 Thread Alex Bennée
Peter Maydell writes: > On Tue, 23 Nov 2021 at 17:10, Peter Maydell wrote: >> >> In gicv3_redist_lpi_pending() we update cs->hpplpi to indicate the >> new highest priority pending LPI after changing the requested LPI >> pending bit. However the overall highest priority pending interrupt >>

Re: [PULL 0/3] Block patches

2021-11-23 Thread Richard Henderson
On 11/23/21 4:59 PM, Hanna Reitz wrote: The following changes since commit 73e0f70e097b7c92a5ce16ee35b53afe119b20d7: Merge tag 'pull-lu-20211123' of https://gitlab.com/rth7680/qemu into staging (2021-11-23 11:33:14 +0100) are available in the Git repository at: https://gitlab.com

Re: [for-6.2] hw/intc/arm_gicv3: Update cached state after acknowledging LPI

2021-11-23 Thread Richard Henderson
On 11/23/21 6:10 PM, Peter Maydell wrote: In gicv3_redist_lpi_pending() we update cs->hpplpi to indicate the new highest priority pending LPI after changing the requested LPI pending bit. However the overall highest priority pending interrupt information won't be updated unless we call

[PATCH 17/23] multifd: Use normal pages array on the send side

2021-11-23 Thread Juan Quintela
Signed-off-by: Juan Quintela --- migration/multifd.h | 8 ++-- migration/multifd-zlib.c | 6 +++--- migration/multifd-zstd.c | 6 +++--- migration/multifd.c | 30 +++--- migration/trace-events | 4 ++-- 5 files changed, 33 insertions(+), 21

[PATCH 15/23] multifd: Use a single writev on the send side

2021-11-23 Thread Juan Quintela
Until now, we wrote the packet header with write(), and the rest of the pages with writev(). Just increase the size of the iovec and do a single writev(). Signed-off-by: Juan Quintela --- migration/multifd.c | 20 1 file changed, 8 insertions(+), 12 deletions(-) diff

[PATCH 06/23] multifd: remove used parameter from send_prepare() method

2021-11-23 Thread Juan Quintela
It is already there as p->pages->num. Signed-off-by: Juan Quintela --- migration/multifd.h | 2 +- migration/multifd-zlib.c | 7 +++ migration/multifd-zstd.c | 7 +++ migration/multifd.c | 9 +++-- 4 files changed, 10 insertions(+), 15 deletions(-) diff --git

[PATCH 16/23] multifd: Unfold "used" variable by its value

2021-11-23 Thread Juan Quintela
Signed-off-by: Juan Quintela --- migration/multifd.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/migration/multifd.c b/migration/multifd.c index 65676d56fd..6983ba3e7c 100644 --- a/migration/multifd.c +++ b/migration/multifd.c @@ -1059,7 +1059,6 @@ static void

[PATCH 05/23] multifd: The variable is only used inside the loop

2021-11-23 Thread Juan Quintela
Signed-off-by: Juan Quintela --- migration/multifd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/migration/multifd.c b/migration/multifd.c index cdeffdc4c5..ce7101cf9d 100644 --- a/migration/multifd.c +++ b/migration/multifd.c @@ -629,7 +629,6 @@ static void

[PATCH 13/23] multifd: Make zstd use iov's

2021-11-23 Thread Juan Quintela
Signed-off-by: Juan Quintela --- migration/multifd-zstd.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/migration/multifd-zstd.c b/migration/multifd-zstd.c index 2d5b61106c..259277dc42 100644 --- a/migration/multifd-zstd.c +++ b/migration/multifd-zstd.c @@ -154,6

[PATCH 10/23] multifd: Make zlib compression method not use iovs

2021-11-23 Thread Juan Quintela
Signed-off-by: Juan Quintela --- migration/multifd-zlib.c | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/migration/multifd-zlib.c b/migration/multifd-zlib.c index e85ef8824d..da6201704c 100644 --- a/migration/multifd-zlib.c +++ b/migration/multifd-zlib.c @@

[PATCH 14/23] multifd: Remove send_write() method

2021-11-23 Thread Juan Quintela
Everything use now iov's. Signed-off-by: Juan Quintela --- migration/multifd.h | 2 -- migration/multifd-zlib.c | 17 - migration/multifd-zstd.c | 17 - migration/multifd.c | 20 ++-- 4 files changed, 2 insertions(+), 54 deletions(-)

[PATCH 02/23] migration: Never call twice qemu_target_page_size()

2021-11-23 Thread Juan Quintela
Signed-off-by: Juan Quintela --- migration/migration.c | 7 --- migration/multifd.c | 7 --- migration/savevm.c| 5 +++-- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 2c1edb2cb9..3de11ae921 100644 ---

[PATCH 08/23] multifd: Fill offset and block for reception

2021-11-23 Thread Juan Quintela
We were using the iov directly, but we will need this info on the following patch. Signed-off-by: Juan Quintela --- migration/multifd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/migration/multifd.c b/migration/multifd.c index 55d99a8232..0533da154a 100644 --- a/migration/multifd.c

[PATCH 09/23] multifd: Make zstd compression method not use iovs

2021-11-23 Thread Juan Quintela
Signed-off-by: Juan Quintela --- migration/multifd-zstd.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/migration/multifd-zstd.c b/migration/multifd-zstd.c index a8b104f4ee..2d5b61106c 100644 --- a/migration/multifd-zstd.c +++

[PATCH 07/23] multifd: remove used parameter from send_recv_pages() method

2021-11-23 Thread Juan Quintela
It is already there as p->pages->num. Signed-off-by: Juan Quintela --- migration/multifd.h | 2 +- migration/multifd-zlib.c | 9 - migration/multifd-zstd.c | 7 +++ migration/multifd.c | 7 +++ 4 files changed, 11 insertions(+), 14 deletions(-) diff --git

[PATCH 11/23] multifd: Move iov from pages to params

2021-11-23 Thread Juan Quintela
This will allow us to reduce the number of system calls on the next patch. Signed-off-by: Juan Quintela --- migration/multifd.h | 8 ++-- migration/multifd.c | 34 -- 2 files changed, 30 insertions(+), 12 deletions(-) diff --git a/migration/multifd.h

[PATCH 01/23] multifd: Delete useless operation

2021-11-23 Thread Juan Quintela
We are divining by page_size to multiply again in the only use. Once there, impreve the comments. Signed-off-by: Juan Quintela --- migration/multifd-zlib.c | 13 - migration/multifd-zstd.c | 13 - 2 files changed, 8 insertions(+), 18 deletions(-) diff --git

[PATCH 04/23] multifd: Add missing documention

2021-11-23 Thread Juan Quintela
Signed-off-by: Juan Quintela --- migration/multifd-zlib.c | 2 ++ migration/multifd-zstd.c | 2 ++ migration/multifd.c | 1 + 3 files changed, 5 insertions(+) diff --git a/migration/multifd-zlib.c b/migration/multifd-zlib.c index 3fc7813b44..d0437cce2a 100644 --- a/migration/multifd-zlib.c

[PATCH 03/23] multifd: Rename used field to num

2021-11-23 Thread Juan Quintela
We will need to split it later in zero_num (number of zero pages) and normal_num (number of normal pages). This name is better. Signed-off-by: Juan Quintela --- migration/multifd.h | 2 +- migration/multifd.c | 38 +++--- 2 files changed, 20 insertions(+), 20

[PATCH 12/23] multifd: Make zlib use iov's

2021-11-23 Thread Juan Quintela
Signed-off-by: Juan Quintela --- migration/multifd-zlib.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/migration/multifd-zlib.c b/migration/multifd-zlib.c index da6201704c..478a4af115 100644 --- a/migration/multifd-zlib.c +++ b/migration/multifd-zlib.c @@ -143,6

[PATCH 00/23] Migration: Transmit and detect zero pages in the multifd threads

2021-11-23 Thread Juan Quintela
Hi Since Friday version: - More cleanups on the code - Remove repeated calls to qemu_target_page_size() - Establish normal pages and zero pages - detect zero pages on the multifd threads - send zero pages through the multifd channels. - reviews by Richard addressed. It pases migration-test, so

Re: [for-6.2] hw/intc/arm_gicv3: Update cached state after acknowledging LPI

2021-11-23 Thread Peter Maydell
On Tue, 23 Nov 2021 at 17:10, Peter Maydell wrote: > > In gicv3_redist_lpi_pending() we update cs->hpplpi to indicate the > new highest priority pending LPI after changing the requested LPI > pending bit. However the overall highest priority pending interrupt > information won't be updated

[PATCH v6 16/16] meson: Move bsd_user_ss to bsd-user/

2021-11-23 Thread Richard Henderson
We have no need to reference bsd_user_ss outside of bsd-user. Go ahead and merge it directly into specific_ss. Reviewed-by: Warner Losh Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- meson.build | 3 --- bsd-user/meson.build | 4 2 files changed, 4

[PATCH v6 14/16] linux-user: Move thunk.c from top-level

2021-11-23 Thread Richard Henderson
So far, linux-user is the only user of these functions. Clean up the build machinery by restricting it to linux-user. Reviewed-by: Warner Losh Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- meson.build | 1 - thunk.c => linux-user/thunk.c | 0

  1   2   3   >