Re: [PATCH RFC 2/2] hw: Replace drive_get_next() by drive_get()

2021-11-15 Thread Markus Armbruster
Philippe Mathieu-Daudé writes: > On 11/15/21 16:57, Markus Armbruster wrote: >> Philippe Mathieu-Daudé writes: >>> On 11/15/21 13:55, Markus Armbruster wrote: drive_get_next() is basically a bad idea. It returns the "next" block backend of a certain interface type. "Next" means bus=0

Re: [PATCH] dump-guest-memory: Use BQL to protect dump finalize process

2021-11-15 Thread Marc-André Lureau
Hi On Tue, Nov 16, 2021 at 7:22 AM Peter Xu wrote: > > When finalizing the dump-guest-memory with detached mode, we'll first set dump > status to either FAIL or COMPLETE before doing the cleanup, however right > after > the dump status change it's possible that another dump-guest-memory qmp > c

Re: [PATCH v2 1/3] icount: preserve cflags when custom tb is about to execute

2021-11-15 Thread Pavel Dovgalyuk
On 11.11.2021 15:20, Alex Bennée wrote: Pavel Dovgalyuk writes: When debugging with the watchpoints, qemu may need to create TB with single instruction. This is achieved by setting cpu->cflags_next_tb. But when this block is about to execute, it may be interrupted by another thread. In this c

[PATCH] migration: fix dump-vmstate with modules

2021-11-15 Thread Laurent Vivier
To work correctly -dump-vmstate and vmstate-static-checker.py need to dump all the supported vmstates. But as some devices can be modules, they are not loaded at startup and not dumped. Fix that by loading all available modules before dumping the machine vmstate. Fixes: 7ab6e7fcce97 ("qdev: devic

Re: [PATCH v5 0/6] Add vmnet.framework based network backend

2021-11-15 Thread Jason Wang
On Mon, Nov 15, 2021 at 6:45 PM Vladislav Yaroshchuk wrote: > > > > пн, 15 нояб. 2021 г. в 07:53, Jason Wang : >> >> On Fri, Nov 12, 2021 at 5:14 PM Vladislav Yaroshchuk >> wrote: >> > >> > macOS provides networking API for VMs called 'vmnet.framework': >> > https://developer.apple.com/documentat

Re: [PATCH v2 1/6] pci: implement power state

2021-11-15 Thread Gerd Hoffmann
Hi, > > new_addr = pci_bar_address(d, i, r->type, r->size); > > +if (!d->has_power) { > > +new_addr = PCI_BAR_UNMAPPED; > > +} > > > > /* This bar isn't changed */ > > if (new_addr == r->addr) > > I am a bit confused about why this is nec

Re: [PATCH for 6.2 v4] nbd/server: Add --selinux-label option

2021-11-15 Thread Thomas Huth
On 15/11/2021 21.29, Eric Blake wrote: From: "Richard W.M. Jones" Under SELinux, Unix domain sockets have two labels. One is on the disk and can be set with commands such as chcon(1). There is a different label stored in memory (called the process label). This can only be set by the process

Re: [PATCH] gitlab-ci: Test compilation on Windows with MSYS2

2021-11-15 Thread Marc-André Lureau
Hi On Mon, Nov 15, 2021 at 6:31 PM Philippe Mathieu-Daudé wrote: > On 11/15/21 15:06, Thomas Huth wrote: > > Gitlab also provides runners with Windows, we can use them to > > test compilation with MSYS2, in both, 64-bit and 32-bit. > > > > However, it takes quite a long time to set up the VM, so

Re: [PATCH] qmp: Stabilize preconfig

2021-11-15 Thread Paolo Bonzini
El lun., 15 nov. 2021 16:40, Markus Armbruster escribió: > > Why do you care? For another example, you can use "reboot" or > > "systemctl isolate reboot.target" and they end up doing the same thing. > > > > As long as qemu_init invokes qmp_machine_set, qmp_accel_set, > > qmp_device_add, qmp_plug

Re: [PATCH] q35: flip acpi-pci-hotplug-with-bridge-support default back to off

2021-11-15 Thread Ani Sinha
On Thu, 11 Nov 2021, Gerd Hoffmann wrote: > Switch qemu 6.2 back to 6.0 behavior (aka native pcie hotplug) because > acpi hotplug for pcie ports caused all kinds of regressions and a fix > for those is not in sight. > > Add compat property for 6.1 to keep it enabled there. Use a separate > com

[PATCH] dump-guest-memory: Use BQL to protect dump finalize process

2021-11-15 Thread Peter Xu
When finalizing the dump-guest-memory with detached mode, we'll first set dump status to either FAIL or COMPLETE before doing the cleanup, however right after the dump status change it's possible that another dump-guest-memory qmp command is sent so both the main thread and dump thread (which is du

Re: [PATCH v4 07/20] target/riscv: Adjust csr write mask with XLEN

2021-11-15 Thread Alistair Francis
On Fri, Nov 12, 2021 at 1:58 AM LIU Zhiwei wrote: > > Write mask is representing the bits we care about. > > Signed-off-by: LIU Zhiwei > Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis Alistair > --- > target/riscv/insn_trans/trans_rvi.c.inc | 4 ++-- > target/riscv/op_helper.c

Re: [PATCH v4 06/20] target/riscv: Relax debug check for pm write

2021-11-15 Thread Alistair Francis
On Fri, Nov 12, 2021 at 2:12 AM LIU Zhiwei wrote: > > Signed-off-by: LIU Zhiwei > Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis Alistair > --- > target/riscv/csr.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/target/riscv/csr.c b/target/riscv/csr.c > index 9f41

Re: [PATCH v4 05/20] target/riscv: Use gdb xml according to max mxlen

2021-11-15 Thread Alistair Francis
On Fri, Nov 12, 2021 at 1:54 AM LIU Zhiwei wrote: > > Signed-off-by: LIU Zhiwei > Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis Alistair > --- > target/riscv/gdbstub.c | 71 +++--- > 1 file changed, 52 insertions(+), 19 deletions(-) > > dif

RE: [PATCH 2/2] virtio-blk: support BLKSECDISCARD

2021-11-15 Thread Qi, Yadong
> The Linux block layer shares the DISCARD queue limits with SECDISCARD. > That's different from BLKZEROOUT (QEMU's WRITE_ZEROES). This is a Linux > implementation detail but I guess virtio-blk can share the DISCARD limits with > SECDISCARD too... > > > @@ -622,6 +628,7 @@ static int virtio_blk_ha

RE: [PATCH 1/2] block:hdev: support BLKSECDISCARD

2021-11-15 Thread Qi, Yadong
> > Add a new option "secdiscard" for block drive. Parse it and record it > > in bs->open_flags as bit(BDRV_O_SECDISCARD). > > > > Add a new BDRV_REQ_SECDISCARD bit for secure discard request from > > virtual device. > > > > For host_device backend: implement by ioctl(BLKSECDISCARD) on real > > hos

RE: [PATCH 1/2] block:hdev: support BLKSECDISCARD

2021-11-15 Thread Qi, Yadong
> > Notably absent: qapi/block-core.json. Without changing this, the option can't > be > available in -blockdev, which is the primary option to configure block device > backends. > > This patch seems to contain multiple logical changes that should be split into > separate patches: > > * Adding

RE: [PATCH 2/2] virtio-blk: support BLKSECDISCARD

2021-11-15 Thread Qi, Yadong
> On Mon, Nov 15, 2021 at 12:52:00PM +0800, yadong...@intel.com wrote: > > From: Yadong Qi > > > > Add new virtio feature: VIRTIO_BLK_F_SECDISCARD. > > Add new virtio command: VIRTIO_BLK_T_SECDISCARD. > > > > This feature is disabled by default, it will check the backend > > bs->open_flags & BDRV_

RE: [PATCH 2/2] virtio-blk: support BLKSECDISCARD

2021-11-15 Thread Qi, Yadong
> >Add new virtio feature: VIRTIO_BLK_F_SECDISCARD. > >Add new virtio command: VIRTIO_BLK_T_SECDISCARD. > > Has a proposal been sent out yet to virtio-comment mailing list for discussing > these specification changes? > Not yet. I will draft a proposal to virtio-comment if no big concern of this

Re: [PATCH v9 68/76] target/riscv: gdb: support vector registers for rv64 & rv32

2021-11-15 Thread Alistair Francis
On Fri, Oct 29, 2021 at 8:24 PM wrote: > > From: Hsiangkai Wang > > Signed-off-by: Hsiangkai Wang > Signed-off-by: Greentime Hu > Signed-off-by: Frank Chang Acked-by: Alistair Francis Alistair > --- > target/riscv/cpu.c | 2 + > target/riscv/cpu.h | 1 + > target/riscv/gdbstub

Re: [PATCH v4 04/20] target/riscv: Extend pc for runtime pc write

2021-11-15 Thread Alistair Francis
On Fri, Nov 12, 2021 at 2:01 AM LIU Zhiwei wrote: > > In some cases, we must restore the guest PC to the address of the start of > the TB, such as when the instruction counter hits zero. So extend pc register > according to current xlen for these cases. > > Signed-off-by: LIU Zhiwei > Reviewed-by

Re: [PATCH v9 74/76] target/riscv: rvv-1.0: add vector unit-stride mask load/store insns

2021-11-15 Thread Alistair Francis
On Fri, Oct 29, 2021 at 8:38 PM wrote: > > From: Frank Chang > > Signed-off-by: Frank Chang Acked-by: Alistair Francis Alistair > --- > target/riscv/helper.h | 2 ++ > target/riscv/insn32.decode | 4 +++ > target/riscv/insn_trans/trans_rvv.c.inc | 40 +++

Re: [PATCH v9 73/76] target/riscv: rvv-1.0: add evl parameter to vext_ldst_us()

2021-11-15 Thread Alistair Francis
On Fri, Oct 29, 2021 at 8:11 PM wrote: > > From: Frank Chang > > Add supports of Vector unit-stride mask load/store instructions > (vlm.v, vsm.v), which has: > evl (effective vector length) = ceil(env->vl / 8). > > The new instructions operate the same as unmasked byte loads and stores. > Add

Re: [PATCH v9 67/76] target/riscv: rvv-1.0: trigger illegal instruction exception if frm is not valid

2021-11-15 Thread Alistair Francis
On Fri, Oct 29, 2021 at 8:14 PM wrote: > > From: Frank Chang > > If the frm field contains an invalid rounding mode (101-111), > attempting to execute any vector floating-point instruction, even > those that do not depend on the rounding mode, will raise an illegal > instruction exception. > > Ca

Re: [PATCH v9 66/76] target/riscv: rvv-1.0: implement vstart CSR

2021-11-15 Thread Alistair Francis
Alistair On Fri, Oct 29, 2021 at 7:55 PM wrote: > > From: Frank Chang > > * Update and check vstart value for vector instructions. > * Add whole register move instruction helper functions as we have to > call helper function for case where vstart is not zero. > * Remove probe_pages() calls in

Re: [PATCH for 6.2] nbd/server: Silence clang sanitizer warning

2021-11-15 Thread Philippe Mathieu-Daudé
On 11/15/21 23:39, Eric Blake wrote: > clang's sanitizer is picky: memset(NULL, x, 0) is technically > undefined behavior, even though no sane implementation of memset() > deferences the NULL. Caught by the nbd-qemu-allocation iotest. > > The alternative to checking before each memset is to inste

[PULL 2/3] tests/unit/test-smp-parse: QOM'ify smp_machine_class_init()

2021-11-15 Thread Philippe Mathieu-Daudé
smp_machine_class_init() is the actual TypeInfo::class_init(). Declare it as such in smp_machine_info, and avoid to call it manually in each test. Move smp_machine_info definition just before we register the type to avoid a forward declaration. Reviewed-by: Andrew Jones Reviewed-by: Richard Hende

Re: [PATCH] sev: allow capabilities to check for SEV-ES support

2021-11-15 Thread Eric Blake
On Mon, Nov 15, 2021 at 02:38:04PM -0500, Tyler Fanelli wrote: > Probe for SEV-ES and SEV-SNP capabilities to distinguish between Rome, > Naples, and Milan processors. Use the CPUID function to probe if a > processor is capable of running SEV-ES or SEV-SNP, rather than if it > actually is running S

Re: [PATCH v4 00/11] tests/unit: Fix test-smp-parse

2021-11-15 Thread Philippe Mathieu-Daudé
On 11/15/21 15:58, Philippe Mathieu-Daudé wrote: > Missing review: patches #4 to #8 (new) > > Yet another approach to fix test-smp-parse. v2 from Yanan Wang: > https://lore.kernel.org/qemu-devel/2021024429.10568-1-wangyana...@huawei.com/ > > Here we use the QOM class_init() to avoid having t

[PULL 3/3] tests/unit/test-smp-parse: Explicit MachineClass name

2021-11-15 Thread Philippe Mathieu-Daudé
If the MachineClass::name pointer is not explicitly set, it is NULL. Per the C standard, passing a NULL pointer to printf "%s" format is undefined. Some implementations display it as 'NULL', other as 'null'. Since we are comparing the formatted output, we need a stable value. The easiest is to expl

[PULL 1/3] tests/unit/test-smp-parse: Restore MachineClass fields after modifying

2021-11-15 Thread Philippe Mathieu-Daudé
There is a single MachineClass object, registered with type_register_static(&smp_machine_info). Since the same object is used multiple times (an MachineState object is instantiated in both test_generic and test_with_dies), we should restore its internal state after modifying for the test purpose.

[PULL 0/3] Machine-next patches for 2021-11-15

2021-11-15 Thread Philippe Mathieu-Daudé
The following changes since commit 42f6c9179be4401974dd3a75ee72defd16b5092d: Merge tag 'pull-ppc-2022' of https://github.com/legoater/qemu into staging (2021-11-12 12:28:25 +0100) are available in the Git repository at: https://github.com/philmd/qemu.git tags/machine-core-202

Re: [PULL 00/20] pci,pc,virtio: bugfixes

2021-11-15 Thread Philippe Mathieu-Daudé
On 11/15/21 17:37, Michael S. Tsirkin wrote: > The following changes since commit 0a70bcf18caf7a61d480f8448723c15209d128ef: > > Update version for v6.2.0-rc0 release (2021-11-09 18:22:57 +0100) > > are available in the Git repository at: > > git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git

[PATCH for 6.2] nbd/server: Silence clang sanitizer warning

2021-11-15 Thread Eric Blake
clang's sanitizer is picky: memset(NULL, x, 0) is technically undefined behavior, even though no sane implementation of memset() deferences the NULL. Caught by the nbd-qemu-allocation iotest. The alternative to checking before each memset is to instead force an allocation of 1 element instead of

[PATCH-for-6.2? 2/2] hw/intc/arm_gicv3: Introduce CONFIG_ARM_GIC_TCG Kconfig selector

2021-11-15 Thread Philippe Mathieu-Daudé
The TYPE_ARM_GICV3 device is an emulated one. When using KVM, it is recommended to use the TYPE_KVM_ARM_GICV3 device (which uses in-kernel support). When using --with-devices-FOO, it is possible to build a binary with a specific set of devices. When this binary is restricted to KVM accelerator, t

[PATCH-for-6.2? 0/2] hw/intc/arm_gicv3: Introduce CONFIG_ARM_GIC_TCG Kconfig selector

2021-11-15 Thread Philippe Mathieu-Daudé
downstream distributions to deselect this device. Based-on: pull-target-arm-2025-1 Philippe Mathieu-Daudé (2): hw/intc/arm_gicv3: Extract gicv3_set_gicv3state from arm_gicv3_cpuif.c hw/intc/arm_gicv3: Introduce CONFIG_ARM_GIC_TCG Kconfig selector hw/intc/arm_gicv3.c | 2 +- hw

[PATCH-for-6.2? 1/2] hw/intc/arm_gicv3: Extract gicv3_set_gicv3state from arm_gicv3_cpuif.c

2021-11-15 Thread Philippe Mathieu-Daudé
gicv3_set_gicv3state() is used by arm_gicv3_common.c in arm_gicv3_common_realize(). Since we want to restrict arm_gicv3_cpuif.c to TCG, extract gicv3_set_gicv3state() to a new file. Add this file to the meson 'specific' source set, since it needs access to "cpu.h". Signed-off-by: Philippe Mathieu-

Re: "make check" fails in a clang sanitizer build on "nbd-qemu-allocation" iotest

2021-11-15 Thread Eric Blake
On Mon, Nov 15, 2021 at 05:11:54PM +, Peter Maydell wrote: > Hi; running a 'make check' on a clang sanitizer build one of > the iotests falls over due to a NULL pointer being passed to > memset(): > > > TEST iotest-qcow2: nbd-qemu-allocation [fail] > +../../nbd/server.c:1027:16: runtime

Re: [PATCH RFC 2/2] hw: Replace drive_get_next() by drive_get()

2021-11-15 Thread Philippe Mathieu-Daudé
On 11/15/21 16:57, Markus Armbruster wrote: > Philippe Mathieu-Daudé writes: >> On 11/15/21 13:55, Markus Armbruster wrote: >>> drive_get_next() is basically a bad idea. It returns the "next" block >>> backend of a certain interface type. "Next" means bus=0,unit=N, where >>> subsequent calls cou

Re: [PULL 00/13] Block layer patches

2021-11-15 Thread Philippe Mathieu-Daudé
Hi Kevin, On 11/15/21 15:53, Kevin Wolf wrote: > The following changes since commit 42f6c9179be4401974dd3a75ee72defd16b5092d: > > Merge tag 'pull-ppc-2022' of https://github.com/legoater/qemu into > staging (2021-11-12 12:28:25 +0100) > > are available in the Git repository at: > > git

Re: [PULL 00/13] Block layer patches

2021-11-15 Thread Richard Henderson
On 11/15/21 3:53 PM, Kevin Wolf wrote: The following changes since commit 42f6c9179be4401974dd3a75ee72defd16b5092d: Merge tag 'pull-ppc-2022' of https://github.com/legoater/qemu into staging (2021-11-12 12:28:25 +0100) are available in the Git repository at: git://repo.or.cz/qemu/ke

[PATCH for 6.2 v4] nbd/server: Add --selinux-label option

2021-11-15 Thread Eric Blake
From: "Richard W.M. Jones" Under SELinux, Unix domain sockets have two labels. One is on the disk and can be set with commands such as chcon(1). There is a different label stored in memory (called the process label). This can only be set by the process creating the socket. When using SELinux

[PULL 4/4] hw/rtc/pl031: Send RTC_CHANGE QMP event

2021-11-15 Thread Peter Maydell
From: Eric Auger The PL031 currently is not able to report guest RTC change to the QMP monitor as opposed to mc146818 or spapr RTCs. This patch adds the call to qapi_event_send_rtc_change() when the Load Register is written. The value which is reported corresponds to the difference between the gu

[PULL 0/4] target-arm queue

2021-11-15 Thread Peter Maydell
7;pull-ppc-2022' of https://github.com/legoater/qemu into staging (2021-11-12 12:28:25 +0100) are available in the Git repository at: https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-2025-1 for you to fetch changes up to 1adf528ec3bdf62ea3b580b7ad562534a367

[PULL 2/4] hw/intc/arm_gicv3: Set GICR_TYPER.Last correctly when nb_redist_regions > 1

2021-11-15 Thread Peter Maydell
The 'Last' bit in the GICR_TYPER GICv3 redistributor register is supposed to be set to 1 if this is the last redistributor in a series of contiguous redistributor pages. Currently we set Last only for the redistributor for CPU (num_cpu - 1). This only works if there is a single redistributor regi

[PULL 1/4] hw/intc/arm_gicv3: Move checking of redist-region-count to arm_gicv3_common_realize

2021-11-15 Thread Peter Maydell
The GICv3 devices have an array property redist-region-count. Currently we check this for errors (bad values) in gicv3_init_irqs_and_mmio(), just before we use it. Move this error checking to the arm_gicv3_common_realize() function, where we sanity-check all of the other base-class properties. (Th

[PULL 3/4] hw/intc/arm_gicv3: Support multiple redistributor regions

2021-11-15 Thread Peter Maydell
Our GICv3 QOM interface includes an array property redist-region-count which allows board models to specify that the registributor registers are not in a single contiguous range, but split into multiple pieces. We implemented this for KVM, but currently the TCG GICv3 model insists that there is on

[PATCH] sev: allow capabilities to check for SEV-ES support

2021-11-15 Thread Tyler Fanelli
Probe for SEV-ES and SEV-SNP capabilities to distinguish between Rome, Naples, and Milan processors. Use the CPUID function to probe if a processor is capable of running SEV-ES or SEV-SNP, rather than if it actually is running SEV-ES or SEV-SNP. Signed-off-by: Tyler Fanelli --- qapi/misc-target.

Re: [PATCH 0/2] hw/nvme: fix namespace attachment on controller hotplug

2021-11-15 Thread Klaus Jensen
On Sep 24 09:27, Klaus Jensen wrote: > From: Klaus Jensen > > First patch from Hannes fixes the subsystem registration process such > that shared (but non-detached) namespaces are automatically attached to > hotplugged controllers. > > The second patch changes the default for 'shared' such that

Re: [PATCH v2] hw/rtc/pl031: Send RTC_CHANGE QMP event

2021-11-15 Thread Peter Maydell
On Mon, 15 Nov 2021 at 12:49, Paolo Bonzini wrote: > > On 11/1/21 17:04, Peter Maydell wrote: > > On Thu, 23 Sept 2021 at 14:29, Peter Maydell > > wrote: > >> > >> On Mon, 20 Sept 2021 at 13:25, Eric Auger wrote: > >>> > >>> The PL031 currently is not able to report guest RTC change to the QMP

Re: [PULL 15/26] configure, meson: move pthread_setname_np checks to Meson

2021-11-15 Thread Peter Maydell
On Mon, 15 Nov 2021 at 17:16, Daniel P. Berrangé wrote: > > On Thu, Oct 14, 2021 at 06:29:27PM +0200, Paolo Bonzini wrote: > > This makes the pthreads check dead in configure, so remove it > > as well. > > This change appears broken > > On v6.1.0 > > $ grep SETNAME_NP build/config-host.h > #define

Re: [PULL 15/26] configure, meson: move pthread_setname_np checks to Meson

2021-11-15 Thread Daniel P . Berrangé
On Thu, Oct 14, 2021 at 06:29:27PM +0200, Paolo Bonzini wrote: > This makes the pthreads check dead in configure, so remove it > as well. This change appears broken On v6.1.0 $ grep SETNAME_NP build/config-host.h #define CONFIG_PTHREAD_SETNAME_NP_W_TID 1 While on git master $ grep SETNAME_NP b

"make check" fails in a clang sanitizer build on "nbd-qemu-allocation" iotest

2021-11-15 Thread Peter Maydell
Hi; running a 'make check' on a clang sanitizer build one of the iotests falls over due to a NULL pointer being passed to memset(): TEST iotest-qcow2: nbd-qemu-allocation [fail] QEMU -- "/mnt/nvmedisk/linaro/qemu-from-laptop/qemu/build/arm-clang/tests/qemu-iotests/../../qemu-system-a

Re: [RFC PATCH v2 1/5] virtio: introduce virtio_force_modern()

2021-11-15 Thread Cornelia Huck
On Mon, Nov 15 2021, Halil Pasic wrote: > On Fri, 12 Nov 2021 16:37:20 +0100 > Cornelia Huck wrote: > >> On Fri, Nov 12 2021, Halil Pasic wrote: >> >> > Legacy vs modern should be detected via transport specific means. We >> > can't wait till feature negotiation is done. Let us introduce >> >

Re: Guests wont start with 15 pcie-root-port devices

2021-11-15 Thread Brian Rak
Will this fix make it into 6.2? On 11/12/2021 3:51 PM, Igor Mammedov wrote: On Fri, 12 Nov 2021 17:53:42 + Daniel P. Berrangé wrote: On Fri, Nov 12, 2021 at 12:35:07PM -0500, Brian Rak wrote: In 6.1, a guest with 15 empty pcie-root-port devices will not boot properly - it just hangs on "

Re: [PULL 21/26] configure, meson: move more compiler checks to Meson

2021-11-15 Thread Peter Maydell
On Mon, 15 Nov 2021 at 16:36, Peter Maydell wrote: > > On Thu, 14 Oct 2021 at 17:49, Paolo Bonzini wrote: > > > > Reviewed-by: Marc-André Lureau > > Message-Id: <20211007130829.632254-15-pbonz...@redhat.com> > > Signed-off-by: Paolo Bonzini > > --- > > configure| 91 ---

[PULL 03/20] vhost: Rename last_index to vq_index_end

2021-11-15 Thread Michael S. Tsirkin
From: Eugenio Pérez The doc of this field pointed out that last_index is the last vq index. This is misleading, since it's actually one past the end of the vqs. Renaming and modifying comment. Signed-off-by: Eugenio Pérez Acked-by: Jason Wang Message-Id: <20211104085625.2054959-2-epere...@red

Re: [PULL 21/26] configure, meson: move more compiler checks to Meson

2021-11-15 Thread Peter Maydell
On Mon, 15 Nov 2021 at 16:36, Peter Maydell wrote: > > On Thu, 14 Oct 2021 at 17:49, Paolo Bonzini wrote: > > > > Reviewed-by: Marc-André Lureau > > Message-Id: <20211007130829.632254-15-pbonz...@redhat.com> > > Signed-off-by: Paolo Bonzini > > --- > > configure| 91 ---

[PULL 16/20] pcie: implement slot power control for pcie root ports

2021-11-15 Thread Michael S. Tsirkin
From: Gerd Hoffmann With this patch hot-plugged pci devices will only be visible to the guest if the guests hotplug driver has enabled slot power. This should fix the hot-plug race which one can hit when hot-plugging a pci device at boot, while the guest is in the middle of the pci bus scan. Si

[PULL 20/20] pcie: expire pending delete

2021-11-15 Thread Michael S. Tsirkin
From: Gerd Hoffmann Add an expire time for pending delete, once the time is over allow pressing the attention button again. This makes pcie hotplug behave more like acpi hotplug, where one can try sending an 'device_del' monitor command again in case the guest didn't respond to the first attempt

[PULL 12/20] virtio: use virtio accessor to access packed event

2021-11-15 Thread Michael S. Tsirkin
From: Jason Wang We used to access packed descriptor event and off_wrap via address_space_{write|read}_cached(). When we hit the cache, memcpy() is used which is not atomic which may lead a wrong value to be read or wrote. This patch fixes this by switching to use virito_{stw|lduw}_phys_cached()

[PULL 19/20] pcie: fast unplug when slot power is off

2021-11-15 Thread Michael S. Tsirkin
From: Gerd Hoffmann In case the slot is powered off (and the power indicator turned off too) we can unplug right away, without round-trip to the guest. Also clear pending attention button press, there is nothing to care about any more. Signed-off-by: Gerd Hoffmann Message-Id: <2021130859.1

[PULL 11/20] virtio: use virtio accessor to access packed descriptor flags

2021-11-15 Thread Michael S. Tsirkin
From: Jason Wang We used to access packed descriptor flags via address_space_{write|read}_cached(). When we hit the cache, memcpy() is used which is not an atomic operation which may lead a wrong value is read or wrote. So this patch switches to use virito_{stw|lduw}_phys_cached() to make sure t

[PULL 17/20] pcie: add power indicator blink check

2021-11-15 Thread Michael S. Tsirkin
From: Gerd Hoffmann Refuse to push the attention button in case the guest is busy with some hotplug operation (as indicated by the power indicator blinking). Signed-off-by: Gerd Hoffmann Message-Id: <2021130859.1171890-4-kra...@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Mic

[PULL 15/20] pci: implement power state

2021-11-15 Thread Michael S. Tsirkin
From: Gerd Hoffmann This allows to power off pci devices. In "off" state the devices will not be visible. No pci config space access, no pci bar access, no dma. Default state is "on", so this patch (alone) should not change behavior. Use case: Allows hotplug controllers implement slot power.

[PULL 07/20] hw/acpi/ich9: Add compat prop to keep HPC bit set for 6.1 machine type

2021-11-15 Thread Michael S. Tsirkin
From: Julia Suvorova To solve issues [1-2] the Hot Plug Capable bit in PCIe Slots will be turned on, while the switch to ACPI Hot-plug will be done in the DSDT table. Introducing 'x-keep-native-hpc' property disables the HPC bit only in 6.1 and as a result keeps the forced 'reserve-io' on pcie-r

[PULL 14/20] vdpa: Check for existence of opts.vhostdev

2021-11-15 Thread Michael S. Tsirkin
From: Eugenio Pérez Since net_init_vhost_vdpa is trying to open it. Not specifying it in the command line crash qemu. Fixes: 7327813d17 ("vhost-vdpa: open device fd in net_init_vhost_vdpa()") Signed-off-by: Eugenio Pérez Message-Id: <2022193431.2379298-3-epere...@redhat.com> Acked-by: Jason

[PULL 02/20] softmmu/qdev-monitor: fix use-after-free in qdev_set_id()

2021-11-15 Thread Michael S. Tsirkin
From: Stefan Hajnoczi Reported by Coverity (CID 1465222). Fixes: 4a1d937796de0fecd8b22d7dbebf87f38e8282fd ("softmmu/qdev-monitor: add error handling in qdev_set_id") Cc: Damien Hedde Cc: Kevin Wolf Cc: Michael S. Tsirkin Signed-off-by: Stefan Hajnoczi Message-Id: <20211102163342.31162-1-ste

[PULL 13/20] vdpa: Replace qemu_open_old by qemu_open at

2021-11-15 Thread Michael S. Tsirkin
From: Eugenio Pérez There is no reason to keep using the old one, since we neither use the variadics arguments nor open it with O_DIRECT. Also, net_client_init1, the caller of net_init_vhost_vdpa, wants all net_client_init_fun to use Error API, so it's a good step in that direction. Signed-off-

[PULL 09/20] hw/i386/acpi-build: Deny control on PCIe Native Hot-plug in _OSC

2021-11-15 Thread Michael S. Tsirkin
From: Julia Suvorova There are two ways to enable ACPI PCI Hot-plug: * Disable the Hot-plug Capable bit on PCIe slots. This was the first approach which led to regression [1-2], as I/O space for a port is allocated only when it is hot-pluggable, which is determined by HPC bit.

[PULL 01/20] net/vhost-vdpa: fix memory leak in vhost_vdpa_get_max_queue_pairs()

2021-11-15 Thread Michael S. Tsirkin
From: Stefano Garzarella Use g_autofree to ensure that `config` is freed when vhost_vdpa_get_max_queue_pairs() returns. Reported-by: Coverity (CID 1465228: RESOURCE_LEAK) Fixes: 402378407d ("vhost-vdpa: multiqueue support") Signed-off-by: Stefano Garzarella Message-Id: <20211102155157.241034-1-

[PULL 18/20] pcie: factor out pcie_cap_slot_unplug()

2021-11-15 Thread Michael S. Tsirkin
From: Gerd Hoffmann No functional change. Signed-off-by: Gerd Hoffmann Message-Id: <2021130859.1171890-5-kra...@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/pci/pcie.c | 32 1 file changed, 20 insertions(+), 12 dele

[PULL 10/20] tests: bios-tables-test update expected blobs

2021-11-15 Thread Michael S. Tsirkin
From: Igor Mammedov The changes are the result of 'hw/i386/acpi-build: Deny control on PCIe Native Hot-Plug in _OSC' which hides PCIE hotplug bit in host-bridge _OSC Method (_OSC, 4, NotSerialized) // _OSC: Operating System Capabilities { CreateDWordField (

[PULL 05/20] hw/mem/pc-dimm: Restrict NUMA-specific code to NUMA machines

2021-11-15 Thread Michael S. Tsirkin
From: Philippe Mathieu-Daudé When trying to use the pc-dimm device on a non-NUMA machine, we get: $ qemu-system-arm -M none -cpu max -S \ -object memory-backend-file,id=mem1,size=1M,mem-path=/tmp/1m \ -device pc-dimm,id=dimm1,memdev=mem1 Segmentation fault (core dumped) (gdb)

[PULL 00/20] pci,pc,virtio: bugfixes

2021-11-15 Thread Michael S. Tsirkin
The following changes since commit 0a70bcf18caf7a61d480f8448723c15209d128ef: Update version for v6.2.0-rc0 release (2021-11-09 18:22:57 +0100) are available in the Git repository at: git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream for you to fetch changes up to 18416c62

[PULL 08/20] bios-tables-test: Allow changes in DSDT ACPI tables

2021-11-15 Thread Michael S. Tsirkin
From: Julia Suvorova Prepare for changing the _OSC method in q35 DSDT. Signed-off-by: Julia Suvorova Signed-off-by: Igor Mammedov Acked-by: Ani Sinha Message-Id: <2022110857.3116853-4-imamm...@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- tests/qtest

[PULL 06/20] pcie: rename 'native-hotplug' to 'x-native-hotplug'

2021-11-15 Thread Michael S. Tsirkin
From: Igor Mammedov Mark property as experimental/internal adding 'x-' prefix. Property was introduced in 6.1 and it should have provided ability to turn on native PCIE hotplug on port even when ACPI PCI hotplug is in use is user explicitly sets property on CLI. However that never worked since s

[PULL 04/20] vhost: Fix last vq queue index of devices with no cvq

2021-11-15 Thread Michael S. Tsirkin
From: Eugenio Pérez The -1 assumes that cvq device model is accounted in data_queue_pairs, if cvq does not exists, but it's actually the opposite: Devices with !cvq are ok but devices with cvq does not add the last queue to data_queue_pairs. This is not a problem to vhost-net, but it is to vhost

Re: [PULL 21/26] configure, meson: move more compiler checks to Meson

2021-11-15 Thread Peter Maydell
On Thu, 14 Oct 2021 at 17:49, Paolo Bonzini wrote: > > Reviewed-by: Marc-André Lureau > Message-Id: <20211007130829.632254-15-pbonz...@redhat.com> > Signed-off-by: Paolo Bonzini > --- > configure| 91 > meson.build | 44 +

Re: [PATCH v4 00/25] block layer: split block APIs in global state and I/O

2021-11-15 Thread Daniel P . Berrangé
On Mon, Nov 15, 2021 at 05:03:28PM +0100, Hanna Reitz wrote: > On 25.10.21 12:17, Emanuele Giuseppe Esposito wrote: > > Currently, block layer APIs like block-backend.h contain a mix of > > functions that are either running in the main loop and under the > > BQL, or are thread-safe functions and ru

Re: does drive_get_next(IF_NONE) make sense?

2021-11-15 Thread Thomas Huth
On 15/11/2021 08.12, Alistair Francis wrote: On Mon, Nov 15, 2021 at 3:32 PM Markus Armbruster wrote: Peter Maydell writes: On Fri, 12 Nov 2021 at 13:34, Markus Armbruster wrote: Thomas Huth writes: On 03/11/2021 09.41, Markus Armbruster wrote: Peter Maydell writes: Does it make s

Re: [PATCH v4 00/25] block layer: split block APIs in global state and I/O

2021-11-15 Thread Hanna Reitz
On 25.10.21 12:17, Emanuele Giuseppe Esposito wrote: Currently, block layer APIs like block-backend.h contain a mix of functions that are either running in the main loop and under the BQL, or are thread-safe functions and run in iothreads performing I/O. The functions running under BQL also take

Re: [PATCH RFC 0/2] Eliminate drive_get_next()

2021-11-15 Thread Markus Armbruster
Peter Maydell writes: > On Mon, 15 Nov 2021 at 12:55, Markus Armbruster wrote: >> >> This is RFC because I'm unsure about the removal of >> >> /* Reason: init() method uses drive_get_next() */ >> dc->user_creatable = false; >> >> in PATCH 1. Both users appear to wire up some GPIO. If t

Re: [PATCH RFC 2/2] hw: Replace drive_get_next() by drive_get()

2021-11-15 Thread Markus Armbruster
Philippe Mathieu-Daudé writes: > On 11/15/21 13:55, Markus Armbruster wrote: >> drive_get_next() is basically a bad idea. It returns the "next" block >> backend of a certain interface type. "Next" means bus=0,unit=N, where >> subsequent calls count N up from zero, per interface type. >> >> Thi

Re: [PATCH] qmp: Stabilize preconfig

2021-11-15 Thread Markus Armbruster
Paolo Bonzini writes: > On 11/13/21 08:52, Markus Armbruster wrote: >> I'm not asking what to do "if it hurts", or "if you want a cold-plugged >> device". I'm asking whether there's a reason for ever wanting hot plug >> instead of cold plug. Or in other words, what can hot plug possibly >> gain

Re: does drive_get_next(IF_NONE) make sense?

2021-11-15 Thread Markus Armbruster
Peter Maydell writes: > On Mon, 15 Nov 2021 at 13:24, Kevin Wolf wrote: >> Same question as for Hao Wu's series: Wouldn't the proper solution be to >> add a drive property to the machine type? >> >> If you can't use -blockdev, it's not done right. > > Is there an example of "doing it right" for

On configuring onboard block devices with -blockdev (was: [PATCH v4 6/7] hw/nvram: Update at24c EEPROM init function in NPCM7xx boards)

2021-11-15 Thread Markus Armbruster
Kevin Wolf writes: > Am 03.11.2021 um 23:01 hat Hao Wu geschrieben: >> We made 3 changes to the at24c_eeprom_init function in >> npcm7xx_boards.c: >> >> 1. We allow the function to take a I2CBus* as parameter. This allows >>us to attach an EEPROM device behind an I2C mux which is not >>p

Re: [PATCH v4 03/25] assertions for block global state API

2021-11-15 Thread Hanna Reitz
On 15.11.21 13:27, Emanuele Giuseppe Esposito wrote: @@ -586,12 +589,14 @@ void bdrv_unapply_subtree_drain(BdrvChild *child, BlockDriverState *old_parent)   void coroutine_fn bdrv_co_drain(BlockDriverState *bs)   {   assert(qemu_in_coroutine()); +    assert(qemu_in_main_thread());   bd

[PATCH-for-7.0 v4 08/11] tests/unit/test-smp-parse: Add 'smp-without-dies-valid' machine type

2021-11-15 Thread Philippe Mathieu-Daudé
Keep the common TYPE_MACHINE class initialization in machine_base_class_init(), make it abstract, and move the non-common code to a new class: "smp-without-dies-valid". Signed-off-by: Philippe Mathieu-Daudé --- tests/unit/test-smp-parse.c | 19 +++ 1 file changed, 15 insertions(+

[PATCH-for-7.0 v4 07/11] tests/unit/test-smp-parse: Add 'smp-without-dies-invalid' machine type

2021-11-15 Thread Philippe Mathieu-Daudé
Avoid modifying the MachineClass internals by adding the 'smp-without-dies-invalid' machine, which inherits from TYPE_MACHINE. Signed-off-by: Philippe Mathieu-Daudé --- tests/unit/test-smp-parse.c | 26 -- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/te

[PATCH-for-6.2 v4 01/11] tests/unit/test-smp-parse: Restore MachineClass fields after modifying

2021-11-15 Thread Philippe Mathieu-Daudé
There is a single MachineClass object, registered with type_register_static(&smp_machine_info). Since the same object is used multiple times (an MachineState object is instantiated in both test_generic and test_with_dies), we should restore its internal state after modifying for the test purpose.

[PATCH v4 00/11] tests/unit: Fix test-smp-parse

2021-11-15 Thread Philippe Mathieu-Daudé
Missing review: patches #4 to #8 (new) Yet another approach to fix test-smp-parse. v2 from Yanan Wang: https://lore.kernel.org/qemu-devel/2021024429.10568-1-wangyana...@huawei.com/ Here we use the QOM class_init() to avoid having to deal with object_unref() and deinit(). Since v3: - Restore

Re: does drive_get_next(IF_NONE) make sense?

2021-11-15 Thread Kevin Wolf
Am 15.11.2021 um 14:31 hat Peter Maydell geschrieben: > On Mon, 15 Nov 2021 at 13:24, Kevin Wolf wrote: > > Same question as for Hao Wu's series: Wouldn't the proper solution be to > > add a drive property to the machine type? > > > > If you can't use -blockdev, it's not done right. > > Is there

Re: [PATCH v4 24/25] job.h: split function pointers in JobDriver

2021-11-15 Thread Hanna Reitz
On 25.10.21 12:17, Emanuele Giuseppe Esposito wrote: The job API will be handled separately in another serie. Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Stefan Hajnoczi --- include/qemu/job.h | 16 1 file changed, 16 insertions(+) diff --git a/include/qemu/job.

[PULL 07/13] transactions: Invoke clean() after everything else

2021-11-15 Thread Kevin Wolf
From: Hanna Reitz Invoke the transaction drivers' .clean() methods only after all .commit() or .abort() handlers are done. This makes it easier to have nested transactions where the top-level transactions pass objects to lower transactions that the latter can still use throughout their commit/ab

Re: [PATCH v2 0/3] virtio: increase VIRTQUEUE_MAX_SIZE to 32k

2021-11-15 Thread Christian Schoenebeck
On Montag, 15. November 2021 12:54:32 CET Stefan Hajnoczi wrote: > On Thu, Nov 11, 2021 at 06:54:03PM +0100, Christian Schoenebeck wrote: > > On Donnerstag, 11. November 2021 17:31:52 CET Stefan Hajnoczi wrote: > > > On Wed, Nov 10, 2021 at 04:53:33PM +0100, Christian Schoenebeck wrote: > > > > On

[PULL 09/13] block: Let replace_child_noperm free children

2021-11-15 Thread Kevin Wolf
From: Hanna Reitz In most of the block layer, especially when traversing down from other BlockDriverStates, we assume that BdrvChild.bs can never be NULL. When it becomes NULL, it is expected that the corresponding BdrvChild pointer also becomes NULL and the BdrvChild object is freed. Therefore

[PATCH-for-7.0 v4 09/11] tests/unit/test-smp-parse: Simplify pointer to compound literal use

2021-11-15 Thread Philippe Mathieu-Daudé
We can simply use a local variable (and pass its pointer) instead of a pointer to a compound literal. Reviewed-by: Andrew Jones Reviewed-by: Richard Henderson Reviewed-by: Yanan Wang Tested-by: Yanan Wang Signed-off-by: Philippe Mathieu-Daudé --- tests/unit/test-smp-parse.c | 66

Re: [PATCH] gitlab-ci: Split custom-runners.yml in one file per runner

2021-11-15 Thread Philippe Mathieu-Daudé
On 11/15/21 15:33, Thomas Huth wrote: > On 15/11/2021 10.56, Philippe Mathieu-Daudé wrote: >> To ease maintenance, add the custom-runners/ directory and >> split custom-runners.yml in 3 files, all included by the >> current custom-runners.yml: >>   - ubuntu-18.04-s390x.yml >>   - ubuntu-20.04-aarch

[PATCH-for-7.0 v4 11/11] hw/core: Rename smp_parse() -> machine_parse_smp_config()

2021-11-15 Thread Philippe Mathieu-Daudé
All methods related to MachineState are prefixed with "machine_". smp_parse() does not need to be an exception. Rename it and const'ify the SMPConfiguration argument, since it doesn't need to be modified. Reviewed-by: Andrew Jones Reviewed-by: Richard Henderson Reviewed-by: Yanan Wang Tested-by

  1   2   >