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

Re: [PATCH v4 13/14] arm/libxl: Emulated PCI device tree node in libxl


  • To: Ian Jackson <iwj@xxxxxxxxxxxxxx>
  • From: Rahul Singh <Rahul.Singh@xxxxxxx>
  • Date: Thu, 7 Oct 2021 13:36:48 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.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=+/6ht/emBIaV6NbUrkr7jRGEytZYuESeWz0oaJ8IphE=; b=iyLqXD4f3esYdImuMYW8FRslv3PmwJgLoV/hsWLp1mDeSafql+ZAPyCI+knXuDYKf1yrT50WMrIVSGuZaeTeexqBCHhKwH4l6sheVPuBLuG6PNh7w7GRT35qxQFY116BvKsvCOHtOxF6+zx7Ewpp6YMzeXKLdaZfzjTN2FfQ8DH/D/O/9LsjzE+KoXtnR+glRWsvsiuF4RCPAtPBqWAeFzviM+GdpWxnB87h4RI0rbt6tW4q3mnuF18H3JG8FxPM7pNDcjRtfvfdbGvQv8vFHA2X5Qj5QD4w12Nhlmwe6FUFcokSEp7JegqpTN+EqZA3H3gMaAH51tAG3WuJOySgmw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PasIG+BxqX3KP0QDeBpNKZkqk59iuFpQVPOF/FX4MaxABtWxZ2khPXkTz2bIkFz2yQH1XDm1kAAhj4hBBEchZeVMSGf+DZSpQDtrIX2LlYVgeRSRM4ldsZQuFgcI0dPLkcP6a59Q6qOVFLlsiORp4qyC9KyjUTimkkZYqsPiPCW+mqv4rJnzU/fELOZ5zSZ9W2FAyOwUZfzWFHZn8jPZ4FGqcsH05kZ4gVkSXWWJgkdSO/mkoL94TG5scKCqfC12xxNhOGcidipihzrqn+0J020xqGZ5ZwZmCen75ixZ4QuUuOw7UhzV9zOgJJzFoD+IW0t6/k/Ww8jMKZ7x63u9YA==
  • Authentication-results-original: xenproject.org; dkim=none (message not signed) header.d=none;xenproject.org; dmarc=none action=none header.from=arm.com;
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Andre Przywara <Andre.Przywara@xxxxxxx>, Wei Liu <wl@xxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Thu, 07 Oct 2021 13:37:25 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: xenproject.org; dkim=none (message not signed) header.d=none;xenproject.org; dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHXuRciClWhjFX7R0aQhsW/aixhyqvDkJEAgACf3oCAAL5hgIAAzJaAgAAXDgCAAALtgIAABFYAgABk+ICAASF7AIAALmeA
  • Thread-topic: [PATCH v4 13/14] arm/libxl: Emulated PCI device tree node in libxl

Hi Ian

> On 7 Oct 2021, at 11:50 am, Ian Jackson <iwj@xxxxxxxxxxxxxx> wrote:
> 
> Rahul Singh writes ("Re: [PATCH v4 13/14] arm/libxl: Emulated PCI device tree 
> node in libxl"):
>> On 6 Oct 2021, at 12:33 pm, Ian Jackson <iwj@xxxxxxxxxxxxxx> wrote:
>>> We try
>>> to make the libxl API "do the right thing" by default.  In this case I
>>> think that means to enable VPCI (i) on platforms where it's available
>>> (ii) if the guest has PCI passthrough devices.  Is that right ?
>> 
>> Yes you are right VPCI will be enabled for guest when guest has PCI 
>> passthrough device 
>> assigned and VPCI support is available.  
>>> 
>>> Sorry to ask these question now, and please forgive my ignorance:
>>> 
>>> Is VPCI inherently an ARM-specific ABI or protocol ?
>> 
>> As of now VPCI for DOMU guests is only implemented  for ARM.
> 
> I'm sorry.  It appears that the thrust of my questions wasn't
> sufficiently clear.  Your replies about details are fine but they
> don't seem to address my underlying concerns.
> 
> "as of now ... only implemented for ARM" suggests to me that it is
> VPCI *not* inherently ARM-specific.  Ie, it is a thing that x86 (or
> riscv or whatever) might support in future.  Is that right ?

Sorry for the confusion VPCI is not ARM inherently specific. x86 or RISC might 
support 
VPCI in the future for DOMU guests.

> 
> How does VPCI fit into the whole system architecture ?  Is it
> *required* for PCI passthrough on ARM ?  If not, what happens if it is
> not enabled ?

VPCI implements the virtual PCI bus topology through IO emulation in XEN. 
Emulated device tree 
node will be created for the DOMU guests and all the access to the config space 
will be a trap to 
XEN.I/O memory regions for the device will be mapped to the guest and MSI/MSIX 
interrupts will 
be redirected to the guest.
 
Yes VPCI is mandatory for PCI passthrough on ARM. If it is not enabled we will 
not be
 able to pass through any PCI device to the guest.

> 
> If VPCI *is* ARM-specific, how do x86 systems (say) achieve the goals
> met on ARM by VPCI ?

On the x86 system, QEMU emulates the PCI bus topology and PV drivers used for 
communication.
> 
> On the other hand if VPCI is not inherently ARM-specific it should not
> be in the ARM part of the libxl IDL.
> 
>>> When might an
>>> admin want to turn it on explicitly ?
>> 
>> It will be enabled dynamically when admin assign any PCI device to guest.
> 
> What about hotplug ?

As of now hotplug is not implemented and tested. We might implement 
the hotplug in future..

> 
>>> How does this all relate to the (non-arch-specific) "passthrough"
>>> option ?
>> 
>> VPCI will be enabled only when there is any PCI device assigned to
>> guest therefore I used "d_config->num_pcidevsïżœ to enable VPCI.
> 
> The purpose of the "passthrough" option is to allow the guest admin to
> specify that a guest is expected to gain hotplugged PCI devices in
> future.  That way, domain features that are required for PCI
> passthrough are automatically enabled.

Once we implement the hotplug feature we will use the "passthrough=“ options.
> 
> Perhaps this isn't explained clearly enough in the documentation,
> which talks about iommu mappings.
> 
> Does PCI passthrugh work on ARM without VPCI ?

VPCI is required on ARM for PCI passthrough.

Regards,
Rahul
> 
> I think it likely that VPCI should be controlled (or at least, its
> default set) from the "passthrough" option.  But I don't understand
> enough of the relationship between the pieces.
> 
> Ian.


 


Rackspace

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