[PATCH 5/8] KVM: Add hva_to_memslot

2012-08-07 Thread Alexander Graf
Architecture code might want to figure out if an hva that it gets for example via the mmu notifier callbacks actually is in guest mapped memory, and if so, in which memory slot. This patch introduces a helper function to enable it to do so. It is a prerequisite for the e500 mmu notifier implementa

Re: [PATCH 5/8] KVM: Add hva_to_memslot

2012-08-09 Thread Takuya Yoshikawa
On Tue, 7 Aug 2012 12:57:13 +0200 Alexander Graf wrote: > +struct kvm_memory_slot *hva_to_memslot(struct kvm *kvm, hva_t hva) > +{ > + struct kvm_memslots *slots = kvm_memslots(kvm); > + struct kvm_memory_slot *memslot; > + > + kvm_for_each_memslot(memslot, slots) > + if

Re: [PATCH 5/8] KVM: Add hva_to_memslot

2012-08-09 Thread Avi Kivity
On 08/09/2012 01:34 PM, Takuya Yoshikawa wrote: > On Tue, 7 Aug 2012 12:57:13 +0200 > Alexander Graf wrote: > >> +struct kvm_memory_slot *hva_to_memslot(struct kvm *kvm, hva_t hva) >> +{ >> +struct kvm_memslots *slots = kvm_memslots(kvm); >> +struct kvm_memory_slot *memslot; >> + >> +

Re: [PATCH 5/8] KVM: Add hva_to_memslot

2012-08-09 Thread Alexander Graf
On 09.08.2012, at 12:36, Avi Kivity wrote: > On 08/09/2012 01:34 PM, Takuya Yoshikawa wrote: >> On Tue, 7 Aug 2012 12:57:13 +0200 >> Alexander Graf wrote: >> >>> +struct kvm_memory_slot *hva_to_memslot(struct kvm *kvm, hva_t hva) >>> +{ >>> +struct kvm_memslots *slots = kvm_memslots(kvm)

Re: [PATCH 5/8] KVM: Add hva_to_memslot

2012-08-12 Thread Avi Kivity
On 08/09/2012 08:02 PM, Alexander Graf wrote: > > > On 09.08.2012, at 12:36, Avi Kivity wrote: > >> On 08/09/2012 01:34 PM, Takuya Yoshikawa wrote: >>> On Tue, 7 Aug 2012 12:57:13 +0200 >>> Alexander Graf wrote: >>> +struct kvm_memory_slot *hva_to_memslot(struct kvm *kvm, hva_t hva) >>>

Re: [PATCH 5/8] KVM: Add hva_to_memslot

2012-08-12 Thread Alexander Graf
On 12.08.2012, at 11:24, Avi Kivity wrote: > On 08/09/2012 08:02 PM, Alexander Graf wrote: >> >> >> On 09.08.2012, at 12:36, Avi Kivity wrote: >> >>> On 08/09/2012 01:34 PM, Takuya Yoshikawa wrote: On Tue, 7 Aug 2012 12:57:13 +0200 Alexander Graf wrote: > +struct kvm_mem

Re: [PATCH 5/8] KVM: Add hva_to_memslot

2012-08-12 Thread Avi Kivity
On 08/12/2012 02:03 PM, Alexander Graf wrote: > > Well, for now I just dropped the whole thing. In general, chances are pretty > good that an HVA we get notified on with mmu notifiers is representing guest > memory. And flushing a few times too often shouldn't hurt. That is not the case, actual

Re: [PATCH 5/8] KVM: Add hva_to_memslot

2012-08-12 Thread Alexander Graf
On 12.08.2012, at 13:21, Avi Kivity wrote: > On 08/12/2012 02:03 PM, Alexander Graf wrote: >> >> Well, for now I just dropped the whole thing. In general, chances are pretty >> good that an HVA we get notified on with mmu notifiers is representing guest >> memory. And flushing a few times to

Re: [kvmarm] [PATCH 5/8] KVM: Add hva_to_memslot

2012-08-07 Thread Christoffer Dall
On Tue, Aug 7, 2012 at 6:57 AM, Alexander Graf wrote: > Architecture code might want to figure out if an hva that it gets for example > via the mmu notifier callbacks actually is in guest mapped memory, and if so, > in which memory slot. > > This patch introduces a helper function to enable it to

Re: [kvmarm] [PATCH 5/8] KVM: Add hva_to_memslot

2012-08-08 Thread Alexander Graf
On 08.08.2012, at 06:55, Christoffer Dall wrote: > On Tue, Aug 7, 2012 at 6:57 AM, Alexander Graf wrote: >> Architecture code might want to figure out if an hva that it gets for example >> via the mmu notifier callbacks actually is in guest mapped memory, and if so, >> in which memory slot. >>