Re: performance with guests running 2.4 kernels (specifically RHEL3)

Avi Kivity
2008-04-26T06:43:05Z

David S. Ahern wrote:
> What is the rip (GUEST_RIP) value in the VMEXIT trace output? Is that the
> current instruction pointer for the guest?
>
>

Yes.

> I take it the virt in the PAGE_FAULT trace output is the virtual address the
> guest was referencing when the page fault occurred. What I don't understand (one
> of many things really) is what the 0xfffb63b0 corresponds to in the guest. Any
> ideas?
>
>

I'm pretty sure it is the kmap_atomic() pte. The guest wants to update
a pte (call it pte1), which is in HIGHMEM, so it doesn't have a
permanent mapping for it. It calls kmap_atomic() which sets up another
pte (pte2, two writes), and then accesses pte1 through pte2.

> Also, the expensive page fault occurs on errorcode = 0x0000000b (PAGE_FAULT
> trace data). What does the 4th bit in 0xb mean? bit 0 set means
> PFERR_PRESENT_MASK is set, and bit 1 means PT_WRITABLE_MASK. What is bit 3?
>

Bit 3 is the reserved bit, which means the shadow pte has an illegal bit
combination. kvm sets up vmx to forward non-persent page faults (bit 0
clear) directly to the guest, so it needs some other pattern to get a
trapping fault.

IOW, there are two types of non-present shadow ptes in kvm: trapping
ones (where we don't know what the guest pte looks like) and nontrapping
ones (where we know the guest pte is not present, so we forward the
fault directly to the guest). The first type is encoded with the
reserved bit and present bit set, the second with both of them clear.

You can disable this trickery using the bypass_guest_pf module
parameter. It should be useful to try it, we'll see the forwarded
faults as well.

--
Do not meddle in the internals of kernels, for they are subtle and quick to panic.

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.