Re: [RESEND] qemu/timer: Add host ticks function for RISC-V

2023-09-09 Thread Paolo Bonzini
Il sab 9 set 2023, 03:35 Atish Patra ha scritto: > On Fri, Sep 8, 2023 at 3:29 AM Paolo Bonzini wrote: > > > > Queued, thanks. > > > > I didn't realize it was already queued. Gmail threads failed me this time. > @Paolo Bonzini : Can you please drop this one as this will break as > soon as the ho

Re: [PATCH v4 01/10] hw/fsi: Introduce IBM's Local bus

2023-09-09 Thread Cédric Le Goater
On 9/9/23 00:28, Ninad Palsule wrote: This is a part of patchset where IBM's Flexible Service Interface is introduced. The LBUS is modelled to maintain the qdev bus hierarchy and to take advantage of the object model to automatically generate the CFAM configuration block. The configuration block

Re: [PATCH v4 02/10] hw/fsi: Introduce IBM's scratchpad

2023-09-09 Thread Cédric Le Goater
On 9/9/23 00:28, Ninad Palsule wrote: This is a part of patchset where IBM's Flexible Service Interface is introduced. The LBUS device is embeded inside the scratchpad. The scratchpad embedded provides a non-functional registers. There is a 1-1 relation between scratchpad and LBUS devices. E

Re: [PATCH v8 11/12] virtio-sound: implement audio capture (RX)

2023-09-09 Thread Volker Rümelin
Am 28.08.23 um 21:55 schrieb Emmanouil Pitsidianakis: To perform audio capture we duplicate the TX logic of the previous commit with the following difference: we receive data from the QEMU audio backend and write it in the virt queue IO buffers the guest sends to QEMU. When they are full (i.e. th

Re: [QEMU PATCH v4 10/13] virtio-gpu: Resource UUID

2023-09-09 Thread Huang Rui
On Thu, Aug 31, 2023 at 06:36:57PM +0800, Akihiko Odaki wrote: > On 2023/08/31 18:32, Huang Rui wrote: > > From: Antonio Caggiano > > > > Enable resource UUID feature and implement command resource assign UUID. > > This is done by introducing a hash table to map resource IDs to their > > UUIDs. >

Re: [QEMU PATCH v4 11/13] virtio-gpu: Support Venus capset

2023-09-09 Thread Huang Rui
On Thu, Aug 31, 2023 at 06:43:17PM +0800, Akihiko Odaki wrote: > On 2023/08/31 18:32, Huang Rui wrote: > > From: Antonio Caggiano > > > > Add support for the Venus capset, which enables Vulkan support through > > the Venus Vulkan driver for virtio-gpu. > > > > Signed-off-by: Antonio Caggiano >

[PATCH v2 00/20] q800: add support for booting MacOS Classic - part 2

2023-09-09 Thread Mark Cave-Ayland
This series contains the remaining patches needed to allow QEMU's q800 machine to boot MacOS Classic when used in conjunction with a real Quadra 800 ROM image. In fact with this series applied it is possible to boot all of the following OSs: - MacOS 7.1 - 8.1, with or without virtual memory enab

[PATCH v2 09/20] q800: add Apple Sound Chip (ASC) audio to machine

2023-09-09 Thread Mark Cave-Ayland
The Quadra 800 has the enhanced ASC (EASC) audio chip which supports both the legacy IRQ routing through VIA2 and also "A/UX" mode routing direct to the CPU. Co-developed-by: Laurent Vivier Signed-off-by: Mark Cave-Ayland --- hw/m68k/q800-glue.c | 11 ++- hw/m68k/q800.c

[PATCH v2 06/20] q800: allow accesses to RAM area even if less memory is available

2023-09-09 Thread Mark Cave-Ayland
MacOS attempts a series of writes and reads over the entire RAM area in order to determine the amount of RAM within the machine. Allow accesses to the entire RAM area ignoring writes and always reading zero for areas where there is no physical RAM installed to allow MacOS to detect the memory size

[PATCH v2 03/20] q800: add machine id register

2023-09-09 Thread Mark Cave-Ayland
MacOS reads this address to identify the hardware. This is a basic implementation returning the ID of Quadra 800. Details: http://mess.redump.net/mess/driver_info/mac_technical_notes "There are 3 ID schemes [...] The third and most scalable is a machine ID register at 0x5ffc. The top wo

[PATCH v2 11/20] swim: add trace events for IWM and ISM registers

2023-09-09 Thread Mark Cave-Ayland
Signed-off-by: Mark Cave-Ayland --- hw/block/swim.c | 14 ++ hw/block/trace-events | 7 +++ 2 files changed, 21 insertions(+) diff --git a/hw/block/swim.c b/hw/block/swim.c index 333da08ce0..7df36ea139 100644 --- a/hw/block/swim.c +++ b/hw/block/swim.c @@ -19,6 +19,7 @@ #

[PATCH v2 04/20] q800: implement additional machine id bits on VIA1 port A

2023-09-09 Thread Mark Cave-Ayland
Co-developed-by: Laurent Vivier Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé --- hw/misc/mac_via.c | 14 +- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/hw/misc/mac_via.c b/hw/misc/mac_via.c index 0787a0268d..baeb73eeb3 100644 --- a/hw/misc/ma

[PATCH v2 13/20] swim: update IWM/ISM register block decoding

2023-09-09 Thread Mark Cave-Ayland
Update the IWM/ISM register block decoding to match the description given in the "SWIM Chip Users Reference". This allows us to validate the device response to the guest OS which currently only does just enough to indicate that the floppy drive is unavailable. Signed-off-by: Mark Cave-Ayland ---

[PATCH v2 17/20] mac_via: always clear ADB interrupt when switching to A/UX mode

2023-09-09 Thread Mark Cave-Ayland
When the NetBSD kernel initialises it can leave the ADB interrupt asserted depending upon where in the ADB poll cycle the MacOS ADB interrupt handler is when the NetBSD kernel disables interrupts. The NetBSD ADB driver uses the ADB interrupt state to determine if the ADB is busy and refuses to sen

[PATCH v2 02/20] q800: add djMEMC memory controller

2023-09-09 Thread Mark Cave-Ayland
The djMEMC controller is used to store information related to the physical memory configuration. Co-developed-by: Laurent Vivier Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé --- MAINTAINERS | 2 + hw/m68k/Kconfig | 1 + hw/m68k/q800.c

[PATCH v2 01/20] q800-glue.c: convert to Resettable interface

2023-09-09 Thread Mark Cave-Ayland
Convert the GLUE device to 3-phase reset. The legacy method doesn't do anything that's invalid in the hold phase, so the conversion is simple and not a behaviour change. Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé --- hw/m68k/q800-glue.c | 7 --- 1 file changed, 4 in

[PATCH v2 18/20] q800: add ESCC alias at 0xc000

2023-09-09 Thread Mark Cave-Ayland
Tests on real Q800 hardware show that the ESCC is addressable at multiple locations within the ESCC memory region - at least 0xc000, 0xc020 (as expected by the MacOS toolbox ROM) and 0xc040. All released NetBSD kernels before 10 use the 0xc000 address which causes a fatal error when running the

[PATCH v2 08/20] asc: generate silence if FIFO empty but engine still running

2023-09-09 Thread Mark Cave-Ayland
MacOS (un)helpfully leaves the FIFO engine running even when all the samples have been written to the hardware, and expects the FIFO status flags and IRQ to be updated continuously. There is an additional problem in that not all audio backends guarantee an all-zero output when there is no FIFO da

[PATCH v2 07/20] audio: add Apple Sound Chip (ASC) emulation

2023-09-09 Thread Mark Cave-Ayland
The Apple Sound Chip was primarily used by the Macintosh II to generate sound in hardware which was previously handled by the toolbox ROM with software interrupts. Implement both the standard ASC and also the enhanced ASC (EASC) functionality which is used in the Quadra 800. Note that whilst real

[PATCH v2 20/20] mac_via: extend timer calibration hack to work with A/UX

2023-09-09 Thread Mark Cave-Ayland
The A/UX timer calibration loop runs continuously until 2 consecutive iterations differ by at least 0x492 timer ticks. Modern hosts execute the timer calibration loop so fast that this situation never occurs causing a hang on boot. Use a similar method to Shoebill which is to randomly add 0x500 to

[PATCH v2 14/20] mac_via: work around underflow in TimeDBRA timing loop in SETUPTIMEK

2023-09-09 Thread Mark Cave-Ayland
The MacOS toolbox ROM calculates the number of branches that can be executed per millisecond as part of its timer calibration. Since modern hosts are considerably quicker than original hardware, the negative counter reaches zero before the calibration completes leading to division by zero later in

[PATCH v2 12/20] swim: split into separate IWM and ISM register blocks

2023-09-09 Thread Mark Cave-Ayland
The swim chip provides an implementation of both Apple's IWM and ISM floppy disk controllers. Split the existing implementation into separate register banks for each controller, whilst also switching the IWM registers from 16-bit to 8-bit as implemented in real hardware. Signed-off-by: Mark Cave-A

[PATCH v2 15/20] mac_via: workaround NetBSD ADB bus enumeration issue

2023-09-09 Thread Mark Cave-Ayland
NetBSD assumes it can send its first ADB command after sending the ADB_BUSRESET command in ADB_STATE_NEW without changing the state back to ADB_STATE_IDLE first as detailed in the ADB protocol. Add a workaround to detect this condition at the start of ADB enumeration and send the next command writ

[PATCH v2 10/20] q800: add easc bool machine class property to switch between ASC and EASC

2023-09-09 Thread Mark Cave-Ayland
This determines whether the Apple Sound Chip (ASC) is set to enhanced mode (default) or to original mode. The real Q800 hardware used an EASC chip however a lot of older software only works with the older ASC chip. Adding this as a machine parameter allows QEMU to be used as an developer aid for t

[PATCH v2 16/20] mac_via: implement ADB_STATE_IDLE state if shift register in input mode

2023-09-09 Thread Mark Cave-Ayland
NetBSD switches directly to IDLE state without switching the shift register to input mode. Duplicate the existing ADB_STATE_IDLE logic in input mode from when the shift register is in output mode which allows the ADB autopoll handler to handle the response. Signed-off-by: Mark Cave-Ayland --- hw

[PATCH v2 05/20] q800: add IOSB subsystem

2023-09-09 Thread Mark Cave-Ayland
It is needed because it defines the BIOSConfig area. Co-developed-by: Laurent Vivier Signed-off-by: Mark Cave-Ayland --- MAINTAINERS| 2 + hw/m68k/Kconfig| 1 + hw/m68k/q800.c | 9 +++ hw/misc/Kconfig| 3 + hw/misc/iosb.c | 133 +++

[PATCH v2 19/20] q800: add alias for MacOS toolbox ROM at 0x40000000

2023-09-09 Thread Mark Cave-Ayland
According to the Apple Quadra 800 Developer Note document, the Quadra 800 ROM consists of 2 ROM code sections based at offsets 0x0 and 0x80. A/UX attempts to access the toolbox ROM at the lower offset during startup, so provide a memory alias to allow the access to succeed. Signed-off-by: Mark

[Stable-8.1.1 00/34] Patch Round-up for stable 8.1.1, freeze on 2023-09-19

2023-09-09 Thread Michael Tokarev
The following patches are queued for QEMU stable v8.1.1: https://gitlab.com/qemu-project/qemu/-/commits/staging-8.1 Patch freeze is 2023-09-19, and the release is planned for 2023-09-21: https://wiki.qemu.org/Planning/8.1 Please respond here or CC qemu-sta...@nongnu.org on any additional pa

[Stable-8.1.1 07/34] accel/kvm: Specify default IPA size for arm64

2023-09-09 Thread Michael Tokarev
From: Akihiko Odaki Before this change, the default KVM type, which is used for non-virt machine models, was 0. The kernel documentation says: > On arm64, the physical address size for a VM (IPA Size limit) is > limited to 40bits by default. The limit can be configured if the host > supports the

[Stable-8.1.1 03/34] target/s390x: Fix VSTL with a large length

2023-09-09 Thread Michael Tokarev
From: Ilya Leoshkevich The length is always truncated to 16 bytes. Do not probe more than that. Cc: qemu-sta...@nongnu.org Fixes: 0e0a5b49ad58 ("s390x/tcg: Implement VECTOR STORE WITH LENGTH") Signed-off-by: Ilya Leoshkevich Message-Id: <20230804235624.263260-1-...@linux.ibm.com> Reviewed-by: D

[Stable-8.1.1 02/34] target/s390x: Use a 16-bit immediate in VREP

2023-09-09 Thread Michael Tokarev
From: Ilya Leoshkevich Unlike most other instructions that contain an immediate element index, VREP's one is 16-bit, and not 4-bit. The code uses only 8 bits, so using, e.g., 0x101 does not lead to a specification exception. Fix by checking all 16 bits. Cc: qemu-sta...@nongnu.org Fixes: 28d0873

[Stable-8.1.1 08/34] target/arm: Fix SME ST1Q

2023-09-09 Thread Michael Tokarev
From: Richard Henderson A typo, noted in the bug report, resulting in an incorrect write offset. Cc: qemu-sta...@nongnu.org Fixes: 7390e0e9ab8 ("target/arm: Implement SME LD1, ST1") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1833 Signed-off-by: Richard Henderson Reviewed-by: Philip

[Stable-8.1.1 13/34] block-migration: Ensure we don't crash during migration cleanup

2023-09-09 Thread Michael Tokarev
From: Fabiano Rosas We can fail the blk_insert_bs() at init_blk_migration(), leaving the BlkMigDevState without a dirty_bitmap and BlockDriverState. Account for the possibly missing elements when doing cleanup. Fix the following crashes: Thread 1 "qemu-system-x86" received signal SIGSEGV, Segme

[Stable-8.1.1 06/34] kvm: Introduce kvm_arch_get_default_type hook

2023-09-09 Thread Michael Tokarev
From: Akihiko Odaki kvm_arch_get_default_type() returns the default KVM type. This hook is particularly useful to derive a KVM type that is valid for "none" machine model, which is used by libvirt to probe the availability of KVM. For MIPS, the existing mips_kvm_type() is reused. This function e

[Stable-8.1.1 01/34] target/s390x: Fix the "ignored match" case in VSTRS

2023-09-09 Thread Michael Tokarev
From: Ilya Leoshkevich Currently the emulation of VSTRS recognizes partial matches in presence of \0 in the haystack, which, according to PoP, is not correct: If the ZS flag is one and a zero byte was detected in the second operand, then there can not be a partial match ... Add a ch

[Stable-8.1.1 16/34] target/i386: raise FERR interrupt with iothread locked

2023-09-09 Thread Michael Tokarev
From: Paolo Bonzini Otherwise tcg_handle_interrupt() triggers an assertion failure: #5 0x55c97369 in tcg_handle_interrupt (cpu=0x57434cb0, mask=2) at ../accel/tcg/tcg-accel-ops.c:83 #6 tcg_handle_interrupt (cpu=0x57434cb0, mask=2) at ../accel/tcg/tcg-accel-ops.c:81 #7

[Stable-8.1.1 18/34] ppc/vof: Fix missed fields in VOF cleanup

2023-09-09 Thread Michael Tokarev
From: Nicholas Piggin Failing to reset the of_instance_last makes ihandle allocation continue to increase, which causes record-replay replay fail to match the recorded trace. Not resetting claimed_base makes VOF eventually run out of memory after some resets. Cc: Alexey Kardashevskiy Fixes: fc

[Stable-8.1.1 10/34] docs/about/license: Update LICENSE URL

2023-09-09 Thread Michael Tokarev
From: Philippe Mathieu-Daudé In early 2021 (see commit 2ad784339e "docs: update README to use GitLab repo URLs") almost all of the code base was converted to point to GitLab instead of git.qemu.org. During 2023, git.qemu.org switched from a git mirror to a http redirect to GitLab (see [1]). Upda

[Stable-8.1.1 22/34] hw/ide/core: set ERR_STAT in unsupported command completion

2023-09-09 Thread Michael Tokarev
From: Niklas Cassel Currently, the first time sending an unsupported command (e.g. READ LOG DMA EXT) will not have ERR_STAT set in the completion. Sending the unsupported command again, will correctly have ERR_STAT set. When ide_cmd_permitted() returns false, it calls ide_abort_command(). ide_ab

[Stable-8.1.1 17/34] ui/dbus: Properly dispose touch/mouse dbus objects

2023-09-09 Thread Michael Tokarev
From: Bilal Elmoussaoui Fixes: 142ca628a7 ("ui: add a D-Bus display backend") Fixes: de9f844ce2 ("ui/dbus: Expose a touch device interface") Signed-off-by: Bilal Elmoussaoui Reviewed-by: Marc-André Lureau Message-Id: <20230901124507.94087-1-belmo...@redhat.com> (cherry picked from commit cb6cc

[Stable-8.1.1 20/34] target/ppc: Flush inputs to zero with NJ in ppc_store_vscr

2023-09-09 Thread Michael Tokarev
From: Richard Henderson Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1779 Signed-off-by: Richard Henderson Reviewed-by: Nicholas Piggin Signed-off-by: Cédric Le Goater (cherry picked from commit af03aeb631eeb81a44d2c0ff5b429cd4b5dc2799) Signed-off-by: Michael Tokarev diff --git a/

[Stable-8.1.1 15/34] linux-user: Adjust brk for load_bias

2023-09-09 Thread Michael Tokarev
From: Richard Henderson PIE executables are usually linked at offset 0 and are relocated somewhere during load. The hiaddr needs to be adjusted to keep the brk next to the executable. Cc: qemu-sta...@nongnu.org Fixes: 1f356e8c013 ("linux-user: Adjust initial brk when interpreter is close to ex

[Stable-8.1.1 27/34] hw/ide/ahci: fix ahci_write_fis_sdb()

2023-09-09 Thread Michael Tokarev
From: Niklas Cassel When there is an error, we need to raise a TFES error irq, see AHCI 1.3.1, 5.3.13.1 SDB:Entry. If ERR_STAT is set, we jump to state ERR:FatalTaskfile, which will raise a TFES IRQ unconditionally, regardless if the I bit is set in the FIS or not. Thus, we should never raise a

[Stable-8.1.1 30/34] hw/i2c/aspeed: Fix TXBUF transmission start position error

2023-09-09 Thread Michael Tokarev
From: Hang Yu According to the ast2600 datasheet and the linux aspeed i2c driver, the TXBUF transmission start position should be TXBUF[0] instead of TXBUF[1],so the arg pool_start is useless,and the address is not included in TXBUF.So even if Tx Count equals zero,there is at least 1 byte data ne

[Stable-8.1.1 14/34] target/arm: properly document FEAT_CRC32

2023-09-09 Thread Michael Tokarev
From: Alex Bennée This is a mandatory feature for Armv8.1 architectures but we don't state the feature clearly in our emulation list. Also include FEAT_CRC32 comment in aarch64_max_tcg_initfn for ease of grepping. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée Message-id: 20230

[Stable-8.1.1 28/34] hw/ide/ahci: fix broken SError handling

2023-09-09 Thread Michael Tokarev
From: Niklas Cassel When encountering an NCQ error, you should not write the NCQ tag to the SError register. This is completely wrong. The SError register has a clear definition, where each bit represents a different error, see PxSERR definition in AHCI 1.3.1. If we write a random value (like t

[Stable-8.1.1 26/34] hw/ide/ahci: PxCI should not get cleared when ERR_STAT is set

2023-09-09 Thread Michael Tokarev
From: Niklas Cassel For NCQ, PxCI is cleared on command queued successfully. For non-NCQ, PxCI is cleared on command completed successfully. Successfully means ERR_STAT, BUSY and DRQ are all cleared. A command that has ERR_STAT set, does not get to clear PxCI. See AHCI 1.3.1, section 5.3.8, stat

[Stable-8.1.1 23/34] hw/ide/ahci: write D2H FIS when processing NCQ command

2023-09-09 Thread Michael Tokarev
From: Niklas Cassel The way that BUSY + PxCI is cleared for NCQ (FPDMA QUEUED) commands is described in SATA 3.5a Gold: 11.15 FPDMA QUEUED command protocol DFPDMAQ2: ClearInterfaceBsy "Transmit Register Device to Host FIS with the BSY bit cleared to zero and the DRQ bit cleared to zero and Inter

[Stable-8.1.1 33/34] hw/net/vmxnet3: Fix guest-triggerable assert()

2023-09-09 Thread Michael Tokarev
From: Thomas Huth The assert() that checks for valid MTU sizes can be triggered by the guest (e.g. with the reproducer code from the bug ticket https://gitlab.com/qemu-project/qemu/-/issues/517 ). Let's avoid this problem by simply logging the error and refusing to activate the device instead. F

[Stable-8.1.1 24/34] hw/ide/ahci: simplify and document PxCI handling

2023-09-09 Thread Michael Tokarev
From: Niklas Cassel The AHCI spec states that: For NCQ, PxCI is cleared on command queued successfully. For non-NCQ, PxCI is cleared on command completed successfully. (A non-NCQ command that completes with error does not clear PxCI.) The current QEMU implementation either clears PxCI in check_

[Stable-8.1.1 05/34] include/hw/virtio/virtio-gpu: Fix virtio-gpu with blob on big endian hosts

2023-09-09 Thread Michael Tokarev
From: Thomas Huth Using "-device virtio-gpu,blob=true" currently does not work on big endian hosts (like s390x). The guest kernel prints an error message like: [drm:virtio_gpu_dequeue_ctrl_func [virtio_gpu]] *ERROR* response 0x1200 (command 0x10c) and the display stays black. When running QEM

[Stable-8.1.1 09/34] target/arm: Fix 64-bit SSRA

2023-09-09 Thread Michael Tokarev
From: Richard Henderson Typo applied byte-wise shift instead of double-word shift. Cc: qemu-sta...@nongnu.org Fixes: 631e565450c ("target/arm: Create gen_gvec_[us]sra") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1737 Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Da

[Stable-8.1.1 04/34] target/s390x: Check reserved bits of VFMIN/VFMAX's M5

2023-09-09 Thread Michael Tokarev
From: Ilya Leoshkevich VFMIN and VFMAX should raise a specification exceptions when bits 1-3 of M5 are set. Cc: qemu-sta...@nongnu.org Fixes: da4807527f3b ("s390x/tcg: Implement VECTOR FP (MAXIMUM|MINIMUM)") Signed-off-by: Ilya Leoshkevich Message-Id: <20230804234621.252522-1-...@linux.ibm.com>

[Stable-8.1.1 31/34] qemu-options.hx: Rephrase the descriptions of the -hd* and -cdrom options

2023-09-09 Thread Michael Tokarev
From: Thomas Huth The current description says that these options will create a device on the IDE bus, which is only true on x86. So rephrase these sentences a little bit to speak of "default bus" instead. Signed-off-by: Thomas Huth Reviewed-by: Alex Bennée Signed-off-by: Michael Tokarev (che

[Stable-8.1.1 12/34] softmmu: Use async_run_on_cpu in tcg_commit

2023-09-09 Thread Michael Tokarev
From: Richard Henderson After system startup, run the update to memory_dispatch and the tlb_flush on the cpu. This eliminates a race, wherein a running cpu sees the memory_dispatch change but has not yet seen the tlb_flush. Since the update now happens on the cpu, we need not use qatomic_rcu_re

[Stable-8.1.1 19/34] hw/ppc/e500: fix broken snapshot replay

2023-09-09 Thread Michael Tokarev
From: Maksim Kostin ppce500_reset_device_tree is registered for system reset, but after c4b075318eb1 this function rerandomizes rng-seed via qemu_guest_getrandom_nofail. And when loading a snapshot, it tries to read EVENT_RANDOM that doesn't exist, so we have an error: qemu-system-ppc: Missing

[Stable-8.1.1 29/34] hw/i2c/aspeed: Fix Tx count and Rx size error in buffer pool mode

2023-09-09 Thread Michael Tokarev
From: Hang Yu Fixed inconsistency between the regisiter bit field definition header file and the ast2600 datasheet. The reg name is I2CD1C:Pool Buffer Control Register in old register mode and I2CC0C: Master/Slave Pool Buffer Control Register in new register mode. They share bit field [12:8]:Tra

[Stable-8.1.1 34/34] qxl: don't assert() if device isn't yet initialized

2023-09-09 Thread Michael Tokarev
From: Marc-André Lureau If the PCI BAR isn't yet mapped or was unmapped, QXL_IO_SET_MODE will assert(). Instead, report a guest bug and keep going. This can be reproduced with: cat << EOF | ./qemu-system-x86_64 -vga qxl -m 2048 -nodefaults -qtest stdio outl 0xcf8 0x8000101c outl 0xcfc 0xc000 ou

[Stable-8.1.1 25/34] hw/ide/ahci: PxSACT and PxCI is cleared when PxCMD.ST is cleared

2023-09-09 Thread Michael Tokarev
From: Niklas Cassel According to AHCI 1.3.1 definition of PxSACT: This field is cleared when PxCMD.ST is written from a '1' to a '0' by software. This field is not cleared by a COMRESET or a software reset. According to AHCI 1.3.1 definition of PxCI: This field is also cleared when PxCMD.ST is w

[Stable-8.1.1 21/34] target/ppc: Fix LQ, STQ register-pair order for big-endian

2023-09-09 Thread Michael Tokarev
From: Nicholas Piggin LQ, STQ have the same register-pair ordering as LQARX/STQARX., which is the even (lower) register contains the most significant bits. This is not implemented correctly for big-endian. do_ldst_quad() has variables low_addr_gpr and high_addr_gpr which is confusing because the

[Stable-8.1.1 11/34] softmmu: Assert data in bounds in iotlb_to_section

2023-09-09 Thread Michael Tokarev
From: Richard Henderson Acked-by: Alex Bennée Suggested-by: Alex Bennée Signed-off-by: Richard Henderson (cherry picked from commit 86e4f93d827d3c1efd00cd8a906e38a2c0f2b5bc) Signed-off-by: Michael Tokarev diff --git a/softmmu/physmem.c b/softmmu/physmem.c index 3df73542e1..7597dc1c39 100644

[Stable-8.1.1 32/34] docs tests: Fix use of migrate_set_parameter

2023-09-09 Thread Michael Tokarev
From: Markus Armbruster docs/multi-thread-compression.txt uses parameter names with underscores instead of dashes. Wrong since day one. docs/rdma.txt, tests/qemu-iotests/181, and tests/qtest/test-hmp.c are wrong the same way since commit cbde7be900d2 (v6.0.0). Hard to see, as test-hmp doesn't

Re: [QEMU PATCH v4 12/13] virtio-gpu: Initialize Venus

2023-09-09 Thread Huang Rui
On Thu, Aug 31, 2023 at 06:40:11PM +0800, Antonio Caggiano wrote: > Hi Huang, > > Thank you for pushing this forward! > My pleasure! :-) > On 31/08/2023 11:32, Huang Rui wrote: > > From: Antonio Caggiano > > > > Request Venus when initializing VirGL. > > > > Signed-off-by: Antonio Caggiano

Re: [QEMU PATCH v4 12/13] virtio-gpu: Initialize Venus

2023-09-09 Thread Huang Rui via
On Thu, Aug 31, 2023 at 11:51:50PM +0800, Dmitry Osipenko wrote: > On 8/31/23 13:40, Antonio Caggiano wrote: > > Hi Huang, > > > > Thank you for pushing this forward! > > > > On 31/08/2023 11:32, Huang Rui wrote: > >> From: Antonio Caggiano > >> > >> Request Venus when initializing VirGL. > >> >

[Stable-8.0.5 09/43] hw/nvme: fix CRC64 for guard tag

2023-09-09 Thread Michael Tokarev
From: Ankit Kumar The nvme CRC64 generator expects the caller to pass inverted seed value. Pass inverted crc value for metadata buffer. Cc: qemu-sta...@nongnu.org Fixes: 44219b6029fc ("hw/nvme: 64-bit pi support") Signed-off-by: Ankit Kumar Signed-off-by: Klaus Jensen (cherry picked from commi

[Stable-8.0.5 03/43] hw/smbios: Fix thread count in type4

2023-09-09 Thread Michael Tokarev
From: Zhao Liu >From SMBIOS 3.0 specification, thread count field means: Thread Count is the total number of threads detected by the BIOS for this processor socket. It is a processor-wide count, not a thread-per-core count. [1] So here we should use threads per socket other than threads per cor

[Stable-8.0.5 02/43] hw/smbios: Fix smbios_smp_sockets caculation

2023-09-09 Thread Michael Tokarev
From: Zhao Liu smp.sockets is the number of sockets which is configured by "-smp" ( otherwise, the default is 1). Trying to recalculate it here with another rules leads to errors, such as: 1. 003f230e37d7 ("machine: Tweak the order of topology members in struct CpuTopology") changes the meani

[Stable-8.0.5 01/43] machine: Add helpers to get cores/threads per socket

2023-09-09 Thread Michael Tokarev
From: Zhao Liu The number of cores/threads per socket are needed for smbios, and are also useful for other modules. Provide the helpers to wrap the calculation of cores/threads per socket so that we can avoid calculation errors caused by other modules miss topology changes. Suggested-by: Igor M

[Stable-8.0.5 00/43] Patch Round-up for stable 8.0.5, freeze on 2023-09-19

2023-09-09 Thread Michael Tokarev
The following patches are queued for QEMU stable v8.0.5: https://gitlab.com/qemu-project/qemu/-/commits/staging-8.0 Patch freeze is 2023-09-19, and the release is planned for 2023-09-21: https://wiki.qemu.org/Planning/8.0 Please respond here or CC qemu-sta...@nongnu.org on any additional pa

[Stable-8.0.5 07/43] hw/nvme: fix oob memory read in fdp events log

2023-09-09 Thread Michael Tokarev
From: Klaus Jensen As reported by Trend Micro's Zero Day Initiative, an oob memory read vulnerability exists in nvme_fdp_events(). The host-provided offset is not verified. Fix this. This is only exploitable when Flexible Data Placement mode (fdp=on) is enabled. Fixes: CVE-2023-4135 Fixes: 730

[Stable-8.0.5 11/43] hw/nvme: fix null pointer access in ruh update

2023-09-09 Thread Michael Tokarev
From: Klaus Jensen The Reclaim Unit Update operation in I/O Management Receive does not verify the presence of a configured endurance group prior to accessing it. Fix this. Cc: qemu-sta...@nongnu.org Fixes: 73064edfb864 ("hw/nvme: flexible data placement emulation") Reviewed-by: Jesper Wendel D

[Stable-8.0.5 10/43] hw/nvme: fix null pointer access in directive receive

2023-09-09 Thread Michael Tokarev
From: Klaus Jensen nvme_directive_receive() does not check if an endurance group has been configured (set) prior to testing if flexible data placement is enabled or not. Fix this. Cc: qemu-sta...@nongnu.org Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1815 Fixes: 73064edfb864 ("hw/nv

[Stable-8.0.5 13/43] include/exec/user: Set ABI_LLONG_ALIGNMENT to 4 for microblaze

2023-09-09 Thread Michael Tokarev
From: Richard Henderson Based on gcc's microblaze.h setting BIGGEST_ALIGNMENT to 32 bits. Signed-off-by: Richard Henderson (cherry picked from commit e73f27003e777fd9b77d13e71c5268015b8ed2b6) Signed-off-by: Michael Tokarev diff --git a/include/exec/user/abitypes.h b/include/exec/user/abitypes

[Stable-8.0.5 04/43] hw/smbios: Fix core count in type4

2023-09-09 Thread Michael Tokarev
From: Zhao Liu >From SMBIOS 3.0 specification, core count field means: Core Count is the number of cores detected by the BIOS for this processor socket. [1] Before 003f230e37d7 ("machine: Tweak the order of topology members in struct CpuTopology"), MachineState.smp.cores means "the number of co

[Stable-8.0.5 20/43] target/s390x: Check reserved bits of VFMIN/VFMAX's M5

2023-09-09 Thread Michael Tokarev
From: Ilya Leoshkevich VFMIN and VFMAX should raise a specification exceptions when bits 1-3 of M5 are set. Cc: qemu-sta...@nongnu.org Fixes: da4807527f3b ("s390x/tcg: Implement VECTOR FP (MAXIMUM|MINIMUM)") Signed-off-by: Ilya Leoshkevich Message-Id: <20230804234621.252522-1-...@linux.ibm.com>

[Stable-8.0.5 19/43] target/s390x: Fix VSTL with a large length

2023-09-09 Thread Michael Tokarev
From: Ilya Leoshkevich The length is always truncated to 16 bytes. Do not probe more than that. Cc: qemu-sta...@nongnu.org Fixes: 0e0a5b49ad58 ("s390x/tcg: Implement VECTOR STORE WITH LENGTH") Signed-off-by: Ilya Leoshkevich Message-Id: <20230804235624.263260-1-...@linux.ibm.com> Reviewed-by: D

[Stable-8.0.5 08/43] hw/nvme: fix compliance issue wrt. iosqes/iocqes

2023-09-09 Thread Michael Tokarev
From: Klaus Jensen As of prior to this patch, the controller checks the value of CC.IOCQES and CC.IOSQES prior to enabling the controller. As reported by Ben in GitLab issue #1691, this is not spec compliant. The controller should only check these values when queues are created. This patch moves

[Stable-8.0.5 15/43] Fixed incorrect LLONG alignment for openrisc and cris

2023-09-09 Thread Michael Tokarev
From: Luca Bonissi OpenRISC (or1k) has long long alignment to 4 bytes, but currently not defined in abitypes.h. This lead to incorrect packing of /epoll_event/ structure and eventually infinite loop while waiting for file descriptor[s] event[s]. Fixed also CRIS alignments (1 byte for all types).

[Stable-8.0.5 05/43] hw/i2c: Fix bitbang_i2c_data trace event

2023-09-09 Thread Michael Tokarev
From: BALATON Zoltan The clock and data values were logged swapped. Correct the trace event text to match what is logged. Also fix a typo in a comment nearby. Signed-off-by: BALATON Zoltan Signed-off-by: Michael Tokarev (cherry picked from commit 8ada214a902225c90583b644cabd85bc89bf188c) Signe

[Stable-8.0.5 27/43] block-migration: Ensure we don't crash during migration cleanup

2023-09-09 Thread Michael Tokarev
From: Fabiano Rosas We can fail the blk_insert_bs() at init_blk_migration(), leaving the BlkMigDevState without a dirty_bitmap and BlockDriverState. Account for the possibly missing elements when doing cleanup. Fix the following crashes: Thread 1 "qemu-system-x86" received signal SIGSEGV, Segme

[Stable-8.0.5 12/43] linux-user/elfload: Set V in ELF_HWCAP for RISC-V

2023-09-09 Thread Michael Tokarev
From: Nathan Egge Set V bit for hwcap if misa is set. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1793 Signed-off-by: Nathan Egge Reviewed-by: Daniel Henrique Barboza Tested-by: Daniel Henrique Barboza Message-Id: <20230803131424.40744-1-ne...@xiph.org> Signed-off-by: Richard Hend

[Stable-8.0.5 23/43] accel/kvm: Specify default IPA size for arm64

2023-09-09 Thread Michael Tokarev
From: Akihiko Odaki Before this change, the default KVM type, which is used for non-virt machine models, was 0. The kernel documentation says: > On arm64, the physical address size for a VM (IPA Size limit) is > limited to 40bits by default. The limit can be configured if the host > supports the

[Stable-8.0.5 16/43] hw/sd/sdhci: Do not force sdhci_mmio_*_ops onto all SD controllers

2023-09-09 Thread Michael Tokarev
From: Bernhard Beschow Since commit c0a55a0c9da2 "hw/sd/sdhci: Support big endian SD host controller interfaces" sdhci_common_realize() forces all SD card controllers to use either sdhci_mmio_le_ops or sdhci_mmio_be_ops, depending on the "endianness" property. However, there are device models whi

[Stable-8.0.5 14/43] include/exec/user: Set ABI_LLONG_ALIGNMENT to 4 for nios2

2023-09-09 Thread Michael Tokarev
From: Richard Henderson Based on gcc's nios2.h setting BIGGEST_ALIGNMENT to 32 bits. Signed-off-by: Richard Henderson (cherry picked from commit ea9812d93f9c3e1a308ac33097021c50d581d10e) Signed-off-by: Michael Tokarev diff --git a/include/exec/user/abitypes.h b/include/exec/user/abitypes.h in

[Stable-8.0.5 22/43] kvm: Introduce kvm_arch_get_default_type hook

2023-09-09 Thread Michael Tokarev
From: Akihiko Odaki kvm_arch_get_default_type() returns the default KVM type. This hook is particularly useful to derive a KVM type that is valid for "none" machine model, which is used by libvirt to probe the availability of KVM. For MIPS, the existing mips_kvm_type() is reused. This function e

[Stable-7.2.6 07/37] linux-user/elfload: Set V in ELF_HWCAP for RISC-V

2023-09-09 Thread Michael Tokarev
From: Nathan Egge Set V bit for hwcap if misa is set. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1793 Signed-off-by: Nathan Egge Reviewed-by: Daniel Henrique Barboza Tested-by: Daniel Henrique Barboza Message-Id: <20230803131424.40744-1-ne...@xiph.org> Signed-off-by: Richard Hend

[Stable-7.2.6 09/37] include/exec/user: Set ABI_LLONG_ALIGNMENT to 4 for nios2

2023-09-09 Thread Michael Tokarev
From: Richard Henderson Based on gcc's nios2.h setting BIGGEST_ALIGNMENT to 32 bits. Signed-off-by: Richard Henderson (cherry picked from commit ea9812d93f9c3e1a308ac33097021c50d581d10e) Signed-off-by: Michael Tokarev diff --git a/include/exec/user/abitypes.h b/include/exec/user/abitypes.h in

[Stable-8.0.5 35/43] hw/ide/ahci: PxCI should not get cleared when ERR_STAT is set

2023-09-09 Thread Michael Tokarev
From: Niklas Cassel For NCQ, PxCI is cleared on command queued successfully. For non-NCQ, PxCI is cleared on command completed successfully. Successfully means ERR_STAT, BUSY and DRQ are all cleared. A command that has ERR_STAT set, does not get to clear PxCI. See AHCI 1.3.1, section 5.3.8, stat

[Stable-7.2.6 14/37] target/s390x: Check reserved bits of VFMIN/VFMAX's M5

2023-09-09 Thread Michael Tokarev
From: Ilya Leoshkevich VFMIN and VFMAX should raise a specification exceptions when bits 1-3 of M5 are set. Cc: qemu-sta...@nongnu.org Fixes: da4807527f3b ("s390x/tcg: Implement VECTOR FP (MAXIMUM|MINIMUM)") Signed-off-by: Ilya Leoshkevich Message-Id: <20230804234621.252522-1-...@linux.ibm.com>

[Stable-8.0.5 21/43] include/hw/virtio/virtio-gpu: Fix virtio-gpu with blob on big endian hosts

2023-09-09 Thread Michael Tokarev
From: Thomas Huth Using "-device virtio-gpu,blob=true" currently does not work on big endian hosts (like s390x). The guest kernel prints an error message like: [drm:virtio_gpu_dequeue_ctrl_func [virtio_gpu]] *ERROR* response 0x1200 (command 0x10c) and the display stays black. When running QEM

[Stable-8.0.5 29/43] ppc/vof: Fix missed fields in VOF cleanup

2023-09-09 Thread Michael Tokarev
From: Nicholas Piggin Failing to reset the of_instance_last makes ihandle allocation continue to increase, which causes record-replay replay fail to match the recorded trace. Not resetting claimed_base makes VOF eventually run out of memory after some resets. Cc: Alexey Kardashevskiy Fixes: fc

[Stable-8.0.5 42/43] hw/net/vmxnet3: Fix guest-triggerable assert()

2023-09-09 Thread Michael Tokarev
From: Thomas Huth The assert() that checks for valid MTU sizes can be triggered by the guest (e.g. with the reproducer code from the bug ticket https://gitlab.com/qemu-project/qemu/-/issues/517 ). Let's avoid this problem by simply logging the error and refusing to activate the device instead. F

[Stable-8.0.5 43/43] qxl: don't assert() if device isn't yet initialized

2023-09-09 Thread Michael Tokarev
From: Marc-André Lureau If the PCI BAR isn't yet mapped or was unmapped, QXL_IO_SET_MODE will assert(). Instead, report a guest bug and keep going. This can be reproduced with: cat << EOF | ./qemu-system-x86_64 -vga qxl -m 2048 -nodefaults -qtest stdio outl 0xcf8 0x8000101c outl 0xcfc 0xc000 ou

[Stable-7.2.6 23/37] ppc/vof: Fix missed fields in VOF cleanup

2023-09-09 Thread Michael Tokarev
From: Nicholas Piggin Failing to reset the of_instance_last makes ihandle allocation continue to increase, which causes record-replay replay fail to match the recorded trace. Not resetting claimed_base makes VOF eventually run out of memory after some resets. Cc: Alexey Kardashevskiy Fixes: fc

[Stable-8.0.5 39/43] hw/i2c/aspeed: Fix TXBUF transmission start position error

2023-09-09 Thread Michael Tokarev
From: Hang Yu According to the ast2600 datasheet and the linux aspeed i2c driver, the TXBUF transmission start position should be TXBUF[0] instead of TXBUF[1],so the arg pool_start is useless,and the address is not included in TXBUF.So even if Tx Count equals zero,there is at least 1 byte data ne

[Stable-7.2.6 32/37] hw/i2c/aspeed: Fix Tx count and Rx size error in buffer pool mode

2023-09-09 Thread Michael Tokarev
From: Hang Yu Fixed inconsistency between the regisiter bit field definition header file and the ast2600 datasheet. The reg name is I2CD1C:Pool Buffer Control Register in old register mode and I2CC0C: Master/Slave Pool Buffer Control Register in new register mode. They share bit field [12:8]:Tra

[Stable-7.2.6 35/37] docs tests: Fix use of migrate_set_parameter

2023-09-09 Thread Michael Tokarev
From: Markus Armbruster docs/multi-thread-compression.txt uses parameter names with underscores instead of dashes. Wrong since day one. docs/rdma.txt, tests/qemu-iotests/181, and tests/qtest/test-hmp.c are wrong the same way since commit cbde7be900d2 (v6.0.0). Hard to see, as test-hmp doesn't

[Stable-7.2.6 30/37] hw/ide/ahci: fix ahci_write_fis_sdb()

2023-09-09 Thread Michael Tokarev
From: Niklas Cassel When there is an error, we need to raise a TFES error irq, see AHCI 1.3.1, 5.3.13.1 SDB:Entry. If ERR_STAT is set, we jump to state ERR:FatalTaskfile, which will raise a TFES IRQ unconditionally, regardless if the I bit is set in the FIS or not. Thus, we should never raise a

[Stable-8.0.5 36/43] hw/ide/ahci: fix ahci_write_fis_sdb()

2023-09-09 Thread Michael Tokarev
From: Niklas Cassel When there is an error, we need to raise a TFES error irq, see AHCI 1.3.1, 5.3.13.1 SDB:Entry. If ERR_STAT is set, we jump to state ERR:FatalTaskfile, which will raise a TFES IRQ unconditionally, regardless if the I bit is set in the FIS or not. Thus, we should never raise a

[Stable-8.0.5 25/43] target/arm: Fix 64-bit SSRA

2023-09-09 Thread Michael Tokarev
From: Richard Henderson Typo applied byte-wise shift instead of double-word shift. Cc: qemu-sta...@nongnu.org Fixes: 631e565450c ("target/arm: Create gen_gvec_[us]sra") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1737 Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Da

  1   2   3   >