linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Alexey Kardashevskiy <aik@ozlabs.ru>
To: David Gibson <david@gibson.dropbear.id.au>
Cc: kvm@vger.kernel.org, Alistair Popple <alistair@popple.id.au>,
	linuxppc-dev@lists.ozlabs.org, kvm-ppc@vger.kernel.org,
	Alex Williamson <alex.williamson@redhat.com>,
	Reza Arbab <arbab@linux.ibm.com>
Subject: Re: [PATCH kernel 2/3] vfio_pci: Allow regions to add own capabilities
Date: Thu, 8 Nov 2018 17:48:58 +1100	[thread overview]
Message-ID: <72022e34-6cf0-3946-8049-ba3d998097f3@ozlabs.ru> (raw)
In-Reply-To: <20181108062139.GQ5575@umbus.fritz.box>


[-- Attachment #1.1: Type: text/plain, Size: 2364 bytes --]



On 08/11/2018 17:21, David Gibson wrote:
> On Mon, Oct 15, 2018 at 08:42:32PM +1100, Alexey Kardashevskiy wrote:
>> VFIO regions already support region capabilities with a limited set of
>> fields. However the subdriver might have to report to the userspace
>> additional bits.
>>
>> This adds an add_capability() hook to vfio_pci_regops.
>>
>> This is aiming Witherspoon POWER9 machines which have multiple
>> interconnected NVIDIA V100 GPUs with coherent RAM; each GPU's RAM
>> is mapped to a system bus and to each of GPU internal system bus and
>> the GPUs use this for DMA routing as DMA trafic can go via any
>> of many NVLink2 (GPU-GPU or GPU-CPU) or even stay local within a
>> GPU.
> 
> This description doesn't really make clear how per-region capabilities
> are relevant to these devices.


I am confused. This patch just adds a hook, and the device specifics are
explained in the next patch where they are used...


> 
>>
>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>> ---
>>
>> This is based on top of "vfio_pci: Allow mapping extra regions"
>> ---
>>  drivers/vfio/pci/vfio_pci_private.h | 3 +++
>>  drivers/vfio/pci/vfio_pci.c         | 6 ++++++
>>  2 files changed, 9 insertions(+)
>>
>> diff --git a/drivers/vfio/pci/vfio_pci_private.h b/drivers/vfio/pci/vfio_pci_private.h
>> index 86aab05..93c1738 100644
>> --- a/drivers/vfio/pci/vfio_pci_private.h
>> +++ b/drivers/vfio/pci/vfio_pci_private.h
>> @@ -62,6 +62,9 @@ struct vfio_pci_regops {
>>  	int	(*mmap)(struct vfio_pci_device *vdev,
>>  			struct vfio_pci_region *region,
>>  			struct vm_area_struct *vma);
>> +	int	(*add_capability)(struct vfio_pci_device *vdev,
>> +				  struct vfio_pci_region *region,
>> +				  struct vfio_info_cap *caps);
>>  };
>>  
>>  struct vfio_pci_region {
>> diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c
>> index 7923314..4a3b93e 100644
>> --- a/drivers/vfio/pci/vfio_pci.c
>> +++ b/drivers/vfio/pci/vfio_pci.c
>> @@ -759,6 +759,12 @@ static long vfio_pci_ioctl(void *device_data,
>>  			if (ret)
>>  				return ret;
>>  
>> +			if (vdev->region[i].ops->add_capability) {
>> +				ret = vdev->region[i].ops->add_capability(vdev,
>> +						&vdev->region[i], &caps);
>> +				if (ret)
>> +					return ret;
>> +			}
>>  		}
>>  		}
>>  
> 

-- 
Alexey


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2018-11-08  6:51 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-15  9:42 [PATCH kernel 0/3] vfio/spapr_tce: Reworks for NVIDIA V100 + P9 passthrough (part 3) Alexey Kardashevskiy
2018-10-15  9:42 ` [PATCH kernel 1/3] vfio_pci: Allow mapping extra regions Alexey Kardashevskiy
2018-11-08  6:04   ` David Gibson
2018-10-15  9:42 ` [PATCH kernel 2/3] vfio_pci: Allow regions to add own capabilities Alexey Kardashevskiy
2018-11-08  6:21   ` David Gibson
2018-11-08  6:48     ` Alexey Kardashevskiy [this message]
2018-11-08  7:16       ` David Gibson
2018-10-15  9:42 ` [PATCH kernel 3/3] vfio_pci: Add NVIDIA GV100GL [Tesla V100 SXM2] [10de:1db1] subdriver Alexey Kardashevskiy
2018-10-16 19:08   ` Alex Williamson
2018-10-17  1:19     ` Alexey Kardashevskiy
2018-10-17 21:52       ` Alex Williamson
2018-10-17 23:42         ` Piotr Jaroszyński
2018-10-18  0:31         ` Alexey Kardashevskiy
2018-10-18 16:55           ` Alex Williamson
2018-10-18 17:37             ` Piotr Jaroszynski
2018-10-18 18:05               ` Alex Williamson
2018-10-18 18:40                 ` Piotr Jaroszynski
2018-10-19  6:25                   ` Christoph Hellwig
2018-10-19  0:53                 ` Alexey Kardashevskiy
2018-11-12  1:08                   ` David Gibson
2018-11-12  2:36                     ` Alexey Kardashevskiy
2018-11-12  4:23                       ` David Gibson
2018-11-12  4:56                         ` Alexey Kardashevskiy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=72022e34-6cf0-3946-8049-ba3d998097f3@ozlabs.ru \
    --to=aik@ozlabs.ru \
    --cc=alex.williamson@redhat.com \
    --cc=alistair@popple.id.au \
    --cc=arbab@linux.ibm.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).