1. 21 6月, 2009 1 次提交
    • L
      x86, 64-bit: Clean up user address masking · 9063c61f
      Linus Torvalds 提交于
      The discussion about using "access_ok()" in get_user_pages_fast() (see
      commit 7f818906: "x86: don't use
      'access_ok()' as a range check in get_user_pages_fast()" for details and
      end result), made us notice that x86-64 was really being very sloppy
      about virtual address checking.
      
      So be way more careful and straightforward about masking x86-64 virtual
      addresses:
      
       - All the VIRTUAL_MASK* variants now cover half of the address
         space, it's not like we can use the full mask on a signed
         integer, and the larger mask just invites mistakes when
         applying it to either half of the 48-bit address space.
      
       - /proc/kcore's kc_offset_to_vaddr() becomes a lot more
         obvious when it transforms a file offset into a
         (kernel-half) virtual address.
      
       - Unify/simplify the 32-bit and 64-bit USER_DS definition to
         be based on TASK_SIZE_MAX.
      
      This cleanup and more careful/obvious user virtual address checking also
      uncovered a buglet in the x86-64 implementation of strnlen_user(): it
      would do an "access_ok()" check on the whole potential area, even if the
      string itself was much shorter, and thus return an error even for valid
      strings. Our sloppy checking had hidden this.
      
      So this fixes 'strnlen_user()' to do this properly, the same way we
      already handled user strings in 'strncpy_from_user()'.  Namely by just
      checking the first byte, and then relying on fault handling for the
      rest.  That always works, since we impose a guard page that cannot be
      mapped at the end of the user space address space (and even if we
      didn't, we'd have the address space hole).
      Acked-by: NIngo Molnar <mingo@elte.hu>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Nick Piggin <npiggin@suse.de>
      Cc: Hugh Dickins <hugh.dickins@tiscali.co.uk>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      9063c61f
  2. 19 6月, 2009 2 次提交
  3. 18 6月, 2009 2 次提交
  4. 17 6月, 2009 9 次提交
  5. 15 6月, 2009 10 次提交
  6. 14 6月, 2009 1 次提交
    • R
      x86: atomic_32.h: Fix kernel-doc warnings · 46e44328
      Randy Dunlap 提交于
      Fix kernel-doc warnings in atomic_32.h:
      
        Warning(arch/x86/include/asm/atomic_32.h:265): No description found for parameter 'ptr'
        Warning(arch/x86/include/asm/atomic_32.h:265): Excess function parameter 'v' description in '__atomic64_read'
        Warning(arch/x86/include/asm/atomic_32.h:305): Excess function parameter 'old_val' description in 'atomic64_xchg'
      Signed-off-by: NRandy Dunlap <randy.dunlap@oracle.com>
      LKML-Reference: <4A3467E6.6010907@oracle.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      46e44328
  7. 13 6月, 2009 1 次提交
  8. 12 6月, 2009 10 次提交
    • M
      lguest: PAE support · acdd0b62
      Matias Zabaljauregui 提交于
      This version requires that host and guest have the same PAE status.
      NX cap is not offered to the guest, yet.
      Signed-off-by: NMatias Zabaljauregui <zabaljauregui@gmail.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      acdd0b62
    • M
      lguest: Add support for kvm_hypercall4() · cefcad17
      Matias Zabaljauregui 提交于
      Add support for kvm_hypercall4(); PAE wants it.
      
      Signed-off-by: Matias Zabaljauregui <zabaljauregui at gmail.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      cefcad17
    • M
      lguest: replace hypercall name LHCALL_SET_PMD with LHCALL_SET_PGD · ebe0ba84
      Matias Zabaljauregui 提交于
      replace LHCALL_SET_PMD with LHCALL_SET_PGD hypercall name
      (That's really what it is, and the confusion gets worse with PAE support)
      Signed-off-by: NMatias Zabaljauregui <zabaljauregui@gmail.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      Reported-by: NJeremy Fitzhardinge <jeremy@goop.org>
      ebe0ba84
    • R
      lguest: improve interrupt handling, speed up stream networking · a32a8813
      Rusty Russell 提交于
      lguest never checked for pending interrupts when enabling interrupts, and
      things still worked.  However, it makes a significant difference to TCP
      performance, so it's time we fixed it by introducing a pending_irq flag
      and checking it on irq_restore and irq_enable.
      
      These two routines are now too big to patch into the 8/10 bytes
      patch space, so we drop that code.
      
      Note: The high latency on interrupt delivery had a very curious
      effect: once everything else was optimized, networking without GSO was
      faster than networking with GSO, since more interrupts were sent and
      hence a greater chance of one getting through to the Guest!
      
      Note2: (Almost) Closing the same loophole for iret doesn't have any
      measurable effect, so I'm leaving that patch for the moment.
      
      Before:
      	1GB tcpblast Guest->Host:		30.7 seconds
      	1GB tcpblast Guest->Host (no GSO):	76.0 seconds
      
      After:
      	1GB tcpblast Guest->Host:		6.8 seconds
      	1GB tcpblast Guest->Host (no GSO):	27.8 seconds
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      a32a8813
    • A
      module: merge module_alloc() finally · c398df30
      Amerigo Wang 提交于
      As Christoph Hellwig suggested, module_alloc() actually can be
      unified for i386 and x86_64 (of course, also UML).
      Signed-off-by: NWANG Cong <amwang@redhat.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: 'Ingo Molnar' <mingo@elte.hu>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      c398df30
    • Y
      x86: make zap_low_mapping could be used early · 55cd6367
      Yinghai Lu 提交于
      Only one cpu is there, just call __flush_tlb for it. Fixes the following boot
      warning on x86:
      
        [    0.000000] Memory: 885032k/915540k available (5993k kernel code, 29844k reserved, 3842k data, 428k init, 0k highmem)
        [    0.000000] virtual kernel memory layout:
        [    0.000000]     fixmap  : 0xffe17000 - 0xfffff000   (1952 kB)
        [    0.000000]     vmalloc : 0xf8615000 - 0xffe15000   ( 120 MB)
        [    0.000000]     lowmem  : 0xc0000000 - 0xf7e15000   ( 894 MB)
        [    0.000000]       .init : 0xc19a5000 - 0xc1a10000   ( 428 kB)
        [    0.000000]       .data : 0xc15da4bb - 0xc199af6c   (3842 kB)
        [    0.000000]       .text : 0xc1000000 - 0xc15da4bb   (5993 kB)
        [    0.000000] Checking if this processor honours the WP bit even in supervisor mode...Ok.
        [    0.000000] ------------[ cut here ]------------
        [    0.000000] WARNING: at kernel/smp.c:369 smp_call_function_many+0x50/0x1b0()
        [    0.000000] Hardware name: System Product Name
        [    0.000000] Modules linked in:
        [    0.000000] Pid: 0, comm: swapper Not tainted 2.6.30-tip #52504
        [    0.000000] Call Trace:
        [    0.000000]  [<c104aa16>] warn_slowpath_common+0x65/0x95
        [    0.000000]  [<c104aa58>] warn_slowpath_null+0x12/0x15
        [    0.000000]  [<c1073bbe>] smp_call_function_many+0x50/0x1b0
        [    0.000000]  [<c1037615>] ? do_flush_tlb_all+0x0/0x41
        [    0.000000]  [<c1037615>] ? do_flush_tlb_all+0x0/0x41
        [    0.000000]  [<c1073d4f>] smp_call_function+0x31/0x58
        [    0.000000]  [<c1037615>] ? do_flush_tlb_all+0x0/0x41
        [    0.000000]  [<c104f635>] on_each_cpu+0x26/0x65
        [    0.000000]  [<c10374b5>] flush_tlb_all+0x19/0x1b
        [    0.000000]  [<c1032ab3>] zap_low_mappings+0x4d/0x56
        [    0.000000]  [<c15d64b5>] ? printk+0x14/0x17
        [    0.000000]  [<c19b42a8>] mem_init+0x23d/0x245
        [    0.000000]  [<c19a56a1>] start_kernel+0x17a/0x2d5
        [    0.000000]  [<c19a5347>] ? unknown_bootoption+0x0/0x19a
        [    0.000000]  [<c19a5039>] __init_begin+0x39/0x41
        [    0.000000] ---[ end trace 4eaa2a86a8e2da22 ]---
      Reported-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NYinghai Lu <yinghai@kernel.org>
      Signed-off-by: NPekka Enberg <penberg@cs.helsinki.fi>
      55cd6367
    • A
      asm-generic: rename page.h and uaccess.h · 5b17e1cd
      Arnd Bergmann 提交于
      The current asm-generic/page.h only contains the get_order
      function, and asm-generic/uaccess.h only implements
      unaligned accesses. This renames the file to getorder.h
      and uaccess-unaligned.h to make room for new page.h
      and uaccess.h file that will be usable by all simple
      (e.g. nommu) architectures.
      Signed-off-by: NRemis Lima Baima <remis.developer@googlemail.com>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      5b17e1cd
    • A
      asm-generic: rename atomic.h to atomic-long.h · 72099ed2
      Arnd Bergmann 提交于
      The existing asm-generic/atomic.h only defines the
      atomic_long type. This renames it to atomic-long.h
      so we have a place to add a truly generic atomic.h
      that can be used on all non-SMP systems.
      Signed-off-by: NRemis Lima Baima <remis.developer@googlemail.com>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Acked-by: NIngo Molnar <mingo@elte.hu>
      72099ed2
    • A
      asm-generic: introduce asm/bitsperlong.h · c31ae4bb
      Arnd Bergmann 提交于
      This provides a reliable way for asm-generic/types.h and other
      files to find out if it is running on a 32 or 64 bit platform.
      
      We cannot use CONFIG_64BIT for this in headers that are included
      from user space because CONFIG symbols are not available there.
      We also cannot do it inside of asm/types.h because some headers
      need the word size but cannot include types.h.
      
      The solution is to introduce a new header <asm/bitsperlong.h>
      that defines both __BITS_PER_LONG for user space and
      BITS_PER_LONG for usage in the kernel. The asm-generic
      version falls back to 32 bit unless the architecture overrides
      it, which I did for all 64 bit platforms.
      Signed-off-by: NRemis Lima Baima <remis.developer@googlemail.com>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      c31ae4bb
    • A
      asm-generic: rename termios.h, signal.h and mman.h · 63b852a6
      Arnd Bergmann 提交于
      The existing asm-generic versions are incomplete and included
      by some architectures. New architectures should be able
      to use a generic version, so rename the existing files and
      change all users, which lets us add the new files.
      Signed-off-by: NRemis Lima Baima <remis.developer@googlemail.com>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      63b852a6
  9. 11 6月, 2009 2 次提交
    • A
      x86: fix ktermios-termio conversion · 5b0ed526
      Arnd Bergmann 提交于
      The legacy TCSETA{,W,F} ioctls failed to set the termio->c_line field
      on x86. This adds a missing get_user.
      
      The same ioctls also fail to report faulting user pointers, which
      we keep ignoring.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NAlan Cox <alan@linux.intel.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      5b0ed526
    • H
      x86, mce: Add boot options for corrected errors · 62fdac59
      Hidetoshi Seto 提交于
      This patch introduces three boot options (no_cmci, dont_log_ce
      and ignore_ce) to control handling for corrected errors.
      
      The "mce=no_cmci" boot option disables the CMCI feature.
      
      Since CMCI is a new feature so having boot controls to disable
      it will be a help if the hardware is misbehaving.
      
      The "mce=dont_log_ce" boot option disables logging for corrected
      errors. All reported corrected errors will be cleared silently.
      This option will be useful if you never care about corrected
      errors.
      
      The "mce=ignore_ce" boot option disables features for corrected
      errors, i.e. polling timer and cmci.  All corrected events are
      not cleared and kept in bank MSRs.
      
      Usually this disablement is not recommended, however it will be
      a help if there are some conflict with the BIOS or hardware
      monitoring applications etc., that clears corrected events in
      banks instead of OS.
      
      [ And trivial cleanup (space -> tab) for doc is included. ]
      Signed-off-by: NHidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
      Reviewed-by: NAndi Kleen <ak@linux.intel.com>
      LKML-Reference: <4A30ACDF.5030408@jp.fujitsu.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      62fdac59
  10. 10 6月, 2009 2 次提交