linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Nicholas Piggin <npiggin@gmail.com>
To: Paul Mackerras <paulus@ozlabs.org>
Cc: kvm-ppc@vger.kernel.org,
	David Gibson <david@gibson.dropbear.id.au>,
	"Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>,
	linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH] KVM: PPC: Book3S HV: Don't use compound_order to determine host mapping size
Date: Tue, 11 Sep 2018 20:46:49 +1000	[thread overview]
Message-ID: <20180911204649.3123600b@roar.ozlabs.ibm.com> (raw)
In-Reply-To: <20180911100154.GC25158@fergus>

On Tue, 11 Sep 2018 20:01:54 +1000
Paul Mackerras <paulus@ozlabs.org> wrote:

> On Tue, Sep 04, 2018 at 06:16:01PM +1000, Nicholas Piggin wrote:
> > 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

      reply	other threads:[~2018-09-11 10:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-04  8:16 [PATCH] KVM: PPC: Book3S HV: Don't use compound_order to determine host mapping size Nicholas Piggin
2018-09-04  9:10 ` Aneesh Kumar K.V
2018-09-05  3:59 ` David Gibson
2018-09-11 10:01 ` Paul Mackerras
2018-09-11 10:46   ` Nicholas Piggin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180911204649.3123600b@roar.ozlabs.ibm.com \
    --to=npiggin@gmail.com \
    --cc=aneesh.kumar@linux.ibm.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=paulus@ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).