All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: LKML <linux-kernel@vger.kernel.org>, Ian Campbell <ijc@hellion.org.uk>
Subject: [PATCH 17 of 31] xen: make use of pte_t union
Date: Mon, 17 Mar 2008 16:37:08 -0700	[thread overview]
Message-ID: <8355eaf061e8fd74996c.1205797028@localhost> (raw)
In-Reply-To: <patchbomb.1205797011@localhost>

pte_t always contains a "pte" field for the whole pte value, so make
use of it.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
---
 arch/x86/xen/mmu.c |   26 ++++++++++++--------------
 1 file changed, 12 insertions(+), 14 deletions(-)

diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -216,12 +216,10 @@
 
 pteval_t xen_pte_val(pte_t pte)
 {
-	pteval_t ret = 0;
+	pteval_t ret = pte.pte;
 
-	if (pte.pte_low) {
-		ret = ((pteval_t)pte.pte_high << 32) | pte.pte_low;
-		ret = machine_to_phys(XMADDR(ret)).paddr | 1;
-	}
+	if (ret & _PAGE_PRESENT)
+		ret = machine_to_phys(XMADDR(ret)).paddr | _PAGE_PRESENT;
 
 	return ret;
 }
@@ -229,16 +227,16 @@
 pmdval_t xen_pmd_val(pmd_t pmd)
 {
 	pmdval_t ret = pmd.pmd;
-	if (ret)
-		ret = machine_to_phys(XMADDR(ret)).paddr | 1;
+	if (ret & _PAGE_PRESENT)
+		ret = machine_to_phys(XMADDR(ret)).paddr | _PAGE_PRESENT;
 	return ret;
 }
 
 pgdval_t xen_pgd_val(pgd_t pgd)
 {
 	pgdval_t ret = pgd.pgd;
-	if (ret)
-		ret = machine_to_phys(XMADDR(ret)).paddr | 1;
+	if (ret & _PAGE_PRESENT)
+		ret = machine_to_phys(XMADDR(ret)).paddr | _PAGE_PRESENT;
 	return ret;
 }
 
@@ -254,7 +252,7 @@
 
 pmd_t xen_make_pmd(pmdval_t pmd)
 {
-	if (pmd & 1)
+	if (pmd & _PAGE_PRESENT)
 		pmd = phys_to_machine(XPADDR(pmd)).maddr;
 
 	return (pmd_t){ pmd };
@@ -275,7 +273,7 @@
 
 pteval_t xen_pte_val(pte_t pte)
 {
-	pteval_t ret = pte.pte_low;
+	pteval_t ret = pte.pte;
 
 	if (ret & _PAGE_PRESENT)
 		ret = machine_to_phys(XMADDR(ret)).paddr;
@@ -286,8 +284,8 @@
 pgdval_t xen_pgd_val(pgd_t pgd)
 {
 	pteval_t ret = pgd.pgd;
-	if (ret)
-		ret = machine_to_phys(XMADDR(ret)).paddr | 1;
+	if (ret & _PAGE_PRESENT)
+		ret = machine_to_phys(XMADDR(ret)).paddr | _PAGE_PRESENT;
 	return ret;
 }
 



  parent reply	other threads:[~2008-03-18  5:29 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-17 23:36 [PATCH 00 of 31] x86: unification and xen updates Jeremy Fitzhardinge
2008-03-17 23:36 ` [PATCH 01 of 31] xen: fix RMW when unmasking events Jeremy Fitzhardinge
2008-03-17 23:36   ` Jeremy Fitzhardinge
2008-03-17 23:36 ` [PATCH 02 of 31] xen: fix UP setup of shared_info Jeremy Fitzhardinge
2008-03-17 23:36   ` Jeremy Fitzhardinge
2008-03-17 23:36 ` [PATCH 03 of 31] x86: convert pgalloc_64.h from macros to inlines Jeremy Fitzhardinge
2008-03-17 23:36 ` [PATCH 04 of 31] x86: add common mm/pgtable.c Jeremy Fitzhardinge
2008-03-17 23:36 ` [PATCH 05 of 31] x86: put paravirt stubs into common asm/pgalloc.h Jeremy Fitzhardinge
2008-03-17 23:36 ` [PATCH 06 of 31] x86: move pte functions " Jeremy Fitzhardinge
2008-03-17 23:36 ` [PATCH 07 of 31] x86: move pmd " Jeremy Fitzhardinge
2008-03-17 23:36 ` [PATCH 08 of 31] x86: move pgalloc pud and pgd operations into common place Jeremy Fitzhardinge
2008-03-17 23:37 ` [PATCH 09 of 31] x86: move all the pgd_list handling to one place Jeremy Fitzhardinge
2008-03-17 23:37 ` [PATCH 10 of 31] x86: rename paravirt_alloc_pt etc after the pagetable structure Jeremy Fitzhardinge
2008-03-17 23:37 ` [PATCH 11 of 31] x86: add pud_alloc for 4-level pagetables Jeremy Fitzhardinge
2008-03-17 23:37 ` [PATCH 12 of 31] x86/pgtable.h: demacro ptep_set_access_flags Jeremy Fitzhardinge
2008-03-17 23:37 ` [PATCH 13 of 31] x86/pgtable.h: demacro ptep_test_and_clear_young Jeremy Fitzhardinge
2008-03-17 23:37 ` [PATCH 14 of 31] x86/pgtable.h: demacro ptep_clear_flush_young Jeremy Fitzhardinge
2008-03-17 23:37 ` [PATCH 15 of 31] x86: demacro pgalloc paravirt stubs Jeremy Fitzhardinge
2008-03-17 23:37 ` [PATCH 16 of 31] xen: use appropriate pte types Jeremy Fitzhardinge
2008-03-17 23:37 ` Jeremy Fitzhardinge [this message]
2008-03-17 23:37 ` [PATCH 18 of 31] xen: unify pte operations Jeremy Fitzhardinge
2008-03-17 23:37 ` [PATCH 19 of 31] xen: use phys_addr_t when referring to physical addresses Jeremy Fitzhardinge
2008-03-17 23:37 ` [PATCH 20 of 31] xen: unify pte operations on machine frames Jeremy Fitzhardinge
2008-03-17 23:37 ` [PATCH 21 of 31] xen: make sure iret faults are trapped Jeremy Fitzhardinge
2008-03-17 23:37 ` [PATCH 22 of 31] x86: unify KERNEL_PGD_PTRS Jeremy Fitzhardinge
2008-03-17 23:37 ` [PATCH 23 of 31] x86: unify pgd ctor/dtor Jeremy Fitzhardinge
2008-03-17 23:37 ` [PATCH 24 of 31] xen: add support for callbackops hypercall Jeremy Fitzhardinge
2008-03-17 23:37 ` [PATCH 25 of 31] x86: only enable interrupts when kernel state has been set up Jeremy Fitzhardinge
2008-03-17 23:37 ` [PATCH 26 of 31] xen: support sysenter/sysexit if hypervisor does Jeremy Fitzhardinge
2008-03-17 23:37 ` [PATCH 27 of 31] xen: implement a debug-interrupt handler Jeremy Fitzhardinge
2008-03-17 23:37 ` [PATCH 28 of 31] xen: make sure retriggered events are set pending Jeremy Fitzhardinge
2008-03-17 23:37 ` [PATCH 29 of 31] xen: short-cut for recursive event handling Jeremy Fitzhardinge
2008-03-17 23:37 ` [PATCH 30 of 31] xen: no need for domU to worry about MCE/MCA Jeremy Fitzhardinge
2008-03-17 23:37 ` [PATCH 31 of 31] xen: jump to iret fixup Jeremy Fitzhardinge
2008-03-18 21:33 ` [PATCH 00 of 31] x86: unification and xen updates Zachary Amsden
2008-03-18 21:37   ` Jeremy Fitzhardinge
2008-03-19  9:22 ` Ian Campbell
2008-03-19 15:11   ` Jeremy Fitzhardinge
2008-03-19 16:50     ` Ian Campbell
2008-03-19 18:45       ` Jeremy Fitzhardinge
2008-03-19 19:07     ` Ingo Molnar
2008-03-19 19:19       ` Jeremy Fitzhardinge
2008-03-19 19:05 ` Ingo Molnar
2008-03-19 19:46   ` Ingo Molnar
2008-03-19 20:02     ` Jeremy Fitzhardinge
2008-03-19 20:09       ` Ingo Molnar
2008-03-19 21:12         ` Jeremy Fitzhardinge
2008-03-19 21:33         ` Ingo Molnar
2008-03-19 21:54           ` Jeremy Fitzhardinge
2008-03-19 22:00             ` Ingo Molnar
2008-03-19 21:58               ` Jeremy Fitzhardinge
2008-03-19 22:04                 ` Ingo Molnar
2008-03-19 22:15                   ` Jeremy Fitzhardinge
2008-03-19 23:52                     ` Ingo Molnar
2008-03-20 20:24                       ` Jeremy Fitzhardinge
2008-03-21 13:17                         ` Ingo Molnar
2008-03-21 14:35                           ` Ingo Molnar
2008-03-21 15:15                             ` Jeremy Fitzhardinge
2008-03-21 15:25                               ` Ingo Molnar
2008-03-22  2:34                                 ` Jeremy Fitzhardinge

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=8355eaf061e8fd74996c.1205797028@localhost \
    --to=jeremy@goop.org \
    --cc=ijc@hellion.org.uk \
    --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.