Re: [Qemu-devel] [PATCH v2 09/18] json-parser: further simplify freeing JSONParserContext

2018-07-19 Thread Markus Armbruster
Marc-André Lureau writes: > Use g_queue_free_full() directly. > > Signed-off-by: Marc-André Lureau > --- > qobject/json-parser.c | 5 + > 1 file changed, 1 insertion(+), 4 deletions(-) > > diff --git a/qobject/json-parser.c b/qobject/json-parser.c > index 6baf73b4b9..0c0b478149 100644 > ---

[Qemu-devel] [PATCH 2/2] spice-display: fix qemu_spice_cursor_refresh_bh locking

2018-07-19 Thread Paolo Bonzini
spice-display should not call the ui/console.c functions dpy_cursor_define and dpy_moues_set with the SimpleSpiceDisplay lock taken. That will cause a deadlock, because the DisplayChangeListener callbacks will take the lock again. It is also in general a bad idea to invoke generic callbacks with

[Qemu-devel] [RFC/RFT PATCH 0/2] spice-display locking fixes (cursors)?

2018-07-19 Thread Paolo Bonzini
The first issue was found by Coverity and should be trivial. The second however made me wonder how to test the code and whether it has ever worked, because in theory it should be an instant deadlock whenever qemu_spice_cursor_refresh_bh is called. So I'm looking for help. In fact, the changes ar

[Qemu-devel] [PATCH 1/2] spice-display: access ptr_x/ptr_y under Mutex

2018-07-19 Thread Paolo Bonzini
The OpenGL-enabled SPICE code was not accessing the cursor position under the SimpleSpiceDisplay lock. Fix this. Signed-off-by: Paolo Bonzini --- ui/spice-display.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ui/spice-display.c b/ui/spice-display.c index fe734821

Re: [Qemu-devel] [PATCH v2 08/18] json-parser: simplify and avoid JSONParserContext allocation

2018-07-19 Thread Markus Armbruster
Marc-André Lureau writes: > parser_context_new/free() are only used from json_parser_parse(). We > can fold the code there and avoid an allocation altogether. > > Signed-off-by: Marc-André Lureau > --- > qobject/json-parser.c | 41 + > 1 file changed, 9 i

Re: [Qemu-devel] [PATCH v2 07/18] qmp: drop json_parser_parse() wrapper

2018-07-19 Thread Markus Armbruster
Marc-André Lureau writes: > Stupid wrapper that's used exactly once, in libqtest.c. Let's use > json_parser_parse_err() there, and drop the wrapper. Let's rename > json_parser_parse_err() to json_parser_parse() then. > > Suggested-by: Markus Armbruster > Signed-off-by: Marc-André Lureau Revi

Re: [Qemu-devel] [PATCH qemu v2] vfio/spapr: Allow backing bigger guest IOMMU pages with smaller physical pages

2018-07-19 Thread Alexey Kardashevskiy
On 20/6/18 7:10 pm, Alexey Kardashevskiy wrote: > At the moment the PPC64/pseries guest only supports 4K/64K/16M IOMMU > pages and POWER8 CPU supports the exact same set of page size so > so far things worked fine. > > However POWER9 supports different set of sizes - 4K/64K/2M/1G and > the last

Re: [Qemu-devel] [PATCH 07/12] json-parser: always set an error if return NULL

2018-07-19 Thread Markus Armbruster
Marc-André Lureau writes: > Hi > > On Tue, Jul 17, 2018 at 9:06 AM, Markus Armbruster wrote: >> Marc-André Lureau writes: >> >>> Let's make json_parser_parse_err() suck less, and simplify caller >>> error handling. >> >> Missing: >> >>* monitor.c handle_qmp_command(): drop workaround >> >>>

Re: [Qemu-devel] [PATCH v3 19/40] target/mips: Add emulation of nanoMIPS branch instructions

2018-07-19 Thread Richard Henderson
On 07/19/2018 05:54 AM, Stefan Markovic wrote: > +/* Immediate Value Compact Branches */ > +static void gen_compute_imm_branch(DisasContext *ctx, uint32_t opc, > + int rt, int32_t imm, int32_t offset) > +{ > +int bcond_compute = 0; > +TCGv t0 = tcg_temp_new

Re: [Qemu-devel] [PATCH v1 01/17] migration: add background snapshot capability

2018-07-19 Thread Peter Xu
On Wed, Jul 18, 2018 at 06:41:44PM +0300, Denis Plotnikov wrote: > The capability is used for the background vmstate saving > using the migration infrastructure. > Background vmstate saving means that the majority of vmstate > (RAM) is saved in the background when VM's vCPUS are running. > This hel

Re: [Qemu-devel] [PATCH v1 02/17] bitops: add some atomic versions of bitmap operations

2018-07-19 Thread Peter Xu
On Wed, Jul 18, 2018 at 06:41:45PM +0300, Denis Plotnikov wrote: > 1. test bit > 2. test and set bit > > Signed-off-by: Denis Plotnikov Reviewed-by: Peter Xu Regards, -- Peter Xu

Re: [Qemu-devel] [PATCH v3 18/40] target/mips: Add emulation of nanoMIPS 32-bit load and store instructions

2018-07-19 Thread Richard Henderson
On 07/19/2018 05:54 AM, Stefan Markovic wrote: > +case NM_ADDIUGP_B: > +gen_arith_imm(ctx, OPC_ADDIU, rt, 28, u); > +break; Use gen_op_addr_add, since behaves_like('DADDIU[GP.B]'). > case NM_P_LS_U12: > +{ > +uint32_t u = extract32(ctx->opcode, 0,

Re: [Qemu-devel] [PATCH v1 03/17] threads: add infrastructure to process sigsegv

2018-07-19 Thread Peter Xu
On Wed, Jul 18, 2018 at 06:41:46PM +0300, Denis Plotnikov wrote: > Allows to define sigsegv handler temporary for all threads. > This is useful to implement copy-on-write logic while > linux usefaultfd doesn't support write-protected faults. > In the future, switch to using WP userfaultfd when it's

[Qemu-devel] [PULL for-3.0 0/1] tcg-next pull

2018-07-19 Thread Richard Henderson
0100) are available in the Git repository at: https://github.com/rth7680/qemu.git tags/pull-tcg-20180719 for you to fetch changes up to e65a5f227d77a5dbae7a7123c3ee915ee4bd80cf: tcg/aarch64: limit mul_vec size (2018-07-19 09:07:31 -0700) --

[Qemu-devel] [PULL for-3.0 1/1] tcg/aarch64: limit mul_vec size

2018-07-19 Thread Richard Henderson
From: Alex Bennée In AdvSIMD we can only do 32x32 integer multiples although SVE is capable of larger 64 bit multiples. As a result we can end up generating invalid opcodes. Fix this by only reprting we can emit mul vector ops if the size is small enough. Fixes a crash on: sve-all-short-v8.3+

[Qemu-devel] [PATCH] migration: fix potential overflow in multifd send

2018-07-19 Thread Peter Xu
I would guess it won't happen normally, but this should ease Coverity. >>> CID 1394385: Integer handling issues (OVERFLOW_BEFORE_WIDEN) >>> Potentially overflowing expression "pages->used * 8192U" with type >>> "unsigned int" (32 bits, unsigned) is evaluated using 32-bit arithmetic, >>

[Qemu-devel] [PATCH for-3.0 v5] monitor: Fix unsafe sharing of @cur_mon among threads

2018-07-19 Thread Peter Xu
@cur_mon is null unless the main thread is running monitor code, either HMP code within monitor_read(), or QMP code within monitor_qmp_dispatch(). Use of @cur_mon outside the main thread is therefore unsafe. Most of its uses are in monitor command handlers. These run in the main thread. However

Re: [Qemu-devel] [RFC PATCH 0/3] Balloon inhibit enhancements

2018-07-19 Thread Peter Xu
On Thu, Jul 19, 2018 at 09:01:46AM -0600, Alex Williamson wrote: > On Thu, 19 Jul 2018 13:40:51 +0800 > Peter Xu wrote: > > On Wed, Jul 18, 2018 at 10:31:33AM -0600, Alex Williamson wrote: > > > On Wed, 18 Jul 2018 14:48:03 +0800 > > > Peter Xu wrote: > > > > I'm wondering what if want to do that

Re: [Qemu-devel] [PATCH v4 1/3] spapr: introduce a fixed IRQ number space

2018-07-19 Thread David Gibson
On Fri, Jul 06, 2018 at 03:36:24PM +0200, Greg Kurz wrote: > On Fri, 6 Jul 2018 11:07:11 +0200 > Cédric Le Goater wrote: [snip] > > +/* > > + * The register property of a VIO device is defined in livirt using a > > + * base number + 0x1000 increment and in QEMU by incrementing the base > > + * re

Re: [Qemu-devel] [PATCH v4 1/3] spapr: introduce a fixed IRQ number space

2018-07-19 Thread David Gibson
On Fri, Jul 06, 2018 at 11:07:11AM +0200, Cédric Le Goater wrote: > This proposal introduces a new IRQ number space layout using static > numbers for all devices, depending on a device index, and a bitmap > allocator for the MSI IRQ numbers which are negotiated by the guest at > runtime. > > As th

Re: [Qemu-devel] [PATCH] target/xtensa/cpu: Set owner of memory region in xtensa_cpu_initfn

2018-07-19 Thread Max Filippov
On Thu, Jul 19, 2018 at 6:02 AM, Thomas Huth wrote: > The instance_init function of the xtensa CPUs creates a memory region, > but does not set an owner, so the memory region is not destroyed > correctly when the CPU object is removed. This can happen when > introspecting the CPU devices, so intro

Re: [Qemu-devel] [PATCH] linux-user/ppc: Implement swapcontext syscall

2018-07-19 Thread Philippe Mathieu-Daudé
On 07/19/2018 08:13 AM, Richard Henderson wrote: > On 07/18/2018 03:56 PM, Philippe Mathieu-Daudé wrote: >>> + >>> +/* This syscall implements {get,set,swap}context for userland. */ >> >> This comment confuses me because do_setcontext() is available at line 625. > > But that's not wired up as a s

Re: [Qemu-devel] [Qemu-arm] [PATCH] hw/arm/spitz: Move problematic nand_init() code to realize function

2018-07-19 Thread Philippe Mathieu-Daudé
On 07/19/2018 10:15 AM, Thomas Huth wrote: > nand_init() does not only create the NAND device, it also realizes > the device with qdev_init_nofail() already. So we must not call > nand_init() from an instance_init function like sl_nand_init(), > otherwise we get superfluous NAND devices in the QOM

Re: [Qemu-devel] [PATCH] hw/intc/arm_gicv3_its: downgrade error_report to warn_report in kvm_arm_its_reset

2018-07-19 Thread Jia He
Hi Peter。 Thanks for the comments On 7/19/2018 8:41 PM, Peter Maydell Wrote: > On 19 July 2018 at 04:11, Jia He wrote: >> In scripts/arch-run.bash of kvm-unit-tests, it will check the qemu >> output log with: >> if [ -z "$(echo "$errors" | grep -vi warning)" ]; then >> >> Thus without the warning

[Qemu-devel] [PULL 2/2] tap: fix memory leak on success to create a tap device

2018-07-19 Thread Jason Wang
From: Yunjian Wang The memory leak on success to create a tap device. And the nfds and nvhosts may not be the same and need to be processed separately. Fixes: 07825977 ("tap: fix memory leak on failure to create a multiqueue tap device") Fixes: 264986e2 ("tap: multiqueue support") Cc: qemu-sta.

[Qemu-devel] [PULL 1/2] e1000e: Prevent MSI/MSI-X storms

2018-07-19 Thread Jason Wang
From: Jan Kiszka Only signal MSI/MSI-X events on rising edges. So far we re-triggered the interrupt sources even if the guest did no consumed the pending one, easily causing interrupt storms. Issue was observable with Linux 4.16 e1000e driver when MSI-X was used. Vector 2 was causing interrupt s

[Qemu-devel] [PULL 0/2] Net patches

2018-07-19 Thread Jason Wang
The following changes since commit 9f2b67e1ca43c84ed37ebd027e7e77a0f2f8ef65: Merge remote-tracking branch 'remotes/alistair/tags/pull-riscv-pull-20180719' into staging (2018-07-19 17:21:43 +0100) are available in the git repository at: https://github.com/jasowang/qemu.git tag

Re: [Qemu-devel] [PATCH v3 17/40] target/mips: Implement emulation of nanoMIPS EXTW instruction

2018-07-19 Thread Richard Henderson
On 07/19/2018 05:54 AM, Stefan Markovic wrote: > From: James Hogan > > Implement emulation of nanoMIPS EXTW instruction, which is similar to > the MIPS r6 ALIGN instruction, except that it counts the other way and > in bits instead of bytes. We therefore generalise gen_align() into > gen_align_bi

Re: [Qemu-devel] [PATCH] monitor: print message when using 'help' with an unknown command

2018-07-19 Thread Collin Walling
On 07/19/2018 03:18 PM, Dr. David Alan Gilbert wrote: > * Collin Walling (wall...@linux.ibm.com) wrote: >> When typing 'help' followed by an unknown command, QEMU will >> not print anything to the command line to let the user know >> they typed a bad command. Let's fix this by printing a message >>

Re: [Qemu-devel] [PATCH] block/file-posix: add bdrv_attach_aio_context callback for host dev and cdrom

2018-07-19 Thread John Snow
On 07/18/2018 05:12 PM, Nishanth Aravamudan via Qemu-devel wrote: > In ed6e2161 ("linux-aio: properly bubble up errors from initialzation"), > I only added a bdrv_attach_aio_context callback for the bdrv_file > driver. There are several other drivers that use the shared > aio_plug callback, thou

Re: [Qemu-devel] [PATCH v3 16/40] target/mips: Implement emulation of nanoMIPS ROTX instruction

2018-07-19 Thread Richard Henderson
On 07/19/2018 05:54 AM, Stefan Markovic wrote: > From: Matthew Fortune > > Added a helper for ROTX based on the pseudocode from the > architecture spec. This instraction was not present in previous > MIPS instruction sets. > > Signed-off-by: Yongbok Kim > Signed-off-by: Aleksandar Markovic > S

Re: [Qemu-devel] [PATCH v3 15/40] target/mips: Add emulation of misc nanoMIPS instructions (pool p_lsx)

2018-07-19 Thread Richard Henderson
On 07/19/2018 05:54 AM, Stefan Markovic wrote: > +static void gen_p_lsx(DisasContext *ctx, int rd, int rs, int rt) > +{ > +TCGv t0, t1; > +t0 = tcg_temp_new(); > +t1 = tcg_temp_new(); > +tcg_gen_movi_tl(t1, 0); > +if (rs == 0) { > +tcg_gen_movi_tl(t0, 0); > +} else {

Re: [Qemu-devel] [PATCH] monitor: print message when using 'help' with an unknown command

2018-07-19 Thread Dr. David Alan Gilbert
* Collin Walling (wall...@linux.ibm.com) wrote: > When typing 'help' followed by an unknown command, QEMU will > not print anything to the command line to let the user know > they typed a bad command. Let's fix this by printing a message > to the monitor when this happens. For example: > > (qe

Re: [Qemu-devel] [PATCH v3 14/40] target/mips: Add emulation of misc nanoMIPS instructions (pool32axf)

2018-07-19 Thread Richard Henderson
On 07/19/2018 05:54 AM, Stefan Markovic wrote: > +static void gen_pool32axf_nanomips_insn(CPUMIPSState *env, DisasContext *ctx) > +{ > +int rt = (ctx->opcode >> 21) & 0x1f; > +int rs = (ctx->opcode >> 16) & 0x1f; > + > +switch ((ctx->opcode >> 6) & 0x07) { extract32. > case N

Re: [Qemu-devel] [PATCH] monitor: print message when using 'help' with an unknown command

2018-07-19 Thread Dr. David Alan Gilbert
* Markus Armbruster (arm...@redhat.com) wrote: > You neglected to cc: maintainers. Cc'ing them increases the odds your > patch will be noticed and picked up. You can use > scripts/get_maintainer.pl to find maintainers. You don't have to do > anything for this patch; it got noticed anyway. > > D

Re: [Qemu-devel] [PATCH v3 13/40] target/mips: Add emulation of misc nanoMIPS instructions (pool32a0)

2018-07-19 Thread Richard Henderson
On 07/19/2018 05:54 AM, Stefan Markovic wrote: > From: Yongbok Kim > > Add emulation of nanoMIPS instructions that are situated in pool32a0. > > Signed-off-by: Yongbok Kim > Signed-off-by: Aleksandar Markovic > Signed-off-by: Stefan Markovic > Reviewed-by: Aleksandar Markovic > --- > target

Re: [Qemu-devel] [PATCH v3 12/40] target/mips: Add emulation of nanoMIPS FP instructions

2018-07-19 Thread Richard Henderson
On 07/19/2018 05:54 AM, Stefan Markovic wrote: > +static void gen_pool32f_nanomips_insn(DisasContext *ctx) > +{ > +int rt, rs, rd; > + > +rt = (ctx->opcode >> 21) & 0x1f; > +rs = (ctx->opcode >> 16) & 0x1f; > +rd = (ctx->opcode >> 11) & 0x1f; extract32? Otherwise, Reviewed-by: Ric

Re: [Qemu-devel] How to generate custom fw paths for IDE devices?

2018-07-19 Thread Laszlo Ersek
On 07/19/18 19:19, Mark Cave-Ayland wrote: > On 19/07/18 09:29, Laszlo Ersek wrote: > >> (updating Marcel's address to his GMail one) >> >> On 07/18/18 23:13, Mark Cave-Ayland wrote: >>> Hi all, >>> >>> Following on from a couple of patches I've previously posted to the >>> mailing list at >>> http

Re: [Qemu-devel] [PATCH v3 11/40] target/mips: Add emulation of nanoMIPS 48-bit instructions

2018-07-19 Thread Richard Henderson
On 07/19/2018 05:54 AM, Stefan Markovic wrote: > case NM_P48I: > +insn = cpu_lduw_code(env, ctx->base.pc_next + 4); > +switch ((ctx->opcode >> 16) & 0x1f) { > +case NM_LI48: > +if (rt != 0) { > +tcg_gen_movi_tl(cpu_gpr[rt], > +

[Qemu-devel] [PATCH v2 16/18] tests: add a qmp success-response test

2018-07-19 Thread Marc-André Lureau
Verify the usage of this schema feature and the API behaviour. This should be the only case where qmp_dispatch() returns NULL without error. Signed-off-by: Marc-André Lureau Reviewed-by: Markus Armbruster --- tests/test-qmp-cmds.c | 17 + tests/qapi-schema/qap

[Qemu-devel] [PATCH v2 17/18] qga: process_event() simplification

2018-07-19 Thread Marc-André Lureau
Simplify the code around qmp_dispatch(): - rely on qmp_dispatch/check_obj() for message checking - have a single send_response() point - constify send_response() argument It changes a couple of error messages: * When @req isn't a dictionary, from Invalid JSON syntax to QMP input must be

[Qemu-devel] [PATCH v2 15/18] tests: add a few qemu-qmp tests

2018-07-19 Thread Marc-André Lureau
These 2 tests exhibited two qmp bugs that were fixed in 2.7 (series from commit e64c75a9752c5d0fd64eb2e684c656a5ea7d03c6 to commit 1382d4abdf9619985e4078e37e49e487cea9935e) Signed-off-by: Marc-André Lureau --- tests/qmp-test.c | 38 ++ 1 file changed, 38 inser

Re: [Qemu-devel] [PATCH v3 10/40] target/mips: Add emulation of some common nanoMIPS 32-bit instructions

2018-07-19 Thread Richard Henderson
On 07/19/2018 05:54 AM, Stefan Markovic wrote: > +case NM_P_ADDIU: > +if (rt == 0) { > +/* P.RI */ > +switch ((ctx->opcode >> 19) & 0x03) { > +case NM_SIGRIE: > +default: > +generate_exception_end(ctx, EXCP_RI); > +

[Qemu-devel] [PATCH v2 14/18] json-lexer: make it safe to call multiple times

2018-07-19 Thread Marc-André Lureau
We can easily avoid the burden of checking if the lexer was initialized prior to calling destroy by the caller, let's do it. This allows simplification in state tracking in later patches of the qmp-async RFC series. Signed-off-by: Marc-André Lureau --- qobject/json-lexer.c | 5 - 1 file cha

[Qemu-devel] [PATCH v2 06/18] qga: process_event() simplification and leak fix

2018-07-19 Thread Marc-André Lureau
json_parser_parse_err() may return something else than a QDict, in which case we loose the object. Let's keep track of the original object to avoid leaks. When an error occurs, "qdict" contains the response, but we still check the "execute" key there. Untangle a bit this code, by having a clear er

[Qemu-devel] [PATCH v2 13/18] json-parser: set an error if parsing returned NULL

2018-07-19 Thread Marc-André Lureau
Let's make json_parser_parse_err() suck less, and simplify caller error handling. * monitor.c handle_qmp_command(): drop workaround * qga/main.c process_event(): improve error report, QERR_JSON_PARSING case is handled by json_parser_parse_err() now. * qobject/json-parser.c json_parser_pars

[Qemu-devel] [PATCH v2 18/18] RFC: qmp: common 'id' handling & make QGA conform to QMP spec

2018-07-19 Thread Marc-André Lureau
Let qmp_dispatch() copy the 'id' field. That way any qmp client will conform to the specification, including QGA. Furthermore, it simplifies the work for qemu monitor. CC: Michael Roth Signed-off-by: Marc-André Lureau --- monitor.c | 30 +++--- qapi/qmp-dispatc

[Qemu-devel] [PATCH v2 08/18] json-parser: simplify and avoid JSONParserContext allocation

2018-07-19 Thread Marc-André Lureau
parser_context_new/free() are only used from json_parser_parse(). We can fold the code there and avoid an allocation altogether. Signed-off-by: Marc-André Lureau --- qobject/json-parser.c | 41 + 1 file changed, 9 insertions(+), 32 deletions(-) diff --git

[Qemu-devel] [PATCH v2 10/18] qjson: report an error if there are multiple results

2018-07-19 Thread Marc-André Lureau
qobject_from_jsonv() returns a single object. Let's make sure that during parsing we don't leak an intermediary object. Instead of returning the last object, set a parsing error. Also, the lexer/parser keeps consuming all the data. There might be an error set earlier. Let's keep it and not call js

[Qemu-devel] [PATCH v2 12/18] qjson: return parsing error if unterminated input

2018-07-19 Thread Marc-André Lureau
Signed-off-by: Marc-André Lureau --- qobject/json-streamer.c | 4 +++- qobject/qjson.c | 5 - tests/check-qjson.c | 8 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/qobject/json-streamer.c b/qobject/json-streamer.c index c51c2021f9..065c551332 100644 ---

[Qemu-devel] [PATCH v2 11/18] qjson: report error on unterminated string

2018-07-19 Thread Marc-André Lureau
An unterminated string will make parser emit an error (tokens == NULL). Let's report it. Signed-off-by: Marc-André Lureau --- qobject/qjson.c | 3 +++ tests/check-qjson.c | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/qobject/qjson.c b/qobject/qjson.c index 8a9d11

[Qemu-devel] [PATCH v2 07/18] qmp: drop json_parser_parse() wrapper

2018-07-19 Thread Marc-André Lureau
Stupid wrapper that's used exactly once, in libqtest.c. Let's use json_parser_parse_err() there, and drop the wrapper. Let's rename json_parser_parse_err() to json_parser_parse() then. Suggested-by: Markus Armbruster Signed-off-by: Marc-André Lureau --- include/qapi/qmp/json-parser.h | 3 +--

[Qemu-devel] [PATCH v2 05/18] monitor: no need to save need_resume

2018-07-19 Thread Marc-André Lureau
There is no need for per-command need_resume granularity, it should resume after running an non-oob command on oob-disabled monitor. Signed-off-by: Marc-André Lureau Reviewed-by: Markus Armbruster --- monitor.c | 13 - 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/mo

[Qemu-devel] [PATCH v2 04/18] Revert "qmp: isolate responses into io thread"

2018-07-19 Thread Marc-André Lureau
This reverts commit abe3cd0ff7f774966da6842620806ab7576fe4f3. There is no need to add an additional queue to send the reply to the IOThread, because QMP response is thread safe, and chardev write path is thread safe. It will schedule the watcher in the associated IOThread. Signed-off-by: Marc-And

[Qemu-devel] [PATCH v2 00/18] monitor: various code simplification and fixes

2018-07-19 Thread Marc-André Lureau
Hi, This series is a rebased subset of "[PATCH v3 00/38] RFC: monitor: add asynchronous command type" with code cleanups and improvements that are worth to consider for 3.0. The series applies on master, and will conflict with the pending series "[PATCH 0/9] monitor: enable OOB by default" from P

[Qemu-devel] [PATCH v2 09/18] json-parser: further simplify freeing JSONParserContext

2018-07-19 Thread Marc-André Lureau
Use g_queue_free_full() directly. Signed-off-by: Marc-André Lureau --- qobject/json-parser.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/qobject/json-parser.c b/qobject/json-parser.c index 6baf73b4b9..0c0b478149 100644 --- a/qobject/json-parser.c +++ b/qobject/json-pa

[Qemu-devel] [PATCH v2 01/18] tests: change /0.15/* tests to /qmp/*

2018-07-19 Thread Marc-André Lureau
Presumably 0.15 was the version it was first introduced, but qmp keeps evolving. There is no point in having that version as test prefix, 'qmp' makes more sense here. Signed-off-by: Marc-André Lureau Reviewed-by: Eric Blake Message-Id: <20180326150916.9602-12-marcandre.lur...@redhat.com> Reviewe

[Qemu-devel] [PATCH v2 02/18] monitor: consitify qmp_send_response() QDict argument

2018-07-19 Thread Marc-André Lureau
Signed-off-by: Marc-André Lureau Reviewed-by: Markus Armbruster --- monitor.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/monitor.c b/monitor.c index be29634a00..adc04a01d3 100644 --- a/monitor.c +++ b/monitor.c @@ -504,9 +504,9 @@ int monitor_fprintf(FILE *stream, co

[Qemu-devel] [PATCH v2 03/18] qmp: constify qmp_is_oob()

2018-07-19 Thread Marc-André Lureau
Signed-off-by: Marc-André Lureau Reviewed-by: Markus Armbruster --- include/qapi/qmp/dispatch.h | 2 +- qapi/qmp-dispatch.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/qapi/qmp/dispatch.h b/include/qapi/qmp/dispatch.h index 4e2e749faf..68a528a9aa 100644

Re: [Qemu-devel] [PATCH v3 09/40] target/mips: Add emulation of nanoMIPS 16-bit save and restore instructions

2018-07-19 Thread Richard Henderson
On 07/19/2018 05:54 AM, Stefan Markovic wrote: > +int rt = 30 + ((ctx->opcode >> 9) & 1); > +switch ((ctx->opcode >> 8) & 1) { extract32. Otherwise, Reviewed-by: Richard Henderson r~

Re: [Qemu-devel] [PATCH v3 07/40] target/mips: Add emulation of nanoMIPS 16-bit load and store instructions

2018-07-19 Thread Richard Henderson
On 07/19/2018 05:54 AM, Stefan Markovic wrote: > +/* Used for 16-bit store instructions. */ > +static int decode_gpr_gpr3_src_store(int r) > +{ > +static const int map[] = { 0, 17, 18, 19, 4, 5, 6, 7 }; > + > +return map[r & 0x7]; > +} Same comment re comment as before. > case NM_P1

Re: [Qemu-devel] [PATCH v3 06/40] target/mips: Add emulation of misc nanoMIPS 16-bit instructions

2018-07-19 Thread Richard Henderson
On 07/19/2018 05:54 AM, Stefan Markovic wrote: > From: Yongbok Kim > > Add emulation of misc nanoMIPS 16-bit instructions from instruction > pools P16, P16.BR, P16.BRI, P16.4X4 and other related pools. > > Signed-off-by: Yongbok Kim > Signed-off-by: Aleksandar Markovic > Signed-off-by: Stefan

Re: [Qemu-devel] [Qemu-block] [PATCH] block: Don't lock /dev/null and /dev/zero automatically

2018-07-19 Thread John Snow
On 07/18/2018 11:41 PM, Fam Zheng wrote: > On my Fedora 28, /dev/null is locked by some other process (couldn't > inspect it due to the current lslocks limitation), so iotests 226 fails > with some unexpected image locking errors because it uses qemu-io to > open it. > > Actually it's safe to n

Re: [Qemu-devel] [PATCH 12/12] RFC: qmp: rework 'id' handling

2018-07-19 Thread Marc-André Lureau
Hi On Tue, Jul 17, 2018 at 6:05 PM, Markus Armbruster wrote: > Copying the guest agent maintainer Michael Roth. > > Patch needs a rebase. > > Marc-André Lureau writes: > >> Let qmp_dispatch() copy the 'id' field. That way any qmp client will >> conform to the specification, including QGA. > > Be

Re: [Qemu-devel] [PULL v2 for 3.0 0/5] riscv-pull queue

2018-07-19 Thread Peter Maydell
ble in the Git repository at: > > g...@github.com:alistair23/qemu.git tags/pull-riscv-pull-20180719 > > for you to fetch changes up to 8ff62f6aa067edd5455d60202041b4ae08a65b17: > > spike: Fix crash when intro

Re: [Qemu-devel] [PATCH 09/12] tests: add a few qemu-qmp tests

2018-07-19 Thread Marc-André Lureau
Hi On Tue, Jul 17, 2018 at 3:15 PM, Markus Armbruster wrote: > Marc-André Lureau writes: > >> Hi >> >> On Tue, Jul 17, 2018 at 10:01 AM, Markus Armbruster >> wrote: >>> Marc-André Lureau writes: >>> These 2 tests exhibited two qmp bugs that were fixed in 2.7 (series from commit e64c

Re: [Qemu-devel] How to generate custom fw paths for IDE devices?

2018-07-19 Thread Mark Cave-Ayland
On 19/07/18 09:29, Laszlo Ersek wrote: (updating Marcel's address to his GMail one) On 07/18/18 23:13, Mark Cave-Ayland wrote: Hi all, Following on from a couple of patches I've previously posted to the mailing list at https://lists.gnu.org/archive/html/qemu-devel/2018-06/msg08836.html I've m

Re: [Qemu-devel] [PATCH 07/12] json-parser: always set an error if return NULL

2018-07-19 Thread Marc-André Lureau
Hi On Tue, Jul 17, 2018 at 9:06 AM, Markus Armbruster wrote: > Marc-André Lureau writes: > >> Let's make json_parser_parse_err() suck less, and simplify caller >> error handling. > > Missing: > >* monitor.c handle_qmp_command(): drop workaround > >> * qga/main.c process_event() doesn't need

Re: [Qemu-devel] [PATCH v3 05/40] target/mips: Add nanoMIPS decoding and extraction utilities

2018-07-19 Thread Richard Henderson
On 07/19/2018 05:54 AM, Stefan Markovic wrote: > +static int decode_gpr_gpr3(int r) > +{ > +static const int map[] = { 16, 17, 18, 19, 4, 5, 6, 7 }; > + > +return map[r & 0x7]; > +} > + > +static int decode_gpr_gpr4(int r) > +{ > +static const int map[] = { 8, 9, 10, 11, 4, 5, 6, 7, > +

Re: [Qemu-devel] How to generate custom fw paths for IDE devices?

2018-07-19 Thread Mark Cave-Ayland
On 19/07/18 09:10, Thomas Huth wrote: On 18.07.2018 23:13, Mark Cave-Ayland wrote: Hi all, Following on from a couple of patches I've previously posted to the mailing list at https://lists.gnu.org/archive/html/qemu-devel/2018-06/msg08836.html I've made some good progress with trying to add boo

Re: [Qemu-devel] [PATCH] monitor: print message when using 'help' with an unknown command

2018-07-19 Thread Collin Walling
On 07/19/2018 12:31 PM, Markus Armbruster wrote: > You neglected to cc: maintainers. Cc'ing them increases the odds your > patch will be noticed and picked up. You can use > scripts/get_maintainer.pl to find maintainers. You don't have to do > anything for this patch; it got noticed anyway. > >

Re: [Qemu-devel] [PATCH v3 04/40] target/mips: Add decode_nanomips_opc() function

2018-07-19 Thread Richard Henderson
On 07/19/2018 05:54 AM, Stefan Markovic wrote: > decode_opc(env, ctx); > } else if (ctx->insn_flags & ASE_MICROMIPS) { > -ctx->opcode = cpu_lduw_code(env, ctx->base.pc_next); > -insn_bytes = decode_micromips_opc(env, ctx); > +if (env->insn_flags & ISA_NANOMIPS3

Re: [Qemu-devel] [PATCH] monitor: print message when using 'help' with an unknown command

2018-07-19 Thread Markus Armbruster
You neglected to cc: maintainers. Cc'ing them increases the odds your patch will be noticed and picked up. You can use scripts/get_maintainer.pl to find maintainers. You don't have to do anything for this patch; it got noticed anyway. David, this is yours :) Collin Walling writes: > When typ

Re: [Qemu-devel] [PATCH for-3.0] target/arm: Correctly handle overlapping small MPU regions

2018-07-19 Thread Peter Maydell
On 18 July 2018 at 05:02, Richard Henderson wrote: > On 07/17/2018 12:40 PM, Peter Maydell wrote: >> On 17 July 2018 at 18:29, Richard Henderson >> wrote: >>> I don't understand why this is necessary in the v8m case. >>> >>>AP APL >>>

Re: [Qemu-devel] [PATCH] hw/timer/mc146818rtc: Fix introspection problem

2018-07-19 Thread Paolo Bonzini
On 19/07/2018 16:46, Peter Maydell wrote: > On 19 July 2018 at 15:23, Thomas Huth wrote: >> There is currently a funny problem with the "mc146818rtc" device: >> 1) Start QEMU like this: >>qemu-system-ppc64 -M pseries -S >> 2) At the HMP monitor, enter "info qom-tree". Note that there is an >>

Re: [Qemu-devel] [PATCH v3 03/40] target/mips: Add nanoMIPS DSP ASE opcodes

2018-07-19 Thread Richard Henderson
On 07/19/2018 05:54 AM, Stefan Markovic wrote: > From: Stefan Markovic > > Add nanoMIPS opcodes for DSP ASE instruction pools and instructions. > > Signed-off-by: Aleksandar Markovic > Signed-off-by: Stefan Markovic > --- > target/mips/translate.c | 144 >

[Qemu-devel] [PULL for-3.0 1/1] tracing: Use double-dash spelling for trace option

2018-07-19 Thread Stefan Hajnoczi
From: Yaowei Bai The '-trace' and '--trace' spellings are only both supported in qemu binary, while for qemu-nbd or qemu-img only '--trace' spelling is supported. So for the consistency of trace option invocation, we should use double-dash spelling in our documentation. This's also mentioned in

Re: [Qemu-devel] [PATCH v2] nvic: Change NVIC to support ARMv6-M

2018-07-19 Thread Peter Maydell
On 19 July 2018 at 13:16, Julia Suvorova wrote: > The differences from ARMv7-M NVIC are: > * ARMv6-M only supports up to 32 external interrupts >(configurable feature already). The ICTR is reserved. > * Active Bit Register is reserved. > * ARMv6-M supports 4 priority levels against 256 i

[Qemu-devel] [PULL for-3.0 0/1] Tracing patches

2018-07-19 Thread Stefan Hajnoczi
The following changes since commit ea6abffa8a08d832feb759d359d5b935e3087cf7: Update version for v3.0.0-rc1 release (2018-07-17 18:15:19 +0100) are available in the Git repository at: git://github.com/stefanha/qemu.git tags/tracing-pull-request for you to fetch changes up to db817b8c500a6087

Re: [Qemu-devel] [qemu-s390x] [BUG?] aio_get_linux_aio: Assertion `ctx->linux_aio' failed

2018-07-19 Thread Nishanth Aravamudan via Qemu-devel
Hi Christian, On 19.07.2018 [08:55:20 +0200], Christian Borntraeger wrote: > > > On 07/18/2018 08:52 PM, Nishanth Aravamudan wrote: > > On 18.07.2018 [11:10:27 -0400], Farhan Ali wrote: > >> > >> > >> On 07/18/2018 09:42 AM, Farhan Ali wrote: > >> I am not too familiar with block device code

Re: [Qemu-devel] [PATCH v2] arm: Add ARMv6-M programmer's model support

2018-07-19 Thread Peter Maydell
On 18 July 2018 at 10:56, Julia Suvorova wrote: > Forbid stack alignment change. (CCR) > Reserve FAULTMASK, BASEPRI registers. > Report any fault as a HardFault. Disable MemManage, BusFault and > UsageFault, so they always escalated to HardFault. (SHCSR) > > Signed-off-by: Julia Suvorova > --- >

Re: [Qemu-devel] [PATCH v6 11/11] linux-user: Add availability control to some syscalls

2018-07-19 Thread Aleksandar Markovic
> From: Richard Henderson > Sent: Thursday, July 19, 2018 5:57 PM > > On 07/19/2018 05:52 AM, Stefan Markovic wrote: > > From: Aleksandar Rikalo > > > > Signed-off-by: Aleksandar Markovic > > Signed-off-by: Stefan Markovic > > --- > > linux-user/strace.c | 14 +- > > linux-user/sy

Re: [Qemu-devel] [PATCH] tcg/aarch64: limit mul_vec size

2018-07-19 Thread Richard Henderson
On 07/19/2018 08:42 AM, Alex Bennée wrote: > In AdvSIMD we can only do 32x32 integer multiples although SVE is > capable of larger 64 bit multiples. As a result we can end up > generating invalid opcodes. Fix this by only reprting we can emit mul > vector ops if the size is small enough. > > Fixes

[Qemu-devel] [PULL v2 for 3.0 4/5] riscv_hart: Fix crash when introspecting the device

2018-07-19 Thread Alistair Francis
Use the new object_initialize_child() and sysbus_init_child_obj() to fix the issue. Signed-off-by: Alistair Francis Suggested-by: Thomas Huth Reviewed-by: Michael Clark Reviewed-by: Thomas Huth --- hw/riscv/riscv_hart.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git

[Qemu-devel] [PULL v2 for 3.0 2/5] sifive_u: Fix crash when introspecting the device

2018-07-19 Thread Alistair Francis
Use the new object_initialize_child() and sysbus_init_child_obj() to fix the issue. Signed-off-by: Alistair Francis Suggested-by: Thomas Huth Reviewed-by: Michael Clark Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé --- hw/riscv/sifive_u.c | 1

[Qemu-devel] [PULL v2 for 3.0 0/5] riscv-pull queue

2018-07-19 Thread Alistair Francis
riscv-pull-20180719 for you to fetch changes up to 8ff62f6aa067edd5455d60202041b4ae08a65b17: spike: Fix crash when introspecting the device (2018-07-19 09:05:48 -0700) riscv: Fix introspection problems This is based on Thomas

[Qemu-devel] [PULL v2 for 3.0 5/5] spike: Fix crash when introspecting the device

2018-07-19 Thread Alistair Francis
Use the new object_initialize_child() and sysbus_init_child_obj() to fix the issue. Signed-off-by: Alistair Francis Suggested-by: Thomas Huth Reviewed-by: Michael Clark Reviewed-by: Thomas Huth --- hw/riscv/spike.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a

[Qemu-devel] [PULL v2 for 3.0 1/5] sifive_e: Fix crash when introspecting the device

2018-07-19 Thread Alistair Francis
Use the new object_initialize_child() and sysbus_init_child_obj() to fix the issue. Signed-off-by: Alistair Francis Suggested-by: Thomas Huth Reviewed-by: Michael Clark Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé --- hw/riscv/sifive_e.c | 1

[Qemu-devel] [PULL v2 for 3.0 3/5] virt: Fix crash when introspecting the device

2018-07-19 Thread Alistair Francis
Use the new object_initialize_child() and sysbus_init_child_obj() to fix the issue. Signed-off-by: Alistair Francis Suggested-by: Thomas Huth Reviewed-by: Michael Clark Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé --- hw/riscv/virt.c | 5 ++-

Re: [Qemu-devel] [PATCH v6 11/11] linux-user: Add availability control to some syscalls

2018-07-19 Thread Richard Henderson
On 07/19/2018 05:52 AM, Stefan Markovic wrote: > From: Aleksandar Rikalo > > Signed-off-by: Aleksandar Markovic > Signed-off-by: Stefan Markovic > --- > linux-user/strace.c | 14 +- > linux-user/syscall.c | 25 + > 2 files changed, 38 insertions(+), 1 delet

Re: [Qemu-devel] [PULL for-v3.0 0/1] Block patches

2018-07-19 Thread Peter Maydell
On 19 July 2018 at 15:28, Stefan Hajnoczi wrote: > The following changes since commit ea6abffa8a08d832feb759d359d5b935e3087cf7: > > Update version for v3.0.0-rc1 release (2018-07-17 18:15:19 +0100) > > are available in the Git repository at: > > git://github.com/stefanha/qemu.git tags/block-pu

Re: [Qemu-devel] [PATCH v6 10/11] linux-user: Update MIPS syscall numbers up to kernel 4.18 headers

2018-07-19 Thread Richard Henderson
On 07/19/2018 05:52 AM, Stefan Markovic wrote: > From: Aleksandar Markovic > > Synchronize content of linux-user/mips/syscall_nr.h and > linux-user/mips64/syscall_nr.h with Linux kernel 4.18 headers. > This adds 7 new syscall numbers, the last being NR_statx. > > Signed-off-by: Aleksandar Markov

Re: [Qemu-devel] [RFC v3] qemu: Add virtio pmem device

2018-07-19 Thread Luiz Capitulino
On Thu, 19 Jul 2018 15:58:20 +0200 David Hildenbrand wrote: > On 19.07.2018 14:16, Stefan Hajnoczi wrote: > > On Thu, Jul 19, 2018 at 01:48:13AM -0400, Pankaj Gupta wrote: > >> > >>> > This patch adds virtio-pmem Qemu device. > > This device presents memory address range in

Re: [Qemu-devel] [PATCH] linux-user/ppc: Implement swapcontext syscall

2018-07-19 Thread Peter Maydell
On 19 July 2018 at 16:24, Richard Henderson wrote: > On 07/19/2018 06:05 AM, Alex Bennée wrote: >> I'm confused by the lock_user_struct/unlock_user_struct which AFAICT are >> basically access checks. Is there an implied locking I'm missing? > > I have no idea why those have that name. There's no

Re: [Qemu-devel] [PATCH v6 09/11] elf: Add ELF flags for MIPS machine variants

2018-07-19 Thread Richard Henderson
On 07/19/2018 05:52 AM, Stefan Markovic wrote: > From: Aleksandar Markovic > > Add MIPS machine variants ELF flags so that the emulation behavior > can be adjusted if needed. > > Signed-off-by: Aleksandar Markovic > Signed-off-by: Stefan Markovic > --- > include/elf.h | 23 +++

[Qemu-devel] [PATCH] tcg/aarch64: limit mul_vec size

2018-07-19 Thread Alex Bennée
In AdvSIMD we can only do 32x32 integer multiples although SVE is capable of larger 64 bit multiples. As a result we can end up generating invalid opcodes. Fix this by only reprting we can emit mul vector ops if the size is small enough. Fixes a crash on: sve-all-short-v8.3+sve@vq3/insn_mul_z_z

Re: [Qemu-devel] [PATCH v6 08/11] elf: Remove duplicate preprocessor constant definition

2018-07-19 Thread Richard Henderson
On 07/19/2018 05:52 AM, Stefan Markovic wrote: > From: Aleksandar Markovic > > Remove duplicate preprocessor constant definition for EF_MIPS_ARCH. > > The duplicate was introduced in commit 45506bdd. > > Signed-off-by: Aleksandar Markovic > --- > include/elf.h | 1 - > 1 file changed, 1 delet

Re: [Qemu-devel] [PATCH v6 07/11] target/mips: Check ELPA flag only in some cases of MFHC0 and MTHC0

2018-07-19 Thread Richard Henderson
On 07/19/2018 05:52 AM, Stefan Markovic wrote: > From: Yongbok Kim > > MFHC0 and MTHC0 used to handle EntryLo0 and EntryLo1 registers only, > and placing ELPA flag checks before switch statement were technically > correct. However, after adding handling more registers, these checks > should be mo

Re: [Qemu-devel] [PATCH v6 06/11] target/mips: Don't update BadVAddr register in Debug Mode

2018-07-19 Thread Richard Henderson
On 07/19/2018 05:52 AM, Stefan Markovic wrote: > From: Yongbok Kim > > BadVAddr should not be updated if (env->hflags & MIPS_HFLAG_DM) is > set. > > Signed-off-by: Yongbok Kim > Signed-off-by: Aleksandar Markovic > Reviewed-by: Philippe Mathieu-Daudé > --- > target/mips/helper.c| 4 +++-

Re: [Qemu-devel] [PATCH v6 05/11] target/mips: Add CP0 BadInstrX register

2018-07-19 Thread Richard Henderson
On 07/19/2018 05:52 AM, Stefan Markovic wrote: > From: Stefan Markovic > > Add CP0 BadInstrX register. This register will be used in nanoMIPS. > > Signed-off-by: Stefan Markovic > Signed-off-by: Yongbok Kim > Signed-off-by: Aleksandar Markovic > Reviewed-by: Aleksandar Markovic > Reviewed-by

  1   2   3   >