Re: [PATCH v3 6/9] vfio/pci: Clean up BAR zap and revocation
From: Jason Gunthorpe
Date: Wed Jun 17 2026 - 08:21:49 EST
On Wed, Jun 17, 2026 at 06:22:59AM +0000, Tian, Kevin wrote:
> > > > I'm wondering if this change in behavior is correct?
> > > > BEFORE this patch the sequence was:
> > > >
> > > > 1. zap vma mappings
> > > > 2. Enter D0
> > > >
> > > > After this patch the sequence becomes
> > > >
> > > > 1. Take the lock
> > > > 2. Enter D0
> > > > 3. zap vma mappings
> > > >
> > > > My worry is if user-space accesses a BAR *during* the transition to D0,
> > > > it could crash since the mappings still exist during the transition?
> > >
> > > not 'crash' as you also noted later with all Fs on read and dropped writes.
> >
> > Ack, "crash" is definitely a strong word, I just meant that the
> > user-space program isn't expecting to see all Fs today. Since today any
> > access during reset is faulted, however with this all apps may have to
> > lookout for all Fs during a read. Could this change cause existing apps
> > to crash?
I don't think that order should be changed, you might get an AER on
access in D0 too..
The purpose of all this zappery is to only allow access while the
device is fully operating normally.
Jason