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

Re: [PATCH v2 2/3] PCI: fold pci_get_pdev{,_by_domain}()


  • To: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 11 Aug 2022 17:41:19 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=BosLsCCq9eIrx2KkN1hwHB+r3NvIpTzBNuy0p7LarpA=; b=CAdYLoOthXIFx5vXSKNw6aIiaU/IaMJCBG4lWSvzovFitCrRNUcPpVpi3GfxJ5KM+sFmMN4cczrfJ8gH9HW+mcyujbhBr8qWzMWPwfCoocADNV63gHq5IUTW6VnbT1WB1CDbQb8q5xJZoYKZLogWntiMEKXrjF26QrcIM8BjeqkE7M/UsB2vvY0nQchnt1C0I9UwysdfohJfYwZxReOYPLZy6JHmY3quZkuNB8iQ3QLrmn9qSOxlRWOkZGR0pswB/2+hOSmppyEkW6dFKuWs+uKDVHUNCTsJArsVi3lD1CyzOqcJJR6HkBcGpVSIM9TSKyu9TSsYuJp9U21Bs1ql4Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KBMgLq1IcmSU14wCM2dYe5uxA867opay3GXQbYkc6uumiaNJcFO0Tdcz4TT+SeV7tvUjO4pLB++bXo+xCr8L2yQankwRFcp6hQ3A7gf9US2yZl5JrItrBPFTxzaByQrQEyOYKWFsjyuxHymjRzHudP+I6h7PTq3nVZ/iWELvKdPULSrVS/QO+ptZ7JQdDNqjgBUolIiJnLSuPEBcb+cDR7polKbypMSHddG3gfpBzdNz8ABmeKB2zyBkJ5wfVRFEf/n6fDAPSPslUA4GFEdwQeC91DP5FLKy8vYBi/OJoy9x2v8eUUkSP/vDlwt4YfWaU2I17Khb/typ7qINZOaxXA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Paul Durrant <paul@xxxxxxx>, Roger Pau Monne <roger.pau@xxxxxxxxxx>, Rahul Singh <Rahul.Singh@xxxxxxx>, George Dunlap <George.Dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 11 Aug 2022 15:41:39 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 11.08.2022 17:09, Andrew Cooper wrote:
> On 11/08/2022 14:26, Jan Beulich wrote:
>> On 11.08.2022 15:21, Andrew Cooper wrote:
>>> On 11/08/2022 11:52, Jan Beulich wrote:
>>>> --- a/xen/arch/x86/irq.c
>>>> +++ b/xen/arch/x86/irq.c
>>>> @@ -2162,7 +2162,7 @@ int map_domain_pirq(
>>>>          if ( !cpu_has_apic )
>>>>              goto done;
>>>>  
>>>> -        pdev = pci_get_pdev_by_domain(d, msi->seg, msi->bus, msi->devfn);
>>>> +        pdev = pci_get_pdev(d, PCI_SBDF(msi->seg, msi->bus, msi->devfn));
>>> Oh, I should really have read this patch before trying to do the sbdf
>>> conversion in patch 1.
>>>
>>> However, it occurs to me that this:
>>>
>>> diff --git a/xen/arch/x86/include/asm/msi.h b/xen/arch/x86/include/asm/msi.h
>>> index 117379318f2c..6f0ab845017c 100644
>>> --- a/xen/arch/x86/include/asm/msi.h
>>> +++ b/xen/arch/x86/include/asm/msi.h
>>> @@ -59,9 +59,14 @@
>>>  #define FIX_MSIX_MAX_PAGES              512
>>>  
>>>  struct msi_info {
>>> -    u16 seg;
>>> -    u8 bus;
>>> -    u8 devfn;
>>> +    union {
>>> +        struct {
>>> +            u8 devfn;
>>> +            u8 bus;
>>> +            u16 seg;
>>> +        };
>>> +        pci_sbdf_t sbdf;
>>> +    };
>>>      int irq;
>>>      int entry_nr;
>>>      uint64_t table_base;
>>>
>>> will simplify several hunks in this patch, because you can just pass
>>> msi->sbdf rather than reconstructing it by reversing 32 bits worth of
>>> data from their in-memory representation.
>> No, I'm strictly against introducing a 2nd instance of such aliasing
>> (we already have one in struct pci_dev, and that's bad enough). There
>> could be _only_ an "sbdf" field here, yes, but that'll have knock-on
>> effects elsewhere, so wants to be a separate change. And there are far
>> more places where imo we'll want to use pci_sbdf_t.
> 
> What's the likelihood of getting to that before 4.17 goes out?

Well, I can try to get to making a patch tomorrow, just in time to meet
the submission deadline. But that's not really a promise ...

Jan

> I'd prefer to see it fixed, and obviously even more conversion to sbdf_t
> is better.
> 
> Basically, I'm happy for the conversion to not be in this patch, as long
> it's not going to get forgotten.
> 
> ~Andrew




 


Rackspace

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