All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Matthew Rosato <mjrosato@linux.ibm.com>
Cc: Alexander Gordeev <agordeev@linux.ibm.com>,
	Alex Williamson <alex.williamson@redhat.com>,
	Lu Baolu <baolu.lu@linux.intel.com>,
	Christian Borntraeger <borntraeger@linux.ibm.com>,
	Cornelia Huck <cohuck@redhat.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Gerald Schaefer <gerald.schaefer@linux.ibm.com>,
	Vasily Gorbik <gor@linux.ibm.com>,
	Heiko Carstens <hca@linux.ibm.com>,
	iommu@lists.linux.dev, Joerg Roedel <joro@8bytes.org>,
	Kevin Tian <kevin.tian@intel.com>,
	kvm@vger.kernel.org, linux-s390@vger.kernel.org,
	Marc Zyngier <maz@kernel.org>,
	Robin Murphy <robin.murphy@arm.com>,
	Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
	Sven Schnelle <svens@linux.ibm.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Will Deacon <will@kernel.org>,
	Niklas Schnelle <schnelle@linux.ibm.com>,
	Gerd Bayer <gbayer@linux.ibm.com>,
	Bharat Bhushan <bharat.bhushan@nxp.com>,
	Eric Auger <eric.auger@redhat.com>,
	Eric Farman <farman@linux.ibm.com>,
	Marc Zyngier <marc.zyngier@arm.com>,
	Tomasz Nowicki <tomasz.nowicki@caviumnetworks.com>,
	Will Deacon <will.deacon@arm.com>
Subject: Re: [PATCH iommufd 0/9] Remove IOMMU_CAP_INTR_REMAP
Date: Thu, 8 Dec 2022 20:42:06 -0400	[thread overview]
Message-ID: <Y5KEXpg356wO0dqk@nvidia.com> (raw)
In-Reply-To: <31af8174-35e9-ebeb-b9ef-74c90d4bfd93@linux.ibm.com>

On Thu, Dec 08, 2022 at 06:37:42PM -0500, Matthew Rosato wrote:
> On 12/8/22 3:26 PM, Jason Gunthorpe wrote:
> 
> >  - S390 has unconditionally claimed it has secure MSI through the iommu
> >    driver. I'm not sure how it works, or if it even does. Perhaps
> >    zpci_set_airq() pushes the "zdev->gias" to the hypervisor which
> >    limits a device's MSI to only certain KVM contexts (though if true
> >    this would be considered insecure by VFIO)
> > 
> 
> There are a few layers here.  Interrupt isolation and mapping on
> s390 is accomplished via a mapping table used by a layer of firmware
> (and can be shared by a hypervisor e.g. qemu/kvm) that sits between
> the device and the kernel/driver (s390 linux always runs on at least
> this 'bare-metal hypervisor' firmware layer).  Indeed the initial
> relationship is established via zpci_set_airq -- the "zdev->fh"
> identifies the device, the "zdev->gisa" (if applicable) identifies
> the single KVM context that is eligible to receive interrupts
> related to the specified device as well as the single KVM context
> allowed to access the device via any zPCI instructions (e.g. config
> space access).  The aibv/noi indicate the vector mappings that are
> authorized for that device; firmware will typically route the
> interrupts to the guest without hypervisor involvement once this is
> established, but the table is shared by the hypervisor so that it
> can be tapped to complete delivery when necessary.  This
> registration process enables a firmware intermediary that will only
> pass along MSI from the device that has an associated,
> previously-authorized vector, associated with either the 'bare-metal
> hypervisor' (gisa = 0) and/or a specific VM (gisa != 0), depending
> what was registered as zpci_set_airq.

I suspected something like this - it technically isn't the same
"secure msi" thing since a VFIO userspace with no KVM can trigger
bogus MSIs against the kernel.

But it has been this way for a long time, let's just document it and
leave it be.

Jason

  reply	other threads:[~2022-12-09  0:42 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-08 20:26 [PATCH iommufd 0/9] Remove IOMMU_CAP_INTR_REMAP Jason Gunthorpe
2022-12-08 20:26 ` [PATCH iommufd 1/9] irq: Add msi_device_has_secure_msi() Jason Gunthorpe
2022-12-09 13:59   ` Marc Zyngier
2022-12-09 14:10     ` Jason Gunthorpe
2022-12-09 14:18       ` Marc Zyngier
2022-12-08 20:26 ` [PATCH iommufd 2/9] vfio/type1: Check that every device supports IOMMU_CAP_INTR_REMAP Jason Gunthorpe
2022-12-08 21:48   ` Alex Williamson
2022-12-09  0:44     ` Jason Gunthorpe
2022-12-09 10:24       ` Robin Murphy
2022-12-08 20:26 ` [PATCH iommufd 3/9] vfio/type1: Convert to msi_device_has_secure_msi() Jason Gunthorpe
2022-12-08 20:26 ` [PATCH iommufd 4/9] iommufd: " Jason Gunthorpe
2022-12-09  6:01   ` Tian, Kevin
2022-12-09 14:47     ` Jason Gunthorpe
2022-12-09 16:44       ` Robin Murphy
2022-12-09 17:38         ` Jason Gunthorpe
2022-12-12 15:17           ` Thomas Gleixner
2022-12-12 15:47             ` Jason Gunthorpe
2022-12-12 16:25               ` Thomas Gleixner
2022-12-08 20:26 ` [PATCH iommufd 5/9] irq: Remove unused irq_domain_check_msi_remap() code Jason Gunthorpe
2022-12-08 20:26 ` [PATCH iommufd 6/9] irq: Rename MSI_REMAP to SECURE_MSI Jason Gunthorpe
2022-12-08 20:26 ` [PATCH iommufd 7/9] iommu/x86: Replace IOMMU_CAP_INTR_REMAP with IRQ_DOMAIN_FLAG_SECURE_MSI Jason Gunthorpe
2022-12-08 20:26 ` [PATCH iommufd 8/9] irq/s390: Add arch_is_secure_msi() for s390 Jason Gunthorpe
2022-12-08 20:26 ` [PATCH iommufd 9/9] iommu: Remove IOMMU_CAP_INTR_REMAP Jason Gunthorpe
2022-12-08 23:37 ` [PATCH iommufd 0/9] " Matthew Rosato
2022-12-09  0:42   ` Jason Gunthorpe [this message]
2022-12-09  5:54 ` Tian, Kevin
2022-12-09 14:38   ` Jason Gunthorpe
2022-12-09 15:21     ` Jason Gunthorpe
2022-12-09 19:57 ` Thomas Gleixner

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=Y5KEXpg356wO0dqk@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=agordeev@linux.ibm.com \
    --cc=alex.williamson@redhat.com \
    --cc=baolu.lu@linux.intel.com \
    --cc=bharat.bhushan@nxp.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=dwmw2@infradead.org \
    --cc=eric.auger@redhat.com \
    --cc=farman@linux.ibm.com \
    --cc=gbayer@linux.ibm.com \
    --cc=gerald.schaefer@linux.ibm.com \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=iommu@lists.linux.dev \
    --cc=joro@8bytes.org \
    --cc=kevin.tian@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=marc.zyngier@arm.com \
    --cc=maz@kernel.org \
    --cc=mjrosato@linux.ibm.com \
    --cc=robin.murphy@arm.com \
    --cc=schnelle@linux.ibm.com \
    --cc=suravee.suthikulpanit@amd.com \
    --cc=svens@linux.ibm.com \
    --cc=tglx@linutronix.de \
    --cc=tomasz.nowicki@caviumnetworks.com \
    --cc=will.deacon@arm.com \
    --cc=will@kernel.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 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.