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

Re: [PATCH] x86/monitor: add option to disable Xen's pagetable walking on events

On 03/01/2021 19:01, Tamas K Lengyel wrote:
> Add option to the monitor interface to disable walking of the guest pagetable
> on certain events. This is a performance optimization for tools that never
> require that information or prefer to do it themselves. For example LibVMI
> maintains a virtual TLB which is faster to lookup then what Xen does here.

There is no plausible way that a remote agent can do this (correctly)
faster than Xen can.  Even if you foreign map the entire VM up front,
and track every PTE write (to maintain the vTLB properly), the best you
can achieve is the same speed as Xen, but that would also require
intercepting the TLB management instructions which isn't available in
the monitor API.

Also, there is an important side effect of setting A/D bits which libVMI
doesn't handle, but is relevant for gla-not-valid faults.

I accept that "not doing things the agent doesn't care about" is a valid
reason, but this isn't the only place where a pagewalk occurs, and some
cases require pagewalks before we can even generate the event (e.g. LMSW
on AMD for CR0 monitoring).

As such, I don't think "disable pagewalks" is something we can actually
do.  Wouldn't it be better to call this "auto translate rip to gfn" or
similar, seeing as it is ancillary information?




Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.