* [PATCH] mmu notifier index huge spte fix
@ 2010-07-16 9:52 Andrea Arcangeli
2010-07-16 15:04 ` Rik van Riel
2010-07-19 7:59 ` Avi Kivity
0 siblings, 2 replies; 3+ messages in thread
From: Andrea Arcangeli @ 2010-07-16 9:52 UTC (permalink / raw)
To: kvm; +Cc: Avi Kivity, Marcelo Tosatti
Subject: fix kvm mmu notifier invalidate handler for huge spte
From: Andrea Arcangeli <aarcange@redhat.com>
The index wasn't calucalted correctly (off by one) for huge spte so KVM guest
was unstable with transparent hugepages.
Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
---
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index d16efbe..da44e31 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -850,8 +850,12 @@ static int kvm_handle_hva(struct kvm *kvm, unsigned long hva,
ret = handler(kvm, &memslot->rmap[gfn_offset], data);
for (j = 0; j < KVM_NR_PAGE_SIZES - 1; ++j) {
- int idx = gfn_offset;
- idx /= KVM_PAGES_PER_HPAGE(PT_DIRECTORY_LEVEL + j);
+ unsigned long idx;
+ int sh;
+
+ sh = KVM_HPAGE_GFN_SHIFT(PT_DIRECTORY_LEVEL+j);
+ idx = ((memslot->base_gfn+gfn_offset) >> sh) -
+ (memslot->base_gfn >> sh);
ret |= handler(kvm,
&memslot->lpage_info[j][idx].rmap_pde,
data);
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] mmu notifier index huge spte fix
2010-07-16 9:52 [PATCH] mmu notifier index huge spte fix Andrea Arcangeli
@ 2010-07-16 15:04 ` Rik van Riel
2010-07-19 7:59 ` Avi Kivity
1 sibling, 0 replies; 3+ messages in thread
From: Rik van Riel @ 2010-07-16 15:04 UTC (permalink / raw)
To: Andrea Arcangeli; +Cc: kvm, Avi Kivity, Marcelo Tosatti
On 07/16/2010 05:52 AM, Andrea Arcangeli wrote:
> Subject: fix kvm mmu notifier invalidate handler for huge spte
>
> From: Andrea Arcangeli<aarcange@redhat.com>
>
> The index wasn't calucalted correctly (off by one) for huge spte so KVM guest
> was unstable with transparent hugepages.
>
> Signed-off-by: Andrea Arcangeli<aarcange@redhat.com>
Reviewed-by: Rik van Riel <riel@redhat.com>
--
All rights reversed
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mmu notifier index huge spte fix
2010-07-16 9:52 [PATCH] mmu notifier index huge spte fix Andrea Arcangeli
2010-07-16 15:04 ` Rik van Riel
@ 2010-07-19 7:59 ` Avi Kivity
1 sibling, 0 replies; 3+ messages in thread
From: Avi Kivity @ 2010-07-19 7:59 UTC (permalink / raw)
To: Andrea Arcangeli; +Cc: kvm, Marcelo Tosatti
On 07/16/2010 12:52 PM, Andrea Arcangeli wrote:
> Subject: fix kvm mmu notifier invalidate handler for huge spte
>
> From: Andrea Arcangeli<aarcange@redhat.com>
>
> The index wasn't calucalted correctly (off by one) for huge spte so KVM guest
> was unstable with transparent hugepages.
>
Applied, thanks.
--
error compiling committee.c: too many arguments to function
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-07-19 7:59 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-16 9:52 [PATCH] mmu notifier index huge spte fix Andrea Arcangeli
2010-07-16 15:04 ` Rik van Riel
2010-07-19 7:59 ` Avi Kivity
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox