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

Re: xen/arm: Virtio-PCI for dom0less on ARM


  • To: "Edgar E. Iglesias" <edgar.iglesias@xxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Wed, 21 May 2025 11:52:47 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 4.158.2.129) smtp.rcpttodomain=amd.com smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
  • 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=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=kQ2kmbFCMaxI6Hmq2bPgpDH8KVgS9owSxdy9Y1yT+g8=; b=soy44w5OwKX6ieUH8n9nt4NTS3Wrj/TAzfL/fStipU4O3kz0Nsgxa/7S5f6EDF7oHUdYL4VkKREiEojEQqe1dRK44ROjgtAXLXp1NeAO03Bdtqmddotha6YAzdG3EzhLzxK3Kyyl65PQSmuhLPJk6vnXINgvmH61MxfLJdFVowRGdM6xGhgswTQY+GDfzvHEh5eZETDLmGB6QqWByksGdesKK6bBrNbjbKW4Jgx51PoYzSSxNghyf+EnKspxUDegDzFapj+mJjQp9IS+RPX/P6UgEEJtOaR0PZgyjENq9k7n7+OvX8tqId9SDilWhrabR3ZcR93g/UDzsBWkhZ4oBA==
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=kQ2kmbFCMaxI6Hmq2bPgpDH8KVgS9owSxdy9Y1yT+g8=; b=ikXVCyvK6pLGgjnLt8T7SkLO87w8NivY4m8o7Gd4ZqfqvbGQ4jYBeKIo5tXS6rGC2rtjDeTtgRz+2TAH5prkCK/u0Z4aGRHFiiM0pwiFJ2kIUr7QBV9ZUL3z2b5qisDY1FNgcfv4mk38AXYweE+RVOHCHLcuF24BhWbu5p6vNwKjEoWJl+/gW+Dj9iFIF2h/h9x5jUBob8yZ3DFLdJAW2rzoyBJLE/l1JRBUmHmLnp3HNgKb5Ff9RhKm+gGthUYcvnbosppybfFImHH8GzTw+JYsTq8GYdgXyg75aPpvU0Wld2gwebQJJOUpEvN/AdAVGke7vBt2/AAk+n7Wmb1v+Q==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=QMZL+6Dq0oSgb/CVa2t740rt+ojhWr7Mxdfh/uEjq7ylmlk9e+IpzsKegeESFIrGuP18/YZhejs2Fa9iQlGx5ytynnaVz3w80AFlaW9EA+/Z9BWOMLRpE8VwDM3EStG9KrGJp5XjmPH3HwVFf1xYlyi6gRUwIeDglXSPAqWL066KDoR0iOtKYQJACXP6BBeD+gl+C52xeK6DJ9jtbRsGjaCElMw2tq9omEyyLfJeF4t+jrdn2IzRa3Cm7azezmVttC8MA4O7gXkUhqFo4MEUeqfYGRXq+5RMu6f6uDed4hBmgKWEKzExVfjlV7/xgxF0NqIs4MOt+lG9NZaOBW0lqQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=PdEyE101PUZlwwD2MhAaPWL/gmyGAByfdAfcSIxB7QX/P87R7AtMVasc+HhNBGfpU5AKHwMJ3iPPsg2MypKZqS/ETC5pYrET3y7Pnz6zadIZjZj8rzu21VD50CpXO0ALy1VwKS6HN61nJysoDU4p0HhACKRDjInTWwdPi9faYL4yPrZLpDqlZjB0dAY55AiiKKQz+bqIfHWbnlTO+XlAq9JZsmNCR/w1Da8UoVNSPvk8GoqzbcXFf2hW8/Qkh21k2KK+jwlDygrHrTE85Nb9LnC9ZjqhGre3Ji339A3n095iJ0QeieJn5AkrFjLbyZx7zUnycB6ZVrbDDecwEwuRMQ==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, "Edgar E. Iglesias" <edgar.iglesias@xxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 21 May 2025 11:53:33 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Thread-index: AQHbyV3Hle+PZAZfxkivw95jajJbObPc+vWA
  • Thread-topic: xen/arm: Virtio-PCI for dom0less on ARM

Hi Edgar,

> On 20 May 2025, at 10:04, Edgar E. Iglesias <edgar.iglesias@xxxxxxx> wrote:
> 
> Hi all,
> 
> Following up on the ARM virtio-pci series I posted a while back ago.
> 
> There have been some concerns around the delayed and silent apperance of
> devices on the ECAM area. The spec is not super clear wether this is OK or
> not but I'm providing some references to the PCI specs and to some real cases
> where this is used for FPGAs.
> 
> There are two options how to implement virtio-pci that we've discussed:
> 1. VPCI + IOREQ
> 2. IOREQ only
> 
> There are pros and cons with both. For example with #1, has the benefit that
> we would only have a single PCIe RC (in Xen) and we could emulate a hotplug
> capable expansion port with a standard way to notify when PCI devices plug in.
> Approach #2 has the benefit that there is (almost) no additional complexity
> or code added to Xen, almost everything lives outside.
> IMO, both options have merit and both could co-exist.
> 
> For dynamic xl flows, options #2 already works without modifications to Xen.
> Users need to pass the correct command-line options to QEMU and a device-tree
> fragment with the pci-generic-ecam-host device.
> 
> For static dom0less flows, we can do the same as for xl flows but we have the
> additional problem of domU's PCI bus enumeration racing with QEMU.
> On x86, when domU's access a memory range that has not yet got IOREQ's
> connected to it, the accesses succeeds with reads returning 0xFFFFFFFF and
> writes ignored. This makes it easy for guests to wait for IOREQ devices to
> pop up since guests will find an empty bus and can initiate a rescan later
> when QEMU attaches. On ARM, we trap on these accesses.
> 
> If we on ARM add support for MMIO background regions with a default read 
> value,
> i.e mmio handlers that have lower priority than IOREQs and that are
> read-const + writes-ignored, we could support the same flow on ARM.
> This may be generally useful for other devices as well (e.g virtio-mmio or
> something else). We could also use this to defer PCI enumeration.
> 
> So the next versions of this series I was thinking to remove the PCI specifics
> and instead add FDT bindings to ARM dom0less enabling setup of user
> configurable (by address-range and read-value) background mmio regions.
> Xen would then support option #2 without any PCI specifics added.
> 
> Thoughts?

We discussed that together last week and I think this is a good approach as it
prevents having some "workaround" code for PCI not following the Virtio spec and
could also fulfil some other use cases by giving a solution to emulate some IO
registers for a guest with a fixed value.

Cheers
Bertrand

> 
> Cheers,
> Edgar
> 
> # References to spec
> 
> PCI express base specification:
> 7.5.1.1.1 Vendor ID Register (Offset 00h)
> The Vendor ID register is HwInit and the value in this register identifies 
> the manufacturer of the Function. In keeping with
> PCI-SIG procedures, valid vendor identifiers must be allocated by the PCI-SIG 
> to ensure uniqueness. Each vendor must
> have at least one Vendor ID. It is recommended that software read the Vendor 
> ID register to determine if a Function is
> present, where a value of FFFFh indicates that no Function is present.
> 
> PCI Firmware Specification:
> 3.5 Device State at Firmware/Operating System Handoff
> Page 34:
> The operating system is required to configure PCI subsystems:
>  During hotplug
>  For devices that take too long to come out of reset
>  PCI-to-PCI bridges that are at levels below what firmware is designed to 
> configure
> 
> Page 36:
> Note: The operating system does not have to walk all buses during boot. The 
> kernel can
> automatically configure devices on request; i.e., an event can cause a scan 
> of I/O on demand.
> 
> FPGA's can be programmed at runtime and appear on the ECAM bus silently.
> An PCI rescan needs to be triggered for the OS to discover the device:
> Intel FPGAs:
> https://www.intel.com/content/www/us/en/docs/programmable/683190/1-3-1/how-to-rescan-bus-and-re-enable-aer.html
> 


 


Rackspace

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