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

Re: [PATCH v6 2/3] xen/arm: Enable the existing x86 virtual PCI support for ARM.


  • To: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 15 Oct 2021 12:24:35 +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=2VarEX2s5xZSbwsgpL/6lT5onBvZTkTqxCqU4i8R1Js=; b=Rt9Hy2T8DrkCvUf3FFzFiaL0MaE8CvRlaN8kRqaozSvX0BF0lX+39sJUiP87NgZogFJg/G+Am1Neb37fGrrU8xpNtms0T4DkM56J+FQnNOMo3zE4fjOGODPdbOnDfZx+qy1b9rsH+z9BlPnVytgTxMzDyjEHBkIuVL1oBKsknq2ciilyRu5UA8gmKGHIloWS741j6Rgurp8W0LI9gX/2D4ZJFXR0e9RDDTrqzhwkdYdPU+EDmwLSutXZQL7sU5+JpVXb724Ckywc3nhSEtx7ysyrwPoEjQY0JQ+24O3jXLjUX9d4kXMavlILZHjNuA8Njzc380PZ0jaD1ebbocIu4A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BKPGNzxjSK4M6HABDlL9g8F7KxM7Cpul4JmoQf2/5uVUPiq0c5+Vhv0h0X+J2I+Hk65HTcbjS1cqM7VedFOu6zNGnHrvb/tGfV14IjMoqWQYPJ1fD8YQV8uKuDIif3w7CZMRP560hvmjnCDSTZhY8p90Ah22A2Z4WrJQaG54OlBb9F+pgEc4+9uAC7nazzsF/ROXYhpiSbuWZ+aHUY0IJ4n4aEw47N37WXJUxhRcAZJbDorfi72crR/lXz/clnmH0u5WVqlVzYuRRStM/kPrkRh0X8LNFhtFQm/QesT+XDR3c4u9aZPQFE5zCRphaTBVTpuLDayRuaCfqnHPg3XnXw==
  • Authentication-results: citrix.com; dkim=none (message not signed) header.d=none;citrix.com; dmarc=none action=none header.from=suse.com;
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Rahul Singh <Rahul.Singh@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Paul Durrant <paul@xxxxxxx>, Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Fri, 15 Oct 2021 10:24:48 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 15.10.2021 11:52, Bertrand Marquis wrote:
>> On 15 Oct 2021, at 09:32, Roger Pau Monné <roger.pau@xxxxxxxxxx> wrote:
>> On Thu, Oct 14, 2021 at 03:49:50PM +0100, Bertrand Marquis wrote:
>>> @@ -752,6 +752,19 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn,
>>>
>>>     check_pdev(pdev);
>>>
>>> +#ifdef CONFIG_ARM
>>> +    /*
>>> +     * On ARM PCI devices discovery will be done by Dom0. Add vpci handler 
>>> when
>>> +     * Dom0 inform XEN to add the PCI devices in XEN.
>>> +     */
>>> +    ret = vpci_add_handlers(pdev);
>>> +    if ( ret )
>>> +    {
>>> +        printk(XENLOG_ERR "Setup of vPCI failed: %d\n", ret);
>>> +        goto out;
>>> +    }
>>> +#endif
>>
>> I think vpci_add_handlers should be called after checking that
>> pdev->domain is != NULL, so I would move this chunk a bit below.
> 
> On arm this would prevent the dom0less use case or to have the PCI
> bus enumerated from an other domain.
> @oleksandr: can you comment on this one, you might have a better
> answer than me on this ?

Well, without Xen doing the enumeration, some other entity would need
to do so, including the reporting to Xen. Obviously without a Dom0 it
would be ambiguous which domain to assign the device to; perhaps it
should be the caller in this case? That would make that caller domain
a pseudo-hwdom though, as far as PCI is concerned, which may not be
desirable according to my (limited) understanding of dom0less.

>>> @@ -784,6 +797,9 @@ out:
>>>                    &PCI_SBDF(seg, bus, slot, func));
>>>         }
>>>     }
>>> +    else if ( pdev )
>>> +        pci_cleanup_msi(pdev);
>>
>> I'm slightly lost at why you add this chunk, is this strictly related
>> to the patch?
> 
> This was discussed a lot in previous version of the patch and
> requested by Stefano. The idea here is that as soon as handlers
> are added some bits might be modified in the PCI config space
> leading possibly to msi interrupts. So it is safer to cleanup on the
> error path. For references please see discussion on v4 and v5 where
> this was actually added (to much references as the discussion was
> long so here [1] and [2] are the patchwork thread).
> 
> [1] 
> https://patchwork.kernel.org/project/xen-devel/patch/9bdca2cda5d2e83f94dc2423e55714273539760a.1633540842.git.rahul.singh@xxxxxxx/
> [2] 
> https://patchwork.kernel.org/project/xen-devel/patch/f093de681c2560a7196895bcd666ef8840885c1d.1633340795.git.rahul.singh@xxxxxxx/

The addition of this call has repeatedly raised questions. This is a
good indication that sufficient discussion thereof has been lacking
from the patch description.

Jan




 


Rackspace

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