[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v5 13/14] xen/arm: account IO handlers for emulated PCI MSI-X
- To: Oleksandr Andrushchenko <andr2000@xxxxxxxxx>
- From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
- Date: Thu, 13 Jan 2022 14:23:30 +0100
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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=Pg1KiyCtYZ3j9EP/NndpzS4A3u+bekw8YCtTpGo4U/4=; b=M+TGQA9tedo7aLo+wMsjh6Gxj24gLNbiB7RMCeic9ER6HsfbaieEc4N9nq3fZjAZATyFpGGAZ4Sugn1Io8Auff8EgmF4WAZU1LmOCWXfq+sTwtNqLIM7QKIRaTAUqEpdpSLCtgthhrtYSzPqrPBN7qrRVqwwoR2qJZd0doNoXxvvqredLEoxSv7V809tN4fo+qTkpLvEsYC8cdvpdSp4KHjljQRFrOZ1q6qQx1EfzdqZebhWKluP+Hxle/DuIX0vjzapv7xRAJJH6nYHm3KVUSRxBHpW8dbzr8FZv/qipuQMyM2Dz6KEYYvwUdfwh+1gxUufk22wMOu+Br3HxijP2w==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iCz0Nrja1G8k/koOQdoRZrempm5pb2fVVz3A8p54lpVjed3B/UsCiozWooeGvlyz9f2cSdKNoGTk2yfllR93aIRNjP7i5KCWYhyS6A5ycOZxzQ+lfrzj9Ov7Akdcj1fTBAtuK+mUWFfzyWB4HWKZdGiZnqT4gGHTXvyNikdIhDYPbUw3YBZNoQsAY3gUKijN4evw7w8jHZXIKSwT+LV653DeNNKBTmt7jufJ4PwlKRBPUWPb9VAZG0wFMdb0GNsdiXzP74RK5klz7bIMjapG8VCMkDwW90yy8/b8liscE7/Lush4RufS6se2BocwR6saqeYCwIvpP4sHHGtm2Ewp+g==
- Authentication-results: esa2.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
- Cc: <xen-devel@xxxxxxxxxxxxxxxxxxxx>, <julien@xxxxxxx>, <sstabellini@xxxxxxxxxx>, <oleksandr_tyshchenko@xxxxxxxx>, <volodymyr_babchuk@xxxxxxxx>, <Artem_Mygaiev@xxxxxxxx>, <jbeulich@xxxxxxxx>, <andrew.cooper3@xxxxxxxxxx>, <george.dunlap@xxxxxxxxxx>, <paul@xxxxxxx>, <bertrand.marquis@xxxxxxx>, <rahul.singh@xxxxxxx>, Oleksandr Andrushchenko <oleksandr_andrushchenko@xxxxxxxx>
- Delivery-date: Thu, 13 Jan 2022 13:24:04 +0000
- Ironport-data: A9a23:LX/5LaCPLvchxhVW/+nlw5YqxClBgxIJ4kV8jS/XYbTApDtz1DEHm jEaXGDUbP6MYDPyf95wbI+2oUIB7JPTyIM2QQY4rX1jcSlH+JHPbTi7wuYcHM8wwunrFh8PA xA2M4GYRCwMo/u1Si6FatANl1ElvU2zbue6WL6s1hxZH1c+En940Ek7wYbVv6Yz6TSHK1LV0 T/Ni5W31G+Ng1aY5UpNtspvADs21BjDkGtwUm4WPJinj3eH/5UhN7oNJLnZEpfNatI88thW5 Qr05OrREmvxp3/BAz4++1rxWhVirrX6ZWBihpfKMkQLb9crSiEai84G2PQghUh/uTmnlcFL5 +R2lYG8VTokJZ/xv7kBekwNe81+FfUuFL7vJHG+tYqYzlHccmuqyPJrZK00FdRGoKAtWzgIr KFGbmBWBvyAr7veLLaTUO5ji95lNMD2FIgepmth3XfSCvNOrZXrHfybvI4Bg2ZYasZmF+3EN vAedBFUYhmefTNGB10YMc47pbL97pX4W2IB8w/EzUYt2EDL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oeLFkry1SNYS4oACU3Ejku96/TEMa0NvM1HBOW u44T0aX7cKPkGei4q484/Qz3h0zboiMhWX68VEH3GO2KHZuP7Imb0VLZkfvOByCXea7SVOHhcZ tPzABi6TNPIoDW+slsHpzwsUyx7STonvjKQjf5n7fvblY2WIVP1GUbu2I0/5vKj5+XcZ48/sls czmEM7Y/6N4KJRh2fdJdg4kZ
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Thu, Nov 25, 2021 at 01:02:50PM +0200, Oleksandr Andrushchenko wrote:
> From: Oleksandr Andrushchenko <oleksandr_andrushchenko@xxxxxxxx>
>
> At the moment, we always allocate an extra 16 slots for IO handlers
> (see MAX_IO_HANDLER). So while adding IO trap handlers for the emulated
> MSI-X registers we need to explicitly tell that we have additional IO
> handlers, so those are accounted.
>
> Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@xxxxxxxx>
LGTM, just one comment below. This will require an Ack from the Arm
guys.
> ---
> Cc: Julien Grall <julien@xxxxxxx>
> Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>
> ---
> This actually moved here from the part 2 of the prep work for PCI
> passthrough on Arm as it seems to be the proper place for it.
>
> New in v5
> ---
> xen/arch/arm/vpci.c | 15 ++++++++++++++-
> 1 file changed, 14 insertions(+), 1 deletion(-)
>
> diff --git a/xen/arch/arm/vpci.c b/xen/arch/arm/vpci.c
> index 3d134f42d07e..902f8491e030 100644
> --- a/xen/arch/arm/vpci.c
> +++ b/xen/arch/arm/vpci.c
> @@ -134,6 +134,8 @@ static int vpci_get_num_handlers_cb(struct domain *d,
>
> unsigned int domain_vpci_get_num_mmio_handlers(struct domain *d)
> {
> + unsigned int count;
> +
> if ( !has_vpci(d) )
> return 0;
>
> @@ -145,7 +147,18 @@ unsigned int domain_vpci_get_num_mmio_handlers(struct
> domain *d)
> }
>
> /* For a single emulated host bridge's configuration space. */
> - return 1;
> + count = 1;
> +
> +#ifdef CONFIG_HAS_PCI_MSI
> + /*
> + * There's a single MSI-X MMIO handler that deals with both PBA
> + * and MSI-X tables per each PCI device being passed through.
> + * Maximum number of emulated virtual devices is VPCI_MAX_VIRT_DEV.
> + */
> + count += VPCI_MAX_VIRT_DEV;
You could also use IS_ENABLED(CONFIG_HAS_PCI_MSI) since
VPCI_MAX_VIRT_DEV is defined unconditionally.
Thanks, Roger.
|