All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gerd Knorr <kraxel@suse.de>
To: Keir Fraser <Keir.Fraser@cl.cam.ac.uk>
Cc: xen-devel@lists.xensource.com
Subject: Re: [patch] pae: tlbflush linear page table updates
Date: Wed, 10 Aug 2005 12:28:24 +0200	[thread overview]
Message-ID: <20050810102824.GB32246@bytesex> (raw)
In-Reply-To: <20050810102222.GA32246@bytesex>

> No, it's actually the changeset
> 6056:a1f7e01b0990a378584e718e6d48eac38824fdb9 which broke it.

And it isn't the mod_l3 update which broke PAE, it's the
__not_mapped() removal.  Applying the bits below reversed
makes PAE boot again.

  Gerd

diff -r 663f0fb1e444 -r a1f7e01b0990 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Tue Aug  9 09:34:06 2005
+++ b/xen/arch/x86/mm.c	Tue Aug  9 10:42:51 2005
@@ -2902,42 +2887,13 @@
     .cmpxchg8b_emulated = ptwr_emulated_cmpxchg8b
 };
 
-#if defined(__x86_64__)
-/*
- * Returns zero on if mapped, or -1 otherwise
- */
-static int __not_mapped(l2_pgentry_t *pl2e)
-{
-    unsigned long page = read_cr3();
-
-    page &= PAGE_MASK;
-    page = ((unsigned long *) __va(page))[l4_table_offset((unsigned long)pl2e)];
-    if ( !(page & _PAGE_PRESENT) ) 
-        return -1;        
-        
-    page &= PAGE_MASK;
-    page = ((unsigned long *) __va(page))[l3_table_offset((unsigned long)pl2e)];
-    if ( !(page & _PAGE_PRESENT) ) 
-        return -1;
-
-    page &= PAGE_MASK;
-    page = ((unsigned long *) __va(page))[l2_table_offset((unsigned long)pl2e)];
-    if ( !(page & _PAGE_PRESENT) )
-        return -1;
-
-    return 0;
-}
-#else
-#define __not_mapped(p) (0)
-#endif
-
 /* Write page fault handler: check if guest is trying to modify a PTE. */
 int ptwr_do_page_fault(struct domain *d, unsigned long addr)
 {
     unsigned long    pfn;
     struct pfn_info *page;
     l1_pgentry_t     pte;
-    l2_pgentry_t    *pl2e;
+    l2_pgentry_t    *pl2e, l2e;
     int              which;
     unsigned long    l2_idx;
 
@@ -2984,10 +2940,7 @@
     pl2e = &__linear_l2_table[l2_idx];
     which = PTWR_PT_INACTIVE;
 
-    if ( unlikely(__not_mapped(pl2e)) )
-        goto inactive;
-
-    if ( (l2e_get_pfn(*pl2e)) == pfn )
+    if ( (__get_user(l2e.l2, &pl2e->l2) == 0) && (l2e_get_pfn(l2e) == pfn) )
     {
         /*
          * Check the PRESENT bit to set ACTIVE mode.
@@ -2995,13 +2948,11 @@
          * ACTIVE p.t. (it may be the same p.t. mapped at another virt addr).
          * The ptwr_flush call below will restore the PRESENT bit.
          */
-        if ( likely(l2e_get_flags(*pl2e) & _PAGE_PRESENT) ||
+        if ( likely(l2e_get_flags(l2e) & _PAGE_PRESENT) ||
              (d->arch.ptwr[PTWR_PT_ACTIVE].l1va &&
               (l2_idx == d->arch.ptwr[PTWR_PT_ACTIVE].l2_idx)) )
             which = PTWR_PT_ACTIVE;
     }
-
-  inactive:
 
     /*
      * If this is a multi-processor guest then ensure that the page is hooked

  reply	other threads:[~2005-08-10 10:28 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-08 14:51 [patch] pae: tlbflush linear page table updates Gerd Knorr
2005-08-08 16:52 ` Keir Fraser
2005-08-09  7:54   ` Gerd Knorr
2005-08-09  8:06     ` Keir Fraser
2005-08-09 10:53       ` Keir Fraser
2005-08-09 13:52         ` Gerd Knorr
2005-08-09 15:44           ` Gerd Knorr
2005-08-09 16:14             ` Keir Fraser
2005-08-10 10:22               ` Gerd Knorr
2005-08-10 10:28                 ` Gerd Knorr [this message]
2005-08-10 10:54                   ` Keir Fraser
2005-08-10 12:33                     ` Gerd Knorr
2005-08-10 13:01                       ` Gerd Knorr
2005-08-10 13:11                         ` Keir Fraser
2005-08-10 13:57                           ` Gerd Knorr
2005-08-10 10:53                 ` Keir Fraser
  -- strict thread matches above, loose matches on Subject: below --
2005-08-12  9:02 Tian, Kevin
2005-08-12  9:17 ` Keir Fraser
2005-08-12  9:20   ` Andi Kleen
2005-08-12  9:49     ` Keir Fraser
2005-08-12  9:17 Tian, Kevin
2005-08-12  9:37 Tian, Kevin
2005-08-12  9:56 ` Andi Kleen
2005-08-12 10:18   ` Keir Fraser

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=20050810102824.GB32246@bytesex \
    --to=kraxel@suse.de \
    --cc=Keir.Fraser@cl.cam.ac.uk \
    --cc=xen-devel@lists.xensource.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.