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

Re: [PATCH v6 1/8] vpci/header: Emulate extended capability list for dom0


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: "Chen, Jiqian" <Jiqian.Chen@xxxxxxx>
  • Date: Fri, 27 Jun 2025 06:37:48 +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=jR0zseXZk2bUXzqXRG9P5SSPPrGx3g90Zcg/c0ZFAg8=; b=AoesZZwmWQ7TQ6idgp8Q+glhmQZPwuL8Ax+MR3w6A5hKQvaH8C2c4/aOLS13zQqKTZG0TFeV+uaZNjRAfBUUJg4/rDyI18z+I3AmCSdtMj41Rrz6bn+vImvHWRYeWWdlf4i2hA3ea0j5g3Xb5cRs/KAS+nr78LwYlweShKx4hD0G20ih+BnFqDyHClhHsP+K1StVTtZvbGcYa/LWcMjNXDnd6Y7iHhREYzEpkIwrgCIiPU/eTu5cSmR8KoV0uvVXi/4Nn5i3uhSVLoydzJR9TxkYyf5OpUeV4bnTV170lPCVWrXzjq0K72O81qtHFWbIdeBNTW6XkpmgNUzGS8PW+Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=pORaVjFfO+DKZ80JcbX8GWwwYABptLCR3gVnkMeoMEhPwLNNiILVaANzjwVQARLemzRCSq7Fb0EgBld1fvxtoH+oI16bYqliRDCskup47+7vI4PngRiPVnoA0oQjSzGVVUdRVfLXGqELWOhZY9rfZ5roKyHGgCYjUdlr6NKn5UlhddEiRudlDnehv5nVpvNtZG/RxmmvEiUvgG80Xa0lqLbh8OnR70zVJE5LFmBfjC7Z19vGLX0p1u9LEffezjWKLR3WzSiz9+g64FP+xOKale4QnRWQR8puKFIPHByw+mtsa2sh4EfyE/qQK/ri3k3NYnuCmp/n74A9V6fQyptlmQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
  • Cc: Jan Beulich <jbeulich@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "Huang, Ray" <Ray.Huang@xxxxxxx>, "Chen, Jiqian" <Jiqian.Chen@xxxxxxx>
  • Delivery-date: Fri, 27 Jun 2025 06:38:15 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHb23yZHYwoBN0glE68BnOedByoqrQI+ZKAgAFXGYCAAVGyAIAG16sA//+EZICABSptAA==
  • Thread-topic: [PATCH v6 1/8] vpci/header: Emulate extended capability list for dom0

Hi Roger,

On 2025/6/24 15:36, Jan Beulich wrote:
> On 24.06.2025 09:01, Chen, Jiqian wrote:
>> On 2025/6/20 14:29, Jan Beulich wrote:
>>> On 19.06.2025 04:29, Chen, Jiqian wrote:
>>>> On 2025/6/18 21:52, Jan Beulich wrote:
>>>>> On 12.06.2025 11:29, Jiqian Chen wrote:
>>>>>> --- a/xen/drivers/vpci/header.c
>>>>>> +++ b/xen/drivers/vpci/header.c
>>>>>> @@ -836,6 +836,42 @@ static int vpci_init_capability_list(struct pci_dev 
>>>>>> *pdev)
>>>>>>                                    PCI_STATUS_RSVDZ_MASK);
>>>>>>  }
>>>>>>  
>>>>>> +static int vpci_init_ext_capability_list(struct pci_dev *pdev)
>>>>>> +{
>>>>>> +    unsigned int pos = PCI_CFG_SPACE_SIZE;
>>>>>> +
>>>>>> +    if ( !is_hardware_domain(pdev->domain) )
>>>>>> +        /* Extended capabilities read as zero, write ignore for guest */
>>>>>
>>>>> s/guest/DomU/ ?
>>>> Will do.
>>>>
>>>>>
>>>>>> +        return vpci_add_register(pdev->vpci, vpci_read_val, NULL,
>>>>>> +                                 pos, 4, (void *)0);
>>>>>> +
>>>>>> +    while ( pos >= PCI_CFG_SPACE_SIZE )
>>>>>> +    {
>>>>>> +        uint32_t header = pci_conf_read32(pdev->sbdf, pos);
>>>>>> +        int rc;
>>>>>> +
>>>>>> +        if ( !header )
>>>>>> +            return 0;
>>>>>
>>>>> Is this a valid check to make for anything other than the first read? And 
>>>>> even
>>>>> if valid for the first one, shouldn't that also go through ...
>>>>>
>>>>>> +        rc = vpci_add_register(pdev->vpci, vpci_read_val, 
>>>>>> vpci_hw_write32,
>>>>>> +                               pos, 4, (void *)(uintptr_t)header);
>>>>>
>>>>> ... here?
>>>> If header of first is zero. There is no need to add a register I think, 
>>>> since the dom0 can read/write directly.
>>>
>>> Well, my remark of course did go along with that further down. Plus I wonder
>>> why the entire field being zero is special, but the field holding, say,
>>> 0x00010000 isn't. Yes, the spec calls out zeroes in all fields specially,
>>> yet at the same time it does say nothing about certain other special values.
>> If want to cover these special values.
>> Should I need to change the check from "!header" to "! 
>> PCI_EXT_CAP_ID(header)" ?
> 
> As indicated - my take is that the check may best be dropped. Roger?
May I get your feedback? Since some discussions need your input.
Also discussion in patch 2 and patch 4 as I remembered.

> 
> Jan

-- 
Best regards,
Jiqian Chen.

 


Rackspace

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