From: Paul Mackerras <paulus@samba.org>
To: Alexander Graf <agraf@suse.de>
Cc: kvm-ppc@vger.kernel.org, kvm@vger.kernel.org
Subject: Re: [PATCH 4/7] KVM: PPC: Book3S HV: Fix dirty map for hugepages
Date: Mon, 26 May 2014 13:30:43 +1000 [thread overview]
Message-ID: <20140526033043.GA31285@drongo> (raw)
In-Reply-To: <5381BF50.5060701@suse.de>
On Sun, May 25, 2014 at 12:00:48PM +0200, Alexander Graf wrote:
>
> Please document in the function header that the return value is the number
> of pages that are dirty. Alternatively rename the function.
OK.
> > for (i = 0; i < memslot->npages; ++i) {
> >- if (kvm_test_clear_dirty(kvm, rmapp) && map)
> >- __set_bit_le(i, map);
> >+ int ret = kvm_test_clear_dirty(kvm, rmapp);
>
> Please give this one a better name. npages maybe?
OK.
> >+ if (ret && map)
> >+ for (j = i - (i % ret); ret; ++j, --ret)
>
> Why do we go down from the index?
When a large page is faulted in by kvmppc_book3s_hv_page_fault(), we
put the guest HPTE in the rmap chain corresponding to the guest
physical address that the guest was trying to access, not the GPA of
the start of the large page. So we need i - (i % ret) to get the
index of the first system page in the large page.
However, on reflection I think that we should always put the guest
HPTE in the rmap chain corresponding to the base address of the large
page. In that case i % ret would always be zero. I'll repost.
Paul.
next prev parent reply other threads:[~2014-05-26 3:30 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-24 8:21 [PATCH 0/7] Bug fixes for HV KVM Paul Mackerras
2014-05-24 8:21 ` [PATCH 1/7] KVM: PPC: Book3S: Add ONE_REG register names that were missed Paul Mackerras
2014-05-24 8:21 ` [PATCH 2/7] KVM: PPC: Book3S: Move KVM_REG_PPC_WORT to an unused register number Paul Mackerras
2014-05-24 8:21 ` [PATCH 3/7] KVM: PPC: Book3S HV: Fix check for running inside guest in global_invalidates() Paul Mackerras
2014-05-24 8:21 ` [PATCH 4/7] KVM: PPC: Book3S HV: Fix dirty map for hugepages Paul Mackerras
2014-05-25 10:00 ` Alexander Graf
2014-05-26 3:30 ` Paul Mackerras [this message]
2014-05-24 8:21 ` [PATCH 5/7] KVM: PPC: Book3S HV: Make sure we don't miss dirty pages Paul Mackerras
2014-05-24 8:22 ` [PATCH 6/7] KVM: PPC: Book3S HV: Work around POWER8 performance monitor bugs Paul Mackerras
2014-05-25 10:07 ` Alexander Graf
2014-05-24 8:22 ` [PATCH 7/7] KVM: PPC: Book3S HV: Fix machine check delivery to guest Paul Mackerras
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=20140526033043.GA31285@drongo \
--to=paulus@samba.org \
--cc=agraf@suse.de \
--cc=kvm-ppc@vger.kernel.org \
--cc=kvm@vger.kernel.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