Re: [Qemu-devel] [RFC PATCH v2 00/39] rewrite MMX/SSE instruction translation

2019-08-09 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20190810041255.6820-1-jan.bo...@gmail.com/ Hi, This series seems to have some coding style problems. See output below for more information: Subject: [Qemu-devel] [RFC PATCH v2 00/39] rewrite MMX/SSE instruction translation Message-id:

[Qemu-devel] [RFC PATCH v2 37/39] target/i386: introduce SSE code generators

2019-08-09 Thread Jan Bobek
Introduce code generators required by SSE instructions. Signed-off-by: Jan Bobek --- target/i386/translate.c | 440 1 file changed, 440 insertions(+) diff --git a/target/i386/translate.c b/target/i386/translate.c index 12d2ac2eb5..681fa1aee2 100644 ---

[Qemu-devel] [RFC PATCH v2 38/39] target/i386: introduce SSE instructions to insn.h

2019-08-09 Thread Jan Bobek
Add all the SSE instruction entries to insn.h. Signed-off-by: Jan Bobek --- target/i386/insn.h | 158 + 1 file changed, 158 insertions(+) diff --git a/target/i386/insn.h b/target/i386/insn.h index 6506ff3137..6e0c75b9f7 100644 ---

[Qemu-devel] [RFC PATCH v2 30/39] target/i386: introduce gvec-based code generator macros

2019-08-09 Thread Jan Bobek
Code generators defined using these macros rely on a gvec operation (i.e. tcg_gen_gvec_*). Signed-off-by: Jan Bobek --- target/i386/translate.c | 17 + 1 file changed, 17 insertions(+) diff --git a/target/i386/translate.c b/target/i386/translate.c index d721bb5142..36f2579654

[Qemu-devel] [RFC PATCH v2 39/39] target/i386: introduce memory-pointer operand read/write workarounds

2019-08-09 Thread Jan Bobek
The memory-pointer operand has a known limitation (see the commit introducing M* operands for details); the workaround involves declaring write-memory operands as read-memory instead. Note: This changeset is intended for development only and shall not be included in the final patch series.

[Qemu-devel] [RFC PATCH v2 25/39] target/i386: introduce M* (memptr) operands

2019-08-09 Thread Jan Bobek
The memory-pointer operand decodes the indirect form of ModR/M byte, loads the effective address into a register and passes that register as the operand. Note: This operand has a known flaw: if an instruction is writing to memory (rather than reading), this operand cannot and will not load the

[Qemu-devel] [RFC PATCH v2 23/39] target/i386: introduce instruction translator macros

2019-08-09 Thread Jan Bobek
Instruction "translators" are responsible for decoding and loading instruction operands, calling the passed-in code generator, and storing the operands back (if applicable). Once a translator returns, the instruction has been translated to TCG ops, hence the name. Signed-off-by: Jan Bobek ---

[Qemu-devel] [RFC PATCH v2 34/39] target/i386: introduce V*, U*, W* (SSE/AVX) operands

2019-08-09 Thread Jan Bobek
These address the SSE/AVX-technology register file. Offset of the entire corresponding register is passed as the operand value, regardless of operand-size suffix. Signed-off-by: Jan Bobek --- target/i386/translate.c | 45 + 1 file changed, 45

[Qemu-devel] [RFC PATCH v2 33/39] target/i386: introduce MMX instructions to insn.h

2019-08-09 Thread Jan Bobek
Add all MMX instruction entries to insn.h. Signed-off-by: Jan Bobek --- target/i386/insn.h | 131 + 1 file changed, 131 insertions(+) diff --git a/target/i386/insn.h b/target/i386/insn.h index 4b48c0c0e1..6506ff3137 100644 --- a/target/i386/insn.h

[Qemu-devel] [RFC PATCH v2 24/39] target/i386: introduce Ib (immediate) operand

2019-08-09 Thread Jan Bobek
Introduce the immediate-byte operand, which loads a byte from the instruction stream and passes its value as the operand. Signed-off-by: Jan Bobek --- target/i386/translate.c | 8 1 file changed, 8 insertions(+) diff --git a/target/i386/translate.c b/target/i386/translate.c index

[Qemu-devel] [RFC PATCH v2 36/39] target/i386: introduce SSE translators

2019-08-09 Thread Jan Bobek
Use the translator macros to define translators required by SSE instructions. Signed-off-by: Jan Bobek --- target/i386/translate.c | 33 + 1 file changed, 33 insertions(+) diff --git a/target/i386/translate.c b/target/i386/translate.c index

[Qemu-devel] [RFC PATCH v2 22/39] target/i386: introduce code generators

2019-08-09 Thread Jan Bobek
In this context, "code generators" are functions that receive decoded instruction operands and emit TCG ops implementing the correct instruction functionality. Introduce the naming macros first, actual generator macros will be added later. Signed-off-by: Jan Bobek --- target/i386/translate.c |

[Qemu-devel] [RFC PATCH v2 31/39] target/i386: introduce MMX translators

2019-08-09 Thread Jan Bobek
Use the translator macros to define instruction translators required by MMX instructions. Signed-off-by: Jan Bobek --- target/i386/translate.c | 16 1 file changed, 16 insertions(+) diff --git a/target/i386/translate.c b/target/i386/translate.c index 36f2579654..3475727380

[Qemu-devel] [RFC PATCH v2 28/39] target/i386: introduce P*, N*, Q* (MMX) operands

2019-08-09 Thread Jan Bobek
These address the MMX-technology register file; the corresponding cpu_env offset is passed as the operand value. Notably, offset of the entire register is pased at all times, regardless of the operand-size suffix. Signed-off-by: Jan Bobek --- target/i386/translate.c | 37

[Qemu-devel] [RFC PATCH v2 27/39] target/i386: introduce RdMw operand

2019-08-09 Thread Jan Bobek
The PINSRW family of instructions have a peculiar second operand: 32-bit general-purpose register file is addressed, but if the operand is indirect, only 16 bits are loaded from memory. Reflect this by the RdMw operand. Signed-off-by: Jan Bobek --- target/i386/translate.c | 6 ++ 1 file

[Qemu-devel] [RFC PATCH v2 29/39] target/i386: introduce helper-based code generator macros

2019-08-09 Thread Jan Bobek
Code generators defined using these macros rely on a helper function (as emitted by gen_helper_*). Signed-off-by: Jan Bobek --- target/i386/translate.c | 26 ++ 1 file changed, 26 insertions(+) diff --git a/target/i386/translate.c b/target/i386/translate.c index

[Qemu-devel] [RFC PATCH v2 35/39] target/i386: introduce UdqMq operand

2019-08-09 Thread Jan Bobek
The MOVHLPS instruction has a special operand: it reads the high quadword of the source operand (hence it requires the full double-quadword width), but if the operand is indirect, only 64-bits are read from memory. Introduce UdqMq operand to address this case. Signed-off-by: Jan Bobek ---

[Qemu-devel] [RFC PATCH v2 20/39] target/i386: introduce generic load-store operand

2019-08-09 Thread Jan Bobek
This operand attempts to capture the "indirect" or "memory" operand in a generic way. It significatly reduces the amount code that needs to be written in order to read operands from memory to temporary storage and write them back. Signed-off-by: Jan Bobek --- target/i386/translate.c | 78

[Qemu-devel] [RFC PATCH v2 26/39] target/i386: introduce G*, R*, E* (general register) operands

2019-08-09 Thread Jan Bobek
These address the general-purpose register file. The corresponding 32-bit or 64-bit register is passed as the operand value. Signed-off-by: Jan Bobek --- target/i386/translate.c | 65 + 1 file changed, 65 insertions(+) diff --git

[Qemu-devel] [RFC PATCH v2 16/39] target/i386: introduce instruction operand infrastructure

2019-08-09 Thread Jan Bobek
insnop_t and the init, prepare and finalize functions form the basis of instruction operand decoding. Introduce macros for defining a generic instruction operand; use cases for operand decoding will be introduced later with instruction translators. Signed-off-by: Jan Bobek ---

[Qemu-devel] [RFC PATCH v2 32/39] target/i386: introduce MMX code generators

2019-08-09 Thread Jan Bobek
Define code generators required for MMX instructions. Signed-off-by: Jan Bobek --- target/i386/translate.c | 114 1 file changed, 114 insertions(+) diff --git a/target/i386/translate.c b/target/i386/translate.c index 3475727380..aa6fb8b013 100644 ---

[Qemu-devel] [RFC PATCH v2 21/39] target/i386: introduce insn.h

2019-08-09 Thread Jan Bobek
This header is intended to eventually list all supported instructions along with some useful details (e.g. mnemonics, opcode, operands etc.) It shall be used (along with some preprocessor magic) anytime we need to automatically generate code for every instruction. Signed-off-by: Jan Bobek ---

[Qemu-devel] [RFC PATCH v2 14/39] target/i386: introduce mnemonic aliases for several gvec operations

2019-08-09 Thread Jan Bobek
It is helpful to introduce aliases for some general gvec operations as it makes a couple of instruction code generators simpler (added later). Signed-off-by: Jan Bobek --- target/i386/translate.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/target/i386/translate.c

[Qemu-devel] [RFC PATCH v2 19/39] target/i386: introduce generic operand alias

2019-08-09 Thread Jan Bobek
It turns out it is useful to be able to declare operand name aliases. Introduce a macro to capture this functionality. Signed-off-by: Jan Bobek --- target/i386/translate.c | 9 + 1 file changed, 9 insertions(+) diff --git a/target/i386/translate.c b/target/i386/translate.c index

[Qemu-devel] [RFC PATCH v2 07/39] target/i386: use pc_start from DisasContext

2019-08-09 Thread Jan Bobek
The variable pc_start is already a member of DisasContext. Remove the superfluous local variable. Signed-off-by: Jan Bobek --- target/i386/translate.c | 131 1 file changed, 65 insertions(+), 66 deletions(-) diff --git a/target/i386/translate.c

[Qemu-devel] [RFC PATCH v2 15/39] target/i386: introduce function ck_cpuid

2019-08-09 Thread Jan Bobek
Introduce a helper function to take care of instruction CPUID checks. Signed-off-by: Jan Bobek --- target/i386/translate.c | 45 + 1 file changed, 45 insertions(+) diff --git a/target/i386/translate.c b/target/i386/translate.c index

[Qemu-devel] [RFC PATCH v2 13/39] target/i386: disable unused function warning temporarily

2019-08-09 Thread Jan Bobek
Some functions added later are generated by preprocessor macros and end up being unused (e.g. not all operands can serve as a destination operand). Disable unused function warnings for the new code until I figure out how I want to solve this particular issue. Note: This changeset is intended for

[Qemu-devel] [RFC PATCH v2 10/39] target/i386: add vector register file alignment constraints

2019-08-09 Thread Jan Bobek
gvec operations require that all vectors be aligned on 16-byte boundary; make sure the MM/XMM/YMM/ZMM register file is aligned as neccessary. Reviewed-by: Richard Henderson Signed-off-by: Jan Bobek --- target/i386/cpu.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git

[Qemu-devel] [RFC PATCH v2 18/39] target/i386: introduce modifier for direct-only operand decoding

2019-08-09 Thread Jan Bobek
Many operands can only decode successfully if the ModR/M byte has the direct form (i.e. MOD=3). Capture this common aspect by introducing a special operand-initialization statement wrapper. Signed-off-by: Jan Bobek --- target/i386/translate.c | 9 + 1 file changed, 9 insertions(+) diff

[Qemu-devel] [RFC PATCH v2 12/39] target/i386: introduce gen_sse_ng

2019-08-09 Thread Jan Bobek
This function serves as the point-of-intercept for all newly implemented instructions. If no new implementation exists, fall back to gen_sse. Note: This changeset is intended for development only and shall not be included in the final patch series. Signed-off-by: Jan Bobek ---

[Qemu-devel] [RFC PATCH v2 05/39] target/i386: use prefix from DisasContext

2019-08-09 Thread Jan Bobek
Reduce scope of the local variable prefixes to enforce use of prefix from DisasContext instead. Signed-off-by: Jan Bobek --- target/i386/translate.c | 113 1 file changed, 57 insertions(+), 56 deletions(-) diff --git a/target/i386/translate.c

[Qemu-devel] [RFC PATCH v2 04/39] target/i386: use dflag from DisasContext

2019-08-09 Thread Jan Bobek
There already is a variable dflag in DisasContext, so reduce the scope of the local variable dflag to enforce use of the one in DisasContext. Suggested-by: Richard Henderson Signed-off-by: Jan Bobek --- target/i386/translate.c | 184 1 file changed, 92

[Qemu-devel] [RFC PATCH v2 17/39] target/i386: introduce helpers for decoding modrm fields

2019-08-09 Thread Jan Bobek
The old code uses bitshifts and bitwise-and all over the place for decoding ModR/M fields. Avoid doing that by introducing proper decoding macros. Signed-off-by: Jan Bobek --- target/i386/translate.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/target/i386/translate.c

[Qemu-devel] [RFC PATCH v2 11/39] target/i386: introduce gen_(ld, st)d_env_A0

2019-08-09 Thread Jan Bobek
Similar in spirit to the already present gen_(ld,st)(q,o)_env_A0, it will prove useful in later commits for smaller-sized vector loads. Signed-off-by: Jan Bobek --- target/i386/translate.c | 12 1 file changed, 12 insertions(+) diff --git a/target/i386/translate.c

[Qemu-devel] [RFC PATCH v2 02/39] target/i386: Push rex_w into DisasContext

2019-08-09 Thread Jan Bobek
From: Richard Henderson Treat this the same as we already do for other rex bits. Signed-off-by: Richard Henderson --- target/i386/translate.c | 19 +++ 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/target/i386/translate.c b/target/i386/translate.c index

[Qemu-devel] [RFC PATCH v2 09/39] target/i386: make variable is_xmm const

2019-08-09 Thread Jan Bobek
The variable is_xmm does not change value after assignment, so make this fact explicit by marking it const. Signed-off-by: Jan Bobek --- target/i386/translate.c | 17 ++--- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/target/i386/translate.c

[Qemu-devel] [RFC PATCH v2 08/39] target/i386: make variable b1 const

2019-08-09 Thread Jan Bobek
The variable b1 does not change value once assigned. Make this fact explicit by marking it const. Signed-off-by: Jan Bobek --- target/i386/translate.c | 15 ++- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/target/i386/translate.c b/target/i386/translate.c index

[Qemu-devel] [RFC PATCH v2 06/39] target/i386: Simplify gen_exception arguments

2019-08-09 Thread Jan Bobek
From: Richard Henderson We can compute cur_eip from values present within DisasContext. Signed-off-by: Richard Henderson --- target/i386/translate.c | 89 - 1 file changed, 44 insertions(+), 45 deletions(-) diff --git a/target/i386/translate.c

[Qemu-devel] [RFC PATCH v2 03/39] target/i386: reduce scope of variable aflag

2019-08-09 Thread Jan Bobek
The variable aflag is not used in most of disas_insn; make this clear by explicitly reducing its scope to the block where it is used. Suggested-by: Richard Henderson Signed-off-by: Jan Bobek --- target/i386/translate.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git

[Qemu-devel] [RFC PATCH v2 01/39] target/i386: Push rex_r into DisasContext

2019-08-09 Thread Jan Bobek
From: Richard Henderson Treat this value the same as we do for rex_b and rex_x. Signed-off-by: Richard Henderson --- target/i386/translate.c | 85 + 1 file changed, 44 insertions(+), 41 deletions(-) diff --git a/target/i386/translate.c

[Qemu-devel] [RFC PATCH v2 00/39] rewrite MMX/SSE instruction translation

2019-08-09 Thread Jan Bobek
This is a v2 of the patch series posted in [1]. Patches 1-9 are just cleanups; patches 10-39 are something actually interesting. Compared to v1, I started using preprocessor more extensively to generate repetitive boilerplate code; opinions/alternatives are welcome and appreciated. I tried to

Re: [Qemu-devel] [PATCH 3/3] target/riscv: Remove redundant declaration pragmas

2019-08-09 Thread Alistair Francis
On Fri, Aug 9, 2019 at 8:43 AM Richard Henderson wrote: > > These are now generated by decodetree itself. > > Signed-off-by: Richard Henderson Reviewed-by: Alistair Francis Alistair > --- > target/riscv/translate.c | 19 +-- > 1 file changed, 1 insertion(+), 18 deletions(-)

Re: [Qemu-devel] [PATCH 2/3] decodetree: Suppress redundant declaration warnings

2019-08-09 Thread Alistair Francis
On Fri, Aug 9, 2019 at 8:42 AM Richard Henderson wrote: > > We can tell that a decodetree input file is "secondary" when it > uses an argument set marked "!extern". This indicates that at > least one of the insn translation functions will have already > been declared by the "primary" input file,

Re: [Qemu-devel] [PATCH v3] hw: net: cadence_gem: Fix build errors in DB_PRINT()

2019-08-09 Thread Alistair Francis
On Fri, Aug 9, 2019 at 12:26 AM Bin Meng wrote: > > When CADENCE_GEM_ERR_DEBUG is turned on, there are several > compilation errors in DB_PRINT(). Fix them. > > While we are here, update to use appropriate modifiers in > the same DB_PRINT() call. > > Signed-off-by: Bin Meng Reviewed-by:

Re: [Qemu-devel] [PATCH v2 6/7] target/riscv: rationalise softfloat includes

2019-08-09 Thread Alistair Francis
On Fri, Aug 9, 2019 at 2:22 AM Alex Bennée wrote: > > We should avoid including the whole of softfloat headers in cpu.h and > explicitly include it only where we will be calling softfloat > functions. We can use the -types.h and -helpers.h in cpu.h for the few > bits that are global. > >

Re: [Qemu-devel] [PATCH v1 6/7] target/riscv: rationalise softfloat includes

2019-08-09 Thread Alistair Francis
On Thu, Aug 8, 2019 at 9:43 AM Alex Bennée wrote: > > We should avoid including the whole of softfloat headers in cpu.h and > explicitly include it only where we will be calling softfloat > functions. We can use the -types.h and -helpers.h in cpu.h for the few > bits that are global. > >

Re: [Qemu-devel] RISC-V: Vector && DSP Extension

2019-08-09 Thread Alistair Francis
On Thu, Aug 8, 2019 at 2:52 AM liuzhiwei wrote: > > Hi all, > > My workmate and I have been working on Vector & Dsp extension, and > I'd like to share develop status with folks. Cool! > > The spec references for Vector extension is riscv-v-spec-0.7.1, and > riscv-p-spec-0.5 for DSP

Re: [Qemu-devel] [PATCH v2 11/28] riscv: sifive: Rename sifive_prci.{c, h} to sifive_e_prci.{c, h}

2019-08-09 Thread Alistair Francis
On Wed, Aug 7, 2019 at 12:49 AM Bin Meng wrote: > > Current SiFive PRCI model only works with sifive_e machine, as it > only emulates registers or PRCI block in the FE310 SoC. > > Rename the file name to make it clear that it is for sifive_e. > > Signed-off-by: Bin Meng > --- > > Changes in v2:

Re: [Qemu-devel] [PATCH v2] riscv: rv32: Root page table address can be larger than 32-bit

2019-08-09 Thread Alistair Francis
On Wed, Aug 7, 2019 at 7:50 PM Bin Meng wrote: > > For RV32, the root page table's PPN has 22 bits hence its address > bits could be larger than the maximum bits that target_ulong is > able to represent. Use hwaddr instead. > > Signed-off-by: Bin Meng Reviewed-by: Alistair Francis Alistair >

[Qemu-devel] [PATCH] HACK: Centralize sve property checks

2019-08-09 Thread Richard Henderson
As promised, an experiment in unifying the checks. I believe that I've tested for all of the same conditions, modulo the timing at which they are emitted. As before, only one error is reported, so if multiple errors exist you can't rely on which error is seen. I think there's value in splitting

Re: [Qemu-devel] [PATCH 3/3] target/riscv: Remove redundant declaration pragmas

2019-08-09 Thread Richard Henderson
On 8/9/19 10:43 AM, Palmer Dabbelt wrote: > Acked-by: Palmer Dabbelt > > I assume you're taking this along with the rest though your tree. Yes, that was my plan. r~

Re: [Qemu-devel] [Qemu-block] [PATCH] qemu-img convert: Deprecate using -n and -o together

2019-08-09 Thread Nir Soffer
On Fri, Aug 9, 2019 at 12:11 PM Kevin Wolf wrote: > bdrv_create options specified with -o have no effect when skipping image > creation with -n, so this doesn't make sense. Warn against the misuse > and deprecate the combination so we can make it a hard error later. > > Signed-off-by: Kevin Wolf

[Qemu-devel] [Bug 1776920] Re: qemu-img convert on Mac OSX creates corrupt images

2019-08-09 Thread John Snow
Hi, there isn't really a development branch; if '-S 0' didn't help alleviate the problem there may be other problems at hand, or the APFS implementation of SEEK_DATA is causing us even more problems in new versions. You could try Yan-Jie Wang's patch that was posted in #20, but until it's posted

Re: [Qemu-devel] [PATCH v4 0/8] Support disabling TCG on ARM

2019-08-09 Thread Philippe Mathieu-Daudé
Hi Peter, Paolo, Alex, Thomas :) On 7/2/19 4:08 PM, Peter Maydell wrote: > On Mon, 1 Jul 2019 at 20:49, Philippe Mathieu-Daudé wrote: [...] >> $ git backport-diff -u v3 -r target-arm.next..v4 >> Key: >> [] : patches are identical >> [] : number of functional differences between

[Qemu-devel] [PATCH] block/backup: install notifier during creation

2019-08-09 Thread John Snow
Backup jobs may yield prior to installing their handler, because of the job_co_entry shim which guarantees that a job won't begin work until we are ready to start an entire transaction. Unfortunately, this makes proving correctness about transactional points-in-time for backup hard to reason

Re: [Qemu-devel] backup bug or question

2019-08-09 Thread John Snow
On 8/9/19 9:18 AM, Vladimir Sementsov-Ogievskiy wrote: > Hi! > > Hmm, hacking around backup I have a question: > > What prevents guest write request after job_start but before setting > write notifier? > > code path: > > qmp_drive_backup or transaction with backup > > job_start >

Re: [Qemu-devel] [PATCH v3 03/14] migration.json: add AMD SEV specific migration parameters

2019-08-09 Thread Singh, Brijesh
On 8/8/19 5:48 AM, Dr. David Alan Gilbert wrote: > * Singh, Brijesh (brijesh.si...@amd.com) wrote: >> On 8/7/19 6:06 AM, Dr. David Alan Gilbert wrote: >>> * Singh, Brijesh (brijesh.si...@amd.com) wrote: AMD SEV migration flow requires that target machine's public Diffie-Hellman key

Re: [Qemu-devel] [PATCH v2 00/11] block: Fix some things about bdrv_has_zero_init()

2019-08-09 Thread Max Reitz
On 24.07.19 19:12, Max Reitz wrote: > Hi, > > See the previous cover letter for the reason for patches 6 through 9: > https://lists.nongnu.org/archive/html/qemu-block/2019-07/msg00563.html > > But no only some bdrv_has_zero_init() implementations are wrong, some > callers also use it the wrong

Re: [Qemu-devel] [PATCH v2 09/11] iotests: Convert to preallocated encrypted qcow2

2019-08-09 Thread Max Reitz
On 25.07.19 18:27, Max Reitz wrote: > On 25.07.19 17:30, Maxim Levitsky wrote: >> On Wed, 2019-07-24 at 19:12 +0200, Max Reitz wrote: >>> Add a test case for converting an empty image (which only returns zeroes >>> when read) to a preallocated encrypted qcow2 image. >>> qcow2_has_zero_init()

Re: [Qemu-devel] [PATCH v3 09/14] target/i386: sev: add support to encrypt the outgoing page

2019-08-09 Thread Dr. David Alan Gilbert
* Singh, Brijesh (brijesh.si...@amd.com) wrote: > 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

[Qemu-devel] [PATCH] iotests: Fix 141 when run with qed

2019-08-09 Thread Max Reitz
69f47505ee has changed qcow2 in such a way that the commit job run in test 141 (and 144[1]) returns before it emits the READY event. However, 141 also runs with qed, where the order is still the other way around. Just filter out the {"return": {}} so the test passes for qed again. [1] 144 only

Re: [Qemu-devel] [PATCH v2 1/2] qemu-file: move qemu_{get, put}_counted_string() declarations

2019-08-09 Thread Dr. David Alan Gilbert
* Marc-André Lureau (marcandre.lur...@redhat.com) wrote: > Move migration helpers for strings under include/, so they can be used > outside of migration/ > > Signed-off-by: Marc-André Lureau > Reviewed-by: Juan Quintela I've queued this one (just 1/2) for the migration pull I'll do as soon as

[Qemu-devel] [Bug 1839325] Re: Go programs crash on qemu-sh4 due to issues with atomics

2019-08-09 Thread John Paul Adrian Glaubitz
Thanks. I will report this to Go/gcc upstream. -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1839325 Title: Go programs crash on qemu-sh4 due to issues with atomics Status in QEMU: New Bug

Re: [Qemu-devel] [PATCH 3/3] target/riscv: Remove redundant declaration pragmas

2019-08-09 Thread Palmer Dabbelt
On Fri, 09 Aug 2019 08:41:53 PDT (-0700), richard.hender...@linaro.org wrote: These are now generated by decodetree itself. Signed-off-by: Richard Henderson --- target/riscv/translate.c | 19 +-- 1 file changed, 1 insertion(+), 18 deletions(-) diff --git

[Qemu-devel] [Bug 1839325] Re: Go programs crash on qemu-sh4 due to issues with atomics

2019-08-09 Thread Peter Maydell
I just did an objdump -x of the /usr/lib/sh4-linux-gnu/libgo.so.14, which will be the shipped version from the Debian package, and in the section header it has: 24 .bss 000191f8 00fe74ec 00fe74ec 00fd74ec 2**2 ALLOC and in the symbol table it has: 00ff98f4 l

[Qemu-devel] [PATCH] linux-user: Add AT_HWCAP2 for aarch64-linux-user

2019-08-09 Thread Richard Henderson
Add the HWCAP2_* bits from kernel version v5.3-rc3. Enable the bits corresponding to ARMv8.5-CondM and ARMv8.5-FRINT. Signed-off-by: Richard Henderson --- linux-user/elfload.c | 31 +++ 1 file changed, 27 insertions(+), 4 deletions(-) --- The HWCAP2_FLAGM2 and

Re: [Qemu-devel] [PATCH v6 06/42] qcow2: Implement .bdrv_storage_child()

2019-08-09 Thread Eric Blake
On 8/9/19 11:13 AM, Max Reitz wrote: > Signed-off-by: Max Reitz > Reviewed-by: Vladimir Sementsov-Ogievskiy > --- > block/qcow2.c | 9 + > 1 file changed, 9 insertions(+) > Reviewed-by: Eric Blake -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226

Re: [Qemu-devel] [PATCH v6 05/42] block: Add chain helper functions

2019-08-09 Thread Eric Blake
On 8/9/19 11:13 AM, Max Reitz wrote: > Add some helper functions for skipping filters in a chain of block > nodes. > > Signed-off-by: Max Reitz > Reviewed-by: Vladimir Sementsov-Ogievskiy > --- > include/block/block_int.h | 3 +++ > block.c | 55

Re: [Qemu-devel] [PATCH v6 04/42] block: Add child access functions

2019-08-09 Thread Eric Blake
On 8/9/19 11:13 AM, Max Reitz wrote: > There are BDS children that the general block layer code can access, > namely bs->file and bs->backing. Since the introduction of filters and > external data files, their meaning is not quite clear. bs->backing can > be a COW source, or it can be an

Re: [Qemu-devel] [PATCH v2 4/7] block/backup: drop handling of max_transfer for copy_range

2019-08-09 Thread Max Reitz
On 09.08.19 17:32, Vladimir Sementsov-Ogievskiy wrote: > Since previous commit, copy_range supports max_transfer, so we don't > need to handle it by hand. > > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > block/backup.c | 11 ++- > 1 file changed, 2 insertions(+), 9 deletions(-)

Re: [Qemu-devel] [PATCH v2 3/7] block/io: handle alignment and max_transfer for copy_range

2019-08-09 Thread Max Reitz
On 09.08.19 17:32, Vladimir Sementsov-Ogievskiy wrote: > copy_range ignores these limitations, let's improve it. > > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > block/io.c | 48 > 1 file changed, 40 insertions(+), 8 deletions(-)

[Qemu-devel] [Bug 1839325] Re: Go programs crash on qemu-sh4 due to issues with atomics

2019-08-09 Thread Peter Maydell
The non-8-aligned pointer is the runtime.work.empty field. The compilation that I have of this binary has put the 'runtime.work' struct at 0x6bfadc, which is only 4-aligned, and this won't work as the lfstack fields it starts with are supposed to be 8-aligned. So it looks to me like the compiler

Re: [Qemu-devel] [PATCH] virtio-pci: Add Function Level Reset support

2019-08-09 Thread Michael S. Tsirkin
On Wed, Aug 07, 2019 at 10:22:41AM +0200, Julia Suvorova wrote: > Using FLR becomes convenient in cases where resetting the bus is > impractical, for example, when debugging the behavior of individual > functions. > > Signed-off-by: Julia Suvorova > --- > hw/virtio/virtio-pci.c | 10 ++

[Qemu-devel] [PATCH v6 41/42] iotests: Add test for commit in sub directory

2019-08-09 Thread Max Reitz
Add a test for committing an overlay in a sub directory to one of the images in its backing chain, using both relative and absolute filenames. Signed-off-by: Max Reitz --- tests/qemu-iotests/020 | 36 tests/qemu-iotests/020.out | 10 ++ 2 files

[Qemu-devel] [PATCH v6 37/42] block: Leave BDS.backing_file constant

2019-08-09 Thread Max Reitz
Parts of the block layer treat BDS.backing_file as if it were whatever the image header says (i.e., if it is a relative path, it is relative to the overlay), other parts treat it like a cache for bs->backing->bs->filename (relative paths are relative to the CWD). Considering

[Qemu-devel] [PATCH v6 35/42] block: Fix check_to_replace_node()

2019-08-09 Thread Max Reitz
Currently, check_to_replace_node() only allows mirror to replace a node in the chain of the source node, and only if it is the first non-filter node below the source. Well, technically, the idea is that you can exactly replace a quorum child by mirroring from quorum. This has (probably) two

[Qemu-devel] [PATCH v6 40/42] iotests: Add filter mirror test cases

2019-08-09 Thread Max Reitz
This patch adds some test cases how mirroring relates to filters. One of them tests what happens when you mirror off a filtered COW node, two others use the mirror filter node as basically our only example of an implicitly created filter node so far (besides the commit filter). Signed-off-by:

[Qemu-devel] [PATCH v6 36/42] iotests: Add tests for mirror @replaces loops

2019-08-09 Thread Max Reitz
This adds two tests for cases where our old check_to_replace_node() function failed to detect that executing this job with these parameters would result in a cyclic graph. Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- tests/qemu-iotests/041 | 124

[Qemu-devel] [PATCH v6 38/42] iotests: Let complete_and_wait() work with commit

2019-08-09 Thread Max Reitz
complete_and_wait() and wait_ready() currently only work for mirror jobs. Let them work for active commit jobs, too. Signed-off-by: Max Reitz --- tests/qemu-iotests/iotests.py | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/qemu-iotests/iotests.py

[Qemu-devel] [PATCH v6 33/42] blockdev: Fix active commit choice

2019-08-09 Thread Max Reitz
We have to perform an active commit whenever the top node has a parent that has taken the WRITE permission on it. Signed-off-by: Max Reitz Reviewed-by: Vladimir Sementsov-Ogievskiy --- blockdev.c | 24 +--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git

[Qemu-devel] [PATCH v6 29/42] nbd: Use CAF when looking for dirty bitmap

2019-08-09 Thread Max Reitz
When looking for a dirty bitmap to share, we should handle filters by just including them in the search (so they do not break backing chains). Signed-off-by: Max Reitz Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake --- nbd/server.c | 6 +++--- 1 file changed, 3

[Qemu-devel] [PATCH v6 32/42] block: Make bdrv_get_cumulative_perm() public

2019-08-09 Thread Max Reitz
This is useful in other files like blockdev.c to determine for example whether a node can be written to or not. Signed-off-by: Max Reitz Reviewed-by: Vladimir Sementsov-Ogievskiy --- include/block/block_int.h | 3 +++ block.c | 6 ++ 2 files changed, 5 insertions(+), 4

[Qemu-devel] [PATCH v6 20/42] block/snapshot: Fix fallback

2019-08-09 Thread Max Reitz
If the top node's driver does not provide snapshot functionality and we want to fall back to a node down the chain, we need to snapshot all non-COW children. For simplicity's sake, just do not fall back if there is more than one such child. bdrv_snapshot_goto() becomes a bit weird because we may

[Qemu-devel] [PATCH v6 42/42] iotests: Test committing to overridden backing

2019-08-09 Thread Max Reitz
Signed-off-by: Max Reitz --- tests/qemu-iotests/040 | 61 ++ tests/qemu-iotests/040.out | 4 +-- 2 files changed, 63 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/040 b/tests/qemu-iotests/040 index a0a0db8889..558fdb9a09 100755 ---

[Qemu-devel] [PATCH v6 30/42] qemu-img: Use child access functions

2019-08-09 Thread Max Reitz
This changes iotest 204's output, because blkdebug on top of a COW node used to make qemu-img map disregard the rest of the backing chain (the backing chain was broken by the filter). With this patch, the allocation in the base image is reported correctly. Signed-off-by: Max Reitz ---

[Qemu-devel] [PATCH v6 19/42] block: Use CAF in bdrv_co_rw_vmstate()

2019-08-09 Thread Max Reitz
If a node whose driver does not provide VM state functions has a metadata child, the VM state should probably go there; if it is a filter, the VM state should probably go there. It follows that we should generally go down to the primary child. Signed-off-by: Max Reitz Reviewed-by: Vladimir

[Qemu-devel] [PATCH v6 34/42] block: Inline bdrv_co_block_status_from_*()

2019-08-09 Thread Max Reitz
With bdrv_filtered_rw_bs(), we can easily handle this default filter behavior in bdrv_co_block_status(). blkdebug wants to have an additional assertion, so it keeps its own implementation, except bdrv_co_block_status_from_file() needs to be inlined there. Suggested-by: Eric Blake Signed-off-by:

[Qemu-devel] [PATCH v6 25/42] mirror: Deal with filters

2019-08-09 Thread Max Reitz
This includes some permission limiting (for example, we only need to take the RESIZE permission for active commits where the base is smaller than the top). Signed-off-by: Max Reitz --- block/mirror.c | 117 ++--- blockdev.c | 47

[Qemu-devel] [PATCH v6 16/42] block: Flush all children in generic code

2019-08-09 Thread Max Reitz
If the driver does not support .bdrv_co_flush() so bdrv_co_flush() itself has to flush the children of the given node, it should not flush just bs->file->bs, but in fact all children. In any case, the BLKDBG_EVENT() should be emitted on the primary child, because that is where a blkdebug node

[Qemu-devel] [PATCH v6 39/42] iotests: Add filter commit test cases

2019-08-09 Thread Max Reitz
This patch adds some tests on how commit copes with filter nodes. Signed-off-by: Max Reitz --- tests/qemu-iotests/040 | 177 + tests/qemu-iotests/040.out | 4 +- 2 files changed, 179 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/040

[Qemu-devel] [PATCH v6 28/42] stream: Deal with filters

2019-08-09 Thread Max Reitz
Because of the recent changes that make the stream job independent of the base node and instead track the node above it, we have to split that "bottom" node into two cases: The bottom COW node, and the node directly above the base node (which may be an R/W filter or the bottom COW node).

[Qemu-devel] [PATCH v6 26/42] backup: Deal with filters

2019-08-09 Thread Max Reitz
Signed-off-by: Max Reitz Reviewed-by: Vladimir Sementsov-Ogievskiy --- block/backup.c | 9 + blockdev.c | 19 +++ 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/block/backup.c b/block/backup.c index ecadb61af3..7854d7575b 100644 --- a/block/backup.c

[Qemu-devel] [PATCH v6 13/42] block: Use CAFs in block status functions

2019-08-09 Thread Max Reitz
Use the child access functions in the block status inquiry functions as appropriate. Signed-off-by: Max Reitz Reviewed-by: Vladimir Sementsov-Ogievskiy --- block/io.c | 19 ++- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/block/io.c b/block/io.c index

[Qemu-devel] [PATCH v6 31/42] block: Drop backing_bs()

2019-08-09 Thread Max Reitz
We want to make it explicit where bs->backing is used, and we have done so. The old role of backing_bs() is now effectively taken by bdrv_filtered_cow_bs(). Signed-off-by: Max Reitz Reviewed-by: Vladimir Sementsov-Ogievskiy --- include/block/block_int.h | 5 - 1 file changed, 5

[Qemu-devel] [PATCH v6 24/42] block: Use child access functions for QAPI queries

2019-08-09 Thread Max Reitz
query-block, query-named-block-nodes, and query-blockstats now return any filtered child under "backing", not just bs->backing or COW children. This is so that filters do not interrupt the reported backing chain. This changes the output for iotest 184, as the throttled node now appears as a

[Qemu-devel] [PATCH v6 23/42] blockdev: Use CAF in external_snapshot_prepare()

2019-08-09 Thread Max Reitz
This allows us to differentiate between filters and nodes with COW backing files: Filters cannot be used as overlays at all (for this function). Signed-off-by: Max Reitz Reviewed-by: Vladimir Sementsov-Ogievskiy --- blockdev.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff

[Qemu-devel] [PATCH v6 11/42] block: Add bdrv_supports_compressed_writes()

2019-08-09 Thread Max Reitz
Filters cannot compress data themselves but they have to implement .bdrv_co_pwritev_compressed() still (or they cannot forward compressed writes). Therefore, checking whether bs->drv->bdrv_co_pwritev_compressed is non-NULL is not sufficient to know whether the node can actually handle compressed

[Qemu-devel] [PATCH v6 27/42] commit: Deal with filters

2019-08-09 Thread Max Reitz
This includes some permission limiting (for example, we only need to take the RESIZE permission if the base is smaller than the top). Signed-off-by: Max Reitz --- block/block-backend.c | 16 +--- block/commit.c| 96 +++ blockdev.c|

[Qemu-devel] [PATCH v6 09/42] block: Include filters when freezing backing chain

2019-08-09 Thread Max Reitz
In order to make filters work in backing chains, the associated functions must be able to deal with them and freeze all filter links, be they COW or R/W filter links. In the process, rename these functions to reflect that they now act on generalized chains of filter nodes instead of backing

[Qemu-devel] [PATCH v6 22/42] block: Fix bdrv_get_allocated_file_size's fallback

2019-08-09 Thread Max Reitz
If the driver does not implement bdrv_get_allocated_file_size(), we should fall back to cumulating the allocated size of all non-COW children instead of just bs->file. Suggested-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Max Reitz --- block.c | 22 -- 1 file changed,

  1   2   3   4   >