Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1393111

Re: [PATCH 5/5] vfio-pci: Allow to mmap MSI-X table if interrupt remapping is supported

From Yongji Xie <xyjxie@linux.vnet.ibm.com>
Newsgroups linux.kernel
Subject Re: [PATCH 5/5] vfio-pci: Allow to mmap MSI-X table if interrupt remapping is supported
Date 2016-05-03 09:40 +0200
Message-ID <ruD61-3HL-9@gated-at.bofh.it> (permalink)
References <rsx4J-1jL-15@gated-at.bofh.it> <rsx4K-1jL-55@gated-at.bofh.it> <ruBdU-1Vt-13@gated-at.bofh.it> <ruBGX-2wf-13@gated-at.bofh.it> <ruC0i-2Qz-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 2016/5/3 14:22, Tian, Kevin wrote:

>> From: Yongji Xie [mailto:xyjxie@linux.vnet.ibm.com]
>> Sent: Tuesday, May 03, 2016 2:08 PM
>>
>> On 2016/5/3 13:34, Tian, Kevin wrote:
>>
>>>> From: Yongji Xie
>>>> Sent: Wednesday, April 27, 2016 8:43 PM
>>>>
>>>> This patch enables mmapping MSI-X tables if hardware supports
>>>> interrupt remapping which can ensure that a given pci device
>>>> can only shoot the MSIs assigned for it.
>>>>
>>>> With MSI-X table mmapped, we also need to expose the
>>>> read/write interface which will be used to access MSI-X table.
>>>>
>>>> Signed-off-by: Yongji Xie <xyjxie@linux.vnet.ibm.com>
>>> A curious question here. Does "allow to mmap MSI-X" essentially
>>> mean that KVM guest can directly read/write physical MSI-X
>>> structure then?
>>>
>>> Thanks
>>> Kevin
>>>
>> Here we just allow to mmap MSI-X table in kernel. It doesn't
>> mean all KVM guest can directly read/write physical MSI-X
>> structure. This should be decided by QEMU. For PPC64
>> platform, we would allow to passthrough the MSI-X table
>> because we know guest kernel would not write physical
>> MSI-X structure when enabling MSI.
>>
> A bit confused here. If guest kernel doesn't need to write
> physical MSI-X structure, what's the point of passing through
> the table then?

We want to allow the MSI-X table because there may be
some critical registers in the same page as the MSI-X table.
We have to handle the mmio access to these register in QEMU
rather than in guest if mmapping MSI-X table is disallowed.

> I think the key whether MSI-X table can be passed through
> is related to where hypervisor control is deployed. At least
> for x86:
>
> - When irq remapping is not enabled, host/hypervisor needs
> to control physical interrupt message including vector/dest/etc.
> directly in MSI-X structure, so we cannot allow a guest to
> access it;
>
> - when irq remapping is enabled, host/hypervisor can control
> interrupt routing in irq remapping table. However MSI-X
> also needs to be configured as remappable format. In this
> manner we also cannot allow direct access from guest.
>
> The only sane case to pass through MSI-X structure, is a
> mechanism similar to irq remapping but w/o need to change
> original MSI-X format so direct access from guest side is
> safe. Is it the case in PPC64?
>
> Thanks
> Kevin

Acutually, we are not aimed at accessing MSI-X table from
guest. So I think it's safe to passthrough MSI-X table if we
can make sure guest kernel would not touch MSI-X table in
normal code path such as para-virtualized guest kernel on PPC64.

Thanks,
Yongji

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

RE: [PATCH 5/5] vfio-pci: Allow to mmap MSI-X table if interrupt  remapping is supported "Tian, Kevin" <kevin.tian@intel.com> - 2016-05-03 07:40 +0200
  Re: [PATCH 5/5] vfio-pci: Allow to mmap MSI-X table if interrupt  remapping is supported Yongji Xie <xyjxie@linux.vnet.ibm.com> - 2016-05-03 08:10 +0200
    RE: [PATCH 5/5] vfio-pci: Allow to mmap MSI-X table if interrupt  remapping is supported "Tian, Kevin" <kevin.tian@intel.com> - 2016-05-03 08:30 +0200
      Re: [PATCH 5/5] vfio-pci: Allow to mmap MSI-X table if interrupt  remapping is supported Yongji Xie <xyjxie@linux.vnet.ibm.com> - 2016-05-03 09:40 +0200
        RE: [PATCH 5/5] vfio-pci: Allow to mmap MSI-X table if interrupt  remapping is supported "Tian, Kevin" <kevin.tian@intel.com> - 2016-05-05 11:40 +0200
          RE: [PATCH 5/5] vfio-pci: Allow to mmap MSI-X table if interrupt  remapping is supported David Laight <David.Laight@ACULAB.COM> - 2016-05-05 12:00 +0200
            Re: [PATCH 5/5] vfio-pci: Allow to mmap MSI-X table if interrupt  remapping is supported Yongji Xie <xyjxie@linux.vnet.ibm.com> - 2016-05-05 13:50 +0200
              RE: [PATCH 5/5] vfio-pci: Allow to mmap MSI-X table if interrupt  remapping is supported "Tian, Kevin" <kevin.tian@intel.com> - 2016-05-05 14:20 +0200
                Re: [PATCH 5/5] vfio-pci: Allow to mmap MSI-X table if interrupt  remapping is supported Yongji Xie <xyjxie@linux.vnet.ibm.com> - 2016-05-05 15:30 +0200
                Re: [PATCH 5/5] vfio-pci: Allow to mmap MSI-X table if interrupt  remapping is supported Alex Williamson <alex.williamson@redhat.com> - 2016-05-05 17:10 +0200
                Re: [PATCH 5/5] vfio-pci: Allow to mmap MSI-X table if interrupt  remapping is supported Alexey Kardashevskiy <aik@ozlabs.ru> - 2016-05-06 08:40 +0200
                Re: [PATCH 5/5] vfio-pci: Allow to mmap MSI-X table if interrupt  remapping is supported Alex Williamson <alex.williamson@redhat.com> - 2016-05-06 19:00 +0200
                RE: [PATCH 5/5] vfio-pci: Allow to mmap MSI-X table if interrupt  remapping is supported "Tian, Kevin" <kevin.tian@intel.com> - 2016-05-11 08:30 +0200
                Re: [PATCH 5/5] vfio-pci: Allow to mmap MSI-X table if interrupt  remapping is supported Alex Williamson <alex.williamson@redhat.com> - 2016-05-11 18:00 +0200
                RE: [PATCH 5/5] vfio-pci: Allow to mmap MSI-X table if interrupt  remapping is supported "Tian, Kevin" <kevin.tian@intel.com> - 2016-05-12 03:30 +0200
                Re: [PATCH 5/5] vfio-pci: Allow to mmap MSI-X table if interrupt  remapping is supported Alex Williamson <alex.williamson@redhat.com> - 2016-05-12 04:30 +0200
                RE: [PATCH 5/5] vfio-pci: Allow to mmap MSI-X table if interrupt  remapping is supported "Tian, Kevin" <kevin.tian@intel.com> - 2016-05-12 07:00 +0200
          Re: [PATCH 5/5] vfio-pci: Allow to mmap MSI-X table if interrupt  remapping is supported Yongji Xie <xyjxie@linux.vnet.ibm.com> - 2016-05-05 13:50 +0200

csiph-web