Re: [PATCH RFC 1/6] Revert "KVM: async_pf: Fix #DF due to inject "Page not Present" and "Page Ready" exceptions simultaneously"
From: Vivek Goyal
Date: Mon May 11 2020 - 15:17:28 EST
On Wed, May 06, 2020 at 05:17:57PM +0200, Vitaly Kuznetsov wrote:
[..]
> >
> > So either we need a way to report errors back while doing synchrounous
> > page faults or we can't fall back to synchorounous page faults while
> > async page faults are enabled.
> >
> > While we are reworking async page mechanism, want to make sure that
> > error reporting part has been taken care of as part of design. Don't
> > want to be dealing with it after the fact.
>
> The main issue I'm seeing here is that we'll need to deliver these
> errors 'right now' and not some time later. Generally, exceptions
> (e.g. #VE) should work but there are some corner cases, I remember Paolo
> and Andy discussing these (just hoping they'll jump in with their
> conclusions :-). If we somehow manage to exclude interrupts-disabled
> context from our scope we should be good, I don't see reasons to skip
> delivering #VE there.
Hi Vitaly,
If we can't find a good solution for interrupt disabled regions, then
I guess I will live with error reporting with interrupts enabled only
for now. It should solve a class of problems. Once users show up which
need error handling with interrupts disabled, then we will need to
solve it.
>
> For the part this series touches, "page ready" notifications, we don't
> skip them but at the same time there is no timely delivery guarantee, we
> just queue an interrupt. I'm not sure you'll need these for virtio-fs
> though.
I think virtiofs will need both (synchronous as well as asynchrous
error reporting).
- If we can deliver async pf to guest, then we will send "page not present"
to guest and try to fault in the page. If we figure out that page can't be
faulted in, then we can send "page fault error" notification using interrupt
(as you are doing for "page ready").
- If async page fault can't be injected in guest and we fall back to
synchronous fault, and we figure out that fault can't be completed,
we need to inject error using #VE (or some exception).
Thanks
Vivek
>
> Thanks for the feedback!
>
> --
> Vitaly
>