1. 22 Nov, 2005 17 commits
    • Hugh Dickins's avatar
      [PATCH] unpaged: anon in VM_UNPAGED · ee498ed7
      Hugh Dickins authored
      copy_one_pte needs to copy the anonymous COWed pages in a VM_UNPAGED area,
      zap_pte_range needs to free them, do_wp_page needs to COW them: just like
      ordinary pages, not like the unpaged.
      
      But recognizing them is a little subtle: because PageReserved is no longer a
      condition for remap_pfn_range, we can now mmap all of /dev/mem (whether the
      distro permits, and whether it's advisable on this or that architecture, is
      another matter).  So if we can see a PageAnon, it may not be ours to mess with
      (or may be ours from elsewhere in the address space).  I suspect there's an
      entertaining insoluble self-referential problem here, but the page_is_anon
      function does a good practical job, and MAP_PRIVATE PROT_WRITE VM_UNPAGED will
      always be an odd choice.
      
      In updating the comment on page_address_in_vma, noticed a potential NULL
      dereference, in a path we don't actually take, but fixed it.
      Signed-off-by: default avatarHugh Dickins <hugh@veritas.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      ee498ed7
    • Hugh Dickins's avatar
      [PATCH] unpaged: COW on VM_UNPAGED · 920fc356
      Hugh Dickins authored
      Remove the BUG_ON(vma->vm_flags & VM_UNPAGED) from do_wp_page, and let it do
      Copy-On-Write without touching the VM_UNPAGED's page counts - but this is
      incomplete, because the anonymous page it inserts will itself need to be
      handled, here and in other functions - next patch.
      
      We still don't copy the page if the pfn is invalid, because the
      copy_user_highpage interface does not allow it.  But that's not been a problem
      in the past: can be added in later if the need arises.
      Signed-off-by: default avatarHugh Dickins <hugh@veritas.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      920fc356
    • Hugh Dickins's avatar
      [PATCH] unpaged: VM_NONLINEAR VM_RESERVED · 101d2be7
      Hugh Dickins authored
      There's one peculiar use of VM_RESERVED which the previous patch left behind:
      because VM_NONLINEAR's try_to_unmap_cluster uses vm_private_data as a swapout
      cursor, but should never meet VM_RESERVED vmas, it was a way of extending
      VM_NONLINEAR to VM_RESERVED vmas using vm_private_data for some other purpose.
       But that's an empty set - they don't have the populate function required.  So
      just throw away those VM_RESERVED tests.
      
      But one more interesting in rmap.c has to go too: try_to_unmap_one will want
      to swap out an anonymous page from VM_RESERVED or VM_UNPAGED area.
      Signed-off-by: default avatarHugh Dickins <hugh@veritas.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      101d2be7
    • Hugh Dickins's avatar
      [PATCH] unpaged: VM_UNPAGED · 0b14c179
      Hugh Dickins authored
      Although we tend to associate VM_RESERVED with remap_pfn_range, quite a few
      drivers set VM_RESERVED on areas which are then populated by nopage.  The
      PageReserved removal in 2.6.15-rc1 changed VM_RESERVED not to free pages in
      zap_pte_range, without changing those drivers not to set it: so their pages
      just leak away.
      
      Let's not change miscellaneous drivers now: introduce VM_UNPAGED at the core,
      to flag the special areas where the ptes may have no struct page, or if they
      have then it's not to be touched.  Replace most instances of VM_RESERVED in
      core mm by VM_UNPAGED.  Force it on in remap_pfn_range, and the sparc and
      sparc64 io_remap_pfn_range.
      
      Revert addition of VM_RESERVED to powerpc vdso, it's not needed there.  Is it
      needed anywhere?  It still governs the mm->reserved_vm statistic, and special
      vmas not to be merged, and areas not to be core dumped; but could probably be
      eliminated later (the drivers are probably specifying it because in 2.4 it
      kept swapout off the vma, but in 2.6 we work from the LRU, which these pages
      don't get on).
      
      Use the VM_SHM slot for VM_UNPAGED, and define VM_SHM to 0: it serves no
      purpose whatsoever, and should be removed from drivers when we clean up.
      Signed-off-by: default avatarHugh Dickins <hugh@veritas.com>
      Acked-by: default avatarWilliam Irwin <wli@holomorphy.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      0b14c179
    • Hugh Dickins's avatar
      [PATCH] unpaged: unifdefed PageCompound · 664beed0
      Hugh Dickins authored
      It looks like snd_xxx is not the only nopage to be using PageReserved as a way
      of holding a high-order page together: which no longer works, but is masked by
      our failure to free from VM_RESERVED areas.  We cannot fix that bug without
      first substituting another way to hold the high-order page together, while
      farming out the 0-order pages from within it.
      
      That's just what PageCompound is designed for, but it's been kept under
      CONFIG_HUGETLB_PAGE.  Remove the #ifdefs: which saves some space (out- of-line
      put_page), doesn't slow down what most needs to be fast (already using
      hugetlb), and unifies the way we handle high-order pages.
      Signed-off-by: default avatarHugh Dickins <hugh@veritas.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      664beed0
    • Hugh Dickins's avatar
      [PATCH] unpaged: sound nopage get_page · 1cdca61b
      Hugh Dickins authored
      Something noticed when studying use of VM_RESERVED in different drivers:
      snd_usX2Y_hwdep_pcm_vm_nopage omitted to get_page: fixed.
      
      And how did this work before?  Aargh!  That nopage is returning a page from
      within a buffer allocated by snd_malloc_pages, which allocates a high-order
      page, then does SetPageReserved on each 0-order page within.
      
      That would have worked in 2.6.14, because when the area was unmapped,
      PageReserved inhibited put_page.  2.6.15-rc1 removed that inhibition (while
      leaving ineffective PageReserveds around for now), but it hasn't caused
      trouble because..  we've not been freeing from VM_RESERVED at all.
      Signed-off-by: default avatarHugh Dickins <hugh@veritas.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      1cdca61b
    • Hugh Dickins's avatar
      [PATCH] unpaged: private write VM_RESERVED · 83e9b7e9
      Hugh Dickins authored
      The PageReserved removal in 2.6.15-rc1 issued a "deprecated" message when you
      tried to mmap or mprotect MAP_PRIVATE PROT_WRITE a VM_RESERVED, and failed
      with -EACCES: because do_wp_page lacks the refinement to COW pages in those
      areas, nor do we expect to find anonymous pages in them; and it seemed just
      bloat to add code for handling such a peculiar case.  But immediately it
      caused vbetool and ddcprobe (using lrmi) to fail.
      
      So revert the "deprecated" messages, letting mmap and mprotect succeed.  But
      leave do_wp_page's BUG_ON(vma->vm_flags & VM_RESERVED) in place until we've
      added the code to do it right: so this particular patch is only good if the
      app doesn't really need to write to that private area.
      Signed-off-by: default avatarHugh Dickins <hugh@veritas.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      83e9b7e9
    • Hugh Dickins's avatar
      [PATCH] unpaged: get_user_pages VM_RESERVED · ed5297a9
      Hugh Dickins authored
      The PageReserved removal in 2.6.15-rc1 prohibited get_user_pages on the areas
      flagged VM_RESERVED in place of PageReserved.  That is correct in theory - we
      ought not to interfere with struct pages in such a reserved area; but in
      practice it broke BTTV for one.
      
      So revert to prohibiting only on VM_IO: if someone gets into trouble with
      get_user_pages on VM_RESERVED, it'll just be a "don't do that".
      
      You can argue that videobuf_mmap_mapper shouldn't set VM_RESERVED in the first
      place, but now's not the time for breaking drivers without notice.
      Signed-off-by: default avatarHugh Dickins <hugh@veritas.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      ed5297a9
    • Jeff Dike's avatar
      [PATCH] uml: eliminate use of libc PAGE_SIZE · aa1a64ee
      Jeff Dike authored
      On some systems, libc PAGE_SIZE calls getpagesize, which can't happen from a
      stub.  So, I use UM_KERN_PAGE_SIZE, which is less variable in its definition,
      instead.
      Signed-off-by: default avatarJeff Dike <jdike@addtoit.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      aa1a64ee
    • Jeff Dike's avatar
      [PATCH] uml: properly invoke x86_64 system calls · 17d46971
      Jeff Dike authored
      This patch makes stub_segv use the stub_syscall macros.  This was needed
      anyway, but the bug that prompted this was the discovery that gcc was storing
      stuff in RCX, which is trashed across a system call.  This is exactly the sort
      of problem that the new macros fix.
      
      There is a stub_syscall0 for getpid.  stub_segv was changed to be a libc file,
      and that caused some include changes.
      Signed-off-by: default avatarJeff Dike <jdike@addtoit.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      17d46971
    • Jeff Dike's avatar
      [PATCH] uml: eliminate anonymous union and clean up symlink lossage · e23181de
      Jeff Dike authored
      This gives a name to the anonymous union introduced in skas-hold-own-ldt,
      allowing to build on a wider range of gccs.
      
      It also removes ldt.h, which somehow became real, and replaces it with a
      symlink, and creates ldt-x86_64.h as a copy of ldt-i386.h for now.
      Signed-off-by: default avatarJeff Dike <jdike@addtoit.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      e23181de
    • Jeff Dike's avatar
      [PATCH] uml: eliminate use of local in clone stub · 39d730ab
      Jeff Dike authored
      We have a bug in the i386 stub_syscall6 which pushes ebp before the system
      call and pops it afterwards.  Because we use syscall6 to remap the stack, the
      old contents of the stack (and the former value of ebp) are no longer
      available.  Some versions of gcc make from a real local, accessed through ebp,
      despite my efforts to make it obvious that references to from are really
      constants.  This patch attempts to make it even more obvious by eliminating
      from and using a macro to access the stub's data explicitly with constants.
      
      My original thinking on this was to replace syscall6 with a remap_stack
      interface which saved ebp someplace and restored it afterwards.  The problem
      is that there are no registers to put it in, except for esp.  That could work,
      since we can store a constant in esp after the mmap because we just replaced
      the stack.  However, this approach seems a tad cleaner.
      Signed-off-by: default avatarJeff Dike <jdike@addtoit.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      39d730ab
    • Richard Knutsson's avatar
      [PATCH] net: Fix compiler-error on dgrs.c when !CONFIG_PCI · 18317ab0
      Richard Knutsson authored
      drivers/net/dgrs.c: In function `dgrs_init_module':
      drivers/net/dgrs.c:1598: `dgrs_pci_driver' undeclared (first use in this function)
      Signed-off-by: default avatarRichard Knutsson <ricknu-0@student.ltu.se>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      18317ab0
    • Linus Torvalds's avatar
    • Linus Torvalds's avatar
      5ea8051a
    • Linus Torvalds's avatar
      66b5920f
    • Linus Torvalds's avatar
  2. 21 Nov, 2005 23 commits