Re: [RESEND PATCH v7 3/4] arm: dirty log write protect management support

Mario Smarduch
2014-06-12T03:02:55Z

Hi Paolo,
for ARM dirty page logging we have couple functions
that are generic.

- kvm_vm_ioctl_get_dirty_log - is identical to x86 version
- kvm_flush_remote_tlbs - ARM version does hardware broadcast
it's different from the generic one in kvm_main.c

How to proceed to make these generic? Please see below
from Christoffer.

Current patch moves kvm_vm_ioctl_get_dirty_log() into kvm_main.c
and labels it and kvm_flush_remote_tlbs weak.

Please advise.

Thanks,
- Mario

> So I don't see a lot of use of weak symbols in kvm_main.c (actually on
> kvmarm/next I don't see any), but we do want to share code when more
> than one architecture implements something in the exact same way, like
> it seems x86 and ARM is doing here for this particular function.
>
> I think the KVM scheme is usually to check for some define, like:
>
> #ifdef KVM_ARCH_HAVE_GET_DIRTY_LOG
> ret = kvm_arch_get_dirty_log(...);
> #else
> ret = kvm_get_dirty_log(...);
> #endif
>
> but Paolo may have a more informed oppinion of how to deal with these.
>
> Thanks,
> -Christoffer
>