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

Re: [PATCH v7 5/5] arm/libxl: Emulated PCI device tree node in libxl


  • To: Julien Grall <julien@xxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Fri, 15 Oct 2021 15:04:37 +0000
  • Accept-language: en-GB, 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=FrKl4S1boW/FetRzJ4k3nbpvsIkHmkx/mkFE6eNhl0E=; b=hnGUi7JI3lZvVHdgAYF9NP7wQ1Dq6GjWus1+4tg8fhTj82anoG4bPIzANcYNGNA/NOqiFyf5gL0+UvDYYinEVu9WEVkax6bEnWKY/FofSQ/0vJCz7EI+pQAW/jw4erg5+ttTHdFXyl5YFISetUPBQv25SgLzjukL8czXOsjOpb5PGhWEs+Je9BKHFiVIct9seaCgfgt9ND6U+iadt9bVskhl70u45uEEoMLG2aK9f0ukI03vv22Tlq4MWtYYBlCYQXxMPKQNJmUIf16jKJ2d6JldW7eMNswM7og4xk11J95PnPq6TvfIpryq0Ko7Eegyl0//qlbTj6G3WXdtj7Bcag==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FQxZVBsu5FOPR1PDGVl1Nfxjs9NUsfSMc+IAic9rRCspJXqFkR3HfWLhtH0r+cC6ECRRnDe3pyoMtXeattgRbje47289dKDa2MU4Rvfo+3Nle5KElfP24rMPP3sXmgcJnlmQOUPLC9+p6L+mclBKmAdprGlhstC+v0jndOpg6qDEQMIxjH4f0wg0nNuR1scwH7yWDbeC0PEOR3gD8WoJkfNKY0HWrCuRhchT3802P8h0+XHvdZu4XtzvBbywiPSy2UU24GeNjo5MG0vCvlWexb3wUnFYv69o7a4cf/X+1EUnQpXEDYgulhdUCQFTcQnBzk3M3jxj5zVmUk7EFFRQSQ==
  • Authentication-results-original: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=arm.com;
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "iwj@xxxxxxxxxxxxxx" <iwj@xxxxxxxxxxxxxx>, Rahul Singh <Rahul.Singh@xxxxxxx>, Wei Liu <wl@xxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Michal Orzel <Michal.Orzel@xxxxxxx>
  • Delivery-date: Fri, 15 Oct 2021 15:05:13 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHXwczxs7P/2oORBkqz9VQaBzYYAavUJQ2AgAADSAA=
  • Thread-topic: [PATCH v7 5/5] arm/libxl: Emulated PCI device tree node in libxl

Hi Julien,

> On 15 Oct 2021, at 15:52, Julien Grall <julien@xxxxxxx> wrote:
> 
> Hi Bertrand,
> 
> On 15/10/2021 14:59, Bertrand Marquis wrote:
>> From: Rahul Singh <rahul.singh@xxxxxxx>
>> libxl will create an emulated PCI device tree node in the device tree to
>> enable the guest OS to discover the virtual PCI during guest boot.
>> Emulated PCI device tree node will only be created when there is any
>> device assigned to guest.
>> A new area has been reserved in the arm guest physical map at
>> which the VPCI bus is declared in the device tree (reg and ranges
>> parameters of the node).
>> Note that currently we are using num_pcidevs instead of
>> c_info->passthrough to decide whether to create a vPCI DT node.
>> This will be insufficient if and when ARM does PCI hotplug.
>> Add this note inside libxl_create.c where c_info->passthrough
>> is set.
>> Signed-off-by: Rahul Singh <rahul.singh@xxxxxxx>
>> Signed-off-by: Michal Orzel <michal.orzel@xxxxxxx>
> 
> I believe you need to add your signed-off-by here as you sent the new version 
> on xen-devel.

I packed it together but the changes where done by Michal so I did not add it.

Could it be added on commit ?

> 
> With one remark below (not to be handled for 4.16):
> 
> Reviewed-by: Julien Grall <jgrall@xxxxxxxxxx>

Thanks

> 
>> +static int make_vpci_node(libxl__gc *gc, void *fdt,
>> +                          const struct arch_info *ainfo,
>> +                          struct xc_dom_image *dom)
>> +{
>> +    int res;
>> +    const uint64_t vpci_ecam_base = GUEST_VPCI_ECAM_BASE;
>> +    const uint64_t vpci_ecam_size = GUEST_VPCI_ECAM_SIZE;
>> +    const char *name = GCSPRINTF("pcie@%"PRIx64, vpci_ecam_base);
>> +
>> +    res = fdt_begin_node(fdt, name);
>> +    if (res) return res;
>> +
>> +    res = fdt_property_compat(gc, fdt, 1, "pci-host-ecam-generic");
>> +    if (res) return res;
>> +
>> +    res = fdt_property_string(fdt, "device_type", "pci");
>> +    if (res) return res;
>> +
>> +    res = fdt_property_regs(gc, fdt, GUEST_ROOT_ADDRESS_CELLS,
>> +            GUEST_ROOT_SIZE_CELLS, 1, vpci_ecam_base, vpci_ecam_size);
>> +    if (res) return res;
>> +
>> +    res = fdt_property_values(gc, fdt, "bus-range", 2, 0, 255);
>> +    if (res) return res;
>> +
>> +    res = fdt_property_cell(fdt, "#address-cells", 3);
>> +    if (res) return res;
>> +
>> +    res = fdt_property_cell(fdt, "#size-cells", 2);
>> +    if (res) return res;
>> +
>> +    res = fdt_property_string(fdt, "status", "okay");
>> +    if (res) return res;
>> +
>> +    res = fdt_property_vpci_ranges(gc, fdt, GUEST_ROOT_ADDRESS_CELLS,
>> +        GUEST_ROOT_SIZE_CELLS, 2,
>> +        GUEST_VPCI_ADDR_TYPE_MEM, GUEST_VPCI_MEM_ADDR, GUEST_VPCI_MEM_SIZE,
>> +        GUEST_VPCI_ADDR_TYPE_PREFETCH_MEM, GUEST_VPCI_PREFETCH_MEM_ADDR,
> 
> From my understanding, the prefetch memory region is optional. Is it going to 
> be a problem to expose one for the vCPI when the host PCI hostbridge may not 
> support it?

Good point but I would guess no as the host bridge should not use it.
I keep that as a point to check with Rahul.

Cheers
Bertrand

> 
> Cheers,
> 
> -- 
> Julien Grall




 


Rackspace

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