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

Re: [PATCH v8 2/5] xen/arm: Enable the existing x86 virtual PCI support for ARM


  • To: Jan Beulich <jbeulich@xxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Rahul Singh <rahul.singh@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>
  • Date: Mon, 18 Oct 2021 10:06:01 +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:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=SsCgakRF88Gi8f0O1TajMGiNPGor3X03uI6NAkKhJJc=; b=ZHBpzeKma1vryNTZvcOZcqFMDkYj4C6W6u/iLYog/y35sM0zE7BFQWn3r+QizCRMKSp8kjssFhNgvzGxAZpdS3+c2GZI+9JNdaSjEDlv/nZX0gp8CLqU4NWwWO+pQfj+DOd3gv945u2lYGEPZs8ah4lD1N4c62BcyPb6dd7KbmWer8IFi6xCgl8/qeQ/mGvb1Y6kSlifT3bFcKe38o9KdV713/AajGOYj7j54Fyf2uwD6DP41wpCC/5AG/3SPPTDiiqlBKz7i/KGAnDEqj7Qmn76PKDazsWhe9WF5jv7jGGc+or4/bclChqmye1i1Aa3mm9ODJhP7KX7xABqcIfbtw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WIdU+3xgHdaxhFQ28jz+zaBOgwNCD/vKeR0+ci75DK5jLJOXpEjxPVoDWDbysJETqlZehG4dpMZVJF4fI8YYE6eOr2BsVTc0+twKy4H82VIri7yl5hzh5m5vqVQUFNcrf6/i53b5qEKYxZgmrXSINsjKeNNHGpZZ9CeGfdY92Q0o1V5BIzw+9cBiHizOj4Nr/Mg4mPRjL6J552ot7vem1kU1OaF3ISZy0Qwp8tOVUKE2ccFRP6orbgBioW1++q7kPSXswXOk5fWXv5JM59ZHDfI6tIWNbPv4+mr3+1CSXGtv6MR9m/U19qsnNIMvIkSVGyXia8CAfyzLUFXM3yXM4w==
  • Authentication-results: suse.com; dkim=none (message not signed) header.d=none;suse.com; dmarc=none action=none header.from=epam.com;
  • Cc: "iwj@xxxxxxxxxxxxxx" <iwj@xxxxxxxxxxxxxx>, "sstabellini@xxxxxxxxxx" <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>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>
  • Delivery-date: Mon, 18 Oct 2021 10:06:10 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHXxAfAx+Lzp09rU0elFmx0jxVt5g==
  • Thread-topic: [PATCH v8 2/5] xen/arm: Enable the existing x86 virtual PCI support for ARM

Hi, Jan!

On 18.10.21 10:47, Jan Beulich wrote:
> On 15.10.2021 18:51, Bertrand Marquis wrote:
>> --- /dev/null
>> +++ b/xen/arch/arm/vpci.c
>> @@ -0,0 +1,77 @@
>> +/*
>> + * xen/arch/arm/vpci.c
>> + *
>> + * This program is free software; you can redistribute it and/or modify
>> + * it under the terms of the GNU General Public License as published by
>> + * the Free Software Foundation; either version 2 of the License, or
>> + * (at your option) any later version.
>> + *
>> + * This program is distributed in the hope that it will be useful,
>> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
>> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>> + * GNU General Public License for more details.
>> + */
>> +#include <xen/sched.h>
>> +#include <xen/vpci.h>
>> +
>> +#include <asm/mmio.h>
>> +
>> +static int vpci_mmio_read(struct vcpu *v, mmio_info_t *info,
>> +                          register_t *r, void *p)
>> +{
>> +    pci_sbdf_t sbdf;
>> +    /* data is needed to prevent a pointer cast on 32bit */
>> +    unsigned long data;
>> +
>> +    /* We ignore segment part and always handle segment 0 */
>> +    sbdf.sbdf = VPCI_ECAM_BDF(info->gpa);
>> +
>> +    if ( vpci_ecam_read(sbdf, ECAM_REG_OFFSET(info->gpa),
>> +                        1U << info->dabt.size, &data) )
>> +    {
> Here it is quite clear that the SBDF you pass into vpci_ecam_read() is
> the virtual one.
Not really yet
>   The function then calls vpci_read(), which in turn
> will call vpci_read_hw() in a number of situations (first and foremost
> whenever pci_get_pdev_by_domain() returns NULL). That function as well
> as pci_get_pdev_by_domain() use the passed in SBDF as if it was a
> physical one; I'm unable to spot any translation. Yet I do recall
> seeing assignment of a virtual device and function number somewhere
> (perhaps another of the related series), so the model also doesn't
> look to assume 1:1 mapping of SBDF.
>
At the time of this patch we do not yet have a virtual topology
implemented which is added at a later stage.
So, when a DomU performs PCI enumeration it sees all the real
PCI HW and thus discovers all PCI devices with their *real SBDFs*,
e.g. just like we pass through all the topology to the guest.
So, in the question, SBDFs are physical

 


Rackspace

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