All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bharat Bhushan <r65777@freescale.com>
To: <benh@kernel.crashing.org>, <agraf@suse.de>,
	<kvm-ppc@vger.kernel.org>, <kvm@vger.kernel.org>,
	<linuxppc-dev@lists.ozlabs.org>, <scottwood@freescale.com>
Cc: Bharat Bhushan <Bharat.Bhushan@freescale.com>,
	Bharat Bhushan <bharat.bhushan@freescale.com>
Subject: [PATCH 4/6 v2] powerpc: move linux pte/hugepte search to more generic file
Date: Thu, 1 Aug 2013 16:42:36 +0530	[thread overview]
Message-ID: <1375355558-19187-5-git-send-email-Bharat.Bhushan@freescale.com> (raw)
In-Reply-To: <1375355558-19187-1-git-send-email-Bharat.Bhushan@freescale.com>

Linux pte search functions find_linux_pte_or_hugepte() and
find_linux_pte() have nothing specific to 64bit anymore.
So they are move from pgtable-ppc64.h to asm/pgtable.h

Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com>
---
v1->v2
 - This is a new change in this version

 arch/powerpc/include/asm/pgtable-ppc64.h |   36 -----------------------------
 arch/powerpc/include/asm/pgtable.h       |   37 ++++++++++++++++++++++++++++++
 2 files changed, 37 insertions(+), 36 deletions(-)

diff --git a/arch/powerpc/include/asm/pgtable-ppc64.h b/arch/powerpc/include/asm/pgtable-ppc64.h
index e3d55f6..d257d98 100644
--- a/arch/powerpc/include/asm/pgtable-ppc64.h
+++ b/arch/powerpc/include/asm/pgtable-ppc64.h
@@ -340,42 +340,6 @@ static inline void __ptep_set_access_flags(pte_t *ptep, pte_t entry)
 void pgtable_cache_add(unsigned shift, void (*ctor)(void *));
 void pgtable_cache_init(void);
 
-/*
- * find_linux_pte returns the address of a linux pte for a given
- * effective address and directory.  If not found, it returns zero.
- */
-static inline pte_t *find_linux_pte(pgd_t *pgdir, unsigned long ea)
-{
-	pgd_t *pg;
-	pud_t *pu;
-	pmd_t *pm;
-	pte_t *pt = NULL;
-
-	pg = pgdir + pgd_index(ea);
-	if (!pgd_none(*pg)) {
-		pu = pud_offset(pg, ea);
-		if (!pud_none(*pu)) {
-			pm = pmd_offset(pu, ea);
-			if (pmd_present(*pm))
-				pt = pte_offset_kernel(pm, ea);
-		}
-	}
-	return pt;
-}
-
-#ifdef CONFIG_HUGETLB_PAGE
-pte_t *find_linux_pte_or_hugepte(pgd_t *pgdir, unsigned long ea,
-				 unsigned *shift);
-#else
-static inline pte_t *find_linux_pte_or_hugepte(pgd_t *pgdir, unsigned long ea,
-					       unsigned *shift)
-{
-	if (shift)
-		*shift = 0;
-	return find_linux_pte(pgdir, ea);
-}
-#endif /* !CONFIG_HUGETLB_PAGE */
-
 #endif /* __ASSEMBLY__ */
 
 #endif /* _ASM_POWERPC_PGTABLE_PPC64_H_ */
diff --git a/arch/powerpc/include/asm/pgtable.h b/arch/powerpc/include/asm/pgtable.h
index b6293d2..690c8c2 100644
--- a/arch/powerpc/include/asm/pgtable.h
+++ b/arch/powerpc/include/asm/pgtable.h
@@ -217,6 +217,43 @@ extern int gup_hugepd(hugepd_t *hugepd, unsigned pdshift, unsigned long addr,
 
 extern int gup_hugepte(pte_t *ptep, unsigned long sz, unsigned long addr,
 		       unsigned long end, int write, struct page **pages, int *nr);
+
+/*
+ * find_linux_pte returns the address of a linux pte for a given
+ * effective address and directory.  If not found, it returns zero.
+ */
+static inline pte_t *find_linux_pte(pgd_t *pgdir, unsigned long ea)
+{
+	pgd_t *pg;
+	pud_t *pu;
+	pmd_t *pm;
+	pte_t *pt = NULL;
+
+	pg = pgdir + pgd_index(ea);
+	if (!pgd_none(*pg)) {
+		pu = pud_offset(pg, ea);
+		if (!pud_none(*pu)) {
+			pm = pmd_offset(pu, ea);
+			if (pmd_present(*pm))
+				pt = pte_offset_kernel(pm, ea);
+		}
+	}
+	return pt;
+}
+
+#ifdef CONFIG_HUGETLB_PAGE
+pte_t *find_linux_pte_or_hugepte(pgd_t *pgdir, unsigned long ea,
+				 unsigned *shift);
+#else
+static inline pte_t *find_linux_pte_or_hugepte(pgd_t *pgdir, unsigned long ea,
+					       unsigned *shift)
+{
+	if (shift)
+		*shift = 0;
+	return find_linux_pte(pgdir, ea);
+}
+#endif /* !CONFIG_HUGETLB_PAGE */
+
 #endif /* __ASSEMBLY__ */
 
 #endif /* __KERNEL__ */
-- 
1.7.0.4

WARNING: multiple messages have this Message-ID (diff)
From: Bharat Bhushan <r65777@freescale.com>
To: <benh@kernel.crashing.org>, <agraf@suse.de>,
	<kvm-ppc@vger.kernel.org>, <kvm@vger.kernel.org>,
	<linuxppc-dev@lists.ozlabs.org>, <scottwood@freescale.com>
Cc: Bharat Bhushan <bharat.bhushan@freescale.com>
Subject: [PATCH 4/6 v2] powerpc: move linux pte/hugepte search to more generic file
Date: Thu, 1 Aug 2013 16:42:36 +0530	[thread overview]
Message-ID: <1375355558-19187-5-git-send-email-Bharat.Bhushan@freescale.com> (raw)
In-Reply-To: <1375355558-19187-1-git-send-email-Bharat.Bhushan@freescale.com>

Linux pte search functions find_linux_pte_or_hugepte() and
find_linux_pte() have nothing specific to 64bit anymore.
So they are move from pgtable-ppc64.h to asm/pgtable.h

Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com>
---
v1->v2
 - This is a new change in this version

 arch/powerpc/include/asm/pgtable-ppc64.h |   36 -----------------------------
 arch/powerpc/include/asm/pgtable.h       |   37 ++++++++++++++++++++++++++++++
 2 files changed, 37 insertions(+), 36 deletions(-)

diff --git a/arch/powerpc/include/asm/pgtable-ppc64.h b/arch/powerpc/include/asm/pgtable-ppc64.h
index e3d55f6..d257d98 100644
--- a/arch/powerpc/include/asm/pgtable-ppc64.h
+++ b/arch/powerpc/include/asm/pgtable-ppc64.h
@@ -340,42 +340,6 @@ static inline void __ptep_set_access_flags(pte_t *ptep, pte_t entry)
 void pgtable_cache_add(unsigned shift, void (*ctor)(void *));
 void pgtable_cache_init(void);
 
-/*
- * find_linux_pte returns the address of a linux pte for a given
- * effective address and directory.  If not found, it returns zero.
- */
-static inline pte_t *find_linux_pte(pgd_t *pgdir, unsigned long ea)
-{
-	pgd_t *pg;
-	pud_t *pu;
-	pmd_t *pm;
-	pte_t *pt = NULL;
-
-	pg = pgdir + pgd_index(ea);
-	if (!pgd_none(*pg)) {
-		pu = pud_offset(pg, ea);
-		if (!pud_none(*pu)) {
-			pm = pmd_offset(pu, ea);
-			if (pmd_present(*pm))
-				pt = pte_offset_kernel(pm, ea);
-		}
-	}
-	return pt;
-}
-
-#ifdef CONFIG_HUGETLB_PAGE
-pte_t *find_linux_pte_or_hugepte(pgd_t *pgdir, unsigned long ea,
-				 unsigned *shift);
-#else
-static inline pte_t *find_linux_pte_or_hugepte(pgd_t *pgdir, unsigned long ea,
-					       unsigned *shift)
-{
-	if (shift)
-		*shift = 0;
-	return find_linux_pte(pgdir, ea);
-}
-#endif /* !CONFIG_HUGETLB_PAGE */
-
 #endif /* __ASSEMBLY__ */
 
 #endif /* _ASM_POWERPC_PGTABLE_PPC64_H_ */
diff --git a/arch/powerpc/include/asm/pgtable.h b/arch/powerpc/include/asm/pgtable.h
index b6293d2..690c8c2 100644
--- a/arch/powerpc/include/asm/pgtable.h
+++ b/arch/powerpc/include/asm/pgtable.h
@@ -217,6 +217,43 @@ extern int gup_hugepd(hugepd_t *hugepd, unsigned pdshift, unsigned long addr,
 
 extern int gup_hugepte(pte_t *ptep, unsigned long sz, unsigned long addr,
 		       unsigned long end, int write, struct page **pages, int *nr);
+
+/*
+ * find_linux_pte returns the address of a linux pte for a given
+ * effective address and directory.  If not found, it returns zero.
+ */
+static inline pte_t *find_linux_pte(pgd_t *pgdir, unsigned long ea)
+{
+	pgd_t *pg;
+	pud_t *pu;
+	pmd_t *pm;
+	pte_t *pt = NULL;
+
+	pg = pgdir + pgd_index(ea);
+	if (!pgd_none(*pg)) {
+		pu = pud_offset(pg, ea);
+		if (!pud_none(*pu)) {
+			pm = pmd_offset(pu, ea);
+			if (pmd_present(*pm))
+				pt = pte_offset_kernel(pm, ea);
+		}
+	}
+	return pt;
+}
+
+#ifdef CONFIG_HUGETLB_PAGE
+pte_t *find_linux_pte_or_hugepte(pgd_t *pgdir, unsigned long ea,
+				 unsigned *shift);
+#else
+static inline pte_t *find_linux_pte_or_hugepte(pgd_t *pgdir, unsigned long ea,
+					       unsigned *shift)
+{
+	if (shift)
+		*shift = 0;
+	return find_linux_pte(pgdir, ea);
+}
+#endif /* !CONFIG_HUGETLB_PAGE */
+
 #endif /* __ASSEMBLY__ */
 
 #endif /* __KERNEL__ */
-- 
1.7.0.4

WARNING: multiple messages have this Message-ID (diff)
From: Bharat Bhushan <r65777@freescale.com>
To: benh@kernel.crashing.org, agraf@suse.de, kvm-ppc@vger.kernel.org,
	kvm@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
	scottwood@freescale.com
Cc: Bharat Bhushan <Bharat.Bhushan@freescale.com>,
	Bharat Bhushan <bharat.bhushan@freescale.com>
Subject: [PATCH 4/6 v2] powerpc: move linux pte/hugepte search to more generic file
Date: Thu, 01 Aug 2013 11:24:36 +0000	[thread overview]
Message-ID: <1375355558-19187-5-git-send-email-Bharat.Bhushan@freescale.com> (raw)
In-Reply-To: <1375355558-19187-1-git-send-email-Bharat.Bhushan@freescale.com>

Linux pte search functions find_linux_pte_or_hugepte() and
find_linux_pte() have nothing specific to 64bit anymore.
So they are move from pgtable-ppc64.h to asm/pgtable.h

Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com>
---
v1->v2
 - This is a new change in this version

 arch/powerpc/include/asm/pgtable-ppc64.h |   36 -----------------------------
 arch/powerpc/include/asm/pgtable.h       |   37 ++++++++++++++++++++++++++++++
 2 files changed, 37 insertions(+), 36 deletions(-)

diff --git a/arch/powerpc/include/asm/pgtable-ppc64.h b/arch/powerpc/include/asm/pgtable-ppc64.h
index e3d55f6..d257d98 100644
--- a/arch/powerpc/include/asm/pgtable-ppc64.h
+++ b/arch/powerpc/include/asm/pgtable-ppc64.h
@@ -340,42 +340,6 @@ static inline void __ptep_set_access_flags(pte_t *ptep, pte_t entry)
 void pgtable_cache_add(unsigned shift, void (*ctor)(void *));
 void pgtable_cache_init(void);
 
-/*
- * find_linux_pte returns the address of a linux pte for a given
- * effective address and directory.  If not found, it returns zero.
- */
-static inline pte_t *find_linux_pte(pgd_t *pgdir, unsigned long ea)
-{
-	pgd_t *pg;
-	pud_t *pu;
-	pmd_t *pm;
-	pte_t *pt = NULL;
-
-	pg = pgdir + pgd_index(ea);
-	if (!pgd_none(*pg)) {
-		pu = pud_offset(pg, ea);
-		if (!pud_none(*pu)) {
-			pm = pmd_offset(pu, ea);
-			if (pmd_present(*pm))
-				pt = pte_offset_kernel(pm, ea);
-		}
-	}
-	return pt;
-}
-
-#ifdef CONFIG_HUGETLB_PAGE
-pte_t *find_linux_pte_or_hugepte(pgd_t *pgdir, unsigned long ea,
-				 unsigned *shift);
-#else
-static inline pte_t *find_linux_pte_or_hugepte(pgd_t *pgdir, unsigned long ea,
-					       unsigned *shift)
-{
-	if (shift)
-		*shift = 0;
-	return find_linux_pte(pgdir, ea);
-}
-#endif /* !CONFIG_HUGETLB_PAGE */
-
 #endif /* __ASSEMBLY__ */
 
 #endif /* _ASM_POWERPC_PGTABLE_PPC64_H_ */
diff --git a/arch/powerpc/include/asm/pgtable.h b/arch/powerpc/include/asm/pgtable.h
index b6293d2..690c8c2 100644
--- a/arch/powerpc/include/asm/pgtable.h
+++ b/arch/powerpc/include/asm/pgtable.h
@@ -217,6 +217,43 @@ extern int gup_hugepd(hugepd_t *hugepd, unsigned pdshift, unsigned long addr,
 
 extern int gup_hugepte(pte_t *ptep, unsigned long sz, unsigned long addr,
 		       unsigned long end, int write, struct page **pages, int *nr);
+
+/*
+ * find_linux_pte returns the address of a linux pte for a given
+ * effective address and directory.  If not found, it returns zero.
+ */
+static inline pte_t *find_linux_pte(pgd_t *pgdir, unsigned long ea)
+{
+	pgd_t *pg;
+	pud_t *pu;
+	pmd_t *pm;
+	pte_t *pt = NULL;
+
+	pg = pgdir + pgd_index(ea);
+	if (!pgd_none(*pg)) {
+		pu = pud_offset(pg, ea);
+		if (!pud_none(*pu)) {
+			pm = pmd_offset(pu, ea);
+			if (pmd_present(*pm))
+				pt = pte_offset_kernel(pm, ea);
+		}
+	}
+	return pt;
+}
+
+#ifdef CONFIG_HUGETLB_PAGE
+pte_t *find_linux_pte_or_hugepte(pgd_t *pgdir, unsigned long ea,
+				 unsigned *shift);
+#else
+static inline pte_t *find_linux_pte_or_hugepte(pgd_t *pgdir, unsigned long ea,
+					       unsigned *shift)
+{
+	if (shift)
+		*shift = 0;
+	return find_linux_pte(pgdir, ea);
+}
+#endif /* !CONFIG_HUGETLB_PAGE */
+
 #endif /* __ASSEMBLY__ */
 
 #endif /* __KERNEL__ */
-- 
1.7.0.4



  parent reply	other threads:[~2013-08-01 11:12 UTC|newest]

Thread overview: 80+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-01 11:12 [PATCH 0/6 v2] kvm: powerpc: use cache attributes from linux pte Bharat Bhushan
2013-08-01 11:24 ` Bharat Bhushan
2013-08-01 11:12 ` [PATCH 1/6 v2] powerpc: book3e: _PAGE_LENDIAN must be _PAGE_ENDIAN Bharat Bhushan
2013-08-01 11:24   ` Bharat Bhushan
2013-08-01 11:12   ` Bharat Bhushan
2013-08-01 11:12 ` [PATCH 2/6 v2] kvm: powerpc: allow guest control "E" attribute in mas2 Bharat Bhushan
2013-08-01 11:24   ` Bharat Bhushan
2013-08-01 11:12   ` Bharat Bhushan
2013-08-01 11:12 ` [PATCH 3/6 v2] kvm: powerpc: allow guest control "G" " Bharat Bhushan
2013-08-01 11:24   ` Bharat Bhushan
2013-08-01 11:12   ` Bharat Bhushan
2013-08-02  6:39   ` "“tiejun.chen”"
2013-08-02  6:39     ` "“tiejun.chen”"
2013-08-02  6:39     ` "“tiejun.chen”"
2013-08-01 11:12 ` Bharat Bhushan [this message]
2013-08-01 11:24   ` [PATCH 4/6 v2] powerpc: move linux pte/hugepte search to more generic file Bharat Bhushan
2013-08-01 11:12   ` Bharat Bhushan
2013-08-01 11:12 ` [PATCH 5/6 v2] kvm: powerpc: booke: Add linux pte lookup like booke3s Bharat Bhushan
2013-08-01 11:24   ` Bharat Bhushan
2013-08-01 11:12   ` Bharat Bhushan
2013-08-02  6:37   ` "“tiejun.chen”"
2013-08-02  6:37     ` "“tiejun.chen”"
2013-08-02  6:37     ` "“tiejun.chen”"
2013-08-02 22:58   ` Scott Wood
2013-08-02 22:58     ` Scott Wood
2013-08-02 22:58     ` Scott Wood
2013-08-02 23:16     ` Benjamin Herrenschmidt
2013-08-02 23:16       ` Benjamin Herrenschmidt
2013-08-02 23:16       ` Benjamin Herrenschmidt
2013-08-03  2:58       ` Bhushan Bharat-R65777
2013-08-03  2:58         ` Bhushan Bharat-R65777
2013-08-03  2:58         ` Bhushan Bharat-R65777
2013-08-03  4:24         ` Benjamin Herrenschmidt
2013-08-03  4:24           ` Benjamin Herrenschmidt
2013-08-03  4:24           ` Benjamin Herrenschmidt
2013-08-05 14:27           ` Bhushan Bharat-R65777
2013-08-05 14:27             ` Bhushan Bharat-R65777
2013-08-05 14:27             ` Bhushan Bharat-R65777
2013-08-05 19:19             ` Scott Wood
2013-08-05 19:19               ` Scott Wood
2013-08-05 19:19               ` Scott Wood
2013-08-06  1:12               ` Bhushan Bharat-R65777
2013-08-06  1:12                 ` Bhushan Bharat-R65777
2013-08-06  1:12                 ` Bhushan Bharat-R65777
2013-08-06  7:02               ` Bhushan Bharat-R65777
2013-08-06  7:02                 ` Bhushan Bharat-R65777
2013-08-06  7:02                 ` Bhushan Bharat-R65777
2013-08-07  0:24                 ` Paul Mackerras
2013-08-07  0:24                   ` Paul Mackerras
2013-08-07  0:24                   ` Paul Mackerras
2013-08-07  1:11                   ` Scott Wood
2013-08-07  1:11                     ` Scott Wood
2013-08-07  1:11                     ` Scott Wood
2013-08-07  1:47                     ` Paul Mackerras
2013-08-07  1:47                       ` Paul Mackerras
2013-08-07  1:47                       ` Paul Mackerras
2013-08-06 14:46               ` Bhushan Bharat-R65777
2013-08-06 14:46                 ` Bhushan Bharat-R65777
2013-08-06 14:46                 ` Bhushan Bharat-R65777
2013-08-01 11:12 ` [PATCH 6/6 v2] kvm: powerpc: use caching attributes as per linux pte Bharat Bhushan
2013-08-01 11:24   ` Bharat Bhushan
2013-08-01 11:12   ` Bharat Bhushan
2013-08-02  6:24   ` "“tiejun.chen”"
2013-08-02  6:24     ` "“tiejun.chen”"
2013-08-02  6:24     ` "“tiejun.chen”"
2013-08-02 23:34   ` Scott Wood
2013-08-02 23:34     ` Scott Wood
2013-08-02 23:34     ` Scott Wood
2013-08-03  3:11     ` Bhushan Bharat-R65777
2013-08-03  3:11       ` Bhushan Bharat-R65777
2013-08-03  3:11       ` Bhushan Bharat-R65777
2013-08-03  4:25       ` Benjamin Herrenschmidt
2013-08-03  4:25         ` Benjamin Herrenschmidt
2013-08-03  4:25         ` Benjamin Herrenschmidt
2013-08-05 16:28         ` Scott Wood
2013-08-05 16:28           ` Scott Wood
2013-08-05 16:28           ` Scott Wood
2013-08-05 16:30       ` Scott Wood
2013-08-05 16:30         ` Scott Wood
2013-08-05 16:30         ` Scott Wood

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=1375355558-19187-5-git-send-email-Bharat.Bhushan@freescale.com \
    --to=r65777@freescale.com \
    --cc=Bharat.Bhushan@freescale.com \
    --cc=agraf@suse.de \
    --cc=benh@kernel.crashing.org \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=scottwood@freescale.com \
    /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.