From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: LKML <linux-kernel@vger.kernel.org>, Andi Kleen <ak@suse.de>,
Glauber de Oliveira Costa <glommer@gmail.com>,
Jan Beulich <jbeulich@novell.com>
Subject: [PATCH 7 of 8] x86/paravirt: make set_pmd operation common
Date: Wed, 16 Jan 2008 15:27:25 -0800 [thread overview]
Message-ID: <83201cf4ab6622f6bfdd.1200526045@localhost> (raw)
In-Reply-To: <patchbomb.1200526038@localhost>
Remove duplicate set_pmd()s.
Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
---
include/asm-x86/paravirt.h | 43 ++++++++++++++++++++-----------------------
1 file changed, 20 insertions(+), 23 deletions(-)
diff --git a/include/asm-x86/paravirt.h b/include/asm-x86/paravirt.h
--- a/include/asm-x86/paravirt.h
+++ b/include/asm-x86/paravirt.h
@@ -998,6 +998,16 @@ static inline void set_pte_at(struct mm_
PVOP_VCALL4(pv_mmu_ops.set_pte_at, mm, addr, ptep, pte.pte);
}
+static inline void set_pmd(pmd_t *pmdp, pmd_t pmd)
+{
+ pmdval_t val = native_pmd_val(pmd);
+
+ if (sizeof(pmdval_t) > sizeof(long))
+ PVOP_VCALL3(pv_mmu_ops.set_pmd, pmdp, val, (u64)val >> 32);
+ else
+ PVOP_VCALL2(pv_mmu_ops.set_pmd, pmdp, val);
+}
+
#ifdef CONFIG_X86_PAE
/* Special-case pte-setting operations for PAE, which can't update a
64-bit pte atomically */
@@ -1019,6 +1029,11 @@ static inline void pte_clear(struct mm_s
{
PVOP_VCALL3(pv_mmu_ops.pte_clear, mm, addr, ptep);
}
+
+static inline void pmd_clear(pmd_t *pmdp)
+{
+ PVOP_VCALL1(pv_mmu_ops.pmd_clear, pmdp);
+}
#else /* !CONFIG_X86_PAE */
static inline void set_pte_atomic(pte_t *ptep, pte_t pte)
{
@@ -1035,6 +1050,11 @@ static inline void pte_clear(struct mm_s
pte_t *ptep)
{
set_pte_at(mm, addr, ptep, __pte(0));
+}
+
+static inline void pmd_clear(pmd_t *pmdp)
+{
+ set_pmd(pmdp, __pmd(0));
}
#endif /* CONFIG_X86_PAE */
@@ -1070,33 +1090,10 @@ static inline pmdval_t pmd_val(pmd_t pmd
#ifdef CONFIG_X86_PAE
-static inline void set_pmd(pmd_t *pmdp, pmd_t pmdval)
-{
- PVOP_VCALL3(pv_mmu_ops.set_pmd, pmdp,
- pmdval.pmd, pmdval.pmd >> 32);
-}
-
static inline void set_pud(pud_t *pudp, pud_t pudval)
{
PVOP_VCALL3(pv_mmu_ops.set_pud, pudp,
pudval.pgd.pgd, pudval.pgd.pgd >> 32);
-}
-
-static inline void pmd_clear(pmd_t *pmdp)
-{
- PVOP_VCALL1(pv_mmu_ops.pmd_clear, pmdp);
-}
-
-#else /* !CONFIG_X86_PAE */
-
-static inline void set_pmd(pmd_t *pmdp, pmd_t pmdval)
-{
- PVOP_VCALL2(pv_mmu_ops.set_pmd, pmdp, pmdval.pud.pgd.pgd);
-}
-
-static inline void pmd_clear(pmd_t *pmdp)
-{
- set_pmd(pmdp, __pmd(0));
}
#endif /* CONFIG_X86_PAE */
next prev parent reply other threads:[~2008-01-17 2:30 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-16 23:27 [PATCH 0 of 8] x86: refactored paravirt mmu_ops Jeremy Fitzhardinge
2008-01-16 23:27 ` [PATCH 1 of 8] add native_pud_val and _pmd_val for 2 and 3 level pagetables Jeremy Fitzhardinge
2008-01-16 23:27 ` [PATCH 2 of 8] x86/paravirt: rearrange common mmu_ops Jeremy Fitzhardinge
2008-01-16 23:27 ` [PATCH 3 of 8] x86/paravirt: common implementation for pte value ops Jeremy Fitzhardinge
2008-01-16 23:27 ` [PATCH 4 of 8] x86/paravirt: common implementation for pgd " Jeremy Fitzhardinge
2008-01-16 23:27 ` [PATCH 5 of 8] x86/paravirt: common implementation for pmd " Jeremy Fitzhardinge
2008-01-16 23:27 ` [PATCH 6 of 8] x86/paravirt: make set_pte operations common Jeremy Fitzhardinge
2008-01-16 23:27 ` Jeremy Fitzhardinge [this message]
2008-01-16 23:27 ` [PATCH 8 of 8] x86/paravirt: make set_pud operation common Jeremy Fitzhardinge
2008-01-17 7:01 ` [PATCH 0 of 8] x86: refactored paravirt mmu_ops Ingo Molnar
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=83201cf4ab6622f6bfdd.1200526045@localhost \
--to=jeremy@goop.org \
--cc=ak@suse.de \
--cc=glommer@gmail.com \
--cc=jbeulich@novell.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/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.