From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <pve-devel-bounces@lists.proxmox.com>
Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9])
	by lore.proxmox.com (Postfix) with ESMTPS id 7C3541FF16B
	for <inbox@lore.proxmox.com>; Thu,  3 Apr 2025 11:43:22 +0200 (CEST)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
	by firstgate.proxmox.com (Proxmox) with ESMTP id E92733B5B6;
	Thu,  3 Apr 2025 11:43:10 +0200 (CEST)
Message-ID: <9aac4127-3511-42cb-a6ae-2b9d8eb319ee@proxmox.com>
Date: Thu, 3 Apr 2025 11:43:08 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird Beta
To: Thomas Lamprecht <t.lamprecht@proxmox.com>,
 Proxmox VE development discussion <pve-devel@lists.proxmox.com>
References: <20250311132055.2826686-1-d.csapak@proxmox.com>
 <20250311132055.2826686-2-d.csapak@proxmox.com>
 <5e97b26c-afe3-4d13-9ea5-3a3f9b037116@proxmox.com>
Content-Language: en-US
From: Dominik Csapak <d.csapak@proxmox.com>
In-Reply-To: <5e97b26c-afe3-4d13-9ea5-3a3f9b037116@proxmox.com>
X-SPAM-LEVEL: Spam detection results:  0
 AWL 0.022 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 guest-common v7 1/2] mapping: pci: check the
 mdev configuration on the device too
X-BeenThere: pve-devel@lists.proxmox.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Proxmox VE development discussion <pve-devel.lists.proxmox.com>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pve-devel/>
List-Post: <mailto:pve-devel@lists.proxmox.com>
List-Help: <mailto:pve-devel-request@lists.proxmox.com?subject=help>
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=subscribe>
Reply-To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Errors-To: pve-devel-bounces@lists.proxmox.com
Sender: "pve-devel" <pve-devel-bounces@lists.proxmox.com>

On 4/3/25 11:40, Thomas Lamprecht wrote:
> Am 11.03.25 um 14:20 schrieb Dominik Csapak:
>> but that lives int he 'global' part of the mapping config, not in a
>> specific mapping. To check that, add it to the $configured_props from
>> there.
>>
>> this requires all call sites to be adapted otherwise the check will
>> always fail for devices that are capable of mediated devices
> 
> But that's not true, or? As the check only happens if the $cluster_mapping_cfg
> param is passed, which call-sites need to do first?
> 

true, I think the commit message is outdated. I faintly remember changing
the semantic at some point but probably forgot to update the commit message.

>>   # checks if the given config is valid for the current node
>>   sub assert_valid {
>> -    my ($name, $mapping) = @_;
>> +    my ($name, $mapping, $cluster_mapping_cfg) = @_;
> 
>                              ^-  new param here
> 
>>   
>>       my @paths = split(';', $mapping->{path} // '');
>>   
>> @@ -161,6 +161,12 @@ sub assert_valid {
>>   
>>   	my $configured_props = { $mapping->%{qw(id iommugroup subsystem-id)} };
>>   
>> +	# check mdev from globabl mapping config, if that is given
>> +	if (defined($cluster_mapping_cfg)) {
> 
> guarded witch check for defindness here
> 
>> +	    $expected_props->{mdev} = $info->{mdev} ? 1 : 0;
>> +	    $configured_props->{mdev} = $cluster_mapping_cfg->{mdev} ? 1 : 0;
>> +	}
>> +
>>   	for my $prop (sort keys $expected_props->%*) {
>>   	    next if $prop eq 'iommugroup' && $idx > 0; # check iommu only on the first device
>>   
> 



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel