[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: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>
  • Date: Mon, 27 Sep 2021 09:35:57 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.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=Gs2RrZQw62BoiJU6muXMOsnGwUgDw4TtrzVC3chvwr0=; b=capUWAQCEN+79BAkyeSOinKioDb8iyc7CNScrYjNFj7GQ/OnDVi/Q9TLMsivinTv6mVTLPWFE/r2QYLWLilDTJJ76dUb7Ns1Mt05T5e+KCuTxCNB/6ZmjeqbrSF38EOnijekop58fUwjfCCxEQw0MouDGl+o5PYvq6WBcboaYQ+8HZrQ39/asc1LEBVeHR5qC/r5ALswrnBJIsyiWE5+ErccIxr1FFk1WMGlCCkyoXADfPeevgTsdOdc8pIVISpxKICOt4poTLzHJaAhXEhn+Mf6s4QVzsJH2MYc1AbF5UBONZNd5KqyNTgsH+ZyuFD8i4xqGBswkw7KBD+MH5+GMg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aX8I/J6PVdXLbESHY0Fvd6iLkbYllXXvRUSP8GuBSBVKPwGe39WpYK9vaSBITPJf0BWO1ZyF7qt4KiJviqiOFi3jxju+ttFvOJdHxhey/L/DItTpPIomKmAvjhqRoKUBcxccfDPr/4NoxKuuEHjLfhx5tQm0MxKEdEsfUMPDFs00IbQh5yh/jU+ir+Vmlax5uiJBZtJmwk1RAeYJKyQ2qYnoLmU+Mf7cwrvup5dxXBXqu5wiBeJSGdeAJdzK32nRFNvA6nESE4/g2BkerqoiXYz/puaejIBloKC+dPlBCHi4f7VH9dw9p3vyfD0KEVL5R2j7Dal2E7wvGZdyi5eY3Q==
  • Authentication-results: suse.com; dkim=none (message not signed) header.d=none;suse.com; dmarc=none action=none header.from=epam.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>, Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>
  • Delivery-date: Mon, 27 Sep 2021 09:36:19 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHXsHoyHtx3VKSfZEKPQekyrs7GEau3hnIAgAAQrICAAAldgIAABLUA
  • Thread-topic: [PATCH v2 05/11] xen/arm: Mark device as PCI while creating one

On 27.09.21 12:19, Jan Beulich wrote:
> 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?

I am fine with arch_pci_new_pdev, but arch prefix points to the fact that

this is just an architecture specific part of the pdev allocation rather than

actual pdev allocation itself, so with this respect arch_pci_alloc_pdev seems

more natural to me.

>
>> 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).
Ok
>
> Jan
>
>
Thank you,

Oleksandr

 


Rackspace

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