kvm: About ept identity pagetable and apic access page migration.
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
Hello, please CC kvm list too.
Quoted 13 lines · Tang Chen
Quoted 12 lines · Tang Chen
Hi Gleb,
I'm working on host's memory hotplug (not guest) recently. I met a problem in kvm and I'll be very appreciate if you'd like to give some advice. :)
When a kvm virtual machine is running, it pins real mode ept identity pagetable
and apic access page in memory till the vm is destroyed. Maybe you have known
about this, the pinned pages cannot be migrated, as a result they cannot be hot-removed.
Quoted 2 lines
Quoted 2 lines
I'm not very familiar with kvm, and I'm wondering:
1. What's these two pages for ?
Identity pagetable is needed for CPUs that do not allow entering guest mode with paging disabled. On such cpus identity pagetable is populated with ptes that cover entire guest's memory and guest's CR3 is pointed to it during guest mode entry.
APIC page is used by CPU directly to catch MMIO access to an APIC.
Quoted 4 lines
Sorry, one more question. :)
Is real mode ept identity pagetable only used in real mode ?
Yes.
Quoted 2 lines
Why does it have to be pinned till the vm is destroyed.
It need not be. Actually both of those may not be pinned at all, it is just simpler to pin them than to track their whereabouts. If identity pagetable or APIC page are moved KVM should unmap them from EPT via mmu notifiers and remap them to a new location on next EPT violation. In case of APIC page it should update VMCS APIC_ACCESS_ADDR pointer in addition to EPT page table.
--
Gleb.