[PATCH v2 09/14] target/riscv: Expose Zvks[c|g] extnesion properties

2023-10-26 Thread Max Chou
Expose the properties of ShangMi Algorithm Suite related extensions (Zvks, Zvksc, Zvksg). Signed-off-by: Max Chou --- target/riscv/cpu.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 8eae8d3e59c..1709df76a9b 100644 --- a/target/riscv/cpu.

[PATCH v2 13/14] disas/riscv: Add support for vector crypto extensions

2023-10-26 Thread Max Chou
This patch adds following v1.0.0 ratified vector crypto extensions support to the RISC-V disassembler. - Zvbb - Zvbc - Zvkb - Zvkg - Zvkned - Zvknha - Zvknhb - Zvksed - Zvksh Signed-off-by: Max Chou --- disas/riscv.c | 137 ++ 1 file changed, 137 i

[PATCH v2 14/14] disas/riscv: Replace TABs with space

2023-10-26 Thread Max Chou
Replaces TABs with spaces, making sure to have a consistent coding style of 4 space indentations. Signed-off-by: Max Chou --- disas/riscv.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/disas/riscv.c b/disas/riscv.c index 7ea6ea050e9..e9458e574b9 100644 --- a/disas/ri

[PATCH v2 12/14] disas/riscv: Add rv_codec_vror_vi for vror.vi

2023-10-26 Thread Max Chou
Add rv_codec_vror_vi for the vector crypto instruction - vror.vi. The rotate amount of vror.vi is defined by combining seperated bits. Signed-off-by: Max Chou --- disas/riscv.c | 14 +- disas/riscv.h | 1 + 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/disas/riscv.c

[PATCH v2 07/14] target/riscv: Expose Zvkn[c|g] extnesion properties

2023-10-26 Thread Max Chou
Expose the properties of NIST Algorithm Suite related extensions (Zvkn, Zvknc, Zvkng). Signed-off-by: Max Chou --- target/riscv/cpu.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 992f8e0f7b0..8eae8d3e59c 100644 --- a/target/riscv/cpu.c +

[PATCH v2 11/14] disas/riscv: Add rv_fmt_vd_vs2_uimm format

2023-10-26 Thread Max Chou
Add rv_fmt_vd_vs2_uimm format for vector crypto instructions. Signed-off-by: Max Chou --- disas/riscv.h | 1 + 1 file changed, 1 insertion(+) diff --git a/disas/riscv.h b/disas/riscv.h index 8abb578b515..b242d73b25e 100644 --- a/disas/riscv.h +++ b/disas/riscv.h @@ -274,6 +274,7 @@ enum { #def

[PATCH v2 08/14] target/riscv: Add cfg properties for Zvks[c|g] extensions

2023-10-26 Thread Max Chou
Vector crypto spec defines the ShangMi algorithm suite related extensions (Zvks, Zvksc, Zvksg) combined by several vector crypto extensions. Signed-off-by: Max Chou --- target/riscv/cpu_cfg.h | 3 +++ target/riscv/tcg/tcg-cpu.c | 17 + 2 files changed, 20 insertions(+) diff

[PATCH v2 03/14] target/riscv: Add cfg property for Zvkb extension

2023-10-26 Thread Max Chou
After vector crypto spec v1.0.0-rc3 release, the Zvkb extension is defined as a proper subset of the Zvbb extension. And both the Zvkn and Zvks shorthand extensions replace the included Zvbb extension by Zvkb extnesion. Signed-off-by: Max Chou --- target/riscv/cpu_cfg.h | 1 + target/riscv/t

[PATCH v2 05/14] target/riscv: Expose Zvkb extension property

2023-10-26 Thread Max Chou
Signed-off-by: Max Chou --- target/riscv/cpu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 5099c786415..992f8e0f7b0 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -125,6 +125,7 @@ const RISCVIsaExtData isa_edata_arr[] = { I

[PATCH v2 04/14] target/riscv: Replace Zvbb checking by Zvkb

2023-10-26 Thread Max Chou
The Zvkb extension is a proper subset of the Zvbb extension and includes following instructions: * vandn.[vv,vx] * vbrev8.v * vrev8.v * vrol.[vv,vx] * vror.[vv,vx,vi] Signed-off-by: Max Chou --- target/riscv/insn_trans/trans_rvvk.c.inc | 37 +++- 1 file changed, 24

[PATCH v2 02/14] target/riscv: Expose Zvkt extension property

2023-10-26 Thread Max Chou
Signed-off-by: Max Chou --- target/riscv/cpu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index a2881bfa383..5099c786415 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -131,6 +131,7 @@ const RISCVIsaExtData isa_edata_arr[] = { I

[PATCH v2 01/14] target/riscv: Add cfg property for Zvkt extension

2023-10-26 Thread Max Chou
Vector crypto spec defines the Zvkt extension that included all of the instructions of Zvbb & Zvbc extensions and some vector instructions. Signed-off-by: Max Chou --- target/riscv/cpu_cfg.h | 1 + target/riscv/tcg/tcg-cpu.c | 5 + 2 files changed, 6 insertions(+) diff --git a/target/ri

[PATCH v2 00/14] Update RISC-V vector crypto to ratified v1.0.0

2023-10-26 Thread Max Chou
This patchset updates the RISC-V vector cryptography support to the ratified version v1.0.0 (commit 1769c26, released on 2023/10). v2: - Fixed the instruction order at disassembler part. - Fixed the vror.vi disassembler format. - Verified by code examples provided by vector crypto spec repository

Re: [PATCH v3 3/6] target/riscv/tcg: add user flag for profile support

2023-10-26 Thread Andrew Jones
On Thu, Oct 26, 2023 at 07:36:21AM -0700, Andrea Bolognani wrote: > On Mon, Oct 23, 2023 at 07:35:16PM +0200, Andrew Jones wrote: > > On Mon, Oct 23, 2023 at 02:00:00PM -0300, Daniel Henrique Barboza wrote: > > > On 10/23/23 05:16, Andrew Jones wrote: > > > > Hmm, I'm not sure I agree with special-

Re: [PATCH v2 0/3] vfio/pci: Fix buffer overrun when writing the VF token

2023-10-26 Thread Konstantin Ryabitsev
October 26, 2023 at 5:58 AM, "Cédric Le Goater" wrote: > > Reviwed-by: Denis V. Lunev > > > > I changed that to "Reviewed-by". > > Interesting to see that b4 was ok with this new tag. When we see an email address in the trailer contents, we don't check it against a known-trailers list, beca

Re: [PATCH v6 22/23] hw/display: make ATI_VGA depend on PIXMAN

2023-10-26 Thread Marc-André Lureau
Hi On Thu, Oct 26, 2023 at 1:07 AM BALATON Zoltan wrote: > > On Wed, 25 Oct 2023, marcandre.lur...@redhat.com wrote: > > From: Marc-André Lureau > > > > Signed-off-by: Marc-André Lureau > > Acked-by: BALATON Zoltan > > --- > > configs/devices/mips64el-softmmu/default.mak | 2 +- > > hw/display/

Re: [PATCH v3 3/6] target/riscv/tcg: add user flag for profile support

2023-10-26 Thread Andrea Bolognani
On Mon, Oct 23, 2023 at 07:35:16PM +0200, Andrew Jones wrote: > On Mon, Oct 23, 2023 at 02:00:00PM -0300, Daniel Henrique Barboza wrote: > > On 10/23/23 05:16, Andrew Jones wrote: > > > Hmm, I'm not sure I agree with special-casing profiles like this. I think > > > the left-to-right processing shou

Re: [PATCH v3 01/37] vfio/container: Move IBM EEH related functions into spapr_pci_vfio.c

2023-10-26 Thread Eric Farman
On Thu, 2023-10-26 at 18:30 +0800, Zhenzhong Duan wrote: > With vfio_eeh_as_ok/vfio_eeh_as_op moved and made static, > vfio.h becomes empty and is deleted. > > No functional changes intended. > > Suggested-by: Cédric Le Goater > Signed-off-by: Zhenzhong Duan > --- >  include/hw/vfio/vfio.h  |  

Re: [PATCH 2/6] system/physmem: IOMMU: Invoke the translate_size function if it is implemented

2023-10-26 Thread Peter Xu
On Thu, Oct 26, 2023 at 02:48:14PM +0800, Ethan Chen wrote: > My target is to support IOPMP partially hit error. IOPMP checks whole memory > access region is in the same entry. If not, reject the access instead of > modify > the access size. Could you elaborate why is that important? In what us

Re: [PATCH v2 0/3] vfio/pci: Fix buffer overrun when writing the VF token

2023-10-26 Thread Cédric Le Goater
On 10/26/23 09:06, Cédric Le Goater wrote: Hello, This series fixes a buffer overrun in VFIO. The buffer used in vfio_realize() by qemu_uuid_unparse() is too small, UUID_FMT_LEN lacks one byte for the trailing NUL. Instead of adding + 1, as done elsewhere, the changes introduce a UUID_STR_LEN d

Re: [PATCH v2 2/3] vfio/pci: Fix buffer overrun when writing the VF token

2023-10-26 Thread Cédric Le Goater
On 10/26/23 13:28, Peter Maydell wrote: On Thu, 26 Oct 2023 at 08:08, Cédric Le Goater wrote: qemu_uuid_unparse() includes a trailing NUL when writing the uuid string and the buffer size should be UUID_FMT_LEN + 1 bytes. Use the recently added UUID_STR_LEN which defines the correct size. Fixe

Re: [PATCH v3 24/37] backends/iommufd: Introduce the iommufd object

2023-10-26 Thread Markus Armbruster
Zhenzhong Duan writes: > From: Eric Auger > > Introduce an iommufd object which allows the interaction > with the host /dev/iommu device. > > The /dev/iommu can have been already pre-opened outside of qemu, > in which case the fd can be passed directly along with the > iommufd object: > > This a

Re: [PATCH v3 00/37] vfio: Adopt iommufd

2023-10-26 Thread Markus Armbruster
Zhenzhong Duan writes: > Hi, > > Thanks all for giving guides and comments on previous series, here is > the v3 of pure iommufd support part. > > Based on Cédric's suggestion, this series includes an effort to remove > spapr code from container.c, now all spapr functions are moved to spapr.c > or

Replace calls to functions named cpu_physical_memory_* with address_space_*.

2023-10-26 Thread Tanmay
Hi, I'm really interested in contributing to qemu. I wanted to work on the renaming API calls cpu_physical_memory_* to address_space_*. I couldn't find any related issues on the GItlab tracker. Can I work on this issue? Thanks, Tanmay Patil

Re: [PATCH V6 0/9] Add architecture agnostic code to support vCPU Hotplug

2023-10-26 Thread Igor Mammedov
On Fri, 13 Oct 2023 11:51:20 +0100 Salil Mehta wrote: > Virtual CPU hotplug support is being added across various architectures[1][3]. > This series adds various code bits common across all architectures: > > 1. vCPU creation and Parking code refactor [Patch 1] > 2. Update ACPI GED framework to

Re: [PATCH v4 05/13] hw/riscv/virt-acpi-build.c: Add AIA support in RINTC

2023-10-26 Thread Sunil V L
On Thu, Oct 26, 2023 at 10:46:56AM +0200, Andrew Jones wrote: > On Thu, Oct 26, 2023 at 01:37:05AM +0530, Sunil V L wrote: > > Update the RINTC structure in MADT with AIA related fields. > > > > Signed-off-by: Sunil V L > > Reviewed-by: Daniel Henrique Barboza > > Acked-by: Alistair Francis > >

Re: [PATCH v4 09/13] hw/riscv/virt-acpi-build.c: Add MMU node in RHCT

2023-10-26 Thread Sunil V L
On Thu, Oct 26, 2023 at 10:31:51AM +0200, Andrew Jones wrote: > On Thu, Oct 26, 2023 at 01:37:09AM +0530, Sunil V L wrote: > > MMU type information is available via MMU node in RHCT. Add this node in > > RHCT. > > > > Signed-off-by: Sunil V L > > Reviewed-by: Daniel Henrique Barboza > > --- > >

Re: [PATCH v4 01/13] hw/arm/virt-acpi-build.c: Migrate fw_cfg creation to common location

2023-10-26 Thread Sunil V L
On Thu, Oct 26, 2023 at 10:15:00AM +0200, Andrew Jones wrote: > On Thu, Oct 26, 2023 at 01:37:01AM +0530, Sunil V L wrote: > ... > > diff --git a/hw/nvram/fw_cfg-acpi.c b/hw/nvram/fw_cfg-acpi.c > > new file mode 100644 > > index 00..eddaffc09b > > --- /dev/null > > +++ b/hw/nvram/fw_cfg-acp

Re: [PATCH v5 01/10] target/riscv/tcg: add 'zic64b' support

2023-10-26 Thread Andrew Jones
On Wed, Oct 25, 2023 at 08:44:50PM -0300, Daniel Henrique Barboza wrote: > zic64b is defined in the RVA22U64 profile [1] as a named feature for > "Cache blocks must be 64 bytes in size, naturally aligned in the address > space". It's a fantasy name for 64 bytes cache blocks. RVA22U64 > mandates th

Re: [PATCH v5 02/10] target/riscv: add rva22u64 profile definition

2023-10-26 Thread Andrew Jones
On Wed, Oct 25, 2023 at 08:44:51PM -0300, Daniel Henrique Barboza wrote: > The rva22U64 profile, described in: > > https://github.com/riscv/riscv-profiles/blob/main/profiles.adoc#rva22-profiles > > Contains a set of CPU extensions aimed for 64-bit userspace > applications. Enabling this set to be

Re: [Question] x86/microvm: why has_hotpluggable_cpus = false but hot(ub)plug APIs exist?

2023-10-26 Thread Igor Mammedov
On Wed, 25 Oct 2023 09:54:07 + Salil Mehta wrote: > > From: David Hildenbrand > > Sent: Wednesday, October 25, 2023 10:32 AM > > To: Salil Mehta ; Igor Mammedov > > ; Salil Mehta > > > > On 25.10.23 11:16, Salil Mehta wrote: > > > Hi Igor, > > > > > >> From: Igor Mammedov > > >> Sent:

Re: [PATCH v5 01/10] target/riscv/tcg: add 'zic64b' support

2023-10-26 Thread Andrew Jones
On Wed, Oct 25, 2023 at 08:44:50PM -0300, Daniel Henrique Barboza wrote: > zic64b is defined in the RVA22U64 profile [1] as a named feature for > "Cache blocks must be 64 bytes in size, naturally aligned in the address > space". It's a fantasy name for 64 bytes cache blocks. RVA22U64 > mandates th

Re: [PATCH 0/6] Support RISC-V IOPMP

2023-10-26 Thread Ethan Chen via
I found that after add size information it is still not enough for IOPMP to reject partially hit error. Access is separated in flatview_read_continue and lost the start address information. I will fix it in next version. Address start, address end will be added to MemTxAttr, translate_size wil

Re: [PATCH] MAINTAINERS: Add include/hw/timer/tmu012.h to the SH4 R2D section

2023-10-26 Thread Philippe Mathieu-Daudé
On 26/10/23 10:00, Thomas Huth wrote: tmu012.h is the header that belongs to hw/timer/sh_timer.c, so we should list it in the same section as sh_timer.c. Signed-off-by: Thomas Huth --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH 13/29] tcg/i386: Support TCG_COND_TST{EQ,NE}

2023-10-26 Thread Paolo Bonzini
On 10/26/23 02:14, Richard Henderson wrote: Signed-off-by: Richard Henderson --- Also, a TST{EQ,NE} with a one-bit immediate argument can be changed to: - a TEST reg, reg + js/jns (or sets/setns, or cmovs/cmovns) when testing bits 7, 15 or 31 - a BT reg, imm + jc/jnc (or setc/setnc, or cmo

Re: [PATCH v2 2/3] vfio/pci: Fix buffer overrun when writing the VF token

2023-10-26 Thread Peter Maydell
On Thu, 26 Oct 2023 at 08:08, Cédric Le Goater wrote: > > qemu_uuid_unparse() includes a trailing NUL when writing the uuid > string and the buffer size should be UUID_FMT_LEN + 1 bytes. Use the > recently added UUID_STR_LEN which defines the correct size. > > Fixes: CID 1522913 > Fixes: 2dca1b37a

Re: [PATCH v2 3/3] util/uuid: Remove UUID_FMT_LEN

2023-10-26 Thread Juan Quintela
Cédric Le Goater wrote: > Dangerous and now unused. > > Cc: Fam Zheng > Signed-off-by: Cédric Le Goater Reviewed-by: Juan Quintela

[PATCH v3 33/37] vfio/pci: Make vfio cdev pre-openable by passing a file handle

2023-10-26 Thread Zhenzhong Duan
This gives management tools like libvirt a chance to open the vfio cdev with privilege and pass FD to qemu. This way qemu never needs to have privilege to open a VFIO or iommu cdev node. Together with the earlier support of pre-opening /dev/iommu device, now we have full support of passing a vfio

[PATCH v3 06/37] vfio: Introduce base object for VFIOContainer and targetted interface

2023-10-26 Thread Zhenzhong Duan
Introduce a dumb VFIOContainer base object and its targetted interface. This is willingly not a QOM object because we don't want it to be visible from the user interface. The VFIOContainer will be smoothly populated in subsequent patches as well as interfaces. No fucntional change intended. Sign

[PATCH v3 37/37] vfio/ccw: Make vfio cdev pre-openable by passing a file handle

2023-10-26 Thread Zhenzhong Duan
This gives management tools like libvirt a chance to open the vfio cdev with privilege and pass FD to qemu. This way qemu never needs to have privilege to open a VFIO or iommu cdev node. Opportunisticly, remove a redundant definition of TYPE_VFIO_CCW. Signed-off-by: Zhenzhong Duan Signed-off-by:

[PATCH v3 25/37] util/char_dev: Add open_cdev()

2023-10-26 Thread Zhenzhong Duan
From: Yi Liu /dev/vfio/devices/vfioX may not exist. In that case it is still possible to open /dev/char/$major:$minor instead. Add helper function to abstract the cdev open. Suggested-by: Jason Gunthorpe Signed-off-by: Yi Liu Signed-off-by: Zhenzhong Duan Signed-off-by: Cédric Le Goater ---

[PATCH v3 16/37] vfio/container: Move dirty_pgsizes and max_dirty_bitmap_size to base container

2023-10-26 Thread Zhenzhong Duan
From: Eric Auger No functional change intended. Signed-off-by: Eric Auger Signed-off-by: Yi Liu Signed-off-by: Yi Sun Signed-off-by: Zhenzhong Duan Signed-off-by: Cédric Le Goater --- include/hw/vfio/vfio-common.h | 2 -- include/hw/vfio/vfio-container-base.h | 2 ++ hw/vfio/cont

[PATCH v3 24/37] backends/iommufd: Introduce the iommufd object

2023-10-26 Thread Zhenzhong Duan
From: Eric Auger Introduce an iommufd object which allows the interaction with the host /dev/iommu device. The /dev/iommu can have been already pre-opened outside of qemu, in which case the fd can be passed directly along with the iommufd object: This allows the iommufd object to be shared accr

[PATCH v3 15/37] vfio/container: Move listener to base container

2023-10-26 Thread Zhenzhong Duan
From: Eric Auger Move listener to base container. Also error and initialized fields are moved at the same time. No functional change intended. Signed-off-by: Eric Auger Signed-off-by: Yi Liu Signed-off-by: Yi Sun Signed-off-by: Zhenzhong Duan [ clg: context changes ] Signed-off-by: Cédric L

[PATCH v3 20/37] vfio/spapr: switch to spapr IOMMU BE add/del_section_window

2023-10-26 Thread Zhenzhong Duan
No fucntional change intended. Signed-off-by: Zhenzhong Duan --- include/hw/vfio/vfio-common.h | 5 - include/hw/vfio/vfio-container-base.h | 5 + hw/vfio/common.c | 8 ++-- hw/vfio/container-base.c | 23 ++- hw/vfio/sp

[PATCH v3 35/37] vfio/platform: Make vfio cdev pre-openable by passing a file handle

2023-10-26 Thread Zhenzhong Duan
This gives management tools like libvirt a chance to open the vfio cdev with privilege and pass FD to qemu. This way qemu never needs to have privilege to open a VFIO or iommu cdev node. Signed-off-by: Zhenzhong Duan Signed-off-by: Cédric Le Goater --- hw/vfio/platform.c | 41 ++

[PATCH v3 23/37] Add iommufd configure option

2023-10-26 Thread Zhenzhong Duan
This adds "--enable-iommufd/--disable-iommufd" to enable or disable iommufd support, enabled by default. Signed-off-by: Zhenzhong Duan Signed-off-by: Cédric Le Goater --- meson.build | 6 ++ meson_options.txt | 2 ++ scripts/meson-buildoptions.sh | 3 +++ 3 fil

[PATCH v3 30/37] vfio/pci: Extract out a helper vfio_pci_get_pci_hot_reset_info

2023-10-26 Thread Zhenzhong Duan
This helper will be used by both legacy and iommufd backends. No functional changes intended. Signed-off-by: Zhenzhong Duan --- hw/vfio/pci.c | 54 +++ 1 file changed, 37 insertions(+), 17 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c i

[PATCH v3 27/37] vfio/iommufd: Switch to manual hwpt allocation

2023-10-26 Thread Zhenzhong Duan
IOMMUFD supports auto allocated hwpt and manually allocated one. Manually allocated hwpt has benefit that its life cycle is under user's control, so it could be used as stage 2 page table by nested feature in the future. Introduce two helpers __vfio_device_attach/detach_hwpt to facilitate this cha

[PATCH v3 34/37] vfio: Allow the selection of a given iommu backend for platform ap and ccw

2023-10-26 Thread Zhenzhong Duan
Previously we added support to select iommu backend for vfio pci device. Now we added others, E.g: platform, ap and ccw. Signed-off-by: Zhenzhong Duan Signed-off-by: Cédric Le Goater --- include/hw/vfio/vfio-platform.h | 1 + hw/vfio/ap.c| 5 + hw/vfio/ccw.c

[PATCH v3 31/37] vfio/pci: Adapt vfio pci hot reset support with iommufd BE

2023-10-26 Thread Zhenzhong Duan
As pci hot reset path need to reference pci specific functions and data structures, adding container level callback functions for legacy and iommufd BE and referencing those pci specific func/data is no better than implementing reset support with iommufd BE directly in pci.c This way we can also s

[PATCH v3 18/37] vfio/container: Implement attach/detach_device

2023-10-26 Thread Zhenzhong Duan
From: Eric Auger No fucntional change intended. Signed-off-by: Eric Auger Signed-off-by: Yi Liu Signed-off-by: Yi Sun Signed-off-by: Zhenzhong Duan Signed-off-by: Cédric Le Goater --- hw/vfio/common.c| 16 hw/vfio/container.c | 12 +--- 2 files changed, 21 inse

[PATCH v3 26/37] vfio/iommufd: Implement the iommufd backend

2023-10-26 Thread Zhenzhong Duan
From: Yi Liu Add the iommufd backend. The IOMMUFD container class is implemented based on the new /dev/iommu user API. This backend obviously depends on CONFIG_IOMMUFD. So far, the iommufd backend doesn't support dirty page sync yet due to missing support in the host kernel. Co-authored-by: Eri

[PATCH v3 03/37] vfio/container: Move spapr specific init/deinit into spapr.c

2023-10-26 Thread Zhenzhong Duan
Move spapr specific init/deinit code into spapr.c and wrap them with vfio_spapr_container_init/deinit, this way footprint of spapr is further reduced, vfio_prereg_listener could also be made static. vfio_listener_release is unnecessary when prereg_listener is moved out, so have it removed. No fun

[PATCH v3 32/37] vfio/pci: Allow the selection of a given iommu backend

2023-10-26 Thread Zhenzhong Duan
From: Eric Auger Now we support two types of iommu backends, let's add the capability to select one of them. This depends on whether an iommufd object has been linked with the vfio-pci device: if the user wants to use the legacy backend, it shall not link the vfio-pci device with any iommufd obj

[PATCH v3 08/37] vfio/container: Switch to dma_map|unmap API

2023-10-26 Thread Zhenzhong Duan
From: Eric Auger No fucntional change intended. Signed-off-by: Eric Auger Signed-off-by: Yi Liu Signed-off-by: Yi Sun Signed-off-by: Zhenzhong Duan --- include/hw/vfio/vfio-common.h | 4 --- include/hw/vfio/vfio-container-base.h | 7 hw/vfio/common.c | 45

[PATCH v3 36/37] vfio/ap: Make vfio cdev pre-openable by passing a file handle

2023-10-26 Thread Zhenzhong Duan
This gives management tools like libvirt a chance to open the vfio cdev with privilege and pass FD to qemu. This way qemu never needs to have privilege to open a VFIO or iommu cdev node. Opportunisticly, remove some unnecessory double-cast. Signed-off-by: Zhenzhong Duan Signed-off-by: Cédric Le

[PATCH v3 29/37] vfio/iommufd: Bypass EEH if iommufd backend

2023-10-26 Thread Zhenzhong Duan
IBM EEH is only supported by legacy backend currently, bypass it for IOMMUFD backend. Signed-off-by: Zhenzhong Duan --- hw/ppc/spapr_pci_vfio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/ppc/spapr_pci_vfio.c b/hw/ppc/spapr_pci_vfio.c index d1d07bec46..a2518838a1 1

[PATCH v3 28/37] vfio/iommufd: Add support for iova_ranges

2023-10-26 Thread Zhenzhong Duan
Some vIOMMU such as virtio-iommu use iova ranges from host side to setup reserved ranges for passthrough device, so that guest will not use an iova range beyond host support. Use an uAPI of IOMMUFD to get iova ranges of host side and pass to vIOMMU just like the legacy backend. Signed-off-by: Zhe

[PATCH v3 14/37] vfio/container: Move vrdl_list, pgsizes and dma_max_mappings to base container

2023-10-26 Thread Zhenzhong Duan
From: Eric Auger Move vrdl_list, pgsizes and dma_max_mappings to the base container object No functional change intended. Signed-off-by: Eric Auger Signed-off-by: Yi Liu Signed-off-by: Yi Sun Signed-off-by: Zhenzhong Duan [ clg: context changes ] Signed-off-by: Cédric Le Goater --- includ

[PATCH v3 17/37] vfio/container: Move iova_ranges to base container

2023-10-26 Thread Zhenzhong Duan
Meanwhile remove the helper function vfio_free_container as it only calls g_free now. No functional change intended. Signed-off-by: Zhenzhong Duan --- include/hw/vfio/vfio-common.h | 1 - include/hw/vfio/vfio-container-base.h | 1 + hw/vfio/common.c | 5 +++-- hw

[PATCH v3 19/37] vfio/spapr: Introduce spapr backend and target interface

2023-10-26 Thread Zhenzhong Duan
Introduce an empry spapr backend which will hold spapr specific content, currently only prereg_listener and hostwin_list. Also introduce and instantiate a spapr specific target interface, currently only has add/del_window callbacks. Signed-off-by: Zhenzhong Duan --- include/hw/vfio/vfio-common.

[PATCH v3 13/37] vfio/container: Convert functions to base container

2023-10-26 Thread Zhenzhong Duan
From: Eric Auger In the prospect to get rid of VFIOContainer refs in common.c lets convert misc functions to use the base container object instead: vfio_devices_all_dirty_tracking vfio_devices_all_device_dirty_tracking vfio_devices_all_running_and_mig_active vfio_devices_query_dirty_bitmap vfio_

[PATCH v3 21/37] vfio/spapr: Move prereg_listener into spapr container

2023-10-26 Thread Zhenzhong Duan
No functional changes intended. Signed-off-by: Zhenzhong Duan --- include/hw/vfio/vfio-common.h | 1 - hw/vfio/spapr.c | 24 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/include/hw/vfio/vfio-common.h b/include/hw/vfio/vfio-common.h index

[PATCH v3 22/37] vfio/spapr: Move hostwin_list into spapr container

2023-10-26 Thread Zhenzhong Duan
No functional changes intended. Signed-off-by: Zhenzhong Duan --- include/hw/vfio/vfio-common.h | 1 - hw/vfio/spapr.c | 30 +- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/include/hw/vfio/vfio-common.h b/include/hw/vfio/vfio-common.

[PATCH v3 12/37] vfio/container: Move per container device list in base container

2023-10-26 Thread Zhenzhong Duan
VFIO Device is also changed to point to base container instead of legacy container. No fucntional change intended. Signed-off-by: Zhenzhong Duan [ clg: context changes ] Signed-off-by: Cédric Le Goater --- include/hw/vfio/vfio-common.h | 3 +-- include/hw/vfio/vfio-container-base.h |

[PATCH v3 05/37] vfio/common: Move vfio_host_win_add/del into spapr.c

2023-10-26 Thread Zhenzhong Duan
Only spapr supports a customed host window list, other vfio driver assume 64bit host window. So remove the check in listener callback and move vfio_host_win_add/del into spapr.c and make static. Suggested-by: Alex Williamson Signed-off-by: Zhenzhong Duan --- include/hw/vfio/vfio-common.h | 5 -

[PATCH v3 10/37] vfio/container: Move space field to base container

2023-10-26 Thread Zhenzhong Duan
From: Eric Auger Move the space field to the base object. Also the VFIOAddressSpace now contains a list of base containers. No fucntional change intended. Signed-off-by: Eric Auger Signed-off-by: Yi Liu Signed-off-by: Yi Sun Signed-off-by: Zhenzhong Duan [ clg: context changes ] Signed-off-

[PATCH v3 00/37] vfio: Adopt iommufd

2023-10-26 Thread Zhenzhong Duan
Hi, Thanks all for giving guides and comments on previous series, here is the v3 of pure iommufd support part. Based on Cédric's suggestion, this series includes an effort to remove spapr code from container.c, now all spapr functions are moved to spapr.c or spapr_pci_vfio.c, but there are still

[PATCH v3 07/37] vfio/container: Introduce a empty VFIOIOMMUOps

2023-10-26 Thread Zhenzhong Duan
This empty VFIOIOMMUOps named vfio_legacy_ops will hold all general IOMMU ops of legacy container. Signed-off-by: Zhenzhong Duan --- include/hw/vfio/vfio-common.h | 2 +- hw/vfio/container.c | 5 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/include/hw/vfio/vfio-c

[PATCH v3 09/37] vfio/common: Move giommu_list in base container

2023-10-26 Thread Zhenzhong Duan
From: Eric Auger Move the giommu_list field in the base object and store the base container in the VFIOGuestIOMMU. We introduce vfio_container_init/destroy helper on the base container. No fucntional change intended. Signed-off-by: Eric Auger Signed-off-by: Yi Liu Signed-off-by: Yi Sun Sign

[PATCH v3 04/37] vfio/spapr: Make vfio_spapr_create/remove_window static

2023-10-26 Thread Zhenzhong Duan
vfio_spapr_create_window calls vfio_spapr_remove_window, With reoder of definition of the two, we can make vfio_spapr_create/remove_window static. No functional changes intended. Signed-off-by: Zhenzhong Duan --- include/hw/vfio/vfio-common.h | 6 - hw/vfio/spapr.c | 48 +

[PATCH v3 11/37] vfio/container: Switch to IOMMU BE set_dirty_page_tracking/query_dirty_bitmap API

2023-10-26 Thread Zhenzhong Duan
From: Eric Auger dirty_pages_supported field is also moved to the base container No fucntional change intended. Signed-off-by: Eric Auger Signed-off-by: Yi Liu Signed-off-by: Yi Sun Signed-off-by: Zhenzhong Duan Signed-off-by: Cédric Le Goater --- include/hw/vfio/vfio-common.h |

[PATCH v3 02/37] vfio/container: Move vfio_container_add/del_section_window into spapr.c

2023-10-26 Thread Zhenzhong Duan
vfio_container_add/del_section_window are spapr specific functions, so move them into spapr.c to make container.c cleaner. No functional changes intended. Suggested-by: Cédric Le Goater Signed-off-by: Zhenzhong Duan --- hw/vfio/container.c | 90 - hw

[PATCH v3 01/37] vfio/container: Move IBM EEH related functions into spapr_pci_vfio.c

2023-10-26 Thread Zhenzhong Duan
With vfio_eeh_as_ok/vfio_eeh_as_op moved and made static, vfio.h becomes empty and is deleted. No functional changes intended. Suggested-by: Cédric Le Goater Signed-off-by: Zhenzhong Duan --- include/hw/vfio/vfio.h | 7 --- hw/ppc/spapr_pci_vfio.c | 100 +

Re: [PATCH 1/1] meson: Enable -Wshadow=local

2023-10-26 Thread Daniel P . Berrangé
On Thu, Oct 26, 2023 at 07:58:42AM +0200, Philippe Mathieu-Daudé wrote: > On 26/10/23 07:31, Markus Armbruster wrote: > > Local variables shadowing other local variables or parameters make the > > code needlessly hard to understand. Bugs love to hide in such code. > > Evidence: commit bbde656263d

Re: [PATCH 1/1] ui/cocoa: add full-screen-scaling display option

2023-10-26 Thread Carwyn Ellis
> On 26 Oct 2023, at 03:51, Akihiko Odaki wrote: > > On 2023/10/25 23:04, carwynel...@gmail.com wrote: >> From: Carwyn Ellis >> Provides a display option, full-screen-scaling, that enables scaling of >> the display when full-screen mode is enabled. >> Also ensures that the corresponding menu

Re: [PATCH] hyperv: add check for NULL for msg

2023-10-26 Thread Maciej S. Szmigiero
On 26.10.2023 11:31, Анастасия Любимова wrote: 28/09/23 19:18, Maciej S. Szmigiero пишет: On 28.09.2023 15:25, Anastasia Belova wrote: cpu_physical_memory_map may return NULL in hyperv_hcall_post_message. Add check for NULL to avoid NULL-dereference. Found by Linux Verification Center (linuxt

Re: [PATCH v2 0/3] vfio/pci: Fix buffer overrun when writing the VF token

2023-10-26 Thread Cédric Le Goater
On 10/26/23 10:41, Denis V. Lunev wrote: On 10/26/23 09:06, Cédric Le Goater wrote: Hello, This series fixes a buffer overrun in VFIO. The buffer used in vfio_realize() by qemu_uuid_unparse() is too small, UUID_FMT_LEN lacks one byte for the trailing NUL. Instead of adding + 1, as done elsewhe

Re: [PATCH] hyperv: add check for NULL for msg

2023-10-26 Thread Анастасия Любимова
28/09/23 19:18, Maciej S. Szmigiero пишет: On 28.09.2023 15:25, Anastasia Belova wrote: cpu_physical_memory_map may return NULL in hyperv_hcall_post_message. Add check for NULL to avoid NULL-dereference. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 76036a5fc7 ("hy

Re: [PATCH v3 28/28] docs: update Xen-on-KVM documentation

2023-10-26 Thread David Woodhouse
On Thu, 2023-10-26 at 10:26 +0200, Kevin Wolf wrote: > > > > > > +.. parsed-literal:: > > > > > + > > > > > +  |qemu_system| --accel kvm,xen-version=0x40011,kernel-irqchip=split > > > > > \\ > > > > > +   -chardev stdio,id=char0 -device xen-console,chardev=char0 \\ > > > > > +   -display

Re: [PATCH 6/6] qga: Cancel async snapshot before abort

2023-10-26 Thread Konstantin Kostiuk
On Wed, Oct 25, 2023 at 5:01 PM Alexander Ivanov < alexander.iva...@virtuozzo.com> wrote: > VSS requestor calls abort after the timeout of the backup operation > expires. In the result later the process hangs on some internal VSS > lock. Cancel async snapshot before abort. > Can you share some in

Re: [PATCH 5/6] qga: Add timeout for fsfreeze

2023-10-26 Thread Konstantin Kostiuk
I think it is better to check that timeout <= 10 sec in the case of Windows. Anyway this is a VSS limitation and FS will be unfrozen earlier if timeout > 10 sec, this can cause some misunderstanding from a user. timeout option sounds good in the guest-fsfreeze-freeze command. In guest-fsfreeze-fre

Re: [PATCH] hw/ide/ahci: trigger either error IRQ or regular IRQ, not both

2023-10-26 Thread Niklas Cassel
On Wed, Oct 11, 2023 at 03:12:20PM +0200, Niklas Cassel wrote: > From: Niklas Cassel > > According to AHCI 1.3.1, 5.3.8.1 RegFIS: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. > > T

[PATCH 3/4] macfb: allow larger write accesses to the DAFB_LUT register

2023-10-26 Thread Mark Cave-Ayland
The original tests with MacOS showed that only the bottom 8 bits of the DAFB_LUT register were used when writing to the LUT, however A/UX performs some of its writes using 4 byte accesses. Expand the address range for the DAFB_LUT register so that different size accesses write the correct value to

[PATCH 0/4] macfb: A/UX fixes for colour LUT

2023-10-26 Thread Mark Cave-Ayland
This fixes an issue discovered in A/UX whereby attempts to read the colour LUT from the macfb device returned zero (black) for all colours. The problem was that the DAFB_RESET register is actually used to set the current colour palette array index: fixing that and allowing larger access sizes allow

[PATCH 1/4] macfb: don't clear interrupts when writing to DAFB_RESET

2023-10-26 Thread Mark Cave-Ayland
Traces from A/UX suggest that this register is only used to reset the framebuffer LUT (colour lookup table) and not any other device state. Signed-off-by: Mark Cave-Ayland --- hw/display/macfb.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/hw/display/macfb.c b/hw/display/macfb.c index 2

[PATCH 2/4] macfb: rename DAFB_RESET to DAFB_LUT_INDEX

2023-10-26 Thread Mark Cave-Ayland
When A/UX uses the MacOS Device Manager Status (GetEntries) call to read the contents of the CLUT, it is easy to see that the requested index is written to the DAFB_RESET register. Update the palette_current index with the requested value, and rename it to DAFB_LUT_INDEX to reflect its true purpose

[PATCH 4/4] macfb: allow reads from the DAFB_LUT register

2023-10-26 Thread Mark Cave-Ayland
This enables A/UX to correctly retrieve the LUT entries when used with applications that use the MacOS Device Manager Status (GetEntries) call. Signed-off-by: Mark Cave-Ayland --- hw/display/macfb.c | 5 + 1 file changed, 5 insertions(+) diff --git a/hw/display/macfb.c b/hw/display/macfb.c

Re: [PATCH] target/i386/kvm: call kvm_put_vcpu_events() before kvm_put_nested_state()

2023-10-26 Thread Vitaly Kuznetsov
Cc'ing Max :-) At first glance the condition in vmx_set_nested_state() is correct so I guess we either have a stale KVM_STATE_NESTED_RUN_PENDING when in SMM or stale smm.flags when outside of it... Philippe Mathieu-Daudé writes: > Cc'ing Vitaly. > > On 26/10/23 07:49, Eiichi Tsukata wrote: >> Hi

Re: [PATCH 6/6] qga: Cancel async snapshot before abort

2023-10-26 Thread Konstantin Kostiuk
Reviewed-by: Konstantin Kostiuk On Wed, Oct 25, 2023 at 5:01 PM Alexander Ivanov < alexander.iva...@virtuozzo.com> wrote: > VSS requestor calls abort after the timeout of the backup operation > expires. In the result later the process hangs on some internal VSS > lock. Cancel async snapshot befo

Re: [PATCH v4 05/13] hw/riscv/virt-acpi-build.c: Add AIA support in RINTC

2023-10-26 Thread Andrew Jones
On Thu, Oct 26, 2023 at 01:37:05AM +0530, Sunil V L wrote: > Update the RINTC structure in MADT with AIA related fields. > > Signed-off-by: Sunil V L > Reviewed-by: Daniel Henrique Barboza > Acked-by: Alistair Francis > --- > hw/riscv/virt-acpi-build.c | 66 +++-

Re: [PATCH v2 0/3] vfio/pci: Fix buffer overrun when writing the VF token

2023-10-26 Thread Denis V. Lunev
On 10/26/23 09:06, Cédric Le Goater wrote: Hello, This series fixes a buffer overrun in VFIO. The buffer used in vfio_realize() by qemu_uuid_unparse() is too small, UUID_FMT_LEN lacks one byte for the trailing NUL. Instead of adding + 1, as done elsewhere, the changes introduce a UUID_STR_LEN d

Re: [PATCH v6 15/23] ui/gl: opengl doesn't require PIXMAN

2023-10-26 Thread Thomas Huth
On 26/10/2023 10.09, Marc-André Lureau wrote: Hi On Thu, Oct 26, 2023 at 10:44 AM Thomas Huth wrote: On 25/10/2023 21.08, marcandre.lur...@redhat.com wrote: From: Marc-André Lureau The QEMU fallback covers the requirements. We still need the flags of header inclusion with CONFIG_PIXMAN. S

Re: [PATCH v4 09/13] hw/riscv/virt-acpi-build.c: Add MMU node in RHCT

2023-10-26 Thread Andrew Jones
On Thu, Oct 26, 2023 at 01:37:09AM +0530, Sunil V L wrote: > MMU type information is available via MMU node in RHCT. Add this node in > RHCT. > > Signed-off-by: Sunil V L > Reviewed-by: Daniel Henrique Barboza > --- > hw/riscv/virt-acpi-build.c | 37 - > 1 fi

Re: [PATCH 2/6] qga: Move command execution code to a separate function

2023-10-26 Thread Konstantin Kostiuk
On Wed, Oct 25, 2023 at 5:01 PM Alexander Ivanov < alexander.iva...@virtuozzo.com> wrote: > In qmp_guest_set_user_password() we have a part of code that we can reuse > in the future commits. Move this code to a separate function. > > Signed-off-by: Alexander Ivanov > --- > qga/commands-posix.c |

Re: [PATCH v3 28/28] docs: update Xen-on-KVM documentation

2023-10-26 Thread Kevin Wolf
Am 25.10.2023 um 20:56 hat Andrew Cooper geschrieben: > On 25/10/2023 7:26 pm, David Woodhouse wrote: > > On Wed, 2023-10-25 at 13:20 -0500, Eric Blake wrote: > >> On Wed, Oct 25, 2023 at 03:50:42PM +0100, David Woodhouse wrote: > >>> + > >>> +Booting Xen PV guests > >>> +- > >>

Re: [PATCH 1/6] qga: Add process termination functionality

2023-10-26 Thread Konstantin Kostiuk
On Wed, Oct 25, 2023 at 5:01 PM Alexander Ivanov < alexander.iva...@virtuozzo.com> wrote: > We need to terminate processes executed with guest-exec command. Add > guest-exec-terminate command for process termination by PID. > > Signed-off-by: Alexander Ivanov > --- > qga/commands-common.h | 2 +

Re: [PATCH v3 qemu 0/3] Allow dump-guest-memory to output standard kdump format

2023-10-26 Thread Marc-André Lureau
Hi On Thu, Oct 26, 2023 at 2:44 AM Stephen Brennan wrote: > Hello, > > Will this be queued for version 8.2? I see here[1] that the feature > freeze is November 7. I'm not really familiar with QEMU development so I > didn't know if there was a "linux-next" equivalent I could check. > > [1]: https:

Re: [PATCH v4 01/13] hw/arm/virt-acpi-build.c: Migrate fw_cfg creation to common location

2023-10-26 Thread Andrew Jones
On Thu, Oct 26, 2023 at 01:37:01AM +0530, Sunil V L wrote: ... > diff --git a/hw/nvram/fw_cfg-acpi.c b/hw/nvram/fw_cfg-acpi.c > new file mode 100644 > index 00..eddaffc09b > --- /dev/null > +++ b/hw/nvram/fw_cfg-acpi.c > @@ -0,0 +1,44 @@ > +/* > + * Add fw_cfg device in DSDT > + * > + * Cop

<    1   2   3   >