[Qemu-devel] [Bug 1790260] [NEW] binfmt support not working for x86 host and x86_64 guest

2018-08-31 Thread elypter via Qemu-devel
Public bug reported: this is a problem in the qemu-binfmt-conf.sh script and maybe somewhere else. the version i checked is the current github mirror https://github.com/qemu/qemu/blob/master/scripts/qemu-binfmt-conf.sh i am running linux mint 19 32bit on a 32bit x86 cpu and i want to run some app

[Qemu-devel] [Bug 1790268] Re: the vhd generated by qemu-img not align with MB again.

2018-08-31 Thread Andy
** Summary changed: - the vhd generated by qemu-img not align with MiB again. + the vhd generated by qemu-img not align with MB again. -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1790268 Title:

[Qemu-devel] [Bug 1790268] Re: the vhd generated by qemu-img not align with MiB again.

2018-08-31 Thread Andy
and even the format is raw: andy@bastion:~/temp$ qemu-img info papapa2.vhd image: papapa2.vhd file format: raw virtual size: 24M (25166336 bytes) disk size: 152K -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.

[Qemu-devel] [Bug 1790268] Re: the vhd generated by qemu-img not align with MiB again.

2018-08-31 Thread Andy
last bug report and fixed is https://bugs.launchpad.net/qemu/+bug/1490611 -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1790268 Title: the vhd generated by qemu-img not align with MiB again. Statu

[Qemu-devel] [Bug 1790268] [NEW] the vhd generated by qemu-img not align with MiB again.

2018-08-31 Thread Andy
Public bug reported: I'm using this version on xenial, andy@bastion:~/temp$ qemu-img -h qemu-img version 2.5.0 (Debian 1:2.5+dfsg-5ubuntu10.31), Copyright (c) 2004-2008 Fabrice Bellard steps to repro: dd if=/dev/zero of=/tmp/azure_config_disk_image20180901-22672-16zxelu bs=1048576 count=24 mkf

[Qemu-devel] [Bug 1490611] Re: Using qemu >=2.2.1 to convert raw->VHD (fixed) adds extra padding to the result file, which Microsoft Azure rejects as invalid

2018-08-31 Thread Andy
I'm using this version on xenial, andy@bastion:~/temp$ qemu-img -h qemu-img version 2.5.0 (Debian 1:2.5+dfsg-5ubuntu10.31), Copyright (c) 2004-2008 Fabrice Bellard qemu-img convert -f raw -O vpc -o subformat=fixed,force_size /tmp/azure_config_disk_image20180901-22672-16zxelu papapa2.vhd unfortun

[Qemu-devel] [PATCH V8 3/4] tests/migration: Add migration-test header file

2018-08-31 Thread Wei Huang
This patch moves the settings related migration-test from the migration-test.c file to a new header file. Signed-off-by: Wei Huang --- tests/migration-test.c | 28 ++-- tests/migration/migration-test.h | 21 + 2 files changed, 39 insertions(+

[Qemu-devel] [PATCH V8 2/4] tests/migration: Support cross compilation in generating boot header file

2018-08-31 Thread Wei Huang
Recently a new configure option, CROSS_CC_GUEST, was added to $(TARGET)-softmmu/config-target.mak to support TCG-related tests. This patch tries to leverage this option to support cross compilation when the migration boot block file is being re-generated: * The x86_64 related files are moved to a

[Qemu-devel] [PATCH V8 1/4] tests/migration: Convert x86 boot block compilation script into Makefile

2018-08-31 Thread Wei Huang
The x86 boot block header currently is generated with a shell script. To better support other CPUs (e.g. aarch64), we convert the script into Makefile. This allows us to 1) support cross-compilation easily, and 2) avoid creating a script file for every architecture. Note that, in the new design, t

[Qemu-devel] [PATCH V8 4/4] tests: Add migration test for aarch64

2018-08-31 Thread Wei Huang
This patch adds migration test support for aarch64. The test code, which implements the same functionality as x86, is booted as a kernel in qemu. Here are the design choices we make for aarch64: * We choose this -kernel approach because aarch64 QEMU doesn't provide a built-in fw like x86 does.

[Qemu-devel] [PATCH V8 0/4] tests: Add migration test for aarch64

2018-08-31 Thread Wei Huang
This patchset adds a migration test for aarch64. It leverages Dave Gilbert's migration boot block patches to create a new test case for aarch64. V7->V8: * Support cross compilation by searching for CROSS_CC_GUEST option, instead of using the find-cross-prefix defined in roms/Makefile * Use th

Re: [Qemu-devel] [PATCH v3 02/15] block/mirror: add block job creation flags

2018-08-31 Thread Jeff Cody
On Fri, Aug 31, 2018 at 06:28:54PM -0400, John Snow wrote: > Add support for taking and passing forward job creaton flags. > > Signed-off-by: John Snow > Reviewed-by: Max Reitz > --- > block/mirror.c| 5 +++-- > blockdev.c| 3 ++- > include/block/block_int.h | 5

Re: [Qemu-devel] [PATCH v3 03/15] block/stream: add block job creation flags

2018-08-31 Thread Jeff Cody
On Fri, Aug 31, 2018 at 06:28:55PM -0400, John Snow wrote: > Add support for taking and passing forward job creaton flags. > > Signed-off-by: John Snow > Reviewed-by: Max Reitz (with the misspelling that Eric pointed out fixed): Reviewed-by: Jeff Cody > --- > block/stream.c| 5 +

Re: [Qemu-devel] [PATCH v3 01/15] block/commit: add block job creation flags

2018-08-31 Thread Jeff Cody
On Fri, Aug 31, 2018 at 06:28:53PM -0400, John Snow wrote: > Add support for taking and passing forward job creation flags. > > Signed-off-by: John Snow > Reviewed-by: Max Reitz Reviewed-by: Jeff Cody > --- > block/commit.c| 5 +++-- > blockdev.c| 7 --- > inc

[Qemu-devel] [PATCH 1/2] tests/tcg/xtensa: move exception handlers to separate section

2018-08-31 Thread Max Filippov
Not all CPU configurations may have enough space for handler code between exception/interrupt vectors. Leave jumps to the handlers at the vectors, but move all handlers past the vectors area. Signed-off-by: Max Filippov --- tests/tcg/xtensa/linker.ld.S | 37 ++---

[Qemu-devel] [PATCH 0/2] tests/tcg/xtensa: exception vectors/handlers improvement

2018-08-31 Thread Max Filippov
Hello, this series generalizes xtensa test vectors and linker script a bit further: - it extracts exception/IRQ handlers from vectors, as not all core configurations have enough space between the vectors; - it conditionalizes vectors code, so that only handlers for configured IRQs and exceptio

[Qemu-devel] [PATCH 2/2] tests/tcg/xtensa: only generate defined exception handlers

2018-08-31 Thread Max Filippov
Don't generate handlers for IRQ levels that are not defined for the CPU or for window overflow/underflow exceptions for configs w/o windowed registers. Signed-off-by: Max Filippov --- tests/tcg/xtensa/vectors.S | 16 1 file changed, 16 insertions(+) diff --git a/tests/tcg/xtens

Re: [Qemu-devel] [PATCH] PC Chipset: Improve serial divisor calculation

2018-08-31 Thread Guenter Roeck
Hi, On Fri, May 11, 2018 at 06:05:44PM -0600, Calvin Lee wrote: > This fixes several problems I found in the UART serial implementation. > Now all divisor values are allowed, while before divisor values of zero > and below the base baud rate were rejected. All changes are in reference > to http://

Re: [Qemu-devel] [PATCH v10 3/6] tpm: allocate/map buffer for TPM Physical Presence interface

2018-08-31 Thread Marc-André Lureau
Hi On Fri, Aug 31, 2018 at 7:32 PM Marc-André Lureau wrote: > > From: Stefan Berger > > Implement a virtual memory device for the TPM Physical Presence interface. > The memory is located at 0xFED45000 and used by ACPI to send messages to the > firmware (BIOS) and by the firmware to provide param

Re: [Qemu-devel] [PATCH 00/11] aspeed: misc fixes and enhancements (SMC)

2018-08-31 Thread Joel Stanley
On Fri, 31 Aug 2018 at 03:38, Cédric Le Goater wrote: > > Hello, > > This series adds a couple of cleanups and two main features to the > Aspeed machines : > > - a 'mmio-exec' property to boot directly from a memory region alias >of the FMC flash module using MMIO execution. This is not activ

Re: [Qemu-devel] [PATCH v2 05/13] block/mirror: conservative mirror_exit refactor

2018-08-31 Thread John Snow
On 08/27/2018 08:47 AM, Max Reitz wrote: > On 2018-08-24 00:22, John Snow wrote: >> For purposes of minimum code movement, refactor the mirror_exit >> callback to use the post-finalization callbacks in a trivial way. >> >> Signed-off-by: John Snow >> --- >> block/mirror.c | 26

[Qemu-devel] [PATCH v3 00/15] jobs: Job Exit Refactoring Pt 2

2018-08-31 Thread John Snow
This is part two of a two part series that refactors the exit logic of jobs. This series forces all jobs to use the "finalize" semantics that were introduced previously, but only exposed via the backup jobs. Patches 1-3 add plumbing for the auto-dismiss and auto-finalize flags but do not expose t

[Qemu-devel] [PATCH v3 01/15] block/commit: add block job creation flags

2018-08-31 Thread John Snow
Add support for taking and passing forward job creation flags. Signed-off-by: John Snow Reviewed-by: Max Reitz --- block/commit.c| 5 +++-- blockdev.c| 7 --- include/block/block_int.h | 5 - 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/blo

[Qemu-devel] [PATCH v3 02/15] block/mirror: add block job creation flags

2018-08-31 Thread John Snow
Add support for taking and passing forward job creaton flags. Signed-off-by: John Snow Reviewed-by: Max Reitz --- block/mirror.c| 5 +++-- blockdev.c| 3 ++- include/block/block_int.h | 5 - 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/block/mir

Re: [Qemu-devel] [PATCH v2 0/3] target/riscv: use tcg_lookup_and_goto_ptr

2018-08-31 Thread Emilio G. Cota
On Fri, Aug 10, 2018 at 13:39:38 -0400, Emilio G. Cota wrote: > Changes wrt v1: changed patch 3 as suggested by Richard. Also > added his R-b's. > > You can fetch this series from: > https://github.com/cota/qemu/tree/riscv-lookup_ptr-v2 RISC-V maintainers: any plans of picking this up for 3.1?

[Qemu-devel] [PATCH v3 10/15] tests/test-blockjob-txn: move .exit to .clean

2018-08-31 Thread John Snow
The exit callback in this test actually only performs cleanup. Signed-off-by: John Snow --- tests/test-blockjob-txn.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test-blockjob-txn.c b/tests/test-blockjob-txn.c index ef29f35e44..86606f92b3 100644 --- a/tests/test

[Qemu-devel] [PATCH v3 06/15] block/mirror: conservative mirror_exit refactor

2018-08-31 Thread John Snow
For purposes of minimum code movement, refactor the mirror_exit callback to use the post-finalization callbacks in a trivial way. Signed-off-by: John Snow --- block/mirror.c | 31 +-- 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/block/mirror.c b/bloc

Re: [Qemu-devel] [PATCH v3 03/15] block/stream: add block job creation flags

2018-08-31 Thread Eric Blake
On 08/31/2018 05:28 PM, John Snow wrote: Add support for taking and passing forward job creaton flags. s/creaton/creation/ (here and in 2/15 as well) Signed-off-by: John Snow Reviewed-by: Max Reitz --- block/stream.c| 5 +++-- blockdev.c| 3 ++- include/bloc

[Qemu-devel] [PATCH v3 07/15] block/commit: refactor stream to use job callbacks

2018-08-31 Thread John Snow
Signed-off-by: John Snow Reviewed-by: Max Reitz --- block/stream.c | 23 +++ 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/block/stream.c b/block/stream.c index 700eb239e4..81a7ec8ece 100644 --- a/block/stream.c +++ b/block/stream.c @@ -54,16 +54,16 @@ static

[Qemu-devel] [PATCH v3 04/15] block/commit: refactor commit to use job callbacks

2018-08-31 Thread John Snow
Use the component callbacks; prepare, abort, and clean. NB: prepare is only called when the job has not yet failed; and abort can be called after prepare. complete -> prepare -> abort -> clean complete -> abort -> clean Signed-off-by: John Snow Reviewed-by: Max Reitz --- block/commit.c | 90 +

[Qemu-devel] [PATCH v3 12/15] qapi/block-commit: expose new job properties

2018-08-31 Thread John Snow
Signed-off-by: John Snow Reviewed-by: Max Reitz --- blockdev.c | 8 qapi/block-core.json | 16 +++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/blockdev.c b/blockdev.c index ec90eb1cf9..98b91e75a7 100644 --- a/blockdev.c +++ b/blockdev.c @@ -320

[Qemu-devel] [PATCH v3 09/15] tests/test-blockjob: remove exit callback

2018-08-31 Thread John Snow
We remove the exit callback and the completed boolean along with it. We can simulate it just fine by waiting for the job to defer to the main loop, and then giving it one final kick to get the main loop portion to run. Signed-off-by: John Snow Reviewed-by: Max Reitz --- tests/test-blockjob.c |

[Qemu-devel] [PATCH v3 14/15] qapi/block-stream: expose new job properties

2018-08-31 Thread John Snow
Signed-off-by: John Snow Reviewed-by: Max Reitz --- blockdev.c | 9 + hmp.c| 5 +++-- qapi/block-core.json | 16 +++- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/blockdev.c b/blockdev.c index 429cdf9901..0cf8febe6c 100644 --- a/

[Qemu-devel] [PATCH v3 03/15] block/stream: add block job creation flags

2018-08-31 Thread John Snow
Add support for taking and passing forward job creaton flags. Signed-off-by: John Snow Reviewed-by: Max Reitz --- block/stream.c| 5 +++-- blockdev.c| 3 ++- include/block/block_int.h | 5 - 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/block/str

[Qemu-devel] [PATCH v3 13/15] qapi/block-mirror: expose new job properties

2018-08-31 Thread John Snow
Signed-off-by: John Snow Reviewed-by: Max Reitz --- blockdev.c | 14 ++ qapi/block-core.json | 30 -- 2 files changed, 42 insertions(+), 2 deletions(-) diff --git a/blockdev.c b/blockdev.c index 98b91e75a7..429cdf9901 100644 --- a/blockdev.c +++

[Qemu-devel] [PATCH v3 08/15] tests/blockjob: replace Blockjob with Job

2018-08-31 Thread John Snow
These tests don't actually test blockjobs anymore, they test generic Job lifetimes. Change the types accordingly. Signed-off-by: John Snow Reviewed-by: Max Reitz --- tests/test-blockjob.c | 98 ++- 1 file changed, 50 insertions(+), 48 deletions(-)

[Qemu-devel] [PATCH v3 11/15] jobs: remove .exit callback

2018-08-31 Thread John Snow
Now that all of the jobs use the component finalization callbacks, there's no use for the heavy-hammer .exit callback anymore. job_exit becomes a glorified type shim so that we can call job_completed from aio_bh_schedule_oneshot. Move these three functions down into job.c to eliminate a forward r

[Qemu-devel] [PATCH v3 15/15] block/backup: qapi documentation fixup

2018-08-31 Thread John Snow
Fix documentation to match the other jobs amended for 3.1. Signed-off-by: John Snow Reviewed-by: Max Reitz --- qapi/block-core.json | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/qapi/block-core.json b/qapi/block-core.json index f877e9e414..c0b3d33dbb 10

[Qemu-devel] [PATCH v3 05/15] block/mirror: don't install backing chain on abort

2018-08-31 Thread John Snow
In cases where we abort the block/mirror job, there's no point in installing the new backing chain before we finish aborting. Move this to the "success" portion of mirror_exit. Signed-off-by: John Snow --- block/mirror.c | 27 ++- 1 file changed, 14 insertions(+), 13 del

[Qemu-devel] [PATCH v6 3/3] arm: Add BBC micro:bit machine

2018-08-31 Thread Joel Stanley
This adds the base for a machine model of the BBC micro:bit: https://en.wikipedia.org/wiki/Micro_Bit This is a system with a nRF51 SoC containing the main processor, with various peripherals on board. Reviewed-by: Stefan Hajnoczi Signed-off-by: Joel Stanley --- v2: - Instead of setting kern

[Qemu-devel] [PATCH v6 1/3] MAINTAINERS: Add NRF51 entry

2018-08-31 Thread Joel Stanley
This contains the NRF51, and the machine that uses it, the BBC micro:bit. Reviewed-by: Stefan Hajnoczi Reviewed-by: Peter Maydell Signed-off-by: Joel Stanley --- v3: fix spelling of mailing list add stefan's reviewed-by v6: Add Peter's reviewed-by --- MAINTAINERS | 8 1 file chan

[Qemu-devel] [PATCH v6 2/3] arm: Add Nordic Semiconductor nRF51 SoC

2018-08-31 Thread Joel Stanley
The nRF51 is a Cortex-M0 microcontroller with an on-board radio module, plus other common ARM SoC peripherals. http://infocenter.nordicsemi.com/pdf/nRF51_RM_v3.0.pdf This defines a basic model of the CPU and memory, with no peripherals implemented at this stage. Signed-off-by: Joel Stanley ---

[Qemu-devel] [PATCH v6 0/3] arm: Add nRF51 SoC and micro:bit machine

2018-08-31 Thread Joel Stanley
v6: Rework based on Peter's review v5: Change back to ARMv7M from ARMMProfile v4: Fix number of IRQs v3: Rebase on Stefan's cortex-m0 series v2: Addresses review from Peter and Stefan This short series implements a minimal definition of the Nordic Semiconductor nRF51, a Cortex-M0 ARM SoC, and the

Re: [Qemu-devel] [PATCH 3/4] cpus: protect TimerState writes with a spinlock

2018-08-31 Thread Emilio G. Cota
On Mon, Aug 20, 2018 at 17:09:02 +0200, Paolo Bonzini wrote: > In the next patch, we will need to write cpu_ticks_offset from any > thread, even outside the BQL. Currently, it is protected by the BQL > just because cpu_enable_ticks and cpu_disable_ticks happen to hold it, > but the critical sectio

Re: [Qemu-devel] [PATCH 1/4] cpus: protect all icount computation with seqlock

2018-08-31 Thread Emilio G. Cota
On Mon, Aug 20, 2018 at 17:09:00 +0200, Paolo Bonzini wrote: > Using the seqlock makes the atomic_read__nocheck safe, because it now > happens always inside a seqlock and any torn reads will be retried. Using a seqlock makes regular accesses safe as well, for the same reason. It's undefined behavi

Re: [Qemu-devel] [PATCH v2 00/11] convert CPU list to RCU

2018-08-31 Thread Emilio G. Cota
On Mon, Aug 20, 2018 at 11:30:07 +0200, Paolo Bonzini wrote: > On 19/08/2018 11:13, Emilio G. Cota wrote: > > - Add some fixes for test-rcu-list. I wanted to be able to get no > > races with ThreadSanitizer, but it still warns about two races. > > I'm appending the report just in case, but I th

[Qemu-devel] [Bug 1787505] Re: Solaris host: no network connection, mouse pointer mismatch

2018-08-31 Thread Michele Denber
Sorry about that. I didn't know where to ask about this. Anyway thank you for the explanation. That was the clue I needed. Instead of giving XP a gateway of 192.168.0.1 in the Networking TCP tab I just set gateway and DNS to automatic. Networking is all working fine now. This was the call: .

[Qemu-devel] [PATCH 2/2] doc: replace x-root with rootdir for usb-mtp

2018-08-31 Thread Bandan
Signed-off-by: Bandan --- qemu-doc.texi | 2 +- scripts/device-crash-test | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/qemu-doc.texi b/qemu-doc.texi index 7bd449f398..f7ad1dfe4b 100644 --- a/qemu-doc.texi +++ b/qemu-doc.texi @@ -943,7 +943,7 @@ for details B

[Qemu-devel] [PATCH 0/2] Misc usb-mtp fixes

2018-08-31 Thread Bandan
A documentation fix and changes to return the right error code on write failures. Bandan (2): usb-mtp: fix error conditions for write operation doc: replace x-root with rootdir for usb-mtp hw/usb/dev-mtp.c | 7 --- qemu-doc.texi | 2 +- scripts/device-crash-test | 2

[Qemu-devel] [PATCH 1/2] usb-mtp: fix error conditions for write operation

2018-08-31 Thread Bandan
Return STORE_FULL if we can't write all the bytes but return incomplete transfer if data received is less then what was specified in the metadata. Also, use d->offset as the file size which is valid for all file sizes. Signed-off-by: Bandan --- hw/usb/dev-mtp.c | 7 --- 1 file changed, 4 ins

Re: [Qemu-devel] [PATCH v4 2/9] target/mips: Add all MXU opcodes

2018-08-31 Thread Aleksandar Markovic
> > > From: Craig Janeczek > Sent: Thursday, August 30, 2018 9:30 PM > To: qemu-devel@nongnu.org > Cc: Aleksandar Markovic; aurel...@aurel32.net; Craig Janeczek > Subject: [PATCH v4 2/9] target/mips: Add all MXU opcodes > > Adds all MXU opcodes to the opc

Re: [Qemu-devel] [PATCH v4 3/9] target/mips: Split mips instruction handling

2018-08-31 Thread Aleksandar Markovic
Hi, Craig, > From: Craig Janeczek > Sent: Thursday, August 30, 2018 9:30 PM > To: qemu-devel@nongnu.org > Cc: Aleksandar Markovic; aurel...@aurel32.net; Craig Janeczek > Subject: [PATCH v4 3/9] target/mips: Split mips instruction handling > > Splits the instruction handling switch statement from

[Qemu-devel] [PATCH v3 6/8] block: dump_qlist() may dereference a Null pointer

2018-08-31 Thread Liam Merwick
A NULL 'list' passed into function dump_qlist() isn't correctly validated and can be passed to qlist_first() where it is dereferenced. Given that dump_qlist() is static, and callers already do the right thing, just add an assert to catch future potential bugs. Signed-off-by: Liam Merwick Reviewe

[Qemu-devel] [PATCH v3 8/8] qcow2: Read outside array bounds in qcow2_pre_write_overlap_check()

2018-08-31 Thread Liam Merwick
The commit for 0e4e4318eaa5 increments QCOW2_OL_MAX_BITNR but does not add an array entry for QCOW2_OL_BITMAP_DIRECTORY_BITNR to metadata_ol_names[]. As a result, an array dereference of metadata_ol_names[8] in qcow2_pre_write_overlap_check() could result in a read outside of the array bounds. Fi

[Qemu-devel] [PATCH v3 5/8] block: Fix potential Null pointer dereferences in vvfat.c

2018-08-31 Thread Liam Merwick
The calls to bdrv_new_open_driver(), find_mapping_for_cluster(), and array_get_next() may return NULL but it isn't always checked for before dereferencing the value returned. Signed-off-by: Liam Merwick Reviewed-by: Darren Kenny Reviewed-by: Mark Kanda --- block/vvfat.c | 56 ++

[Qemu-devel] [PATCH v3 7/8] io: potential unnecessary check in qio_channel_command_new_spawn()

2018-08-31 Thread Liam Merwick
In qio_channel_command_new_spawn() the 'flags' variable is checked to see if /dev/null should be used for stdin or stdout; first with O_RDONLY and then O_WRONLY. However the second check for O_WRONLY is only needed if flags != O_RDONLY and therefore should be an else if statement. This minor opti

[Qemu-devel] [PATCH v3 4/8] qemu-img: potential Null pointer deref in img_commit()

2018-08-31 Thread Liam Merwick
The function block_job_get() may return NULL so before dereferencing the 'job' pointer in img_commit() it should be checked. Signed-off-by: Liam Merwick Reviewed-by: Darren Kenny Reviewed-by: Mark Kanda --- qemu-img.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qemu-img.c b/qemu-img

[Qemu-devel] [PATCH v3 1/8] configure: Provide option to explicitly disable AVX2

2018-08-31 Thread Liam Merwick
The configure script detects if the compiler has AVX2 support and automatically sets avx2_opt="yes" which in turn defines CONFIG_AVX2_OPT. There is no way of explicitly overriding this setting so this commit adds two command-line options: --enable-avx2 and --disable-avx2. The default behaviour, wh

[Qemu-devel] [PATCH v3 0/8] off-by-one and NULL pointer accesses detected by static analysis

2018-08-31 Thread Liam Merwick
Below are a number of fixes to some off-by-one, read outside array bounds, and NULL pointer accesses detected by an internal Oracle static analysis tool (Parfait). https://labs.oracle.com/pls/apex/f?p=labs:49:P49_PROJECT_ID:13 I have also included a patch to add a command-line option to confi

[Qemu-devel] [PATCH v3 2/8] job: Fix off-by-one assert checks for JobSTT and JobVerbTable

2018-08-31 Thread Liam Merwick
In the assert checking the array dereference of JobVerbTable[verb] in job_apply_verb() the check of the index, verb, allows an overrun because an index equal to the array size is permitted. Similarly, in the assert check of JobSTT[s0][s1] with index s1 in job_state_transition(), an off-by-one over

[Qemu-devel] [PATCH v3 3/8] block: Null pointer dereference in blk_root_get_parent_desc()

2018-08-31 Thread Liam Merwick
The dev_id returned by the call to blk_get_attached_dev_id() in blk_root_get_parent_desc() can be NULL (an internal call to object_get_canonical_path may have returned NULL) so it should be checked before dereferencing. Signed-off-by: Liam Merwick Reviewed-by: Darren Kenny Reviewed-by: Mark Kand

Re: [Qemu-devel] [PATCH v2 8/8] qcow2: Read outside array bounds in qcow2_pre_write_overlap_check()

2018-08-31 Thread Liam Merwick
On 31/08/18 17:53, Eric Blake wrote: On 08/31/2018 11:36 AM, Liam Merwick wrote: The commit for 0e4e4318eaa5 increments QCOW2_OL_MAX_BITNR but does not add an array entry for QCOW2_OL_BITMAP_DIRECTORY_BITNR to metadata_ol_names[]. As a result, an array dereference of metadata_ol_names[8] in

[Qemu-devel] [PATCH v10 6/6] tpm: add ACPI memory clear interface

2018-08-31 Thread Marc-André Lureau
This allows to pass the last failing test from the Windows HLK TPM 2.0 TCG PPI 1.3 tests. The interface is described in the "TCG Platform Reset Attack Mitigation Specification", chapter 6 "ACPI _DSM Function". According to Laszlo, it's not so easy to implement in OVMF, he suggested to do it in qem

[Qemu-devel] [PATCH v10 3/6] tpm: allocate/map buffer for TPM Physical Presence interface

2018-08-31 Thread Marc-André Lureau
From: Stefan Berger Implement a virtual memory device for the TPM Physical Presence interface. The memory is located at 0xFED45000 and used by ACPI to send messages to the firmware (BIOS) and by the firmware to provide parameters for each one of the supported codes. This interface should be used

[Qemu-devel] [PATCH v10 2/6] tpm: add a "ppi" boolean property

2018-08-31 Thread Marc-André Lureau
The following patches implement the TPM Physical Presence Interface, make use of a new memory region and a fw_cfg entry. Enable PPI by default with >3.0 machine type, to avoid migration issues. Signed-off-by: Marc-André Lureau Reviewed-by: Igor Mammedov --- include/hw/compat.h | 11 ++-

[Qemu-devel] [PATCH v10 5/6] acpi: build TPM Physical Presence interface

2018-08-31 Thread Marc-André Lureau
From: Stefan Berger The TPM Physical Presence interface consists of an ACPI part, a shared memory part, and code in the firmware. Users can send messages to the firmware by writing a code into the shared memory through invoking the ACPI code. When a reboot happens, the firmware looks for the code

[Qemu-devel] [PATCH v10 4/6] acpi: expose TPM/PPI configuration parameters to firmware via fw_cfg

2018-08-31 Thread Marc-André Lureau
From: Stefan Berger To avoid having to hard code the base address of the PPI virtual memory device we introduce a fw_cfg file etc/tpm/config that holds the base address of the PPI device, the version of the PPI interface and the version of the attached TPM. Signed-off-by: Stefan Berger [ Marc-A

[Qemu-devel] [PATCH v10 1/6] hw/i386: add pc-i440fx-3.1 & pc-q35-3.1

2018-08-31 Thread Marc-André Lureau
The following patch is going to add compatiblity parameters. Signed-off-by: Marc-André Lureau --- include/hw/i386/pc.h | 5 - hw/i386/pc_piix.c| 15 --- hw/i386/pc_q35.c | 13 +++-- 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/include/hw/i386/p

[Qemu-devel] [PATCH v10 0/6] Add support for TPM Physical Presence interface

2018-08-31 Thread Marc-André Lureau
Hi, The following patches implement the TPM Physical Presence Interface that allows a user to set a command via ACPI (sysfs entry in Linux) that, upon the next reboot, the firmware looks for and acts upon by sending sequences of commands to the TPM. A dedicated memory region is added to the TPM C

Re: [Qemu-devel] [PATCH v2 1/2] memfd: fix possible usage of the uninitialized file descriptor

2018-08-31 Thread Thomas Huth
On 2018-06-13 10:19, Dima Stepanov wrote: > The qemu_memfd_alloc_check() routine allocates the fd variable on stack. > This variable is initialized inside the qemu_memfd_alloc() function. > There are several cases when *fd will be left unintialized which can > lead to the unexpected close() in the

Re: [Qemu-devel] [PATCH v2 8/8] qcow2: Read outside array bounds in qcow2_pre_write_overlap_check()

2018-08-31 Thread Eric Blake
On 08/31/2018 11:36 AM, Liam Merwick wrote: The commit for 0e4e4318eaa5 increments QCOW2_OL_MAX_BITNR but does not add an array entry for QCOW2_OL_BITMAP_DIRECTORY_BITNR to metadata_ol_names[]. As a result, an array dereference of metadata_ol_names[8] in qcow2_pre_write_overlap_check() could resu

Re: [Qemu-devel] [PATCH v2 7/8] io: potential unnecessary check in qio_channel_command_new_spawn()

2018-08-31 Thread Eric Blake
On 08/31/2018 11:36 AM, Liam Merwick wrote: In qio_channel_command_new_spawn() the 'flags' variable is checked to see if /dev/null should be used for stdin or stdout; first with O_RDONLY and then O_WRONLY. However the second check for O_WRONLY is only needed if flags != O_RDONLY and therefore sh

Re: [Qemu-devel] [PATCH v2 6/8] block: dump_qlist() may dereference a Null pointer

2018-08-31 Thread Eric Blake
On 08/31/2018 11:36 AM, Liam Merwick wrote: A NULL 'list' passed into function dump_qlist() isn't correctly validated and can be passed to qlist_first() where it is dereferenced. Given that dump_qlist() is static, and callers already do the right Double space looks odd. thing, just add an a

Re: [Qemu-devel] [PATCH 7/8] io: file descriptor not initialized in qio_channel_command_new_spawn()

2018-08-31 Thread Eric Blake
On 08/31/2018 11:19 AM, Liam Merwick wrote: Looking at it again, the very minor optimisation of converting the 2nd 'if' to an 'else if' has the useful side-effect of appeasing the static analysis tool. I never figured out what the tool precisely thought was wrong in the first place. Can you

Re: [Qemu-devel] [PATCH 3/3] RFC: delete PID file on exit

2018-08-31 Thread Marc-André Lureau
Hi On Fri, Aug 31, 2018 at 6:29 PM, Stefan Weil wrote: > Am 31.08.2018 um 16:53 schrieb Marc-André Lureau: > [...] >> +static const char *pid_file; >> + >> +static void qemu_unlink_pidfile(void) >> +{ >> +if (pid_file) { >> +unlink(pid_file); >> +} >> +} >> + >> bool machine_init

[Qemu-devel] [PATCH v2 5/8] block: Fix potential Null pointer dereferences in vvfat.c

2018-08-31 Thread Liam Merwick
The calls to bdrv_new_open_driver(), find_mapping_for_cluster(), and array_get_next() may return NULL but it isn't always checked for before dereferencing the value returned. Signed-off-by: Liam Merwick Reviewed-by: Darren Kenny Reviewed-by: Mark Kanda --- block/vvfat.c | 56 ++

[Qemu-devel] [PATCH v2 8/8] qcow2: Read outside array bounds in qcow2_pre_write_overlap_check()

2018-08-31 Thread Liam Merwick
The commit for 0e4e4318eaa5 increments QCOW2_OL_MAX_BITNR but does not add an array entry for QCOW2_OL_BITMAP_DIRECTORY_BITNR to metadata_ol_names[]. As a result, an array dereference of metadata_ol_names[8] in qcow2_pre_write_overlap_check() could result in a read outside of the array bounds. Fi

[Qemu-devel] [PATCH v2 4/8] qemu-img: potential Null pointer deref in img_commit()

2018-08-31 Thread Liam Merwick
The function block_job_get() may return NULL so before dereferencing the 'job' pointer in img_commit() it should be checked. Signed-off-by: Liam Merwick Reviewed-by: Darren Kenny Reviewed-by: Mark Kanda --- qemu-img.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qemu-img.c b/qemu-img

[Qemu-devel] [PATCH v2 6/8] block: dump_qlist() may dereference a Null pointer

2018-08-31 Thread Liam Merwick
A NULL 'list' passed into function dump_qlist() isn't correctly validated and can be passed to qlist_first() where it is dereferenced. Given that dump_qlist() is static, and callers already do the right thing, just add an assert to catch future potential bugs. Signed-off-by: Liam Merwick --- b

[Qemu-devel] [PATCH v2 1/8] configure: Provide option to explicitly disable AVX2

2018-08-31 Thread Liam Merwick
The configure script detects if the compiler has AVX2 support and automatically sets avx2_opt="yes" which in turn defines CONFIG_AVX2_OPT. There is no way of explicitly overriding this setting so this commit adds two command-line options: --enable-avx2 and --disable-avx2. The default behaviour, wh

[Qemu-devel] [PATCH v2 0/8] off-by-one and NULL pointer accesses detected by static analysis

2018-08-31 Thread Liam Merwick
Below are a number of fixes to some off-by-one, read outside array bounds, and NULL pointer accesses detected by an internal Oracle static analysis tool (Parfait). https://labs.oracle.com/pls/apex/f?p=labs:49:P49_PROJECT_ID:13 I have also included a patch to add a command-line option to confi

[Qemu-devel] [PATCH v2 7/8] io: potential unnecessary check in qio_channel_command_new_spawn()

2018-08-31 Thread Liam Merwick
In qio_channel_command_new_spawn() the 'flags' variable is checked to see if /dev/null should be used for stdin or stdout; first with O_RDONLY and then O_WRONLY. However the second check for O_WRONLY is only needed if flags != O_RDONLY and therefore should be an else if statement. This minor opti

[Qemu-devel] [PATCH v2 2/8] job: Fix off-by-one assert checks for JobSTT and JobVerbTable

2018-08-31 Thread Liam Merwick
In the assert checking the array dereference of JobVerbTable[verb] in job_apply_verb() the check of the index, verb, allows an overrun because an index equal to the array size is permitted. Similarly, in the assert check of JobSTT[s0][s1] with index s1 in job_state_transition(), an off-by-one over

[Qemu-devel] [PATCH v2 3/8] block: Null pointer dereference in blk_root_get_parent_desc()

2018-08-31 Thread Liam Merwick
The dev_id returned by the call to blk_get_attached_dev_id() in blk_root_get_parent_desc() can be NULL (an internal call to object_get_canonical_path may have returned NULL) so it should be checked before dereferencing. Signed-off-by: Liam Merwick Reviewed-by: Darren Kenny Reviewed-by: Mark Kand

Re: [Qemu-devel] [PATCH 3/3] RFC: delete PID file on exit

2018-08-31 Thread Stefan Weil
Am 31.08.2018 um 16:53 schrieb Marc-André Lureau: [...] > +static const char *pid_file; > + > +static void qemu_unlink_pidfile(void) > +{ > +if (pid_file) { > +unlink(pid_file); > +} > +} > + > bool machine_init_done; > > void qemu_add_machine_init_done_notifier(Notifier *notify

Re: [Qemu-devel] [PATCH 7/8] io: file descriptor not initialized in qio_channel_command_new_spawn()

2018-08-31 Thread Liam Merwick
On 31/08/18 16:50, Eric Blake wrote: On 08/31/2018 10:36 AM, Liam Merwick wrote: On 30/08/2018 17:18, Eric Blake wrote: On 08/30/2018 10:47 AM, Liam Merwick wrote: Incorrect checking of flags could result in uninitialized file descriptor being used. Looking at it again, the very minor

Re: [Qemu-devel] [PATCH 7/8] io: file descriptor not initialized in qio_channel_command_new_spawn()

2018-08-31 Thread Eric Blake
On 08/31/2018 10:36 AM, Liam Merwick wrote: On 30/08/2018 17:18, Eric Blake wrote: On 08/30/2018 10:47 AM, Liam Merwick wrote: Incorrect checking of flags could result in uninitialized file descriptor being used. Looking at it again, the very minor optimisation of converting the 2nd 'if'

Re: [Qemu-devel] [PATCH] i386: clarify that the Q35 machine type implements a P35 chipset

2018-08-31 Thread Marcel Apfelbaum
On 08/30/2018 01:57 PM, Daniel P. Berrangé wrote: The 'q35' machine type implements an Intel Series 3 chipset, of which there are several variants: https://www.intel.com/Assets/PDF/datasheet/316966.pdf The key difference between the 82P35 MCH ('p35', PCI device ID 0x29c0) and 82Q35 GMCH (

Re: [Qemu-devel] [PATCH 7/8] io: file descriptor not initialized in qio_channel_command_new_spawn()

2018-08-31 Thread Liam Merwick
On 30/08/2018 17:18, Eric Blake wrote: On 08/30/2018 10:47 AM, Liam Merwick wrote: Incorrect checking of flags could result in uninitialized file descriptor being used. Signed-off-by: Liam Merwick Reviewed-by: Darren Kenny Reviewed-by: Mark Kanda ---   io/channel-command.c | 4 ++--   1 file

Re: [Qemu-devel] [PATCH v3 2/9] jobs: canonize Error object

2018-08-31 Thread John Snow
On 08/31/2018 02:08 AM, Markus Armbruster wrote: > Eric Blake writes: > >> On 08/29/2018 08:57 PM, John Snow wrote: >>> Jobs presently use both an Error object in the case of the create job, >>> and char strings in the case of generic errors elsewhere. >>> >>> Unify the two paths as just j->er

Re: [Qemu-devel] [PATCH v2 14/20] memory-device: ids of virtio based devices are special

2018-08-31 Thread Eric Blake
On 08/31/2018 06:18 AM, David Hildenbrand wrote: -error_setg(errp, "address range conflicts with '%s'", d->id); +error_setg(errp, "address range conflicts with '%s'", + id ? id : 0); What's that 'id ? id : 0' trick for? 0 -> "", then

Re: [Qemu-devel] [PATCH 8/8] qcow2: Read outside array bounds in qcow2_pre_write_overlap_check()

2018-08-31 Thread Eric Blake
On 08/31/2018 08:32 AM, Liam Merwick wrote: The fix looks correct, but to prevent the problem from happening again, I'd suggest you also add a compile-time BUG_ON that fails if the array size gets out of sync again due to another addition of another overlap detection bit. Good idea. Ther

Re: [Qemu-devel] [PATCH v9 1/6] hw/i386: add pc-i440fx-3.1 & pc-q35-3.1

2018-08-31 Thread Marc-André Lureau
Hi On Thu, Aug 30, 2018 at 8:53 PM, Eduardo Habkost wrote: > On Fri, Aug 10, 2018 at 05:32:18PM +0200, Marc-André Lureau wrote: >> The following patch is going to add compatiblity parameters. >> >> Signed-off-by: Marc-André Lureau >> --- >> include/hw/compat.h | 4 +++- >> include/hw/i386/pc.

[Qemu-devel] [PATCH 3/3] RFC: delete PID file on exit

2018-08-31 Thread Marc-André Lureau
Register an exit handler to remove the PID file. By the time atexit() is called, qemu_write_pidfile() guarantees QEMU owns the PID file, thus we could safely remove it when exiting. Signed-off-by: Marc-André Lureau --- vl.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff

[Qemu-devel] [PATCH 2/3] util: use fcntl() for qemu_write_pidfile() locking

2018-08-31 Thread Marc-André Lureau
Daniel Berrangé suggested to use fcntl() locks rather than lockf(). 'man lockf': On Linux, lockf() is just an interface on top of fcntl(2) locking. Many other systems implement lockf() in this way, but note that POSIX.1 leaves the relationship between lockf() and fcntl(2) locks unspec

[Qemu-devel] [PATCH 1/3] util: add qemu_write_pidfile()

2018-08-31 Thread Marc-André Lureau
There are variants of qemu_create_pidfile() in qemu-pr-helper and qemu-ga. Let's have a common implementation in libqemuutil. The code is initially based from pr-helper write_pidfile(), with various improvements and suggestions from Daniel Berrangé: QEMU will leave the pidfile existing on disk

[Qemu-devel] [PATCH 0/3] util: add qemu_write_pidfile()

2018-08-31 Thread Marc-André Lureau
Hi, Here are a few PID file related patches extracted from "[PATCH v4 00/29] vhost-user for input & GPU" series, with suggestions from Daniel Berrangé. thanks Marc-André Lureau (3): util: add qemu_write_pidfile() util: use fcntl() for qemu_write_pidfile() locking RFC: delete PID file on ex

Re: [Qemu-devel] [PULL 8/9] tests: add qmp/qom-set-without-value test

2018-08-31 Thread Markus Armbruster
Thomas Huth writes: > On 2018-08-31 15:24, Marc-André Lureau wrote: >> Hi >> On Fri, Aug 31, 2018 at 3:18 PM Thomas Huth wrote: >>> >>> On 2018-08-31 14:04, Markus Armbruster wrote: Thomas Huth writes: > From: Marc-André Lureau > > test_qom_set_without_value() is about a

[Qemu-devel] [PULL v2 10/10] jobs: remove job_defer_to_main_loop

2018-08-31 Thread Max Reitz
From: John Snow Now that the job infrastructure is handling the job_completed call for all implemented jobs, we can remove the interface that allowed jobs to schedule their own completion. Signed-off-by: John Snow Reviewed-by: Max Reitz Message-id: 20180830015734.19765-10-js...@redhat.com Sign

[Qemu-devel] [PULL v2 07/10] jobs: utilize job_exit shim

2018-08-31 Thread Max Reitz
From: John Snow Utilize the job_exit shim by not calling job_defer_to_main_loop, and where applicable, converting the deferred callback into the job_exit callback. This converts backup, stream, create, and the unit tests all at once. Most of these jobs do not see any changes to the order in whic

  1   2   3   >