Thread (5 messages) flat view 5 messages, 4 authors, 2018-09-11

Re: [PATCH] KVM: PPC: Book3S HV: Don't use compound_order to determine host mapping size

From: Nicholas Piggin <npiggin@gmail.com>
Date: 2018-09-11 10:47:02

On Tue, 11 Sep 2018 20:01:54 +1000
Paul Mackerras [off-list ref] wrote:
On Tue, Sep 04, 2018 at 06:16:01PM +1000, Nicholas Piggin wrote:
quoted
THP paths can defer splitting compound pages until after the actual
remap and TLB flushes to split a huge PMD/PUD. This causes radix
partition scope page table mappings to get out of synch with the host
qemu page table mappings.

This results in random memory corruption in the guest when running
with THP. The easiest way to reproduce is use KVM baloon to free up
a lot of memory in the guest and then shrink the balloon to give the
memory back, while some work is being done in the guest.  
I'm hitting the WARN_ON you added.  I think I have an old qemu that
doesn't 2M-align the guest ram and so we get to the level = 0 case
because of misalignment.  The patch below on top of yours seems to
work just fine.  In the case where the pte is 2M or 1G but we have
misalignment, it ORs in address bits from hva into the pte so we get
to the specific single page we want.

Care to fold this in and resend?
Thanks for that, I misunderstood the unaligned adjustment case.
Good thing you caught it.

Thanks,
Nick
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help