Re: [PATCH v4 0/1] qga/linux: Add new api 'guest-network-get-route'

2024-06-12 Thread Konstantin Kostiuk
On Wed, Jun 12, 2024 at 7:36 AM Dehan Meng wrote: > v3 -> v4 > - Fix some indentation issues > - Update 'Since 8.2' to 'Since 9.1' > - Remove useless enum and adjust this change. > > v2 -> v3 > - Remove this declaration and make the function 'hexToIPAddress' as static. > - Define 'IFNAMSIZ' from

Re: [PATCH v4 1/1] qga/linux: Add new api 'guest-network-get-route'

2024-06-12 Thread Konstantin Kostiuk
On Wed, Jun 12, 2024 at 7:36 AM Dehan Meng wrote: > The Route information of the Linux VM needs to be used > by administrators and users when debugging network problems > and troubleshooting. > > Signed-off-by: Dehan Meng > --- > qga/commands-posix.c | 73 +++

Re: about QEMU TLS

2024-06-12 Thread Yu Zhang
Sorry for my confusion. I tested TLS migration by using RDMA, as RDMA traffic bypasses the CPU, the TLS setting is not validated. With TCP, the connection can't be established if "endpoint" setting is wrong. On Tue, Jun 11, 2024 at 5:57 PM Yu Zhang wrote: > > Hello Daniel and all, > > When I was

Re: [PATCH v3 00/13] riscv: QEMU RISC-V IOMMU Support

2024-06-12 Thread LIU Zhiwei
On 2024/6/11 18:13, Daniel Henrique Barboza wrote: Hi Zhiwei, On 6/10/24 10:51 PM, LIU Zhiwei wrote: Hi Daniel, I want to know if we can use the IOMMU and IOPMP at the same time. AFAIK we can. They're not mutually exclusive since they offer protection and isolation at different layers/stag

Re: [RFC PATCH v1 1/6] build-sys: Add rust feature option

2024-06-12 Thread Daniel P . Berrangé
On Tue, Jun 11, 2024 at 02:25:39PM -0400, Stefan Hajnoczi wrote: > On Tue, 11 Jun 2024 at 13:54, Manos Pitsidianakis > wrote: > > > > On Tue, 11 Jun 2024 at 17:05, Stefan Hajnoczi wrote: > > > > > > On Mon, Jun 10, 2024 at 09:22:36PM +0300, Manos Pitsidianakis wrote: > > > > Add options for Rust

[RFC PATCH 00/16] Implements RISC-V WorldGuard extension v0.4

2024-06-12 Thread Jim Shu
This patchset implements Smwg/Smwgd/Sswg CPU extension and wgChecker device defined in WorldGuard spec v0.4. The WG v0.4 spec could be found here: https://lists.riscv.org/g/security/attachment/711/0/worldguard_rvia_spec-v0.4.pdf To enable WG in QEMU, pass "wg=on" as machine parameter to virt mach

[RFC PATCH 02/16] accel/tcg: memory access from CPU will pass access_type to IOMMU

2024-06-12 Thread Jim Shu
It is the preparation patch for upcoming RISC-V wgChecker device. Since RISC-V wgChecker could permit access in RO/WO permission, the IOMMUMemoryRegion could return different section for read & write access. The memory access from CPU should also pass the access_type to IOMMU translate function so

[RFC PATCH 03/16] exec: Add RISC-V WorldGuard WID to MemTxAttrs

2024-06-12 Thread Jim Shu
RISC-V WorldGuard will add 5-bit world_id (WID) to the each memory transaction on the bus. The wgChecker in front of RAM or peripherals MMIO could do the access control based on the WID. It is similar to ARM TrustZone NS bit, but the WID is 5-bit. The common implementation of WID is AXI4 AxUSER si

[RFC PATCH 01/16] accel/tcg: Store section pointer in CPUTLBEntryFull

2024-06-12 Thread Jim Shu
'CPUTLBEntryFull.xlat_section' stores section_index in last 12 bits to find the correct section when CPU access the IO region over the IOTLB (iotlb_to_section()). However, section_index is only unique inside single AddressSpace. If address space translation is over IOMMUMemoryRegion, it could retu

[RFC PATCH 08/16] target/riscv: Allow global WG config to set WG CPU callbacks

2024-06-12 Thread Jim Shu
Some WG CPU functions depend on global WG config (like num-of-world), so we let the global WG config device to set callbacks of a RISC-V HART. Signed-off-by: Jim Shu --- target/riscv/cpu.h | 4 1 file changed, 4 insertions(+) diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h index 2d3bf

[RFC PATCH 12/16] hw/misc: riscv_wgchecker: Implement RISC-V WorldGuard Checker

2024-06-12 Thread Jim Shu
Implement the RISC-V WorldGuard Checker, which sits in front of RAM or device MMIO and allow software to configure it to either pass through or reject transactions. We implement the wgChecker as a QEMU IOMMU, which will direct transactions either through to the devices and memory behind it or to a

[RFC PATCH 15/16] hw/misc: riscv_wgchecker: Check the slot settings in translate

2024-06-12 Thread Jim Shu
The final part of wgChecker we need to implement is actually using the wgChecker slots programmed by guest to determine whether to block the transaction or not. Since this means we now change transaction mappings when the guest writes to wgChecker slots, we must also call the IOMMU notifiers at th

[RFC PATCH 09/16] target/riscv: Implement WorldGuard CSRs

2024-06-12 Thread Jim Shu
The WG v0.4 specification adds 3 CSRs to configure S/U/HS/VS-mode WIDs of CPUs in the higher privileged modes. The Smwg extension at least requires a RISC-V HART to have M/U-mode, and the Sswg/Smwgd extension at least requires a RISC-V HART to have M/S/U-mode. Signed-off-by: Jim Shu --- target/

[RFC PATCH 14/16] hw/misc: riscv_wgchecker: Implement correct block-access behavior

2024-06-12 Thread Jim Shu
The wgChecker is configurable for whether blocked accesses: * should cause a bus error or just read return zero and write ignore * should generate the interrupt or not Signed-off-by: Jim Shu --- hw/misc/riscv_wgchecker.c | 169 +- 1 file changed, 167 insertion

[RFC PATCH 07/16] target/riscv: Add defines for WorldGuard CSRs

2024-06-12 Thread Jim Shu
Add CSRs for 3 WG extensions: Smwg, Smwgd, and Sswg. Signed-off-by: Jim Shu --- target/riscv/cpu_bits.h | 5 + 1 file changed, 5 insertions(+) diff --git a/target/riscv/cpu_bits.h b/target/riscv/cpu_bits.h index 74318a925c..3ea8a8e9a0 100644 --- a/target/riscv/cpu_bits.h +++ b/target/riscv/

[RFC PATCH 16/16] hw/riscv: virt: Add WorldGuard support

2024-06-12 Thread Jim Shu
* Add 'wg=on' option to enable RISC-V WorldGuard * Add wgChecker to protect several resources: DRAM, FLASH, UART. Signed-off-by: Jim Shu --- docs/system/riscv/virt.rst | 10 +++ hw/riscv/Kconfig | 1 + hw/riscv/virt.c| 163 - include

[RFC PATCH 13/16] hw/misc: riscv_wgchecker: Implement wgchecker slot registers

2024-06-12 Thread Jim Shu
wgChecker slot is similar to PMP region. SW could program each slot to configure the permission of address range. Signed-off-by: Jim Shu --- hw/misc/riscv_wgchecker.c | 330 + hw/misc/riscv_worldguard.c | 3 + include/hw/misc/riscv_worldguard.h |

[RFC PATCH 10/16] target/riscv: Add WID to MemTxAttrs of CPU memory transactions

2024-06-12 Thread Jim Shu
When a RISC-V HART has WG extension, their memory transactions will contain WID. Support MemTxAttrs in RISC-V target and add WID inside if a HART has WG extension. Signed-off-by: Jim Shu --- target/riscv/cpu.c| 2 +- target/riscv/cpu.h| 1 + target/riscv/cpu_helper.c | 51 +

[RFC PATCH 11/16] hw/misc: riscv_worldguard: Add API to enable WG extension of CPU

2024-06-12 Thread Jim Shu
riscv_worldguard_apply_cpu() could enable WG CPU extension and set WG callback to CPUs. It is used by machine code after realizing global WG device. Signed-off-by: Jim Shu --- hw/misc/riscv_worldguard.c | 87 ++ include/hw/misc/riscv_worldguard.h | 1 + 2 fil

[RFC PATCH 05/16] target/riscv: Add CPU options of WorldGuard CPU extension

2024-06-12 Thread Jim Shu
We define CPU options for WG CSR support in RISC-V CPUs which can be set by machine/device emulation. The RISC-V CSR emulation will also check this feature for emulating WG CSRs. Signed-off-by: Jim Shu --- target/riscv/cpu.c | 8 target/riscv/cpu_cfg.h | 3 +++ target/risc

[RFC PATCH 04/16] hw/misc: riscv_worldguard: Add RISC-V WorldGuard global config

2024-06-12 Thread Jim Shu
Add a device for RISCV WG global config, which contains the number of worlds, reset value, and trusted WID ... etc. This global config is used by both CPU WG extension and wgChecker devices. Signed-off-by: Jim Shu --- hw/misc/Kconfig| 3 + hw/misc/meson.build

[RFC PATCH 06/16] target/riscv: Add hard-coded CPU state of WG extension

2024-06-12 Thread Jim Shu
Add hard-coded state of WG extension. 'mwid' is the M-mode WID of CPU. 'mwidlist' is the list of allowed WID value of 'mlwid' CSR. These CPU states can be set by CPU option, or can be set by machine code via newly added APIs. If we want different WG configs of CPUs, we should set it by machine cod

Re: [RFC PATCH v1 1/6] build-sys: Add rust feature option

2024-06-12 Thread Marc-André Lureau
Hi On Wed, Jun 12, 2024 at 12:05 PM Daniel P. Berrangé wrote: > On Tue, Jun 11, 2024 at 02:25:39PM -0400, Stefan Hajnoczi wrote: > > On Tue, 11 Jun 2024 at 13:54, Manos Pitsidianakis > > wrote: > > > > > > On Tue, 11 Jun 2024 at 17:05, Stefan Hajnoczi > wrote: > > > > > > > > On Mon, Jun 10, 2

Re: [PATCH v5 25/65] i386/tdx: Add property sept-ve-disable for tdx-guest object

2024-06-12 Thread Xiaoyao Li
On 6/6/2024 6:45 PM, Daniel P. Berrangé wrote: Copying Zhenzhong Duan as my point relates to the proposed libvirt TDX patches. On Thu, Feb 29, 2024 at 01:36:46AM -0500, Xiaoyao Li wrote: Bit 28 of TD attribute, named SEPT_VE_DISABLE. When set to 1, it disables EPT violation conversion to #VE o

Re: [PATCH v3 4/4] qdev: add device policy [RfC]

2024-06-12 Thread Markus Armbruster
Gerd Hoffmann writes: > Add policies for devices which are deprecated or not secure. > There are three options: allow, warn and deny. > > It's implemented for devices only. Devices will probably be the main > user of this. Also object_new() can't fail as of today so it's a bit > hard to impleme

Re: [RFC PATCH v2 0/5] Implement ARM PL011 in Rust

2024-06-12 Thread Daniel P . Berrangé
On Tue, Jun 11, 2024 at 01:33:29PM +0300, Manos Pitsidianakis wrote: > > .gitignore | 2 + > .gitlab-ci.d/buildtest.yml | 64 ++-- > MAINTAINERS| 13 + > configure | 12 + > hw/arm/virt.c | 4 + > meson.buil

Re: [PATCH v1] virtio-iommu: add error check before assert

2024-06-12 Thread Alex Bennée
Manos Pitsidianakis writes: > On Tue, 11 Jun 2024 at 18:01, Philippe Mathieu-Daudé > wrote: >> >> On 11/6/24 14:23, Manos Pitsidianakis wrote: >> > A fuzzer case discovered by Zheyu Ma causes an assert failure. >> > >> > Add a check before the assert, and respond with an error before moving >>

Re: [PATCH 1/8] tests/unit/test-smp-parse: Fix comments of drawers and books case

2024-06-12 Thread Thomas Huth
On 29/05/2024 08.19, Zhao Liu wrote: Fix the comments to match the actual configurations. Signed-off-by: Zhao Liu --- tests/unit/test-smp-parse.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) Reviewed-by: Thomas Huth

Re: [PATCH 2/8] tests/unit/test-smp-parse: Fix comment of parameters=1 case

2024-06-12 Thread Thomas Huth
On 29/05/2024 08.19, Zhao Liu wrote: SMP_CONFIG_WITH_FULL_TOPO hasn't support module level, so the parameter should indicate the "clusters". Additionally, reorder the parameters of -smp to match the topology hierarchy order. Signed-off-by: Zhao Liu --- tests/unit/test-smp-parse.c | 4 +++-

[RFC PATCH] memory: Introduce memory region fetch operation

2024-06-12 Thread Ethan Chen via
Allow the memory region to have different behaviors for read and fetch operations. For example RISCV IOPMP will raise interrupt when cpu try to fetch a non-excutable region. If fetch operation of a memory region is not implemented, it still uses the read operation for fetch. Signed-off-by: Ethan

Re: [PATCH 3/8] tests/unit/test-smp-parse: Fix an invalid topology case

2024-06-12 Thread Thomas Huth
On 29/05/2024 08.19, Zhao Liu wrote: Adjust the "cpus" parameter to match the comment configuration. Signed-off-by: Zhao Liu --- tests/unit/test-smp-parse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Thomas Huth

Updated invitation: QEMU/KVM developers conference call @ Every 2 weeks from 13:00 to 14:00 on Tuesday from Tue 19 Mar to Tue 11 Jun (GMT) (qemu-devel@nongnu.org)

2024-06-12 Thread Alex Bennée
BEGIN:VCALENDAR PRODID:-//Google Inc//Google Calendar 70.9054//EN VERSION:2.0 CALSCALE:GREGORIAN METHOD:REQUEST BEGIN:VTIMEZONE TZID:America/New_York X-LIC-LOCATION:America/New_York BEGIN:DAYLIGHT TZOFFSETFROM:-0500 TZOFFSETTO:-0400 TZNAME:EDT DTSTART:19700308T02 RRULE:FREQ=YEARLY;BYMONTH=3;BYD

Updated invitation: QEMU/KVM developers conference call @ Every 2 weeks from 14:00 to 15:00 on Tuesday (BST) (qemu-devel@nongnu.org)

2024-06-12 Thread Alex Bennée
BEGIN:VCALENDAR PRODID:-//Google Inc//Google Calendar 70.9054//EN VERSION:2.0 CALSCALE:GREGORIAN METHOD:REQUEST BEGIN:VTIMEZONE TZID:America/New_York X-LIC-LOCATION:America/New_York BEGIN:DAYLIGHT TZOFFSETFROM:-0500 TZOFFSETTO:-0400 TZNAME:EDT DTSTART:19700308T02 RRULE:FREQ=YEARLY;BYMONTH=3;BYD

Re: [RFC PATCH] migration/savevm: do not schedule snapshot_save_job_bh in qemu_aio_context

2024-06-12 Thread Fiona Ebner
Am 11.06.24 um 16:04 schrieb Stefan Hajnoczi: > On Tue, Jun 11, 2024 at 02:08:49PM +0200, Fiona Ebner wrote: >> Am 06.06.24 um 20:36 schrieb Stefan Hajnoczi: >>> On Wed, Jun 05, 2024 at 02:08:48PM +0200, Fiona Ebner wrote: The fact that the snapshot_save_job_bh() is scheduled in the main

Re: [PATCH] scripts/qcow2-to-stdout.py: Add script to write qcow2 images to stdout

2024-06-12 Thread Alberto Garcia
On Wed 12 Jun 2024 09:01:01 AM +03, Manos Pitsidianakis wrote: > Hello Alberto, Hello Manos! > > This is equivalent to using qemu-img to convert a file to qcow2 and > > then writing the result to stdout, with the difference that this > > tool does not need to create this temporary qcow2 file and

Re: [PATCH v5 17/65] i386/tdx: Adjust the supported CPUID based on TDX restrictions

2024-06-12 Thread Xiaoyao Li
On 5/31/2024 4:47 PM, Duan, Zhenzhong wrote: On 2/29/2024 2:36 PM, Xiaoyao Li wrote: According to Chapter "CPUID Virtualization" in TDX module spec, CPUID bits of TD can be classified into 6 types: 1 | As configured | con

Re: [PATCH v5 18/65] i386/tdx: Make Intel-PT unsupported for TD guest

2024-06-12 Thread Xiaoyao Li
On 5/31/2024 5:27 PM, Duan, Zhenzhong wrote: On 2/29/2024 2:36 PM, Xiaoyao Li wrote: Due to the fact that Intel-PT virtualization support has been broken in QEMU since Sapphire Rapids generation[1], below warning is triggered when luanching TD guest:    warning: host doesn't support requested

Re: [PATCH 4/8] tests/unit/test-smp-parse: Use default parameters=0 when not set in -smp

2024-06-12 Thread Thomas Huth
On 29/05/2024 08.19, Zhao Liu wrote: Since -smp allows parameters=1 whether the level is supported by machine, to avoid the test scenarios where the parameter defaults to 1 cause some errors to be masked, explicitly set undesired parameters to 0. Signed-off-by: Zhao Liu --- tests/unit/test-sm

Re: [PATCH v1] virtio-iommu: add error check before assert

2024-06-12 Thread Alex Bennée
Manos Pitsidianakis writes: > A fuzzer case discovered by Zheyu Ma causes an assert failure. > > Add a check before the assert, and respond with an error before moving > on to the next queue element. > > To reproduce the failure: > > cat << EOF | \ > qemu-system-x86_64 \ > -display none -machine

Re: [PATCH v3 03/13] hw/riscv: add RISC-V IOMMU base emulation

2024-06-12 Thread Daniel Henrique Barboza
Hi Jason, (CCing designware folks and Cedric) On 6/11/24 1:15 PM, Jason Chien wrote: Hi Daniel, On 2024/5/24 上午 01:39, Daniel Henrique Barboza wrote: From: Tomasz Jeznach The RISC-V IOMMU specification is now ratified as-per the RISC-V international process. The latest frozen specifcation c

Re: [PATCH v3] hw/arm/virt: Avoid unexpected warning from Linux guest on host with Fujitsu CPUs

2024-06-12 Thread Jonathan Cameron via
On Tue, 11 Jun 2024 22:05:06 -0400 Zhenyu Zhang wrote: > Multiple warning messages and corresponding backtraces are observed when Linux > guest is booted on the host with Fujitsu CPUs. One of them is shown as below. > > [0.032443] [ cut here ] > [0.032446] uart-pl

Re: [PATCH 5/8] tests/unit/test-smp-parse: Make test cases aware of module level

2024-06-12 Thread Thomas Huth
On 29/05/2024 08.19, Zhao Liu wrote: Currently, -smp supports module level. It is necessary to consider the effects of module in the test cases to ensure that the calculations are correct. This is also the preparation to add module test cases. Signed-off-by: Zhao Liu --- tests/unit/test-smp-

[RFC PATCH] system/physmem: Support IOMMU granularity smaller than TARGET_PAGE size

2024-06-12 Thread Ethan Chen via
If the IOMMU granularity is smaller than TARGET_PAGE size, there may have multiple entries in the same page. Pass the origin address to IOMMU to get correct result Similar to the RISCV PMP solution, TLB_INVALID_MASK will be set when there have multiple entries in the same page to check the IOMMU o

[PATCH v5 1/1] qga/linux: Add new api 'guest-network-get-route'

2024-06-12 Thread Dehan Meng
The Route information of the Linux VM needs to be used by administrators and users when debugging network problems and troubleshooting. Signed-off-by: Dehan Meng --- qga/commands-posix.c | 81 qga/commands-win32.c | 6 qga/qapi-schema.json | 56

[PATCH v5 0/1] qga/linux: Add new api 'guest-network-get-route'

2024-06-12 Thread Dehan Meng
v4 -> v5 - Remove useless struct - Rename 'GuestNetworkRouteStat' to 'GuestNetworkRoute'. v3 -> v4 - Fix some indentation issues - Update 'Since 8.2' to 'Since 9.1' - Remove useless enum and adjust this change. v2 -> v3 - Remove this declaration and make the function 'hexToIPAddress' as static. -

[PATCH 2/5] Revert "host/i386: assume presence of SSSE3"

2024-06-12 Thread Alexander Monakov
This reverts commit 433cd6d94a8256af70a5200f236dc8047c3c1468. Revert in preparation to rolling back x86_64-v2 ISA requirement. Signed-off-by: Alexander Monakov --- util/cpuinfo-i386.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/cpuinfo-i386.c b/util/cpuinfo-i386

[PATCH 5/5] Revert "meson: assume x86-64-v2 baseline ISA"

2024-06-12 Thread Alexander Monakov
This reverts commit 294ac64e459aca023f43441651d860980c9784f1. Reinstate the ability to use Qemu on x86 hosts that do not meet x86_64-v2 ISA baseline. Signed-off-by: Alexander Monakov --- meson.build | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/meson.build b/mes

[PATCH 3/5] Revert "host/i386: assume presence of SSE2"

2024-06-12 Thread Alexander Monakov
This reverts commit b18236897ca15c3db1506d8edb9a191dfe51429c. Revert in preparation to rolling back x86_64-v2 ISA requirement. Signed-off-by: Alexander Monakov --- host/include/i386/host/cpuinfo.h | 1 + util/bufferiszero.c | 4 ++-- util/cpuinfo-i386.c | 1 + 3 files

[PATCH 0/5] Reinstate ability to use Qemu on pre-SSE4.1 x86 hosts

2024-06-12 Thread Alexander Monakov
Hello, I'm sending straightforward reverts to recent patches that bumped minimum required x86 instruction set to SSE4.2. The older chips did not stop working, and people still test and use new software on older hardware: https://sourceware.org/bugzilla/show_bug.cgi?id=31867 Considering the very m

[PATCH 1/5] Revert "host/i386: assume presence of POPCNT"

2024-06-12 Thread Alexander Monakov
This reverts commit 45ccdbcb24baf99667997fac5cf60318e5e7db51. Revert in preparation to rolling back x86_64-v2 ISA requirement. Signed-off-by: Alexander Monakov --- host/include/i386/host/cpuinfo.h | 1 + tcg/i386/tcg-target.h| 5 +++-- util/cpuinfo-i386.c | 1 + 3 files

[PATCH 4/5] Revert "host/i386: assume presence of CMOV"

2024-06-12 Thread Alexander Monakov
This reverts commit e68e97ce55b3d17af22dd62c3b3dc72f761b0862. Revert in preparation to rolling back x86_64-v2 ISA requirement. Signed-off-by: Alexander Monakov --- host/include/i386/host/cpuinfo.h | 1 + tcg/i386/tcg-target.c.inc| 15 ++- util/cpuinfo-i386.c |

Re: [PATCH 0/5] Reinstate ability to use Qemu on pre-SSE4.1 x86 hosts

2024-06-12 Thread Daniel P . Berrangé
On Wed, Jun 12, 2024 at 01:55:20PM +0300, Alexander Monakov wrote: > Hello, > > I'm sending straightforward reverts to recent patches that bumped minimum > required x86 instruction set to SSE4.2. The older chips did not stop working, > and people still test and use new software on older hardware:

Re: [PATCH v3 1/4] qom: allow to mark objects as deprecated or not secure.

2024-06-12 Thread Markus Armbruster
Gerd Hoffmann writes: > Add flags to ObjectClass for objects which are deprecated or not secure. > Add 'deprecated' and 'not-secure' bools to ObjectTypeInfo, report in > 'qom-list-types'. Print the flags when listing devices via '-device > help'. > > Signed-off-by: Gerd Hoffmann > --- > includ

Re: [PATCH 0/5] Reinstate ability to use Qemu on pre-SSE4.1 x86 hosts

2024-06-12 Thread Paolo Bonzini
On Wed, Jun 12, 2024 at 1:04 PM Daniel P. Berrangé wrote: > > On Wed, Jun 12, 2024 at 01:55:20PM +0300, Alexander Monakov wrote: > > Hello, > > > > I'm sending straightforward reverts to recent patches that bumped minimum > > required x86 instruction set to SSE4.2. The older chips did not stop >

Re: [PATCH 0/5] Reinstate ability to use Qemu on pre-SSE4.1 x86 hosts

2024-06-12 Thread Alexander Monakov
On Wed, 12 Jun 2024, Daniel P. Berrangé wrote: > On Wed, Jun 12, 2024 at 01:55:20PM +0300, Alexander Monakov wrote: > > Hello, > > > > I'm sending straightforward reverts to recent patches that bumped minimum > > required x86 instruction set to SSE4.2. The older chips did not stop > > working,

Re: [PATCH 0/5] Reinstate ability to use Qemu on pre-SSE4.1 x86 hosts

2024-06-12 Thread Alexander Monakov
On Wed, 12 Jun 2024, Paolo Bonzini wrote: > I didn't do this because of RHEL9, I did it because it's silly that > QEMU cannot use POPCNT and has to waste 2% of the L1 d-cache to > compute the x86 parity flag (and POPCNT was introduced at the same > time as SSE4.2). >From looking at that POPCNT

Re: [PATCH] scripts/qcow2-to-stdout.py: Add script to write qcow2 images to stdout

2024-06-12 Thread Manos Pitsidianakis
On Mon, 10 Jun 2024 17:47, Alberto Garcia wrote: This tool converts a disk image to qcow2, writing the result directly to stdout. This can be used for example to send the generated file over the network. This is equivalent to using qemu-img to convert a file to qcow2 and then writing the result

Re: [PATCH v3 1/4] qom: allow to mark objects as deprecated or not secure.

2024-06-12 Thread Daniel P . Berrangé
On Wed, Jun 12, 2024 at 01:07:44PM +0200, Markus Armbruster wrote: > Gerd Hoffmann writes: > > > Add flags to ObjectClass for objects which are deprecated or not secure. > > Add 'deprecated' and 'not-secure' bools to ObjectTypeInfo, report in > > 'qom-list-types'. Print the flags when listing de

Re: [PATCH] scripts/qcow2-to-stdout.py: Add script to write qcow2 images to stdout

2024-06-12 Thread Manos Pitsidianakis
On Wed, 12 Jun 2024 12:21, Alberto Garcia wrote: On Wed 12 Jun 2024 09:01:01 AM +03, Manos Pitsidianakis wrote: Hello Alberto, Hello Manos! > This is equivalent to using qemu-img to convert a file to qcow2 and > then writing the result to stdout, with the difference that this > tool does no

Re: [PATCH 0/5] Reinstate ability to use Qemu on pre-SSE4.1 x86 hosts

2024-06-12 Thread Paolo Bonzini
On Wed, Jun 12, 2024 at 1:19 PM Alexander Monakov wrote: > On Wed, 12 Jun 2024, Paolo Bonzini wrote: > > I didn't do this because of RHEL9, I did it because it's silly that > > QEMU cannot use POPCNT and has to waste 2% of the L1 d-cache to > > compute the x86 parity flag (and POPCNT was introduce

Re: [PATCH 0/5] Reinstate ability to use Qemu on pre-SSE4.1 x86 hosts

2024-06-12 Thread Daniel P . Berrangé
On Wed, Jun 12, 2024 at 01:12:43PM +0200, Paolo Bonzini wrote: > On Wed, Jun 12, 2024 at 1:04 PM Daniel P. Berrangé > wrote: > > > > On Wed, Jun 12, 2024 at 01:55:20PM +0300, Alexander Monakov wrote: > > > Hello, > > > > > > I'm sending straightforward reverts to recent patches that bumped minimu

Re: [PATCH v3 0/4] allow to deprecate objects and devices

2024-06-12 Thread Markus Armbruster
Gerd Hoffmann writes: > Put some infrastructure in place to allow tagging objects (including > devices) as deprected. Use it to mark the ohci pci host adapter and > the usb hub as deprecated. I can see usb-hub [PATCH 2], but not "ohci pci host adapter". Peeking at the change log below... dropp

Re: [PATCH v3 1/4] qom: allow to mark objects as deprecated or not secure.

2024-06-12 Thread Markus Armbruster
Daniel P. Berrangé writes: > On Wed, Jun 12, 2024 at 01:07:44PM +0200, Markus Armbruster wrote: >> Gerd Hoffmann writes: >> >> > Add flags to ObjectClass for objects which are deprecated or not secure. >> > Add 'deprecated' and 'not-secure' bools to ObjectTypeInfo, report in >> > 'qom-list-type

Re: [PATCH 0/5] Reinstate ability to use Qemu on pre-SSE4.1 x86 hosts

2024-06-12 Thread Alexander Monakov
On Wed, 12 Jun 2024, Paolo Bonzini wrote: > On Wed, Jun 12, 2024 at 1:19 PM Alexander Monakov wrote: > > On Wed, 12 Jun 2024, Paolo Bonzini wrote: > > > I didn't do this because of RHEL9, I did it because it's silly that > > > QEMU cannot use POPCNT and has to waste 2% of the L1 d-cache to > > >

Re: [PATCH 0/5] Reinstate ability to use Qemu on pre-SSE4.1 x86 hosts

2024-06-12 Thread Paolo Bonzini
On Wed, Jun 12, 2024 at 1:38 PM Daniel P. Berrangé wrote: > This isn't anything to do with the distro installer. The use case is that > the distro wants all its software to be able to run on the x86_64 baseline > it has chosen to build with. Sure, and they can patch the packages if their wish is

Re: [PATCH 0/5] Reinstate ability to use Qemu on pre-SSE4.1 x86 hosts

2024-06-12 Thread Paolo Bonzini
On Wed, Jun 12, 2024 at 1:46 PM Alexander Monakov wrote: > > > On Wed, 12 Jun 2024, Paolo Bonzini wrote: > > > On Wed, Jun 12, 2024 at 1:19 PM Alexander Monakov > > wrote: > > > On Wed, 12 Jun 2024, Paolo Bonzini wrote: > > > > I didn't do this because of RHEL9, I did it because it's silly that

Re: [PATCH v3 00/13] riscv: QEMU RISC-V IOMMU Support

2024-06-12 Thread Daniel Henrique Barboza
On 6/12/24 4:50 AM, LIU Zhiwei wrote: On 2024/6/11 18:13, Daniel Henrique Barboza wrote: Hi Zhiwei, On 6/10/24 10:51 PM, LIU Zhiwei wrote: Hi Daniel, I want to know if we can use the IOMMU and IOPMP at the same time. AFAIK we can. They're not mutually exclusive since they offer protecti

Re: [PATCH v3 0/4] hw/mips/loongson3_virt: Implement IPI support

2024-06-12 Thread Jiaxun Yang
在2024年6月5日六月 上午3:15,Jiaxun Yang写道: > Hi all, > > This series enabled IPI support for loongson3 virt board, loosely > based on my previous work[1]. > It generalized loongarch_ipi device to share among both loongarch > and MIPS machines. > > Thanks A genttle ping :-) Thanks - Jiaxun > > [1]: > h

Re: [PATCH 0/5] Reinstate ability to use Qemu on pre-SSE4.1 x86 hosts

2024-06-12 Thread Alexander Monakov
On Wed, 12 Jun 2024, Paolo Bonzini wrote: > Ahah, nice. :) I'm pretty sure that, when I tested "pf = > (__builtin_popcount(x) & 1) * 4;", it was generating a call to > __builtin_popcountsi2. Why write '__builtin_popcount(x) & 1' when you can write '__builtin_parity(x)' in the first place? > S

Re: [PATCH 0/5] Reinstate ability to use Qemu on pre-SSE4.1 x86 hosts

2024-06-12 Thread Paolo Bonzini
On Wed, Jun 12, 2024 at 2:11 PM Alexander Monakov wrote: > > > On Wed, 12 Jun 2024, Paolo Bonzini wrote: > > > Ahah, nice. :) I'm pretty sure that, when I tested "pf = > > (__builtin_popcount(x) & 1) * 4;", it was generating a call to > > __builtin_popcountsi2. > > Why write '__builtin_popcount(x)

Re: [PATCH 0/5] Reinstate ability to use Qemu on pre-SSE4.1 x86 hosts

2024-06-12 Thread Daniel P . Berrangé
On Wed, Jun 12, 2024 at 01:51:31PM +0200, Paolo Bonzini wrote: > On Wed, Jun 12, 2024 at 1:38 PM Daniel P. Berrangé > wrote: > > This isn't anything to do with the distro installer. The use case is that > > the distro wants all its software to be able to run on the x86_64 baseline > > it has chos

Re: [RFC PATCH v2 21/22] qapi: Inline and remove QERR_UNSUPPORTED definition

2024-06-12 Thread Philippe Mathieu-Daudé
Michael, Konstantin, QERR_UNSUPPORTED is only used by QGA. Do you mind giving our maintainer's position on Markus analysis so we can know how to proceed with this definition? Regards, Phil. On 5/10/23 13:22, Markus Armbruster wrote: Philippe Mathieu-Daudé writes: Address the comment added

Re: QEMU plugin past, present and future examples

2024-06-12 Thread Philippe Mathieu-Daudé
Hi Robert, On 11/6/24 18:53, Robert Henry wrote: QEMU plugin experts: A few years I wrote a plugin for QEMU that saves the instruction stream to a file for offline analysis.  QEMU could fly along at about 10MIPS and the disk would soon fill up with large protobuf files.  The offline analysis

Re: [RFC PATCH v2 3/5] rust: add PL011 device model

2024-06-12 Thread Paolo Bonzini
I think this is extremely useful to show where we could go in the task of creating more idiomatic bindings. On Tue, Jun 11, 2024 at 12:34 PM Manos Pitsidianakis wrote: > +fn main() { > +println!("cargo::rerun-if-env-changed=MESON_BUILD_DIR"); > +println!("cargo::rerun-if-env-changed=MESON

Re: [PATCH v3] hw/arm/virt: Avoid unexpected warning from Linux guest on host with Fujitsu CPUs

2024-06-12 Thread Philippe Mathieu-Daudé
Hi Zhenyu, On 12/6/24 04:05, Zhenyu Zhang wrote: Multiple warning messages and corresponding backtraces are observed when Linux guest is booted on the host with Fujitsu CPUs. One of them is shown as below. [0.032443] [ cut here ] [0.032446] uart-pl011 900.pl0

Re: [PATCH] accel/tcg: Fix typo causing tb->page_addr[1] to not be recorded

2024-06-12 Thread Philippe Mathieu-Daudé
On 11/6/24 23:58, Anton Johansson via wrote: For TBs crossing page boundaries, the 2nd page will never be recorded/removed, as the index of the 2nd page is computed from the address of the 1st page. This is due to a typo, fix it. Cc: qemu-sta...@nongnu.org Fixes: deba78709a ("accel/tcg: Always

Re: assert fails in s390x TCG

2024-06-12 Thread Philippe Mathieu-Daudé
On 28/7/23 18:43, Richard Henderson wrote: On 7/28/23 09:05, Richard Henderson wrote: It's the page containing both code and a page table entry that concerns me.  It seems like a kernel bug, though obviously we shouldn't crash.  I'm not sure what to do about it. Bah.  Of course it's not a ker

Re: [RFC PATCH] memory: Introduce memory region fetch operation

2024-06-12 Thread Peter Maydell
On Wed, 12 Jun 2024 at 10:02, Ethan Chen via wrote: > > Allow the memory region to have different behaviors for read and fetch > operations. > > For example RISCV IOPMP will raise interrupt when cpu try to fetch a > non-excutable region. It actually raises an interrupt rather than it being a perm

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

2024-06-12 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 v5 0/5] vvfat: Fix write bugs for large files and add iotests

2024-06-12 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 v5 2/5] vvfat: Fix usage of `info.file.offset`

2024-06-12 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 --- block/vvfat.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/blo

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

2024-06-12 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 v5 5/5] iotests: Add `vvfat` tests

2024-06-12 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 v5 4/5] vvfat: Fix reading files with non-continuous clusters

2024-06-12 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

Re: [PATCH v5 1/1] qga/linux: Add new api 'guest-network-get-route'

2024-06-12 Thread Philippe Mathieu-Daudé
Hi Dehan, On 12/6/24 12:31, Dehan Meng wrote: The Route information of the Linux VM needs to be used by administrators and users when debugging network problems and troubleshooting. Signed-off-by: Dehan Meng --- qga/commands-posix.c | 81 qga/com

Re: [PATCH v3] hw/arm/virt: Avoid unexpected warning from Linux guest on host with Fujitsu CPUs

2024-06-12 Thread Peter Maydell
On Wed, 12 Jun 2024 at 13:33, Philippe Mathieu-Daudé wrote: > > Hi Zhenyu, > > On 12/6/24 04:05, Zhenyu Zhang wrote: > > diff --git a/hw/arm/virt.c b/hw/arm/virt.c > > index 3c93c0c0a6..3cefac6d43 100644 > > --- a/hw/arm/virt.c > > +++ b/hw/arm/virt.c > > @@ -271,6 +271,17 @@ static void create_fd

Re: [PATCH v3] hw/arm/virt: Avoid unexpected warning from Linux guest on host with Fujitsu CPUs

2024-06-12 Thread Philippe Mathieu-Daudé
On 12/6/24 14:48, Peter Maydell wrote: On Wed, 12 Jun 2024 at 13:33, Philippe Mathieu-Daudé wrote: Hi Zhenyu, On 12/6/24 04:05, Zhenyu Zhang wrote: diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 3c93c0c0a6..3cefac6d43 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -271,6 +271,17 @@ stat

Re: [PATCH v5 1/1] qga/linux: Add new api 'guest-network-get-route'

2024-06-12 Thread Daniel P . Berrangé
On Wed, Jun 12, 2024 at 02:48:24PM +0200, Philippe Mathieu-Daudé wrote: > Hi Dehan, > > On 12/6/24 12:31, Dehan Meng wrote: > > The Route information of the Linux VM needs to be used > > by administrators and users when debugging network problems > > and troubleshooting. > > > > Signed-off-by: De

[PATCH v7 00/13] vhost-user: support any POSIX system (tested on macOS, FreeBSD, OpenBSD)

2024-06-12 Thread Stefano Garzarella
This series should be in a good shape, in which tree should we queue it? @Micheal would your tree be okay? Thanks, Stefano Changelog v1: https://patchew.org/QEMU/20240228114759.44758-1-sgarz...@redhat.com/ v2: https://patchew.org/QEMU/20240326133936.125332-1-sgarz...@redhat.com/ v3: https://patc

[PATCH v1 02/16] vfio: Remove unused declarations from vfio-common.h

2024-06-12 Thread Cédric Le Goater
These were forgotten in the recent cleanups. Signed-off-by: Cédric Le Goater --- include/hw/vfio/vfio-common.h | 4 1 file changed, 4 deletions(-) diff --git a/include/hw/vfio/vfio-common.h b/include/hw/vfio/vfio-common.h index 776de8064f740784f95cab0311c5f15f50d60ffe..c19572f90b277193491

[PATCH v1 04/16] vfio/common: Extract vIOMMU code from vfio_sync_dirty_bitmap()

2024-06-12 Thread Cédric Le Goater
From: Avihai Horon Extract vIOMMU code from vfio_sync_dirty_bitmap() to a new function and restructure the code. This is done in preparation for optimizing vIOMMU deviice dirty page tracking. No functional changes intended. Signed-off-by: Avihai Horon Signed-off-by: Joao Martins [ clg: - Reba

[PATCH v1 12/16] vfio/container: Switch to QOM

2024-06-12 Thread Cédric Le Goater
Instead of allocating the container struct, create a QOM object of the appropriate type. Signed-off-by: Cédric Le Goater --- hw/vfio/container.c | 6 +++--- hw/vfio/iommufd.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/vfio/container.c b/hw/vfio/container.c inde

[PATCH v1 08/16] vfio/container: Introduce vfio_get_iommu_class_name()

2024-06-12 Thread Cédric Le Goater
Rework vfio_get_iommu_class() to return a literal class name instead of a class object. We will need this name to instantiate the object later on. Since the default case asserts, remove the error report as QEMU will simply abort before. Signed-off-by: Cédric Le Goater --- hw/vfio/container.c | 1

[PATCH RESEND v7 04/12] vhost-user-server: do not set memory fd non-blocking

2024-06-12 Thread Stefano Garzarella
In vhost-user-server we set all fd received from the other peer in non-blocking mode. For some of them (e.g. memfd, shm_open, etc.) it's not really needed, because we don't use these fd with blocking operations, but only to map memory. In addition, in some systems this operation can fail (e.g. in

[PATCH v1 11/16] vfio/container: Change VFIOContainerBase to use QOM

2024-06-12 Thread Cédric Le Goater
VFIOContainerBase was made a QOM interface because we believed that a QOM object would expose all the IOMMU backends to the QEMU machine and human interface. This only applies to user creatable devices or objects. Change the VFIOContainerBase nature from interface to object and make the necessary

[PATCH RESEND v7 06/12] contrib/vhost-user-*: use QEMU bswap helper functions

2024-06-12 Thread Stefano Garzarella
Let's replace the calls to le*toh() and htole*() with qemu/bswap.h helpers to make the code more portable. Suggested-by: Philippe Mathieu-Daudé Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Acked-by: Stefan Hajnoczi Reviewed-by: David Hildenbrand Signed-off-by: Stefano

[PATCH v1 01/16] vfio: Make vfio_devices_dma_logging_start() return bool

2024-06-12 Thread Cédric Le Goater
Since vfio_devices_dma_logging_start() takes an 'Error **' argument, best practices suggest to return a bool. See the api/error.h Rules section. It will simplify potential changes coming after. vfio_container_set_dirty_page_tracking() could be modified in the same way but the errno value can be sa

[PATCH RESEND v7 08/12] libvhost-user: enable it on any POSIX system

2024-06-12 Thread Stefano Garzarella
The vhost-user protocol is not really Linux-specific so let's enable libvhost-user for any POSIX system. Compiling it on macOS and FreeBSD some problems came up: - avoid to include linux/vhost.h which is available only on Linux (vhost_types.h contains many of the things we need) - macOS doesn't

[PATCH v1 03/16] vfio/common: Move dirty tracking ranges update to helper

2024-06-12 Thread Cédric Le Goater
From: Joao Martins Separate the changes that updates the ranges from the listener, to make it reusable in preparation to expand its use to vIOMMU support. Signed-off-by: Joao Martins [ clg: - Rebased on upstream - Introduced vfio_dirty_tracking_update_range() ] Signed-off-by: Cédric Le G

[PATCH v1 05/16] vfio/container: Introduce vfio_address_space_insert()

2024-06-12 Thread Cédric Le Goater
It will ease future changes. Signed-off-by: Cédric Le Goater --- include/hw/vfio/vfio-common.h | 2 ++ hw/vfio/common.c | 6 ++ hw/vfio/container.c | 2 +- hw/vfio/iommufd.c | 2 +- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/include/hw/

  1   2   3   >