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

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


  • To: Jan Beulich <jbeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: "Chen, Jiqian" <Jiqian.Chen@xxxxxxx>
  • Date: Wed, 9 Jul 2025 05:34:28 +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=Kezi6cbAF8Zyc4ZSB5FVxJGKYVwaqGHrP6ptpIXTPRw=; b=yJbX56VCtSZX86xAmcz8JOhlaBozj4wQowHvo51T7bm8onrVV3CHXDH7RH4yL8DvlvBmEFxudXuD+u/Icmq1B30vUBZgZ9hyvO7d3UXpbb1xks26hr8YgteI+M/LtZznJvxRdsOSkPjXJkLBIFEJZRTgpq8wcJm2SBDUQdVezu/uWcp5pjTSyJM6pHPAB6LBU/RWTHzMwBOoO8XvbasAhosqoXrnlehR1I2OaDNDKHqEZa5T2jxF6AnO3fTxvSEK2Pn2drsGddCiu90G9kOVHahpcAWwhqTbAy05OZAD6y3MhJhx62/SDHVCpfpeSaqLeYqnrZqKYpbWVIfh0gFYrw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=PnW+DJKncr/na6tDjKgyGEfN/He+2uXZoNDKwMDnWS36/rsF9IMzw8VB7heTr/Ss1UrelWr/LdniqhrBCwOZcHMeIXrvMZLw47MrB0rzQmidl/bE8nr41ZUEV3YPhx8/YahL0i9AmPCmc+0HrmJtTJOCsM/dheaO57jqBjo4lsouhPjH/7YTzz1VRQlcm9VYr1vbM54QmITNHRpaR/m8BYs1lOHVanw7cTNtbI+KyNNLZlQcPDSyB5gJjNEpIKXNscuhqvxhRsQPJ1pnyQ9i+pHiZWZeha2CYKyxZlkC2etgZ56UQLgqOV8N+pvayFxGcWHVHqgCWFAmabCPX9MXHA==
  • 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>, "Chen, Jiqian" <Jiqian.Chen@xxxxxxx>, "Huang, Ray" <Ray.Huang@xxxxxxx>
  • Delivery-date: Wed, 09 Jul 2025 05:34:40 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHb7LJxCAe3dwZ41UCqlD5sc7if87QoStWAgAGGGID//3tSAIAAhoUA
  • Thread-topic: [PATCH v7 1/8] vpci/header: Emulate extended capability list for dom0

On 2025/7/9 13:32, Jan Beulich wrote:
> On 09.07.2025 07:29, Chen, Jiqian wrote:
>> On 2025/7/8 22:10, Jan Beulich wrote:
>>> On 04.07.2025 09:07, Jiqian Chen wrote:
>>>> --- a/xen/drivers/vpci/header.c
>>>> +++ b/xen/drivers/vpci/header.c
>>>> @@ -836,6 +836,39 @@ static int vpci_init_capability_list(struct pci_dev 
>>>> *pdev)
>>>>                                    PCI_STATUS_RSVDZ_MASK);
>>>>  }
>>>>  
>>>> +static int vpci_init_ext_capability_list(const 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 DomU */
>>>> +        return vpci_add_register(pdev->vpci, vpci_read_val, NULL,
>>>> +                                 pos, 4, (void *)0);
>>>> +
>>>> +    do
>>>> +    {
>>>> +        uint32_t header = pci_conf_read32(pdev->sbdf, pos);
>>>> +        int rc;
>>>> +
>>>> +        rc = vpci_add_register(pdev->vpci, vpci_read_val, vpci_hw_write32,
>>>> +                               pos, 4, (void *)(uintptr_t)header);
>>>
>>> If it wasn't for this use of vpci_hw_write32(), I'd be happy to provide my
>>> R-b. But this continues to look bogus to me: What use is it to allow writes
>>> when Dom0 then can't read back any possible effect of such a write (in the
>>> unexpected event that some of the bits were indeed writable)?
>> Oh, I got your concern.
>> What do you think about updating the header value after writing to hardware 
>> in write function?
> 
> That would imo be a layering violation. Once again that's something that you
> primarily would need Roger's input on.
OK, wait for Roger's input.

> 
>> Or you prefer to pass NULL here?
> 
> Yes, that's what I've been trying to argue for.
> 
> Jan

-- 
Best regards,
Jiqian Chen.

 


Rackspace

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