Re: [RFC PATCH] KVM: PPC: Book3S HV: add support for page faults in VM_IO|VM_PFNMAP vmas

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2018-02-12 at 12:01 +0100, Paolo Bonzini wrote:
> On 12/02/2018 11:54, Benjamin Herrenschmidt wrote:
> > On Mon, 2018-02-12 at 11:41 +0100, Paolo Bonzini wrote:
> > > In fact I don't know about PPC but on x86 we actually do
> > > write-protection except on the newest processors that have a dirty page
> > > _log_ in addition to the bits.
> > 
> > Can you explain ? I'm not sure I got what you mean here.
> 
> On recent processors you can get an exit to the hypervisor every time N
> dirty pages are marked dirty, and the processor also keeps a log of
> _which_ pages are marked dirty.  Without the log, you'd have to walk the
> entire radix tree to find the dirty pages, which is so expensive that
> without the log we don't use dirty bits at all.

Oh interesting. How is that log "kept" ? Some kind of HW fifo ? There's
a feature on hash ppc where the CPU can keep an array of dirty bit but
it's still indexed by hash idx so you still have to walk it. What you
describe sounds more like a log which would be more interesting... 

> > > Quite likely since it was stolen from pHyp.
> > > 
> > > The idea is that you tell the guest about _host_ page faults and the
> > > guest starts running some other process.  Then when the host page fault
> > > is resolved, you tell the guest about that as well.  This way host page
> > > faults are resolved without blocking the whole guest.
> > 
> > Not pHyp then, I don't think we have any such thing on PAPR, you are
> > probably thinking about s390 ?
> 
> Yeah, s390 too.  Gleb said AIX on
> https://www.linux-kvm.org/images/a/ac/2010-forum-Async-page-faults.pdf
> but maybe he was wrong.

Maybe you aren't, but if it exists us (Linux) never used it :-) I'll
ask around.

> > How do you tell the guest on x86 ? You synthetize some kind of
> > artificial interrupt ? There's a paravirt stuff for the guest to tell
> > you it knows about it ? Or some other mechanism ?
> 
> Yes, the guest sets aside a communication page, tells us the address
> that it knows about it, and then we start sending the guest "weird" page
> faults that are slightly different from the real thing.  Search for
> MSR_KVM_ASYNC_PF_EN in Documentation/virtual/kvm/msr.txt.

Thanks !

Cheers,
Ben.

> Thanks,
> 
> Paolo
> 
> > For powerpc, we could do something similar fairly easily since we are
> > paravirtualized but I'd like to see how that's plumbed into the exist
> > archs who use it so we don't diverge too much.
> > 
> > Cheers,
> > Ben.
> > 



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux