From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id E23701FF15C for ; Fri, 5 Sep 2025 13:45:58 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 96B81135EF; Fri, 5 Sep 2025 13:46:15 +0200 (CEST) Mime-Version: 1.0 Date: Fri, 05 Sep 2025 13:45:41 +0200 Message-Id: From: "Daniel Kral" To: "Fiona Ebner" , "Proxmox VE development discussion" X-Mailer: aerc 0.20.0 References: <20250902112307.124706-1-d.kral@proxmox.com> <20250902112307.124706-3-d.kral@proxmox.com> <1d1b02b3-6932-4550-ae3d-76f24d04cb94@proxmox.com> In-Reply-To: <1d1b02b3-6932-4550-ae3d-76f24d04cb94@proxmox.com> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1757072723651 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.014 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pve-devel] [PATCH qemu-server v2 1/4] fix #6608: expose viommu driver aw-bits option X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" On Fri Sep 5, 2025 at 12:07 PM CEST, Fiona Ebner wrote: > Am 02.09.25 um 1:23 PM schrieb Daniel Kral: >> Since QEMU 9.2 [0], the default I/O address space bit width was raised >> from 39 bits to 48 bits for the Intel vIOMMU driver, which makes the >> aw-bits check introduced in [1] to trip for host CPUs with less than 48 > > s/to trip/fail/ > >> bits physical address width from QEMU 9.2 onwards: >> >> vfio 0000:XX:YY.Z: Failed to set vIOMMU: aw-bits 48 > host aw-bits 39 >> >> For VFIO devices where a vIOMMU is in-use, QEMU fetches the IOVA ranges >> with the iommufd ioctl IOMMU_IOAS_IOVA_RANGES or the vfio_iommu_type1's >> VFIO_IOMMU_TYPE1_INFO_CAP_IOVA_RANGE info, so 'phys-bits' doesn't change >> the behavior of the check. >> >> Therefore, expose the 'aw-bits' option of the intel-iommu and >> virtio-iommu QEMU drivers to allow users to set the value. >> >> [0] https://lore.kernel.org/qemu-devel/20241212083757.605022-17-zhenzhong.duan@intel.com/ >> [1] https://lore.kernel.org/qemu-devel/20240605083043.317831-18-zhenzhong.duan@intel.com/ >> > > Nit: I'd prefer references to qemu commits rather than mails ACK, but not sure in what format we reference external repos, to the qemu-project gitlab or just the repo + commit hash + summary? So [0] https://gitlab.com/qemu-project/qemu/-/commit/ddd84fd0c1 [1] https://gitlab.com/qemu-project/qemu/-/commit/77f6efc0ab or [0] qemu ddd84fd0c1 ("intel_iommu: Set default aw_bits to 48 starting from QEMU 9.2") [1] qemu 77f6efc0ab ("intel_iommu: Check compatibility with host IOMMU capabilities") > >> @@ -112,9 +122,14 @@ sub default_machine_for_arch { >> >> sub assert_valid_machine_property { >> my ($machine_conf) = @_; >> - my $q35 = $machine_conf->{type} && ($machine_conf->{type} =~ m/q35/) ? 1 : 0; >> - if ($machine_conf->{viommu} && $machine_conf->{viommu} eq "intel" && !$q35) { >> - die "to use Intel vIOMMU please set the machine type to q35\n"; >> + if ($machine_conf->{viommu} && $machine_conf->{viommu} eq "intel") { >> + my $q35 = $machine_conf->{type} && ($machine_conf->{type} =~ m/q35/) ? 1 : 0; >> + die "to use Intel vIOMMU please set the machine type to q35\n" if !$q35; >> + >> + die "Intel vIOMMU supports only 39 or 48 bits as address width\n" >> + if $machine_conf->{'aw-bits'} >> + && $machine_conf->{'aw-bits'} != 39 >> + && $machine_conf->{'aw-bits'} != 48; >> } > > There should be an error (or at least warning) when aw-bits is set > without setting a viommu. ACK will add that _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel