[Qemu-devel] How to use QEMU's "cpu_physical_memory_" functions?

2019-04-13 Thread 宋延杰
Hello all, I have started a project which requires the host to continuously write to VM's memory. VM reads its memory and performs some operations. I've found in this thread that I can use QEMU's "cpu_physical_memory_"

[Qemu-devel] [Bug 1824622] [NEW] Qemu 4.0.0-rc3 COLO Primary Crashes with "Assertion `event_unhandled_count > 0' failed."

2019-04-13 Thread Lukas Straub
Public bug reported: Hello Everyone, Now with Qemu 4.0.0-rc3, COLO is finally working so I gave it a try, but the Primary is always crashing during Network use. Typing fast in ssh or running "top" with 0.1 second delay (change with 'd') reliably trigger the crash for me. I use the attached

Re: [Qemu-devel] [PATCH v4 1/3] target/mips: add or remove space to fix checkpatch errors

2019-04-13 Thread Aleksandar Markovic
On Apr 13, 2019 3:16 AM, "Jules Irenge" wrote: > > Add or remove space to fix errors issued by checkpatch.pl tool > "ERROR: spaces required around that..." > "ERROR: space required after that..." > "ERROR: space required before the open parenthesis" > "ERROR: space required after that..." >

[Qemu-devel] [Bug 1824622] Re: Qemu 4.0.0-rc3 COLO Primary Crashes with "Assertion `event_unhandled_count > 0' failed."

2019-04-13 Thread Lukas Straub
https://lists.nongnu.org/archive/html/qemu-discuss/2019-04/msg00026.html -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1824622 Title: Qemu 4.0.0-rc3 COLO Primary Crashes with "Assertion

[Qemu-devel] [PATCH for-next 1/2] iotests: Perform the correct test in 082

2019-04-13 Thread Max Reitz
In the "amend" section of 082, we perform a single "convert" test (namely "convert -o help"). That does not make sense, especially because we have done exactly that "convert" test earlier in 082 already. Replacing "convert" by "amend" yields an error, which is correct because there is no point

[Qemu-devel] [PATCH for-next 0/2] qemu-img: Make create hint at protocol options

2019-04-13 Thread Max Reitz
https://bugzilla.redhat.com/show_bug.cgi?id=1698863 reports that while "qemu-img create -f raw" supports the "preallocation" option, it is not listed under "-o help". It turns out it is, but only if you specify a target filename. Users may not realize this, but a note should help. Max Reitz

[Qemu-devel] [PATCH for-next 2/2] qemu-img: Make create hint at protocol options

2019-04-13 Thread Max Reitz
qemu-img create allows giving just a format and "-o help" to get a list of the options supported by that format. Users may not realize that the protocol level may offer even more options, which they only get to see by specifying a filename. This patch adds a note to hint at that fact.

[Qemu-devel] [PATCH v5 1/2] target/mips: add or remove space to fix checkpatch errors

2019-04-13 Thread Jules Irenge
Add or remove space to fix errors issued by checkpatch.pl tool "ERROR: spaces required around that..." "ERROR: space required after that..." "ERROR: space required before the open parenthesis" "ERROR: space required after that..." "ERROR: space prohibited between function name and open

[Qemu-devel] [PATCH v5 2/2] target/mips: realign comments to fix checkpatch warnings

2019-04-13 Thread Jules Irenge
Realign comments to fix warnings issued by checkpatc.pl tool "WARNING: Block comments use a leading /* on a separate line" within "target/mips/cpu.h" file. Signed-off-by: Jules Irenge --- target/mips/cpu.h | 34 ++ 1 file changed, 22 insertions(+), 12

[Qemu-devel] [PATCH v5 0/2] target/mips: Errors amd warnings cleanups

2019-04-13 Thread Jules Irenge
This v5 series combines patch v4 2/3 into patch v4 1/3 hence the number of patches to two. Jules Irenge (2): target/mips: add or remove space to fix checkpatch errors target/mips: realign comments to fix checkpatch warnings target/mips/cpu.h | 211

Re: [Qemu-devel] How to I trigger a rebuild?

2019-04-13 Thread Max Filippov
On Sat, Apr 13, 2019 at 8:28 AM Joachim Durchholz wrote: > I did the usual ./configure; make dance. > Then modified a source file (ui/curses.c), called make again, but didn't > see curses.c recompiled, and the change was indeed ineffective. > make clean; make didn't help either. Perhaps you

Re: [Qemu-devel] [PATCH v1 40/41] s390x/tcg: Implement VECTOR SUM ACROSS WORD

2019-04-13 Thread Richard Henderson
On 4/11/19 12:08 AM, David Hildenbrand wrote: > Similar to VECTOR SUM ACROSS DOUBLEWORD. > > Signed-off-by: David Hildenbrand > --- > target/s390x/insn-data.def | 2 ++ > target/s390x/translate_vx.inc.c | 29 + > 2 files changed, 31 insertions(+) Reviewed-by:

Re: [Qemu-devel] [PATCH v1 39/41] s390x/tcg: Implement VECTOR SUM ACROSS QUADWORD

2019-04-13 Thread Richard Henderson
On 4/11/19 12:08 AM, David Hildenbrand wrote: > +read_vec_element_i64(suml, get_field(s->fields, v3), max_idx, es); > +for (idx = 0; idx <= max_idx; idx++) { > +read_vec_element_i64(tmpl, get_field(s->fields, v2), idx, es); > +tcg_gen_add2_i64(suml, sumh, suml, sumh, tmpl,

Re: [Qemu-devel] [PATCH v1 37/41] s390x/tcg: Implement VECTOR SUBTRACT WITH BORROW COMPUTE BORROW INDICATION

2019-04-13 Thread Richard Henderson
On 4/11/19 12:08 AM, David Hildenbrand wrote: > +static DisasJumpType op_vsbcbi(DisasContext *s, DisasOps *o) > +{ > +if (get_field(s->fields, m5) != ES_128) { > +gen_program_exception(s, PGM_SPECIFICATION); > +return DISAS_NORETURN; > +} > + > +

Re: [Qemu-devel] [PATCH v1 38/41] s390x/tcg: Implement VECTOR SUM ACROSS DOUBLEWORD

2019-04-13 Thread Richard Henderson
On 4/11/19 12:08 AM, David Hildenbrand wrote: > Perform the calculations without a helper. Only 16 bit or 32 bit values > have to be added. > > Signed-off-by: David Hildenbrand > --- > target/s390x/insn-data.def | 2 ++ > target/s390x/translate_vx.inc.c | 29 +

Re: [Qemu-devel] [PATCH v1 41/41] s390x/tcg: Implement VECTOR TEST UNDER MASK

2019-04-13 Thread Richard Henderson
On 4/11/19 12:08 AM, David Hildenbrand wrote: > +void HELPER(gvec_vtm)(void *v1, const void *v2, CPUS390XState *env, > + uint32_t desc) > +{ > +S390Vector tmp; > + > +s390_vec_and(, v1, v2); > +if (s390_vec_is_zero()) { > +/* Selected bits all zeros; or all

Re: [Qemu-devel] [PATCH v3 12/23] linux-user: Call qcrypto_init if not using -seed

2019-04-13 Thread Richard Henderson
On 4/10/19 11:49 PM, Philippe Mathieu-Daudé wrote: >> -if (seed_optarg != NULL) { >> -qemu_guest_random_seed_main(seed_optarg, _fatal); >> +{ > Since 7be41675f7c we use gnu99 C, so this extra block indentation can be > removed. > >> +Error *err = NULL; >> +if

[Qemu-devel] How to I trigger a rebuild?

2019-04-13 Thread Joachim Durchholz
Hi all, I did the usual ./configure; make dance. Then modified a source file (ui/curses.c), called make again, but didn't see curses.c recompiled, and the change was indeed ineffective. make clean; make didn't help either. Is there a list of make targets anywhere? I looked in a few places in

Re: [Qemu-devel] [PATCH v5 07/11] block: introduce backup-top filter driver

2019-04-13 Thread Vladimir Sementsov-Ogievskiy
16.01.2019 19:02, Max Reitz wrote: > On 29.12.18 13:20, Vladimir Sementsov-Ogievskiy wrote: >> Backup-top filter does copy-before-write operation. It should be >> inserted above active disk and has a target node for CBW, like the >> following: >> >> +---+ >> | Guest | >>

Re: [Qemu-devel] [PATCH v6 1/4] target/mips: Optimize ILVOD. MSA instructions

2019-04-13 Thread Aleksandar Markovic
On Thu, Apr 4, 2019 at 3:16 PM Mateja Marjanovic wrote: > > From: Mateja Marjanovic > > Optimize set of MSA instructions ILVOD., using > directly tcg registers and performing logic on them instead > of using helpers. > Please see my comments for ILVEV.D. Thanks, Aleksandar > In the following

Re: [Qemu-devel] [PATCH v3 0/2] block/ssh: Implement .bdrv_refresh_filename()

2019-04-13 Thread Max Reitz
On 25.02.19 20:08, Max Reitz wrote: > This series implements .bdrv_refresh_filename() for the ssh block > driver, along with an appropriate .bdrv_dirname() so we don't chop off > query strings for backing files with relative filenames. > > > v3: > - Keep iotests 104 and 207 working > > > Max

[Qemu-devel] [PATCH v3 4/7] blkdebug: Add "none" event

2019-04-13 Thread Max Reitz
Together with @iotypes and @sector, this can be used to trap e.g. the first read or write access to a certain sector without having to know what happens internally in the block layer, i.e. which "real" events happen right before such an access. Signed-off-by: Max Reitz --- qapi/block-core.json

[Qemu-devel] [PATCH v3 5/7] blkdebug: Inject errors on .bdrv_co_block_status()

2019-04-13 Thread Max Reitz
Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- qapi/block-core.json | 5 - block/blkdebug.c | 8 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/qapi/block-core.json b/qapi/block-core.json index 717b13f7f5..2aa675a192 100644 --- a/qapi/block-core.json +++

[Qemu-devel] [PATCH v3 6/7] iotests: Test qemu-img convert --salvage

2019-04-13 Thread Max Reitz
This test converts a simple image to another, but blkdebug injects block_status and read faults at some offsets. The resulting image should be the same as the input image, except that sectors that could not be read have to be 0. Signed-off-by: Max Reitz --- tests/qemu-iotests/249 | 163

Re: [Qemu-devel] [PATCH for-4.1 0/2] Fix check for default backing files in bdrv_reopen_prepare()

2019-04-13 Thread Max Reitz
On 13.04.19 10:46, Alberto Garcia wrote: > On Sat 13 Apr 2019 02:56:57 AM CEST, Max Reitz wrote: >>> Patch 2 fixes a different (but slightly related) issue that I found >>> while preparing the first patch. >> >> I think the real problem is that bs->backing_file is not a cache for >>

Re: [Qemu-devel] [PATCH v6 3/4] target/mips: Optimize ILVL. MSA instructions

2019-04-13 Thread Aleksandar Markovic
On Thu, Apr 4, 2019 at 3:16 PM Mateja Marjanovic wrote: > > From: Mateja Marjanovic > > Optimized ILVL. instructions, using a hybrid > approach. For byte data elements, use a helper with an > unrolled loop (much better performance), for halfword, > word and doubleword data elements use directly

[Qemu-devel] [PATCH v3 7/7] iotests: Test qemu-img convert -C --salvage

2019-04-13 Thread Max Reitz
We do not support this combination (yet), so this should yield an error message. Signed-off-by: Max Reitz --- tests/qemu-iotests/082 | 1 + tests/qemu-iotests/082.out | 3 +++ 2 files changed, 4 insertions(+) diff --git a/tests/qemu-iotests/082 b/tests/qemu-iotests/082 index

[Qemu-devel] [PATCH v3 3/7] blkdebug: Add @iotype error option

2019-04-13 Thread Max Reitz
This new error option allows users of blkdebug to inject errors only on certain kinds of I/O operations. Users usually want to make a very specific operation fail, not just any; but right now they simply hope that the event that triggers the error injection is followed up with that very

[Qemu-devel] [PATCH v3 0/7] qemu-img: Add salvaging mode to convert

2019-04-13 Thread Max Reitz
Hi, This series adds a --salvage option to qemu-img convert. With this, qemu-img will not abort when it encounters an I/O error. Instead, it tries to narrow it down and will treat the affected sectors as being completely 0 (and print a warning). Testing this is not so easy, because while real

[Qemu-devel] [PATCH v3 1/7] qemu-img: Move quiet into ImgConvertState

2019-04-13 Thread Max Reitz
Move img_convert()'s quiet flag into the ImgConvertState so it is accessible by nested functions. -q dictates that it suppresses anything but errors, so if those functions want to emit warnings, they need to query this flag first. (There currently are no such warnings, but there will be as of

[Qemu-devel] [PATCH v3 2/7] qemu-img: Add salvaging mode to convert

2019-04-13 Thread Max Reitz
This adds a salvaging mode (--salvage) to qemu-img convert which ignores read errors and treats the respective areas as containing only zeroes. This can be used for instance to at least partially recover the data from terminally corrupted qcow2 images. Signed-off-by: Max Reitz --- qemu-img.c

Re: [Qemu-devel] [PATCH 0/3] qemu-img: Allow rebase with no input base

2019-04-13 Thread Max Reitz
Ping again (I feel like I just need to start merging unreviewed patches until I break something (can't take that long) so you get so scared of my patches that you at least refuse them outright) On 13.07.18 13:14, Max Reitz wrote: > This series allows using qemu-img rebase on images that do not

Re: [Qemu-devel] [PATCH for-4.1 0/2] Fix check for default backing files in bdrv_reopen_prepare()

2019-04-13 Thread Alberto Garcia
On Sat 13 Apr 2019 05:48:11 PM CEST, Max Reitz wrote: >> Ok, you can leave out the second patch then. The first one should >> still be correct, right? > > I just think it’s unnecessary because as of my series both > backing_file and auto_backing_file serve the purpose. Ok then! Berto

Re: [Qemu-devel] [PATCH v6 2/4] target/mips: Optimize ILVEV. MSA instructions

2019-04-13 Thread Aleksandar Markovic
On Thu, Apr 4, 2019 at 3:18 PM Mateja Marjanovic wrote: > > From: Mateja Marjanovic > > Optimize set of MSA instructions ILVEV., using > directly tcg registers and performing logic on them > instead of using helpers. > > In the following table, the first column is the performance > before this

Re: [Qemu-devel] [PATCH v6 4/4] target/mips: Optimize ILVR. MSA instructions

2019-04-13 Thread Aleksandar Markovic
On Thu, Apr 4, 2019 at 3:16 PM Mateja Marjanovic wrote: > > From: Mateja Marjanovic > > Optimized ILVR. instructions, using a hybrid Optimized -> Optimize > approach. For byte data elements, use a helper with an > unrolled loop (much better performance), for halfword, (much better

[Qemu-devel] [PATCH] util/error: do not free error on error_abort

2019-04-13 Thread Vladimir Sementsov-Ogievskiy
It would be nice to have Error object not freed away when debugging a coredump. Signed-off-by: Vladimir Sementsov-Ogievskiy --- util/error.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/util/error.c b/util/error.c index 934a78e1b1..f9180c0f30 100644 ---

Re: [Qemu-devel] [PATCH v5 07/11] block: introduce backup-top filter driver

2019-04-13 Thread Vladimir Sementsov-Ogievskiy
13.04.2019 19:08, Vladimir Sementsov-Ogievskiy wrote: > 16.01.2019 19:02, Max Reitz wrote: >> On 29.12.18 13:20, Vladimir Sementsov-Ogievskiy wrote: >>> Backup-top filter does copy-before-write operation. It should be >>> inserted above active disk and has a target node for CBW, like the >>>

[Qemu-devel] [Bug 1815889] Re: qemu-system-x86_64 crashed with signal 31 in __pthread_setaffinity_new()

2019-04-13 Thread Bug Watch Updater
** Changed in: mesa Status: Confirmed => Won't Fix -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1815889 Title: qemu-system-x86_64 crashed with signal 31 in __pthread_setaffinity_new()

[Qemu-devel] [Bug 1815889]

2019-04-13 Thread Ahzo
This problem was solved by qemu [1], so this mesa bug can be closed. [1] https://git.qemu.org/git/qemu.git/?a=commitdiff;h=9a1565a03b79d80b236bc7cc2dbce52a2ef3a1b8 -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU.

Re: [Qemu-devel] [RFC 3/3] RDMA/virtio-rdma: VirtIO rdma driver

2019-04-13 Thread Yuval Shaia
> > + > > + wake_up(>acked); > > + > > + printk("%s\n", __func__); > > Cool:-) > > this line should be for debug? Yes > > Zhu Yanjun >

Re: [Qemu-devel] [RFC 3/3] RDMA/virtio-rdma: VirtIO rdma driver

2019-04-13 Thread Yanjun Zhu
On 2019/4/11 19:01, Yuval Shaia wrote: Signed-off-by: Yuval Shaia --- drivers/infiniband/Kconfig| 1 + drivers/infiniband/hw/Makefile| 1 + drivers/infiniband/hw/virtio/Kconfig | 6 + drivers/infiniband/hw/virtio/Makefile | 4 +

[Qemu-devel] [Bug 1824616] [NEW] Build succeeds despite flex/bison missing

2019-04-13 Thread Joachim Durchholz
Public bug reported: I just built qemu using a fresh install, and "make" would report success despite messages of "flex: command not found" and "bison: command not found". I didn't notice any errors, but I don't know whether that's because there's a workaround in case the tools aren't there, or

[Qemu-devel] R: Re: [PATCH v2] target/i386: kvm: add VMX migration blocker

2019-04-13 Thread Paolo Bonzini
- Cole Robinson ha scritto: > On 4/12/19 3:47 AM, Paolo Bonzini wrote: > > On 10/04/19 20:26, Cole Robinson wrote: > >> On 11/20/18 6:44 AM, Dr. David Alan Gilbert wrote: > >>> * Paolo Bonzini (pbonz...@redhat.com) wrote: > Nested VMX does not support live migration yet. Add a blocker

Re: [Qemu-devel] [PATCH 2/9] tcg: Add INDEX_op_extract2_{i32,i64}

2019-04-13 Thread Richard Henderson
On 4/3/19 1:56 AM, Peter Maydell wrote: > On Wed, 3 Apr 2019 at 18:37, Richard Henderson >> * extract2_i32/i64 dest, t1, t2, pos >> >> For N = {32,64}, extract an N-bit quantity from the concatenation >> of t2:t1, beginning at pos. The tcg_gen_extract2_* expander allows >> values 0 <= pos <= N,

Re: [Qemu-devel] [PATCH for-4.1 0/2] Fix check for default backing files in bdrv_reopen_prepare()

2019-04-13 Thread Alberto Garcia
On Sat 13 Apr 2019 02:56:57 AM CEST, Max Reitz wrote: >> Patch 2 fixes a different (but slightly related) issue that I found >> while preparing the first patch. > > I think the real problem is that bs->backing_file is not a cache for > bs->backing->bs->filename. > > In fact, every user of

Re: [Qemu-devel] [PATCH] target/arm: Implement NSACR gating of floating point

2019-04-13 Thread Richard Henderson
On 4/11/19 5:39 AM, Peter Maydell wrote: > +static uint64_t cptr_el2_read(CPUARMState *env, const ARMCPRegInfo *ri) > +{ > +/* > + * For A-profile AArch32 EL3, if NSACR.CP10 > + * is 0 then HCPTR.{TCP11,TCP10} ignore writes and read as 1. > + */ > +uint64_t value =

[Qemu-devel] [Bug 1824616] Re: Build succeeds despite flex/bison missing

2019-04-13 Thread Joachim Durchholz
s/install/git clone/ -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1824616 Title: Build succeeds despite flex/bison missing Status in QEMU: New Bug description: I just built qemu using a

[Qemu-devel] curses.c: "We need a terminal output" ?

2019-04-13 Thread Joachim Durchholz
Hi all, what's the reasoning behind "We need a terminal output" in curses.c? I don't really see a scenario where it's problematic if qemu emits escape sequences to a pipe. I have experienced one scenario where it is problematic: It doesn't work properly with pexpect and expectit (a Python and