Re: [Question] qemu-img convert block alignment

2021-08-04 Thread Zhenyu Ye
On 2021/8/3 23:03, Eric Blake wrote: > On Fri, Apr 02, 2021 at 11:52:25AM +0800, Zhenyu Ye wrote: >> Hi all, >> >> commit 8dcd3c9b91 ("qemu-img: align result of is_allocated_sectors") >> introduces block alignment when doing qemu-img convert. However, the >> alignment is: >> >> s.alignment = M

Re: [PATCH v2 12/22] target/loongarch: Add fixed point extra instruction translation

2021-08-04 Thread Song Gao
On 07/23/2021 01:12 PM, Richard Henderson wrote: >> +static bool trans_asrtle_d(DisasContext *ctx, arg_asrtle_d * a) >> +{ >> +    TCGv t0, t1; >> + >> +    t0 = get_gpr(a->rj); >> +    t1 = get_gpr(a->rk); >> + >> +    gen_helper_asrtle_d(cpu_env, t0, t1); >> + >> +    return true; >> +} >> + >>

Re: [PATCH v2] hw/display/xlnx_dp: fix an out-of-bounds read in xlnx_dp_read

2021-08-04 Thread Thomas Huth
On 04/08/2021 08.51, Qiang Liu wrote: xlnx_dp_read allows an out-of-bounds read at its default branch because of an improper index. According to https://www.xilinx.com/html_docs/registers/ug1087/ug1087-zynq-ultrascale-registers.html (DP Module), registers 0x3A4/0x3A4/0x3AC are allowed. DP_INT_M

Re: [PATCH v2 12/22] target/loongarch: Add fixed point extra instruction translation

2021-08-04 Thread Song Gao
On 08/04/2021 03:40 PM, Song Gao wrote: > > On 07/23/2021 01:12 PM, Richard Henderson wrote: >>> +static bool trans_asrtle_d(DisasContext *ctx, arg_asrtle_d * a) >>> +{ >>> +    TCGv t0, t1; >>> + >>> +    t0 = get_gpr(a->rj); >>> +    t1 = get_gpr(a->rk); >>> + >>> +    gen_helper_asrtle_d(cpu_

Re: [PATCH 0/5] seccomp: fix hole in blocking forks

2021-08-04 Thread Eduardo Terrell Ferrari Otubo
On Mon, 2021-08-02 at 14:02 +0100, Daniel P. Berrangé wrote: > Blocking the 'fork' syscall on Linux is not sufficient to block the > 'fork' C library function, because the latter is essentially always > implemented using the 'clone' syscall these days. > > Blocking 'clone' is difficult as that als

Re: [PATCH for-6.1? v2 5/7] job: Add job_cancel_requested()

2021-08-04 Thread Max Reitz
On 03.08.21 16:25, Kevin Wolf wrote: Am 26.07.2021 um 16:46 hat Max Reitz geschrieben: Most callers of job_is_cancelled() actually want to know whether the job is on its way to immediate termination. For example, we refuse to pause jobs that are cancelled; but this only makes sense for jobs tha

Re: [PATCH v4] virtio/vsock: add two more queues for datagram types

2021-08-04 Thread Stefano Garzarella
On Tue, Aug 03, 2021 at 11:41:32PM +, Jiang Wang wrote: Datagram sockets are connectionless and unreliable. The sender does not know the capacity of the receiver and may send more packets than the receiver can handle. Add two more dedicate virtqueues for datagram sockets, so that it will not

Re: [PATCH] Makefile: Fix cscope issues on MacOS and soft links

2021-08-04 Thread Alex Bennée
Peter Xu writes: > Hi, Alex, > > On Tue, Aug 03, 2021 at 11:18:36PM +0100, Alex Bennée wrote: >> >> Peter Xu writes: >> >> > This patch fixes actually two issues with 'make cscope'. >> > >> > Firstly, it fixes the command for MacOS "find" command as MacOS will >> > append the >> > full path

Re: [PATCH v6 11/11] qapi: make 'if' condition strings simple identifiers

2021-08-04 Thread Marc-André Lureau
On Tue, Aug 3, 2021 at 5:35 PM Markus Armbruster wrote: > marcandre.lur...@redhat.com writes: > > > From: Marc-André Lureau > > > > Change the 'if' condition strings to be C-agnostic and be simple > > identifiers. > > This is less general, and that's okay, we're doing it for a purpose. > But the

Re: [PATCH v6 04/11] qapi: _make_enum_members() to work with pre-built QAPISchemaIfCond

2021-08-04 Thread Marc-André Lureau
Hi On Mon, Aug 2, 2021 at 2:41 PM Markus Armbruster wrote: > marcandre.lur...@redhat.com writes: > > > From: Marc-André Lureau > > > > Instead of lowering the expression back to its original form, and having > > to convert it again, special-case the 'if' condition to be pre-built. > > > > Signe

Re: [PATCH v6 02/11] qapi: wrap Sequence[str] in an object

2021-08-04 Thread Marc-André Lureau
Hi On Mon, Aug 2, 2021 at 1:21 PM Markus Armbruster wrote: > marcandre.lur...@redhat.com writes: > > > From: Marc-André Lureau > > > > Except for the special casing assert in _make_implicit_object_type(), > > which needs to handle schema objects, it's a mechanical change. > > > > Signed-off-by:

Re: [PATCH v6 06/11] qapidoc: introduce QAPISchemaIfCond.docgen()

2021-08-04 Thread Marc-André Lureau
Hi On Mon, Aug 2, 2021 at 7:47 PM Markus Armbruster wrote: > marcandre.lur...@redhat.com writes: > > > From: Marc-André Lureau > > > > Instead of building the condition documentation from a list of string, > > use the result generated from QAPISchemaIfCond.docgen(). > > > > Signed-off-by: Marc-

Re: [PATCH v6 05/11] qapi: introduce QAPISchemaIfCond.cgen()

2021-08-04 Thread Marc-André Lureau
Hi On Mon, Aug 2, 2021 at 6:46 PM Markus Armbruster wrote: > marcandre.lur...@redhat.com writes: > > > From: Marc-André Lureau > > > > Instead of building prepocessor conditions from a list of string, use > > the result generated from QAPISchemaIfCond.cgen() and hide the > > implementation deta

Re: [PATCH v6 03/11] qapi: add QAPISchemaIfCond.is_present()

2021-08-04 Thread Marc-André Lureau
On Mon, Aug 2, 2021 at 1:52 PM Markus Armbruster wrote: > marcandre.lur...@redhat.com writes: > > > From: Marc-André Lureau > > > > Signed-off-by: Marc-André Lureau > > --- > > docs/sphinx/qapidoc.py | 8 > > scripts/qapi/schema.py | 7 +-- > > tests/qapi-schema/te

Re: [PATCH v6 00/11] qapi: untie 'if' conditions from C preprocessor

2021-08-04 Thread Marc-André Lureau
Hi On Tue, Aug 3, 2021 at 5:44 PM Markus Armbruster wrote: > marcandre.lur...@redhat.com writes: > > > From: Marc-André Lureau > > > > Hi, > > > > This series makes the 'if' conditions less liberal, by formalizing a > simple > > expression tree based on bare boolean logic of configure option >

Re: [PATCH for-6.1? v2 6/7] mirror: Check job_is_cancelled() earlier

2021-08-04 Thread Max Reitz
On 03.08.21 16:34, Kevin Wolf wrote: Am 26.07.2021 um 16:46 hat Max Reitz geschrieben: We must check whether the job is force-cancelled early in our main loop, most importantly before any `continue` statement. For example, we used to have `continue`s before our current checking location that ar

Re: [PATCH v6 07/11] qapi: replace if condition list with dict {'all': [...]}

2021-08-04 Thread Marc-André Lureau
Hi On Tue, Aug 3, 2021 at 5:05 PM Markus Armbruster wrote: > marcandre.lur...@redhat.com writes: > > > From: Marc-André Lureau > > > > Replace the simple list sugar form with a recursive structure that will > > accept other operators in the following commits (all, any or not). > > > > Signed-of

Re: [PULL 0/3] s390x fixes

2021-08-04 Thread Peter Maydell
On Tue, 3 Aug 2021 at 15:25, Thomas Huth wrote: > > Hi Peter! > > The following changes since commit 7f1cab9c628a798ae2607940993771e6300e9e00: > > Merge remote-tracking branch 'remotes/bonzini-gitlab/tags/for-upstream' > into staging (2021-08-02 17:21:50 +0100) > > are available in the Git rep

[PATCH v7 00/10] qapi: untie 'if' conditions from C preprocessor

2021-08-04 Thread marcandre . lureau
From: Marc-André Lureau Hi, This series makes the 'if' conditions less liberal, by formalizing a simple expression tree based on bare boolean logic of configure option identifiers. (this allows to express conditions in Rust in my QAPI-Rust PoC series) thanks v7: after Markus review - use is_

[PATCH v7 01/10] docs: update the documentation upfront about schema configuration

2021-08-04 Thread marcandre . lureau
From: Marc-André Lureau Update the documentation describing the changes in this series. Signed-off-by: Marc-André Lureau Reviewed-by: Stefan Hajnoczi Tested-by: John Snow Reviewed-by: Markus Armbruster --- docs/devel/qapi-code-gen.txt | 30 ++ 1 file changed, 18

[PATCH v7 02/10] qapi: wrap Sequence[str] in an object

2021-08-04 Thread marcandre . lureau
From: Marc-André Lureau Except for the special casing assert in _make_implicit_object_type(), which needs to handle schema objects, it's a mechanical change. Signed-off-by: Marc-André Lureau --- docs/sphinx/qapidoc.py | 10 +++--- scripts/qapi/commands.py | 4 +-- scripts/qapi/e

[PATCH v7 06/10] qapi: replace if condition list with dict {'all': [...]}

2021-08-04 Thread marcandre . lureau
From: Marc-André Lureau Replace the simple list sugar form with a recursive structure that will accept other operators in the following commits (all, any or not). Signed-off-by: Marc-André Lureau --- scripts/qapi/common.py| 23 +-- scripts/qapi/expr.py

[PATCH v7 05/10] qapidoc: introduce QAPISchemaIfCond.docgen()

2021-08-04 Thread marcandre . lureau
From: Marc-André Lureau Instead of building the condition documentation from a list of string, use the result generated from QAPISchemaIfCond.docgen(). This changes the generated documentation from: - COND1, COND2... (where COND1, COND2 are Literal nodes, and ',' is Text) to: - COND1 and COND2 (

[PATCH v7 03/10] qapi: add QAPISchemaIfCond.is_present()

2021-08-04 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Reviewed-by: Markus Armbruster --- docs/sphinx/qapidoc.py | 8 scripts/qapi/introspect.py | 4 ++-- scripts/qapi/schema.py | 7 +-- tests/qapi-schema/test-qapi.py | 2 +- 4 files changed, 12 insertions(+)

[PATCH v7 09/10] qapi: add 'not' condition operation

2021-08-04 Thread marcandre . lureau
From: Marc-André Lureau For the sake of completeness, introduce the 'not' condition. Signed-off-by: Marc-André Lureau --- scripts/qapi/common.py | 4 scripts/qapi/expr.py| 7 +-- tests/qapi-schema/bad-if-key.err| 2 +- tests/qapi-schema/bad

[PATCH v7 04/10] qapi: introduce QAPISchemaIfCond.cgen()

2021-08-04 Thread marcandre . lureau
From: Marc-André Lureau Instead of building prepocessor conditions from a list of string, use the result generated from QAPISchemaIfCond.cgen() and hide the implementation details. Note: this patch introduces a minor regression, generating a redundant pair of parenthesis. This is fixed in a late

Re: [PATCH 4/6] coverity-model: clean up the models for array allocation functions

2021-08-04 Thread Markus Armbruster
Paolo Bonzini writes: > On 02/08/21 14:36, Peter Maydell wrote: >> Reviewed-by: Peter Maydell >> The real g_malloc_n() returns failure if the multiplication >> would overflow; Really? Its documentation: This function is similar to g_malloc(), allocating (n_blocks * n_block_bytes) bytes

Re: [PATCH] hw/char/virtio-serial-bus: fix: Unpop throttled VirtQueueElement to queue before discard vq data

2021-08-04 Thread AIERPATIJIANG1 [艾尔帕提江·阿布都赛买提]
在 2021/8/2 下午11:01,“Laurent Vivier” 写入: On 30/07/2021 03:58, AIERPATIJIANG1 [艾尔帕提江·阿布都赛买提] wrote: >> Ports enter a "throttled" state when writing to the chardev would block. >> The current output VirtQueueElement is kept around until the chardev >> becomes writable again. >>

[PATCH v7 07/10] qapi: add 'any' condition

2021-08-04 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- tests/unit/test-qmp-cmds.c | 1 + scripts/qapi/common.py | 4 ++-- scripts/qapi/expr.py| 6 +++--- tests/qapi-schema/bad-if-key.err| 2 +- tests/qapi-schema/bad-if-keys.err

[PATCH v7 08/10] qapi: Use 'if': { 'any': ... } where appropriate

2021-08-04 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Reviewed-by: Stefan Hajnoczi Tested-by: John Snow Reviewed-by: Markus Armbruster --- qapi/machine-target.json | 20 qapi/misc-target.json| 12 +++- 2 files changed, 27 insertions(+), 5 deletions(-) dif

[PATCH v7 10/10] qapi: make 'if' condition strings simple identifiers

2021-08-04 Thread marcandre . lureau
From: Marc-André Lureau Change the 'if' condition strings to be C-agnostic. It will accept '[A-Z][A-Z0-9_]*' identifiers. This allows to express configuration conditions in other languages (Rust or Python for ex) or other more suitable forms. Signed-off-by: Marc-André Lureau Reviewed-by: Stefan

Re: [PATCH] util: fix abstract socket path copy

2021-08-04 Thread Marc-André Lureau
Hi On Wed, Aug 4, 2021 at 12:39 PM Markus Armbruster wrote: > marcandre.lur...@redhat.com writes: > > > From: Marc-André Lureau > > > > Commit 776b97d360 "qemu-sockets: add abstract UNIX domain socket > > support" neglected to update socket_sockaddr_to_address_unix() and > > copied the whole su

Re: [PATCH] util: fix abstract socket path copy

2021-08-04 Thread Markus Armbruster
marcandre.lur...@redhat.com writes: > From: Marc-André Lureau > > Commit 776b97d360 "qemu-sockets: add abstract UNIX domain socket > support" neglected to update socket_sockaddr_to_address_unix() and > copied the whole sun_path without taking "salen" into account. > > Later, commit 3b14b4ec49 "so

Re: [PATCH 4/6] coverity-model: clean up the models for array allocation functions

2021-08-04 Thread Peter Maydell
On Wed, 4 Aug 2021 at 09:35, Markus Armbruster wrote: > > Paolo Bonzini writes: > > > On 02/08/21 14:36, Peter Maydell wrote: > >> Reviewed-by: Peter Maydell > >> The real g_malloc_n() returns failure if the multiplication > >> would overflow; > > Really? Its documentation: > > This function

Re: [PATCH 0/3] docs: convert qapi-code-gen.txt to qapi-code-gen.rst

2021-08-04 Thread Markus Armbruster
Peter Maydell writes: > On Wed, 21 Jul 2021 at 00:58, John Snow wrote: >> >> Patch 1 does (roughly) the bare minimum, patch 2 adds some formatting, >> and patch 3 adds cross-references. >> >> John Snow (3): >> docs: convert qapi-code-gen.txt to ReST >> docs/qapi-code-gen: Beautify formatting

[RESEND RFC] hw/arm/smmuv3: add device properties to disable cached iotlb

2021-08-04 Thread chenxiang
From: Xiang Chen It splits invalidations into ^2 range invalidations in the patch 6d9cd115b(" hw/arm/smmuv3: Enforce invalidation on a power of two range"). So for some scenarios such as the size of invalidation is not ^2 range invalidation, it costs more time to invalidate. Currently smmuv3_tran

Re: [PATCH] docs: convert writing-qmp-commands.txt to writing-qmp-commands.rst

2021-08-04 Thread Markus Armbruster
John Snow writes: > This does about the bare minimum, converting section headers to ReST > ones and adding an indent for code blocks. > > Signed-off-by: John Snow > --- > docs/devel/index.rst | 1 + > ...-commands.txt => writing-qmp-commands.rst} | 581 +--

Re: [PATCH v2 06/55] target/microblaze: Do not set MO_ALIGN for user-only

2021-08-04 Thread Edgar E. Iglesias
On Mon, Aug 02, 2021 at 06:13:54PM -1000, Richard Henderson wrote: > The kernel will fix up unaligned accesses, so emulate that > by allowing unaligned accesses to succeed. Reviewed-by: Edgar E. Iglesias > > Cc: Edgar E. Iglesias > Signed-off-by: Richard Henderson > --- > target/microblaz

Re: [PATCH V5 00/25] Live Update [restart] : fork mode?

2021-08-04 Thread Zheng Chuan
kindly ping? On 2021/7/30 21:10, Zheng Chuan wrote: > Hi, Steve > I have saw the discussion about the fork+exec mode below: > https://www.mail-archive.com/qemu-devel@nongnu.org/msg815956.html > > And I am still very curious and I want to discuss about the possibility to > support both fork+exec

[PATCH v7 00/33] block: publish backup-top filter

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
Hi all! v7: small change: keep fleecing detection logic. I'm now implementing a more effective way to do fleecing, that doesn't rely on backing chain and on serializing requests. So, for this alternative way we'll not need BDRV_REQ_SERIALISING flag. Let's keep automatic addition of this flag when

[PATCH v7 06/33] block-copy: move detecting fleecing scheme to block-copy

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
We want to simplify initialization interface of copy-before-write filter as we are going to make it public. So, let's detect fleecing scheme exactly in block-copy code, to not pass this information through extra levels. Why not just set BDRV_REQ_SERIALISING unconditionally: because we are going to

[PATCH v7 07/33] block/block-copy: introduce block_copy_set_copy_opts()

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
We'll need a possibility to set compress and use_copy_range options after initialization of the state. So make corresponding part of block_copy_state_new() separate and public. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/block/block-copy.h | 2 ++ block/block-copy.c | 66 +++

[PATCH v7 05/33] block: rename backup-top to copy-before-write

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
We are going to convert backup_top to full featured public filter, which can be used in separate of backup job. Start from renaming from "how it used" to "what it does". While updating comments in 283 iotest, drop and rephrase also things about ".active", as this field is now dropped, and filter d

[PATCH v7 01/33] block: introduce bdrv_replace_child_bs()

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
Add function to transactionally replace bs inside BdrvChild. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- include/block/block.h | 2 ++ block.c | 31 +++ 2 files changed, 33 insertions(+) diff --git a/include/block/block.h b/

[PATCH v7 09/33] block/backup: move cluster size calculation to block-copy

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
The main consumer of cluster-size is block-copy. Let's calculate it here instead of passing through backup-top. We are going to publish copy-before-write filter soon, so it will be created through options. But we don't want for now to make explicit option for cluster-size, let's continue to calcul

[PATCH v7 08/33] block/backup: set copy_range and compress after filter insertion

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
We are going to publish copy-before-write filter, so it would be initialized through options. Still we don't want to publish compress and copy-range options, as 1. Modern way to enable compression is to use compress filter. 2. For copy-range it's unclean how to make proper interface: - it's has

[PATCH v7 04/33] qdev: allow setting drive property for realized device

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
We need an ability to insert filters above top block node, attached to block device. It can't be achieved with blockdev-reopen command. So, we want do it with help of qom-set. Intended usage: Assume there is a node A that is attached to some guest device. 1. blockdev-add to create a filter node

[PATCH v7 20/33] block/block-copy: make setting progress optional

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
Now block-copy will crash if user don't set progress meter by block_copy_set_progress_meter(). copy-before-write filter will be used in separate of backup job, and it doesn't want any progress meter (for now). So, allow not setting it. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max

[PATCH v7 02/33] block: introduce blk_replace_bs

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
Add function to change bs inside blk. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- include/sysemu/block-backend.h | 1 + block/block-backend.c | 8 2 files changed, 9 insertions(+) diff --git a/include/sysemu/block-backend.h b/include/sysemu/block-ba

[PATCH v7 11/33] block/copy-before-write: drop extra bdrv_unref on failure path

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
bdrv_attach_child() do bdrv_unref() on failure, so we shouldn't do it by hand here. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- block/copy-before-write.c | 1 - 1 file changed, 1 deletion(-) diff --git a/block/copy-before-write.c b/block/copy-before-write.c index 2a5

[PATCH v7 10/33] block/copy-before-write: relax permission requirements when no parents

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
We are going to publish copy-before-write filter. So, user should be able to create it with blockdev-add first, specifying both filtered and target children. And then do blockdev-reopen, to actually insert the filter where needed. Currently, filter unshares write permission unconditionally on sour

[PATCH v7 03/33] qdev-properties: PropertyInfo: add realized_set_allowed field

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
Add field, so property can declare support for setting the property when device is realized. To be used in the following commit. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- include/hw/qdev-properties.h | 1 + hw/core/qdev-properties.c| 6 +++--- 2 files changed, 4

[PATCH v7 16/33] block/copy-before-write: cbw_init(): use file child after attaching

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
In the next commit we'll get rid of source argument of cbw_init(). Prepare to it now, to make next commit simpler: move the code block that uses source below attaching the child and use bs->file->bs instead of source variable. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --

[PATCH v7 19/33] block/copy-before-write: initialize block-copy bitmap

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
We are going to publish copy-before-write filter to be used in separate of backup. Future step would support bitmap for the filter. But let's start from full set bitmap. We have to modify backup, as bitmap is first initialized by copy-before-write filter, and then backup modifies it. Signed-off-b

[PATCH v7 13/33] block/copy-before-write: bdrv_cbw_append(): replace child at last

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
Refactor the function to replace child at last. Thus we don't need to revert it and code is simplified. block-copy state initialization being done before replacing the child doesn't need any drained section. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- block/copy-befo

[PATCH v7 21/33] block/copy-before-write: make public block driver

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
Finally, copy-before-write gets own .bdrv_open and .bdrv_close handlers, block_init() call and becomes available through bdrv_open(). To achieve this: - cbw_init gets unused flags argument and becomes cbw_open - block_copy_state_free() call moved to new cbw_close() - in bdrv_cbw_append: - o

[PATCH v7 14/33] block/copy-before-write: introduce cbw_init()

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
Move part of bdrv_cbw_append() to new function cbw_open(). It's an intermediate step for adding normal .bdrv_open() handler to the filter. With this commit no logic is changed, but we have a function which will be turned into .bdrv_open() handler in future commit. Signed-off-by: Vladimir Sementsov

[PATCH v7 12/33] block/copy-before-write: use file child instead of backing

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
We are going to publish copy-before-write filter, and there no public backing-child-based filter in Qemu. No reason to create a precedent, so let's refactor copy-before-write filter instead. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- block/copy-before-write.c | 39 ++

[PATCH v7 15/33] block/copy-before-write: cbw_init(): rename variables

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
One more step closer to real .bdrv_open() handler: use more usual names for bs being initialized and its state. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- block/copy-before-write.c | 29 ++--- 1 file changed, 14 insertions(+), 15 deletions(-)

[PATCH v7 22/33] qapi: publish copy-before-write filter

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- qapi/block-core.json | 25 +++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/qapi/block-core.json b/qapi/block-core.json index 675d8265eb..59d3e5e42d 100644 --- a/qapi/block-core.json ++

[PATCH v7 18/33] block/copy-before-write: cbw_init(): use options

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
One more step closer to .bdrv_open(): use options instead of plain arguments. Move to bdrv_open_child() calls, native for drive open handlers. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/copy-before-write.c | 29 +++-- 1 file changed, 15 insertions(+), 14 deleti

[PATCH v7 17/33] block/copy-before-write: bdrv_cbw_append(): drop unused compress arg

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/copy-before-write.h | 1 - block/backup.c| 2 +- block/copy-before-write.c | 7 +++ 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/block/copy-before-write.h b/block/copy-before-write.h index b386fd8f01..51847e71

[PATCH v7 24/33] python/qemu/machine: QEMUMachine: improve qmp() method

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
We often call qmp() with unpacking dict, like qmp('foo', **{...}). mypy don't really like it, it thinks that passed unpacked dict is a positional argument and complains that it type should be bool (because second argument of qmp() is conv_keys: bool). Allow passing dict directly, simplifying inter

[PATCH v7 31/33] iotests/image-fleecing: rename tgt_node

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
Actually target of backup(sync=None) is not a final backup target: image fleecing is intended to be used with external tool, which will copy data from fleecing node to some real backup target. Also, we are going to add a test case for "push backup with fleecing", where instead of exporting fleecin

[PATCH v7 28/33] iotests: move 222 to tests/image-fleecing

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
Give a good name to test file. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- tests/qemu-iotests/{222 => tests/image-fleecing} | 0 tests/qemu-iotests/{222.out => tests/image-fleecing.out} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename tests/qemu-i

[PATCH v7 23/33] python/qemu/machine.py: refactor _qemu_args()

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
- use shorter construction - don't create new dict if not needed - drop extra unpacking key-val arguments - drop extra default values Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz Reviewed-by: John Snow --- python/qemu/machine/machine.py | 18 -- 1 file

[PATCH v7 26/33] iotests/222: fix pylint and mypy complains

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
Here: - long line - move to new interface of vm.qmp() (direct passing dict), to avoid mypy false-positive, as it thinks that unpacked dict is a positional argument. - extra parenthesis - handle event_wait possible None value Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max R

[PATCH v7 27/33] iotests/222: constantly use single quotes for strings

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
The file use both single and double quotes for strings. Let's be consistent. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- tests/qemu-iotests/222 | 68 +- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/tests/qemu-

[PATCH v7 30/33] iotests/image-fleecing: proper source device

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
Define scsi device to operate with it by qom-set in further patch. Give a new node-name to source block node, to not look like device name. Job now don't want to work without giving explicit id, so, let's call it "fleecing". Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --

[PATCH v7 25/33] iotests.py: VM: add own __enter__ method

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
In superclass __enter__ method is defined with return value type hint 'QEMUMachine'. So, mypy thinks that return value of VM.__enter__ is QEMUMachine. Let's redefine __enter__ in VM class, to give it correct type hint. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- tests

[PATCH v7 33/33] iotests/image-fleecing: add test-case for copy-before-write filter

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
New fleecing method becomes available: copy-before-write filter. Actually we don't need backup job to setup image fleecing. Add test for new recommended way of image fleecing. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- tests/qemu-iotests/tests/image-fleecing | 5

Re: [PATCH 2/2] Acceptance Tests: updates to the MAINTAINERS file

2021-08-04 Thread Philippe Mathieu-Daudé
On 8/3/21 10:09 PM, Willian Rampazzo wrote: > On Tue, Aug 3, 2021 at 4:35 PM Cleber Rosa wrote: >> >> The tests/acceptance directory is currently lacking a maintainer >> entry, even though I've been performing that role (of course with help >> from many others). Thus, its status is, even more now

[PATCH v7 29/33] iotests.py: hmp_qemu_io: support qdev

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- tests/qemu-iotests/iotests.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 025e288ddd..9d0031a0e8 100644 --- a/tests/qemu-iotests

Re: [PATCH] linux-user/elfload: byteswap i386 registers when dumping core

2021-08-04 Thread Philippe Mathieu-Daudé
On 8/3/21 7:20 PM, Ilya Leoshkevich wrote: > Core dumps from emulating x86_64 on big-endian hosts contain incorrect > register values. > > Signed-off-by: Ilya Leoshkevich > --- > linux-user/elfload.c | 88 ++-- > 1 file changed, 44 insertions(+), 44 deleti

[PATCH v7 32/33] iotests/image-fleecing: prepare for adding new test-case

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
We are going to add a test-case with some behavior modifications. So, let's prepare a function to be reused. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- tests/qemu-iotests/tests/image-fleecing | 19 +-- 1 file changed, 13 insertions(+), 6 deletions(-)

Re: [PATCH v2 for-6.2 0/6] push backup with fleecing

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
Consider that as RFC. I'm preparing an alternative and more efficient fleecing scheme, based on special block driver, not on backing link. So, this will be rebased, and probably some permission-related difficulties may be avoided. 21.07.2021 17:04, Vladimir Sementsov-Ogievskiy wrote: Hi all!

Re: [PATCH for-6.1? v2 6/7] mirror: Check job_is_cancelled() earlier

2021-08-04 Thread Kevin Wolf
Am 04.08.2021 um 10:25 hat Max Reitz geschrieben: > On 03.08.21 16:34, Kevin Wolf wrote: > > Am 26.07.2021 um 16:46 hat Max Reitz geschrieben: > > > We must check whether the job is force-cancelled early in our main loop, > > > most importantly before any `continue` statement. For example, we used

Re: [PATCH for-6.1? v2 6/7] mirror: Check job_is_cancelled() earlier

2021-08-04 Thread Max Reitz
On 04.08.21 11:48, Kevin Wolf wrote: Am 04.08.2021 um 10:25 hat Max Reitz geschrieben: On 03.08.21 16:34, Kevin Wolf wrote: Am 26.07.2021 um 16:46 hat Max Reitz geschrieben: We must check whether the job is force-cancelled early in our main loop, most importantly before any `continue` statemen

Re: [PATCH for-6.1? v2 5/7] job: Add job_cancel_requested()

2021-08-04 Thread Kevin Wolf
[ Peter, the question for you is at the end. ] Am 04.08.2021 um 10:07 hat Max Reitz geschrieben: > On 03.08.21 16:25, Kevin Wolf wrote: > > Am 26.07.2021 um 16:46 hat Max Reitz geschrieben: > > > Most callers of job_is_cancelled() actually want to know whether the job > > > is on its way to immedi

Re: [PULL 0/1] Block layer patches

2021-08-04 Thread Peter Maydell
On Tue, 3 Aug 2021 at 15:41, Kevin Wolf wrote: > > The following changes since commit 7f1cab9c628a798ae2607940993771e6300e9e00: > > Merge remote-tracking branch 'remotes/bonzini-gitlab/tags/for-upstream' > into staging (2021-08-02 17:21:50 +0100) > > are available in the Git repository at: > >

Re: [PATCH for-6.1? v2 5/7] job: Add job_cancel_requested()

2021-08-04 Thread Peter Krempa
On Wed, Aug 04, 2021 at 12:34:31 +0200, Kevin Wolf wrote: > We could in theory keep allowing redundant completion requests when the > completion mode doesn't conflict, but I don't see the point of that. I don't see either. Especially since ... > Unless libvirt can actually issue multiple comple

[qemu-web PATCH] Update broken links to point to the new page with deprecated features

2021-08-04 Thread Thomas Huth
The deprecated.html file has been moved from the "system" to the "about" folder recently. Signed-off-by: Thomas Huth --- _posts/2017-08-10-deprecation.md | 2 +- download.html| 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/_posts/2017-08-10-deprecat

Re: [PATCH 1/4] chardev: fix qemu_chr_open_fd() being called with fd=-1

2021-08-04 Thread Marc-André Lureau
Hi On Tue, Aug 3, 2021 at 12:41 PM Daniel P. Berrangé wrote: > On Fri, Jul 23, 2021 at 02:28:22PM +0400, marcandre.lur...@redhat.com > wrote: > > From: Marc-André Lureau > > > > The "file" chardev may call qemu_chr_open_fd() with fd_in=-1. This may > > cause invalid system calls, as the QIOChan

[PATCH] target/i386: VMRUN and VMLOAD canonicalizations

2021-08-04 Thread Lara Lazier
APM2 requires that VMRUN and VMLOAD canonicalize (sign extend to 63 from 48/57) all base addresses in the segment registers that have been respectively loaded. Signed-off-by: Lara Lazier --- target/i386/cpu.c | 19 +++ target/i386/cpu.h | 2 ++

[PATCH v4 01/14] doc: update AMD SEV API spec web link

2021-08-04 Thread Ashish Kalra
From: Brijesh Singh Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Brijesh Singh Signed-off-by: Ashish Kalra --- docs/amd-memory-encryption.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/amd-memory-encryption.txt b/docs/amd-memory-encryption.txt index ffc

Re: [PATCH v5 0/2] plugins/cache: multicore cache modelling

2021-08-04 Thread Mahmoud Mandour
On Tue, Aug 3, 2021 at 11:10 PM Alex Bennée wrote: > > Mahmoud Mandour writes: > > > Hello, > > > > This series introduce multicore cache modelling in > contrib/plugins/cache.c > > > > Multi-core cache modelling is handled such that for full-system > > emulation, a private L1 cache is maintained

[PATCH v4 03/14] migration.json: add AMD SEV specific migration parameters

2021-08-04 Thread Ashish Kalra
From: Brijesh Singh AMD SEV migration flow requires that target machine's public Diffie-Hellman key (PDH) and certificate chain must be passed before initiating the guest migration. User can use QMP 'migrate-set-parameters' to pass the certificate chain. The certificate chain will be used while c

[PATCH v4 04/14] confidential guest support: introduce ConfidentialGuestMemoryEncryptionOps for encrypted VMs

2021-08-04 Thread Ashish Kalra
From: Brijesh Singh When memory encryption is enabled in VM, the guest RAM will be encrypted with the guest-specific key, to protect the confidentiality of data while in transit we need to platform specific hooks to save or migrate the guest RAM. Introduce the new ConfidentialGuestMemoryEncrypti

[PATCH v4 02/14] doc: update AMD SEV to include Live migration flow

2021-08-04 Thread Ashish Kalra
From: Brijesh Singh Signed-off-by: Brijesh Singh Signed-off-by: Ashish Kalra --- docs/amd-memory-encryption.txt | 46 +- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/docs/amd-memory-encryption.txt b/docs/amd-memory-encryption.txt index 12ca25180

[PATCH v4 06/14] target/i386: sev: do not create launch context for an incoming guest

2021-08-04 Thread Ashish Kalra
From: Brijesh Singh The LAUNCH_START is used for creating an encryption context to encrypt newly created guest, for an incoming guest the RECEIVE_START should be used. Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Brijesh Singh Signed-off-by: Ashish Kalra --- target/i386/sev.c | 15

[PATCH v4 08/14] target/i386: sev: add support to load incoming encrypted page

2021-08-04 Thread Ashish Kalra
From: Brijesh Singh The sev_load_incoming_page() provide the implementation to read the incoming guest private pages from the socket and load it into the guest memory. The routines uses the RECEIVE_START command to create the incoming encryption context on the first call then uses the RECEIEVE_UP

[PATCH v4 05/14] target/i386: sev: provide callback to setup outgoing context

2021-08-04 Thread Ashish Kalra
From: Brijesh Singh The user provides the target machine's Platform Diffie-Hellman key (PDH) and certificate chain before starting the SEV guest migration. Cache the certificate chain as we need them while creating the outgoing context. Signed-off-by: Brijesh Singh Co-developed-by: Ashish Kalra

[PATCH v4 00/14] Add SEV guest live migration support

2021-08-04 Thread Ashish Kalra
From: Ashish Kalra AMD SEV encrypts the memory of VMs and because this encryption is done using an address tweak, the hypervisor will not be able to simply copy ciphertext between machines to migrate a VM. Instead the AMD SEV Key Management API provides a set of functions which the hypervisor can

[PATCH v4 07/14] target/i386: sev: add support to encrypt the outgoing page

2021-08-04 Thread Ashish Kalra
From: Brijesh Singh The sev_save_outgoing_page() provide the implementation to encrypt the guest private pages during the transit. The routines uses the SEND_START command to create the outgoing encryption context on the first call then uses the SEND_UPDATE_DATA command to encrypt the data before

[PATCH v4 11/14] migration/ram: add support to send encrypted pages

2021-08-04 Thread Ashish Kalra
From: Brijesh Singh When memory encryption is enabled, the guest memory will be encrypted with the guest specific key. The patch introduces RAM_SAVE_FLAG_ENCRYPTED_PAGE flag to distinguish the encrypted data from plaintext. Encrypted pages may need special handling. The sev_save_outgoing_page() i

[PATCH v4 10/14] migration: add support to migrate shared regions list

2021-08-04 Thread Ashish Kalra
From: Brijesh Singh When memory encryption is enabled, the hypervisor maintains a shared regions list which is referred by hypervisor during migration to check if page is private or shared. This list is built during the VM bootup and must be migrated to the target host so that hypervisor on targe

[PATCH v4 09/14] kvm: Add support for SEV shared regions list and KVM_EXIT_HYPERCALL.

2021-08-04 Thread Ashish Kalra
From: Ashish Kalra KVM_HC_MAP_GPA_RANGE hypercall is used by the SEV guest to notify a change in the page encryption status to the hypervisor. The hypercall should be invoked only when the encryption attribute is changed from encrypted -> decrypted and vice versa. By default all guest pages are c

[PATCH v4 14/14] kvm: Add support for userspace MSR filtering and handling of MSR_KVM_MIGRATION_CONTROL.

2021-08-04 Thread Ashish Kalra
From: Ashish Kalra Add support for userspace MSR filtering using KVM_X86_SET_MSR_FILTER ioctl and handling of MSRs in userspace. Currently this is only used for SEV guests which use MSR_KVM_MIGRATION_CONTROL to indicate if the guest is enabled and ready for migration. KVM arch code calls into SE

[PATCH v4 12/14] migration/ram: Force encrypted status for flash0 & flash1 devices.

2021-08-04 Thread Ashish Kalra
From: Ashish Kalra Currently OVMF clears the C-bit and marks NonExistent memory space as decrypted in the page encryption bitmap. By marking the NonExistent memory space as decrypted it gurantees any future MMIO adds will work correctly, but this marks flash0 device space as decrypted. At reset t

[PATCH v4 13/14] migration: for SEV live migration bump downtime limit to 1s.

2021-08-04 Thread Ashish Kalra
From: Ashish Kalra Now, qemu has a default expected downtime of 300 ms and SEV Live migration has a page-per-second bandwidth of 350-450 pages ( SEV Live migration being generally slow due to guest RAM pages being migrated after encryption using the security processor ). With this expected downti

  1   2   3   >