All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Williamson <alex.williamson@redhat.com>
To: "Lan, Tianyu" <tianyu.lan@intel.com>
Cc: aik@ozlabs.ru, amit.shah@redhat.com, anthony@codemonkey.ws,
	ard.biesheuvel@linaro.org, blauwirbel@gmail.com,
	cornelia.huck@de.ibm.com, eddie.dong@intel.com,
	nrupal.jani@intel.com, agraf@suse.de, kvm@vger.kernel.org,
	pbonzini@redhat.com, qemu-devel@nongnu.org,
	emil.s.tantilov@intel.com, gerlitz.or@gmail.com,
	donald.c.skidmore@intel.com, mark.d.rustad@intel.com,
	mst@redhat.com, kraxel@redhat.com, lcapitulino@redhat.com,
	quintela@redhat.com
Subject: Re: [RFC PATCH V2 02/10] Qemu/VFIO: Add new VFIO_GET_PCI_CAP_INFO ioctl cmd definition
Date: Thu, 03 Dec 2015 08:26:53 -0700	[thread overview]
Message-ID: <1449156413.15753.153.camel@redhat.com> (raw)
In-Reply-To: <5660000E.8020008@intel.com>

On Thu, 2015-12-03 at 16:40 +0800, Lan, Tianyu wrote:
> On 12/3/2015 6:25 AM, Alex Williamson wrote:
> > I didn't seen a matching kernel patch series for this, but why is the
> > kernel more capable of doing this than userspace is already?
> The following link is the kernel patch.
> http://marc.info/?l=kvm&m=144837328920989&w=2
> 
> > These seem
> > like pointless ioctls, we're creating a purely virtual PCI capability,
> > the kernel doesn't really need to participate in that.
> 
> VFIO kernel driver has pci_config_map which indicates the PCI capability 
> position and length which helps to find free PCI config regs. Qemu side 
> doesn't have such info and can't get the exact table size of PCI 
> capability. If we want to add such support in the Qemu, needs duplicates 
> a lot of code of vfio_pci_configs.c in the Qemu.

That's an internal implementation detail of the kernel, not motivation
for creating a new userspace ABI.  QEMU can recreate this data on its
own.  The kernel is in no more of an authoritative position to determine
capability extents than userspace.

> > Also, why are we
> > restricting ourselves to standard capabilities?
> 
> This version is to check whether it's on the right way and We can extend
> this to pci extended capability later.
> 
> > That's often a crowded
> > space and we can't always know whether an area is free or not based only
> > on it being covered by a capability.  Some capabilities can also appear
> > more than once, so there's context that isn't being passed to the kernel
> > here.  Thanks,
> 
> The region outside of PCI capability are not passed to kernel or used by 
> Qemu for MSI/MSIX . It's possible to use these places for new 
> capability. One concerns is that guest driver may abuse them and quirk 
> of masking some special regs outside of capability maybe helpful.

That's not correct, see kernel commit
a7d1ea1c11b33bda2691f3294b4d735ed635535a.  Gaps between capabilities are
exposed with raw read-write access from the kernel and some drivers and
devices depend on this.  There's also no guarantee that there's a
sufficiently sized gap in conventional space.  Thanks,

Alex


WARNING: multiple messages have this Message-ID (diff)
From: Alex Williamson <alex.williamson@redhat.com>
To: "Lan, Tianyu" <tianyu.lan@intel.com>
Cc: emil.s.tantilov@intel.com, kvm@vger.kernel.org,
	ard.biesheuvel@linaro.org, aik@ozlabs.ru,
	donald.c.skidmore@intel.com, mst@redhat.com,
	eddie.dong@intel.com, agraf@suse.de, quintela@redhat.com,
	qemu-devel@nongnu.org, blauwirbel@gmail.com,
	cornelia.huck@de.ibm.com, nrupal.jani@intel.com,
	kraxel@redhat.com, anthony@codemonkey.ws, amit.shah@redhat.com,
	pbonzini@redhat.com, mark.d.rustad@intel.com,
	lcapitulino@redhat.com, gerlitz.or@gmail.com
Subject: Re: [Qemu-devel] [RFC PATCH V2 02/10] Qemu/VFIO: Add new VFIO_GET_PCI_CAP_INFO ioctl cmd definition
Date: Thu, 03 Dec 2015 08:26:53 -0700	[thread overview]
Message-ID: <1449156413.15753.153.camel@redhat.com> (raw)
In-Reply-To: <5660000E.8020008@intel.com>

On Thu, 2015-12-03 at 16:40 +0800, Lan, Tianyu wrote:
> On 12/3/2015 6:25 AM, Alex Williamson wrote:
> > I didn't seen a matching kernel patch series for this, but why is the
> > kernel more capable of doing this than userspace is already?
> The following link is the kernel patch.
> http://marc.info/?l=kvm&m=144837328920989&w=2
> 
> > These seem
> > like pointless ioctls, we're creating a purely virtual PCI capability,
> > the kernel doesn't really need to participate in that.
> 
> VFIO kernel driver has pci_config_map which indicates the PCI capability 
> position and length which helps to find free PCI config regs. Qemu side 
> doesn't have such info and can't get the exact table size of PCI 
> capability. If we want to add such support in the Qemu, needs duplicates 
> a lot of code of vfio_pci_configs.c in the Qemu.

That's an internal implementation detail of the kernel, not motivation
for creating a new userspace ABI.  QEMU can recreate this data on its
own.  The kernel is in no more of an authoritative position to determine
capability extents than userspace.

> > Also, why are we
> > restricting ourselves to standard capabilities?
> 
> This version is to check whether it's on the right way and We can extend
> this to pci extended capability later.
> 
> > That's often a crowded
> > space and we can't always know whether an area is free or not based only
> > on it being covered by a capability.  Some capabilities can also appear
> > more than once, so there's context that isn't being passed to the kernel
> > here.  Thanks,
> 
> The region outside of PCI capability are not passed to kernel or used by 
> Qemu for MSI/MSIX . It's possible to use these places for new 
> capability. One concerns is that guest driver may abuse them and quirk 
> of masking some special regs outside of capability maybe helpful.

That's not correct, see kernel commit
a7d1ea1c11b33bda2691f3294b4d735ed635535a.  Gaps between capabilities are
exposed with raw read-write access from the kernel and some drivers and
devices depend on this.  There's also no guarantee that there's a
sufficiently sized gap in conventional space.  Thanks,

Alex

  reply	other threads:[~2015-12-03 15:26 UTC|newest]

Thread overview: 142+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-24 13:35 [RFC PATCH V2 00/10] Qemu: Add live migration support for SRIOV NIC Lan Tianyu
2015-11-24 13:35 ` [Qemu-devel] " Lan Tianyu
2015-11-24 13:35 ` [RFC PATCH V2 01/10] Qemu/VFIO: Create head file pci.h to share data struct Lan Tianyu
2015-11-24 13:35   ` [Qemu-devel] " Lan Tianyu
2015-11-24 13:35 ` [RFC PATCH V2 02/10] Qemu/VFIO: Add new VFIO_GET_PCI_CAP_INFO ioctl cmd definition Lan Tianyu
2015-11-24 13:35   ` [Qemu-devel] " Lan Tianyu
2015-12-02 22:25   ` Alex Williamson
2015-12-02 22:25     ` [Qemu-devel] " Alex Williamson
2015-12-03  8:40     ` Lan, Tianyu
2015-12-03  8:40       ` [Qemu-devel] " Lan, Tianyu
2015-12-03 15:26       ` Alex Williamson [this message]
2015-12-03 15:26         ` Alex Williamson
2015-11-24 13:35 ` [RFC PATCH V2 03/10] Qemu/VFIO: Rework vfio_std_cap_max_size() function Lan Tianyu
2015-11-24 13:35   ` [Qemu-devel] " Lan Tianyu
2015-11-24 13:35 ` [RFC PATCH V2 04/10] Qemu/VFIO: Add vfio_find_free_cfg_reg() to find free PCI config space regs Lan Tianyu
2015-11-24 13:35   ` [Qemu-devel] " Lan Tianyu
2015-11-24 13:35 ` [RFC PATCH V2 05/10] Qemu/VFIO: Expose PCI config space read/write and msix functions Lan Tianyu
2015-11-24 13:35   ` [Qemu-devel] " Lan Tianyu
2015-11-24 13:35 ` [RFC PATCH V2 06/10] Qemu/PCI: Add macros for faked PCI migration capability Lan Tianyu
2015-11-24 13:35   ` [Qemu-devel] " Lan Tianyu
2015-12-02 22:25   ` Alex Williamson
2015-12-02 22:25     ` [Qemu-devel] " Alex Williamson
2015-12-03  8:57     ` Lan, Tianyu
2015-12-03  8:57       ` [Qemu-devel] " Lan, Tianyu
2015-11-24 13:35 ` [RFC PATCH V2 07/10] Qemu: Add post_load_state() to run after restoring CPU state Lan Tianyu
2015-11-24 13:35   ` [Qemu-devel] " Lan Tianyu
2015-11-24 13:35 ` [RFC PATCH V2 08/10] Qemu: Add save_before_stop callback to run just before stopping VCPU during migration Lan Tianyu
2015-11-24 13:35   ` [Qemu-devel] " Lan Tianyu
2015-11-24 13:35 ` [RFC PATCH V2 09/10] Qemu/VFIO: Add SRIOV VF migration support Lan Tianyu
2015-11-24 13:35   ` [Qemu-devel] " Lan Tianyu
2015-11-24 21:03   ` Michael S. Tsirkin
2015-11-24 21:03     ` [Qemu-devel] " Michael S. Tsirkin
2015-11-25 15:32     ` Lan, Tianyu
2015-11-25 15:32       ` [Qemu-devel] " Lan, Tianyu
2015-11-25 15:44       ` Michael S. Tsirkin
2015-11-25 15:44         ` [Qemu-devel] " Michael S. Tsirkin
2015-12-02 22:25   ` Alex Williamson
2015-12-02 22:25     ` [Qemu-devel] " Alex Williamson
2015-12-03  8:56     ` Lan, Tianyu
2015-12-03  8:56       ` [Qemu-devel] " Lan, Tianyu
2015-11-24 13:35 ` [RFC PATCH V2 10/10] Qemu/VFIO: Misc change for enable migration with VFIO Lan Tianyu
2015-11-24 13:35   ` [Qemu-devel] " Lan Tianyu
2015-11-30  8:01 ` [RFC PATCH V2 00/10] Qemu: Add live migration support for SRIOV NIC Michael S. Tsirkin
2015-11-30  8:01   ` [Qemu-devel] " Michael S. Tsirkin
2015-12-01  6:26   ` Lan, Tianyu
2015-12-01  6:26     ` [Qemu-devel] " Lan, Tianyu
2015-12-01 15:02     ` Michael S. Tsirkin
2015-12-01 15:02       ` [Qemu-devel] " Michael S. Tsirkin
2015-12-02 14:08       ` Lan, Tianyu
2015-12-02 14:08         ` [Qemu-devel] " Lan, Tianyu
2015-12-02 14:31         ` Michael S. Tsirkin
2015-12-02 14:31           ` [Qemu-devel] " Michael S. Tsirkin
2015-12-03 14:53           ` Lan, Tianyu
2015-12-03 14:53             ` [Qemu-devel] " Lan, Tianyu
2015-12-04  6:42           ` Lan, Tianyu
2015-12-04  6:42             ` [Qemu-devel] " Lan, Tianyu
2015-12-04  8:05             ` Michael S. Tsirkin
2015-12-04  8:05               ` [Qemu-devel] " Michael S. Tsirkin
2015-12-04 12:11               ` Lan, Tianyu
2015-12-04 12:11                 ` [Qemu-devel] " Lan, Tianyu
2015-12-03 18:32         ` Alexander Duyck
2015-12-03 18:32           ` [Qemu-devel] " Alexander Duyck
2015-12-07 16:50 ` live migration vs device assignment (was Re: [RFC PATCH V2 00/10] Qemu: Add live migration support for SRIOV NIC) Michael S. Tsirkin
2015-12-07 16:50   ` [Qemu-devel] " Michael S. Tsirkin
2015-12-09 16:26   ` live migration vs device assignment (motivation) Lan, Tianyu
2015-12-09 16:26     ` [Qemu-devel] " Lan, Tianyu
2015-12-09 17:14     ` Alexander Duyck
2015-12-09 17:14       ` [Qemu-devel] " Alexander Duyck
2015-12-10  3:15       ` Lan, Tianyu
2015-12-10  3:15         ` [Qemu-devel] " Lan, Tianyu
2015-12-09 20:07     ` Michael S. Tsirkin
2015-12-09 20:07       ` [Qemu-devel] " Michael S. Tsirkin
2015-12-10  3:04       ` Lan, Tianyu
2015-12-10  3:04         ` [Qemu-devel] " Lan, Tianyu
2015-12-10  8:38         ` Michael S. Tsirkin
2015-12-10  8:38           ` [Qemu-devel] " Michael S. Tsirkin
2015-12-10 14:23           ` Lan, Tianyu
2015-12-10 14:23             ` [Qemu-devel] " Lan, Tianyu
2015-12-10 10:18     ` Dr. David Alan Gilbert
2015-12-10 10:18       ` Dr. David Alan Gilbert
2015-12-10 11:28       ` Yang Zhang
2015-12-10 11:28         ` Yang Zhang
2015-12-10 11:41         ` Dr. David Alan Gilbert
2015-12-10 11:41           ` Dr. David Alan Gilbert
2015-12-10 13:07           ` Yang Zhang
2015-12-10 13:07             ` Yang Zhang
2015-12-10 14:38           ` Lan, Tianyu
2015-12-10 14:38             ` [Qemu-devel] " Lan, Tianyu
2015-12-10 16:11             ` Michael S. Tsirkin
2015-12-10 16:11               ` Michael S. Tsirkin
2015-12-10 19:17               ` Alexander Duyck
2015-12-10 19:17                 ` Alexander Duyck
2015-12-11  7:32               ` Lan, Tianyu
2015-12-11  7:32                 ` Lan, Tianyu
2015-12-14  9:12                 ` Michael S. Tsirkin
2015-12-14  9:12                   ` Michael S. Tsirkin
2015-12-10 16:23             ` Dr. David Alan Gilbert
2015-12-10 16:23               ` Dr. David Alan Gilbert
2015-12-10 17:16             ` Alexander Duyck
2015-12-10 17:16               ` Alexander Duyck
2015-12-13 15:47               ` Lan, Tianyu
2015-12-13 15:47                 ` Lan, Tianyu
2015-12-13 19:30                 ` Alexander Duyck
2015-12-13 19:30                   ` Alexander Duyck
2015-12-25  7:03                   ` Lan Tianyu
2015-12-25  7:03                     ` [Qemu-devel] " Lan Tianyu
2015-12-25 12:11                     ` Michael S. Tsirkin
2015-12-25 12:11                       ` Michael S. Tsirkin
2015-12-28 17:42                       ` Lan, Tianyu
2015-12-28 17:42                         ` Lan, Tianyu
2015-12-29 16:46                         ` Michael S. Tsirkin
2015-12-29 16:46                           ` Michael S. Tsirkin
2015-12-29 17:04                           ` Alexander Duyck
2015-12-29 17:04                             ` Alexander Duyck
2015-12-29 17:15                             ` Michael S. Tsirkin
2015-12-29 17:15                               ` [Qemu-devel] " Michael S. Tsirkin
2015-12-29 18:04                               ` Alexander Duyck
2015-12-29 18:04                                 ` Alexander Duyck
2016-01-04  2:15                           ` Lan Tianyu
2016-01-04  2:15                             ` Lan Tianyu
2015-12-25 22:31                     ` Alexander Duyck
2015-12-25 22:31                       ` Alexander Duyck
2015-12-27  9:21                       ` Michael S. Tsirkin
2015-12-27  9:21                         ` [Qemu-devel] " Michael S. Tsirkin
2015-12-27 21:45                         ` Alexander Duyck
2015-12-27 21:45                           ` Alexander Duyck
2015-12-28  8:51                           ` Michael S. Tsirkin
2015-12-28  8:51                             ` Michael S. Tsirkin
2015-12-28  3:20                       ` Dong, Eddie
2015-12-28  3:20                         ` Dong, Eddie
2015-12-28  4:26                         ` Alexander Duyck
2015-12-28  4:26                           ` [Qemu-devel] " Alexander Duyck
2015-12-28 11:50                         ` Michael S. Tsirkin
2015-12-28 11:50                           ` Michael S. Tsirkin
2015-12-14  9:26                 ` Michael S. Tsirkin
2015-12-14  9:26                   ` Michael S. Tsirkin
2015-12-28  8:52                   ` Pavel Fedin
2015-12-28  8:52                     ` Pavel Fedin
2015-12-28 11:51                     ` Michael S. Tsirkin
2015-12-28 11:51                       ` Michael S. Tsirkin
2016-03-17  9:15 ` [Qemu-devel] [RFC PATCH V2 00/10] Qemu: Add live migration support for SRIOV NIC Wei Yang
2016-03-17  9:15   ` Wei Yang

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=1449156413.15753.153.camel@redhat.com \
    --to=alex.williamson@redhat.com \
    --cc=agraf@suse.de \
    --cc=aik@ozlabs.ru \
    --cc=amit.shah@redhat.com \
    --cc=anthony@codemonkey.ws \
    --cc=ard.biesheuvel@linaro.org \
    --cc=blauwirbel@gmail.com \
    --cc=cornelia.huck@de.ibm.com \
    --cc=donald.c.skidmore@intel.com \
    --cc=eddie.dong@intel.com \
    --cc=emil.s.tantilov@intel.com \
    --cc=gerlitz.or@gmail.com \
    --cc=kraxel@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=lcapitulino@redhat.com \
    --cc=mark.d.rustad@intel.com \
    --cc=mst@redhat.com \
    --cc=nrupal.jani@intel.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=tianyu.lan@intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.