1. 19 2月, 2010 14 次提交
  2. 18 2月, 2010 10 次提交
  3. 17 2月, 2010 16 次提交
    • A
      powerpc/mpc5121: correct DIU compatible property · d24720a4
      Anatolij Gustschin 提交于
      The DIU driver should bind against "fsl,mpc5121-diu"
      directly. Add this compatible property to the match
      table and fix DTS and platform code accordingly.
      Signed-off-by: NAnatolij Gustschin <agust@denx.de>
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      d24720a4
    • A
      powerpc/mpc5121: enable support for more PSC UARTs · e9cb0a49
      Anatolij Gustschin 提交于
      MPC5121 has 12 PSC devices. Enable UART support for all of
      them by defining the number of max. PSCs depending on
      selection of PPC_MPC512x platform support.
      Signed-off-by: NAnatolij Gustschin <agust@denx.de>
      Acked-by: NGreg Kroah-Hartman <gregkh@suse.de>
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      e9cb0a49
    • D
      powerpc/booke: Add support for advanced debug registers · 3bffb652
      Dave Kleikamp 提交于
      powerpc/booke: Add support for advanced debug registers
      
      From: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
      
      Based on patches originally written by Torez Smith.
      
      This patch defines context switch and trap related functionality
      for BookE specific Debug Registers. It adds support to ptrace()
      for setting and getting BookE related Debug Registers
      Signed-off-by: NDave Kleikamp <shaggy@linux.vnet.ibm.com>
      Cc: Torez Smith  <lnxtorez@linux.vnet.ibm.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: David Gibson <dwg@au1.ibm.com>
      Cc: Josh Boyer <jwboyer@linux.vnet.ibm.com>
      Cc: Kumar Gala <galak@kernel.crashing.org>
      Cc: Sergio Durigan Junior <sergiodj@br.ibm.com>
      Cc: Thiago Jung Bauermann <bauerman@br.ibm.com>
      Cc: linuxppc-dev list <Linuxppc-dev@ozlabs.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      3bffb652
    • D
      powerpc/booke: Add definitions for advanced debug registers · 99396ac1
      Dave Kleikamp 提交于
      powerpc/booke: Add definitions for advanced debug registers
      
      From: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
      
      Based on patches originally written by Torez Smith.
      
      This patch adds additional definitions for BookE Debug Registers
      to the reg_booke.h header file.
      Signed-off-by: NDave Kleikamp <shaggy@linux.vnet.ibm.com>
      Acked-by: NDavid Gibson <dwg@au1.ibm.com>
      Cc: Torez Smith  <lnxtorez@linux.vnet.ibm.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Josh Boyer <jwboyer@linux.vnet.ibm.com>
      Cc: Kumar Gala <galak@kernel.crashing.org>
      Cc: Sergio Durigan Junior <sergiodj@br.ibm.com>
      Cc: Thiago Jung Bauermann <bauerman@br.ibm.com>
      Cc: linuxppc-dev list <Linuxppc-dev@ozlabs.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      99396ac1
    • D
      powerpc: Extended ptrace interface · 3162d92d
      Dave Kleikamp 提交于
      powerpc: Extended ptrace interface
      
      From: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
      
      Based on patches originally written by Torez Smith.
      
      Add a new extended ptrace interface so that user-space has a single
      interface for powerpc, without having to know the specific layout
      of the debug registers.
      
      Implement:
      PPC_PTRACE_GETHWDEBUGINFO
      PPC_PTRACE_SETHWDEBUG
      PPC_PTRACE_DELHWDEBUG
      Signed-off-by: NDave Kleikamp <shaggy@linux.vnet.ibm.com>
      Acked-by: NDavid Gibson <dwg@au1.ibm.com>
      Cc: Torez Smith  <lnxtorez@linux.vnet.ibm.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Josh Boyer <jwboyer@linux.vnet.ibm.com>
      Cc: Kumar Gala <galak@kernel.crashing.org>
      Cc: Sergio Durigan Junior <sergiodj@br.ibm.com>
      Cc: Thiago Jung Bauermann <bauerman@br.ibm.com>
      Cc: linuxppc-dev list <Linuxppc-dev@ozlabs.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      3162d92d
    • D
      powerpc/booke: Introduce new CONFIG options for advanced debug registers · 172ae2e7
      Dave Kleikamp 提交于
      powerpc/booke: Introduce new CONFIG options for advanced debug registers
      
      From: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
      
      Introduce new config options to simplify the ifdefs pertaining to the
      advanced debug registers for booke and 40x processors:
      
      CONFIG_PPC_ADV_DEBUG_REGS - boolean: true for dac-based processors
      CONFIG_PPC_ADV_DEBUG_IACS - number of IAC registers
      CONFIG_PPC_ADV_DEBUG_DACS - number of DAC registers
      CONFIG_PPC_ADV_DEBUG_DVCS - number of DVC registers
      CONFIG_PPC_ADV_DEBUG_DAC_RANGE - DAC ranges supported
      
      Beginning conservatively, since I only have the facilities to test 440
      hardware.  I believe all 40x and booke platforms support at least 2 IAC
      and 2 DAC registers.  For 440, 4 IAC and 2 DVC registers are enabled, as
      well as the DAC ranges.
      Signed-off-by: NDave Kleikamp <shaggy@linux.vnet.ibm.com>
      Acked-by: NDavid Gibson <dwg@au1.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      172ae2e7
    • A
      powerpc: Improve 64bit copy_tofrom_user · 789c299c
      Anton Blanchard 提交于
      Here is a patch from Paul Mackerras that improves the ppc64 copy_tofrom_user.
      The loop now does 32 bytes at a time and as well as pairing loads and stores.
      
      A quick test case that reads 8kB over and over shows the improvement:
      
      POWER6: 53% faster
      POWER7: 51% faster
      
      #define _XOPEN_SOURCE 500
      #include <stdlib.h>
      #include <stdio.h>
      #include <unistd.h>
      #include <fcntl.h>
      #include <sys/types.h>
      #include <sys/stat.h>
      
      #define BUFSIZE (8 * 1024)
      #define ITERATIONS 10000000
      
      int main()
      {
      	char tmpfile[] = "/tmp/copy_to_user_testXXXXXX";
      	int fd;
      	char *buf[BUFSIZE];
      	unsigned long i;
      
      	fd = mkstemp(tmpfile);
      	if (fd < 0) {
      		perror("open");
      		exit(1);
      	}
      
      	if (write(fd, buf, BUFSIZE) != BUFSIZE) {
      		perror("open");
      		exit(1);
      	}
      
      	for (i = 0; i < 10000000; i++) {
      		if (pread(fd, buf, BUFSIZE, 0) != BUFSIZE) {
      			perror("pread");
      			exit(1);
      		}
      	}
      
      	unlink(tmpfile);
      
      	return 0;
      }
      Signed-off-by: NAnton Blanchard <anton@samba.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      789c299c
    • A
      powerpc: Pair loads and stores in copy_4k_page · 63e6c5b8
      Anton Blanchard 提交于
      A number of our chips like loads and stores to be paired. A small kernel
      module testcase shows the improvement of pairing loads and stores in
      copy_4k_page:
      
      POWER6: +9%
      POWER7: +1.5%
      
      #include <linux/module.h>
      #include <linux/mm.h>
      
      #define ITERATIONS 10000000
      
      static int __init copypage_init(void)
      {
      	struct timespec before, after;
      	unsigned long i;
      	struct page *destpage, *srcpage;
      	char *dest, *src;
      
      	destpage = alloc_page(GFP_KERNEL);
      	srcpage = alloc_page(GFP_KERNEL);
      
      	dest = page_address(destpage);
      	src = page_address(srcpage);
      
      	getnstimeofday(&before);
      
      	for (i = 0; i < ITERATIONS; i++)
      		copy_4K_page(dest, src);
      
      	getnstimeofday(&after);
      
      	free_page((unsigned long)dest);
      	free_page((unsigned long)src);
      
      	printk(KERN_DEBUG "copy_4K_page loop took %lu ns\n",
      		(after.tv_sec - before.tv_sec) * NSEC_PER_SEC +
      		(after.tv_nsec - before.tv_nsec));
      
      	return 0;
      }
      
      static void __exit copypage_exit(void)
      {
      }
      
      module_init(copypage_init)
      module_exit(copypage_exit)
      MODULE_LICENSE("GPL");
      MODULE_AUTHOR("Anton Blanchard");
      Signed-off-by: NAnton Blanchard <anton@samba.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      63e6c5b8
    • A
      powerpc: Use lwsync for acquire barrier if CPU supports it · 5a0e9b57
      Anton Blanchard 提交于
      Nick Piggin discovered that lwsync barriers around locks were faster than isync
      on 970. That was a long time ago and I completely dropped the ball in testing
      his patches across other ppc64 processors.
      
      Turns out the idea helps on other chips. Using a microbenchmark that
      uses a lot of threads to contend on a global pthread mutex (and therefore a
      global futex), POWER6 improves 8% and POWER7 improves 2%. I checked POWER5
      and while I couldn't measure an improvement, there was no regression.
      
      This patch uses the lwsync patching code to replace the isyncs with lwsyncs
      on CPUs that support the instruction. We were marking POWER3 and RS64 as lwsync
      capable but in reality they treat it as a full sync (ie slow). Remove the
      CPU_FTR_LWSYNC bit from these CPUs so they continue to use the faster isync
      method.
      Signed-off-by: NAnton Blanchard <anton@samba.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      5a0e9b57
    • A
      powerpc: Fix lwsync patching code on 64bit · 53eae228
      Anton Blanchard 提交于
      do_lwsync_fixups doesn't work on 64bit, we end up writing lwsyncs to the
      wrong addresses:
      
      0:mon> di c0000001000bfacc
      c0000001000bfacc  7c2004ac      lwsync
      
      Since the lwsync section has negative offsets we need to use a signed int
      pointer so we sign extend the value.
      Signed-off-by: NAnton Blanchard <anton@samba.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      53eae228
    • A
      powerpc: Rename LWSYNC_ON_SMP to PPC_RELEASE_BARRIER, ISYNC_ON_SMP to PPC_ACQUIRE_BARRIER · f10e2e5b
      Anton Blanchard 提交于
      For performance reasons we are about to change ISYNC_ON_SMP to sometimes be
      lwsync. Now that the macro name doesn't make sense, change it and LWSYNC_ON_SMP
      to better explain what the barriers are doing.
      Signed-off-by: NAnton Blanchard <anton@samba.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      f10e2e5b
    • A
      powerpc: Convert open coded native hashtable bit lock · 66d99b88
      Anton Blanchard 提交于
      Now we have real bit locks use them instead of open coding it.
      Signed-off-by: NAnton Blanchard <anton@samba.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      66d99b88
    • A
      powerpc: Use lwarx/ldarx hint in bit locks · 864b9e6f
      Anton Blanchard 提交于
      This patch implements the lwarx/ldarx hint bit for bit locks.
      Signed-off-by: NAnton Blanchard <anton@samba.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      864b9e6f
    • A
      powerpc: Use lwarx hint in spinlocks · 4e14a4d1
      Anton Blanchard 提交于
      Recent versions of the PowerPC architecture added a hint bit to the larx
      instructions to differentiate between an atomic operation and a lock operation:
      
      > 0 Other programs might attempt to modify the word in storage addressed by EA
      > even if the subsequent Store Conditional succeeds.
      >
      > 1 Other programs will not attempt to modify the word in storage addressed by
      > EA until the program that has acquired the lock performs a subsequent store
      > releasing the lock.
      
      To avoid a binutils dependency this patch create macros for the extended lwarx
      format and uses it in the spinlock code. To test this change I used a simple
      test case that acquires and releases a global pthread mutex:
      
      	pthread_mutex_lock(&mutex);
      	pthread_mutex_unlock(&mutex);
      
      On a 32 core POWER6, running 32 test threads we spend almost all our time in
      the futex spinlock code:
      
          94.37%     perf  [kernel]                     [k] ._raw_spin_lock
                     |
                     |--99.95%-- ._raw_spin_lock
                     |          |
                     |          |--63.29%-- .futex_wake
                     |          |
                     |          |--36.64%-- .futex_wait_setup
      
      Which is a good test for this patch. The results (in lock/unlock operations per
      second) are:
      
      before: 1538203 ops/sec
      after:  2189219 ops/sec
      
      An improvement of 42%
      
      A 32 core POWER7 improves even more:
      
      before: 1279529 ops/sec
      after:  2282076 ops/sec
      
      An improvement of 78%
      Signed-off-by: NAnton Blanchard <anton@samba.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      4e14a4d1
    • A
      powerpc: Convert global "BAD" interrupt to per cpu spurious · 17081102
      Anton Blanchard 提交于
      I often get asked if BAD interrupts are really bad. On some boxes (eg
      IBM machines running a hypervisor) there are valid cases where are
      presented with an interrupt that is not for us. These cases are common
      enough to show up as thousands of BAD interrupts a day.
      
      Tone them down by calling them spurious. Since they can be a significant cause
      of OS jitter, we may as well log them per cpu so we know where they are
      occurring.
      Signed-off-by: NAnton Blanchard <anton@samba.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      17081102
    • A
      powerpc: Add timer, performance monitor and machine check counts to /proc/interrupts · 89713ed1
      Anton Blanchard 提交于
      With NO_HZ it is useful to know how often the decrementer is going off. The
      patch below adds an entry for it and also adds it into the /proc/stat
      summaries.
      
      While here, I added performance monitoring and machine check exceptions.
      I found it useful to keep an eye on the PMU exception rate
      when using the perf tool. Since it's possible to take a completely
      handled machine check on a System p box it also sounds like a good idea to
      keep a machine check summary.
      
      The event naming matches x86 to keep gratuitous differences to a minimum.
      Signed-off-by: NAnton Blanchard <anton@samba.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      89713ed1