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

Re: [PATCH v2 05/11] xen/arm: Mark device as PCI while creating one


  • To: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 27 Sep 2021 11:19:05 +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; bh=JhnrBnwuUNF23CxQfoC4vO8DtJ34XGVGnTDJNQawta0=; b=EETh8Ba730Jv8jmza//sSSeoCuKZ+08Zm9bWnkK+usk1nEaS8mb0K2/uMqXXiv9LgC1Pll8r7w5bOxKhEvwR+3wNUOLpp9iJ3KhczdVMEhWyvGGBZIunYabyILgCOOR3avbyCH9KydbTD17qpXq0QIClagq1S9KExQ82NJdQIGo9eVFO263eySDBgGGhw4LHAIAWaDCLQgbIyrpQyZSebmCxj5UO90X5irP2q+EbPfIjmamBlYSbWUChMXrcjE6vyUQ+vAjsubA0IYrf2sGu0LodfRE5giChVPdZTE4D9n8qUZAClr71h5xFpN+z/YoUKj/NuuukypoNwVGhfTEhiQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=P2qMDFCUhQGjVAqclSP8Vy4jpMJK7VBu+z6hcx2TQGNX/fu9kVHLwFaeV70Usv1o5iuHU/93iqYoG9k054sNNbPLm2ftUXJakIFMT7qKdn5PK19osKONoo6vkBmiDtdr8Chf5gxvY4T66VkkFeTxODW+taqiF/XzEZXjkUJ4UyBiOsrjQpXFZ10ZlUUGBYFDG/5YqdRUzwf1VapRh5uJt1jNWdKPo2GX2QKBARpDE+4kjQVq2q+e3YRgvCigTldX+Ey8PsDE4EOcTajGW098RYg/+mX78HmK/ro7xNoP9okVfwFS3ophBbaXdW+5xq1OzckfJ5BAKn4ZnTkNlOiUEA==
  • Authentication-results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=suse.com;
  • Cc: "julien@xxxxxxx" <julien@xxxxxxx>, "sstabellini@xxxxxxxxxx" <sstabellini@xxxxxxxxxx>, Oleksandr Tyshchenko <Oleksandr_Tyshchenko@xxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Artem Mygaiev <Artem_Mygaiev@xxxxxxxx>, "roger.pau@xxxxxxxxxx" <roger.pau@xxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Rahul Singh <rahul.singh@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 27 Sep 2021 09:19:15 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 27.09.2021 10:45, Oleksandr Andrushchenko wrote:
> 
> On 27.09.21 10:45, Jan Beulich wrote:
>> On 23.09.2021 14:54, Oleksandr Andrushchenko wrote:
>>> --- a/xen/drivers/passthrough/pci.c
>>> +++ b/xen/drivers/passthrough/pci.c
>>> @@ -328,6 +328,9 @@ static struct pci_dev *alloc_pdev(struct pci_seg *pseg, 
>>> u8 bus, u8 devfn)
>>>       *((u8*) &pdev->bus) = bus;
>>>       *((u8*) &pdev->devfn) = devfn;
>>>       pdev->domain = NULL;
>>> +#ifdef CONFIG_ARM
>>> +    pci_to_dev(pdev)->type = DEV_PCI;
>>> +#endif
>> I have to admit that I'm not happy about new CONFIG_<arch> conditionals
>> here. I'd prefer to see this done by a new arch helper, unless there are
>> obstacles I'm overlooking.
> 
> Do you mean something like arch_pci_alloc_pdev(dev)?

I'd recommend against "alloc" in its name; "new" instead maybe?

> If so, where should we put this call? At the very beginning of alloc_pdev
> or at the bottom just before returning from alloc_pdev?

Right where you have the #ifdef right now, I would say (separated by
a blank line).

Jan




 


Rackspace

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