Migration for SPP(Sub-Page Protection) bitmaps
Hi, Paolo,
I'm working on migration support for SPP(Sub-Page Protection) feature, the previous patch set is here:
https://lkml.org/lkml/2018/11/30/574, basically it's used to protect 128-byte subpages within a normal 4KB page.
but I'm not sure whether we need to add migration support for such kind of feature.
Currently, my solution is to store the SPP bitmaps to destination KVM, when there's EPT violation, search the bitmap mapping table to check if the guest page needs to be protected.
Another solution is to setup EPT table directly at the end of migration.
Do you have perferred approach?
Thanks for your comments!
Paolo Bonzini
maintainerQuoted 7 lines · Yang Weijiang
Hi, Paolo,
I'm working on migration support for SPP(Sub-Page Protection) feature, the previous patch set is here:
https://lkml.org/lkml/2018/11/30/574, basically it's used to protect 128-byte subpages within a normal 4KB page.
Quoted 7 lines
but I'm not sure whether we need to add migration support for such kind of feature.
Currently, my solution is to store the SPP bitmaps to destination KVM, when there's EPT violation, search the bitmap mapping table to check if the guest page needs to be protected.
Another solution is to setup EPT table directly at the end of migration.
The destination userspace should simply call KVM_SUBPAGES_SET_ACCESS, and KVM will process it just like it would on the source. In other words, it shouldn't matter if the ioctl is done as part of migration or the first time a VM is setup. And in both cases, lazy setup should be fine.
Thanks,
Paolo
Quoted 16 lines · Paolo Bonzini
Quoted 7 lines · Yang Weijiang
Hi, Paolo,
I'm working on migration support for SPP(Sub-Page Protection) feature, the previous patch set is here:
https://lkml.org/lkml/2018/11/30/574, basically it's used to protect 128-byte subpages within a normal 4KB page.Quoted 7 lines
but I'm not sure whether we need to add migration support for such kind of feature.
Currently, my solution is to store the SPP bitmaps to destination KVM, when there's EPT violation, search the bitmap mapping table to check if the guest page needs to be protected.
Another solution is to setup EPT table directly at the end of migration.
Quoted 8 lines
The destination userspace should simply call
KVM_SUBPAGES_SET_ACCESS, and KVM will process it just like it would on the source. In other words, it shouldn't matter if the ioctl is done as part of migration or the first time a VM is setup. And in both cases, lazy setup should be fine.Thanks,
Paolo
Thanks Paolo!
The problem is in current patch (as in link), it assumes the target pages are there in EPT, but in migration case, these pages are not setup in ETP, so KVM_SUBPAGES_SET_ACCESS during migration or destination bootup will fail, should I modify the patch to setup the ETP in lazy mode?
Paolo Bonzini
maintainerQuoted 7 lines
Quoted 6 lines
The destination userspace should simply call
KVM_SUBPAGES_SET_ACCESS, and KVM will process it just like it would on the source. In other words, it shouldn't matter if the ioctl is done as part of migration or the first time a VM is setup. And in both cases, lazy setup should be fine.
Quoted 5 lines
The problem is in current patch (as in link), it assumes the target pages are there in EPT, but in migration case, these pages are not setup in ETP, so
KVM_SUBPAGES_SET_ACCESSduring migration or destination bootup will fail, should I modify the patch to setup the ETP in lazy mode?
Yes, definitely. Remember that EPT page tables come and go (pages could be swapped out, or moved from one host physical address to another; there is also a shrinker that will release EPT page tables if memory is low), so SPP support should be ready for that. Migration is just a special case.
Paolo
Quoted 13 lines · Paolo Bonzini
Quoted 7 lines
Quoted 6 lines
The destination userspace should simply call
KVM_SUBPAGES_SET_ACCESS, and KVM will process it just like it would on the source. In other words, it shouldn't matter if the ioctl is done as part of migration or the first time a VM is setup. And in both cases, lazy setup should be fine.Quoted 5 lines
The problem is in current patch (as in link), it assumes the target pages are there in EPT, but in migration case, these pages are not setup in ETP, so
KVM_SUBPAGES_SET_ACCESSduring migration or destination bootup will fail, should I modify the patch to setup the ETP in lazy mode?
Quoted 6 lines
Yes, definitely. Remember that EPT page tables come and go (pages could be swapped out, or moved from one host physical address to another; there is also a shrinker that will release EPT page tables if memory is low), so SPP support should be ready for that. Migration is just a special case.
Paolo
OK, got it, thanks a lot for the reply!