From: Liu Ping Fan <kernelfans@gmail.com>
To: linuxppc-dev@lists.ozlabs.org, kvm-ppc@vger.kernel.org
Cc: Paul Mackerras <paulus@samba.org>,
"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>,
Alexander Graf <agraf@suse.de>
Subject: [PATCH 3/4] powernv: kvm: extend input param for lookup_linux_pte
Date: Wed, 11 Dec 2013 08:47:53 +0000 [thread overview]
Message-ID: <1386751674-14136-4-git-send-email-pingfank@linux.vnet.ibm.com> (raw)
In-Reply-To: <1386751674-14136-1-git-send-email-pingfank@linux.vnet.ibm.com>
It will be helpful for next patch
Signed-off-by: Liu Ping Fan <pingfank@linux.vnet.ibm.com>
---
Can it be merged with the next patch?
---
arch/powerpc/kvm/book3s_hv_rm_mmu.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/kvm/book3s_hv_rm_mmu.c b/arch/powerpc/kvm/book3s_hv_rm_mmu.c
index af8602d..ae46052 100644
--- a/arch/powerpc/kvm/book3s_hv_rm_mmu.c
+++ b/arch/powerpc/kvm/book3s_hv_rm_mmu.c
@@ -135,7 +135,8 @@ static void remove_revmap_chain(struct kvm *kvm, long pte_index,
}
static pte_t lookup_linux_pte(pgd_t *pgdir, unsigned long hva,
- int writing, unsigned long *pte_sizep)
+ int writing, unsigned long *pte_sizep,
+ pte_t **ptepp)
{
pte_t *ptep;
unsigned long ps = *pte_sizep;
@@ -144,6 +145,8 @@ static pte_t lookup_linux_pte(pgd_t *pgdir, unsigned long hva,
ptep = find_linux_pte_or_hugepte(pgdir, hva, &hugepage_shift);
if (!ptep)
return __pte(0);
+ if (ptepp != NULL)
+ *ptepp = ptep;
if (hugepage_shift)
*pte_sizep = 1ul << hugepage_shift;
else
@@ -231,7 +234,7 @@ long kvmppc_do_h_enter(struct kvm *kvm, unsigned long flags,
/* Look up the Linux PTE for the backing page */
pte_size = psize;
- pte = lookup_linux_pte(pgdir, hva, writing, &pte_size);
+ pte = lookup_linux_pte(pgdir, hva, writing, &pte_size, NULL);
if (pte_present(pte) && !pte_numa(pte)) {
if (writing && !pte_write(pte))
/* make the actual HPTE be read-only */
@@ -671,7 +674,8 @@ long kvmppc_h_protect(struct kvm_vcpu *vcpu, unsigned long flags,
memslot = __gfn_to_memslot(kvm_memslots(kvm), gfn);
if (memslot) {
hva = __gfn_to_hva_memslot(memslot, gfn);
- pte = lookup_linux_pte(pgdir, hva, 1, &psize);
+ pte = lookup_linux_pte(pgdir, hva, 1, &psize,
+ NULL);
if (pte_present(pte) && !pte_write(pte))
r = hpte_make_readonly(r);
}
--
1.8.1.4
WARNING: multiple messages have this Message-ID (diff)
From: Liu Ping Fan <kernelfans@gmail.com>
To: linuxppc-dev@lists.ozlabs.org, kvm-ppc@vger.kernel.org
Cc: Paul Mackerras <paulus@samba.org>,
"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>,
Alexander Graf <agraf@suse.de>
Subject: [PATCH 3/4] powernv: kvm: extend input param for lookup_linux_pte
Date: Wed, 11 Dec 2013 16:47:53 +0800 [thread overview]
Message-ID: <1386751674-14136-4-git-send-email-pingfank@linux.vnet.ibm.com> (raw)
In-Reply-To: <1386751674-14136-1-git-send-email-pingfank@linux.vnet.ibm.com>
It will be helpful for next patch
Signed-off-by: Liu Ping Fan <pingfank@linux.vnet.ibm.com>
---
Can it be merged with the next patch?
---
arch/powerpc/kvm/book3s_hv_rm_mmu.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/kvm/book3s_hv_rm_mmu.c b/arch/powerpc/kvm/book3s_hv_rm_mmu.c
index af8602d..ae46052 100644
--- a/arch/powerpc/kvm/book3s_hv_rm_mmu.c
+++ b/arch/powerpc/kvm/book3s_hv_rm_mmu.c
@@ -135,7 +135,8 @@ static void remove_revmap_chain(struct kvm *kvm, long pte_index,
}
static pte_t lookup_linux_pte(pgd_t *pgdir, unsigned long hva,
- int writing, unsigned long *pte_sizep)
+ int writing, unsigned long *pte_sizep,
+ pte_t **ptepp)
{
pte_t *ptep;
unsigned long ps = *pte_sizep;
@@ -144,6 +145,8 @@ static pte_t lookup_linux_pte(pgd_t *pgdir, unsigned long hva,
ptep = find_linux_pte_or_hugepte(pgdir, hva, &hugepage_shift);
if (!ptep)
return __pte(0);
+ if (ptepp != NULL)
+ *ptepp = ptep;
if (hugepage_shift)
*pte_sizep = 1ul << hugepage_shift;
else
@@ -231,7 +234,7 @@ long kvmppc_do_h_enter(struct kvm *kvm, unsigned long flags,
/* Look up the Linux PTE for the backing page */
pte_size = psize;
- pte = lookup_linux_pte(pgdir, hva, writing, &pte_size);
+ pte = lookup_linux_pte(pgdir, hva, writing, &pte_size, NULL);
if (pte_present(pte) && !pte_numa(pte)) {
if (writing && !pte_write(pte))
/* make the actual HPTE be read-only */
@@ -671,7 +674,8 @@ long kvmppc_h_protect(struct kvm_vcpu *vcpu, unsigned long flags,
memslot = __gfn_to_memslot(kvm_memslots(kvm), gfn);
if (memslot) {
hva = __gfn_to_hva_memslot(memslot, gfn);
- pte = lookup_linux_pte(pgdir, hva, 1, &psize);
+ pte = lookup_linux_pte(pgdir, hva, 1, &psize,
+ NULL);
if (pte_present(pte) && !pte_write(pte))
r = hpte_make_readonly(r);
}
--
1.8.1.4
next prev parent reply other threads:[~2013-12-11 8:47 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-11 8:47 [PATCH 0/4] powernv: kvm: numa fault improvement Liu Ping Fan
2013-12-11 8:47 ` Liu Ping Fan
2013-12-11 8:47 ` [PATCH 1/4] mm: export numa_migrate_prep() Liu Ping Fan
2013-12-11 8:47 ` Liu Ping Fan
2013-12-11 8:47 ` [PATCH 2/4] powernv: kvm: make _PAGE_NUMA take effect Liu Ping Fan
2013-12-11 8:47 ` Liu Ping Fan
2014-01-20 15:22 ` Aneesh Kumar K.V
2014-01-20 15:34 ` Aneesh Kumar K.V
2013-12-11 8:47 ` Liu Ping Fan [this message]
2013-12-11 8:47 ` [PATCH 3/4] powernv: kvm: extend input param for lookup_linux_pte Liu Ping Fan
2013-12-11 8:47 ` [PATCH 4/4] powernv: kvm: make the handling of _PAGE_NUMA faster for guest Liu Ping Fan
2013-12-11 8:47 ` Liu Ping Fan
2014-01-09 12:08 ` [PATCH 0/4] powernv: kvm: numa fault improvement Alexander Graf
2014-01-09 12:08 ` Alexander Graf
2014-01-15 6:36 ` Liu ping fan
2014-01-15 6:36 ` Liu ping fan
2014-01-20 14:48 ` Alexander Graf
2014-01-20 14:48 ` Alexander Graf
2014-01-21 11:22 ` Paul Mackerras
2014-01-21 11:22 ` Paul Mackerras
2014-01-22 5:18 ` Aneesh Kumar K.V
2014-01-22 5:30 ` Aneesh Kumar K.V
2014-01-22 8:33 ` Liu ping fan
2014-01-22 8:33 ` Liu ping fan
2014-02-26 3:09 ` Liu ping fan
2014-02-26 3:09 ` Liu ping fan
2014-01-20 15:45 ` Aneesh Kumar K.V
2014-01-20 15:57 ` Aneesh Kumar K.V
2014-01-21 2:30 ` Liu ping fan
2014-01-21 2:30 ` Liu ping fan
2014-01-21 3:40 ` Aneesh Kumar K.V
2014-01-21 3:52 ` Aneesh Kumar K.V
2014-01-21 9:07 ` Liu ping fan
2014-01-21 9:07 ` Liu ping fan
2014-01-21 9:11 ` Liu ping fan
2014-01-21 9:11 ` Liu ping fan
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=1386751674-14136-4-git-send-email-pingfank@linux.vnet.ibm.com \
--to=kernelfans@gmail.com \
--cc=agraf@suse.de \
--cc=aneesh.kumar@linux.vnet.ibm.com \
--cc=kvm-ppc@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=paulus@samba.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.