[PATCH v2 1/4] target/nios2: Shadow register set

2022-02-24 Thread Amir Gonnen
Implement shadow register set and related instructions rdprs, wrprs. Fix eret to update either status or sstatus according to current register set. eret also changes register set when needed. Signed-off-by: Amir Gonnen --- target/nios2/cpu.c | 1 + target/nios2/cpu.h | 47

Re: [PATCH] target/arm: Report KVM's actual PSCI version to guest in dtb

2022-02-24 Thread Akihiko Odaki
Reviewed-by: Akihiko Odaki On Thu, Feb 24, 2022 at 10:46 PM Peter Maydell wrote: > > When we're using KVM, the PSCI implementation is provided by the > kernel, but QEMU has to tell the guest about it via the device tree. > Currently we look at the KVM_CAP_ARM_PSCI_0_2 capability to determine >

[PATCH v2 2/2] ui/cocoa.m: Remove unnecessary NSAutoreleasePools

2022-02-24 Thread Peter Maydell
In commit 6e657e64cdc478 in 2013 we added some autorelease pools to deal with complaints from macOS when we made calls into Cocoa from threads that didn't have automatically created autorelease pools. Later on, macOS got stricter about forbidding cross-thread Cocoa calls, and in commit

Re: [PATCH RFC v1 0/2] VM fork detection for RNG

2022-02-24 Thread Jason A. Donenfeld
On Thu, Feb 24, 2022 at 11:56 AM Daniel P. Berrangé wrote: > IIRC this part of the QEMU doc was making an implicit assumption > about the way QEMU is to be used by mgmt apps doing snapshots. > > Instead of using the 'loadvm' command on the existing running QEMU > process, the doc seems to tacitly

Re: [PATCH v4 13/14] hw/mem/system-memory: add a memory sysbus device

2022-02-24 Thread Damien Hedde
On 2/24/22 10:55, Igor Mammedov wrote: On Wed, 23 Feb 2022 11:19:49 +0100 Damien Hedde wrote: On 2/23/22 10:44, Igor Mammedov wrote: On Wed, 23 Feb 2022 10:07:05 +0100 Damien Hedde wrote: This device can be used to create a memory wrapped into a sysbus device. This device has one

[PATCH v2 06/12] mos6522: use device_class_set_parent_reset() to propagate reset to parent

2022-02-24 Thread Mark Cave-Ayland
Switch from using a legacy approach to the more formal approach for propagating device reset to the parent. Signed-off-by: Mark Cave-Ayland Reviewed-by: Peter Maydell --- hw/misc/mac_via.c| 7 +-- hw/misc/macio/cuda.c | 3 ++- hw/misc/macio/pmu.c | 3 ++- hw/misc/mos6522.c| 1 - 4

[PATCH v2 03/12] mac_via: use IFR bit flag constants for VIA2 IRQs

2022-02-24 Thread Mark Cave-Ayland
This allows us to easily see how the physical control lines are mapped to the IFR bit flags. Signed-off-by: Mark Cave-Ayland --- include/hw/misc/mac_via.h | 19 +-- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/include/hw/misc/mac_via.h

[PATCH v2 08/12] mos6522: add "info via" HMP command for debugging

2022-02-24 Thread Mark Cave-Ayland
This displays detailed information about the device registers and timers to aid debugging problems with timers and interrupts. Currently the QAPI generators for HumanReadableText don't work correctly if used in qapi/target-misc.json when a non-specified target is built, so for now manually add a

Re: [PATCH v5 09/20] jobs: add job lock in find_* functions

2022-02-24 Thread Emanuele Giuseppe Esposito
On 17/02/2022 16:00, Stefan Hajnoczi wrote: > On Tue, Feb 08, 2022 at 09:35:02AM -0500, Emanuele Giuseppe Esposito wrote: >> diff --git a/blockdev.c b/blockdev.c >> index c5fba4d157..08408cd44b 100644 >> --- a/blockdev.c >> +++ b/blockdev.c >> @@ -3311,7 +3311,10 @@ out: >>

Re: [PATCH] hw/i386/pc: when adding reserved E820 entries do not allocate dynamic entries

2022-02-24 Thread Ani Sinha
On Thu, Feb 24, 2022 at 2:33 PM Igor Mammedov wrote: > > On Wed, 23 Feb 2022 17:30:34 +0530 > Ani Sinha wrote: > > > On Wed, Feb 23, 2022 at 2:34 PM Igor Mammedov wrote: > > > > > > On Thu, 10 Feb 2022 18:58:21 +0530 > > > Ani Sinha wrote: > > > > > > > When adding E820_RESERVED entries we

Re: [PATCH v4 15/18] iotests/image-fleecing: add test case with bitmap

2022-02-24 Thread Hanna Reitz
On 16.02.22 20:46, Vladimir Sementsov-Ogievskiy wrote: Note that reads zero areas (not dirty in the bitmap) fails, that's correct. Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/tests/image-fleecing | 32 ++-- tests/qemu-iotests/tests/image-fleecing.out | 84

[PATCH v3 0/2] VM fork detection for RNG

2022-02-24 Thread Jason A. Donenfeld
This small series picks up work from Amazon that seems to have stalled out last year around this time: listening for the vmgenid ACPI notification, and using it to "do something." Last year, folks proposed a complicated userspace mmap chardev, which was frought with difficulty and evidently

[PATCH v3 1/2] random: add mechanism for VM forks to reinitialize crng

2022-02-24 Thread Jason A. Donenfeld
When a VM forks, we must immediately mix in additional information to the stream of random output so that two forks or a rollback don't produce the same stream of random numbers, which could have catastrophic cryptographic consequences. This commit adds a simple API, add_vmfork_ randomness(), for

Re: [PATCH v2 07/12] mos6522: add register names to register read/write trace events

2022-02-24 Thread Philippe Mathieu-Daudé
On 24/2/22 12:59, Mark Cave-Ayland wrote: This helps to follow how the guest is programming the mos6522 when debugging. Signed-off-by: Mark Cave-Ayland Reviewed-by: Peter Maydell --- hw/misc/mos6522.c| 10 -- hw/misc/trace-events | 4 ++-- 2 files changed, 10 insertions(+), 4

Re: [PATCH v3 4/6] i386/pc: relocate 4g start to 1T where applicable

2022-02-24 Thread Joao Martins
On 2/23/22 18:44, Joao Martins wrote: > diff --git a/hw/i386/pc.c b/hw/i386/pc.c > index 360f4e10001b..6e4f5c87a2e5 100644 > --- a/hw/i386/pc.c > +++ b/hw/i386/pc.c > @@ -802,6 +802,78 @@ void xen_load_linux(PCMachineState *pcms) > #define PC_ROM_ALIGN 0x800 > #define PC_ROM_SIZE

Re: [PATCH v2] Added parameter to take screenshot with screendump as PNG

2022-02-24 Thread Eric Blake
On Thu, Feb 24, 2022 at 11:59:08AM +, Kshitij Suri wrote: > Currently screendump only supports PPM format, which is un-compressed and not > standard. Added a "format" parameter to qemu monitor screendump capabilites > to support PNG image capture using libpng. The param was added in QAPI

[PATCH 4/4] q35: compat: keep hotplugged PCIe device broken after migration for 6.2-older machine types

2022-02-24 Thread Igor Mammedov
Q35 switched to ACPI PCI hotplug by default in since 6.1 machine type and migration worked as expected (with BARs on target being the same as on source) However native PCIe fixes [1] merged in 6.2 time, regressed migration part, resulting in disabled BARs on target. The issue affects pc-q35-6.2

Re: [PATCH V7 10/29] machine: memfd-alloc option

2022-02-24 Thread Dr. David Alan Gilbert
* Steve Sistare (steven.sist...@oracle.com) wrote: > Allocate anonymous memory using memfd_create if the memfd-alloc machine > option is set. > > Signed-off-by: Steve Sistare So other than the minor error nit that Guoyi spotted, I think this is pretty good, one other comment below: > --- >

Re: [PATCH v3 4/6] i386/pc: relocate 4g start to 1T where applicable

2022-02-24 Thread Joao Martins
On 2/24/22 17:23, Michael S. Tsirkin wrote: > On Thu, Feb 24, 2022 at 04:07:22PM +, Joao Martins wrote: >> On 2/23/22 23:35, Joao Martins wrote: >>> On 2/23/22 21:22, Michael S. Tsirkin wrote: > +static void x86_update_above_4g_mem_start(PCMachineState *pcms, > +

Re: [PATCH 0/4] Fix broken PCIe device after migration

2022-02-24 Thread Michael S. Tsirkin
On Thu, Feb 24, 2022 at 12:44:07PM -0500, Igor Mammedov wrote: > Currently ACPI PCI hotplug is enabled by default for Q35 machine > type and overrides native PCIe hotplug. It works as expected when > a PCIe device is hotplugged into slot, however the device becomes > in-operational after

Re: [PATCH V7 04/29] migration: simplify savevm

2022-02-24 Thread Dr. David Alan Gilbert
* Steve Sistare (steven.sist...@oracle.com) wrote: > Use qemu_file_open to simplify a few functions in savevm.c. > No functional change. > > Signed-off-by: Steve Sistare So I think this is mostly OK, but a couple of minor tidyups below; so with the tidies and the renames from the previous

[PATCH 08/12] Move HOST_LONG_BITS to compiler.h

2022-02-24 Thread marcandre . lureau
From: Marc-André Lureau This will help to make common code independent. Signed-off-by: Marc-André Lureau --- include/qemu/compiler.h | 3 +++ include/qemu/osdep.h| 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h index

[PATCH 08/10] tcg/s390x: Use tgen_movcond_int in tgen_clz

2022-02-24 Thread Richard Henderson
Reuse code from movcond to conditionally copy a2 to dest, based on the condition codes produced by FLOGR. Signed-off-by: Richard Henderson --- tcg/s390x/tcg-target-con-set.h | 1 + tcg/s390x/tcg-target.c.inc | 26 +++--- 2 files changed, 12 insertions(+), 15

[PATCH 10/10] tcg/s390x: Implement ctpop operation

2022-02-24 Thread Richard Henderson
There is an older form that produces per-byte results, and a newer form that produces per-register results, and a vector form that produces per-element results. Signed-off-by: Richard Henderson --- tcg/s390x/tcg-target.h | 5 ++-- tcg/s390x/tcg-target.c.inc | 54

Re: [PATCH v2] Added parameter to take screenshot with screendump as PNG

2022-02-24 Thread Daniel P . Berrangé
On Thu, Feb 24, 2022 at 11:59:08AM +, Kshitij Suri wrote: > Currently screendump only supports PPM format, which is un-compressed and not > standard. Added a "format" parameter to qemu monitor screendump capabilites > to support PNG image capture using libpng. The param was added in QAPI

Re: [PATCH v2 2/4] hyperv: Add definitions for syndbg

2022-02-24 Thread Emanuele Giuseppe Esposito
On 16/02/2022 11:24, Jon Doron wrote: > Add all required definitions for hyperv synthetic debugger interface. > > Signed-off-by: Jon Doron > --- > include/hw/hyperv/hyperv-proto.h | 52 > target/i386/kvm/hyperv-proto.h | 37 +++ > 2

Re: [PATCH] tests/qemu-iotests/testrunner: Quote "case not run" lines in TAP mode

2022-02-24 Thread Hanna Reitz
On 23.02.22 13:43, Thomas Huth wrote: In TAP mode, the stdout is reserved for the TAP protocol, so we have to make sure to mark other lines with a comment '#' character at the beginning to avoid that the TAP parser at the other end gets confused. To test this condition, run "configure" for

[PATCH 0/2] blockdev-add transaction

2022-02-24 Thread Vladimir Sementsov-Ogievskiy
Hi all! If we want to do incremental backups with help of copy-before-write filter bitmap parameter introduced in my in-flight series "[PATCH v4 00/18] Make image fleecing more usable", we actually need to create filter, insert it into graph and do some operations with bitmaps in one transaction.

[PATCH 1/2] block: transaction support for blockdev-add

2022-02-24 Thread Vladimir Sementsov-Ogievskiy
Simply do blockdev_add() in .prepare() and bdrv_unref() in .abort() and that's it. Signed-off-by: Vladimir Sementsov-Ogievskiy --- qapi/transaction.json | 11 ++ blockdev.c| 80 +-- 2 files changed, 66 insertions(+), 25 deletions(-) diff

Re: [PATCH v3 4/6] i386/pc: relocate 4g start to 1T where applicable

2022-02-24 Thread Michael S. Tsirkin
On Thu, Feb 24, 2022 at 04:07:22PM +, Joao Martins wrote: > On 2/23/22 23:35, Joao Martins wrote: > > On 2/23/22 21:22, Michael S. Tsirkin wrote: > >>> +static void x86_update_above_4g_mem_start(PCMachineState *pcms, > >>> + uint64_t pci_hole64_size) >

[PATCH 06/12] Replace config-time define HOST_WORDS_BIGENDIAN

2022-02-24 Thread marcandre . lureau
From: Marc-André Lureau Replace a config-time define with a compile time condition define (compatible with clang and gcc) that must be declared prior to its usage. This avoids having a global configure time define, but also prevents from bad usage, if the config header wasn't included before.

[PATCH 07/10] tcg/s390x: Support SELGR instruction in MOVCOND

2022-02-24 Thread Richard Henderson
The new select instruction provides two separate register inputs, whereas the old load-on-condition instruction overlaps one of the register inputs with the destination. Generalize movcond to support pre-computed conditions, and the same set of arguments at all times. This allows, but does not

Re: [PATCH v3 4/6] i386/pc: relocate 4g start to 1T where applicable

2022-02-24 Thread Joao Martins
On 2/23/22 23:35, Joao Martins wrote: > On 2/23/22 21:22, Michael S. Tsirkin wrote: >>> +static void x86_update_above_4g_mem_start(PCMachineState *pcms, >>> + uint64_t pci_hole64_size) >>> +{ >>> +X86MachineState *x86ms = X86_MACHINE(pcms); >>> +

Re: [PATCH v2 4/4] hw: hyperv: Initial commit for Synthetic Debugging device

2022-02-24 Thread Emanuele Giuseppe Esposito
On 16/02/2022 11:25, Jon Doron wrote: > Signed-off-by: Jon Doron > --- > hw/hyperv/Kconfig | 5 + > hw/hyperv/meson.build | 1 + > hw/hyperv/syndbg.c| 402 ++ > 3 files changed, 408 insertions(+) > create mode 100644 hw/hyperv/syndbg.c > >

Re: [PATCH 6/8] char: move qemu_openpty_raw from util/ to char/

2022-02-24 Thread Marc-André Lureau
Paolo, This patch is ok, but in some (new?) circumstances it fails with freebsd and reveals that -lutil was missing for kinfo_getproc() in util/oslib-posix.c. Please add: -util_ss.add(when: 'CONFIG_POSIX', if_true: files('oslib-posix.c')) +util_ss.add(when: 'CONFIG_POSIX', if_true:

Re: [PATCH v6 01/19] configure, meson: override C compiler for cmake

2022-02-24 Thread Paolo Bonzini
On 2/22/22 20:05, Jag Raman wrote: -defaults[prefix + 'COMPILER'] = exe_list +defaults[f'{prefix}COMPILER'] = [exe_list[0]] +for i in range(1, len(exe_list)): +defaults[f'{prefix}COMPILER_ARG{i}'] = [exe_list[i]] + if

Re: [PATCH 4/4] q35: compat: keep hotplugged PCIe device broken after migration for 6.2-older machine types

2022-02-24 Thread Michael S. Tsirkin
On Thu, Feb 24, 2022 at 12:44:11PM -0500, Igor Mammedov wrote: > Q35 switched to ACPI PCI hotplug by default in since 6.1 > machine type and migration worked as expected (with BARs > on target being the same as on source) > > However native PCIe fixes [1] merged in 6.2 time, regressed > migration

[PATCH 02/12] compiler.h: replace QEMU_SENTINEL with G_GNUC_NULL_TERMINATED

2022-02-24 Thread marcandre . lureau
From: Marc-André Lureau One less qemu-specific macro. It also helps to make some headers/units only depend on glib, and thus moved in standalone projects eventually. Signed-off-by: Marc-André Lureau --- include/qemu/compiler.h| 2 -- include/qom/object.h | 6 +++---

[PATCH 04/12] compiler.h: replace QEMU_NORETURN with G_NORETURN

2022-02-24 Thread marcandre . lureau
From: Marc-André Lureau G_NORETURN was introduced in glib 2.68, fallback to G_GNUC_NORETURN in glib-compat. Note that this attribute must be placed before the function declaration (bringing a bit of consistency in qemu codebase usage). Signed-off-by: Marc-André Lureau ---

[PATCH 10/12] util: remove needless includes

2022-02-24 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- util/cutils.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/util/cutils.c b/util/cutils.c index c9b91e7535a8..53346138c970 100644 --- a/util/cutils.c +++ b/util/cutils.c @@ -27,8 +27,6 @@ #include #include "qemu-common.h"

[PATCH 06/10] tcg/s390x: Create tgen_cmp2 to simplify movcond

2022-02-24 Thread Richard Henderson
Return both regular and inverted condition codes from tgen_cmp2. This lets us choose after the fact which comparision we want. Signed-off-by: Richard Henderson --- tcg/s390x/tcg-target.c.inc | 25 + 1 file changed, 17 insertions(+), 8 deletions(-) diff --git

Re: [PATCH v5 08/20] jobs: protect jobs with job_lock/unlock

2022-02-24 Thread Stefan Hajnoczi
On Thu, Feb 24, 2022 at 01:45:48PM +0100, Emanuele Giuseppe Esposito wrote: > > > On 17/02/2022 15:48, Stefan Hajnoczi wrote: > > On Tue, Feb 08, 2022 at 09:35:01AM -0500, Emanuele Giuseppe Esposito wrote: > >> diff --git a/block/replication.c b/block/replication.c > >> index

[PATCH 0/4] Fix broken PCIe device after migration

2022-02-24 Thread Igor Mammedov
Currently ACPI PCI hotplug is enabled by default for Q35 machine type and overrides native PCIe hotplug. It works as expected when a PCIe device is hotplugged into slot, however the device becomes in-operational after migration. Which is caused by BARs being disabled on target due to powered off

[PATCH 2/4] pcie: update slot power status only is power control is enabled

2022-02-24 Thread Igor Mammedov
on creation a PCIDevice has power turned on at the end of pci_qdev_realize() however later on if PCIe slot isn't populated with any children it's power is turned off. It's fine if native hotplug is used as plug callback will power slot on among other things. However when ACPI hotplug is enabled it

[ Job Ad ] Qualcomm hiring developers to work on QEMU

2022-02-24 Thread Brian Cain
/* moderators - this is a job ad, please discard if it's not permitted by the community */ Qualcomm has openings for developers to help work on QEMU for the Hexagon DSP. If you like QEMU and are interested in challenging work, please apply!

[PATCH 1/4] pci: expose TYPE_XIO3130_DOWNSTREAM name

2022-02-24 Thread Igor Mammedov
Type name will be used in followup patch for cast check in pcihp code. Signed-off-by: Igor Mammedov --- include/hw/pci-bridge/xio3130_downstream.h | 15 +++ hw/pci-bridge/xio3130_downstream.c | 3 ++- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644

Re: [PATCH V7 03/29] migration: qemu file wrappers

2022-02-24 Thread Dr. David Alan Gilbert
* Steve Sistare (steven.sist...@oracle.com) wrote: > Add qemu_file_open and qemu_fd_open to create QEMUFile objects for unix > files and file descriptors. > > Signed-off-by: Steve Sistare > --- > migration/qemu-file-channel.c | 36 >

Re: [PATCH v3 4/6] i386/pc: relocate 4g start to 1T where applicable

2022-02-24 Thread Michael S. Tsirkin
On Thu, Feb 24, 2022 at 05:54:58PM +, Joao Martins wrote: > On 2/24/22 17:23, Michael S. Tsirkin wrote: > > On Thu, Feb 24, 2022 at 04:07:22PM +, Joao Martins wrote: > >> On 2/23/22 23:35, Joao Martins wrote: > >>> On 2/23/22 21:22, Michael S. Tsirkin wrote: > > +static void

[RFC PATCH 1/4] target/ppc: TCG: Migrate tb_offset and decr

2022-02-24 Thread Fabiano Rosas
These two were not migrated so the remote end was starting with the decrementer expired. I am seeing less frequent crashes with this patch (tested with -smp 4 and -smp 32). It certainly doesn't fix all issues but it looks like it helps. Signed-off-by: Fabiano Rosas --- target/ppc/machine.c |

Re: [PATCH v3] tests/qtest: add qtests for npcm7xx sdhci

2022-02-24 Thread Hao Wu
The problem is probably because we read it in using "strcmp". strcmp compares two strings that end with "\0". But one of the string is read in using read() so it didn't read in the ending '\0' character. We should use strncmp to compare the two strings. It probably avoids the issue. On Tue, Feb

[RFC PATCH 0/4] ppc: nested TCG migration (KVM-on-TCG)

2022-02-24 Thread Fabiano Rosas
This series implements the migration for a TCG pseries guest running a nested KVM guest. This is just like migrating a pseries TCG guest, but with some extra state to allow a nested guest to continue to run on the destination. Unfortunately the regular TCG migration scenario (not nested) is not

[PATCH 03/10] tcg/s390x: Support MIE2 multiply single instructions

2022-02-24 Thread Richard Henderson
The MIE2 facility adds 3-operand versions of multiply. Signed-off-by: Richard Henderson --- tcg/s390x/tcg-target-con-set.h | 1 + tcg/s390x/tcg-target.h | 1 + tcg/s390x/tcg-target.c.inc | 34 -- 3 files changed, 26 insertions(+), 10 deletions(-)

[PATCH 02/10] tcg/s390x: Distinguish RIE formats

2022-02-24 Thread Richard Henderson
There are multiple variations, with different fields. Signed-off-by: Richard Henderson --- tcg/s390x/tcg-target.c.inc | 47 +- 1 file changed, 26 insertions(+), 21 deletions(-) diff --git a/tcg/s390x/tcg-target.c.inc b/tcg/s390x/tcg-target.c.inc index

[PATCH 00/10] tcg/s390x: updates for mie2 and mie3

2022-02-24 Thread Richard Henderson
While reviewing David Miller's updates for mie3 for target/s390x, I realized that most of those are useful on the code generation side as well. Then I stepped back and looked at what other feature extensions had been missed. Our new s390x ci host is a z15, so this new code gets exercised, at

[PATCH 01/10] tcg/s390x: Distinguish RRF-a and RRF-c formats

2022-02-24 Thread Richard Henderson
One has 3 register arguments; the other has 2 plus an m3 field. Signed-off-by: Richard Henderson --- tcg/s390x/tcg-target.c.inc | 57 +- 1 file changed, 32 insertions(+), 25 deletions(-) diff --git a/tcg/s390x/tcg-target.c.inc b/tcg/s390x/tcg-target.c.inc

[PATCH 04/10] tcg/s390x: Support MIE2 MGRK instruction

2022-02-24 Thread Richard Henderson
The MIE2 facility adds a 3-operand signed 64x64->128 multiply. Signed-off-by: Richard Henderson --- tcg/s390x/tcg-target-con-set.h | 1 + tcg/s390x/tcg-target.h | 2 +- tcg/s390x/tcg-target.c.inc | 6 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git

[PATCH 05/10] tcg/s390x: Support MIE3 logical operations

2022-02-24 Thread Richard Henderson
This is andc, orc, nand, nor, eqv. We can use nor for implementing not. Signed-off-by: Richard Henderson --- tcg/s390x/tcg-target-con-set.h | 1 + tcg/s390x/tcg-target.h | 25 + tcg/s390x/tcg-target.c.inc | 100 + 3 files changed, 114

Re: [PATCH v5 08/20] jobs: protect jobs with job_lock/unlock

2022-02-24 Thread Emanuele Giuseppe Esposito
On 24/02/2022 17:48, Stefan Hajnoczi wrote: > On Thu, Feb 24, 2022 at 01:45:48PM +0100, Emanuele Giuseppe Esposito wrote: >> >> >> On 17/02/2022 15:48, Stefan Hajnoczi wrote: >>> On Tue, Feb 08, 2022 at 09:35:01AM -0500, Emanuele Giuseppe Esposito wrote: diff --git a/block/replication.c

Re: [PATCH 2/4] pcie: update slot power status only is power control is enabled

2022-02-24 Thread Michael S. Tsirkin
On Thu, Feb 24, 2022 at 12:44:09PM -0500, Igor Mammedov wrote: > on creation a PCIDevice has power turned on at the end of pci_qdev_realize() > however later on if PCIe slot isn't populated with any children > it's power is turned off. It's fine if native hotplug is used > as plug callback will

[PATCH 00/12] Misc cleanups

2022-02-24 Thread marcandre . lureau
From: Marc-André Lureau Hi, A small collection of patches gleaned while working on different things (more specifically, I am looking at making qapi code usable outside of qemu, many things are twisted together, it takes effort but it is hopefully worth it) Based-on:

[PATCH 03/12] osdep.h: move qemu_build_not_reached()

2022-02-24 Thread marcandre . lureau
From: Marc-André Lureau Move the macro and declaration so it can use glib in the following patch. Signed-off-by: Marc-André Lureau --- include/qemu/compiler.h | 16 include/qemu/osdep.h| 16 2 files changed, 16 insertions(+), 16 deletions(-) diff --git

[PATCH 09/12] scripts/modinfo-collect: remove unused/dead code

2022-02-24 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- scripts/modinfo-collect.py | 5 - 1 file changed, 5 deletions(-) diff --git a/scripts/modinfo-collect.py b/scripts/modinfo-collect.py index 61b90688c6dc..4e7584df6676 100755 --- a/scripts/modinfo-collect.py +++

[PATCH 11/12] util: remove the net/net.h dependency

2022-02-24 Thread marcandre . lureau
From: Marc-André Lureau Move qemu_ether_ntoa() which is only needed in net/. Signed-off-by: Marc-André Lureau --- include/qemu-common.h | 1 - net/announce.c| 13 + util/cutils.c | 14 -- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git

[RFC PATCH 2/4] spapr: TCG: Migrate spapr_cpu->prod

2022-02-24 Thread Fabiano Rosas
I'm seeing some stack traces in the migrated guest going through cede and some hangs at the plpar_hcall_norets so let's make sure everything related to cede/prod is being migrated just in case. Signed-off-by: Fabiano Rosas --- hw/ppc/spapr_cpu_core.c | 1 +

[PATCH 09/10] tcg/s390x: Use vector ctz for integer ctz

2022-02-24 Thread Richard Henderson
There is no integer version of ctz, but there is a vector one. Push the values to and fro, then fix up as required for the semantics of the tcg operation. Signed-off-by: Richard Henderson --- tcg/s390x/tcg-target.h | 4 ++-- tcg/s390x/tcg-target.c.inc | 35

RE: [PATCH 3/3] whpx: Added support for breakpoints and stepping

2022-02-24 Thread Ivan Shcherbakov
> I haven't looked at the rest of the patch -- but can you explain where > whpx is different from how other accelerators handle debug such that > it needs to know whether gdb is connected or not ? This mainly comes from the way single-stepping is handled. WHPX needs to know whether you want to

Re: [PATCH 7/8] Drop qemu_foo() socket API wrapper

2022-02-24 Thread Eric Blake
On Tue, Feb 22, 2022 at 11:40:07PM +0400, marcandre.lur...@redhat.com wrote: > From: Marc-André Lureau > > The socket API wrappers were initially introduced in commit > 00aa0040 ("Wrap recv to avoid warnings"), but made redundatant with redundant > commit a2d96af4 ("osdep: add wrappers for

Re: [PATCH v2 1/4] hyperv: SControl is optional to enable SynIc

2022-02-24 Thread Emanuele Giuseppe Esposito
On 16/02/2022 11:24, Jon Doron wrote: > SynIc can be enabled regardless of the SControl mechanisim which can > register a GSI for a given SintRoute. > > This behaviour can achived by setting enabling SIMP and then the guest > will poll on the message slot. > > Once there is another message

[PATCH 2/2] iotests: add blockdev-add-transaction

2022-02-24 Thread Vladimir Sementsov-Ogievskiy
Add a test for transaction support of blockdev-add. Test is format-agnostic, so limit it to qcow2 to avoid extra test runs. Signed-off-by: Vladimir Sementsov-Ogievskiy --- .../tests/blockdev-add-transaction| 52 +++ .../tests/blockdev-add-transaction.out| 6

Re: [PATCH] target/arm: Report KVM's actual PSCI version to guest in dtb

2022-02-24 Thread Richard Henderson
On 2/24/22 03:46, Peter Maydell wrote: When we're using KVM, the PSCI implementation is provided by the kernel, but QEMU has to tell the guest about it via the device tree. Currently we look at the KVM_CAP_ARM_PSCI_0_2 capability to determine if the kernel is providing at least PSCI 0.2, but if

Re: [PATCH V7 01/29] memory: qemu_check_ram_volatile

2022-02-24 Thread Dr. David Alan Gilbert
* Steve Sistare (steven.sist...@oracle.com) wrote: > Add a function that returns an error if any ram_list block represents > volatile memory. > > Signed-off-by: Steve Sistare > --- > include/exec/memory.h | 8 > softmmu/memory.c | 26 ++ > 2 files changed,

[PATCH 01/12] compiler.h: replace QEMU_WARN_UNUSED_RESULT with G_GNUC_WARN_UNUSED_RESULT

2022-02-24 Thread marcandre . lureau
From: Marc-André Lureau One less qemu-specific macro. It also helps to make some headers/units only depend on glib, and thus moved in standalone projects eventually. Signed-off-by: Marc-André Lureau --- include/qemu-common.h | 2 +- include/qemu/compiler.h| 2 --

[PATCH 05/12] compiler.h: drop __printf__ macro MinGW/glib workaround

2022-02-24 Thread marcandre . lureau
From: Marc-André Lureau This workaround was added in commit 95df51a4 ("w32: Always use standard instead of native format strings"), as it claimed glib was using __printf__ attribute. This is surprising, since glib has always used G_GNUC_PRINTF which, as the name implies, uses __gnu_printf__ when

[PATCH 07/12] Simplify HOST_LONG_BITS

2022-02-24 Thread marcandre . lureau
From: Marc-André Lureau Simplify the macro, not depending on headers defines, but compiler predefined __SIZEOF__POINTER__ only. Available since gcc 4.3 and clang 2.8. Signed-off-by: Marc-André Lureau --- include/qemu/osdep.h | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff

Re: [PATCH V7 02/29] migration: fix populate_vfio_info

2022-02-24 Thread Peter Maydell
On Wed, 22 Dec 2021 at 19:45, Steve Sistare wrote: > > Include CONFIG_DEVICES so that populate_vfio_info is instantiated for > CONFIG_VFIO. The commit message says "include CONFIG_DEVICES"... > Signed-off-by: Steve Sistare > --- > migration/target.c | 10 +++--- > 1 file changed, 7

Re: [PATCH v2 3/4] hyperv: Add support to process syndbg commands

2022-02-24 Thread Emanuele Giuseppe Esposito
On 16/02/2022 11:24, Jon Doron wrote: > SynDbg commands can come from two different flows: > 1. Hypercalls, in this mode the data being sent is fully >encapsulated network packets. > 2. SynDbg specific MSRs, in this mode only the data that needs to be >transfered is passed. > >

Re: [PATCH] tests/qemu-iotests/040: Skip TestCommitWithFilters without 'throttle'

2022-02-24 Thread Hanna Reitz
On 23.02.22 13:31, Thomas Huth wrote: iotest 040 already has some checks for the availability of the 'throttle' driver, but some new code has been added in the course of time that depends on 'throttle' but does not check for its availability. Add a check to the TestCommitWithFilters class so

[PATCH 3/4] acpi: pcihp: disable power control on PCIe slot

2022-02-24 Thread Igor Mammedov
Previous patch [1] fixed unconditional power handling on a PCIe slot, and make it honor PCI_EXP_SLTCAP_PCP capability. Use COMPAT_PROP_PCP to disable power control (PCI_EXP_SLTCAP_PCP) on PCIe slot when its plug callbacks are wired to ACPI pcihp, which effectively leaves stop always powered. PS:

[RESEND PATCH v3 1/1] multifd: Remove some redundant code

2022-02-24 Thread Li Zhang
Clean up some unnecessary code Signed-off-by: Li Zhang --- migration/multifd.c | 15 --- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/migration/multifd.c b/migration/multifd.c index 3242f688e5..d44cc6670f 100644 --- a/migration/multifd.c +++ b/migration/multifd.c

Re: [PATCH 05/12] compiler.h: drop __printf__ macro MinGW/glib workaround

2022-02-24 Thread Peter Maydell
On Thu, 24 Feb 2022 at 18:38, wrote: > > From: Marc-André Lureau > > This workaround was added in commit 95df51a4 ("w32: Always use standard > instead of native format strings"), as it claimed glib was using > __printf__ attribute. This is surprising, since glib has always used > G_GNUC_PRINTF

Re: [PATCH v2] hw/i2c: flatten pca954x mux device

2022-02-24 Thread Patrick Venture
On Thu, Feb 24, 2022 at 2:56 AM Peter Maydell wrote: > On Wed, 2 Feb 2022 at 17:57, Patrick Venture wrote: > > > > Previously this device created N subdevices which each owned an i2c bus. > > Now this device simply owns the N i2c busses directly. > > > > Tested: Verified devices behind mux are

Re: [PATCH v4 38/47] target/ppc: Refactor VSX_SCALAR_CMP_DP

2022-02-24 Thread Víctor Colombo
On 22/02/2022 21:20, Richard Henderson wrote:> On 2/22/22 04:36, matheus.fe...@eldorado.org.br wrote: From: Víctor Colombo Refactor VSX_SCALAR_CMP_DP, changing its name to VSX_SCALAR_CMP and prepare the helper to be used for quadword comparisons. Signed-off-by: Víctor Colombo Signed-off-by:

Re: [PATCH 01/12] compiler.h: replace QEMU_WARN_UNUSED_RESULT with G_GNUC_WARN_UNUSED_RESULT

2022-02-24 Thread Richard Henderson
On 2/24/22 08:36, marcandre.lur...@redhat.com wrote: From: Marc-André Lureau One less qemu-specific macro. It also helps to make some headers/units only depend on glib, and thus moved in standalone projects eventually. Signed-off-by: Marc-André Lureau --- include/qemu-common.h | 2 +-

Re: [PATCH 06/12] Replace config-time define HOST_WORDS_BIGENDIAN

2022-02-24 Thread Richard Henderson
On 2/24/22 08:36, marcandre.lur...@redhat.com wrote: From: Marc-André Lureau Replace a config-time define with a compile time condition define (compatible with clang and gcc) that must be declared prior to its usage. This avoids having a global configure time define, but also prevents from bad

Re: [PATCH 04/12] compiler.h: replace QEMU_NORETURN with G_NORETURN

2022-02-24 Thread Marc-André Lureau
Hi On Thu, Feb 24, 2022 at 11:37 PM Richard Henderson < richard.hender...@linaro.org> wrote: > On 2/24/22 08:36, marcandre.lur...@redhat.com wrote: > > From: Marc-André Lureau > > > > G_NORETURN was introduced in glib 2.68, fallback to G_GNUC_NORETURN in > > glib-compat. > > > > Note that this

[PATCH v13 1/4] target/ppc: make power8-pmu.c CONFIG_TCG only

2022-02-24 Thread Daniel Henrique Barboza
This is an exclusive TCG helper. Gating it with CONFIG_TCG and changing meson.build accordingly will prevent problems --disable-tcg and --disable-linux-user later on. We're also changing the uses of !kvm_enabled() to tcg_enabled() to avoid adding "defined(CONFIG_TCG)" ifdefs, since tcg_enabled()

Re: [PATCH v3 4/6] i386/pc: relocate 4g start to 1T where applicable

2022-02-24 Thread Joao Martins
On 2/24/22 20:12, Michael S. Tsirkin wrote: > On Thu, Feb 24, 2022 at 08:04:48PM +, Joao Martins wrote: >> On 2/24/22 19:54, Michael S. Tsirkin wrote: >>> On Thu, Feb 24, 2022 at 07:44:26PM +, Joao Martins wrote: On 2/24/22 18:30, Michael S. Tsirkin wrote: > On Thu, Feb 24, 2022

Re: [RFC PATCH 0/4] ppc: nested TCG migration (KVM-on-TCG)

2022-02-24 Thread Mark Cave-Ayland
On 24/02/2022 18:58, Fabiano Rosas wrote: This series implements the migration for a TCG pseries guest running a nested KVM guest. This is just like migrating a pseries TCG guest, but with some extra state to allow a nested guest to continue to run on the destination. Unfortunately the regular

Re: [PATCH] libvhost-user: Fix wrong type of argument to formatting function (reported by LGTM)

2022-02-24 Thread Stefan Weil
Am 07.01.22 um 16:49 schrieb Stefan Weil: Signed-off-by: Stefan Weil --- LGTM has some more alerts which need attention: https://lgtm.com/projects/g/qemu/qemu/ Regards, Stefan subprojects/libvhost-user/libvhost-user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

Re: [PATCH v13 1/4] target/ppc: make power8-pmu.c CONFIG_TCG only

2022-02-24 Thread Richard Henderson
On 2/24/22 10:18, Daniel Henrique Barboza wrote: This is an exclusive TCG helper. Gating it with CONFIG_TCG and changing meson.build accordingly will prevent problems --disable-tcg and --disable-linux-user later on. We're also changing the uses of !kvm_enabled() to tcg_enabled() to avoid adding

Re: [PATCH 05/12] compiler.h: drop __printf__ macro MinGW/glib workaround

2022-02-24 Thread Marc-André Lureau
Hi On Fri, Feb 25, 2022 at 1:41 AM Stefan Weil wrote: > Am 24.02.22 um 20:12 schrieb Peter Maydell: > > > On Thu, 24 Feb 2022 at 18:38, wrote: > >> From: Marc-André Lureau > >> > >> This workaround was added in commit 95df51a4 ("w32: Always use standard > >> instead of native format

Re: [RFC PATCH 4/4] spapr: Add KVM-on-TCG migration support

2022-02-24 Thread Nicholas Piggin
Excerpts from Fabiano Rosas's message of February 25, 2022 4:58 am: > This adds migration support for TCG pseries machines running a KVM-HV > guest. > > The state that needs to be migrated is: > > - the nested PTCR value; > - the in_nested flag; > - the nested_tb_offset. > - the saved host

Re: [PATCH] accel/tcg/cpu-exec: fix precise single-stepping after interrupt

2022-02-24 Thread Richard Henderson
On 2/24/22 14:23, Richard Henderson wrote: On 2/14/22 03:26, Luc Michel wrote: In some cases, cpu->exit_request can be false after handling the interrupt, leading to another TB being executed instead of returning to the main loop. Fix this by returning true unconditionally when in single-step

Re: [PATCH v2] target/arm: Support PSCI 1.1 and SMCCC 1.0

2022-02-24 Thread Akihiko Odaki
On 2022/02/24 21:53, Peter Maydell wrote: On Sun, 13 Feb 2022 at 03:58, Akihiko Odaki wrote: Support the latest PSCI on TCG and HVF. A 64-bit function called from AArch32 now returns NOT_SUPPORTED, which is necessary to adhere to SMC Calling Convention 1.0. It is still not compliant with

Re: [PATCH v3 4/6] i386/pc: relocate 4g start to 1T where applicable

2022-02-24 Thread Jason Wang
On Fri, Feb 25, 2022 at 2:30 AM Michael S. Tsirkin wrote: > > On Thu, Feb 24, 2022 at 05:54:58PM +, Joao Martins wrote: > > On 2/24/22 17:23, Michael S. Tsirkin wrote: > > > On Thu, Feb 24, 2022 at 04:07:22PM +, Joao Martins wrote: > > >> On 2/23/22 23:35, Joao Martins wrote: > > >>> On

Re: [PATCH v6 01/19] configure, meson: override C compiler for cmake

2022-02-24 Thread Jag Raman
> On Feb 24, 2022, at 12:52 PM, Paolo Bonzini wrote: > > On 2/22/22 20:05, Jag Raman wrote: >>> -defaults[prefix + 'COMPILER'] = exe_list >>> +defaults[f'{prefix}COMPILER'] = [exe_list[0]] >>> +for i in range(1, len(exe_list)): >>> +

RE: [PATCH] vl: transform QemuOpts device to JSON syntax device

2022-02-24 Thread Duan, Zhenzhong
>-Original Message- >From: Kevin Wolf >Sent: Thursday, February 24, 2022 7:31 PM >To: Duan, Zhenzhong >Cc: qemu-devel@nongnu.org; pbonz...@redhat.com; ebl...@redhat.com; >m...@redhat.com; pkre...@redhat.com; ler...@redhat.com >Subject: Re: [PATCH] vl: transform QemuOpts device to JSON

Fix a potential Use-after-free in test_blockjob_common_drain_node() (v6.2.0).

2022-02-24 Thread wliang
Hi all, I find a potential Use-after-free in QEMU 6.2.0, which is in test_blockjob_common_drain_node() (./tests/unit/test-bdrv-drain.c). Specifically, at line 880, the variable 'scr' is released by the bdrv_unref(). However, at line 881, it is subsequently used as the 1st parameter of the

Re: [RFC PATCH 2/4] spapr: TCG: Migrate spapr_cpu->prod

2022-02-24 Thread David Gibson
On Thu, Feb 24, 2022 at 03:58:15PM -0300, Fabiano Rosas wrote: > I'm seeing some stack traces in the migrated guest going through cede > and some hangs at the plpar_hcall_norets so let's make sure everything > related to cede/prod is being migrated just in case. This is a poor approach in

Re: [RFC PATCH 0/4] ppc: nested TCG migration (KVM-on-TCG)

2022-02-24 Thread David Gibson
On Thu, Feb 24, 2022 at 09:00:24PM +, Mark Cave-Ayland wrote: > On 24/02/2022 18:58, Fabiano Rosas wrote: > > > This series implements the migration for a TCG pseries guest running a > > nested KVM guest. This is just like migrating a pseries TCG guest, but > > with some extra state to allow

<    1   2   3   >