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

Re: [PATCH 03/10] xen/arm: Setup MMIO range trap handlers for hardware domain


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Oleksandr Andrushchenko <andr2000@xxxxxxxxx>
  • From: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>
  • Date: Wed, 11 Nov 2020 14:42:56 +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-SenderADCheck; bh=CdpnGa4rbLp/JBpsamr4pRiPirSjNwVGSJB0QN2k7LU=; b=AXXLkO3L6U+JdWILxpe/jGU3OIO9tGNeYgiXlHOwhiHvUAx5+JJpcXHleM5Il8vB1WACuOAfZexEv0JaQuVkXE4fZJBRn6E3UfcurcOZwTkz20HyKv+gLSwvyYMwf8Vo2y2v5HntIjDyqDZT8z3hdg+erGdazqMcOKlu+7uhKmwc5N6K7Q4GREs2fKWttvnHOYv8FWY7CuS6y/tUKiIAE2yICNpvuyKfighT5GGYsaT/D545h6ZqY+7QwP/Zj6+IUmwZp61twxpj88+WaGEqlqzSqbitnJstGsRrhcu9Q+vK0ao++/fC23aVBSYcTUkio4hzmaeCB4zyVWNo6+bfyA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c5gKiV3f67by+uzKkzAM053lDP1BQSDnpHD+AD0zNqLVWCfgCcm7EU/sH+/sYpsKVfBNNc5fB8PGj1dFe1fqG2W6OY0LvHdpF3FuDARGKlrLUbTqJOTpbavMEFZpbz0DMt3moGLPGNn6Ji7HiSkBrjQD3i2vbJfk47nBxClVCuuJv5d1DHcKt9V96hgMOwFlZn/JsOYeocoyXsf48K5PEAcVXMWRDblpWpsc3K2gGdFae5uZsgEBg0Y2/e/6A7utdTVin9b/Fqi+An1BkvmvGskZJWXocOOS4PJ2DrKSKC3RwBYr2ANKTE1Ra+UPl59taxOVjJpnRg2qDtts8gwEJQ==
  • Authentication-results: citrix.com; dkim=none (message not signed) header.d=none;citrix.com; dmarc=none action=none header.from=epam.com;
  • Cc: "Rahul.Singh@xxxxxxx" <Rahul.Singh@xxxxxxx>, "Bertrand.Marquis@xxxxxxx" <Bertrand.Marquis@xxxxxxx>, "julien.grall@xxxxxxx" <julien.grall@xxxxxxx>, "jbeulich@xxxxxxxx" <jbeulich@xxxxxxxx>, "sstabellini@xxxxxxxxxx" <sstabellini@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "iwj@xxxxxxxxxxxxxx" <iwj@xxxxxxxxxxxxxx>, "wl@xxxxxxx" <wl@xxxxxxx>
  • Delivery-date: Wed, 11 Nov 2020 14:43:11 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHWtpb07GsqhunhOkybCrJJI4gm+6nDA7cAgAAA/IA=
  • Thread-topic: [PATCH 03/10] xen/arm: Setup MMIO range trap handlers for hardware domain

On 11/11/20 4:39 PM, Roger Pau Monné wrote:
> On Mon, Nov 09, 2020 at 02:50:24PM +0200, Oleksandr Andrushchenko wrote:
>> From: Oleksandr Andrushchenko <oleksandr_andrushchenko@xxxxxxxx>
>>
>> In order vPCI to work it needs all access to PCI configuration space
>> access to be synchronized among all entities, e.g. hardware domain and
>> guests. For that implement PCI host bridge specific callbacks to
>> propelry setup those ranges depending on host bridge implementation.
>>
>> This callback is optional and may not be used by non-ECAM host bridges.
>>
>> Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@xxxxxxxx>
>> ---
>>   xen/arch/arm/pci/pci-host-common.c  | 16 ++++++++++++++++
>>   xen/arch/arm/pci/pci-host-generic.c | 15 +++++++++++++--
>>   xen/arch/arm/vpci.c                 | 16 +++++++++++++++-
> So this is based on top of another series, maybe it would make sense
> to post those together, or else it's hard to get the right context.

This is based on ARM's PCI passthrough RFC series [1]

You can also see the whole picture at [2]

>
>>   xen/include/asm-arm/pci.h           |  7 +++++++
>>   4 files changed, 51 insertions(+), 3 deletions(-)
>>
>> diff --git a/xen/arch/arm/pci/pci-host-common.c 
>> b/xen/arch/arm/pci/pci-host-common.c
>> index b011c7eff3c8..b81184d34980 100644
>> --- a/xen/arch/arm/pci/pci-host-common.c
>> +++ b/xen/arch/arm/pci/pci-host-common.c
>> @@ -219,6 +219,22 @@ struct device *pci_find_host_bridge_device(struct 
>> device *dev)
>>       }
>>       return dt_to_dev(bridge->dt_node);
>>   }
>> +
>> +int pci_host_iterate_bridges(struct domain *d,
>> +                             int (*clb)(struct domain *d,
>> +                                        struct pci_host_bridge *bridge))
>> +{
>> +    struct pci_host_bridge *bridge;
>> +    int err;
>> +
>> +    list_for_each_entry( bridge, &pci_host_bridges, node )
>> +    {
>> +        err = clb(d, bridge);
>> +        if ( err )
>> +            return err;
>> +    }
>> +    return 0;
>> +}
>>   /*
>>    * Local variables:
>>    * mode: C
>> diff --git a/xen/arch/arm/pci/pci-host-generic.c 
>> b/xen/arch/arm/pci/pci-host-generic.c
>> index 54dd123e95c7..469df3da0116 100644
>> --- a/xen/arch/arm/pci/pci-host-generic.c
>> +++ b/xen/arch/arm/pci/pci-host-generic.c
>> @@ -85,12 +85,23 @@ int pci_ecam_config_read(struct pci_host_bridge *bridge, 
>> uint32_t sbdf,
>>       return 0;
>>   }
>>   
>> +static int pci_ecam_register_mmio_handler(struct domain *d,
>> +                                          struct pci_host_bridge *bridge,
> I think you can also constify bridge here.
Makes sense
>
> Thanks, Roger.

Thank you,

Oleksandr

[1] https://www.mail-archive.com/xen-devel@xxxxxxxxxxxxxxxxxxxx/msg84452.html

[2] https://github.com/andr2000/xen/tree/vpci_rfc

 


Rackspace

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