Re: swapping with MMU Notifiers V2

Andrea Arcangeli
2008-01-29T16:52:19Z

On Tue, Jan 29, 2008 at 06:24:12PM +0200, Avi Kivity wrote:
> Carsten Otte wrote:
>>> #include <linux/kvm.h>
>>> @@ -118,6 +119,7 @@ struct kvm {
>>> struct kvm_io_bus pio_bus;
>>> struct kvm_vm_stat stat;
>>> struct kvm_arch arch;
>>> + struct mmu_notifier mmu_notifier;
>>> };
>>>
>>> /* The guest did something we don't support. */
>>>
>> This should not be in struct kvm, it should go to x86's kvm_arch. This is
>> x86 specific, we don't need a notifier since the core-vm will just page
>> out our guest memory like regular userspace mem.
>>
>>
>
> Every arch except s390 needs it. An ugly #ifndef
> CONFIG_KVM_HARDWARE_TLB_SYNC is preferred to duplicating the code.

Well I already moved that bit to x86, at least that had a good reason
for being moved there, it's really invisible code to s390. The memslot
are all but invisible to s390 instead, and so the locking rules of the
memslots should be common as long as memslots remains a common-code
data structure too IMHO.