All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Rosato <mjrosato@linux.ibm.com>
To: Farhan Ali <alifm@linux.ibm.com>,
	Konstantin Shkolnyy <kshk@linux.ibm.com>
Cc: farman@linux.ibm.com, richard.henderson@linaro.org,
	iii@linux.ibm.com, david@kernel.org, cohuck@redhat.com,
	pasic@linux.ibm.com, borntraeger@linux.ibm.com,
	qemu-s390x@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [PATCH v8 01/16] s390x/pci: implement IOMMU replay
Date: Wed, 16 Sep 2026 15:05:58 -0400	[thread overview]
Message-ID: <3687f02c-a0fb-4801-9b45-e32bc87dd248@linux.ibm.com> (raw)
In-Reply-To: <2c2bf867-a11a-4591-88bf-bf38d114d364@linux.ibm.com>


>> +                    pbdev->state = ZPCI_FS_ERROR;
>> +                    s390_pci_generate_error_event(ERR_EVENT_PERMERR,
>> pbdev->fh,
>> +                                                  pbdev->fid, 0, 0);
> 
> A permanent error will indicate to the guest that PCI device in
> unusable, in that case would the guest drive a device re-initialization?
> Would it be better to generate a ERR_EVENT_SERVAC to allow the guest to
> attempt recovery and so drive the mappings again?
> 
The problem is that if we hit this scenario, we've exhausted the vfio
DMA limit for the device, so there is no way to create more mappings
without freeing some other ones up.
In the case of a RPCIT, we can ask the guest to try and free up all
stale/invalidated mappings to make room, but in this case
1) we have no mechanism to ask the guest to do that
2) we are in the middle replaying only the valid mappings, so there are
no invalid mappings to flush anyway -- so we're really in a permanent
error case here -- the number of vfio-allowed concurrent DMA mappings is
less than what our IOMMU wishes to replay.  AFAICT this can only get
solved by forcing the guest to throw everything out and start over.

I think in reality, you would only hit this in a migration scenario with
a vfio-pci device (which we don't support with this series) where the
vfio DMA limit is lower on the target than it was on the host.
If you hit this doing IOMMU replay of a vfio-pci device without a
migration involved then the limit should be the same as it was before
replay and it should have been impossible to map more than the vfio DMA
limit (so if you managed it, a permanent error also seems reasonable
because there may be a deeper issue).

Would an 0x3a trigger a total wipe of the IOMMU contents that we were
trying to replay?  If yes, it might be something to consider if/when we
support vfio-pci migration but I'm not sure it makes sense under the
current scenario(s) where we should never hit this path.

Thanks,
Matt


  reply	other threads:[~2026-09-16 19:06 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-11 15:21 [PATCH v8 00/16] s390x/pci: Implement migration for emulated devices Konstantin Shkolnyy
2026-09-11 15:21 ` [PATCH v8 01/16] s390x/pci: implement IOMMU replay Konstantin Shkolnyy
2026-09-16 18:44   ` Farhan Ali
2026-09-16 19:05     ` Matthew Rosato [this message]
2026-09-16 19:17       ` Farhan Ali
2026-09-11 15:21 ` [PATCH v8 02/16] s390x/pci: Create function to contain translation status check Konstantin Shkolnyy
2026-09-11 15:21 ` [PATCH v8 03/16] s390x/pci: Move iommu_mr from S390PCIIOMMU to S390PCIBusDevice Konstantin Shkolnyy
2026-09-11 15:21 ` [PATCH v8 04/16] s390x/pci: Move dm_mr " Konstantin Shkolnyy
2026-09-11 15:21 ` [PATCH v8 05/16] s390x/pci: Move iotlb " Konstantin Shkolnyy
2026-09-11 15:21 ` [PATCH v8 06/16] s390x/pci: Remove a ptr to S390PCIBusDevice from S390PCIIOMMU Konstantin Shkolnyy
2026-09-11 15:21 ` [PATCH v8 07/16] s390x/pci: Move/rename enabled from S390PCIIOMMU to S390PCIBusDevice Konstantin Shkolnyy
2026-09-11 15:21 ` [PATCH v8 08/16] s390x/pci: Move dma_limit " Konstantin Shkolnyy
2026-09-11 15:21 ` [PATCH v8 09/16] s390x/pci: Move g_iota " Konstantin Shkolnyy
2026-09-11 15:21 ` [PATCH v8 10/16] s390x/pci: Move pba " Konstantin Shkolnyy
2026-09-11 15:21 ` [PATCH v8 11/16] s390x/pci: Move pal " Konstantin Shkolnyy
2026-09-11 15:21 ` [PATCH v8 12/16] s390x/pci: Move max_dma_limit " Konstantin Shkolnyy
2026-09-11 15:21 ` [PATCH v8 13/16] s390x/pci: Add a comment explaining S390PCIIOMMU purpose Konstantin Shkolnyy
2026-09-11 15:21 ` [PATCH v8 14/16] s390x/pci: Factor ioat sanity checks into a separate function Konstantin Shkolnyy
2026-09-16 18:53   ` Farhan Ali
2026-09-11 15:21 ` [PATCH v8 15/16] s390x/pci: Implement migration for emulated devices Konstantin Shkolnyy
2026-09-17 17:25   ` Farhan Ali
2026-09-17 17:35     ` Daniel P. Berrangé
2026-09-21 15:12       ` Konstantin Shkolnyy
2026-09-21 15:19         ` Daniel P. Berrangé
2026-09-21 16:53           ` Farhan Ali
2026-09-11 15:21 ` [PATCH v8 16/16] s390x/pci: Create function to contain fmb_timer start Konstantin Shkolnyy

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=3687f02c-a0fb-4801-9b45-e32bc87dd248@linux.ibm.com \
    --to=mjrosato@linux.ibm.com \
    --cc=alifm@linux.ibm.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=david@kernel.org \
    --cc=farman@linux.ibm.com \
    --cc=iii@linux.ibm.com \
    --cc=kshk@linux.ibm.com \
    --cc=pasic@linux.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=richard.henderson@linaro.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.