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

Re: [PATCH v3 03/11] vpci/header: Emulate legacy capability list for dom0


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: "Chen, Jiqian" <Jiqian.Chen@xxxxxxx>
  • Date: Wed, 7 May 2025 02:50:19 +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=KhQ+or2CjMpMGn7G1uA69vlG590bZ040e5Cz/LDHhaY=; b=iAxQaVhB+q07P2yIBFhpmZwCwVb1WEDwzHYw5LD3VMz/94C0GmbB40x1MHLtae0u8FDkClaFIaD9DsPIhXhyvPnj8OqnTn2PefcoC4YY5Si/c3VRiwLpGfyqjpOPX712r5eWFh+x9bEBsS6dJ9D05zPpGd2V8bSINVTGwhYFwt2UlEI/V8H1AM3+TNg9qdAsLUCWEy0R9DB9pEzDQtY0kDRwxhWMFN+2YbAO6bOvbBhcw1uU4VLtvzNShGdbbvUb9D+OlYSucF5CSu8vMUyZbZt4jrTMM+D1NtyZI49sswrzCFP8A+dpWnJeJdUK4QTV+TPDNIWA8EnISnQNmvE58w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=nQft6yhcAAvpAlK8aBfQ+g2eljX+QhigfH/XYjHHeGyzSickQnK8qesxsry/LqAFPYSiBBG4ZQPdg6P77ozYe4RfW11CYOkgLXHmABo7DEAj6o4p9BdAwW5TS7GLVEUiono5w/iFSz0DaQ3fpG3TAdtmSQYpwAThe0lq9dgUdZuB7okym6Zev2bRpDD1VAsM0BWM3CyqKK3ziRtYqfqNcHAkgaUufa615D4smjOIyuL3CGG2HD/zPSGbI6tHgfTsPLrH2WLNZ6704//7jXrb6Fq5HbAtTR6cMgiYKYV/p8XN/MjmWVWy17oU0RUpIeTPYor+Weu6r2JokI4EYuueIA==
  • 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: Wed, 07 May 2025 02:50:32 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHbsoVY0As/JNC0IkWc2g8aH+9wh7PFtqAAgAFbx4CAAAPaAA==
  • Thread-topic: [PATCH v3 03/11] vpci/header: Emulate legacy capability list for dom0

On 2025/5/7 10:46, Chen, Jiqian wrote:
> On 2025/5/6 21:50, Roger Pau Monné wrote:
>> On Mon, Apr 21, 2025 at 02:18:55PM +0800, Jiqian Chen wrote:
>>> Current logic of emulating legacy capability list is only for domU.
>>> So, expand it to emulate for dom0 too. Then it will be easy to hide
>>> a capability whose initialization fails in a function.
>>>
>>> Signed-off-by: Jiqian Chen <Jiqian.Chen@xxxxxxx>
>>
>> Sorry, one nit I've noticed while looking at the next patch.
>>
>>> @@ -786,13 +787,15 @@ static int vpci_init_capability_list(struct pci_dev 
>>> *pdev)
>>>  
>>>              next = pci_find_next_cap_ttl(pdev->sbdf,
>>>                                           pos + PCI_CAP_LIST_NEXT,
>>> -                                         supported_caps,
>>> -                                         ARRAY_SIZE(supported_caps), &ttl);
>>> +                                         caps, n, &ttl);
>>>  
>>> -            rc = vpci_add_register(pdev->vpci, vpci_hw_read8, NULL,
> The same here, NULL -> vpci_hw_write8, I think.
> 
>>> -                                   pos + PCI_CAP_LIST_ID, 1, NULL);
>>> -            if ( rc )
>>> -                return rc;
>>> +            if ( !is_hwdom )
>>> +            {
>>> +                rc = vpci_add_register(pdev->vpci, vpci_hw_read8, NULL,
>>> +                                       pos + PCI_CAP_LIST_ID, 1, NULL);
>>> +                if ( rc )
>>> +                    return rc;
>>> +            }
>>>  
>>>              rc = vpci_add_register(pdev->vpci, vpci_read_val, NULL,
>>
>> For the hardware domain the write handler should be vpci_hw_write8
>> instead of NULL.
> OK, I think I need to add definition of vpci_hw_write8.
> But I have a question, if hardware domain write this register through 
> vpci_hw_write8,
> then the "next address data" of hardware will be in consistent with vpci.
be in consistent with -> be inconsistent with
I am sorry.

> Is it fine? Or should I update vpci's cache?
> 
>>
>> Thanks, Roger.
> 

-- 
Best regards,
Jiqian Chen.

 


Rackspace

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