[Qemu-devel] [Bug 1331859] Re: QEMU kernel panic on Windows with arithmetic syntax error

2018-08-24 Thread Launchpad Bug Tracker
[Expired for QEMU because there has been no activity for 60 days.] ** Changed in: qemu Status: Incomplete => Expired -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1331859 Title: QEMU

[Qemu-devel] [PATCH V4 2/4] target-i386:add coalesced_pio API

2018-08-24 Thread Peng Hao
Signed-off-by: Peng Hao --- accel/kvm/kvm-all.c | 57 +++ include/exec/memory.h | 4 ++-- memory.c | 4 ++-- 3 files changed, 57 insertions(+), 8 deletions(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index

[Qemu-devel] [PATCH V4 0/4] introduce coalesced pio support

2018-08-24 Thread Peng Hao
Coalesced pio is base on coalesced mmio and can be used for some port like rtc port, pci-host config port, virtio-pci config port and so on. Specially in case of rtc as coalesced pio, some versions of windows guest access rtc frequently because of rtc as system tick. guest access rtc like this:

[Qemu-devel] [PATCH V4 1/4] target-i386: introduce coalesced_pio kvm header update

2018-08-24 Thread Peng Hao
add coalesced_pio's struct and KVM_CAP_COALESCED_PIO header. Signed-off-by: Peng Hao --- accel/kvm/kvm-all.c | 4 ++-- linux-headers/linux/kvm.h | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index eb7db92..4a3909d

[Qemu-devel] [PATCH V4 4/4] target-i386: add i440fx 0xcf8 port as coalesced_pio

2018-08-24 Thread Peng Hao
Signed-off-by: Peng Hao --- hw/pci-host/piix.c | 4 1 file changed, 4 insertions(+) diff --git a/hw/pci-host/piix.c b/hw/pci-host/piix.c index 0e60834..da73743 100644 --- a/hw/pci-host/piix.c +++ b/hw/pci-host/piix.c @@ -327,6 +327,10 @@ static void i440fx_pcihost_realize(DeviceState *dev,

[Qemu-devel] [PATCH V4 3/4] target-i386: add rtc 0x70 port as coalesced_pio

2018-08-24 Thread Peng Hao
Signed-off-by: Peng Hao --- hw/timer/mc146818rtc.c | 8 1 file changed, 8 insertions(+) diff --git a/hw/timer/mc146818rtc.c b/hw/timer/mc146818rtc.c index 6f1f723..b19ef51 100644 --- a/hw/timer/mc146818rtc.c +++ b/hw/timer/mc146818rtc.c @@ -70,6 +70,7 @@ typedef struct RTCState {

Re: [Qemu-devel] [PULL 12/25] tests: Clean up string interpolation into QMP input (simple cases)

2018-08-24 Thread Eric Blake
On 08/16/2018 03:36 AM, Markus Armbruster wrote: When you build QMP input manually like this cmd = g_strdup_printf("{ 'execute': 'migrate'," "'arguments': { 'uri': '%s' } }", uri); rsp = qmp(cmd); g_free(cmd); you're

Re: [Qemu-devel] [PATCH] tests: vm: auto_install OpenBSD

2018-08-24 Thread Brad Smith
On 8/24/2018 10:46 AM, Peter Maydell wrote: On 24 August 2018 at 15:43, Daniel P. Berrangé wrote: On Fri, Aug 24, 2018 at 10:36:30AM -0400, Brad Smith wrote: I very much appreciate the effort to bump up to 6.3 as I was going to suggest doing that at some point. But bumping up to 6.3 at the

Re: [Qemu-devel] [PATCH] target/xtensa: convert to do_transaction_failed

2018-08-24 Thread Peter Maydell
On 24 August 2018 at 19:10, Max Filippov wrote: > Hi Peter, > > On Fri, Aug 24, 2018 at 10:56 AM, Peter Maydell > wrote: >> On 20 August 2018 at 03:31, Max Filippov wrote: >>> Signed-off-by: Max Filippov >>> --- >>> target/xtensa/cpu.c | 2 +- >>> target/xtensa/cpu.h | 7 ---

Re: [Qemu-devel] [PULL 00/12] Ui 20180823 v3 patches

2018-08-24 Thread Peter Maydell
On 23 August 2018 at 10:56, Gerd Hoffmann wrote: > The following changes since commit d0092d90eb546a8bbe9e9120426c189474123797: > > Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20180820' into > staging (2018-08-20 17:41:18 +0100) > > are available in the git repository at: > >

[Qemu-devel] [Bug 1788665] Re: Low 2D graphics performance with Windows 10 (1803) VGA passthrough VM using "Spectre" protection

2018-08-24 Thread Heiko Sieger
Thanks for your explanations - I thought so too. The new Intel microcode is applied, as you can see: dmesg | grep microcode [ 0.00] microcode: microcode updated early to revision 0x714, date = 2018-05-08 [ 2.810683] microcode: sig=0x206d7, pf=0x4, revision=0x714 [ 2.813340] microcode:

[Qemu-devel] [PATCH 5/7] target/mips: Add MXU instruction D16MAC

2018-08-24 Thread Craig Janeczek via Qemu-devel
Adds support for emulating the D16MAC instruction. Signed-off-by: Craig Janeczek --- target/mips/translate.c | 66 + 1 file changed, 66 insertions(+) diff --git a/target/mips/translate.c b/target/mips/translate.c index 64fc6089bb..221076711d 100644 ---

[Qemu-devel] [PATCH 7/7] target/mips: Add MXU instructions S32LDD and S32LDDR

2018-08-24 Thread Craig Janeczek via Qemu-devel
Adds support for emulating the S32LDD and S32LDDR MXU instructions. Signed-off-by: Craig Janeczek --- target/mips/translate.c | 44 + 1 file changed, 40 insertions(+), 4 deletions(-) diff --git a/target/mips/translate.c b/target/mips/translate.c index

[Qemu-devel] [PATCH 4/7] target/mips: Add MXU instruction D16MUL

2018-08-24 Thread Craig Janeczek via Qemu-devel
Adds support for emulating the D16MUL instruction. Signed-off-by: Craig Janeczek --- target/mips/translate.c | 55 - 1 file changed, 54 insertions(+), 1 deletion(-) diff --git a/target/mips/translate.c b/target/mips/translate.c index

[Qemu-devel] [PATCH 2/7] target/mips: Add MXU instructions S32I2M and S32M2I

2018-08-24 Thread Craig Janeczek via Qemu-devel
Adds support for emulating the S32I2M and S32M2I MXU instructions. Signed-off-by: Craig Janeczek --- target/mips/translate.c | 55 + 1 file changed, 55 insertions(+) diff --git a/target/mips/translate.c b/target/mips/translate.c index

[Qemu-devel] [PATCH 1/7] target/mips: Add MXU register support

2018-08-24 Thread Craig Janeczek via Qemu-devel
This commit makes the MXU registers and the helper functions for reading/writing to them. This is required for full MXU instruction support. Signed-off-by: Craig Janeczek --- target/mips/cpu.h | 1 + target/mips/translate.c | 30 ++ 2 files changed, 31

[Qemu-devel] [PATCH 3/7] target/mips: Add MXU instruction S8LDD

2018-08-24 Thread Craig Janeczek via Qemu-devel
Adds support for emulating the S8LDD MXU instruction. Signed-off-by: Craig Janeczek --- target/mips/translate.c | 82 - 1 file changed, 81 insertions(+), 1 deletion(-) diff --git a/target/mips/translate.c b/target/mips/translate.c index

[Qemu-devel] [PATCH 0/7] Add limited MXU instruction support

2018-08-24 Thread Craig Janeczek via Qemu-devel
This patch set begins to add MXU instruction support for mips emulation. The patches are split such that the register overhead is added first followed by a series of instructions. Craig Janeczek (7): target/mips: Add MXU register support target/mips: Add MXU instructions S32I2M and S32M2I

[Qemu-devel] [PATCH 6/7] target/mips: Add MXU instructions Q8MUL and Q8MULSU

2018-08-24 Thread Craig Janeczek via Qemu-devel
Adds support for emulating the Q8MUL and Q8MULSU instructions. Signed-off-by: Craig Janeczek --- target/mips/translate.c | 75 - 1 file changed, 74 insertions(+), 1 deletion(-) diff --git a/target/mips/translate.c b/target/mips/translate.c index

[Qemu-devel] [PATCH] spapr: fix leak of rev array

2018-08-24 Thread Emilio G. Cota
Introduced in 04d595b300 ("spapr: do not use CPU_FOREACH_REVERSE", 2018-08-23) Fixes: CID1395181 Reported-by: Peter Maydell Signed-off-by: Emilio G. Cota --- hw/ppc/spapr.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 4edb6c7d16..505d4c84e5 100644

[Qemu-devel] [PULL 55/58] json: Keep interpolation state in JSONParserContext

2018-08-24 Thread Markus Armbruster
The recursive descent parser passes along a pointer to JSONParserContext. It additionally passes a pointer to interpolation state (a va_alist *) as needed to reach its consumer parse_interpolation(). Stuffing the latter pointer into JSONParserContext saves us the trouble of passing it along, so

Re: [Qemu-devel] [PULL 45/74] spapr: do not use CPU_FOREACH_REVERSE

2018-08-24 Thread Emilio G. Cota
On Fri, Aug 24, 2018 at 16:20:24 +0100, Peter Maydell wrote: (snip) > Hi -- Coverity points out in CID1395181 that this introduces > a memory leak -- we allocate memory into the rev pointer > with g_renew(), but we never free it before leaving the function. Thanks for the heads up; fix

[Qemu-devel] [PULL 56/58] json: Improve safety of qobject_from_jsonf_nofail() & friends

2018-08-24 Thread Markus Armbruster
The JSON parser optionally supports interpolation. This is used to build QObjects by parsing string templates. The templates are C literals, so parse errors (such as invalid interpolation specifications) are actually programming errors. Consequently, the functions providing parsing with

[Qemu-devel] [PULL 47/58] qjson: Have qobject_from_json() & friends reject empty and blank

2018-08-24 Thread Markus Armbruster
The last case where qobject_from_json() & friends return null without setting an error is empty or blank input. Callers: * block.c's parse_json_protocol() reports "Could not parse the JSON options". It's marked as a work-around, because it also covered actual bugs, but they got fixed in the

[Qemu-devel] [PULL 52/58] qobject: Drop superfluous includes of qemu-common.h

2018-08-24 Thread Markus Armbruster
Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Message-Id: <20180823164025.12553-53-arm...@redhat.com> --- include/qapi/qmp/json-parser.h | 1 - qobject/json-lexer.c | 1 - qobject/json-streamer.c| 1 - qobject/qbool.c| 1 - qobject/qlist.c

[Qemu-devel] [PULL 53/58] json: Clean up headers

2018-08-24 Thread Markus Armbruster
The JSON parser has three public headers, json-lexer.h, json-parser.h, json-streamer.h. They all contain stuff that is of no interest outside qobject/json-*.c. Collect the public interface in include/qapi/qmp/json-parser.h, and everything else in qobject/json-parser-int.h. Signed-off-by: Markus

[Qemu-devel] [PULL 45/58] json: Fix streamer not to ignore trailing unterminated structures

2018-08-24 Thread Markus Armbruster
json_message_process_token() accumulates tokens until it got the sequence of tokens that comprise a single JSON value (it counts curly braces and square brackets to decide). It feeds those token sequences to json_parser_parse(). If a non-empty sequence of tokens remains at the end of the parse,

[Qemu-devel] [PULL 41/58] json: Replace %I64d, %I64u by %PRId64, %PRIu64

2018-08-24 Thread Markus Armbruster
Support for %I64d got added in commit 2c0d4b36e7f "json: fix PRId64 on Win32". We had to hard-code I64d because we used the lexer's finite state machine to check interpolations. No more, so clean this up. Additional conversion specifications would be easy enough to implement when needed.

[Qemu-devel] [PULL 44/58] json: Fix latent parser aborts at end of input

2018-08-24 Thread Markus Armbruster
json-parser.c carefully reports end of input like this: token = parser_context_pop_token(ctxt); if (token == NULL) { parse_error(ctxt, NULL, "premature EOI"); goto out; } Except parser_context_pop_token() can't return null, it fails its assertion instead. Same for

[Qemu-devel] [PULL 51/58] json: Make JSONToken opaque outside json-parser.c

2018-08-24 Thread Markus Armbruster
Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Message-Id: <20180823164025.12553-52-arm...@redhat.com> --- include/qapi/qmp/json-parser.h | 4 include/qapi/qmp/json-streamer.h | 7 --- qobject/json-parser.c| 19 +++ qobject/json-streamer.c

[Qemu-devel] [PULL 36/58] json: Don't create JSON_ERROR tokens that won't be used

2018-08-24 Thread Markus Armbruster
Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Message-Id: <20180823164025.12553-37-arm...@redhat.com> --- qobject/json-streamer.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/qobject/json-streamer.c b/qobject/json-streamer.c index 0c33186e8e..fa595a8761

[Qemu-devel] [PULL 38/58] json: Treat unwanted interpolation as lexical error

2018-08-24 Thread Markus Armbruster
The JSON parser optionally supports interpolation. The lexer recognizes interpolation tokens unconditionally. The parser rejects them when interpolation is disabled, in parse_interpolation(). However, it neglects to set an error then, which can make json_parser_parse() fail without setting an

[Qemu-devel] [PULL 49/58] json: Streamline json_message_process_token()

2018-08-24 Thread Markus Armbruster
Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Message-Id: <20180823164025.12553-50-arm...@redhat.com> --- qobject/json-streamer.c | 13 + 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/qobject/json-streamer.c b/qobject/json-streamer.c index

[Qemu-devel] [PULL 46/58] json: Assert json_parser_parse() consumes all tokens on success

2018-08-24 Thread Markus Armbruster
Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Message-Id: <20180823164025.12553-47-arm...@redhat.com> --- qobject/json-parser.c | 1 + 1 file changed, 1 insertion(+) diff --git a/qobject/json-parser.c b/qobject/json-parser.c index e3ee2a273a..685e9dac24 100644 ---

[Qemu-devel] [PULL 57/58] json: Support %% in JSON strings when interpolating

2018-08-24 Thread Markus Armbruster
The previous commit makes JSON strings containing '%' awkward to express in templates: you'd have to mask the '%' with an Unicode escape \u0025. No template currently contains such JSON strings. Support the printf conversion specification %% in JSON strings as a convenience anyway, because it's

[Qemu-devel] [PULL 14/58] check-qjson: Fix utf8_string() to test all invalid sequences

2018-08-24 Thread Markus Armbruster
Some of utf8_string()'s test_cases[] contain multiple invalid sequences. Testing that qobject_from_json() fails only tests we reject at least one invalid sequence. That's incomplete. Additionally test each non-space sequence in isolation. This demonstrates that the JSON parser accepts invalid

[Qemu-devel] [PULL 58/58] json: Update references to RFC 7159 to RFC 8259

2018-08-24 Thread Markus Armbruster
RFC 8259 (December 2017) obsoletes RFC 7159 (March 2014). Signed-off-by: Markus Armbruster Message-Id: <20180823164025.12553-59-arm...@redhat.com> Reviewed-by: Eric Blake --- include/qapi/qmp/qnum.h | 2 +- qapi/introspect.json| 2 +- qobject/json-parser.c | 2 +- 3 files changed, 3

[Qemu-devel] [PULL 54/58] tests/drive_del-test: Fix harmless JSON interpolation bug

2018-08-24 Thread Markus Armbruster
test_after_failed_device_add() does this: response = qmp("{'execute': 'device_add'," " 'arguments': {" " 'driver': 'virtio-blk-%s'," " 'drive': 'drive0'" "}}", qvirtio_get_dev_type()); Wrong. An interpolation

[Qemu-devel] [PULL 48/58] json: Enforce token count and size limits more tightly

2018-08-24 Thread Markus Armbruster
Token count and size limits exist to guard against excessive heap usage. We check them only after we created the token on the heap. That's assigning a cowboy to the barn to lasso the horse after it has bolted. Close the barn door instead: check before we create the token. Signed-off-by: Markus

[Qemu-devel] [PULL 18/58] json: Reject unescaped control characters

2018-08-24 Thread Markus Armbruster
Fix the lexer to reject unescaped control characters in JSON strings, in accordance with RFC 8259 "The JavaScript Object Notation (JSON) Data Interchange Format". Bonus: we now recover more nicely from unclosed strings. E.g. {"one: 1}\n{"two": 2} now recovers cleanly after the newline,

[Qemu-devel] [PULL 22/58] json: Reject invalid UTF-8 sequences

2018-08-24 Thread Markus Armbruster
We reject bytes that can't occur in valid UTF-8 (\xC0..\xC1, \xF5..\xFF in the lexer. That's insufficient; there's plenty of invalid UTF-8 not containing these bytes, as demonstrated by check-qjson: * Malformed sequences - Unexpected continuation bytes - Missing continuation bytes after

[Qemu-devel] [PULL 50/58] json: Unbox tokens queue in JSONMessageParser

2018-08-24 Thread Markus Armbruster
Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Message-Id: <20180823164025.12553-51-arm...@redhat.com> --- include/qapi/qmp/json-streamer.h | 2 +- qobject/json-parser.c| 1 - qobject/json-streamer.c | 30 +++--- 3 files changed, 12

[Qemu-devel] [PULL 43/58] qjson: Fix qobject_from_json() & friends for multiple values

2018-08-24 Thread Markus Armbruster
qobject_from_json() & friends use the consume_json() callback to receive either a value or an error from the parser. When they are fed a string that contains more than either one JSON value or one JSON syntax error, consume_json() gets called multiple times. When the last call receives a value,

[Qemu-devel] [PULL 27/58] json: Simplify parse_string()

2018-08-24 Thread Markus Armbruster
Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Message-Id: <20180823164025.12553-28-arm...@redhat.com> --- qobject/json-parser.c | 42 +++--- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/qobject/json-parser.c

[Qemu-devel] [PULL 40/58] json: Leave rejecting invalid interpolation to parser

2018-08-24 Thread Markus Armbruster
Both lexer and parser reject invalid interpolation specifications. The parser's check is useless. The lexer ends the token right after the first bad character. This tends to lead to suboptimal error reporting. For instance, input [ %04d ] produces the tokens JSON_LSQUARE [

Re: [Qemu-devel] [PATCH v3 06/58] qmp-test: Cover syntax and lexical errors

2018-08-24 Thread Markus Armbruster
Eric Blake writes: > On 08/23/2018 11:39 AM, Markus Armbruster wrote: >> qmp-test neglects to cover QMP input that isn't valid JSON. libqtest >> doesn't let us such input. Add qtest_qmp_send_raw() for this purpose, > > s/us/us send/ Fixed in my pull request. Thanks!

[Qemu-devel] [PULL 42/58] json: Improve names of lexer states related to numbers

2018-08-24 Thread Markus Armbruster
Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Message-Id: <20180823164025.12553-43-arm...@redhat.com> --- qobject/json-lexer.c | 34 +- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/qobject/json-lexer.c b/qobject/json-lexer.c index

[Qemu-devel] [PULL 26/58] json: Leave rejecting invalid escape sequences to parser

2018-08-24 Thread Markus Armbruster
Both lexer and parser reject invalid escape sequences in strings. The parser's check is useless. The lexer ends the token right after the first non-well-formed byte. This tends to lead to suboptimal error reporting. For instance, input {"abc\@ijk": 1} produces the tokens JSON_LCURLY

[Qemu-devel] [PULL 24/58] json: Leave rejecting invalid UTF-8 to parser

2018-08-24 Thread Markus Armbruster
Both the lexer and the parser (attempt to) validate UTF-8 in JSON strings. The lexer rejects bytes that can't occur in valid UTF-8: \xC0..\xC1, \xF5..\xFF. This rejects some, but not all invalid UTF-8. It also rejects ASCII control characters \x00..\x1F, in accordance with RFC 8259 (see recent

[Qemu-devel] [PULL 19/58] json: Revamp lexer documentation

2018-08-24 Thread Markus Armbruster
Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Message-Id: <20180823164025.12553-20-arm...@redhat.com> --- qobject/json-lexer.c | 80 +++- 1 file changed, 71 insertions(+), 9 deletions(-) diff --git a/qobject/json-lexer.c b/qobject/json-lexer.c

[Qemu-devel] [PULL 05/58] qmp-cmd-test: Split off qmp-test

2018-08-24 Thread Markus Armbruster
qmp-test is for QMP protocol tests. Commit e4a426e75ef added generic, basic tests of query commands to it. Move them to their own test program qmp-cmd-test, to keep qmp-test focused on the protocol. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Message-Id:

[Qemu-devel] [PULL 23/58] json: Report first rather than last parse error

2018-08-24 Thread Markus Armbruster
Quiz time! When a parser reports multiple errors, but the user gets to see just one, which one is (on average) the least useful one? Yes, you're right, it's the last one! You're clearly familiar with compilers. Which one does QEMU report? Right again, the last one! You're clearly familiar

[Qemu-devel] [PULL 21/58] check-qjson: Document we expect invalid UTF-8 to be rejected

2018-08-24 Thread Markus Armbruster
The JSON parser rejects some invalid sequences, but accepts others without correcting the problem. We should either reject all invalid sequences, or minimize overlong sequences and replace all other invalid sequences by a suitable replacement character. A common choice for replacement is U+FFFD.

[Qemu-devel] [PULL 35/58] json: Don't pass null @tokens to json_parser_parse()

2018-08-24 Thread Markus Armbruster
json_parser_parse() normally returns the QObject on success. Except it returns null when its @tokens argument is null. Its only caller json_message_process_token() passes null @tokens when emitting a lexical error. The call is a rather opaque way to say json = NULL then. Simplify matters by

[Qemu-devel] [PULL 29/58] json: Fix \uXXXX for surrogate pairs

2018-08-24 Thread Markus Armbruster
The JSON parser treats each half of a surrogate pair as unpaired surrogate. Fix it to recognize surrogate pairs. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Message-Id: <20180823164025.12553-30-arm...@redhat.com> --- qobject/json-parser.c | 60

[Qemu-devel] [PULL 10/58] check-qjson: Cover escaped characters more thoroughly, part 2

2018-08-24 Thread Markus Armbruster
Cover escaped single quote, surrogates, invalid escapes, and noncharacters. This demonstrates that valid surrogate pairs are misinterpreted, and invalid surrogates and noncharacters aren't rejected. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Message-Id:

[Qemu-devel] [PULL 34/58] json: Redesign the callback to consume JSON values

2018-08-24 Thread Markus Armbruster
The classical way to structure parser and lexer is to have the client call the parser to get an abstract syntax tree, the parser call the lexer to get the next token, and the lexer call some function to get input characters. Another way to structure them would be to have the client feed

[Qemu-devel] [PULL 32/58] json-parser: simplify and avoid JSONParserContext allocation

2018-08-24 Thread Markus Armbruster
From: 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 Message-Id: <20180719184111.5129-9-marcandre.lur...@redhat.com> Reviewed-by: Markus Armbruster Message-Id:

[Qemu-devel] [PULL 31/58] json: remove useless return value from lexer/parser

2018-08-24 Thread Markus Armbruster
From: Marc-André Lureau The lexer always returns 0 when char feeding. Furthermore, none of the caller care about the return value. Signed-off-by: Marc-André Lureau Message-Id: <20180326150916.9602-10-marcandre.lur...@redhat.com> Reviewed-by: Markus Armbruster Reviewed-by: Thomas Huth

[Qemu-devel] [PULL 15/58] check-qjson qmp-test: Cover control characters more thoroughly

2018-08-24 Thread Markus Armbruster
RFC 8259 "The JavaScript Object Notation (JSON) Data Interchange Format" requires control characters in strings to be escaped. Demonstrate the JSON parser accepts U+0001 .. U+001F unescaped. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Message-Id:

[Qemu-devel] [PULL 39/58] json: Pass lexical errors and limit violations to callback

2018-08-24 Thread Markus Armbruster
The callback to consume JSON values takes QObject *json, Error *err. If both are null, the callback is supposed to make up an error by itself. This sucks. qjson.c's consume_json() neglects to do so, which makes qobject_from_json() null instead of failing. I consider that a bug. The culprit is

[Qemu-devel] [PULL 08/58] check-qjson: Cover escaped characters more thoroughly, part 1

2018-08-24 Thread Markus Armbruster
escaped_string() first tests double quoted strings, then repeats a few tests with single quotes. Repeat all of them: store the strings to test without quotes, and wrap them in either kind of quote for testing. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Message-Id:

[Qemu-devel] [PULL 13/58] check-qjson: Simplify utf8_string()

2018-08-24 Thread Markus Armbruster
The previous commit made utf8_string()'s test_cases[].utf8_in superfluous: we can use .json_in instead. Except for the case testing U+. \x00 doesn't work in C strings, so it tests \\u instead. But testing \\u is escaped_string()'s job. It's covered there. Test U+0001 here, and drop

[Qemu-devel] [PULL 28/58] json: Reject invalid \uXXXX, fix \u0000

2018-08-24 Thread Markus Armbruster
The JSON parser translates invalid \u to garbage instead of rejecting it, and swallows \u. Fix by using mod_utf8_encode() instead of flawed wchar_to_utf8(). Valid surrogate pairs are now differently broken: they're rejected instead of translated to garbage. The next commit will fix

[Qemu-devel] [PULL 37/58] json: Rename token JSON_ESCAPE & friends to JSON_INTERP

2018-08-24 Thread Markus Armbruster
The JSON parser optionally supports interpolation. The code calls it "escape". Awkward, because it uses the same term for escape sequences within strings. The latter usage is consistent with RFC 8259 "The JavaScript Object Notation (JSON) Data Interchange Format" and ISO C. Call the former

[Qemu-devel] [PULL 20/58] json: Tighten and simplify qstring_from_escaped_str()'s loop

2018-08-24 Thread Markus Armbruster
Simplify loop control, and assert that the string ends with the appropriate quote (the lexer ensures it does). Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Message-Id: <20180823164025.12553-21-arm...@redhat.com> --- qobject/json-parser.c | 30 +++--- 1 file

[Qemu-devel] [PULL 01/58] docs/interop/qmp-spec: How to force known good parser state

2018-08-24 Thread Markus Armbruster
Section "QGA Synchronization" specifies that sending "a raw 0xFF sentinel byte" makes the server "reset its state and discard all pending data prior to the sentinel." What actually happens there is a lexical error, which will produce one or more error responses. Moreover, it's not specific to

[Qemu-devel] [PULL 16/58] check-qjson: Cover interpolation more thoroughly

2018-08-24 Thread Markus Armbruster
Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Message-Id: <20180823164025.12553-17-arm...@redhat.com> --- tests/check-qjson.c | 166 +++- 1 file changed, 102 insertions(+), 64 deletions(-) diff --git a/tests/check-qjson.c b/tests/check-qjson.c

[Qemu-devel] [PULL 30/58] check-qjson: Fix and enable utf8_string()'s disabled part

2018-08-24 Thread Markus Armbruster
Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Message-Id: <20180823164025.12553-31-arm...@redhat.com> --- tests/check-qjson.c | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/tests/check-qjson.c b/tests/check-qjson.c index 343f8af36a..defc21fa04 100644

[Qemu-devel] [PULL 33/58] json: Have lexer call streamer directly

2018-08-24 Thread Markus Armbruster
json_lexer_init() takes the function to process a token as an argument. It's always json_message_process_token(). Makes the code harder to understand for no actual gain. Drop the indirection. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Message-Id:

[Qemu-devel] [PULL 09/58] check-qjson: Streamline escaped_string()'s test strings

2018-08-24 Thread Markus Armbruster
Merge a few closely related test strings, and drop a few redundant ones. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Message-Id: <20180823164025.12553-10-arm...@redhat.com> --- tests/check-qjson.c | 12 +--- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git

[Qemu-devel] [PULL 12/58] check-qjson: Cover UTF-8 in single quoted strings

2018-08-24 Thread Markus Armbruster
utf8_string() tests only double quoted strings. Cover single quoted strings, too: store the strings to test without quotes, then wrap them in either kind of quote. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Message-Id: <20180823164025.12553-13-arm...@redhat.com> ---

[Qemu-devel] [PULL 11/58] check-qjson: Consolidate partly redundant string tests

2018-08-24 Thread Markus Armbruster
simple_string() and single_quote_string() have become redundant with escaped_string(), except for embedded single and double quotes. Replace them by a test that covers just that. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Message-Id: <20180823164025.12553-12-arm...@redhat.com> ---

[Qemu-devel] [PULL 00/58] QObject patches for 2018-08-24

2018-08-24 Thread Markus Armbruster
The following changes since commit 1dfb85a8755096beecf182a617493d539259cbea: Merge remote-tracking branch 'remotes/juanquintela/tags/check/20180822' into staging (2018-08-24 14:46:31 +0100) are available in the Git repository at: git://repo.or.cz/qemu/armbru.git

[Qemu-devel] [PULL 06/58] qmp-test: Cover syntax and lexical errors

2018-08-24 Thread Markus Armbruster
qmp-test neglects to cover QMP input that isn't valid JSON. libqtest doesn't let us send such input. Add qtest_qmp_send_raw() for this purpose, and put it to use in qmp-test. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Message-Id: <20180823164025.12553-7-arm...@redhat.com>

[Qemu-devel] [PULL 02/58] check-qjson: Cover multiple JSON objects in same string

2018-08-24 Thread Markus Armbruster
qobject_from_json() & friends misbehave when the JSON text has more than one JSON value. Add test coverage to demonstrate the bugs. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Message-Id: <20180823164025.12553-3-arm...@redhat.com> --- tests/check-qjson.c | 20

[Qemu-devel] [PULL 25/58] json: Accept overlong \xC0\x80 as U+0000 ("modified UTF-8")

2018-08-24 Thread Markus Armbruster
Since the JSON grammer doesn't accept U+ anywhere, this merely exchanges one kind of parse error for another. It's purely for consistency with qobject_to_json(), which accepts \xC0\x80 (see commit e2ec3f97680). Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Message-Id:

[Qemu-devel] [PULL 04/58] check-qjson: Cover whitespace more thoroughly

2018-08-24 Thread Markus Armbruster
Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Message-Id: <20180823164025.12553-5-arm...@redhat.com> --- tests/check-qjson.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/check-qjson.c b/tests/check-qjson.c index 4daadc272b..188f683317 100644 ---

[Qemu-devel] [PULL 03/58] check-qjson: Cover blank and lexically erroneous input

2018-08-24 Thread Markus Armbruster
qobject_from_json() can return null without setting an error on lexical errors. I call that a bug. Add test coverage to demonstrate it. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Message-Id: <20180823164025.12553-4-arm...@redhat.com> --- tests/check-qjson.c | 40

[Qemu-devel] [PULL 17/58] json: Fix lexer to include the bad character in JSON_ERROR token

2018-08-24 Thread Markus Armbruster
json_lexer[] maps (lexer state, input character) to the new lexer state. The input character is consumed unless the new state is terminal and the input character doesn't belong to this token, i.e. the state transition uses look-ahead. When this is the case, input character '\0' would result in

[Qemu-devel] [PULL 07/58] test-qga: Clean up how we test QGA synchronization

2018-08-24 Thread Markus Armbruster
To permit recovering from arbitrary JSON parse errors, the JSON parser resets itself on lexical errors. We recommend sending a 0xff byte for that purpose, and test-qga covers this usage since commit 5229564b832. That commit had to add an ugly hack to qmp_fd_vsend() to make capable of sending this

Re: [Qemu-devel] [PATCH] target/xtensa: convert to do_transaction_failed

2018-08-24 Thread Max Filippov
Hi Peter, On Fri, Aug 24, 2018 at 10:56 AM, Peter Maydell wrote: > On 20 August 2018 at 03:31, Max Filippov wrote: >> Signed-off-by: Max Filippov >> --- >> target/xtensa/cpu.c | 2 +- >> target/xtensa/cpu.h | 7 --- >> target/xtensa/op_helper.c | 12 +++- >> 3 files

Re: [Qemu-devel] [PULL 0/1] 9p patches 2018-08-22

2018-08-24 Thread Peter Maydell
On 22 August 2018 at 15:43, Greg Kurz wrote: > The following changes since commit 13b7b188501d419a7d63c016e00065bcc693b7d4: > > Merge remote-tracking branch > 'remotes/kraxel/tags/vga-20180821-pull-request' into staging (2018-08-21 > 15:57:56 +0100) > > are available in the Git repository at:

Re: [Qemu-devel] [PATCH] target/xtensa: convert to do_transaction_failed

2018-08-24 Thread Peter Maydell
On 20 August 2018 at 03:31, Max Filippov wrote: > Signed-off-by: Max Filippov > --- > target/xtensa/cpu.c | 2 +- > target/xtensa/cpu.h | 7 --- > target/xtensa/op_helper.c | 12 +++- > 3 files changed, 12 insertions(+), 9 deletions(-) Hi -- thanks for doing this

[Qemu-devel] [PULL 0/5] target/xtensa updates

2018-08-24 Thread Max Filippov
repository at: git://github.com/OSLL/qemu-xtensa.git tags/20180824-xtensa for you to fetch changes up to 4e16a9cad82be9caa8d58a5c5c99cb5fa15ee833: tests/tcg/xtensa: add test for failed memory transactions (2018-08-19 20:21:50 -0700

Re: [Qemu-devel] usage of mremap in pvrdma break FreeBSD build

2018-08-24 Thread Roger Pau Monné
On Fri, Aug 24, 2018 at 07:49:01PM +0300, Marcel Apfelbaum wrote: > Hi Roger, > > > On 08/24/2018 06:58 PM, Roger Pau Monné wrote: > > Hello, > > > > The usage of mremap in the pvrdma code breaks the build on FreeBSD: > > > > /root/src/xen/tools/qemu-xen-dir/hw/rdma/vmw/pvrdma_cmd.c:60:17:

Re: [Qemu-devel] [PULL 4/7] hostmem-file: add the 'pmem' option

2018-08-24 Thread Michael S. Tsirkin
On Fri, Aug 24, 2018 at 05:57:06PM +0100, Peter Maydell wrote: > On 24 August 2018 at 17:53, Michael S. Tsirkin wrote: > > On Fri, Aug 24, 2018 at 04:13:18PM +0100, Peter Maydell wrote: > >> object_get_canonical_path_component() returns a string which > >> must be freed using g_free(). > > >

[Qemu-devel] [Bug 1788665] Re: Low 2D graphics performance with Windows 10 (1803) VGA passthrough VM using "Spectre" protection

2018-08-24 Thread Daniel Berrange
You're mis-understanding how microcode works a little. Microcode is loaded into physical CPUs in the host. This affects everything that runs on these CPUs thereafter. A KVM guest is merely a process running on the host CPUs, so it is affected by the updated microcode. There is no notion of the

[Qemu-devel] [PATCH 3/3] docs/devel/memory.txt: Document _with_attrs accessors

2018-08-24 Thread Peter Maydell
When we added the _with_attrs accessors we forgot to mention them in the documentation. Signed-off-by: Peter Maydell --- docs/devel/memory.txt | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/docs/devel/memory.txt b/docs/devel/memory.txt index

[Qemu-devel] [PATCH 0/3] Drop old_mmio accessor support

2018-08-24 Thread Peter Maydell
Hi; this patchset removes support for the old_mmio accessors from the memory core code, now that we have fixed all the devices that were using it. Patch 1 does that removal. Patch 2 fixes up a wart in fw_cfg that was only needed while we had the old_mmio accessors (spotted because of the comment

[Qemu-devel] [PATCH 2/3] hw/nvram/fw_cfg: Use memberwise copy of MemoryRegionOps struct

2018-08-24 Thread Peter Maydell
We've now removed the 'old_mmio' member from MemoryRegionOps, so we can perform the copy as a simple struct copy rather than having to do it via a memberwise copy. Signed-off-by: Peter Maydell --- hw/nvram/fw_cfg.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git

Re: [Qemu-devel] [PULL 00/20] Migration pull requset

2018-08-24 Thread Peter Maydell
On 22 August 2018 at 13:00, Juan Quintela wrote: > The following changes since commit 13b7b188501d419a7d63c016e00065bcc693b7d4: > > Merge remote-tracking branch > 'remotes/kraxel/tags/vga-20180821-pull-request' into staging (2018-08-21 > 15:57:56 +0100) > > are available in the Git repository

[Qemu-devel] [PATCH 1/3] memory: Remove old_mmio accessors

2018-08-24 Thread Peter Maydell
Now that all the users of old_mmio MemoryRegion accessors have been converted, we can remove the core code support. Signed-off-by: Peter Maydell --- docs/devel/memory.txt | 2 -- include/exec/memory.h | 5 memory.c | 64 ++- 3 files

Re: [Qemu-devel] [PULL 25/26] spapr_pci: factorize the use of SPAPR_MACHINE_GET_CLASS()

2018-08-24 Thread Cédric Le Goater
On 08/24/2018 05:38 PM, Greg Kurz wrote: > On Fri, 24 Aug 2018 17:30:12 +0200 > Cédric Le Goater wrote: > >> On 08/24/2018 05:09 PM, Peter Maydell wrote: >>> On 21 August 2018 at 05:33, David Gibson >>> wrote: From: Cédric Le Goater It should save us some CPU cycles as these

Re: [Qemu-devel] [PULL 4/7] hostmem-file: add the 'pmem' option

2018-08-24 Thread Peter Maydell
On 24 August 2018 at 17:53, Michael S. Tsirkin wrote: > On Fri, Aug 24, 2018 at 04:13:18PM +0100, Peter Maydell wrote: >> object_get_canonical_path_component() returns a string which >> must be freed using g_free(). > Like the following? Junyan, could you pls try this one and confirm? > >

Re: [Qemu-devel] [PATCH] spapr_pci: fix potential NULL pointer dereference

2018-08-24 Thread Cédric Le Goater
On 08/24/2018 05:30 PM, Greg Kurz wrote: > Commit 2c88b098e76fd added a call to SPAPR_MACHINE_GET_CLASS(spapr) in > spapr_phb_realize() before we check spapr isn't NULL. This causes QEMU > to crash when starting a non-pseries machine with a sPAPR PHB. > > This could be fixed by setting the smc

Re: [Qemu-devel] usage of mremap in pvrdma break FreeBSD build

2018-08-24 Thread Marcel Apfelbaum
Hi Roger, On 08/24/2018 06:58 PM, Roger Pau Monné wrote: Hello, The usage of mremap in the pvrdma code breaks the build on FreeBSD: /root/src/xen/tools/qemu-xen-dir/hw/rdma/vmw/pvrdma_cmd.c:60:17: warning: implicit declaration of function 'mremap' is invalid in C99

Re: [Qemu-devel] [PULL 4/7] hostmem-file: add the 'pmem' option

2018-08-24 Thread Michael S. Tsirkin
On Fri, Aug 24, 2018 at 04:13:18PM +0100, Peter Maydell wrote: > On 20 August 2018 at 21:24, Michael S. Tsirkin wrote: > > From: Junyan He > > > > When QEMU emulates vNVDIMM labels and migrates vNVDIMM devices, it > > needs to know whether the backend storage is a real persistent memory, > > in

Re: [Qemu-devel] [PATCH v3 2/2] hw/pci: add PCI resource reserve capability to legacy PCI bridge

2018-08-24 Thread Marcel Apfelbaum
Hi Jing, On 08/24/2018 05:27 AM, Liu, Jing2 wrote: Hi Marcel, On 8/22/2018 2:58 PM, Marcel Apfelbaum wrote: Hi Jing, On 08/22/2018 04:53 AM, Liu, Jing2 wrote: Hi Marcel, On 8/21/2018 5:59 PM, Marcel Apfelbaum wrote: On 08/21/2018 06:18 AM, Jing Liu wrote: Add hint to firmware (e.g.

[Qemu-devel] [Bug 1788665] Re: Low 2D graphics performance with Windows 10 (1803) VGA passthrough VM using "Spectre" protection

2018-08-24 Thread Heiko Sieger
Thanks for the reply. I understand that the CPU features are exposed. However, is the host-side Intel microcode exposed to the guest? Here is my qemu command: qemu-system-x86_64 \ -runas user \ -monitor stdio \ -serial none \ -parallel none \ -nodefaults \ -nodefconfig \ -name

  1   2   3   >