Re: [PATCH v2] vfio/pci: Support error recovery
From: Alex Williamson
Date: Thu Jan 19 2017 - 14:27:00 EST
On Thu, 19 Jan 2017 11:04:37 +0800
Cao jin <caoj.fnst@xxxxxxxxxxxxxx> wrote:
> On 01/19/2017 05:32 AM, Alex Williamson wrote:
> > On Tue, 10 Jan 2017 17:11:01 +0200
> > "Michael S. Tsirkin" <mst@xxxxxxxxxx> wrote:
> >
> >> On Tue, Jan 10, 2017 at 07:46:17PM +0800, Cao jin wrote:
> >>>
> >>>
> >>> On 01/10/2017 07:04 AM, Michael S. Tsirkin wrote:
> >>>> On Sat, Dec 31, 2016 at 05:15:36PM +0800, Cao jin wrote:
> >>>>> Support serious device error recovery
> >>>>
> >>>> serious?
> >>>>
> >>>
> >>> Sorry for my poor vocabulary if it confuses people. I wanted to express
> >>> the meaning that: vfio-pci actually cannot do a real recovery for device
> >>> even if it provides the callbacks, it relies on the user to do a
> >>> effective(or word "serious"?) recovery.
> >>>
> >>> Welcome the amendment on the commit log.
> >>
> >> It's up to Alex, maybe he's able to figure it all out from
> >> code, but the rest of us could benefit from a description
> >> of what the patch does from userspace point of view.
> >>
> >> Also, is it a pre-requisite of the userspace patches you posted?
> >
> > This is the same blocking user accesses while the device is in recovery
> > that you thought was ineffective/wrong before. Why do we still need it
> > if QEMU isn't trying to handle fatal errors? If the kernel is doing a
> > reset shouldn't the user consider the device dead? A commit log
> > explaining this is absolutely necessary. Thanks,
> >
> > Alex
> >
>
> Yes, it is the same blocking user access as before, and I did said it is
> not effective as we expected, and I drew the figure to illustrate my
> analysis. I think the blocking is right, maybe just not enough to work
> fine, because it is possible that vfio's blocking is over, while
> hardware reset is not done, results in inaccessible device.
>
> Leave the blocking here is no harm for now, and could be useful in
> future(when we handle fatal error).
If you want this in the kernel, you're going to need to invest the
effort to make it work. I'm not going to put in code that is
ineffective at what it intends to do.
> We don't forward fatal error events to guest, why would guest kernel do
> a reset? Or do you mean some device driver would do hardware reset on
> non-fatal error?
The question is if we're only trying to recover from non-fatal events,
what is the scenario where the user is attempting to access the device
while it's in reset? Do we need to consider the existing notifier to
be a fatal event where access to the device should stop immediately and
add a new notifier for non-fatal events where it's safe for the user to
access the device? Trying to use the eventfd to push status through a
single notifier seems flawed. Thanks,
Alex