From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 96F036A841 for ; Wed, 16 Mar 2022 18:03:44 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 8A2C22A933 for ; Wed, 16 Mar 2022 18:03:14 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id F33672A927 for ; Wed, 16 Mar 2022 18:03:13 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id BD66A4277D for ; Wed, 16 Mar 2022 18:03:13 +0100 (CET) Message-ID: <9b98740f-f9a0-9e14-850b-90dd925ec0d2@proxmox.com> Date: Wed, 16 Mar 2022 18:03:12 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:99.0) Gecko/20100101 Thunderbird/99.0 Content-Language: en-US To: Proxmox VE development discussion , Markus Frank References: <20220225120028.1768349-1-m.frank@proxmox.com> From: Thomas Lamprecht In-Reply-To: <20220225120028.1768349-1-m.frank@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.058 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment NICE_REPLY_A -0.001 Looks like a legit reply (A) SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - Subject: Re: [pve-devel] [PATCH qemu-server] fix #3784: Parameter for guest vIOMMU 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: , X-List-Received-Date: Wed, 16 Mar 2022 17:03:44 -0000 On 25.02.22 13:00, Markus Frank wrote: > added a Parameter for vIOMMU so nobody has to use a github-script > or change the kvm command on every vm boot. > The args parameter doesn't work because the -device parameter(kvm) > with intel-iommu has to be placed before the other arguments. > some short sentence what vIOMMU is used for could be nice to have for context. > Signed-off-by: Markus Frank > --- > PVE/QemuServer.pm | 11 +++++++++++ > 1 file changed, 11 insertions(+) > > diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm > index 42f0fbd..a09dd2e 100644 > --- a/PVE/QemuServer.pm > +++ b/PVE/QemuServer.pm > @@ -647,6 +647,12 @@ EODESCR > ." remove disk operations.", > default => 0, > }, > + viommu => { > + optional => 1, > + type => 'boolean', > + description => "enable guest vIOMMU", > + default => 0, > + }, I'd like to avoid having too many separate config properties where sensible. qemu-server obv. failed already a bit with that, but that's now its legacy ^^ Anyhow, do you think it could make sense to either: * have this a format-string (`property: foo=1,bar=2,baz=42`) added to an existing option * use a more general `machine-flags` that already starts out as format-string so that we can reuse this in the future, e.g., for memory encryption (qemu sets that also on its machine param) or the like? > bios => { > optional => 1, > type => 'string', > @@ -3427,6 +3433,9 @@ sub config_to_command { > my $winversion = windows_version($ostype); > my $kvm = $conf->{kvm}; > my $nodename = nodename(); > + my $viommu = $conf->{viommu}; > + > + push @$devices, '-device', 'intel-iommu,intremap=on,caching-mode=on' if $viommu; > > my $arch = get_vm_arch($conf); > my $kvm_binary = get_command_for_arch($arch); > @@ -4021,6 +4030,8 @@ sub config_to_command { > } > push @$machineFlags, "type=${machine_type_min}"; > > + push @$machineFlags, 'accel=kvm,kernel-irqchip=split' if $viommu; We set accel= already elsewhere, did you check for possible conflicts that we could catch earlier (e.g., config set) and tell the user? > + > push @$cmd, @$devices; > push @$cmd, '-rtc', join(',', @$rtcFlags) if scalar(@$rtcFlags); > push @$cmd, '-machine', join(',', @$machineFlags) if scalar(@$machineFlags);