[PATCH] scripts/qemugdb/mtree.py: fix error of treating decimal as hexadecimal

2024-07-20 Thread Hawkins Jiawei
The mtree command throws the following exception: Python Exception : int too big to convert Error occurred in Python: int too big to convert The mtree command first converts `ptr['size']` to a python integer using int128(), then calculates the memory end address by `int(addr + (size - 1))`. Consid

Re: [PATCH] vhsot-user: Remove redundant judgment

2024-07-20 Thread BillXiang
> From: "Michael S. Tsirkin" > Date:  Sun, Jul 21, 2024, 03:14 > Subject:  Re: [PATCH] vhsot-user: Remove redundant judgment > To: "BillXiang" > Cc: , > On Wed, Jul 10, 2024 at 03:40:41PM +0800, BillXiang wrote: > > From: BillXiang > >  > > Send only once has been supported in vhost_user_write

Re: [PATCH v2] vhsot-user: Do not wait for replay for not sent VHOST_USER_SET_LOG_BASE

2024-07-20 Thread BillXiang
> From: "Michael S. Tsirkin" > Date:  Sun, Jul 21, 2024, 03:01 > Subject:  Re: [PATCH v2] vhsot-user: Do not wait for replay for not sent > VHOST_USER_SET_LOG_BASE > To: "BillXiang" > Cc: > typos in subject do not inspire confidence. Sorry >  > On Thu, Jul 18, 2024 at 04:31:03PM +0800, BillXi

Re: [PATCH v2] hw/i386/intel_iommu: Block CFI when necessary

2024-07-20 Thread Yuke Peng
Hi On Sun, Jul 21, 2024 at 3:05 AM Michael S. Tsirkin wrote: > > On Tue, Jul 09, 2024 at 04:43:25AM +, CLEMENT MATHIEU--DRIF wrote: > > Hi > > > > On 08/07/2024 12:08, Yuke Peng wrote: > > > Caution: External email. Do not open attachments or click links, unless > > > this email comes from a

Re: [PATCH v5 00/18] SMMUv3 nested translation support

2024-07-20 Thread Mostafa Saleh
Hi Peter, On Fri, Jul 19, 2024 at 04:57:18PM +0100, Peter Maydell wrote: > On Fri, 19 Jul 2024 at 16:36, Julien Grall wrote: > > > > Hi, > > > > On 18/07/2024 10:43, Julien Grall wrote: > > > Hi Eric, > > > > > > On 17/07/2024 18:43, Eric Auger wrote: > > >> Hi Peter, Richard, > > >> > > >> On 7/

Re: [PULL 21/26] hw/arm/smmu: Refactor SMMU OAS

2024-07-20 Thread Mostafa Saleh
Hi Peter, On Sat, Jul 20, 2024 at 04:05:40PM +0100, Peter Maydell wrote: > On Thu, 18 Jul 2024 at 14:20, Peter Maydell wrote: > > > > From: Mostafa Saleh > > > > SMMUv3 OAS is currently hardcoded in the code to 44 bits, for nested > > configurations that can be a problem, as stage-2 might be sha

Re: [PATCH V2 06/11] migration: fix mismatched GPAs during cpr

2024-07-20 Thread Steven Sistare
On 7/19/2024 12:28 PM, Peter Xu wrote: On Sun, Jun 30, 2024 at 12:40:29PM -0700, Steve Sistare wrote: For new cpr modes, ramblock_is_ignored will always be true, because the memory is preserved in place rather than copied. However, for an ignored block, parse_ramblock currently requires that th

Re: [PATCH V2 00/11] Live update: cpr-exec

2024-07-20 Thread Steven Sistare
On 7/18/2024 11:56 AM, Peter Xu wrote: Steve, On Sun, Jun 30, 2024 at 12:40:23PM -0700, Steve Sistare wrote: What? Thanks for trying out with the cpr-transfer series. I saw that that series missed most of the cc list here, so I'm attaching the link here: https://lore.kernel.org/r/1719776648

Re: [PATCH V2 01/11] machine: alloc-anon option

2024-07-20 Thread Steven Sistare
On 7/17/2024 3:24 PM, Peter Xu wrote: On Tue, Jul 16, 2024 at 11:19:55AM +0200, Igor Mammedov wrote: On Sun, 30 Jun 2024 12:40:24 -0700 Steve Sistare wrote: Allocate anonymous memory using mmap MAP_ANON or memfd_create depending on the value of the anon-alloc machine property. This affects m

Re: [PATCH V2 01/11] machine: alloc-anon option

2024-07-20 Thread Steven Sistare
On 7/16/2024 5:19 AM, Igor Mammedov wrote: On Sun, 30 Jun 2024 12:40:24 -0700 Steve Sistare wrote: Allocate anonymous memory using mmap MAP_ANON or memfd_create depending on the value of the anon-alloc machine property. This affects memory-backend-ram objects, guest RAM created with the globa

Re: [RFC V1 0/6] Live update: cpr-transfer

2024-07-20 Thread Steven Sistare
On 7/18/2024 11:36 AM, Peter Xu wrote: On Sun, Jun 30, 2024 at 12:44:02PM -0700, Steve Sistare wrote: What? This patch series adds the live migration cpr-transfer mode, which allows the user to transfer a guest to a new QEMU instance on the same host. It is identical to cpr-exec in most respec

Re: [PATCH V2 04/11] migration: stop vm earlier for cpr

2024-07-20 Thread Steven Sistare
On 7/17/2024 2:59 PM, Fabiano Rosas wrote: Steve Sistare writes: Stop the vm earlier for cpr, to guarantee consistent device state when CPR state is saved. Signed-off-by: Steve Sistare --- migration/migration.c | 22 +- 1 file changed, 13 insertions(+), 9 deletions(-)

[PATCH qemu] ui/gtk: Reuse input event slots for GdkEventTouch

2024-07-20 Thread ~katharine_chui
From: Katharine Chui There seems to be no guarantee as to how GdkEventTouch.sequence would progress https://docs.gtk.org/gdk3/struct.EventTouch.html In the case of steam gamescope session, touch input would increment the number every touch, resulting in all touch inputs after the 10th touch to g

Re: [PATCH V2 02/11] migration: cpr-state

2024-07-20 Thread Steven Sistare
On 7/19/2024 11:03 AM, Peter Xu wrote: On Sun, Jun 30, 2024 at 12:40:25PM -0700, Steve Sistare wrote: CPR must save state that is needed after QEMU is restarted, when devices are realized. Thus the extra state cannot be saved in the migration stream, as objects must already exist before that st

Re: [PATCH 0/2] Postcopy migration and vhost-user errors

2024-07-20 Thread Michael S. Tsirkin
On Wed, Jul 17, 2024 at 09:47:17AM -0400, Peter Xu wrote: > On Wed, Jul 17, 2024 at 09:40:06AM -0400, Michael S. Tsirkin wrote: > > On Wed, Jul 17, 2024 at 09:33:01AM -0400, Peter Xu wrote: > > > Hi, Michael, > > > > > > On Wed, Jul 17, 2024 at 04:55:52AM -0400, Michael S. Tsirkin wrote: > > > > I

Re: [PATCH 1/2] vhost-user: add a write-read lock

2024-07-20 Thread Michael S. Tsirkin
On Thu, Jul 11, 2024 at 06:44:23PM +0530, Prasad Pandit wrote: > From: Prasad Pandit > > QEMU threads use vhost_user_write/read calls to send > and receive messages from a vhost-user device. When multiple > threads communicate with the same vhost-user device, they can > receive each other's messa

Re: [PATCH] smbios: make memory device size configurable per Machine

2024-07-20 Thread Michael S. Tsirkin
On Thu, Jul 11, 2024 at 03:05:11PM +0200, Igor Mammedov wrote: > On Thu, 11 Jul 2024 07:13:27 -0400 > "Michael S. Tsirkin" wrote: > > > On Thu, Jul 11, 2024 at 09:48:22AM +0200, Igor Mammedov wrote: > > > Currently SMBIOS maximum memory device chunk is capped at 16Gb, > > > which is fine for the

[RFC V1 05/12] iommufd: preserve device fd

2024-07-20 Thread Steve Sistare
Save the iommu and vfio device fd in CPR state when it is created, and fetch the fd from that state after CPR. Save the devid as the fd id. Remember that the fd was reused, for subsequent patches. Signed-off-by: Steve Sistare --- backends/iommufd.c | 12 +++- hw/vfio/iommufd.c

[RFC V1 11/12] iommufd: update DMA virtual addresses

2024-07-20 Thread Steve Sistare
Register a vmstate post_load handler to call IOMMU_IOAS_CHANGE_PROCESS and update the virtual address of all DMA mappings after CPR. Signed-off-by: Steve Sistare --- backends/iommufd.c | 81 +- 1 file changed, 80 insertions(+), 1 deletion(-) d

[RFC V1 07/12] iommufd: change_process kernel interface

2024-07-20 Thread Steve Sistare
Define IOMMU_IOAS_CHANGE_PROCESS for use by CPR. This interface is preliminary. Signed-off-by: Steve Sistare --- linux-headers/linux/iommufd.h | 19 +++ 1 file changed, 19 insertions(+) diff --git a/linux-headers/linux/iommufd.h b/linux-headers/linux/iommufd.h index 72e8f4b..568

[RFC V1 12/12] vfio: mdev blocker

2024-07-20 Thread Steve Sistare
Block CPR if the container has any mdevs (mediated devices). CPR is not supported for legacy containers and mdevs. It will be supported for iommufd containers with mdevs in a future patch. Signed-off-by: Steve Sistare --- hw/vfio/pci.c | 10 ++ include/hw/vfio/v

[RFC V1 06/12] iommufd: export iommufd_cdev_get_info_iova_range

2024-07-20 Thread Steve Sistare
Export iommufd_cdev_get_info_iova_range for use by CPR. No functional change. Signed-off-by: Steve Sistare --- hw/vfio/iommufd.c | 4 ++-- include/hw/vfio/vfio-common.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/vfio/iommufd.c b/hw/vfio/iommufd.c index

[RFC V1 08/12] vfio/iommufd: register container for cpr

2024-07-20 Thread Steve Sistare
Register a vfio iommufd container for CPR. Add a blocker if the kernel does not support IOMMU_IOAS_CHANGE_PROCESS. Signed-off-by: Steve Sistare --- backends/iommufd.c| 8 ++ hw/vfio/cpr-iommufd.c | 60 +++ hw/vfio/iommufd.c

[RFC V1 09/12] vfio/iommufd: rebuild device

2024-07-20 Thread Steve Sistare
Rebuild userland device state after CPR. During vfio_realize, skip all ioctls that configure the device, as it was already configured in old QEMU, and we preserved the device descriptor. Preserve the ioas_id in vmstate. Because we skip ioctl's, it is not needed at realize time. However, we do n

[RFC V1 01/12] vfio: move cpr_exec_notifier

2024-07-20 Thread Steve Sistare
Move the cpr notifier to the base container. This change will be squashed into the "live update: vfio" series. Signed-off-by: Steve Sistare --- hw/vfio/cpr-legacy.c | 10 +- include/hw/vfio/vfio-common.h | 1 - include/hw/vfio/vfio-container-base.h | 1 + 3 fi

[RFC V1 04/12] migration: cpr_find_fd_any

2024-07-20 Thread Steve Sistare
Add a function for finding a CPR fd by name, for any value of id, and return the id. Signed-off-by: Steve Sistare --- include/migration/cpr.h | 1 + migration/cpr.c | 15 +++ 2 files changed, 16 insertions(+) diff --git a/include/migration/cpr.h b/include/migration/cpr.h in

[RFC V1 03/12] iommufd: pass name to connect

2024-07-20 Thread Steve Sistare
Pass device name to iommufd_backend_connect and iommufd_backend_disconnect, for use by CPR in a subsequent patch. No functional change. Signed-off-by: Steve Sistare --- backends/iommufd.c | 4 ++-- hw/vfio/iommufd.c| 6 +++--- include/sysemu/iommufd.h | 5 +++-- 3 files changed, 8

[RFC V1 00/12] Live update: iommufd

2024-07-20 Thread Steve Sistare
Support iommufd devices with the cpr-exec live migration mode. No user-visible interfaces are added. Pass the iommufd and vfio device descriptors from old to new QEMU. In new QEMU, during vfio_realize, skip the ioctls that configure the device, because it is already configured. In new QEMU, call

[RFC V1 02/12] iommufd: no DMA to BARs

2024-07-20 Thread Steve Sistare
Do not map VFIO PCI BARs for DMA. This stops a raft of warnings of the following form at QEMU start time when using -object iommufd: qemu-kvm: warning: IOMMU_IOAS_MAP failed: Bad address, PCI BAR? qemu-kvm: vfio_container_dma_map(0x58282db0, 0x880001, 0x4000, 0x77ff) = -14 (Bad a

[RFC V1 10/12] migration/ram: old host address

2024-07-20 Thread Steve Sistare
Remember the RAMBlock host address as host_old during migration, for use by CPR. The iommufd interface to update the virtual address of DMA mappings requires it. Signed-off-by: Steve Sistare --- hw/core/machine.c | 6 ++ include/exec/ramblock.h | 1 + migration/migration.h | 2 ++ m

Re: [PATCH v4 6/6] virtio: Add VIRTIO_F_IN_ORDER property definition

2024-07-20 Thread Michael S. Tsirkin
On Wed, Jul 10, 2024 at 08:55:19AM -0400, Jonah Palmer wrote: > Extend the virtio device property definitions to include the > VIRTIO_F_IN_ORDER feature. > > The default state of this feature is disabled, allowing it to be > explicitly enabled where it's supported. > > Acked-by: Eugenio Pérez >

Re: [PATCH] vhsot-user: Remove redundant judgment

2024-07-20 Thread Michael S. Tsirkin
On Wed, Jul 10, 2024 at 03:40:41PM +0800, BillXiang wrote: > From: BillXiang > > Send only once has been supported in vhost_user_write by > vhost_user_per_device_request > > Signed-off-by: BillXiang I am confused by all the patches. Is it on top of your other patch or instead of? Because that

Re: [PATCH v10 06/12] pcie_sriov: Reuse SR-IOV VF device instances

2024-07-20 Thread Michael S. Tsirkin
On Sat, Jul 13, 2024 at 09:45:07PM +0900, Akihiko Odaki wrote: > On 2024/07/10 19:52, Michael S. Tsirkin wrote: > > On Wed, Jul 10, 2024 at 08:37:27AM +0200, Cédric Le Goater wrote: > > > Hello, > > > > > > This change introduced a regression on s390x. I could have spotted it > > > earlier. Sorry

Re: [PATCH v4 4/4] intel_iommu: make types match

2024-07-20 Thread Michael S. Tsirkin
On Sat, Jul 20, 2024 at 02:46:14PM -0400, Michael S. Tsirkin wrote: > On Mon, Jul 08, 2024 at 03:20:45PM +0800, Yi Liu wrote: > > On 2024/7/5 19:01, CLEMENT MATHIEU--DRIF wrote: > > > From: Clément Mathieu--Drif > > > > > > The 'level' field in vtd_iotlb_key is an unsigned integer. > > > We don't

Re: [PATCH v4 3/4] intel_iommu: fix type of the mask field in VTDIOTLBPageInvInfo

2024-07-20 Thread Michael S. Tsirkin
On Sat, Jul 20, 2024 at 02:45:29PM -0400, Michael S. Tsirkin wrote: > On Mon, Jul 08, 2024 at 03:12:27PM +0800, Yi Liu wrote: > > On 2024/7/5 19:01, CLEMENT MATHIEU--DRIF wrote: > > > From: Clément Mathieu--Drif > > > > > > The mask we are trying to store into VTDIOTLBPageInvInfo.mask might not >

Re: [PATCH v4 0/4] VT-d minor fixes

2024-07-20 Thread Michael S. Tsirkin
On Sat, Jul 20, 2024 at 02:44:18PM -0400, Michael S. Tsirkin wrote: > On Fri, Jul 05, 2024 at 11:01:55AM +, CLEMENT MATHIEU--DRIF wrote: > > From: Clément Mathieu--Drif > > > > Various fixes for VT-d > > > > This series contains fixes that will be necessary > > when adding in-guest (fully em

Re: [PATCH v2] hw/i386/intel_iommu: Block CFI when necessary

2024-07-20 Thread Michael S. Tsirkin
On Tue, Jul 09, 2024 at 04:43:25AM +, CLEMENT MATHIEU--DRIF wrote: > Hi > > On 08/07/2024 12:08, Yuke Peng wrote: > > Caution: External email. Do not open attachments or click links, unless > > this email comes from a known sender and you know the content is safe. > > > > > > According to Int

Re: [PATCH v2] vhsot-user: Do not wait for replay for not sent VHOST_USER_SET_LOG_BASE

2024-07-20 Thread Michael S. Tsirkin
typos in subject do not inspire confidence. On Thu, Jul 18, 2024 at 04:31:03PM +0800, BillXiang wrote: > From: BillXiang > > We have added VHOST_USER_SET_LOG_BASE to vhost_user_per_device_request > in https://lists.nongnu.org/archive/html/qemu-devel/2024-06/msg02559.html Pls put commit here not

Re: [PATCH v9] virtio-net: Fix network stall at the host side waiting for kick

2024-07-20 Thread Michael S. Tsirkin
On Mon, Jul 08, 2024 at 12:48:39PM +0800, Wencheng Yang wrote: > From: thomas > > Patch 06b12970174 ("virtio-net: fix network stall under load") > added double-check to test whether the available buffer size > can satisfy the request or not, in case the guest has added > some buffers to the avail

Re: [PATCH 1/1] pci: don't skip function 0 occupancy verification for devfn auto assign

2024-07-20 Thread Michael S. Tsirkin
On Sun, Jul 07, 2024 at 09:10:56PM -0700, Dongli Zhang wrote: > When the devfn is already assigned in the command line, the > do_pci_register_device() may verify if the function 0 is already occupied. > > However, when devfn < 0, the verification is skipped because it is part of > the last "else i

Re: [PATCH v4 4/4] intel_iommu: make types match

2024-07-20 Thread Michael S. Tsirkin
On Mon, Jul 08, 2024 at 03:20:45PM +0800, Yi Liu wrote: > On 2024/7/5 19:01, CLEMENT MATHIEU--DRIF wrote: > > From: Clément Mathieu--Drif > > > > The 'level' field in vtd_iotlb_key is an unsigned integer. > > We don't need to store level as an int in vtd_lookup_iotlb. > > > > This is not an issu

Re: [PATCH v4 3/4] intel_iommu: fix type of the mask field in VTDIOTLBPageInvInfo

2024-07-20 Thread Michael S. Tsirkin
On Mon, Jul 08, 2024 at 03:12:27PM +0800, Yi Liu wrote: > On 2024/7/5 19:01, CLEMENT MATHIEU--DRIF wrote: > > From: Clément Mathieu--Drif > > > > The mask we are trying to store into VTDIOTLBPageInvInfo.mask might not > > fit in an uint8_t. Use uint64_t to avoid overflows > > Per the below code,

Re: [PATCH v4 0/4] VT-d minor fixes

2024-07-20 Thread Michael S. Tsirkin
On Fri, Jul 05, 2024 at 11:01:55AM +, CLEMENT MATHIEU--DRIF wrote: > From: Clément Mathieu--Drif > > Various fixes for VT-d > > This series contains fixes that will be necessary > when adding in-guest (fully emulated) SVM support. Clément are you going to address Yi Liu's comments? > v4 >

Re: [PATCH 0/3] Resolve vt82c686 and piix4 qemu_irq memory leaks

2024-07-20 Thread Michael S. Tsirkin
On Thu, Jul 04, 2024 at 10:58:51PM +0200, Bernhard Beschow wrote: > This series first turns vt82c686's "INTR" pin into a named GPIO for better > comprehensibility. It then continues fixing qemu_irq memory leaks in vt82c686 > and piix4 by connecting out IRQs of the south bridges before they get > r

Re: [PATCH] intel-iommu: fix Read DMAR IQA REG DW

2024-07-20 Thread Michael S. Tsirkin
On Thu, Jul 04, 2024 at 11:53:02AM +0800, YeeLi wrote: > From: yeeli > > When dmar_readq or devmem2 read the DW of IQA always 0UL because > "& VTD_IQA_QS". So, try to fix it. > > case: > after vtd_mem_write > IQA val: 0x100206801 > > after vtd_mem_read > IQA val: 0x100206001 > > Signed-off-by:

Re: [PATCH] intel-iommu: fix Read DMAR IQA REG DW

2024-07-20 Thread Michael S. Tsirkin
On Thu, Jul 04, 2024 at 02:54:00PM +0800, Yee Li wrote: > Sorry, the patch missing "(( ))" > Replace "& VTD_IQA_QS" with "& (VTD_IQA_QS | VTD_IQA_DW_MASK))" is correct. > Revised patch as follows, > So submit it properly. Also, how did you test the patch? > Signed-off-by: yeeli > --- > hw

Re: [PATCH v4 00/17] Introduce support for IGVM files

2024-07-20 Thread Michael S. Tsirkin
On Wed, Jul 03, 2024 at 12:05:38PM +0100, Roy Hopkins wrote: > Here is v4 of the set of patches to add support for IGVM files to QEMU. This > is > based on commit 1a2d52c7fc of qemu. > > This version addresses all of the review comments from v3 along with a couple > of > small bug fixes. This is

Re: [PATCH v2 0/8] hw/display/apple-gfx: New macOS PV Graphics device

2024-07-20 Thread Akihiko Odaki
On 2024/07/21 0:16, Phil Dennis-Jordan wrote: On Sat 20. Jul 2024 at 16:42, Akihiko Odaki > wrote: > It also became clear in out-of-band communication that Alexander would > probably not end up having the time to see the patch through to inc

Re: [PULL 26/30] target/riscv: Do not setup pmu timer if OF is disabled

2024-07-20 Thread Peter Maydell
On Thu, 18 Jul 2024 at 03:15, Alistair Francis wrote: > > From: Atish Patra > > The timer is setup function is invoked in both hpmcounter > write and mcountinhibit write path. If the OF bit set, the > LCOFI interrupt is disabled. There is no benefitting in > setting up the qemu timer until LCOFI

Re: [PATCH v2 0/8] hw/display/apple-gfx: New macOS PV Graphics device

2024-07-20 Thread Phil Dennis-Jordan
On Sat 20. Jul 2024 at 16:42, Akihiko Odaki wrote: > > > It also became clear in out-of-band communication that Alexander would > > probably not end up having the time to see the patch through to > inclusion, > > and was happy for me to start making changes and to integrate my PCI > code. > > I t

Re: [PULL 21/26] hw/arm/smmu: Refactor SMMU OAS

2024-07-20 Thread Peter Maydell
On Thu, 18 Jul 2024 at 14:20, Peter Maydell wrote: > > From: Mostafa Saleh > > SMMUv3 OAS is currently hardcoded in the code to 44 bits, for nested > configurations that can be a problem, as stage-2 might be shared with > the CPU which might have different PARANGE, and according to SMMU manual >

Re: [PULL 21/30] target/riscv: Implement privilege mode filtering for cycle/instret

2024-07-20 Thread Peter Maydell
On Thu, 18 Jul 2024 at 03:12, Alistair Francis wrote: > > From: Atish Patra > > Privilege mode filtering can also be emulated for cycle/instret by > tracking host_ticks/icount during each privilege mode switch. This > patch implements that for both cycle/instret and mhpmcounters. The > first one

Re: [PATCH v2 0/8] hw/display/apple-gfx: New macOS PV Graphics device

2024-07-20 Thread Akihiko Odaki
On 2024/07/17 20:03, Phil Dennis-Jordan wrote: This sequence of patches integrates the paravirtualised graphics device implemented by macOS's ParavirtualizedGraphics.Framework into Qemu. Combined with the guest drivers which ship with macOS versions 11 and up, this allows the guest OS to use the

Re: [PATCH] [PATCH] system/memory: Fix max access size

2024-07-20 Thread Peter Maydell
On Sat, 20 Jul 2024 at 08:56, TaiseiIto wrote: > > Before this commit, an HPET driver can not write correct values to > comparator registers of HPET timers. When I tested my HPET driver on QEMU, I > ovserved too early HPET interruptions. I investigated cause and found that > QEMU didn't write high

Re: [PATCH v2] hw/timer/hpet: Fix wrong HPET interrupts

2024-07-20 Thread 伊藤 太清
Thank you for preparing the hpet branch. I tried to use the branch. Your modification was not enough to solve my problem but I confirmed that the problem is completely solved by adding the following 2 patches on your hpet branch. https://lore.kernel.org/qemu-devel/ty0pr0101mb42850337f8917d1f514107

[PATCH v6 3/5] vvfat: Fix wrong checks for cluster mappings invariant

2024-07-20 Thread Amjad Alsharafi
How this `abort` was intended to check for was: - if the `mapping->first_mapping_index` is not the same as `first_mapping_index`, which **should** happen only in one case, when we are handling the first mapping, in that case `mapping->first_mapping_index == -1`, in all other cases, the other

[PATCH v6 4/5] vvfat: Fix reading files with non-continuous clusters

2024-07-20 Thread Amjad Alsharafi
When reading with `read_cluster` we get the `mapping` with `find_mapping_for_cluster` and then we call `open_file` for this mapping. The issue appear when its the same file, but a second cluster that is not immediately after it, imagine clusters `500 -> 503`, this will give us 2 mappings one has th

[PATCH v6 5/5] iotests: Add `vvfat` tests

2024-07-20 Thread Amjad Alsharafi
Added several tests to verify the implementation of the vvfat driver. We needed a way to interact with it, so created a basic `fat16.py` driver that handled writing correct sectors for us. Added `vvfat` to the non-generic formats, as its not a normal image format. Signed-off-by: Amjad Alsharafi

[PATCH v6 1/5] vvfat: Fix bug in writing to middle of file

2024-07-20 Thread Amjad Alsharafi
Before this commit, the behavior when calling `commit_one_file` for example with `offset=0x2000` (second cluster), what will happen is that we won't fetch the next cluster from the fat, and instead use the first cluster for the read operation. This is due to off-by-one error here, where `i=0x2000

[PATCH v6 0/5] vvfat: Fix write bugs for large files and add iotests

2024-07-20 Thread Amjad Alsharafi
These patches fix some bugs found when modifying files in vvfat. First, there was a bug when writing to the cluster 2 or above of a file, it will copy the cluster before it instead, so, when writing to cluster=2, the content of cluster=1 will be copied into disk instead in its place. Another issue

[PATCH v6 2/5] vvfat: Fix usage of `info.file.offset`

2024-07-20 Thread Amjad Alsharafi
The field is marked as "the offset in the file (in clusters)", but it was being used like this `cluster_size*(nums)+mapping->info.file.offset`, which is incorrect. Signed-off-by: Amjad Alsharafi Reviewed-by: Kevin Wolf --- block/vvfat.c | 11 +++ 1 file changed, 7 insertions(+), 4 delet

[PATCH v4 1/6] target/arm/kvm: Set PMU for host only when available

2024-07-20 Thread Akihiko Odaki
target/arm/kvm.c checked PMU availability but unconditionally set the PMU feature flag for the host CPU model, which is confusing. Set the feature flag only when available. Signed-off-by: Akihiko Odaki --- target/arm/kvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/targe

[PATCH v4 5/6] hvf: arm: Properly disable PMU

2024-07-20 Thread Akihiko Odaki
Setting pmu property used to have no effect for hvf so fix it. Signed-off-by: Akihiko Odaki --- target/arm/hvf/hvf.c | 184 +++ 1 file changed, 97 insertions(+), 87 deletions(-) diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c index 1a7495

[PATCH v4 4/6] hvf: arm: Raise an exception for sysreg by default

2024-07-20 Thread Akihiko Odaki
Any sysreg access results in an exception unless defined otherwise so we should raise an exception by default. Signed-off-by: Akihiko Odaki --- target/arm/hvf/hvf.c | 174 +-- 1 file changed, 85 insertions(+), 89 deletions(-) diff --git a/target/a

[PATCH v4 6/6] hvf: arm: Do not advance PC when raising an exception

2024-07-20 Thread Akihiko Odaki
This is identical with commit 30a1690f2402 ("hvf: arm: Do not advance PC when raising an exception") but for writes instead of reads. Fixes: a2260983c655 ("hvf: arm: Add support for GICv3") Signed-off-by: Akihiko Odaki --- target/arm/hvf/hvf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 delet

[PATCH v4 2/6] target/arm/kvm: Do not silently remove PMU

2024-07-20 Thread Akihiko Odaki
kvm_arch_init_vcpu() used to remove PMU when it is not available even if the CPU model needs one. It is semantically incorrect, and may continue execution on a misbehaving host that advertises a CPU model while lacking its PMU. Keep the PMU when the CPU model needs one, and let kvm_arm_vcpu_init()

[PATCH v4 3/6] target/arm: Always add pmu property for Armv7-A/R+

2024-07-20 Thread Akihiko Odaki
kvm-steal-time and sve properties are added for KVM even if the corresponding features are not available. Always add pmu property for Armv8. Note that the property is added only for Armv7-A/R+ as QEMU currently emulates PMU only for such versions, and a different version may have a different defini

[PATCH v4 0/6] target/arm/kvm: Report PMU unavailability

2024-07-20 Thread Akihiko Odaki
target/arm/kvm.c checked PMU availability but claimed PMU is available even if it is not. In fact, Asahi Linux supports KVM but lacks PMU support. Only advertise PMU availability only when it is really available. Fixes: dc40d45ebd8e ("target/arm/kvm: Move kvm_arm_get_host_cpu_features and unexpor

Re: [PATCH v6 7/8] target/riscv: Add any32 and max32 CPU for RV64 QEMU

2024-07-20 Thread Daniel Henrique Barboza
On 7/19/24 8:11 PM, LIU Zhiwei wrote: We may need 32-bit max or 32-bit any CPU for RV64 QEMU. Thus we add these two CPUs for RV64 QEMU. The reason we don't expose them to RV32 QEMU is that we already have max or any cpu with the same configuration. Another reason is that we want to follow the

Re: [PATCH v6 8/8] tests/avocado: Boot Linux for RV32 cpu on RV64 QEMU

2024-07-20 Thread Daniel Henrique Barboza
On 7/19/24 8:11 PM, LIU Zhiwei wrote: make check-avocado AVOCADO_TESTS=tests/avocado/tuxrun_baselines.py: \ TuxRunBaselineTest:test_riscv64_rv32 Signed-off-by: LIU Zhiwei Suggested-by: Daniel Henrique Barboza --- Reviewed-by: Daniel Henrique Barboza tests/avocado/tuxrun_baselines.py

[PATCH] [PATCH] system/memory: Fix max access size

2024-07-20 Thread TaiseiIto
Before this commit, an HPET driver can not write correct values to comparator registers of HPET timers. When I tested my HPET driver on QEMU, I ovserved too early HPET interruptions. I investigated cause and found that QEMU didn't write higher 32 bits of comparator registers of HPET timers even tho

Re: [PATCH] ui/cocoa: Do not automatically zoom for HiDPI

2024-07-20 Thread Akihiko Odaki
On 2024/03/22 22:06, Peter Maydell wrote: On Mon, 18 Mar 2024 at 09:02, Akihiko Odaki wrote: Cocoa automatically zooms for a HiDPI display like Retina and makes the display blurry. Revert the automatic zooming. Signed-off-by: Akihiko Odaki --- ui/cocoa.m | 9 ++--- 1 file changed, 6 i