linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Martin Schlemmer <azarah@gentoo.org>
To: William Lee Irwin III <wli@holomorphy.com>
Cc: Andrew Morton <akpm@osdl.org>,
	Thomas Schlichter <schlicht@uni-mannheim.de>,
	smiler@lanil.mine.nu, KML <linux-kernel@vger.kernel.org>,
	linux-mm@kvack.org
Subject: Re: 2.5.74-mm2 + nvidia (and others)
Date: 14 Jul 2003 14:09:37 +0200	[thread overview]
Message-ID: <1058184576.799.341.camel@workshop.saharacpt.lan> (raw)
In-Reply-To: <20030712012130.GB15452@holomorphy.com>

On Sat, 2003-07-12 at 03:21, William Lee Irwin III wrote:
> On Tue, Jul 08, 2003 at 09:03:39AM +0200, Martin Schlemmer wrote:
> > +#if defined(NV_PMD_OFFSET_UNMAP)
> > +    pmd_unmap(pg_mid_dir);
> > +#endif
> 
> You could try defining an NV_PMD_OFFSET_UNMAP() which is a nop for
> mainline and DTRT for -mm.
> 

Ok, I basically got the latest minion.de (2003/07/13) to look as
follow:

----------------------------------
diff -urpN NVIDIA_kernel-1.0-4363/nv-linux.h
NVIDIA_kernel-1.0-4363.highpmd-fixup/nv-linux.h
--- NVIDIA_kernel-1.0-4363/nv-linux.h   2003-07-14 12:42:00.000000000
+0200
+++ NVIDIA_kernel-1.0-4363.highpmd-fixup/nv-linux.h     2003-07-14
13:38:02.000000000 +0200
@@ -228,14 +228,14 @@

 #if defined(pmd_offset_map)
 #define NV_PMD_OFFSET(address, pgd, pmd) \
-    { \
-        pmd_t *pmd__ = pmd_offset_map(pgd, address); \
-        pmd = *pmd__; \
-        pmd_unmap(pgd__); \
-    }
+    pmd = pmd_offset_map(pgd, address)
+#define NV_PMD_UNMAP(pmd) \
+    pmd_unmap(pmd)
 #else
 #define NV_PMD_OFFSET(address, pgd, pmd) \
-    pmd = *pmd_offset(pgd, address)
+    pmd = pmd_offset(pgd, address)
+#define NV_PMD_UNMAP(pmd) \
+    nop()
 #endif 

 #define NV_PAGE_ALIGN(addr)             ( ((addr) + PAGE_SIZE - 1) /
PAGE_SIZE)
diff -urpN NVIDIA_kernel-1.0-4363/nv.c
NVIDIA_kernel-1.0-4363.highpmd-fixup/nv.c
--- NVIDIA_kernel-1.0-4363/nv.c 2003-07-14 12:42:00.000000000 +0200
+++ NVIDIA_kernel-1.0-4363.highpmd-fixup/nv.c   2003-07-14
13:38:43.000000000 +0200
@@ -2087,7 +2087,7 @@ unsigned long
 nv_get_phys_address(unsigned long address)
 {
     pgd_t *pgd;
-    pmd_t pmd;
+    pmd_t *pmd;
     pte_t pte;
 
 #if defined(NVCPU_IA64)
@@ -2110,10 +2110,14 @@ nv_get_phys_address(unsigned long addres

     NV_PMD_OFFSET(address, pgd, pmd);
 
-    if (pmd_none(pmd))
+    if (pmd_none(*pmd)) {
+        NV_PMD_UNMAP(pmd);
         goto failed;
+    }
+
+    NV_PTE_OFFSET(address, pmd, pte);
 
-    NV_PTE_OFFSET(address, &pmd, pte);
+    NV_PMD_UNMAP(pmd);

     if (!pte_present(pte))
         goto failed;
----------------------------------

so that it will not use a copy of 'pmd' that was already
unmapped.

Question now - what about:

--------------------- nv-linux.h ----------------------
#if defined(pte_offset_atomic)
#define NV_PTE_OFFSET(addres, pmd, pte) \
    { \
        pte_t *pte__ = pte_offset_atomic(pmd, address); \
        pte = *pte__; \
        pte_kunmap(pte__); \
    } 
#elif defined(pte_offset)
#define NV_PTE_OFFSET(addres, pmd, pte) \
    pte = *pte_offset(pmd, address)
#else
#define NV_PTE_OFFSET(addres, pmd, pte) \
    { \
        pte_t *pte__ = pte_offset_map(pmd, address); \
        pte = *pte__; \
        pte_unmap(pte__); \
    }
#endif
-------------------------------------------------------

I cannot think that it is safe as well to use an copy
of an unmapped pte ??  Should this be fixed as well ?


Thanks,

-- 
Martin Schlemmer



  reply	other threads:[~2003-07-14 11:54 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-07 15:08 2.5.74-mm2 + nvidia (and others) Christian Axelsson
2003-07-07 15:33 ` Thomas Schlichter
2003-07-07 17:09   ` Christian Axelsson
2003-07-07 19:30   ` Andrew Morton
2003-07-08  7:03     ` Martin Schlemmer
2003-07-08  7:26       ` William Lee Irwin III
2003-07-08  8:51         ` Thomas Schlichter
2003-07-08  8:55           ` William Lee Irwin III
2003-07-08  9:37             ` Peter C. Ndikuwera
2003-07-08 11:01               ` Petr Vandrovec
2003-07-08 11:23                 ` Flameeyes
2003-07-08 11:26                   ` William Lee Irwin III
2003-07-08 11:35                   ` Christian Axelsson
2003-07-08 11:40       ` Christian Axelsson
2003-07-12  1:21       ` William Lee Irwin III
2003-07-14 12:09         ` Martin Schlemmer [this message]
2003-07-14 16:51           ` Thomas Schlichter
2003-07-07 23:08 ` William Lee Irwin III
2003-07-08 12:37 Petr Vandrovec
2003-07-08 12:57 ` Flameeyes
2003-07-08 13:02 ` Christian Axelsson
2003-07-08 13:07   ` Petr Vandrovec

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=1058184576.799.341.camel@workshop.saharacpt.lan \
    --to=azarah@gentoo.org \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=schlicht@uni-mannheim.de \
    --cc=smiler@lanil.mine.nu \
    --cc=wli@holomorphy.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).