Re: [PATCH 1/9] qapi: New special feature flag "unstable"

2021-10-25 Thread Juan Quintela
Markus Armbruster wrote: > By convention, names starting with "x-" are experimental. The parts > of external interfaces so named may be withdrawn or changed > incompatibly in future releases. > > Drawback: promoting something from experimental to stable involves a > name change. Client code

Re: [PATCH] block/export/fuse.c: fix musl build

2021-10-25 Thread Kevin Wolf
Am 22.10.2021 um 11:52 hat Fabrice Fontaine geschrieben: > Include linux/falloc.h if CONFIG_FALLOCATE_ZERO_RANGE is defined to fix > https://gitlab.com/qemu-project/qemu/-/commit/50482fda98bd62e072c30b7ea73c985c4e9d9bbb > and avoid the following build failure on musl: > > ../block/export/fuse.c:

Re: [PATCH] block/export/fuse.c: fix musl build

2021-10-25 Thread Fabrice Fontaine
Le lun. 25 oct. 2021 à 11:33, Kevin Wolf a écrit : > > Am 22.10.2021 um 11:52 hat Fabrice Fontaine geschrieben: > > Include linux/falloc.h if CONFIG_FALLOCATE_ZERO_RANGE is defined to fix > > https://gitlab.com/qemu-project/qemu/-/commit/50482fda98bd62e072c30b7ea73c985c4e9d9bbb > > and avoid the

Re: [PULL 0/1] Block patches

2021-10-25 Thread Stefan Hajnoczi
On Thu, Oct 21, 2021 at 03:08:56PM -0700, Richard Henderson wrote: > On 10/21/21 10:41 AM, Stefan Hajnoczi wrote: > > The following changes since commit afc9fcde55296b83f659de9da3cdf044812a6eeb: > > > >Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into > > staging (2021-10-20

[PATCH v4 05/25] block/block-backend.c: assertions for block-backend

2021-10-25 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 Reviewed-by: Stefan Hajnoczi --- block/block-backend.c | 90

[PATCH v4 07/25] assertions for block_int global state API

2021-10-25 Thread Emanuele Giuseppe Esposito
Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Stefan Hajnoczi --- block.c | 17 + block/backup.c | 1 + block/block-backend.c | 3 +++ block/commit.c | 2 ++ block/dirty-bitmap.c| 1 +

[PATCH v4 08/25] block: introduce assert_bdrv_graph_writable

2021-10-25 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 v4 16/25] include/block/snapshot: global state API + assertions

2021-10-25 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 --- block/snapshot.c

[PATCH v4 17/25] block/copy-before-write.h: global state API + assertions

2021-10-25 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.c | 2 ++ block/copy-before-write.h | 7 +++ 2 files changed, 9 insertions(+) diff --git

[PATCH v4 10/25] assertions for blockjob_int.h

2021-10-25 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..fbd6c7d873 100644 --- a/blockjob.c +++ b/blockjob.c @@ -83,6 +83,7 @@ BlockJob *block_job_get(const char *id)

[PATCH v4 20/25] block_int-common.h: assertion in the callers of BlockDriver function pointers

2021-10-25 Thread Emanuele Giuseppe Esposito
Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Stefan Hajnoczi --- block.c | 17 + 1 file changed, 17 insertions(+) diff --git a/block.c b/block.c index 94bff5c757..40c4729b8d 100644 --- a/block.c +++ b/block.c @@ -1074,6 +1074,7 @@ int

Re: [PATCH v8 72/78] target/riscv: set mstatus.SD bit when writing fp CSRs

2021-10-25 Thread Alistair Francis
On Fri, Oct 15, 2021 at 6:44 PM wrote: > > From: Frank Chang > > Signed-off-by: Frank Chang Hey Frank, You will need to rebase this on the latest master branch. Alistair > --- > target/riscv/csr.c | 9 ++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > > diff --git

Re: [PATCH] Trim some trailing space from human-readable output

2021-10-25 Thread Markus Armbruster
Nominating for qemu-trivial. Tweaking the subject to monitor: Trim some trailing space from human-readable output as Philippe suggested would be nice. Markus Armbruster writes: > I noticed -cpu help printing enough trailing spaces to make the output > at least 84 characters wide. Looks

[PATCH v4 19/25] block_int-common.h: split function pointers in BlockDriver

2021-10-25 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 Reviewed-by: Stefan Hajnoczi --- include/block/block_int-common.h | 458 --- 1 file changed, 237 insertions(+), 221

[PATCH v4 15/25] assertions for blockdev.h global state API

2021-10-25 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

Re: gitlab/cirrus auth token failure

2021-10-25 Thread Daniel P . Berrangé
On Sun, Oct 24, 2021 at 06:15:38PM -0700, Richard Henderson wrote: > On 10/24/21 12:42 AM, Paolo Bonzini wrote: > > On 22/10/21 20:31, Richard Henderson wrote: > > > Hi Daniel, you win the cookie because you committed cirrus.yml. > > > > > > I should have reported this before the weekend, but at

[PATCH] hvf: Avoid mapping regions < PAGE_SIZE as ram

2021-10-25 Thread Alexander Graf
HVF has generic memory listener code that adds all RAM regions as HVF RAM regions. However, HVF can only handle page aligned, page granule regions. So let's ignore regions that are not page aligned and sized. They will be trapped as MMIO instead. Signed-off-by: Alexander Graf ---

Re: [PATCH v6 00/15] target/riscv: Rationalize XLEN and operand length

2021-10-25 Thread LIU Zhiwei
On 2021/10/22 下午11:50, Richard Henderson wrote: On 10/22/21 1:26 AM, LIU Zhiwei wrote: As the specification said, "PC bits above XLEN are ignored, and when the PC is written, it is sign-extended to fill the widest supported XLEN." We still need special process of PC for exceptions or jump

[PATCH v4 14/25] include/systemu/blockdev.h: global state API

2021-10-25 Thread Emanuele Giuseppe Esposito
blockdev functions run always under the BQL lock. Signed-off-by: Emanuele Giuseppe Esposito --- include/sysemu/blockdev.h | 18 ++ 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/include/sysemu/blockdev.h b/include/sysemu/blockdev.h index 960b54d320..b07f15df09

Re: [PATCH v8 51/78] target/riscv: rvv-1.0: floating-point slide instructions

2021-10-25 Thread Alistair Francis
On Fri, Oct 15, 2021 at 6:38 PM wrote: > > From: Frank Chang > > Add the following instructions: > > * vfslide1up.vf > * vfslide1down.vf > > Signed-off-by: Frank Chang Reviewed-by: Alistair Francis Alistair > --- > target/riscv/helper.h | 7 ++ >

Re: [PATCH v4] isa-applesmc: provide OSK forwarding on Apple hosts

2021-10-25 Thread Alexander Graf
On 22.10.21 18:14, Vladislav Yaroshchuk wrote: On Apple hosts we can read AppleSMC OSK key directly from host's SMC and forward this value to QEMU Guest. Usage: `-device isa-applesmc,hostosk=on` Apple licence allows use and run up to two additional copies or instances of macOS operating

[PATCH] Add a comment about endian-ness of capabilities recorded in pci config space

2021-10-25 Thread Ani Sinha
Values in PCI configuration space are written in little endian format. This includes capability values recorded in pci config space for pci bridges etc. Add comment to remind developers to make sure the values are written in little endian for all platforms and that the code must be endian safe.

[PATCH v4 01/25] main-loop.h: introduce qemu_in_main_thread()

2021-10-25 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 v4 18/25] block/coroutines: I/O API

2021-10-25 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

Re: [PATCH 1/3] file-posix: add `aio-max-batch` option

2021-10-25 Thread Stefano Garzarella
On Thu, Oct 21, 2021 at 04:18:41PM +0100, Stefan Hajnoczi wrote: On Thu, Sep 23, 2021 at 04:30:58PM +0200, Stefano Garzarella wrote: Commit d7ddd0a161 ("linux-aio: limit the batch size using `aio-max-batch` parameter") added a way to limit the batch size of Linux AIO backend for the entire AIO

Re: [PATCH] block/export/fuse.c: fix musl build

2021-10-25 Thread Michael Tokarev
22.10.2021 12:52, Fabrice Fontaine пишет: Include linux/falloc.h if CONFIG_FALLOCATE_ZERO_RANGE is defined to fix https://gitlab.com/qemu-project/qemu/-/commit/50482fda98bd62e072c30b7ea73c985c4e9d9bbb and avoid the following build failure on musl: ../block/export/fuse.c: In function

Re: [PATCH] block/export/fuse.c: fix musl build

2021-10-25 Thread Fabrice Fontaine
Le lun. 25 oct. 2021 à 08:31, Michael Tokarev a écrit : > > 22.10.2021 12:52, Fabrice Fontaine пишет: > > Include linux/falloc.h if CONFIG_FALLOCATE_ZERO_RANGE is defined to fix > > https://gitlab.com/qemu-project/qemu/-/commit/50482fda98bd62e072c30b7ea73c985c4e9d9bbb > > and avoid the following

[PATCH] configure: do not duplicate CPU_CFLAGS into QEMU_LDFLAGS

2021-10-25 Thread Paolo Bonzini
CPU_CFLAGS is included in the link commands both during configure and (via config-meson.cross) during meson. It need not be added separately to QEMU_LDFLAGS. Signed-off-by: Paolo Bonzini --- configure | 53 ++--- 1 file changed, 14 insertions(+),

[PATCH] configure: remove useless NPTL probe

2021-10-25 Thread Paolo Bonzini
Using a linuxthreads system with a recent QEMU will have bigger problems than just not having NPTL. Remove the unnecessary check. Signed-off-by: Paolo Bonzini --- configure | 19 --- 1 file changed, 19 deletions(-) diff --git a/configure b/configure index

Re: [PATCH] Trim some trailing space from human-readable output

2021-10-25 Thread Laurent Vivier
Le 25/10/2021 à 11:12, Markus Armbruster a écrit : Nominating for qemu-trivial. Tweaking the subject to monitor: Trim some trailing space from human-readable output as Philippe suggested would be nice. Markus Armbruster writes: I noticed -cpu help printing enough trailing spaces to

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

2021-10-25 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 v4 04/25] include/sysemu/block-backend: split header into I/O and global state (GS) API

2021-10-25 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

Re: [PATCH v8 61/78] target/riscv: rvv-1.0: floating-point/integer type-convert instructions

2021-10-25 Thread Alistair Francis
On Fri, Oct 15, 2021 at 6:43 PM wrote: > > From: Frank Chang > > Add the following instructions: > > * vfcvt.rtz.xu.f.v > * vfcvt.rtz.x.f.v > > Also adjust GEN_OPFV_TRANS() to accept multiple floating-point rounding > modes. > > Signed-off-by: Frank Chang Reviewed-by: Alistair Francis

[PATCH v4 03/25] assertions for block global state API

2021-10-25 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 Reviewed-by: Stefan Hajnoczi --- block.c| 136

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

2021-10-25 Thread Emanuele Giuseppe Esposito
Currently, block layer APIs like block-backend.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

[PATCH v4 25/25] job.h: assertions in the callers of JobDriver funcion pointers

2021-10-25 Thread Emanuele Giuseppe Esposito
Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Stefan Hajnoczi --- job.c | 9 + 1 file changed, 9 insertions(+) diff --git a/job.c b/job.c index dbfa67bb0a..94b142684f 100644 --- a/job.c +++ b/job.c @@ -380,6 +380,8 @@ void job_ref(Job *job) void job_unref(Job *job) { +

[PATCH v4 11/25] include/block/blockjob.h: global state API

2021-10-25 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 v4 23/25] block-backend-common.h: split function pointers in BlockDevOps

2021-10-25 Thread Emanuele Giuseppe Esposito
Assertions in the callers of the funciton pointrs are already added by previous patches. Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Stefan Hajnoczi --- include/sysemu/block-backend-common.h | 28 ++- 1 file changed, 23 insertions(+), 5 deletions(-) diff

Re: [PATCH v8 43/78] target/riscv: rvv-1.0: integer add-with-carry/subtract-with-borrow

2021-10-25 Thread Alistair Francis
On Fri, Oct 15, 2021 at 6:26 PM wrote: > > From: Frank Chang > > * Only do carry-in or borrow-in if is masked (vm=0). > * Remove clear function from helper functions as the tail elements > are unchanged in RVV 1.0. > > Signed-off-by: Frank Chang Reviewed-by: Alistair Francis Alistair >

Re: [PATCH v8 65/78] target/riscv: rvv-1.0: relax RV_VLEN_MAX to 1024-bits

2021-10-25 Thread Alistair Francis
On Fri, Oct 15, 2021 at 6:43 PM wrote: > > From: Frank Chang > > Signed-off-by: Frank Chang Reviewed-by: Alistair Francis Alistair > > -- > --- > target/riscv/cpu.h | 2 +- > target/riscv/insn_trans/trans_rvv.c.inc | 4 ++-- > target/riscv/vector_helper.c|

Re: [PATCH 2/9] qapi: Mark unstable QMP parts with feature 'unstable'

2021-10-25 Thread Juan Quintela
Markus Armbruster wrote: > Add special feature 'unstable' everywhere the name starts with 'x-', > except for InputBarrierProperties member x-origin and > MemoryBackendProperties member x-use-canonical-path-for-ramblock-id, > because these two are actually stable. > > Signed-off-by: Markus

Re: [PATCH 3/9] qapi: Eliminate QCO_NO_OPTIONS for a slight simplification

2021-10-25 Thread Juan Quintela
Markus Armbruster wrote: > Signed-off-by: Markus Armbruster Reviewed-by: Juan Quintela

Re: [PATCH v3] target/riscv: fix VS interrupts forwarding to HS

2021-10-25 Thread Jose Martins
> From your last response I thought you sent a different series that > replaces this patch. If that's not the case do you mind sending this > patch again? I already sent the patch series here: https://lists.gnu.org/archive/html/qemu-devel/2021-06/msg00553.html. I got confused, I should have

[PATCH v4 06/25] include/block/block_int: split header into I/O and global state API

2021-10-25 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 v4 12/25] assertions for blockob.h global state API

2021-10-25 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 fbd6c7d873..4982f6a2b5 100644 --- a/blockjob.c +++ b/blockjob.c @@ -61,6 +61,7 @@ static bool is_block_job(Job

[PATCH v4 13/25] include/sysemu/blockdev.h: move drive_add and inline drive_def

2021-10-25 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. This also helps

[PATCH v4 09/25] include/block/blockjob_int.h: split header into I/O and GS API

2021-10-25 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 v4 22/25] block_int-common.h: assertions in the callers of BdrvChildClass function pointers

2021-10-25 Thread Emanuele Giuseppe Esposito
Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Stefan Hajnoczi --- block.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/block.c b/block.c index 40c4729b8d..da80e89ad4 100644 --- a/block.c +++ b/block.c @@ -1462,6 +1462,7 @@ const BdrvChildClass child_of_bds = {

Re: [PATCH] hvf: Avoid mapping regions < PAGE_SIZE as ram

2021-10-25 Thread Philippe Mathieu-Daudé
Hi Alex, On 10/25/21 10:25, Alexander Graf wrote: > HVF has generic memory listener code that adds all RAM regions as HVF RAM > regions. However, HVF can only handle page aligned, page granule regions. > > So let's ignore regions that are not page aligned and sized. They will be > trapped as

[PATCH v2] hw/i386: Rename default_bus_bypass_iommu

2021-10-25 Thread Jean-Philippe Brucker
Since commit d8fb7d0969d5 ("vl: switch -M parsing to keyval"), machine parameter definitions cannot use underscores, because keyval_dashify() transforms them to dashes and the parser doesn't find the parameter. This affects option default_bus_bypass_iommu which was introduced in the same release:

Re: [PATCH 6/9] qapi: Generalize command policy checking

2021-10-25 Thread Philippe Mathieu-Daudé
On 10/25/21 07:25, Markus Armbruster wrote: > The code to check command policy can see special feature flag > 'deprecated' as command flag QCO_DEPRECATED. I want to make feature > flag 'unstable' visible there as well, so I can add policy for it. > > To let me make it visible, add member

Re: [PATCH 8/9] qapi: Factor out compat_policy_input_ok()

2021-10-25 Thread Philippe Mathieu-Daudé
On 10/25/21 07:25, Markus Armbruster wrote: > The code to check policy for handling deprecated input is triplicated. > Factor it out into compat_policy_input_ok() before I mess with it in > the next commit. > > Signed-off-by: Markus Armbruster > --- > include/qapi/compat-policy.h | 7 + >

[PATCH v4 10/17] target/riscv: support for 128-bit U-type instructions

2021-10-25 Thread Frédéric Pétrot
Adding the 128-bit version of lui and auipc, and introducing to that end a set register with immediat function to handle extension on 128 bits. Signed-off-by: Frédéric Pétrot Co-authored-by: Fabien Portas --- target/riscv/translate.c| 22 ++

[PATCH v4 12/17] target/riscv: support for 128-bit arithmetic instructions

2021-10-25 Thread Frédéric Pétrot
Addition of 128-bit adds and subs in their various sizes. Signed-off-by: Frédéric Pétrot Co-authored-by: Fabien Portas --- target/riscv/insn32.decode | 3 + target/riscv/translate.c| 63 ++-- target/riscv/insn_trans/trans_rvb.c.inc | 20 +--

[PATCH v4 15/17] target/riscv: helper functions to wrap calls to 128-bit csr insns

2021-10-25 Thread Frédéric Pétrot
Given the side effects they have, the csr instructions are realized as helpers. We extend this existing infrastructure for 128-bit sized csr. We return 128-bit values using the same approach as for div/rem. Theses helpers all call a unique function that is currently a fallback on the 64-bit

[PATCH v4 08/17] target/riscv: accessors to registers upper part and 128-bit load/store

2021-10-25 Thread Frédéric Pétrot
Get function to retrieve the 64 top bits of a register, stored in the gprh field of the cpu state. Set function that writes the 128-bit value at once. The access to the gprh field can not be protected at compile time to make sure it is accessed only in the 128-bit version of the processor because

[RFC 1/2] tls: add macros for coroutine-safe TLS variables

2021-10-25 Thread Stefan Hajnoczi
Compiler optimizations can cache TLS values across coroutine yield points, resulting in stale values from the previous thread when a coroutine is re-entered by a new thread. Serge Guelton developed an __attribute__((noinline)) wrapper and tested it with clang and gcc. I formatted his idea

[RFC 2/2] util/async: replace __thread with QEMU TLS macros

2021-10-25 Thread Stefan Hajnoczi
QEMU TLS macros must be used to make TLS variables safe with coroutines. Signed-off-by: Stefan Hajnoczi --- util/async.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/util/async.c b/util/async.c index 6f6717a34b..9033f22a20 100644 --- a/util/async.c +++

[RFC 0/2] tls: add macros for coroutine-safe TLS variables

2021-10-25 Thread Stefan Hajnoczi
This is a preview of how we can solve the coroutines TLS problem. Coroutines re-entered from another thread sometimes see stale TLS values. This happens because compilers may cache values across yield points, so a value from the previous thread will be used when the coroutine is re-entered in

Re: [PATCH v2 0/3] virtio: increase VIRTQUEUE_MAX_SIZE to 32k

2021-10-25 Thread Stefan Hajnoczi
On Thu, Oct 21, 2021 at 05:39:28PM +0200, Christian Schoenebeck wrote: > On Freitag, 8. Oktober 2021 18:08:48 CEST Christian Schoenebeck wrote: > > On Freitag, 8. Oktober 2021 16:24:42 CEST Christian Schoenebeck wrote: > > > On Freitag, 8. Oktober 2021 09:25:33 CEST Greg Kurz wrote: > > > > On

Re: [PATCH v5 0/6] block/rbd: migrate to coroutines and add write zeroes support

2021-10-25 Thread Peter Lieven
Am 16.09.21 um 14:34 schrieb Peter Lieven: Am 09.07.21 um 12:21 schrieb Kevin Wolf: Am 08.07.2021 um 20:23 hat Peter Lieven geschrieben: Am 08.07.2021 um 14:18 schrieb Kevin Wolf : Am 07.07.2021 um 20:13 hat Peter Lieven geschrieben: Am 06.07.2021 um 17:25 schrieb Kevin Wolf : Am 06.07.2021

Re: [PATCH v4 02/25] include/block/block: split header into I/O and global state API

2021-10-25 Thread Philippe Mathieu-Daudé
On 10/25/21 12:17, Emanuele Giuseppe Esposito wrote: > 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 >

Re: [PATCH v4 6/8] iotests/300: avoid abnormal shutdown race condition

2021-10-25 Thread Hanna Reitz
On 13.10.21 23:57, John Snow wrote: Wait for the destination VM to close itself instead of racing to shut it down first, which produces different error log messages from AQMP depending on precisely when we tried to shut it down. (For example: We may try to issue 'quit' immediately prior to the

Re: [PATCH 1/9] qapi: New special feature flag "unstable"

2021-10-25 Thread Kashyap Chamarthy
On Mon, Oct 25, 2021 at 07:25:24AM +0200, Markus Armbruster wrote: > By convention, names starting with "x-" are experimental. The parts > of external interfaces so named may be withdrawn or changed > incompatibly in future releases. > > Drawback: promoting something from experimental to stable

Re: [PATCH] qmp: Stabilize preconfig

2021-10-25 Thread Markus Armbruster
Michal Privoznik writes: > The -preconfig option and exit-preconfig command are around for > quite some time now. However, they are still marked as unstable. > This is suboptimal because it may block some upper layer in > consuming it. In this specific case - Libvirt avoids using > experimental

[PATCH v4 05/17] target/riscv: array for the 64 upper bits of 128-bit registers

2021-10-25 Thread Frédéric Pétrot
The upper 64-bit of the 128-bit registers have now a place inside the cpu state structure, and are created as globals for future use. Signed-off-by: Frédéric Pétrot Co-authored-by: Fabien Portas --- target/riscv/cpu.h | 2 ++ target/riscv/cpu.c | 9 +

[PATCH v4 14/17] target/riscv: adding high part of some csrs

2021-10-25 Thread Frédéric Pétrot
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 --- target/riscv/cpu.h | 4 target/riscv/machine.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/target/riscv/cpu.h

[PATCH v4 04/17] target/riscv: separation of bitwise logic and aritmetic helpers

2021-10-25 Thread Frédéric Pétrot
Introduction of a gen_logic function for bitwise logic to implement instructions in which not propagation of information occurs between bits and use of this function on the bitwise instructions. Signed-off-by: Frédéric Pétrot Co-authored-by: Fabien Portas Reviewed-by: Richard Henderson ---

Re: MMIO/PIO dispatch file descriptors (ioregionfd) design discussion

2021-10-25 Thread Stefan Hajnoczi
On Mon, Oct 11, 2021 at 10:34:29PM -0700, elena wrote: > On Wed, Nov 25, 2020 at 12:44:07PM -0800, Elena Afanasova wrote: > > Hello, > > > > Hi > > Sorry for top-posting, just wanted to provide a quik update. > We are currently working on the support for ioregionfd in Qemu and will > be posting

[PATCH v4 16/17] target/riscv: modification of the trans_csrxx for 128-bit support

2021-10-25 Thread Frédéric Pétrot
As opposed to the gen_arith and gen_shift generation helpers, the csr insns do not have a common prototype, so the choice to generate 32/64 or 128-bit helper calls is done in the trans_csrxx functions. Signed-off-by: Frédéric Pétrot Co-authored-by: Fabien Portas Reviewed-by: Richard Henderson

Re: [PATCH 7/8] pci: Add pci_for_each_device_all()

2021-10-25 Thread Michael S. Tsirkin
On Mon, Oct 25, 2021 at 08:57:36PM +0800, Peter Xu wrote: > On Fri, Oct 22, 2021 at 04:43:43AM -0400, Michael S. Tsirkin wrote: > > On Fri, Oct 22, 2021 at 10:33:15AM +0800, Peter Xu wrote: > > > Hi, Michael, > > > > > > On Thu, Oct 21, 2021 at 06:54:59AM -0400, Michael S. Tsirkin wrote: > > > >

Re: [PATCH v2] hvf: Avoid mapping regions < PAGE_SIZE as ram

2021-10-25 Thread Philippe Mathieu-Daudé
On 10/25/21 15:21, Alexander Graf wrote: > HVF has generic memory listener code that adds all RAM regions as HVF RAM > regions. However, HVF can only handle page aligned, page granule regions. > > So let's ignore regions that are not page aligned and sized. They will be > trapped as MMIO instead.

Re: [PATCH v4 23/25] block-backend-common.h: split function pointers in BlockDevOps

2021-10-25 Thread Philippe Mathieu-Daudé
On 10/25/21 12:17, Emanuele Giuseppe Esposito wrote: > Assertions in the callers of the funciton pointrs are already > added by previous patches. Typo "function pointers". > > Signed-off-by: Emanuele Giuseppe Esposito > Reviewed-by: Stefan Hajnoczi > --- >

Re: [PATCH v4 00/25] block layer: split block APIs in global state and I/O

2021-10-25 Thread Philippe Mathieu-Daudé
On 10/25/21 12:17, Emanuele Giuseppe Esposito wrote: [...] > Each function in the GS API will have an assertion, checking > that it is always running under BQL. > I/O functions are instead thread safe (or so should be), meaning > that they *can* run under BQL, but also in an iothread in another >

Re: [PATCH] Add a comment about endian-ness of capabilities recorded in pci config space

2021-10-25 Thread Michael S. Tsirkin
On Mon, Oct 25, 2021 at 03:47:36PM +0530, Ani Sinha wrote: > Values in PCI configuration space are written in little endian format. This > includes capability values recorded in pci config space for pci bridges etc. > Add comment to remind developers to make sure the values are written in little >

[PATCH v4 13/17] target/riscv: support for 128-bit M extension

2021-10-25 Thread Frédéric Pétrot
Given the complexity of the implementation of these instructions, we call helpers to produce their behavior. From an implementation standpoint, we ended up by adding two more tcg globals to return the 128-bit result in a wrapper that itself is called by gen_arith. The sub 128-bit insns are now

[PATCH v2 0/2] mconfigptr support

2021-10-25 Thread Rahul Pathak
Patches add the mconfigptr csr support. mconfigptr is newly incorporated in risc-v privileged architecture specification 1.12 version. priv spec 1.12.0 version check is also added. qemu-system-riscv64 -nographic -machine virt -cpu rv64,priv_spec=v1.12.0 Changelog: v1->v2 -- 1. Added

[PATCH v4 17/17] target/riscv: actual functions to realize crs 128-bit insns

2021-10-25 Thread Frédéric Pétrot
The csrs are accessed through function pointers: we add read operations in the table for two 128-bit accesses (writes fallback to the 64-bit version): - misa, as mxl is needed for proper operation, - mstatus, as sd needs to be known also In addition, we also add read and write accesses to the

Re: [PATCH 7/8] pci: Add pci_for_each_device_all()

2021-10-25 Thread Peter Xu
On Fri, Oct 22, 2021 at 04:43:43AM -0400, Michael S. Tsirkin wrote: > On Fri, Oct 22, 2021 at 10:33:15AM +0800, Peter Xu wrote: > > Hi, Michael, > > > > On Thu, Oct 21, 2021 at 06:54:59AM -0400, Michael S. Tsirkin wrote: > > > > +typedef struct { > > > > +pci_bus_dev_fn fn; > > > > +void

Re: [PATCH 0/3] linux-aio: allow block devices to limit aio-max-batch

2021-10-25 Thread Kevin Wolf
Am 23.09.2021 um 16:30 hat Stefano Garzarella geschrieben: > Commit d7ddd0a161 ("linux-aio: limit the batch size using > `aio-max-batch` parameter") added a way to limit the batch size > of Linux AIO backend for the entire AIO context. > > The same AIO context can be shared by multiple devices,

Re: [RFC 1/2] tls: add macros for coroutine-safe TLS variables

2021-10-25 Thread Daniel P . Berrangé
On Mon, Oct 25, 2021 at 03:07:15PM +0100, Stefan Hajnoczi wrote: > Compiler optimizations can cache TLS values across coroutine yield > points, resulting in stale values from the previous thread when a > coroutine is re-entered by a new thread. > > Serge Guelton developed an

RE: [PATCH v3 36/48] tcg/optimize: Split out fold_xi_to_x

2021-10-25 Thread Luis Fernando Fujita Pires
From: Richard Henderson > Pull the "op r, a, i => mov r, a" optimization into a function, and use them > int the > outer-most logical operations. Typo: "int" -> "in". > -/* Simplify expression for "op r, a, const => mov r, a" cases */ > -switch (opc) { > -

RE: [PATCH v3 37/48] tcg/optimize: Split out fold_ix_to_i

2021-10-25 Thread Luis Fernando Fujita Pires
From: Richard Henderson > Pull the "op r, 0, b => movi r, 0" optimization into a function, and use it in > fold_shift. > > Signed-off-by: Richard Henderson > --- > tcg/optimize.c | 28 ++-- > 1 file changed, 10 insertions(+), 18 deletions(-) Reviewed-by: Luis Pires

[PATCH v2 3/4] usb/uhci: Replace pci_set_irq with qemu_set_irq

2021-10-25 Thread BALATON Zoltan
Instead of using pci_set_irq, store the irq in the device state and use it explicitly so variants having different interrupt handling can use their own. Signed-off-by: BALATON Zoltan Reviewed-by: Gerd Hoffmann --- hw/usb/hcd-uhci.c | 4 +++- hw/usb/hcd-uhci.h | 2 +- 2 files changed, 4

[PATCH v2 4/4] hw/usb/vt82c686-uhci-pci: Use ISA instead of PCI interrupts

2021-10-25 Thread BALATON Zoltan
This device is part of a superio/ISA bridge chip and IRQs from it are routed to an ISA interrupt set by the Interrupt Line PCI config register. Implement this in a vt82c686-uhci-pci specific irq handler Using via_isa_set_irq(). Signed-off-by: BALATON Zoltan Reviewed-by: Jiaxun Yang Reviewed-by:

Re: [PATCH v2 0/4] hw/usb/vt82c686-uhci-pci: Use ISA instead of PCI interrupts

2021-10-25 Thread Philippe Mathieu-Daudé
On 10/25/21 13:33, BALATON Zoltan wrote: > This is the same as posted before just omitting the two patches that > are optimisations by caching the func0 and avoiding QOM casts which > could not be measured to have an effect but these reamaining patches > are still needed to fix USB interrupts on

[PATCH v4 03/17] target/riscv: additional macros to check instruction support

2021-10-25 Thread Frédéric Pétrot
Given that the 128-bit version of the riscv spec adds new instructions, and that some instructions that were previously only available in 64-bit mode are now available for both 64-bit and 128-bit, we added new macros to check for the processor mode during translation. Although RV128 is a superset

Re: [PATCH 0/5] trace: inroduce qmp: trace namespace

2021-10-25 Thread Stefan Hajnoczi
On Thu, Oct 14, 2021 at 06:22:32PM +0300, Vladimir Sementsov-Ogievskiy wrote: > 12.10.2021 14:49, Markus Armbruster wrote: > > Vladimir Sementsov-Ogievskiy writes: > > > > > Hi all! > > > > > > We have handle_qmp_command and qmp_command_repond trace points to trace > > > qmp commands. They are

[PATCH v4 02/17] qemu/int128: addition of a few 128-bit operations

2021-10-25 Thread Frédéric Pétrot
Addition of not, xor, div and rem on 128-bit integers, used in particular within div/rem and csr helpers for computations on 128-bit registers in the 128-bit riscv target. Signed-off-by: Frédéric Pétrot Co-authored-by: Fabien Portas --- include/qemu/int128.h | 26 + util/int128.c

[PATCH v4 06/17] target/riscv: setup everything so that riscv128-softmmu compiles

2021-10-25 Thread Frédéric Pétrot
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 do to have a single executable for both. Once this patch applied,

Re: gitlab/cirrus auth token failure

2021-10-25 Thread Thomas Huth
On 25/10/2021 10.17, Daniel P. Berrangé wrote: On Sun, Oct 24, 2021 at 06:15:38PM -0700, Richard Henderson wrote: On 10/24/21 12:42 AM, Paolo Bonzini wrote: On 22/10/21 20:31, Richard Henderson wrote: Hi Daniel, you win the cookie because you committed cirrus.yml. I should have reported this

[PATCH v4 09/17] target/riscv: support for 128-bit bitwise instructions

2021-10-25 Thread Frédéric Pétrot
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 --- target/riscv/translate.c | 21 +++-- 1 file

Re: [PATCH 5/8] pci: Add pci_for_each_root_bus()

2021-10-25 Thread Michael S. Tsirkin
On Thu, Oct 21, 2021 at 06:42:56PM +0800, Peter Xu wrote: > Add a helper to loop over each root bus of the system, either the default root > bus or extended buses like pxb-pcie. > > Signed-off-by: Peter Xu > --- > hw/pci/pci.c | 26 ++ > include/hw/pci/pci.h | 2

Re: [PATCH 0/5] hw/sh4: Codeing style fixes

2021-10-25 Thread Yoshinori Sato
On Sun, 24 Oct 2021 09:40:53 +0900, BALATON Zoltan wrote: > > This fixes coding style of files belonging to SH4 system emulation > which were not following current QEMU coding style requirements. > > BALATON Zoltan (5): > hw/sh4: Coding style: Remove tabs > hw/sh4: Coding style: Fix

Re: [PATCH] block/export/fuse.c: fix musl build

2021-10-25 Thread Kevin Wolf
Am 22.10.2021 um 11:52 hat Fabrice Fontaine geschrieben: > Include linux/falloc.h if CONFIG_FALLOCATE_ZERO_RANGE is defined to fix > https://gitlab.com/qemu-project/qemu/-/commit/50482fda98bd62e072c30b7ea73c985c4e9d9bbb > and avoid the following build failure on musl: > > ../block/export/fuse.c:

Re: [PATCH v4] isa-applesmc: provide OSK forwarding on Apple hosts

2021-10-25 Thread Vladislav Yaroshchuk
пн, 25 окт. 2021 г. в 13:13, Alexander Graf : > > On 22.10.21 18:14, Vladislav Yaroshchuk wrote: > > On Apple hosts we can read AppleSMC OSK key directly from host's > > SMC and forward this value to QEMU Guest. > > > > Usage: > > `-device isa-applesmc,hostosk=on` > > > > Apple licence allows use

[PATCH v4 24/25] job.h: split function pointers in JobDriver

2021-10-25 Thread Emanuele Giuseppe Esposito
The job API will be handled separately in another serie. Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Stefan Hajnoczi --- include/qemu/job.h | 16 1 file changed, 16 insertions(+) diff --git a/include/qemu/job.h b/include/qemu/job.h index 6e67b6977f..7e9e59f4b8

Re: [PATCH] configure: do not duplicate CPU_CFLAGS into QEMU_LDFLAGS

2021-10-25 Thread Philippe Mathieu-Daudé
On 10/25/21 10:20, Paolo Bonzini wrote: Can we prefix with this? Since commit 4dba2789084 ("configure, meson: move CPU_CFLAGS out of QEMU_CFLAGS"), > CPU_CFLAGS is included in the link commands both during configure > and (via config-meson.cross) during meson. It need not be added >

Re: [PATCH] block/export/fuse.c: fix musl build

2021-10-25 Thread Philippe Mathieu-Daudé
On 10/22/21 11:52, Fabrice Fontaine wrote: > Include linux/falloc.h if CONFIG_FALLOCATE_ZERO_RANGE is defined to fix > https://gitlab.com/qemu-project/qemu/-/commit/50482fda98bd62e072c30b7ea73c985c4e9d9bbb > and avoid the following build failure on musl: > > ../block/export/fuse.c: In function

Re: [PATCH v5 04/12] hw/i386/pc: Allow instantiating a virtio-iommu device

2021-10-25 Thread Jean-Philippe Brucker
On Thu, Oct 21, 2021 at 03:47:09PM +0200, Igor Mammedov wrote: > On Wed, 20 Oct 2021 18:27:38 +0100 > Jean-Philippe Brucker wrote: > > > Allow instantiating a virtio-iommu device by adding an ACPI Virtual I/O > > Translation table (VIOT), which describes the relation between the > > virtio-iommu

  1   2   3   >