From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <d.csapak@proxmox.com>
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 493258B9FF
 for <pve-devel@lists.proxmox.com>; Fri, 26 Aug 2022 08:39:56 +0200 (CEST)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
 by firstgate.proxmox.com (Proxmox) with ESMTP id 3FA972CB6F
 for <pve-devel@lists.proxmox.com>; Fri, 26 Aug 2022 08:39:26 +0200 (CEST)
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
 for <pve-devel@lists.proxmox.com>; Fri, 26 Aug 2022 08:39:25 +0200 (CEST)
Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1])
 by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 9BC9443292;
 Fri, 26 Aug 2022 08:39:25 +0200 (CEST)
Message-ID: <e9a2b2c6-d754-107e-3ae3-aceb938571d9@proxmox.com>
Date: Fri, 26 Aug 2022 08:39:25 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:105.0) Gecko/20100101
 Thunderbird/105.0
Content-Language: en-US
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
 "DERUMIER, Alexandre" <Alexandre.DERUMIER@groupe-cyllene.com>
References: <20220825092440.1810328-1-d.csapak@proxmox.com>
 <20220825092440.1810328-18-d.csapak@proxmox.com>
 <40540b19-6675-8ec9-5ac0-0163814bfe92@groupe-cyllene.com>
 <7d0ed948-8cd9-0a68-afee-764d67852e30@groupe-cyllene.com>
From: Dominik Csapak <d.csapak@proxmox.com>
In-Reply-To: <7d0ed948-8cd9-0a68-afee-764d67852e30@groupe-cyllene.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-SPAM-LEVEL: Spam detection results:  0
 AWL 0.094 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 v2 12/13] fix #3574: enable
 multi pci device mapping from config
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>
X-List-Received-Date: Fri, 26 Aug 2022 06:39:56 -0000

On 8/25/22 16:53, DERUMIER, Alexandre wrote:
>   > root@pve2:~# qm start 101
>   > ignoring mediated device with multifunction device
> 
> ok, it's simply that indeed I have specify a multifunction path "0000:02".
> 
> I think it should better/safe to die here, instead to simply warn and
> continue.
i agree die'ing here is better, for the mapped case we could do that now,
but for the old case of a pciid we can't (for backwards compat) until 8.0

[snip]

>>
>> maybe not related, but after that, stop/start are not working anymore
>>
>> root@pve2:~# qm stop 101
>> PCI device mapping invalid (hardware probably changed): 'mdev'
>> configured but should not be
>>
>> root@pve2:~# qm start 101
>> PCI device mapping invalid (hardware probably changed): 'mdev'
>> configured but should not be
>>

i had this also happen here once, when we do 'normal' pci passthrough
we reset the devices (via sysfs) and it seems the nvidia driver/card
does not like that and does not enable the mediated devices until
a reboot ....

the code then sees a hardware/feature mismatch and refuses to start.
this is done to prevent a start with passthrough on hardware change,
i.e. if someone adds/removes a device and suddenly
the device at path X is not the same anymore)