[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v4 05/10] vpci: Hide legacy capability when it fails to initialize


  • To: Jan Beulich <jbeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: "Chen, Jiqian" <Jiqian.Chen@xxxxxxx>
  • Date: Mon, 19 May 2025 07:35:49 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=491AY4HAQJHrgbjN3sGzes+iq/mHC0r/x4iefrn0KUo=; b=vO+SORLzqb6qq9+15SCibgqlqJqiBnuIo3OwltQdDTBmFAkQRAXwg6gaj5vTEWGDIAyItJzwyilki7ewIlCPhFAFHcx60EzRjs1kuDygVHnqSWAMZc1Wd40vUAUKW1chrJ4KAH7tTA2gNV/MpLfUdU2TPSPJ8HjFfcKjBQXplOemB7zr9Jbalb4OlWhZjCeNjsZFpc4izXaBmNtIRHbnayFl76NDd/64us6AhkADKU7dR7eHMFyGozXJ0E2RF3LWoOiSCesnPdQHS8T4+NBML0CkyIPO0v0Zdqfv7+qk1/Y15Gu8qKYRbxBZBOO2bt3z8rV4GdDJxI+EL6W5dAtCFA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=iKKDpWkDYGpVmxiZtwJ84borSo1CRHSoQbTQtNcNA5FFXyhEjmXJRJ4apqtxf1OTIjyl+TNdGjq1fczu4dkQL4v3JE87TV/m7A5vAjHFeqayAv/KDB7MB+NkPf0HgbLurvTD8QSYePSGPmjdAfesDgjDfx2QOK5teMTOq+7vJni4tk16snPoS+OKw2yvUMnP0uA7M77w4ViBvWycn0itpjdTNdW6QYZkQVkrv3l64ZzkPJBiD0/nRzQTmDDm1DMp84LUn6aWkWhatX/iyOJXacRUQiqTFHX+PM6hCHAIp+tPrSzKIvgXodu5TTAdCwHtz30xm9x1cxMKuRScUCiMXA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "Huang, Ray" <Ray.Huang@xxxxxxx>, "Chen, Jiqian" <Jiqian.Chen@xxxxxxx>
  • Delivery-date: Mon, 19 May 2025 07:36:09 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHbwMGgfMHCGxGzEUKJiTb14nIoDbPYhTMAgAGdm4A=
  • Thread-topic: [PATCH v4 05/10] vpci: Hide legacy capability when it fails to initialize

On 2025/5/18 22:44, Jan Beulich wrote:
> On 09.05.2025 11:05, Jiqian Chen wrote:
>> @@ -83,6 +99,100 @@ static int assign_virtual_sbdf(struct pci_dev *pdev)
>>  
>>  #endif /* CONFIG_HAS_VPCI_GUEST_SUPPORT */
>>  
>> +static struct vpci_register *vpci_get_register(struct vpci *vpci,
>> +                                               unsigned int offset,
>> +                                               unsigned int size)
>> +{
>> +    const struct vpci_register r = { .offset = offset, .size = size };
>> +    struct vpci_register *rm;
>> +
>> +    ASSERT(spin_is_locked(&vpci->lock));
>> +    list_for_each_entry ( rm, &vpci->handlers, node )
>> +    {
>> +        int cmp = vpci_register_cmp(&r, rm);
>> +
>> +        if ( !cmp && rm->offset == offset && rm->size == size )
> 
> What's the point of using vpci_register_cmp() when you need to do
> the "exact match" check here anyway?
Oh, you are right.
Will remove "!cmp" here in next version.

> 
>> +static int vpci_capability_mask(struct pci_dev *pdev, unsigned int cap)
> 
> What's the word "mask" indicating here? The function doesn't return any
> mask afaics. Do you perhaps mean "hide"?
Yes, hide.
This is a question of naming preference.
I remember Roger suggested this name, but maybe I remember wrong.
For double confirmation, hi Roger, are you fine that I change this name from 
mask to hide?

> 
> Jan

-- 
Best regards,
Jiqian Chen.

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.