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 3 of 8] x86/paravirt: common implementation for pte value ops
Date: Wed, 16 Jan 2008 15:27:21 -0800 [thread overview]
Message-ID: <ee3af933339f011538a0.1200526041@localhost> (raw)
In-Reply-To: <patchbomb.1200526038@localhost>
Remove duplicate __pte/pte_val functions.
Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
---
include/asm-x86/paravirt.h | 48 ++++++++++++++++++++++++--------------------
1 file changed, 27 insertions(+), 21 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
@@ -920,15 +920,37 @@ static inline void pte_update_defer(stru
PVOP_VCALL3(pv_mmu_ops.pte_update_defer, mm, addr, ptep);
}
-#ifdef CONFIG_X86_PAE
-static inline pte_t __pte(unsigned long long val)
+static inline pte_t __pte(pteval_t val)
{
- unsigned long long ret = PVOP_CALL2(unsigned long long,
- pv_mmu_ops.make_pte,
- val, val >> 32);
+ pteval_t ret;
+
+ if (sizeof(pteval_t) > sizeof(long))
+ ret = PVOP_CALL2(pteval_t,
+ pv_mmu_ops.make_pte,
+ val, (u64)val >> 32);
+ else
+ ret = PVOP_CALL1(pteval_t,
+ pv_mmu_ops.make_pte,
+ val);
+
return (pte_t) { .pte = ret };
}
+static inline pteval_t pte_val(pte_t pte)
+{
+ pteval_t ret;
+
+ if (sizeof(pteval_t) > sizeof(long))
+ ret = PVOP_CALL2(pteval_t, pv_mmu_ops.pte_val,
+ pte.pte, (u64)pte.pte >> 32);
+ else
+ ret = PVOP_CALL1(pteval_t, pv_mmu_ops.pte_val,
+ pte.pte);
+
+ return ret;
+}
+
+#ifdef CONFIG_X86_PAE
static inline pmd_t __pmd(unsigned long long val)
{
return (pmd_t) { PVOP_CALL2(unsigned long long, pv_mmu_ops.make_pmd,
@@ -939,12 +961,6 @@ static inline pgd_t __pgd(unsigned long
{
return (pgd_t) { PVOP_CALL2(unsigned long long, pv_mmu_ops.make_pgd,
val, val >> 32) };
-}
-
-static inline unsigned long long pte_val(pte_t x)
-{
- return PVOP_CALL2(unsigned long long, pv_mmu_ops.pte_val,
- x.pte_low, x.pte_high);
}
static inline unsigned long long pmd_val(pmd_t x)
@@ -1008,19 +1024,9 @@ static inline void pmd_clear(pmd_t *pmdp
#else /* !CONFIG_X86_PAE */
-static inline pte_t __pte(unsigned long val)
-{
- return (pte_t) { PVOP_CALL1(unsigned long, pv_mmu_ops.make_pte, val) };
-}
-
static inline pgd_t __pgd(unsigned long val)
{
return (pgd_t) { PVOP_CALL1(unsigned long, pv_mmu_ops.make_pgd, val) };
-}
-
-static inline unsigned long pte_val(pte_t x)
-{
- return PVOP_CALL1(unsigned long, pv_mmu_ops.pte_val, x.pte_low);
}
static inline unsigned long pgd_val(pgd_t x)
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 ` Jeremy Fitzhardinge [this message]
2008-01-16 23:27 ` [PATCH 4 of 8] x86/paravirt: common implementation for pgd value ops 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 ` [PATCH 7 of 8] x86/paravirt: make set_pmd operation common Jeremy Fitzhardinge
2008-01-16 23:27 ` [PATCH 8 of 8] x86/paravirt: make set_pud " 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=ee3af933339f011538a0.1200526041@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.