[PATCH v2] virtio: fix reachable assertion due to stale value of cached region size

2023-03-02 Thread Carlos López
In virtqueue_{split,packed}_get_avail_bytes() descriptors are read in a loop via MemoryRegionCache regions and calls to vring_{split,packed}_desc_read() - these take a region cache and the index of the descriptor to be read. For direct descriptors we use a cache provided by the caller, whose size

[PATCH] virtio: refresh vring region cache after updating a virtqueue size

2023-03-02 Thread Carlos López
When a virtqueue size is changed by the guest via virtio_queue_set_num(), its region cache is not automatically updated. If the size was increased, this could lead to accessing the cache out of bounds. For example, in vring_get_used_event(): static inline uint16_t

Re: Bug in master branch: IbmPrep40pMachine.test_factory_firmware_and_netbsd broken

2023-03-02 Thread Philippe Mathieu-Daudé
On 2/3/23 10:48, Cédric Le Goater wrote: On 3/2/23 08:47, Thomas Huth wrote:   Hi all, seems like we've got another bug that sneaked in during the CI minutes blackout: The avocado test IbmPrep40pMachine.test_factory_firmware_and_netbsd is now broken reliably, see:   

Re: [PATCH v5 2/7] Revert "hw/isa/vt82c686: Remove intermediate IRQ forwarder"

2023-03-02 Thread Philippe Mathieu-Daudé
On 1/3/23 01:33, BALATON Zoltan wrote: On Wed, 1 Mar 2023, BALATON Zoltan wrote: This partially reverts commit bb98e0f59cde84d9fddc60ae74ef7ddfca17 keeping the rename of a state field but reverting other cahanges which break interrupts on pegasos2. I've found this with just booting the

[PATCH] hostmem: Add clear option to file backend

2023-03-02 Thread Fam Zheng
This adds a memset to clear the backing memory. This is useful in the case of PMEM DAX to drop dirty data, if the backing memory is handed over from a previous application or firmware which didn't clean up before exiting. Signed-off-by: Fam Zheng --- backends/hostmem-file.c | 20

Re: [PULL v2 00/24] testing updates (gitlab, cirrus, docker, avocado, windows)

2023-03-02 Thread Alex Bennée
Peter Maydell writes: > On Wed, 1 Mar 2023 at 19:47, Alex Bennée wrote: >> >> From the other thread: >> >> I think the underlying config needs updating: >> >> .git/modules/tests/fp/berkeley-testfloat-3/config >> >> I'm surprised the git config for submodules doesn't carry the metadata. > >

[PULL 03/62] xen: Add XEN_DISABLED mode and make it default

2023-03-02 Thread Paolo Bonzini
From: David Woodhouse Also set XEN_ATTACH mode in xen_init() to reflect the truth; not that anyone ever cared before. It was *only* ever checked in xen_init_pv() before. Suggested-by: Paolo Bonzini Signed-off-by: David Woodhouse Reviewed-by: Paul Durrant --- accel/xen/xen-all.c | 2 ++

[PULL 08/62] xen-platform: allow its creation with XEN_EMULATE mode

2023-03-02 Thread Paolo Bonzini
From: Joao Martins The only thing we need to fix to make this build is the PIO hack which sets the BIOS memory areas to R/W v.s. R/O. Theoretically we could hook that up to the PAM registers on the emulated PIIX, but in practice nobody cares, so just leave it doing nothing. Now it builds

[PULL 19/62] i386/xen: implement HYPERVISOR_hvm_op

2023-03-02 Thread Paolo Bonzini
From: Joao Martins This is when guest queries for support for HVMOP_pagetable_dying. Signed-off-by: Joao Martins Signed-off-by: David Woodhouse Reviewed-by: Paul Durrant --- target/i386/kvm/xen-emu.c | 17 + 1 file changed, 17 insertions(+) diff --git

[PULL 04/62] i386/kvm: Add xen-version KVM accelerator property and init KVM Xen support

2023-03-02 Thread Paolo Bonzini
From: David Woodhouse This just initializes the basic Xen support in KVM for now. Only permitted on TYPE_PC_MACHINE because that's where the sysbus devices for Xen heap overlay, event channel, grant tables and other stuff will exist. There's no point having the basic hypercall support if nothing

[PULL 59/62] i386/xen: Document Xen HVM emulation

2023-03-02 Thread Paolo Bonzini
From: David Woodhouse Signed-off-by: David Woodhouse Reviewed-by: Paul Durrant --- docs/system/i386/xen.rst| 76 + docs/system/target-i386.rst | 1 + 2 files changed, 77 insertions(+) create mode 100644 docs/system/i386/xen.rst diff --git

[PULL 34/62] hw/xen: Implement EVTCHNOP_send

2023-03-02 Thread Paolo Bonzini
From: David Woodhouse Signed-off-by: David Woodhouse Reviewed-by: Paul Durrant --- hw/i386/kvm/xen_evtchn.c | 180 ++ hw/i386/kvm/xen_evtchn.h | 2 + target/i386/kvm/xen-emu.c | 12 +++ 3 files changed, 194 insertions(+) diff --git

[PULL 61/62] qapi: Add 'acpi' field to 'query-machines' output

2023-03-02 Thread Paolo Bonzini
From: Peter Krempa Report which machine types support ACPI so that management applications can properly use the 'acpi' property even on platforms such as ARM where support for ACPI depends on the machine type and thus checking presence of '-machine acpi=' in 'query-command-line-options' is

[PULL 52/62] hw/xen: Add basic ring handling to xenstore

2023-03-02 Thread Paolo Bonzini
From: David Woodhouse Extract requests, return ENOSYS to all of them. This is enough to allow older Linux guests to boot, as they need *something* back but it doesn't matter much what. A full implementation of a single-tentant internal XenStore copy-on-write tree with transactions and watches

[PULL 43/62] hw/xen: Add xen_gnttab device for grant table emulation

2023-03-02 Thread Paolo Bonzini
From: David Woodhouse Signed-off-by: David Woodhouse Reviewed-by: Paul Durrant --- hw/i386/kvm/meson.build | 1 + hw/i386/kvm/xen_gnttab.c | 111 ++ hw/i386/kvm/xen_gnttab.h | 18 +++ hw/i386/pc.c | 2 + target/i386/kvm/xen-emu.c |

Re: [PATCH] hw/intc/i8259: Implement legacy LTIM Edge/Level Bank Select

2023-03-02 Thread BALATON Zoltan
On Thu, 2 Mar 2023, David Woodhouse wrote: Back in the mists of time, before IBM PS/2 came along with MCA and added per-pin level control in the ELCR register, the i8259 had a chip-wide level-mode control in bit 3 of ICW1. Thanks a lot for doing this, it's easy if you already understand the

[PULL 37/62] hw/xen: Implement EVTCHNOP_bind_vcpu

2023-03-02 Thread Paolo Bonzini
From: David Woodhouse Signed-off-by: David Woodhouse Reviewed-by: Paul Durrant --- hw/i386/kvm/xen_evtchn.c | 40 +++ hw/i386/kvm/xen_evtchn.h | 2 ++ target/i386/kvm/xen-emu.c | 12 3 files changed, 54 insertions(+) diff --git

Re: [PATCH v4 27/27] target/s390x: Enable TARGET_TB_PCREL

2023-03-02 Thread Thomas Huth
On 27/02/2023 12.41, Thomas Huth wrote: On 21/02/2023 15.35, Thomas Huth wrote: On 20/02/2023 19.40, Richard Henderson wrote: Reviewed-by: Ilya Leoshkevich Signed-off-by: Richard Henderson ---   target/s390x/cpu-param.h |  4 ++   target/s390x/cpu.c   | 12 +  

[RFC PATCH v3 2/4] i386/sev: Extract build_kernel_loader_hashes

2023-03-02 Thread Dov Murik
Extract the building of the kernel hashes table out from sev_add_kernel_loader_hashes() to allow building it in other memory areas (for SNP support). No functional change intended. Signed-off-by: Dov Murik --- target/i386/sev.c | 110 ++ 1 file

Re: [PATCH v6 4/4] hw: replace most qemu_bh_new calls with qemu_bh_new_guarded

2023-03-02 Thread Paul Durrant
On 01/03/2023 20:54, Michael S. Tsirkin wrote: On Sat, Feb 04, 2023 at 11:07:37PM -0500, Alexander Bulekov wrote: This protects devices from bh->mmio reentrancy issues. Reviewed-by: Darren Kenny Reviewed-by: Stefan Hajnoczi Signed-off-by: Alexander Bulekov Reviewed-by: Michael S. Tsirkin

[RFC PATCH v3 3/4] i386/sev: Reorder struct declarations

2023-03-02 Thread Dov Murik
Move the declaration of PaddedSevHashTable before SevSnpGuest so we can add a new such field to the latter. No functional change intended. Signed-off-by: Dov Murik --- target/i386/sev.c | 56 +++ 1 file changed, 28 insertions(+), 28 deletions(-)

Re: Bug in master branch: IbmPrep40pMachine.test_factory_firmware_and_netbsd broken

2023-03-02 Thread Cédric Le Goater
On 3/2/23 08:47, Thomas Huth wrote:  Hi all, seems like we've got another bug that sneaked in during the CI minutes blackout: The avocado test IbmPrep40pMachine.test_factory_firmware_and_netbsd is now broken reliably, see:  https://gitlab.com/qemu-project/qemu/-/jobs/3858833617#L300  

Re: [PATCH] hw/intc/i8259: Implement legacy LTIM Edge/Level Bank Select

2023-03-02 Thread David Woodhouse
On Thu, 2023-03-02 at 09:06 +, David Woodhouse wrote: > Back in the mists of time, before IBM PS/2 came along with MCA and added > per-pin level control in the ELCR register, the i8259 had a chip-wide > level-mode control in bit 3 of ICW1. Actually... I think MCA might have been level

Re: [PATCH v2 1/1] hw/riscv/virt.c: add cbo[mz]-block-size fdt properties

2023-03-02 Thread Bin Meng
On Thu, Mar 2, 2023 at 5:16 PM Daniel Henrique Barboza wrote: > > From: Anup Patel > > The cbom-block-size fdt property property is used to inform the OS about > the blocksize in bytes for the Zicbom cache operations. Linux documents > it in Documentation/devicetree/bindings/riscv/cpus.yaml >

Re: [PATCH] virtio: fix reachable assertion due to stale value of cached region size

2023-03-02 Thread Carlos López
Hi, On 1/3/23 23:03, Michael S. Tsirkin wrote:>> diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index f35178f5fc..db70c4976e 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -1071,6 +1071,7 @@ static void virtqueue_split_get_avail_bytes(VirtQueue *vq, VirtIODevice *vdev

Re: [PULL v2 00/24] testing updates (gitlab, cirrus, docker, avocado, windows)

2023-03-02 Thread Thomas Huth
On 02/03/2023 12.15, Philippe Mathieu-Daudé wrote: On 2/3/23 11:56, Peter Maydell wrote: On Wed, 1 Mar 2023 at 19:47, Alex Bennée wrote:  From the other thread: I think the underlying config needs updating:    .git/modules/tests/fp/berkeley-testfloat-3/config I'm surprised the git config

Re: [PATCH] hostmem: Add clear option to file backend

2023-03-02 Thread David Hildenbrand
On 02.03.23 12:09, Fam Zheng wrote: This adds a memset to clear the backing memory. This is useful in the case of PMEM DAX to drop dirty data, if the backing memory is handed over from a previous application or firmware which didn't clean up before exiting. Why can't the VM manager do that

Re: [PATCH] vhost: accept VIRTIO_F_ORDER_PLATFORM as a valid SVQ feature

2023-03-02 Thread Eugenio Perez Martin
On Wed, Mar 1, 2023 at 10:37 PM Michael S. Tsirkin wrote: > > On Tue, Feb 14, 2023 at 09:36:01AM +0100, Eugenio Perez Martin wrote: > > On Tue, Feb 14, 2023 at 8:51 AM Michael S. Tsirkin wrote: > > > > > > On Tue, Feb 14, 2023 at 08:02:08AM +0100, Eugenio Perez Martin wrote: > > > > On Tue, Feb

Re: [PULL v2 00/24] testing updates (gitlab, cirrus, docker, avocado, windows)

2023-03-02 Thread Alex Bennée
Peter Maydell writes: > On Wed, 1 Mar 2023 at 19:47, Alex Bennée wrote: >> >> From the other thread: >> >> I think the underlying config needs updating: >> >> .git/modules/tests/fp/berkeley-testfloat-3/config >> >> I'm surprised the git config for submodules doesn't carry the metadata. > >

Re: [PULL v2 00/24] testing updates (gitlab, cirrus, docker, avocado, windows)

2023-03-02 Thread Alex Bennée
Peter Maydell writes: > On Thu, 2 Mar 2023 at 11:15, Philippe Mathieu-Daudé wrote: >> >> On 2/3/23 11:56, Peter Maydell wrote: >> > On Wed, 1 Mar 2023 at 19:47, Alex Bennée wrote: >> >> >> >> From the other thread: >> >> >> >> I think the underlying config needs updating: >> >> >> >>

Re: [PULL v2 00/24] testing updates (gitlab, cirrus, docker, avocado, windows)

2023-03-02 Thread Peter Maydell
On Thu, 2 Mar 2023 at 11:30, Alex Bennée wrote: > > > Peter Maydell writes: > > > On Wed, 1 Mar 2023 at 19:47, Alex Bennée wrote: > >> > >> From the other thread: > >> > >> I think the underlying config needs updating: > >> > >> .git/modules/tests/fp/berkeley-testfloat-3/config > >> > >> I'm

[RFC PATCH v1 04/12] hw: arm: Add bananapi M2-Ultra and allwinner-r40 support

2023-03-02 Thread qianfanguijin
From: qianfan Zhao Allwinner R40 (sun8i) SoC features a Quad-Core Cortex-A7 ARM CPU, and a Mali400 MP2 GPU from ARM. It's also known as the Allwinner T3 for In-Car Entertainment usage, A40i and A40pro are variants that differ in applicable temperatures range (industrial and military). This

[RFC PATCH v1 06/12] hw: allwinner-r40: Complete uart devices

2023-03-02 Thread qianfanguijin
From: qianfan Zhao R40 has eight UARTs, support both 16450 and 16550 compatible modes. Signed-off-by: qianfan Zhao --- hw/arm/allwinner-r40.c | 32 include/hw/arm/allwinner-r40.h | 7 +++ 2 files changed, 39 insertions(+) diff --git

[RFC PATCH v1 03/12] hw: arm: allwinner-h3: Fix and complete H3 i2c devices

2023-03-02 Thread qianfanguijin
From: qianfan Zhao Allwinner h3 has 4 twi(i2c) devices named twi0, twi1, twi2 and r_twi. The registers are compatible with TYPE_AW_I2C_SUN6I, write 1 to clear control register's INT_FLAG bit. Signed-off-by: qianfan Zhao --- hw/arm/allwinner-h3.c | 29 +

[RFC PATCH v1 01/12] hw: allwinner-i2c: Make the trace message more readable

2023-03-02 Thread qianfanguijin
From: qianfan Zhao Next is an example when read/write trace enabled: allwinner_i2c_write write XADDR(0x04): 0x00 allwinner_i2c_write write CNTR(0x0c): 0x50 M_STP BUS_EN allwinner_i2c_write write CNTR(0x0c): 0xe4 A_ACK M_STA BUS_EN INT_EN allwinner_i2c_read readCNTR(0x0c): 0xcc A_ACK

Re: [External] [PATCH] hostmem: Add clear option to file backend

2023-03-02 Thread Feiran Zheng
> On 2 Mar 2023, at 11:44, Daniel P. Berrangé wrote: > > On Thu, Mar 02, 2023 at 12:31:46PM +0100, David Hildenbrand wrote: >> On 02.03.23 12:09, Fam Zheng wrote: >>> This adds a memset to clear the backing memory. This is useful in the >>> case of PMEM DAX to drop dirty data, if the backing

Re: [PATCH 00/33] pci(pc/q35): acpi-index support on non-hotpluggable slots

2023-03-02 Thread Jonathan Cameron via
On Thu, 2 Mar 2023 05:59:16 -0500 "Michael S. Tsirkin" wrote: > On Fri, Feb 24, 2023 at 04:37:39PM +0100, Igor Mammedov wrote: > > Series extends acpi-index support to host-bridge(s) and bridges > > with disabled hotplug (either explicitly or implicitly). > > Whats new (it is still limited to

Re: [PATCH 00/33] pci(pc/q35): acpi-index support on non-hotpluggable slots

2023-03-02 Thread Igor Mammedov
On Thu, 2 Mar 2023 05:59:16 -0500 "Michael S. Tsirkin" wrote: > On Fri, Feb 24, 2023 at 04:37:39PM +0100, Igor Mammedov wrote: > > Series extends acpi-index support to host-bridge(s) and bridges > > with disabled hotplug (either explicitly or implicitly). > > Whats new (it is still limited to

[PULL 44/62] hw/xen: Support mapping grant frames

2023-03-02 Thread Paolo Bonzini
From: David Woodhouse Signed-off-by: David Woodhouse Reviewed-by: Paul Durrant --- hw/i386/kvm/xen_gnttab.c | 73 ++- hw/i386/kvm/xen_overlay.c | 2 +- hw/i386/kvm/xen_overlay.h | 2 ++ 3 files changed, 75 insertions(+), 2 deletions(-) diff --git

Re: [PULL v2 00/24] testing updates (gitlab, cirrus, docker, avocado, windows)

2023-03-02 Thread Philippe Mathieu-Daudé
On 2/3/23 12:24, Alex Bennée wrote: Peter Maydell writes: On Wed, 1 Mar 2023 at 19:47, Alex Bennée wrote: From the other thread: I think the underlying config needs updating: .git/modules/tests/fp/berkeley-testfloat-3/config I'm surprised the git config for submodules doesn't carry

[PULL 13/62] hw/xen: Add xen_overlay device for emulating shared xenheap pages

2023-03-02 Thread Paolo Bonzini
From: David Woodhouse For the shared info page and for grant tables, Xen shares its own pages from the "Xen heap" to the guest. The guest requests that a given page from a certain address space (XENMAPSPACE_shared_info, etc.) be mapped to a given GPA using the XENMEM_add_to_physmap hypercall.

[PULL 60/62] hw/xen: Subsume xen_be_register_common() into xen_be_init()

2023-03-02 Thread Paolo Bonzini
From: David Woodhouse Every caller of xen_be_init() checks and exits on error, then calls xen_be_register_common(). Just make xen_be_init() abort for itself and return void, and register the common devices too. Signed-off-by: David Woodhouse Reviewed-by: Paul Durrant ---

[PULL 51/62] hw/xen: Add xen_xenstore device for xenstore emulation

2023-03-02 Thread Paolo Bonzini
From: David Woodhouse Just the basic shell, with the event channel hookup. It only dumps the buffer for now; a real ring implmentation will come in a subsequent patch. Signed-off-by: David Woodhouse Reviewed-by: Paul Durrant --- hw/i386/kvm/meson.build| 1 + hw/i386/kvm/xen_evtchn.c

Re: [PATCH v6 1/2] arm/kvm: add support for MTE

2023-03-02 Thread Andrea Bolognani
On Thu, Mar 02, 2023 at 02:26:06PM +0100, Cornelia Huck wrote: > On Wed, Mar 01 2023, Andrea Bolognani wrote: > > Note that, from libvirt's point of view, there's no advantage to > > doing things that way instead of what you already have. Handling the > > additional machine property is a complete

[RESEND PATCH v6 4/8] hw/pci-bridge/cxl_root_port: Wire up MSI

2023-03-02 Thread Jonathan Cameron via
Done to avoid fixing ACPI route description of traditional PCI interrupts on q35 and because we should probably move with the times anyway. Signed-off-by: Jonathan Cameron Reviewed-by: Dave Jiang --- hw/pci-bridge/cxl_root_port.c | 61 +++ 1 file changed, 61

[RESEND PATCH v6 5/8] hw/mem/cxl-type3: Add AER extended capability

2023-03-02 Thread Jonathan Cameron via
This enables AER error injection to function as expected. It is intended as a building block in enabling CXL RAS error injection in the following patches. Signed-off-by: Jonathan Cameron Reviewed-by: Dave Jiang --- hw/mem/cxl_type3.c | 13 + 1 file changed, 13 insertions(+) diff

Re: [PATCH 3/9] mirror: implement mirror_change method

2023-03-02 Thread Fiona Ebner
Am 01.03.23 um 16:18 schrieb Vladimir Sementsov-Ogievskiy: > On 24.02.23 17:48, Fiona Ebner wrote: >> which allows switching the @copy-mode from 'background' to >> 'write-blocking'. >> >> Once the job is in active mode, no new writes need to be registered in >> the dirty bitmap, because they are

[PATCH v3 2/6] hw/cxl: Introduce cxl_device_get_timestamp() utility function

2023-03-02 Thread Jonathan Cameron via
From: Ira Weiny There are new users of this functionality coming shortly so factor it out from the GET_TIMESTAMP mailbox command handling. Signed-off-by: Ira Weiny Reviewed-by: Fan Ni Signed-off-by: Jonathan Cameron --- v8: Picked up tag from Fan Ni --- hw/cxl/cxl-device-utils.c | 15

[PATCH v3 3/6] bswap: Add the ability to store to an unaligned 24 bit field

2023-03-02 Thread Jonathan Cameron via
From: Ira Weiny CXL has 24 bit unaligned fields which need to be stored to. CXL is specified as little endian. Define st24_le_p() and the supporting functions to store such a field from a 32 bit host native value. The use of b, w, l, q as the size specifier is limiting. So "24" was used for

Re: Bug in master branch: IbmPrep40pMachine.test_factory_firmware_and_netbsd broken

2023-03-02 Thread Cédric Le Goater
On 3/2/23 11:27, Philippe Mathieu-Daudé wrote: On 2/3/23 10:48, Cédric Le Goater wrote: On 3/2/23 08:47, Thomas Huth wrote:   Hi all, seems like we've got another bug that sneaked in during the CI minutes blackout: The avocado test IbmPrep40pMachine.test_factory_firmware_and_netbsd is now

Re: [PATCH 2/6] block: convert blk_exp_close_all_type() to AIO_WAIT_WHILE_UNLOCKED()

2023-03-02 Thread Philippe Mathieu-Daudé
On 1/3/23 21:57, Stefan Hajnoczi wrote: There is no change in behavior. Switch to AIO_WAIT_WHILE_UNLOCKED() instead of AIO_WAIT_WHILE() to document that this code has already been audited and converted. The AioContext argument is already NULL so aio_context_release() is never called anyway.

Re: Bug in master branch: IbmPrep40pMachine.test_factory_firmware_and_netbsd broken

2023-03-02 Thread Mark Cave-Ayland
On 02/03/2023 10:27, Philippe Mathieu-Daudé wrote: On 2/3/23 10:48, Cédric Le Goater wrote: On 3/2/23 08:47, Thomas Huth wrote:   Hi all, seems like we've got another bug that sneaked in during the CI minutes blackout: The avocado test IbmPrep40pMachine.test_factory_firmware_and_netbsd is

[PULL 58/62] kvm/i386: Add xen-evtchn-max-pirq property

2023-03-02 Thread Paolo Bonzini
From: David Woodhouse The default number of PIRQs is set to 256 to avoid issues with 32-bit MSI devices. Allow it to be increased if the user desires. Signed-off-by: David Woodhouse Reviewed-by: Paul Durrant --- accel/kvm/kvm-all.c | 1 + hw/i386/kvm/xen_evtchn.c | 21

[PULL 40/62] hw/xen: Support HVM_PARAM_CALLBACK_TYPE_GSI callback

2023-03-02 Thread Paolo Bonzini
From: David Woodhouse The GSI callback (and later PCI_INTX) is a level triggered interrupt. It is asserted when an event channel is delivered to vCPU0, and is supposed to be cleared when the vcpu_info->evtchn_upcall_pending field for vCPU0 is cleared again. Thankfully, Xen does *not* assert the

[PULL 42/62] kvm/i386: Add xen-gnttab-max-frames property

2023-03-02 Thread Paolo Bonzini
From: David Woodhouse Signed-off-by: David Woodhouse Reviewed-by: Paul Durrant --- accel/kvm/kvm-all.c | 1 + include/sysemu/kvm_int.h | 1 + include/sysemu/kvm_xen.h | 1 + target/i386/kvm/kvm.c | 34 ++ target/i386/kvm/xen-emu.c | 6 ++ 5

[PULL 31/62] hw/xen: Implement EVTCHNOP_unmask

2023-03-02 Thread Paolo Bonzini
From: David Woodhouse This finally comes with a mechanism for actually injecting events into the guest vCPU, with all the atomic-test-and-set that's involved in setting the bit in the shinfo, then the index in the vcpu_info, and injecting either the lapic vector as MSI, or letting KVM inject the

[RESEND PATCH v6 7/8] hw/pci/aer: Make PCIE AER error injection facility available for other emulation to use.

2023-03-02 Thread Jonathan Cameron via
This infrastructure will be reused for CXL RAS error injection in patches that follow. Reviewed-by: Dave Jiang Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Jonathan Cameron --- hw/pci/pci-internal.h | 1 - include/hw/pci/pcie_aer.h | 1 + 2 files changed, 1 insertion(+), 1

[RESEND PATCH v6 6/8] hw/cxl: Fix endian issues in CXL RAS capability defaults / masks

2023-03-02 Thread Jonathan Cameron via
As these are about to be modified, fix the endian handle for this set of registers rather than making it worse. Note that CXL is currently only supported in QEMU on x86 (arm64 patches out of tree) so we aren't going to yet hit an problems with big endian. However it is good to avoid making things

Re: [PATCH v3 07/10] qapi: implement conditional command arguments

2023-03-02 Thread Daniel P . Berrangé
On Thu, Mar 02, 2023 at 07:58:28AM +0100, Markus Armbruster wrote: > Marc-André Lureau writes: > > > Hi > > > > On Wed, Mar 1, 2023 at 5:16 PM Markus Armbruster wrote: > >> What about 3. have an additional command conditional on CONFIG_WIN32? > >> Existing getfd stays the same: always fails

Re: [PATCH v2 0/6] hw/cxl: Poison get, inject, clear

2023-03-02 Thread Jonathan Cameron via
On Wed, 1 Mar 2023 17:15:56 -0800 Alison Schofield wrote: > On Mon, Feb 27, 2023 at 05:03:05PM +, Jonathan Cameron wrote: > > Hi Jonathan, > Can you share your repo with this support? How about your qemu cmdline? > I'm more of a 'try it out' type of a reviewer for qemu changes.

Re: [PATCH v5 18/18] qapi: introduce DEVICE_ON event

2023-03-02 Thread Michael S. Tsirkin
On Thu, Mar 02, 2023 at 01:03:12PM +0300, Vladimir Sementsov-Ogievskiy wrote: > On 02.03.23 11:44, Michael S. Tsirkin wrote: > > On Thu, Feb 16, 2023 at 09:03:56PM +0300, Vladimir Sementsov-Ogievskiy > > wrote: > > > We have DEVICE_DELETED event, that signals that device_del command is > > >

Re: [PATCH v6 8/8] hw/mem/cxl_type3: Add CXL RAS Error Injection Support.

2023-03-02 Thread Jonathan Cameron via
+CC Michael Roth. Michael Tsirkin noted I'd missed CCing QAPI maintaintainers on the poison injection series so I went back to check the others I had out for review. For this series I'd managed to pick up one of two as Markus gave comments on earlier versions. On Mon, 27 Feb 2023 11:27:51 +

[PATCH] vfio: Fix vfio_get_dev_region() trace event

2023-03-02 Thread Cédric Le Goater
From: Cédric Le Goater Format is missing a conversion specifier. Fixes: e61a424f05 ("vfio: Create device specific region info helper") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1526 Signed-off-by: Cédric Le Goater --- hw/vfio/trace-events | 2 +- 1 file changed, 1 insertion(+),

Re: [PULL 31/53] pcie: set power indicator to off on reset by default

2023-03-02 Thread Vladimir Sementsov-Ogievskiy
On 02.03.23 11:26, Michael S. Tsirkin wrote: From: Vladimir Sementsov-Ogievskiy It should be zero, the only valid values are ON, OFF and BLINK. At any chance, fix s/should be/should not be/ Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Anton Kuchin Message-Id:

Re: [External] [PATCH] hostmem: Add clear option to file backend

2023-03-02 Thread David Hildenbrand
On 02.03.23 12:37, Feiran Zheng wrote: On 2 Mar 2023, at 11:31, David Hildenbrand wrote: On 02.03.23 12:09, Fam Zheng wrote: This adds a memset to clear the backing memory. This is useful in the case of PMEM DAX to drop dirty data, if the backing memory is handed over from a previous

Re: [PATCH] hostmem: Add clear option to file backend

2023-03-02 Thread Daniel P . Berrangé
On Thu, Mar 02, 2023 at 12:31:46PM +0100, David Hildenbrand wrote: > On 02.03.23 12:09, Fam Zheng wrote: > > This adds a memset to clear the backing memory. This is useful in the > > case of PMEM DAX to drop dirty data, if the backing memory is handed > > over from a previous application or

Re: [PATCH 1/3] migration: Merge ram_counters and ram_atomic_counters

2023-03-02 Thread David Edmondson
On Wednesday, 2023-03-01 at 13:40:24 +01, Juan Quintela wrote: > Using MgrationStats as type for ram_counters mean that we didn't have > to re-declare each value in another struct. The need of atomic > counters have make us to create MigrationAtomicStats for this atomic > counters. > > Create

Re: [PULL 35/53] chardev/char-socket: set s->listener = NULL in char_socket_finalize

2023-03-02 Thread Michael Tokarev
There are some url'ifications slipped into this one: 02.03.2023 11:26, Michael S. Tsirkin пишет: .. Message-Id: <20230214021430.3638579-1-yaj...@nvidia.com> Reviewed-by: Marc-André Lureau Signed-off-by: Yajun Wu mailto:yaj...@nvidia.com; target="_blank">yaj...@nvidia.com Acked-by: Jiri Pirko

Re: [PULL v2 00/24] testing updates (gitlab, cirrus, docker, avocado, windows)

2023-03-02 Thread Daniel P . Berrangé
On Thu, Mar 02, 2023 at 11:24:36AM +, Alex Bennée wrote: > > Peter Maydell writes: > > > On Wed, 1 Mar 2023 at 19:47, Alex Bennée wrote: > >> > >> From the other thread: > >> > >> I think the underlying config needs updating: > >> > >> .git/modules/tests/fp/berkeley-testfloat-3/config >

[PULL 06/62] i386/kvm: Set Xen vCPU ID in KVM

2023-03-02 Thread Paolo Bonzini
From: David Woodhouse There are (at least) three different vCPU ID number spaces. One is the internal KVM vCPU index, based purely on which vCPU was chronologically created in the kernel first. If userspace threads are all spawned and create their KVM vCPUs in essentially random order, then the

[PULL 29/62] hw/xen: Implement EVTCHNOP_status

2023-03-02 Thread Paolo Bonzini
From: David Woodhouse This adds the basic structure for maintaining the port table and reporting the status of ports therein. Signed-off-by: David Woodhouse Reviewed-by: Paul Durrant --- hw/i386/kvm/xen_evtchn.c | 104 ++ hw/i386/kvm/xen_evtchn.h | 3

[PULL 36/62] hw/xen: Implement EVTCHNOP_bind_interdomain

2023-03-02 Thread Paolo Bonzini
From: David Woodhouse Signed-off-by: David Woodhouse Reviewed-by: Paul Durrant --- hw/i386/kvm/xen_evtchn.c | 78 +++ hw/i386/kvm/xen_evtchn.h | 2 + target/i386/kvm/xen-emu.c | 16 3 files changed, 96 insertions(+) diff --git

Re: [PULL 0/5] Monitor patches for 2023-03-02

2023-03-02 Thread Peter Maydell
On Thu, 2 Mar 2023 at 07:07, Markus Armbruster wrote: > > The following changes since commit 627634031092e1514f363fd8659a579398de0f0e: > > Merge tag 'buildsys-qom-qdev-ui-20230227' of https://github.com/philmd/qemu > into staging (2023-02-28 15:09:18 +) > > are available in the Git

[PULL 33/62] hw/xen: Implement EVTCHNOP_bind_ipi

2023-03-02 Thread Paolo Bonzini
From: David Woodhouse Signed-off-by: David Woodhouse Reviewed-by: Paul Durrant --- hw/i386/kvm/xen_evtchn.c | 69 +++ hw/i386/kvm/xen_evtchn.h | 2 ++ target/i386/kvm/xen-emu.c | 15 + 3 files changed, 86 insertions(+) diff --git

Re: [PULL 00/10] Bsd user 2023q1 patches

2023-03-02 Thread Peter Maydell
On Wed, 1 Mar 2023 at 18:26, Warner Losh wrote: > > The following changes since commit 627634031092e1514f363fd8659a579398de0f0e: > > Merge tag 'buildsys-qom-qdev-ui-20230227' of https://github.com/philmd/qemu > into staging (2023-02-28 15:09:18 +) > > are available in the Git repository

[PULL 62/62] Makefile: qemu-bundle is a directory

2023-03-02 Thread Paolo Bonzini
From: Juan Quintela So make distclean should remove it with -rf, not -f alone. It has been that way since it was included. ommit cf60ccc3306ca4726cbd286a156863863b00ff4f Author: Akihiko Odaki Date: Fri Jun 24 23:50:37 2022 +0900 cutils: Introduce bundle mechanism Fixes:

Re: [PATCH v6 1/2] arm/kvm: add support for MTE

2023-03-02 Thread Cornelia Huck
On Wed, Mar 01 2023, Andrea Bolognani wrote: > On Wed, Mar 01, 2023 at 03:15:17PM +0100, Cornelia Huck wrote: >> On Wed, Mar 01 2023, Andrea Bolognani wrote: >> > I'm actually a bit confused. The documentation for the mte property >> > of the virt machine type says >> > >> > mte >> > Set

[RFC PATCH v3 0/4] i386/sev: Support measured direct kernel boot on SNP

2023-03-02 Thread Dov Murik
(This RFC patch series is based on AMD's RFC upmv10-snpv3 tree [1]. So far that RFC tree was not submitted for review in qemu-devel.) In order to enable measured direct kernel boot on SNP, QEMU needs to fill the hashes page when kernel-hashes=on. This relies on several changes to the SNP

Re: [PATCH v5 18/18] qapi: introduce DEVICE_ON event

2023-03-02 Thread Michael S. Tsirkin
On Thu, Mar 02, 2023 at 12:16:23PM +0300, Vladimir Sementsov-Ogievskiy wrote: > On 02.03.23 11:50, Michael S. Tsirkin wrote: > > On Thu, Mar 02, 2023 at 11:39:42AM +0300, Vladimir Sementsov-Ogievskiy > > wrote: > > > On 02.03.23 00:07, Michael S. Tsirkin wrote: > > > > On Thu, Feb 16, 2023 at

Re: [PATCH RFC 0/4] memory: Fix (/ Discuss) a few rcu issues

2023-03-02 Thread David Hildenbrand
On 25.02.23 17:31, Peter Xu wrote: [not for merging, but for discussion; this is something I found when looking at another issue on Chuang's optimization for migration downtime] Summary: we tried to access memory_listeners, address_spaces, etc. in RCU way. However we didn't implement them

Re: [PATCH 00/33] pci(pc/q35): acpi-index support on non-hotpluggable slots

2023-03-02 Thread Michael S. Tsirkin
On Fri, Feb 24, 2023 at 04:37:39PM +0100, Igor Mammedov wrote: > Series extends acpi-index support to host-bridge(s) and bridges > with disabled hotplug (either explicitly or implicitly). > Whats new (it is still limited to 'pc' and 'q35' machines), > acpi-index now works for non-hotpluggable

Re: [PATCH 2/3] migration: Update atomic stats out of the mutex

2023-03-02 Thread David Edmondson
On Wednesday, 2023-03-01 at 13:40:25 +01, Juan Quintela wrote: > Signed-off-by: Juan Quintela Reviewed-by: David Edmondson > --- > migration/multifd.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/migration/multifd.c b/migration/multifd.c > index

[PULL 09/62] i386/xen: handle guest hypercalls

2023-03-02 Thread Paolo Bonzini
From: Joao Martins This means handling the new exit reason for Xen but still crashing on purpose. As we implement each of the hypercalls we will then return the right return code. Signed-off-by: Joao Martins [dwmw2: Add CPL to hypercall tracing, disallow hypercalls from CPL > 0] Signed-off-by:

[PULL 56/62] hw/xen: Support GSI mapping to PIRQ

2023-03-02 Thread Paolo Bonzini
From: David Woodhouse If I advertise XENFEAT_hvm_pirqs then a guest now boots successfully as long as I tell it 'pci=nomsi'. [root@localhost ~]# cat /proc/interrupts CPU0 0: 52 IO-APIC 2-edge timer 1: 16 xen-pirq 1-ioapic-edge i8042 4: 1534

[PULL 15/62] i386/xen: add pc_machine_kvm_type to initialize XEN_EMULATE mode

2023-03-02 Thread Paolo Bonzini
From: David Woodhouse The xen_overlay device (and later similar devices for event channels and grant tables) need to be instantiated. Do this from a kvm_type method on the PC machine derivatives, since KVM is only way to support Xen emulation for now. Signed-off-by: David Woodhouse

Re: [PATCH] hw/virtio/vhost-user: avoid using unitialized errp

2023-03-02 Thread Albert Esteve
Hi, I found the issue by chance, while working in not-yet-upstreamed virtio code. I am not sure if there is any QEMU stub currently upstreamed that does not support an F_CONFIG backend, to be able to trigger the error. It may as well be that this branch of the condition is never executed.

Re: [PATCH 2/6] block: convert blk_exp_close_all_type() to AIO_WAIT_WHILE_UNLOCKED()

2023-03-02 Thread Stefan Hajnoczi
On Thu, Mar 02, 2023 at 11:36:03AM +0100, Philippe Mathieu-Daudé wrote: > On 1/3/23 21:57, Stefan Hajnoczi wrote: > > There is no change in behavior. Switch to AIO_WAIT_WHILE_UNLOCKED() > > instead of AIO_WAIT_WHILE() to document that this code has already been > > audited and converted. The

[PATCH 0/4] Add meson wrap fallback for slirp & dtc

2023-03-02 Thread marcandre . lureau
From: Marc-André Lureau Hi, Meson "wrap" is a mechanism to build dependencies that doesn't rely on git submodules and integrate external dependencies as subproject()s. This offers developpers a simpler way to build QEMU with missing system dependencies (ex, libslirp in my case), but also

[PATCH 2/4] build-sys: prevent meson from downloading wrapped subprojects

2023-03-02 Thread marcandre . lureau
From: Marc-André Lureau The following patches are going to introduce meson wrap dependencies, which is a solution to download and build missing dependencies. The QEMU build-system will do network access with no way to avoid the fallback. As a start, hardcode "--wrap-mode=nodownload" in

[PATCH 1/4] mtest2make.py: teach suite name that are just "PROJECT"

2023-03-02 Thread marcandre . lureau
From: Marc-André Lureau A subproject test may be simply in the "PROJECT" suite (such as "qemu-common" with the following patches) Signed-off-by: Marc-André Lureau --- scripts/mtest2make.py | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/mtest2make.py

[PATCH 4/4] build-sys: replace dtc submodule with dtc.wrap

2023-03-02 Thread marcandre . lureau
From: Marc-André Lureau Use meson wrap fallback for libfdt. Simplify handling of fallback/internal build and get rid of a submodule. This drops support for ./configure --enable-fdt=git/--enable-fdt=internal: if the system version is enough, it will use it, otherwise it can fall back on the

[PATCH 3/4] build-sys: add slirp.wrap

2023-03-02 Thread marcandre . lureau
From: Marc-André Lureau This allows to build with --enable-slirp / -D slirp=enabled, even when libslirp is not installed on the system. Meson will pull it from git in that case. Signed-off-by: Marc-André Lureau --- .gitignore | 2 ++ subprojects/slirp.wrap | 6 ++ 2 files

Re: [PATCH v5 00/18] pci hotplug tracking

2023-03-02 Thread Vladimir Sementsov-Ogievskiy
On 02.03.23 00:17, Michael S. Tsirkin wrote: On Thu, Feb 16, 2023 at 09:03:38PM +0300, Vladimir Sementsov-Ogievskiy wrote: Hi all! v5: - don't deprecate IDs and return to ID & QOM scheme - split complicated HOTPLUG_STATE patch into several ones picked up 1-12 Thanks! -- Best regards,

Re: [PATCH v5 13/18] pci: introduce pci_find_the_only_child()

2023-03-02 Thread Vladimir Sementsov-Ogievskiy
On 02.03.23 11:53, Michael S. Tsirkin wrote: On Thu, Mar 02, 2023 at 11:45:00AM +0300, Vladimir Sementsov-Ogievskiy wrote: On 02.03.23 11:37, Michael S. Tsirkin wrote: On Thu, Mar 02, 2023 at 11:28:44AM +0300, Vladimir Sementsov-Ogievskiy wrote: On 02.03.23 00:09, Michael S. Tsirkin wrote:

Re: [PATCH v5 18/18] qapi: introduce DEVICE_ON event

2023-03-02 Thread Vladimir Sementsov-Ogievskiy
On 02.03.23 11:44, Michael S. Tsirkin wrote: On Thu, Feb 16, 2023 at 09:03:56PM +0300, Vladimir Sementsov-Ogievskiy wrote: We have DEVICE_DELETED event, that signals that device_del command is actually completed. But we don't have a counter-part for device_add. Still it's sensible for SHPC and

Re: [PATCH 8/9] mirror: return the remaining dirty bytes upon query

2023-03-02 Thread Vladimir Sementsov-Ogievskiy
On 02.03.23 13:00, Fiona Ebner wrote: Am 01.03.23 um 17:31 schrieb Vladimir Sementsov-Ogievskiy: On 24.02.23 17:48, Fiona Ebner wrote: This can be used by management applications starting with a job in background mode to determine when the switch to active mode should happen. Suggested-by:

[PATCH v3 5/6] hw/cxl: Add poison injection via the mailbox.

2023-03-02 Thread Jonathan Cameron via
Very simple implementation to allow testing of corresponding kernel code. Note that for now we track each 64 byte section independently. Whilst a valid implementation choice, it may make sense to fuse entries so as to prove out more complex corners of the kernel code. Signed-off-by: Jonathan

[PATCH v3 4/6] hw/cxl: QMP based poison injection support

2023-03-02 Thread Jonathan Cameron via
Inject poison using qmp command cxl-inject-poison to add an entry to the poison list. For now, the poison is not returned CXL.mem reads, but only via the mailbox command Get Poison List. See CXL rev 3.0, sec 8.2.9.8.4.1 Get Poison list (Opcode 4300h) Kernel patches to use this interface here:

Re: [PATCH 3/6] block: convert bdrv_graph_wrlock() to AIO_WAIT_WHILE_UNLOCKED()

2023-03-02 Thread Philippe Mathieu-Daudé
On 1/3/23 21:57, Stefan Hajnoczi wrote: The following conversion is safe and does not change behavior: GLOBAL_STATE_CODE(); ... - AIO_WAIT_WHILE(qemu_get_aio_context(), ...); + AIO_WAIT_WHILE_UNLOCKED(NULL, ...); Since we're in GLOBAL_STATE_CODE(), qemu_get_aio_context() is

Re: [PATCH] acpi: cpuhp: fix guest-visible maximum access size to the legacy reg block

2023-03-02 Thread Laszlo Ersek
On 3/2/23 09:32, Christian Ehrhardt wrote: > good ~instant > [08:14:37.267336194] Select Item: 0xE > [08:14:37.268346995] [Bds]RegisterKeyNotify: 000C/ 8000/00 Success > > bad ~8s > [08:15:43.561054490] Select Item: 0xE > [08:15:51.291039364] [Bds]RegisterKeyNotify: 000C/ 8000/00

  1   2   3   4   5   6   7   >