[PATCH] make-release: do not ship dtc sources

2023-09-26 Thread Paolo Bonzini
A new enough libfdt is included in all of Debian 11, Ubuntu 20.04 and MSYS2. It has also been included for several minor releases in Fedora and openSUSE Leap, as well as in CentOS. Therefore there is no need anymore to ship the sources together with the QEMU tarballs. Keep the wrap file so that

[v2] Help wanted for enabling -Wshadow=local

2023-09-26 Thread Markus Armbruster
Brian, Gerd, Jason, Marc-André, Michael, we need your help to enable -Wshadow=local. Paolo, you already took care of several subsystems (thanks!), except you left a few warnings in target/i386/tcg/seg_helper.c. Local variables shadowing other local variables or parameters make the code needlessl

Re: [PATCH 1/1] hw/ide/core: terminate in-flight DMA on IDE bus reset

2023-09-26 Thread John Snow
On Tue, Sep 26, 2023, 3:11 AM Fiona Ebner wrote: > Am 25.09.23 um 21:53 schrieb John Snow: > > On Thu, Sep 21, 2023 at 12:07 PM Simon Rowe > wrote: > >> > >> When an IDE controller is reset, its internal state is being cleared > >> before any outstanding I/O is cancelled. If a response to DMA is

Re: [PATCH 09/12] kvm-all: introduce limits for name_size and num_desc

2023-09-26 Thread Vladimir Sementsov-Ogievskiy
On 26.09.23 14:05, Peter Maydell wrote: On Mon, 25 Sept 2023 at 20:43, Vladimir Sementsov-Ogievskiy wrote: Coverity doesn't like when the value with unchecked bounds that comes from fd is used as length for IO or allocation. And really, that's not a good practice. Let's introduce at least an e

Re: [PATCH v1 0/4] vfio: report NUMA nodes for device memory

2023-09-26 Thread Ankit Agrawal
Good idea.  Fundamentally the device should not be creating NUMA nodes, the VM should be configured with NUMA nodes and the device memory associated with those nodes. >>> >>> +1. That would also make it fly with DIMMs and virtio-mem, where you >>> would want NUMA-less nodes ass well

Re: [PATCH] target/i386/seg_helper: remove shadowed variable

2023-09-26 Thread Markus Armbruster
Paolo Bonzini writes: > Il mar 26 set 2023, 15:16 Markus Armbruster ha scritto: > >> I still get these: >> >> ../target/i386/tcg/seg_helper.c: In function ‘switch_tss_ra’: >> ../target/i386/tcg/seg_helper.c:344:22: warning: declaration of ‘ptr’ >> shadows a previous local [-Wshadow=compatible-lo

Re: [PATCH v1 3/4] hw/arm/virt-acpi-build: patch guest SRAT for NUMA nodes

2023-09-26 Thread Ankit Agrawal
> With an ACPI spec clarification agreed then I'm fine with > using this for all the cases that have come up in this thread. > Or a good argument that this is valid in under existing ACPI spec. Hi Jonathan I looked at the Section 5.2.16 in ACPI spec doc, but could not see any mention of whether s

Re: [PATCH 4/4] hw/arm/smmuv3-internal.h: Don't use locals in statement macros

2023-09-26 Thread Eric Auger
Hi Peter, On 9/22/23 17:29, Peter Maydell wrote: > The STE_CTXPTR() and STE_S2TTB() macros both extract two halves > of an address from fields in the STE and combine them into a > single value to return. The current code for this uses a GCC > statement expression. There are two problems with this:

Re: [PATCH 3/4] hw/arm/smmuv3.c: Avoid shadowing variable

2023-09-26 Thread Eric Auger
Hi Peter, On 9/22/23 17:29, Peter Maydell wrote: > Avoid shadowing a variable in smmuv3_notify_iova(): > > ../../hw/arm/smmuv3.c: In function ‘smmuv3_notify_iova’: > ../../hw/arm/smmuv3.c:1043:23: warning: declaration of ‘event’ shadows a > previous local [-Wshadow=local] > 1043 | SMMUEv

Re: [PATCH v6 1/2] tpm: convert tpmdev options processing to new visitor format

2023-09-26 Thread Stefan Berger
On 1/9/23 11:15, James Bottomley wrote: From: James Bottomley Instead of processing the tpmdev options using the old qemu options, convert to the new visitor format which also allows the passing of json on the command line. Signed-off-by: James Bottomley $ ./scripts/checkpatch.pl 0001-tp

Re: [PATCH 1/3] hw/arm/smmuv3: Update ID register bit field definitions

2023-09-26 Thread Eric Auger
Hi Peter, On 9/14/23 16:57, Peter Maydell wrote: > Update the SMMUv3 ID register bit field definitions to the > set in the most recent specification (IHI0700 F.a). > > Signed-off-by: Peter Maydell > --- > hw/arm/smmuv3-internal.h | 38 ++ > 1 file changed, 38

Re: [v2] Help wanted for enabling -Wshadow=local

2023-09-26 Thread Markus Armbruster
Markus Armbruster writes: > Brian, Gerd, Jason, Marc-André, Michael, we need your help to enable > -Wshadow=local. > > Paolo, you already took care of several subsystems (thanks!), except you > left a few warnings in target/i386/tcg/seg_helper.c. Nope, I missed a patch; seg_helper.c is clean, to

Re: [PATCH 2/3] hw/arm/smmuv3: Sort ID register setting into field order

2023-09-26 Thread Eric Auger
On 9/14/23 16:57, Peter Maydell wrote: > In smmuv3_init_regs() when we set the various bits in the ID > registers, we do this almost in order of the fields in the > registers, but not quite. Move the initialization of > SMMU_IDR3.RIL and SMMU_IDR5.OAS into their correct places. > > Signed-off-by

Re: [PATCH v3 0/4] block: clean up coroutine versions of bdrv_{is_allocated, block_status}*

2023-09-26 Thread Paolo Bonzini
On Mon, Sep 4, 2023 at 12:03 PM Paolo Bonzini wrote: > > Provide coroutine versions of bdrv_is_allocated* and bdrv_block_status*, > since the underlying BlockDriver API is coroutine-based, and use > automatically-generated wrappers for the "mixed" versions. > > v2->v3: cleaned up formatting Ping.

Re: [PATCH 3/4] target/i386: enumerate VMX nested-exception support

2023-09-26 Thread Paolo Bonzini
On 9/1/23 07:30, Xin Li wrote: Allow VMX nested-exception support to be exposed in KVM guests, thus nested KVM guests can enumerate it. Tested-by: Shan Kang Signed-off-by: Xin Li --- target/i386/cpu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/i386/cpu.c b/target/i386/cpu.c

Re: [PATCH 3/3] hw/arm/smmuv3: Advertise SMMUv3.1-XNX feature

2023-09-26 Thread Eric Auger
Hi Peter, On 9/14/23 16:57, Peter Maydell wrote: > The SMMUv3.1-XNX feature is mandatory for an SMMUv3.1 if S2P is > supported, so we should theoretically have implemented it as part of > the recent S2P work. Fortunately, for us the implementation is a > no-op. > > This feature is about interpret

Re: [PATCH 1/4] hw/intc/arm_gicv3_its: Avoid shadowing variable in do_process_its_cmd()

2023-09-26 Thread Eric Auger
On 9/22/23 17:29, Peter Maydell wrote: > Avoid shadowing a local variable in do_process_its_cmd(): > > ../../hw/intc/arm_gicv3_its.c:548:17: warning: declaration of ‘ite’ shadows a > previous local [-Wshadow=compatible-local] > 548 | ITEntry ite = {}; > | ^~~ > .

Re: [v2] Help wanted for enabling -Wshadow=local

2023-09-26 Thread Paolo Bonzini
On 9/26/23 16:42, Markus Armbruster wrote: Overall Audio backends M: Gerd Hoffmann M: Marc-André Lureau audio/audio.c I can handle this too, but I first need to send out my next pull request. Paolo

Re: [PATCH] make-release: do not ship dtc sources

2023-09-26 Thread Marc-André Lureau
On Tue, Sep 26, 2023 at 6:43 PM Paolo Bonzini wrote: > > A new enough libfdt is included in all of Debian 11, Ubuntu 20.04 > and MSYS2. It has also been included for several minor releases > in Fedora and openSUSE Leap, as well as in CentOS. Therefore > there is no need anymore to ship the sourc

[PATCH] audio: remove shadowed locals

2023-09-26 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- audio/audio.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/audio/audio.c b/audio/audio.c index 90c7c49d116..2f479657117 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -1706,7 +1706,7 @@ static AudioState *audio_init(Audiodev *

Re: [PATCH 2/4] hw/misc/arm_sysctl.c: Avoid shadowing local variable

2023-09-26 Thread Eric Auger
On 9/22/23 17:29, Peter Maydell wrote: > Avoid shadowing a local variable in arm_sysctl_write(): > > ../../hw/misc/arm_sysctl.c: In function ‘arm_sysctl_write’: > ../../hw/misc/arm_sysctl.c:537:26: warning: declaration of ‘val’ shadows a > parameter [-Wshadow=local] > 537 | ui

[PATCH] e1000: remove old compatibility code

2023-09-26 Thread Paolo Bonzini
This code is not needed anymore in the supported machine types. Signed-off-by: Paolo Bonzini --- Requires the patch to remove pc-i440fx-1.4 to 1.7, which is going in a pull request as soon as testing finishes. hw/net/e1000.c | 79 +

Re: [v2] Help wanted for enabling -Wshadow=local

2023-09-26 Thread Warner Losh
On Tue, Sep 26, 2023 at 8:43 AM Markus Armbruster wrote: > Brian, Gerd, Jason, Marc-André, Michael, we need your help to enable > -Wshadow=local. > > Paolo, you already took care of several subsystems (thanks!), except you > left a few warnings in target/i386/tcg/seg_helper.c. > > > Local variabl

[PATCH] pc: remove short_root_bus property

2023-09-26 Thread Paolo Bonzini
The property was only used on QEMU 1.6 machine types. Signed-off-by: Paolo Bonzini --- Requires the patch to remove pc-i440fx-1.4 to 1.7, which is going in a pull request as soon as testing finishes. hw/pci-host/i440fx.c | 8 hw/pci-host/q35.c | 7 ---

RE: [PATCH v3 2/7] Update CPUs AML with cpu-(ctrl)dev change

2023-09-26 Thread Salil Mehta via
> From: Michael S. Tsirkin > Sent: Tuesday, September 26, 2023 1:07 PM > To: Salil Mehta > Cc: xianglai li ; qemu-devel@nongnu.org; Bernhard > Beschow ; Salil Mehta ; Xiaojuan > Yang ; Song Gao ; Igor > Mammedov ; Ani Sinha ; Paolo > Bonzini ; Richard Henderson > ; Eduardo Habkost ; > Marcel Apfe

[PATCH] target/arm/arm-powerctl: Correctly init CPUs when powered on to lower EL

2023-09-26 Thread Peter Maydell
The code for powering on a CPU in arm-powerctl.c has two separate use cases: * emulation of a real hardware power controller * emulation of firmware interfaces (primarily PSCI) with CPU on/off APIs For the first case, we only need to reset the CPU and set its starting PC and X0. For the seco

Re: [PATCH] audio: remove shadowed locals

2023-09-26 Thread Marc-André Lureau
On Tue, Sep 26, 2023 at 7:50 PM Paolo Bonzini wrote: > > Signed-off-by: Paolo Bonzini Reviewed-by: Marc-André Lureau > --- > audio/audio.c | 11 +-- > 1 file changed, 5 insertions(+), 6 deletions(-) > > diff --git a/audio/audio.c b/audio/audio.c > index 90c7c49d116..2f479657117 100644

[PATCH 0/5] RFC: migration: check required entries and sections are loaded

2023-09-26 Thread marcandre . lureau
From: Marc-André Lureau Hi, To my surprise, QEMU didn't seem to check that required migration entries and subsections are loaded. I took a naive approach to add such check, by adding some "visited" marks along the loading path, and checking by the end that all required entries have been loaded.

[PATCH 4/5] RFC: migration: check required subsections are loaded, once

2023-09-26 Thread marcandre . lureau
From: Marc-André Lureau Check that required subsections have been loaded. Signed-off-by: Marc-André Lureau --- migration/vmstate.c | 40 ++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/migration/vmstate.c b/migration/vmstate.c index 31842

[PATCH 2/5] virtio: make endian_needed() work during loading

2023-09-26 Thread marcandre . lureau
From: Marc-André Lureau There is no simple way to distinguish when the callback is used for load or save, AFAICT. Signed-off-by: Marc-André Lureau --- hw/virtio/virtio.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 4577f

[PATCH 5/5] RFC: migration: check required entries are loaded, once

2023-09-26 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- migration/savevm.c | 43 +++ 1 file changed, 43 insertions(+) diff --git a/migration/savevm.c b/migration/savevm.c index bb3e99194c..6a17bb0f73 100644 --- a/migration/savevm.c +++ b/migration/s

[PATCH 3/5] net/slirp: use different IDs for each instance

2023-09-26 Thread marcandre . lureau
From: Marc-André Lureau Using always 0, QEMU will end up loading the same instance, even if multiple have been saved. Signed-off-by: Marc-André Lureau --- net/slirp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/slirp.c b/net/slirp.c index c33b3e02e7..af1451b60f 10

[PATCH 1/5] block/fdc: 'phase' is not needed on load

2023-09-26 Thread marcandre . lureau
From: Marc-André Lureau It is reconstructed during fdc_post_load() Signed-off-by: Marc-André Lureau --- hw/block/fdc.c | 5 + 1 file changed, 5 insertions(+) diff --git a/hw/block/fdc.c b/hw/block/fdc.c index d7cc4d3ec1..fc71660ba0 100644 --- a/hw/block/fdc.c +++ b/hw/block/fdc.c @@ -1005

Re: [PATCH] make-release: do not ship dtc sources

2023-09-26 Thread Peter Maydell
On Tue, 26 Sept 2023 at 15:42, Paolo Bonzini wrote: > > A new enough libfdt is included in all of Debian 11, Ubuntu 20.04 > and MSYS2. It has also been included for several minor releases > in Fedora and openSUSE Leap, as well as in CentOS. Therefore > there is no need anymore to ship the source

[PATCH v8 2/5] apic: add support for x2APIC mode

2023-09-26 Thread Bui Quang Minh
This commit extends the APIC ID to 32-bit long and remove the 255 max APIC ID limit in userspace APIC. The array that manages local APICs is now dynamically allocated based on the max APIC ID of created x86 machine. Also, new x2APIC IPI destination determination scheme, self IPI and x2APIC mode reg

[PATCH v8 0/5] Support x2APIC mode with TCG accelerator

2023-09-26 Thread Bui Quang Minh
Hi everyone, This series implements x2APIC mode in userspace local APIC and the RDMSR/WRMSR helper to access x2APIC registers in x2APIC mode. Intel iommu and AMD iommu are adjusted to support x2APIC interrupt remapping. With this series, we can now boot Linux kernel into x2APIC mode with TCG accel

[PATCH v8 3/5] apic, i386/tcg: add x2apic transitions

2023-09-26 Thread Bui Quang Minh
This commit adds support for x2APIC transitions when writing to MSR_IA32_APICBASE register and finally adds CPUID_EXT_X2APIC to TCG_EXT_FEATURES. Reviewed-by: Michael S. Tsirkin Signed-off-by: Bui Quang Minh --- hw/intc/apic.c | 50 hw/intc/api

[PATCH v8 4/5] intel_iommu: allow Extended Interrupt Mode when using userspace APIC

2023-09-26 Thread Bui Quang Minh
As userspace APIC now supports x2APIC, intel interrupt remapping hardware can be set to EIM mode when userspace local APIC is used. Suggested-by: Joao Martins Acked-by: Peter Xu Signed-off-by: Bui Quang Minh --- hw/i386/intel_iommu.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-)

[PATCH v8 1/5] i386/tcg: implement x2APIC registers MSR access

2023-09-26 Thread Bui Quang Minh
This commit refactors apic_mem_read/write to support both MMIO access in xAPIC and MSR access in x2APIC. Reviewed-by: Michael S. Tsirkin Signed-off-by: Bui Quang Minh --- hw/intc/apic.c | 79 ++-- hw/intc/trace-events | 4 +- includ

Re: [PATCH] make-release: do not ship dtc sources

2023-09-26 Thread Paolo Bonzini
On Tue, Sep 26, 2023 at 6:00 PM Peter Maydell wrote: > > Keep the wrap file so that it can be used with --enable-download, > > but do not ship the sources anymore with either archive-source.sh > > or make-release. > > Can you explain this use case in a little more detail? I'm > clear on the two po

[PATCH v8 5/5] amd_iommu: report x2APIC support to the operating system

2023-09-26 Thread Bui Quang Minh
This commit adds XTSup configuration to let user choose to whether enable this feature or not. When XTSup is enabled, additional bytes in IRTE with enabled guest virtual VAPIC are used to support 32-bit destination id. Additionally, this commit exports IVHD type 0x11 besides the old IVHD type 0x10

Re: [PULL 0/7] NBD patches through 2023-09-25

2023-09-26 Thread Stefan Hajnoczi
Applied, thanks. Please update the changelog at https://wiki.qemu.org/ChangeLog/8.2 for any user-visible changes. signature.asc Description: PGP signature

[PATCH 1/5] migration: Store downtime timestamps in an array

2023-09-26 Thread Joao Martins
Right now downtime_start is stored in MigrationState. In preparation to having more downtime timestamps during switchover, move downtime_start to an array namely, @timestamp. Add a setter/getter surrounding which timestamps to record, to make it easier to spread to various migration functions. S

[PATCH 2/5] migration: Collect more timestamps during switchover

2023-09-26 Thread Joao Martins
In addition to the start of switchover (previously @downtime_start), add other timestamps during saving of state and return path. For precopy migration, it should be able to capture the principal steps of switchover. Resume-side downtime is sadly only possible when return path is enabled. Signed-

[PATCH 5/5] migration: Print expected-downtime on completion

2023-09-26 Thread Joao Martins
Right now, migration statistics either print downtime or expected downtime depending on migration completing of in progress. Also in the beginning of migration by printing the downtime limit as expected downtime, when estimation is not available. The pending_size is private in migration iteration

[PATCH 3/5] migration: Add a tracepoint for the downtime stats

2023-09-26 Thread Joao Martins
To facilitate understanding of what constitutes downtime, add a tracepoint that gives the downtime breakdown throughout all steps of switchover. Signed-off-by: Joao Martins --- migration/migration.c | 34 ++ migration/trace-events | 1 + 2 files changed, 35 inse

[PATCH 4/5] migration: Provide QMP access to downtime stats

2023-09-26 Thread Joao Martins
Deliver the downtime breakdown also via `query-migrate` to allow users to understand what their downtime value represents. Signed-off-by: Joao Martins --- qapi/migration.json | 22 ++ migration/migration.c | 14 ++ 2 files changed, 36 insertions(+) diff --git a

[PATCH 0/5] migration: Downtime observability improvements

2023-09-26 Thread Joao Martins
Hey, The cost of switchover is usually not accounted in the migration algorithm, as the migration algorithm reduces all of it to "pending bytes" fitting a "threshold" (which represents some available or proactively-measured link bandwidth) as the rule of thumb to calculate downtime. External late

Re: [PATCH v8 0/5] Support x2APIC mode with TCG accelerator

2023-09-26 Thread Bui Quang Minh
On 9/26/23 23:06, Bui Quang Minh wrote: Version 8 changes, - Patch 2, 4: + Rebase to master and resolve conflicts in these 2 patches The conflicts when rebasing is due to the commit 9926cf34de5fa15da ("target/i386: Allow elision of kvm_enable_x2apic()"). AFAIK, this commit adds kvm_enable

Re: [PATCH v2 12/22] hw/m68k: Clean up local variable shadowing

2023-09-26 Thread Thomas Huth
On 04/09/2023 18.12, Philippe Mathieu-Daudé wrote: Fix: hw/m68k/virt.c:263:13: error: declaration shadows a local variable [-Werror,-Wshadow] BOOTINFOSTR(param_ptr, BI_COMMAND_LINE, ^ hw/m68k/bootinfo.h:47:13: note: expanded from macro 'BOOTINFOSTR' int

Re: [PATCH] disas/m68k: clean up local variable shadowing

2023-09-26 Thread Thomas Huth
On 25/09/2023 10.44, Laurent Vivier wrote: Fix following warnings .../disas/m68k.c: In function ‘print_insn_arg’: .../disas/m68k.c:1635:13: warning: declaration of ‘val’ shadows a previous local [-Wshadow=compatible-local] 1635 | int val = fetch_arg (buffer, place, 5, info); |

Re: [PATCH v5 00/14] simpletrace: refactor and general improvements

2023-09-26 Thread Stefan Hajnoczi
On Tue, Sep 26, 2023 at 12:34:22PM +0200, Mads Ynddal wrote: > From: Mads Ynddal > > I wanted to use simpletrace.py for an internal project, so I tried to update > and polish the code. Some of the commits resolve specific issues, while some > are more subjective. > > I've tried to divide it into

Re: FreeBSD 13.2 installer does not see AHCI devices on aarch64/sbsa-ref and x86-64/q35

2023-09-26 Thread John Snow
On Tue, Sep 26, 2023, 8:06 AM Niklas Cassel wrote: > Hello Marcin, > > I will have a look at this. > > > Kind regards, > Niklas > Thanks. You have my blessing in advance to get any hot fixes for this merged ASAP, as long as another block maintainer is willing to give it an ACK. (I'll try to be p

Re: [PATCH v2 01/12] scripts/update-linux-headers: Add iommufd.h

2023-09-26 Thread Cédric Le Goater
On 9/26/23 13:32, Zhenzhong Duan wrote: From: Eric Auger Update the script to import iommufd.h Signed-off-by: Eric Auger Signed-off-by: Yi Liu Signed-off-by: Zhenzhong Duan Reviewed-by: Cédric Le Goater Thanks, C. --- scripts/update-linux-headers.sh | 3 ++- 1 file changed, 2 in

Re: [PATCH v2 02/12] linux-headers: Add iommufd.h

2023-09-26 Thread Cédric Le Goater
On 9/26/23 13:32, Zhenzhong Duan wrote: Since commit da3c22c74a3c ("linux-headers: Update to Linux v6.6-rc1"), linux-headers has been updated to v6.6-rc1. As previous patch added iommufd.h to update-linux-headers.sh, run the script again against TAG v6.6-rc1 to have iommufd.h included. Signed-o

Re: [PATCH v2 03/12] vfio/common: Move IOMMU agnostic helpers to a separate file

2023-09-26 Thread Cédric Le Goater
On 9/26/23 13:32, Zhenzhong Duan wrote: From: Yi Liu Move low-level iommu agnostic helpers to a separate helpers.c file. They relate to regions, interrupts, device/region capabilities and etc. Signed-off-by: Eric Auger Signed-off-by: Yi Sun Signed-off-by: Yi Liu Signed-off-by: Zhenzhong Dua

Re: [PATCH] hw/nvme: Clean up local variable shadowing in nvme_ns_init()

2023-09-26 Thread Jesper Wendel Devantier
Klaus Jensen writes: > From: Klaus Jensen > > Fix local variable shadowing in nvme_ns_init(). > > Reported-by: Markus Armbruster > Signed-off-by: Klaus Jensen > --- > hw/nvme/ns.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/hw/nvme/ns.c b/hw/nvme/ns.c > inde

Re: [PATCH v1 0/4] vfio: report NUMA nodes for device memory

2023-09-26 Thread David Hildenbrand
On 26.09.23 16:52, Ankit Agrawal wrote: Good idea.  Fundamentally the device should not be creating NUMA nodes, the VM should be configured with NUMA nodes and the device memory associated with those nodes. +1. That would also make it fly with DIMMs and virtio-mem, where you would want NUMA-les

[PULL 01/19] pc_piix: remove pc-i440fx-1.4 up to pc-i440fx-1.7

2023-09-26 Thread Paolo Bonzini
These are the last users of the 128K SeaBIOS blob in the i440FX family. Removing them allows us to drop PCI support from the 128K blob, thus making it easier to update SeaBIOS to newer versions. Reviewed-by: Thomas Huth Signed-off-by: Paolo Bonzini --- docs/about/deprecated.rst | 8 -

[PULL 03/19] user-exec-stub: remove unused variable

2023-09-26 Thread Paolo Bonzini
enable_cpu_pm is only used by softmmu-specific code, namely target/i386/host-cpu.c and target/i386/kvm/*. It does not need a stub definition anymore. Signed-off-by: Paolo Bonzini --- accel/tcg/user-exec-stub.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/accel/tcg/user-exec-stub.c b/ac

[PULL 07/19] ui/vnc: fix handling of VNC_FEATURE_XVP

2023-09-26 Thread Paolo Bonzini
VNC_FEATURE_XVP was not shifted left before adding it to vs->features, so it was never enabled; but it was also checked the wrong way with a logical AND instead of vnc_has_feature. Fix both places. Signed-off-by: Paolo Bonzini --- ui/vnc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(

[PULL 13/19] target/i386/translate: avoid shadowed local variables

2023-09-26 Thread Paolo Bonzini
Just remove the declaration. There is nothing in the function after the switch statement, so it is safe to do. Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/transl

[PULL 16/19] target/i386/svm_helper: eliminate duplicate local variable

2023-09-26 Thread Paolo Bonzini
This shadows an outer "cs" variable that is initialized to the same expression. Signed-off-by: Paolo Bonzini --- target/i386/tcg/sysemu/svm_helper.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/target/i386/tcg/sysemu/svm_helper.c b/target/i386/tcg/sysemu/svm_helper.c index 2d27731b608..

[PULL 05/19] vl: remove shadowed local variables

2023-09-26 Thread Paolo Bonzini
Reviewed-by: Daniel P. Berrangé Signed-off-by: Paolo Bonzini --- softmmu/vl.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/softmmu/vl.c b/softmmu/vl.c index db04f98c36f..59a472a0b10 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -3214,7 +3214,6 @@ void qemu_init(

[PULL 19/19] audio: remove shadowed locals

2023-09-26 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- audio/audio.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/audio/audio.c b/audio/audio.c index 90c7c49d116..2f479657117 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -1706,7 +1706,7 @@ static AudioState *audio_init(Audiodev *

[PULL 08/19] mptsas: avoid shadowed local variables

2023-09-26 Thread Paolo Bonzini
Rename the argument so that "addr" is only used inside the for loop. Signed-off-by: Paolo Bonzini --- hw/scsi/mptsas.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/scsi/mptsas.c b/hw/scsi/mptsas.c index 3de288b454c..75d3ab8bd18 100644 --- a/hw/scsi/mptsas.c +++ b/

[PULL 00/19] Misc patches for 2023-09-26

2023-09-26 Thread Paolo Bonzini
The following changes since commit 494a6a2cf7f775d2c20fd6df9601e30606cc2014: Merge tag 'pull-request-2023-09-25' of https://gitlab.com/thuth/qemu into staging (2023-09-25 10:10:30 -0400) are available in the Git repository at: https://gitlab.com/bonzini/qemu.git tags/for-upstream for you t

[PULL 10/19] m48t59-test: avoid possible overflow on ABS

2023-09-26 Thread Paolo Bonzini
Originally meant to avoid a shadowed variable "s", which was fixed by renaming the outer declaration to "qts". Avoid the chance of an overflow in the computation of ABS(t - s). Signed-off-by: Paolo Bonzini --- tests/qtest/m48t59-test.c | 17 ++--- 1 file changed, 10 insertions(+), 7

[PULL 15/19] target/i386/seg_helper: remove shadowed variable

2023-09-26 Thread Paolo Bonzini
Return the width of the new task directly from switch_tss_ra. Signed-off-by: Paolo Bonzini --- target/i386/tcg/seg_helper.c | 22 ++ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/target/i386/tcg/seg_helper.c b/target/i386/tcg/seg_helper.c index b5198db82bc..

[PULL 12/19] target/i386/cpu: avoid shadowed local variables

2023-09-26 Thread Paolo Bonzini
Reuse the pointer variable used for the unversioned model. Signed-off-by: Paolo Bonzini --- target/i386/cpu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 7836aa6692f..ed72883bf33 100644 --- a/target/i386/cpu.c +++ b/target/i38

[PULL 04/19] hw/scsi/scsi-disk: Disallow block sizes smaller than 512 [CVE-2023-42467]

2023-09-26 Thread Paolo Bonzini
From: Thomas Huth We are doing things like nb_sectors /= (s->qdev.blocksize / BDRV_SECTOR_SIZE); in the code here (e.g. in scsi_disk_emulate_mode_sense()), so if the blocksize is smaller than BDRV_SECTOR_SIZE (=512), this crashes with a division by 0 exception. Thus disallow block sizes of

[PULL 14/19] target/i386/seg_helper: introduce tss_set_busy

2023-09-26 Thread Paolo Bonzini
Eliminate a shadowed local variable in the process. Signed-off-by: Paolo Bonzini --- target/i386/tcg/seg_helper.c | 31 +-- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/target/i386/tcg/seg_helper.c b/target/i386/tcg/seg_helper.c index e8d19c65fdc..b

[PULL 11/19] target/i386/kvm: eliminate shadowed local variables

2023-09-26 Thread Paolo Bonzini
These are harmless are they die immediately after their use. Signed-off-by: Paolo Bonzini --- target/i386/kvm/kvm.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index af101fcdf6f..f6c7f7e2686 100644 --- a/target/i386/kvm/

[PULL 17/19] block: mark mixed functions that can suspend

2023-09-26 Thread Paolo Bonzini
The marking should be extended transitively to all functions that call these ones, so that static analysis can be done much more efficiently. However, this is a start and makes it possible to use vrc's path-based searches to find potential bugs where coroutine_fns call blocking functions. Signed-o

[PULL 06/19] ui/vnc: fix debug output for invalid audio message

2023-09-26 Thread Paolo Bonzini
The debug message was cut and pasted from the invalid audio format case, but the audio message is at bytes 2-3. Reviewed-by: Daniel P. Berrangé Signed-off-by: Paolo Bonzini --- ui/vnc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/vnc.c b/ui/vnc.c index 6fd86996a54..16

[PULL 18/19] compiler: introduce QEMU_ANNOTATE

2023-09-26 Thread Paolo Bonzini
Allow a more shorter syntax when defining wrapper macros for __attribute__((annotate(...))). Signed-off-by: Paolo Bonzini --- include/qemu/compiler.h | 6 ++ include/qemu/osdep.h| 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/include/qemu/compiler.h b/include/q

Re: [PATCH] MAINTAINERS: Add entry for rdma migration

2023-09-26 Thread Peter Xu
On Mon, Sep 25, 2023 at 03:55:08PM +0200, Markus Armbruster wrote: > Peter Xu writes: > > > It's not obvious to many that RDMA migration is in Odd Fixes stage for a > > long time. Add an explicit sub entry for it (besides migration, which > > already covers the rdma files) to be clear on that, m

[PULL 09/19] pm_smbus: rename variable to avoid shadowing

2023-09-26 Thread Paolo Bonzini
Acked-by: Corey Minyard Signed-off-by: Paolo Bonzini --- hw/i2c/pm_smbus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/i2c/pm_smbus.c b/hw/i2c/pm_smbus.c index 9ad6a47739b..4e1b8a5182d 100644 --- a/hw/i2c/pm_smbus.c +++ b/hw/i2c/pm_smbus.c @@ -279,7 +279,7 @@ stati

Re: [PATCH v3 0/4] qapi/migration: Dedup migration parameter objects and fix tls-authz crash

2023-09-26 Thread Peter Xu
On Mon, Sep 25, 2023 at 02:59:30PM +0200, Markus Armbruster wrote: > Peter, looks like you missed my review of v2. I definitely missed that if there is, but I didn't see any, and also nothing I spot on the list, either.. https://lore.kernel.org/all/20230825171517.1215317-1-pet...@redhat.com/ Cou

Re: [PATCH v3 2/7] Update CPUs AML with cpu-(ctrl)dev change

2023-09-26 Thread Michael S. Tsirkin
On Tue, Sep 26, 2023 at 03:52:48PM +, Salil Mehta wrote: > > From: Michael S. Tsirkin > > Sent: Tuesday, September 26, 2023 1:07 PM > > To: Salil Mehta > > Cc: xianglai li ; qemu-devel@nongnu.org; Bernhard > > Beschow ; Salil Mehta ; Xiaojuan > > Yang ; Song Gao ; Igor > > Mammedov ; Ani Sinh

Re: [PATCH v6 1/2] tpm: convert tpmdev options processing to new visitor format

2023-09-26 Thread Stefan Berger
On 9/26/23 11:20, Stefan Berger wrote: On 1/9/23 11:15, James Bottomley wrote: From: James Bottomley Instead of processing the tpmdev options using the old qemu options, convert to the new visitor format which also allows the passing of json on the command line. Signed-off-by: James Bottom

Re: [PATCH 0/8] riscv: query-cpu-model-expansion API

2023-09-26 Thread Daniel Henrique Barboza
Hi, I'll split patches 1 and 2 and send those standalone. First because they can stand on its own. Second because patch 2 in particular is going to be a prerequisite for the profile support work. Thanks, Daniel On 9/20/23 18:37, Daniel Henrique Barboza wrote: Based-on: 20230920112020.651006

Re: [PATCH v2 1/2] migration: Fix rdma migration failed

2023-09-26 Thread Peter Xu
On Tue, Sep 26, 2023 at 06:01:02PM +0800, Li Zhijian wrote: > Migration over RDMA failed since > commit: 294e5a4034 ("multifd: Only flush once each full round of memory") > with erors: > qemu-system-x86_64: rdma: Too many requests in this message > (3638950032).Bailing. > > migration with RDMA is

[PATCH 1/2] target/riscv: add riscv_cpu_get_name()

2023-09-26 Thread Daniel Henrique Barboza
We'll introduce generic errors that will output a CPU type name via its RISCVCPU pointer. Create a helper for that. Use the helper in tcg_cpu_realizefn() instead of hardcoding the 'host' CPU name. Signed-off-by: Daniel Henrique Barboza --- target/riscv/cpu.c | 11 +++ target/ris

[PATCH 2/2] target/riscv/tcg-cpu.c: add extension properties for all cpus

2023-09-26 Thread Daniel Henrique Barboza
At this moment we do not expose extension properties for vendor CPUs because that would allow users to change them via command line. The drawback is that if we were to add an API that shows all CPU properties, e.g. qmp-query-cpu-model-expansion, we won't be able to show extensions state of vendor C

[PATCH 0/2] riscv: add extension properties for all cpus

2023-09-26 Thread Daniel Henrique Barboza
Hi, At this moment we do not expose extension properties for vendor CPUs because that would allow users to enable extensions in them. But that comes at a cost: if we were to add an API that shows all CPU properties, e.g. qmp-query-cpu-model-expansion, we won't be able to show the extension state o

Re: [PATCH 02/12] hw/i386/intel_iommu: vtd_slpte_nonzero_rsvd(): reduce magic numbers

2023-09-26 Thread Vladimir Sementsov-Ogievskiy
On 26.09.23 13:37, Peter Maydell wrote: On Mon, 25 Sept 2023 at 20:41, Vladimir Sementsov-Ogievskiy wrote: Add a constant and clear assertion. The assertion also tells Coverity that we are not going to overflow the array. Signed-off-by: Vladimir Sementsov-Ogievskiy --- hw/i386/intel_iommu.

[PATCH v2 1/6] target/riscv/kvm/kvm-cpu.c: add missing property getters()

2023-09-26 Thread Daniel Henrique Barboza
We got along without property getters in the KVM driver because we never needed them. But the incoming query-cpu-model-expansion API will use property getters and setters to retrieve the CPU characteristics. Add the missing getters for the KVM driver for both MISA and multi-letter extension proper

[PATCH v2 0/6] riscv: query-cpu-model-expansion API

2023-09-26 Thread Daniel Henrique Barboza
Hi, In this second version we stripped patches 1 and 2 from v1. They're now being treated in separate in "[PATCH 0/2] riscv: add extension properties for all cpus" Note that we'll need these applied beforehand to see vendor CPU properties with this new API. This series implements query-cpu-mod

[PATCH v2 2/6] qapi,risc-v: add query-cpu-model-expansion

2023-09-26 Thread Daniel Henrique Barboza
This API is used to inspect the characteristics of a given CPU model. It also allows users to validate a CPU model with a certain configuration, e.g. if "-cpu X,a=true,b=false" is a valid setup for a given QEMU binary. We'll start implementing the first part. The second requires more changes in RIS

[PATCH v2 3/6] target/riscv/tcg: add tcg_cpu_finalize_features()

2023-09-26 Thread Daniel Henrique Barboza
The query-cpu-model-expansion API is capable of passing extra properties to a given CPU model and tell callers if this custom configuration is valid. The RISC-V version of the API is not quite there yet. The reason is the realize() flow in the TCG driver, where most of the validation is done in tc

[PATCH v2 4/6] target/riscv: handle custom props in qmp_query_cpu_model_expansion

2023-09-26 Thread Daniel Henrique Barboza
Callers can add 'props' when querying for a cpu model expansion to see if a given CPU model supports a certain criteria, and what's the resulting CPU object. If we have 'props' to handle, gather it in a QDict and use the new riscv_cpuobj_validate_qdict_in() helper to validate it. This helper will

[PATCH v2 5/6] target/riscv: add riscv_cpu_accelerator_compatible()

2023-09-26 Thread Daniel Henrique Barboza
Add an API to check if a given CPU is compatible with the current accelerator. This will allow query-cpu-model-expansion to work properly in conditions where QEMU supports both accelerators (TCG and KVM), QEMU is then launched using TCG, and the API requests information about a KVM only CPU (e.g.

[PATCH v2 6/6] target/riscv/riscv-qmp-cmds.c: check CPU accel in query-cpu-model-expansion

2023-09-26 Thread Daniel Henrique Barboza
Use the recently added riscv_cpu_accelerator_compatible() to filter unavailable CPUs for a given accelerator. At this moment this is the case for a QEMU built with KVM and TCG support querying a binary running with TCG: qemu-system-riscv64 -S -M virt,accel=tcg -display none -qmp tcp:localhost:

Re: [PATCH 02/12] hw/i386/intel_iommu: vtd_slpte_nonzero_rsvd(): reduce magic numbers

2023-09-26 Thread Vladimir Sementsov-Ogievskiy
On 26.09.23 21:36, Vladimir Sementsov-Ogievskiy wrote: On 26.09.23 13:37, Peter Maydell wrote: On Mon, 25 Sept 2023 at 20:41, Vladimir Sementsov-Ogievskiy wrote: Add a constant and clear assertion. The assertion also tells Coverity that we are not going to overflow the array. Signed-off-by:

[PATCH v4 00/18] virtio-mem: Expose device memory through multiple memslots

2023-09-26 Thread David Hildenbrand
Quoting from patch #16: Having large virtio-mem devices that only expose little memory to a VM is currently a problem: we map the whole sparse memory region into the guest using a single memslot, resulting in one gigantic memslot in KVM. KVM allocates metadata for the whole memslot

[PATCH v4 01/18] vhost: Rework memslot filtering and fix "used_memslot" tracking

2023-09-26 Thread David Hildenbrand
Having multiple vhost devices, some filtering out fd-less memslots and some not, can mess up the "used_memslot" accounting. Consequently our "free memslot" checks become unreliable and we might run out of free memslots at runtime later. An example sequence which can trigger a potential issue that

[PATCH v4 05/18] vhost: Return number of free memslots

2023-09-26 Thread David Hildenbrand
Let's return the number of free slots instead of only checking if there is a free slot. Required to support memory devices that consume multiple memslots. This is a preparation for memory devices that consume multiple memslots. Reviewed-by: Maciej S. Szmigiero Signed-off-by: David Hildenbrand -

[PATCH v4 04/18] kvm: Return number of free memslots

2023-09-26 Thread David Hildenbrand
Let's return the number of free slots instead of only checking if there is a free slot. While at it, check all address spaces, which will also consider SMM under x86 correctly. This is a preparation for memory devices that consume multiple memslots. Reviewed-by: Philippe Mathieu-Daudé Reviewed-b

[PATCH v4 08/18] memory-device: Track required and actually used memslots in DeviceMemoryState

2023-09-26 Thread David Hildenbrand
Let's track how many memslots are required by plugged memory devices and how many are currently actually getting used by plugged memory devices. "required - used" is the number of reserved memslots. For now, the number of used and required memslots is always equal, and there are no reservations. T

<    1   2   3   4   >