Re: [patch] kvm: make cr3 loading more robust

Ingo Molnar
2007-01-03T13:44:17Z

* Ingo Molnar <mingo-X9Un+BFzKDI@public.gmane.org> wrote:

> instead of a host crash. Note that i chose to put this into the
> generic cr3 loading function, so that it covers real-mode too. I think
> we can safely ignore a BIOS loading crap into cr3 and after that
> loading the right value into it. (if that ever happens we 1) want to
> know about it 2) can push the test down into paging_new_cr3()) Agreed?

another small detail is that currently KVM_SET_MEMORY_REGION appears to
be an add-only interface - it is not possible to 'unregister' RAM from a
VM.

That keeps things easy for now, but if it's ever implemented then the
current cr3 of all vcpus of the VM needs to be validated against the
reduced memory slot map. (besides migrating all existing mappings from
the removed memory slot to other memory slots and redirecting all
in-flight DMA transactions, etc., etc. Which all needs heavy guest-OS
awareness as well.)

Ingo