Commit Graph

705 Commits

Author SHA1 Message Date
Arnd Bergmann c8ca0633e5 [PATCH] spufs: dont hold root->isem in spu_forget
spu_forget will do mmput on the DMA address space,
which can lead to lots of other stuff getting triggered.
We better not hold a semaphore here that we might
need in the process.

Noticed by Al Viro.

Signed-off-by: Arnd Bergmann <arndb@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 15:44:37 +11:00
Arnd Bergmann 762cf6dac2 [PATCH] spufs: fix locking in spu_acquire_runnable
We need to check for validity of owner under down_write,
down_read is not enough.

Noticed by Al Viro.

Signed-off-by: Arnd Bergmann <arndb@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 15:44:35 +11:00
Arnd Bergmann c902be71dc [PATCH] cell: enable pause(0) in cpu_idle
This patch enables support for pause(0) power management state
for the Cell Broadband Processor, which is import for power efficient
operation. The pervasive infrastructure will in the future enable
us to introduce more functionality specific to the Cell's
pervasive unit.

From: Maximino Aguilar <maguilar@us.ibm.com>
Signed-off-by: Arnd Bergmann <arndb@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 15:44:32 +11:00
Kumar Gala 017e0fad3e [PATCH] powerpc: fixing compile issue with !CONFIG_PCI in legacy_serial.c
Only build in support for ISA and PCI cases if we have enabled CONFIG_ISA
and CONFIG_PCI.  Additionally, isa_bridge is a global so we shouldn't use
it a parameter name since it gets redefined to NULL when !CONFIG_PCI.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 15:44:30 +11:00
Haren Myneni 9da5cad61c [PATCH] powerpc: Fix search for the main interrupt controller
At present, we are not looking at all interrupt controller nodes in the
device tree even though the proper node was not found. This is causing
the system panic. The attached patch will scan all nodes until it finds
the proper interrupt controller type.

Signed-off-by: Haren Myneni <haren@us.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 15:35:01 +11:00
Kumar Gala 79e7bac0d6 [PATCH] powerpc: Call find_legacy_serial_ports() if we enable CONFIG_SERIAL_8250
In setup_arch and setup_system call find_legacy_serial_ports() if we
build in support for 8250 serial ports instead of basing it on PPC_MULTIPLATFORM.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 15:34:31 +11:00
Kumar Gala be6b843918 [PATCH] powerpc: added a udbg_progress
Added a common udbg_progress for use by ppc_md.progress()

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 15:33:50 +11:00
Kumar Gala b580d46ce8 [PATCH] powerpc: Add the ability to handle SOC ports in legacy_serial
Add the ability to configure and initialize legacy 8250 serials
ports on an SOC bus.  Also, fixed an issue that we would not
configure any serial ports if "linux,stdout-path" was not found.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 15:33:46 +11:00
Kumar Gala d0e132b536 [PATCH] powerpc: Loosen udbg_probe_uart_speed sanity checking
The checking of the baudrate in udbg_probe_uart_speed was
too tight and would cause reporting back of the default
baud rate in cases where the computed speed was valid.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 15:33:42 +11:00
Mike Kravetz b226e46212 [PATCH] powerpc: don't add memory to empty node/zone
The system will oops if an attempt is made to add memory to an
empty node/zone.  This patch prevents adding memory to an empty
node.  The code to dynamically add a node/zone is non-trivial.
This patch is temporary and will be removed when the ability
to dynamically add a node/zone is complete.

Signed-off-by: Mike Kravetz <kravetz@us.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 15:14:22 +11:00
Arnd Bergmann 021c733549 [PATCH] powerpc: fix two build warnings
Building the arch/powerpc tree currently gives me
two warnings with gcc-4.0:

arch/powerpc/mm/imalloc.c: In function '__im_get_area':
arch/powerpc/mm/imalloc.c:225: warning: 'tmp' may be used uninitialized in this function
arch/powerpc/mm/hugetlbpage.c: In function 'hugetlb_get_unmapped_area':
arch/powerpc/mm/hugetlbpage.c:608: warning: unused variable 'vma'

both fixes are trivial.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 15:14:14 +11:00
Matt Mackall e585e47031 [PATCH] tiny: Make *[ug]id16 support optional
Configurable 16-bit UID and friends support

This allows turning off the legacy 16 bit UID interfaces on embedded platforms.

   text    data     bss     dec     hex filename
3330172  529036  190556 4049764  3dcb64 vmlinux-baseline
3328268  529040  190556 4047864  3dc3f8 vmlinux

From: Adrian Bunk <bunk@stusta.de>

    UID16 was accidentially disabled for !EMBEDDED.

Signed-off-by: Matt Mackall <mpm@selenic.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-01-08 20:14:11 -08:00
Christoph Hellwig 6b9c7ed848 [PATCH] use ptrace_get_task_struct in various places
The ptrace_get_task_struct() helper that I added as part of the ptrace
consolidation is useful in variety of places that currently opencode it.
Switch them to the common helpers.

Add a ptrace_traceme() helper that needs to be explicitly called, and simplify
the ptrace_get_task_struct() interface.  We don't need the request argument
now, and we return the task_struct directly, using ERR_PTR() for error
returns.  It's a bit more code in the callers, but we have two sane routines
that do one thing well now.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-01-08 20:13:51 -08:00
David Gibson e1333803c3 [PATCH] powerpc: Fix iSeries bug in VMALLOCBASE/VMALLOC_START consolidation
Oops, forgot to compile the VMALLOCBASE/VMALLOC_START patch on
iSeries.  VMALLOC_START is defined in pgtable.h whereas previously
VMALLOCBASE was previously defined in page.h.  lparmap.c needs to be
updated appropriately.

Booted on iSeries RS64 (now).

Signed-off-by: David Gibson <dwg@au1.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 15:06:06 +11:00
Andy Fleming 555d97ac87 [PATCH] powerpc: G4+ oprofile support
This patch adds oprofile support for the 7450 and all its multitudinous
derivatives.

* Added 7450 (and derivatives) support for oprofile
* Changed e500 cputable to have oprofile model and cpu_type fields
* Added support for classic 32-bit performance monitor interrupt
* Cleaned up common powerpc oprofile code to be as common as possible
* Cleaned up oprofile_impl.h to reflect 32 bit classic code
* Added 32-bit MMCRx bitfield definitions and SPR numbers

Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 15:06:03 +11:00
Benjamin Herrenschmidt f2c4583a38 [PATCH] powerpc: pci_address_to_pio fix
This fixes pci_address_to_pio() to return an unsigned long (to be safe)
and fixes a bug in the implementation that caused it to return a bogus
IO port number

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 15:05:56 +11:00
David Gibson 14c89e7fc8 [PATCH] powerpc: Replace VMALLOCBASE with VMALLOC_START
On ppc64, we independently define VMALLOCBASE and VMALLOC_START to be
the same thing: the start of the vmalloc() area at 0xd000000000000000.
VMALLOC_START is used much more widely, including in generic code, so
this patch gets rid of the extraneous VMALLOCBASE.

This does require moving the definitions of region IDs from page_64.h
to pgtable.h, but they don't clearly belong in the former rather than
the latter, anyway.  While we're moving them, clean up the definitions
of the REGION_IDs:
	- Abolish REGION_SIZE, it was only used once, to define
REGION_MASK anyway
	- Define the specific region ids in terms of the REGION_ID()
macro.
	- Define KERNEL_REGION_ID in terms of PAGE_OFFSET rather than
KERNELBASE.  It amounts to the same thing, but conceptually this is
about the region of the linear mapping (which starts at PAGE_OFFSET)
rather than of the kernel text itself (which is at KERNELBASE).

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 15:05:47 +11:00
Benjamin Herrenschmidt 56c8eaee65 [PATCH] powerpc: Fix g5 DART init
The patch enabling the new G5's with U4 broke initialization of the DART
driver, causing it to trigger a BUG_ON for a case that is actually
valid. This patch fixes it:

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 15:05:42 +11:00
Benjamin Herrenschmidt 1beb6a7d6c [PATCH] powerpc: Experimental support for new G5 Macs (#2)
This adds some very basic support for the new machines, including the
Quad G5 (tested), and other new dual core based machines and iMac G5
iSight (untested). This is still experimental !  There is no thermal
control yet, there is no proper handing of MSIs, etc.. but it
boots, I have all 4 cores up on my machine. Compared to the previous
version of this patch, this one adds DART IOMMU support for the U4
chipset and thus should work fine on setups with more than 2Gb of RAM.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 15:03:17 +11:00
linas 31087d7d49 [PATCH] powerpc: export PCI fixup routine
There is code in the RPAPHP directory that is identical to this routine;
I'll be removing that code in an upcoming patch, but this patch is needed
to expose the function to make it callable.

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:54:02 +11:00
Segher Boessenkool c4b22f2689 [PATCH] powerpc: Update MPIC workarounds
Cleanup the MPIC IO-APIC workarounds, make them a bit more generic,
smaller and faster.

Signed-off-by: Segher Boessenkool <segher@kernel.crashing.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:53:59 +11:00
Benjamin Herrenschmidt cc5d0189b9 [PATCH] powerpc: Remove device_node addrs/n_addr
The pre-parsed addrs/n_addrs fields in struct device_node are finally
gone. Remove the dodgy heuristics that did that parsing at boot and
remove the fields themselves since we now have a good replacement with
the new OF parsing code. This patch also fixes a bunch of drivers to use
the new code instead, so that at least pmac32, pseries, iseries and g5
defconfigs build.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:53:55 +11:00
Benjamin Herrenschmidt f75225d0a0 [PATCH] powerpc: Add pmac32 defconfig for ARCH=powerpc
This adds a defconfig for PowerMac with ARCH=powerpc

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:53:47 +11:00
Anton Blanchard 448b271940 [PATCH] powerpc: Remove old comment in head.S
Remove a comment in head.S which is no longer relevant.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:53:44 +11:00
Anton Blanchard 4b703a2317 [PATCH] ppc64: Add NUMA cpu summary at boot
We used to print a NUMA cpu summary at boot before the hotplug cpu code
was added. This has been useful for catching machine configuration as
well as firmware bugs in the past.

This patch restores that functionality. An example of the output is:

Node 0 CPUs: 0-7
Node 1 CPUs: 8-15

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:53:37 +11:00
Arnd Bergmann f9ce299fc6 [PATCH] powerpc: fix large nvram access
/dev/nvram uses the user-provided read/write size
for kmalloc, which fails, if a large number is passed.
This will always use a single page at most, which
can be expected to succeed.

Signed-off-by: Arnd Bergmann <arndb@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:53:31 +11:00
David Woodhouse d52771fce4 [PATCH] powerpc/cell: disable legacy i/o area
We currently crash in the fedora installer because the keyboard
driver tries to access I/O space that is not there on our hardware.

This uses the same solution as powermac by just marking all
legacy i/o as invalid.

Signed-off-by: Arnd Bergmann <arndb@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:53:27 +11:00
Jens.Osterkamp@de.ibm.com 49d65b3ac5 [PATCH] powerpc/cell: add iommu support for larger memory
So far, the iommu code was hardwired to a linear mapping
between 0x20000000 and 0x40000000, so it could only support
512MB of RAM.

This patch still keeps the linear mapping, but looks for
proper ibm,dma-window properties to set up larger windows,
this makes the maximum supported RAM size 2GB.

If there is anything unusual about the dma-window properties,
we fall back to the old behavior.

We also support switching off the iommu completely now
with the regular iommu=off command line option.

Signed-off-by: Arnd Bergmann <arndb@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:53:24 +11:00
Arnd Bergmann 38307341af [PATCH] spufs: clear dsisr on CLASS1[Mf] exception
Because of always clearing DSISR at spu class 1 interrupt handler,
kernel may lose Class1[Mf] interrupt.

Signed-off-by: Masato Noguchi <Masato.Noguchi@jp.sony.com>
Signed-off-by: Geoff Levand <geoff.levand@am.sony.com>
Signed-off-by: Arnd Bergmann <arndb@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:53:21 +11:00
Arnd Bergmann 462c853eb5 [PATCH] spufs: fix hexdump format
Output from hexdump with "%08x" depends on HOST platform's endian.
When building linux by cross toolchain, that difference makes errors.

Signed-off-by: Masato Noguchi <Masato.Noguchi@jp.sony.com>
Signed-off-by: Geoff Levand <geoff.levand@am.sony.com>
Signed-off-by: Arnd Bergmann <arndb@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:53:18 +11:00
Arnd Bergmann 7945a4a27d [PATCH] spufs: trivial compile fix
One of my last patches contained a broken line
from splitting out some other changes, this
restores a working version.

Signed-off-by: Arnd Bergmann <arndb@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:53:14 +11:00
Arnd Bergmann 59d6d39f30 [PATCH] spufs: fix module refcount race
One of the two users of spufs_calls.owner still has a race
when calling try_module_get while the module is removed.
This makes it use the correct instance of owner.

Noticed by Milton Miller.

Signed-off-by: Arnd Bergmann <arndb@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:53:11 +11:00
Arnd Bergmann dad482c256 [PATCH] cell: add platform detection code
I can't really get a conclusive answer from the firmware
people what to check for, so I just try scanning for
anything that starts with "IBM,CPB", which should be
correct for all hardware produced so far and for
systemsim.

Signed-off-by: Arnd Bergmann <arndb@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:53:04 +11:00
Arnd Bergmann 3a843d7cd3 [PATCH] spufs: fix mailbox polling
Handling mailbox interrupts was broken in multiple respects,
the combination of which was hiding the bugs most of the time.

- The ibox interrupt mask was open initially even though there
  are no waiters on a newly created SPU.

- Acknowledging the mailbox interrupt did not work because
  it is level triggered and the mailbox data is never retrieved
  from inside the interrupt handler.

- The interrupt handler delivered interrupts with a disabled
  mask if another interrupt is triggered for the same class
  but a different mask.

- The poll function did not enable the interrupt if it had not
  been enabled, so we might run into the poll timeout if none of
  the other bugs saved us and no signal was delivered.

We probably still have a similar problem with blocking
read/write on mailbox files, but that will result in extra
wakeup in the worst case, not in incorrect behaviour.

Signed-off-by: Arnd Bergmann <arndb@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:53:01 +11:00
Arnd Bergmann 2a911f0bb7 [PATCH] spufs: Improved SPU preemptability [part 2].
This patch reduces lock complexity of SPU scheduler, particularly
for involuntary preemptive switches.  As a result the new code
does a better job of mapping the highest priority tasks to SPUs.

Lock complexity is reduced by using the system default workqueue
to perform involuntary saves.  In this way we avoid nasty lock
ordering problems that the previous code had.  A "minimum timeslice"
for SPU contexts is also introduced.  The intent here is to avoid
thrashing.

While the new scheduler does a better job at prioritization it
still does nothing for fairness.

From: Mark Nutter <mnutter@us.ibm.com>
Signed-off-by: Arnd Bergmann <arndb@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:52:58 +11:00
Arnd Bergmann 5110459f18 [PATCH] spufs: Improved SPU preemptability.
This patch makes it easier to preempt an SPU context by
having the scheduler hold ctx->state_sema for much shorter
periods of time.

As part of this restructuring, the control logic for the "run"
operation is moved from arch/ppc64/kernel/spu_base.c to
fs/spufs/file.c.  Of course the base retains "bottom half"
handlers for class{0,1} irqs.  The new run loop will re-acquire
an SPU if preempted.

From: Mark Nutter <mnutter@us.ibm.com>
Signed-off-by: Arnd Bergmann <arndb@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:52:55 +11:00
Arnd Bergmann 3b3d22cb84 [PATCH] spufs: Turn off debugging output
spufs is rather noisy when debugging is enabled, this
turns off the messages for production use.

Signed-off-by: Arnd Bergmann <arndb@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:52:51 +11:00
Arnd Bergmann b41305a39a [PATCH] spufs: Fix oops when spufs module is not loaded
try_module_get returns true when NULL arguments, so
we first need to check if there is a module loaded before
getting the reference count.

Signed-off-by: Arnd Bergmann <arndb@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:52:48 +11:00
Arnd Bergmann d88cfffac0 [PATCH] spufs: fix local store page refcounting
With the new rules for reserved pages, the spufs now
needs working page reference counting.

I should probably look into converting to vm_insert_page,
but for now this patch makes spufs work again.

Signed-off-by: Arnd Bergmann <arndb@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:52:45 +11:00
Arnd Bergmann 39c73c332c [PATCH] spufs: Make all exports GPL-only
This changes all exported symbols of spufs to EXPORT_SYMBOL_GPL.
The spu_ibox_read/spu_wbox_write symbols are not exported
any more when the scheduler patch is applied.

Signed-off-by: Arnd Bergmann <arndb@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:52:41 +11:00
Michael Ellerman ba7594852f [PATCH] powerpc: Add support for "linux,usable-memory" on memory nodes
Milton has proposed that we should support a "linux,usable-memory" property
on memory nodes which describes, in preference to "reg", the regions of memory
Linux should use.

This facility is required for kdump to inform the second kernel which memory
it should use.

Signed-off-by: Haren Myneni <haren@us.ibm.com>
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:52:38 +11:00
Michael Ellerman 54c32021eb [PATCH] powerpc: Add arch-dependent copy_oldmem_page
Signed-off-by: Haren Myneni <haren@us.ibm.com>
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:52:35 +11:00
Michael Ellerman dcee30361d [PATCH] powerpc: Parse crashkernel= parameter in first kernel
This patch adds code to parse and setup the crash kernel resource in the
first kernel. PPC64 ignores the @x part, we always run at 32 MB.

Signed-off-by: Haren Myneni <haren@us.ibm.com>
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:52:31 +11:00
Michael Ellerman cc53291521 [PATCH] powerpc: Add arch dependent basic infrastructure for Kdump.
Implementing the machine_crash_shutdown which will be called by
crash_kexec (called in case of a panic, sysrq etc.). Disable the
interrupts, shootdown cpus using debugger IPI and collect regs
for all CPUs.

elfcorehdr= specifies the location of elf core header stored by
the crashed kernel. This command line option will be passed by
the kexec-tools to capture kernel.

savemaxmem= specifies the actual memory size that the first kernel
has and this value will be used for dumping in the capture kernel.
This command line option will be passed by the kexec-tools to
capture kernel.

Signed-off-by: Haren Myneni <haren@us.ibm.com>
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:52:28 +11:00
Michael Ellerman 758438a7b8 [PATCH] powerpc: Fixups for kernel linked at 32 MB
There's a few places where we need to fix things up for the kernel to work
if it's linked at 32MB:

 - platforms/powermac/smp.c
   To start secondary cpus on pmac we patch the reset vector, which is fine.
   Except if we're above 32MB we don't have enough bits for an absolute branch,
   it needs to relative.
 - kernel/head_64.s
    - A few branches in the cpu hold code need to load the full target address
      and do a bctr.
    - after_prom_start needs to load PHYSICAL_START as the dest address, not 0.
    - The exception prolog needs to load the low word of the target adddress,
      not just the low halfword.
    - Fixup handling of the initial stab address.
 - kernel/setup_64.c
   smp_release_cpus() needs to write 1 to the spinloop flag near 0, not 32 MB.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:52:25 +11:00
Michael Ellerman 0cc4746cad [PATCH] powerpc: Reroute interrupts from 0 + offset to PHYSICAL_START + offset
Regardless of where the kernel's linked we always get interrupts at low
addresses. This patch creates a trampoline in the first 3 pages of memory,
where interrupts land, and patches those addresses to jump into the real
kernel code at PHYSICAL_START.

We also need to reserve the trampoline code and a bit more in prom.c

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:52:21 +11:00
Michael Ellerman 8c4f1f2958 [PATCH] powerpc: Create a trampoline for the fwnmi vectors
The fwnmi vectors can be anywhere < 32 MB, so we need to use a trampoline
for them. The kdump kernel will register the trampoline addresses, which will
then jump up to the real code above 32 MB.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:52:17 +11:00
Michael Ellerman 398ab1fcb9 [PATCH] powerpc: Add CONFIG_CRASH_DUMP
This patch adds a Kconfig variable, CONFIG_CRASH_DUMP, which configures the
built kernel for use as a Kdump kernel.

Currently "all" this involves is changing the value of KERNELBASE to 32 MB.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:52:14 +11:00
Paul Mackerras 4693c09a47 powerpc: Fix typo in head_64.S
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:52:10 +11:00
Stephen Rothwell d4e4b3520c [PATCH] powerpc: fix for "Update OF address parsers"
This allows iSeries to build again.  It just moves pci_address_to_pio
outside the #ifdef CONFIG_PPC_MULTIPLATFORM.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:52:07 +11:00
linas e07102db63 [PATCH] powerpc: minor cleanup of void ptr deref
Minor: use macro to perform void pointer deref; this may someday help
avoid pointer typecasting errors.

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:52:04 +11:00
Mike Kravetz 237a0989e2 [PATCH] powerpc: numa placement for dynamically added memory
This places dynamically added memory within the appropriate
numa node.  A new routine hot_add_scn_to_nid() replicates most of
the memory scanning code in parse_numa_properties().

Signed-off-by: Mike Kravetz <kravetz@us.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:51:57 +11:00
Michael Ellerman b5666f7039 [PATCH] powerpc: Separate usage of KERNELBASE and PAGE_OFFSET
This patch separates usage of KERNELBASE and PAGE_OFFSET. I haven't
looked at any of the PPC32 code, if we ever want to support Kdump on
PPC we'll have to do another audit, ditto for iSeries.

This patch makes PAGE_OFFSET the constant, it'll always be 0xC * 1
gazillion for 64-bit.

To get a physical address from a virtual one you subtract PAGE_OFFSET,
_not_ KERNELBASE.

KERNELBASE is the virtual address of the start of the kernel, it's
often the same as PAGE_OFFSET, but _might not be_.

If you want to know something's offset from the start of the kernel
you should subtract KERNELBASE.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:51:54 +11:00
Michael Ellerman 51fae6de24 [PATCH] powerpc: Add a is_kernel_addr() macro
There's a bunch of code that compares an address with KERNELBASE to see if
it's a "kernel address", ie. >= KERNELBASE. The proper test is actually to
compare with PAGE_OFFSET, since we're going to change KERNELBASE soon.

So replace all of them with an is_kernel_addr() macro that does that.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:51:50 +11:00
Michael Ellerman cd0ca2ce4b [PATCH] powerpc: Propagate regs through to machine_crash_shutdown
Currently machine_crash_shutdown() gets a struct pt_regs, but doesn't pass it
through to the ppc_md function, it should.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:51:47 +11:00
Andy Whitcroft e40c7f0272 [PATCH] powerpc32: fix definition of distribute_irqs
When we select ppc32 under the powerpc architecture we get the
error below.  This relates to defining distribute_irqs when this
configuratiom option is undefined.

      CC      arch/powerpc/sysdev/mpic.o
    .../arch/powerpc/sysdev/mpic.c: In function `mpic_setup_this_cpu':
    .../arch/powerpc/sysdev/mpic.c:788: error: `CONFIG_IRQ_ALL_CPUS'
	undeclared (first use in this function)

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:51:43 +11:00
Andy Whitcroft 9100b205fd [PATCH] powerpc32: clean up available memory models
Clean up the currently available memory models for ppc32 under
the powerpc architecture.  We need FLATMEM for ppc32: enable it.
SPARSEMEM is not parameterised for ppc32 so disable that.  Take this
opportunity to clean up white space for FLATMEM_ENABLE.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:51:40 +11:00
Mike Kravetz 84c9fdd11e [PATCH] powerpc: Minor numa memory code cleanup
Here is an updated version of the patch that panics if no memory is
found as Nathan suggested.  I'm still concerned that panic strings
(not just the one added here) at this stage of booting do not show
up on my system.  But, that is an issue separate from this patch.

Combine get_mem_*_cells() routines to avoid multiple memory node
lookups.  Added missing of_node_put() call.  Changed variable names
to help with some confusion as to meaning.

Signed-off-by: Mike Kravetz <kravetz@us.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:51:34 +11:00
Paul Mackerras 54c233102f Revert "[PATCH] powerpc: Minor numa memory code cleanup"
This reverts f1fdc0117004d343698b9830e141491d5ae320d1 commit.
2006-01-09 14:51:30 +11:00
Benjamin Herrenschmidt d2dd482bc1 [PATCH] powerpc: Update OF address parsers
This updates the OF address parsers to return the IO flags
indicating the type of address obtained. It also adds a PCI
call for converting physical addresses that hit IO space into
into IO tokens, and add routines that return the translated
addresses into struct resource

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:51:26 +11:00
Benjamin Herrenschmidt bb6b9b28d6 [PATCH] powerpc: udbg updates
The udbg low level io layer has an issue with udbg_getc() returning a
char (unsigned on ppc) instead of an int, thus the -1 if you had no
available input device could end up turned into 0xff, filling your
display with bogus characters. This fixes it, along with adding a little
blob to xmon to do a delay before exiting when getting an EOF and fixing
the detection of ADB keyboards in udbg_adb.c

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:51:22 +11:00
Andy Whitcroft 54b9a9aedc [PATCH] powerpc: powermac adb fix udbg_adb_use_btext warning
When compiling without BOOTX_TEXT the following warning is emitted.
Fix up the definition to only be made when required.

      CC      arch/powerpc/platforms/powermac/udbg_adb.o
    .../arch/powerpc/platforms/powermac/udbg_adb.c:41: warning:
		`udbg_adb_use_btext' defined but not used

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:51:19 +11:00
Andy Whitcroft 52020d2bda [PATCH] powerpc: powermac adb fix dependency on btext_drawchar
udbg_adb_init() has become dependent on btext_drawchar, even when
BOOTX_TEXT support is not selected.  This leads to the error below.
Make the check dependant on BOOTX_TEXT.

      LD      .tmp_vmlinux1
    arch/powerpc/platforms/built-in.o(.toc1+0xa40): undefined
					reference to `btext_drawchar'

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:51:15 +11:00
Linas Vepstas 2bf6a8fa21 [PATCH] powerpc: migrate common PCI hotplug code
23-rpaphp-migrate.patch (parts)

This patch moves some pci device add & remove code from the PCI
hotplug directory to the arch/powerpc/kernel directory, and cleans
it up a tad. The primary reason for this is that the code performs
some fairly generic operations that are shared with the PCI error
recovery code (living in the arch/powerpc/kernel directory).

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:51:12 +11:00
Linas Vepstas facf07870b [PATCH] powerpc: make pcibios_claim_one_bus available to other code
22-rpaphp-eliminate-dupe-code.patch (parts)

The RPAPHP code contains two routines that appear to be gratuitous
copies of very similar pci code.  In particular,

   rpaphp_claim_resource ~~ pci_claim_resource
   rpadlpar_claim_one_bus == pcibios_claim_one_bus

This makes pcibios_claim_one_bus from arch/powerpc/kernel/pci_64.c
available to the RPAPHP code.

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:51:08 +11:00
Linas Vepstas e2a296eeaa [PATCH] powerpc: PCI hotplug common code elimination
20-rpaphp-eeh-cleanup.patch

This patch move some code from the rpaphp directory, to the powerpc
directory, where it should have been all along (Among other things, I
need it in the powerpc directory for the PCI error recovery.)

Please note that patch affects TWO maintainers: Paul, after applying
the powerpc part, please ask that GregKH appli the PCI part. It is safe
to have the powerpc part go in first. It would be bad to have the
PCI part go in first.

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:51:05 +11:00
Mike Kravetz 74761bb53d [PATCH] powerpc: Minor numa memory code cleanup
I started to add missing of_node_put() calls to the routines that
determine the number of cells for memory.  Decided to combine the
routines instead of making separate node lookups.  Changed variable
names to help with some confusion as to meaning.

Signed-off-by: Mike Kravetz <kravetz@us.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:51:02 +11:00
Benjamin Herrenschmidt 8dacaedf04 [PATCH] powerpc: More serial probe fixes (#2)
This fixes the new serial probe code with some PCI MMIO UARTs, and fixes
CHRP build with ARCH=powerpc.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:50:58 +11:00
David Woodhouse 623703f620 [PATCH] Fix code that saves NVGPRS in 32-bit signal frame
On Thu, 2005-11-24 at 12:51 +0000, David Woodhouse wrote:
> Somehow this one slipped through the cracks; when we ended up in
> do_signal() on a 32-bit kernel but without having the caller-saved
> registers into the regs, we didn't set the TIF_SAVE_NVGPRS flag to
> ensure they got saved later.

Oh, and if we actually set the flag, then we fairly quickly find out
that I was a bit overzealous in copying code from entry_64.S ... :)

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:50:48 +11:00
David Woodhouse 9687c58759 [PATCH] Save NVGPRS in 32-bit signal frame
Somehow this one slipped through the cracks; when we ended up in
do_signal() on a 32-bit kernel but without having the caller-saved
registers into the regs, we didn't set the TIF_SAVE_NVGPRS flag to
ensure they got saved later.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:50:45 +11:00
David Woodhouse 31df1678d7 [PATCH] powerpc: serial port discovery: cope with broken firmware
On Tue, 2005-11-22 at 15:49 +1100, Benjamin Herrenschmidt wrote:
> This moves the discovery of legacy serial ports to a separate file,
> makes it common to ppc32 and ppc64, and reworks it to use the new OF
> address translators to get to the ports early. This new version can also
> detect some PCI serial cards using legacy chips and will probably match
> those discovered port with the default console choice.

This makes it deal with the fact that the Pegasos firmware reports that
its clock frequency is zero...

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:50:42 +11:00
Benjamin Herrenschmidt 9177ae4378 [PATCH] powerpc: Fix g5 build with xmon
My previous patches inadvertently broke building a G5 kernel with
CONFIG_XMON enabled. This fixes it.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:50:38 +11:00
David Gibson 404849bbd2 [PATCH] powerpc: Remove some unneeded fields from the paca
This patch removes several unnecessary fields from the paca:

- next_jiffy_update_tb was simply unused.  Remove trivially.

- The exdsi exception save area was not used.  There were plans to use
  it, but they never seem to have gone anywhere.  If they ever do, we
  can put it back.  Remove from the paca, and from asm-offsets.c

- The default_decr field was used from asm, but was only ever assigned
  the value of tb_ticks_per_jiffy.  Just access tb_ticks_per_jiffy from
  asm directly instead.

Built and booted on POWER5 LPAR and iSeries RS64.

Signed-off-by: David Gibson <dwg@au1.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:50:35 +11:00
David Gibson 1888e7b51c [PATCH] powerpc: Remove ItLpRegSave area from the paca
On iSeries, the paca contains, amongst other things an ItLpRegSave
structure used by the hypervisor to save registers.  The hypervisor
locates this area through a pointer at the beginning of the paca, so
the structure itself can be located elsewhere.  This patch moves the
reg_save area out into its own array.  This reduces the amount of
iSeries specific gunk which is visible to general powerpc code via
paca.h

Built and booted on POWER5 LPAR and iSeries RS64.

Signed-off-by: David Gibson <dwg@au1.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:50:32 +11:00
David Gibson 456752f750 [PATCH] powerpc: Make hugepage mappings respect hint addresses
Currently, the powerpc version of hugetlb_get_unmapped_area() entirely
ignores the hint address.  The only way to get a hugepage mapping at a
specified address is with MAP_FIXED, in which case there's no way
(short of parsing /proc/self/maps) for userspace to tell if it will
clobber an existing mapping.  This is inconvenient, so the patch below
makes hugepage mappings use the given hint address if possible.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:50:28 +11:00
Kumar Gala 706e6b2caf [PATCH] powerpc: Fix suboptimal uImage target
Sam Ravnborg pointed out that calling if_changed was redundant in the
rule since a prerequisite had to have changed for us to get there.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:50:25 +11:00
Kumar Gala 8c441a57d7 [PATCH] powerpc: Add support for building uImages
powerpc: Add support for building uImages

Add support to build a kernel image bootable by u-boot.
Most of the makefile foo is taken from arch/ppc/boot/images/Makefile

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:50:21 +11:00
Stephen Rothwell 1d7a6b97f3 powerpc: more iseries irq work
Make get_IRQ return a pending irq number so it can be handled
in the powerpc geeneric code.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
2006-01-09 14:50:18 +11:00
Stephen Rothwell a50b56d24c powerpc: reduce include in irq.c
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
2006-01-09 14:50:15 +11:00
Stephen Rothwell e199500c62 powerpc: partly merge iseries do_IRQ
Hide some of the iseries details in iSeries_get_irq.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
2006-01-09 14:50:11 +11:00
Stephen Rothwell 853f828cfd powerpc: use end_IRQ for iseries irqs
Encode the sub bus number into the real irq number (even though it
is always zero for now) so that we have enough information to do
the EOI in iseries_end_IRQ.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
2006-01-09 14:50:08 +11:00
Stephen Rothwell 60798c6a27 powerpc: cleanup iseries irq.c
Remove two useless counters.
DeStropify.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
2006-01-09 14:50:05 +11:00
Benjamin Herrenschmidt d7f3945420 [PATCH] powerpc: Add back support for booting from BootX (#2)
ARCH=powerpc couldn't boot from BootX as it uses a "different" way of
getting in the kernel. This patch adds the necessary trampolines,
creating a flattened device-tree from the tree passed from MacOS, and
initializing the btext engine early for really-early debugging.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:49:58 +11:00
Benjamin Herrenschmidt 51d3082fe6 [PATCH] powerpc: Unify udbg (#2)
This patch unifies udbg for both ppc32 and ppc64 when building the
merged achitecture. xmon now has a single "back end". The powermac udbg
stuff gets enriched with some ADB capabilities and btext output. In
addition, the early_init callback is now called on ppc32 as well,
approx. in the same order as ppc64 regarding device-tree manipulations.
The init sequences of ppc32 and ppc64 are getting closer, I'll unify
them in a later patch.

For now, you can force udbg to the scc using "sccdbg" or to btext using
"btextdbg" on powermacs. I'll implement a cleaner way of forcing udbg
output to something else than the autodetected OF output device in a
later patch.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:49:54 +11:00
Benjamin Herrenschmidt 463ce0e103 [PATCH] powerpc: serial port discovery (#2)
This moves the discovery of legacy serial ports to a separate file,
makes it common to ppc32 and ppc64, and reworks it to use the new OF
address translators to get to the ports early. This new version can also
detect some PCI serial cards using legacy chips and will probably match
those discovered port with the default console choice.

Only ppc64 gets udbg still yet, unifying udbg isn't finished yet.

It also adds some speed-probing code to udbg so that the default console
can come up at the same speed it was set to by the firmware.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:49:50 +11:00
Benjamin Herrenschmidt d1405b8698 [PATCH] powerpc: Add OF address parsing code (#2)
Parsing addresses extracted from Open Firmware isn't a simple matter. We
have various bits of code that try to do it in various place, including
some heuristics in prom.c that pre-parse addresses at boot and fill
device-nodes "addrs", but those are dodgy at best and I want to
deprecate them. So this patch introduces a new set of routines that
should be capable of parsing most types of addresses and translating
them into CPU physical addresses. It currently works for things on PCI
busses and ISA busses and should work on "standard" busses like the root
bus or the MacIO bus that don't put funky flags in addresses. If you
have other bus types that do use funky flags, you'll have to add new bus
type translators, which is fairly easy.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:49:46 +11:00
David Woodhouse bcb05504ed [PATCH] ppc64 syscall_exit_work: call the save_nvgprs function, not its descriptor.
On Tue, 2005-11-15 at 18:52 +0000, David Woodhouse wrote:
> This cleanup patch speeds up the null syscall path on ppc64 by about 3%,
> and brings the ppc32 and ppc64 code slightly closer together.

Needs this unless your binutils, like mine, are clever enough to notice
my stupidity and fix it up automatically...

Spotted by Paul.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:49:42 +11:00
Arnd Bergmann 8b3d6663c6 [PATCH] spufs: cooperative scheduler support
This adds a scheduler for SPUs to make it possible to use
more logical SPUs than physical ones are present in the
system.

Currently, there is no support for preempting a running
SPU thread, they have to leave the SPU by either triggering
an event on the SPU that causes it to return to the
owning thread or by sending a signal to it.

This patch also adds operations that enable accessing an SPU
in either runnable or saved state. We use an RW semaphore
to protect the state of the SPU from changing underneath
us, while we are holding it readable. In order to change
the state, it is acquired writeable and a context save
or restore is executed before downgrading the semaphore
to read-only.

From: Mark Nutter <mnutter@us.ibm.com>,
      Uli Weigand <Ulrich.Weigand@de.ibm.com>
Signed-off-by: Arnd Bergmann <arndb@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:49:30 +11:00
Mark Nutter 05b841174c [PATCH] spufs: add spu-side context switch code
Add the source code that is used to generate spu_save_dump.h and
spu_restore_dump.h. Since a full spu tool chain is needed to
generate these files, the default remains to use the shipped
versions in order to keep the number of tools for building the
kernel down.

Signed-off-by: Arnd Bergmann <arndb@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:49:25 +11:00
Mark Nutter 7c038749d1 [PATCH] kernel-side context switch code for spufs
This adds the code needed to perform a context switch from
spufs, following the recommended 76-step sequence.

Signed-off-by: Arnd Bergmann <arndb@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:49:21 +11:00
Mark Nutter 5473af049d [PATCH] spufs: switchable spu contexts
Add some infrastructure for saving and restoring the context of an
SPE. This patch creates a new structure that can hold the whole
state of a physical SPE in memory. It also contains code that
avoids races during the context switch and the binary code that
is loaded to the SPU in order to access its registers.

The actual PPE- and SPE-side context switch code are two separate
patches.

Signed-off-by: Arnd Bergmann <arndb@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:49:16 +11:00
Arnd Bergmann 67207b9664 [PATCH] spufs: The SPU file system, base
This is the current version of the spu file system, used
for driving SPEs on the Cell Broadband Engine.

This release is almost identical to the version for the
2.6.14 kernel posted earlier, which is available as part
of the Cell BE Linux distribution from
http://www.bsc.es/projects/deepcomputing/linuxoncell/.

The first patch provides all the interfaces for running
spu application, but does not have any support for
debugging SPU tasks or for scheduling. Both these
functionalities are added in the subsequent patches.

See Documentation/filesystems/spufs.txt on how to use
spufs.

Signed-off-by: Arnd Bergmann <arndb@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:49:12 +11:00
Heiko J Schick d7a301033f [PATCH] powerpc: IBMEBUS bus support
This patch adds the necessary core bus support used by device drivers
that sit on the IBM GX bus on modern pSeries machines like the Galaxy
infiniband for example. It provide transparent DMA ops (the low level
driver works with virtual addresses directly) along with a simple bus
layer using the Open Firmware matching routines.

Signed-off-by: Heiko J Schick <schickhj@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:49:06 +11:00
David Woodhouse 401d1f029b [PATCH] syscall entry/exit revamp
This cleanup patch speeds up the null syscall path on ppc64 by about 3%,
and brings the ppc32 and ppc64 code slightly closer together.

The ppc64 code was checking current_thread_info()->flags twice in the
syscall exit path; once for TIF_SYSCALL_T_OR_A before disabling
interrupts, and then again for TIF_SIGPENDING|TIF_NEED_RESCHED etc after
disabling interrupts. Now we do the same as ppc32 -- check the flags
only once in the fast path, and re-enable interrupts if necessary in the
ptrace case.

The patch abolishes the 'syscall_noerror' member of struct thread_info
and replaces it with a TIF_NOERROR bit in the flags, which is handled in
the slow path. This shortens the syscall entry code, which no longer
needs to clear syscall_noerror.

The patch adds a TIF_SAVE_NVGPRS flag which causes the syscall exit slow
path to save the non-volatile GPRs into a signal frame. This removes the
need for the assembly wrappers around sys_sigsuspend(),
sys_rt_sigsuspend(), et al which existed solely to save those registers
in advance. It also means I don't have to add new wrappers for ppoll()
and pselect(), which is what I was supposed to be doing when I got
distracted into this...

Finally, it unifies the ppc64 and ppc32 methods of handling syscall exit
directly into a signal handler (as required by sigsuspend et al) by
introducing a TIF_RESTOREALL flag which causes _all_ the registers to be
reloaded from the pt_regs by taking the ret_from_exception path, instead
of the normal syscall exit path which stomps on the callee-saved GPRs.

It appears to pass an LTP test run on ppc64, and passes basic testing on
ppc32 too. Brief tests of ptrace functionality with strace and gdb also
appear OK. I wouldn't send it to Linus for 2.6.15 just yet though :)

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:49:01 +11:00
Kumar Gala 1cd8e50620 [PATCH] powerpc: moved ipic code to arch/powerpc
Moved 83xx and QUICC Engine interrupt handling code into arch/powerpc
as a precursor of getting 83xx sub-arch building in arch/powerpc.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:48:57 +11:00
Michael Ellerman 3d1229d6ae [PATCH] powerpc: Merge kexec
This patch merges, to some extent, the PPC32 and PPC64 kexec implementations.

We adopt the PPC32 approach of having ppc_md callbacks for the kexec functions.
The current PPC64 implementation becomes the "default" implementation for PPC64
which platforms can select if they need no special treatment.

I've added these default callbacks to pseries/maple/cell/powermac, this means
iSeries no longer supports kexec - but it never worked anyway.

I've renamed PPC32's machine_kexec_simple to default_machine_kexec, inline with
PPC64. Judging by the comments it might be better named machine_kexec_non_of,
or something, but at the moment it's the only implementation for PPC32 so it's
the "default".

Kexec requires machine_shutdown(), which is in machine_kexec.c on PPC32, but we
already have in setup-common.c on powerpc. All this does is call
ppc_md.nvram_sync, which only powermac implements, so instead make
machine_shutdown a ppc_md member and have it call core99_nvram_sync directly
on powermac.

I've also stuck relocate_kernel.S into misc_32.S for powerpc.

Built for ARCH=ppc, and 32 & 64 bit ARCH=powerpc, with KEXEC=y/n. Booted on
P5 LPAR and successfully kexec'ed.

Should apply on top of 493f25ef40.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:48:52 +11:00
Adrian Bunk afcc2472d8 [PATCH] PPC_PREP: remove unneeded exports
This patch removes the EXPORT_SYMBOL'ed but completely unused variable
ucSystemType and removes the unneeded EXPORT_SYMBOL(_prep_type).

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Acked-by: Tom Rini <trini@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-01-09 14:48:47 +11:00
Sam Ravnborg ad14336de8 kbuild: remove GCC_VERSION
This was causing some ordering problems.  Remove the up-front evaluation
and just revaluate the compiler version each time we need it.

(The up-front evaluation was problematic because some architectures modify
the value of $(CC)).

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2006-01-08 19:58:51 +01:00
Kay Sievers 312c004d36 [PATCH] driver core: replace "hotplug" by "uevent"
Leave the overloaded "hotplug" word to susbsystems which are handling
real devices. The driver core does not "plug" anything, it just exports
the state to userspace and generates events.

Signed-off-by: Kay Sievers <kay.sievers@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-01-04 16:18:08 -08:00
Anton Blanchard e597cb32e9 [PATCH] ppc64: htab_initialize_secondary cannot be marked __init
Sonny has noticed hotplug CPU on ppc64 is broken in 2.6.15-*. One of the
problems is that htab_initialize_secondary is called when a cpu is being
brought up, but it is marked __init.

Signed-off-by: Anton Blanchard <anton@samba.org>
Acked-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-12-29 10:26:36 -08:00
Paul Mackerras 8b1af56b29 powerpc: Fix i8259 cascade on pSeries with XICS interrupt controller
It turns out that commit f9bd170a87
broke the cascade from XICS to i8259 on pSeries machines; specifically
we ended up not ever doing the EOI on the XICS for the cascade.  The
result was that interrupts from the serial ports (and presumably any
other devices using ISA interrupts) didn't get through.  This fixes
it and also simplifies the code, by doing the EOI on the XICS in the
xics_get_irq routine after reading and acking the interrupt on the
i8259.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-12-22 21:55:37 +11:00
Linus Torvalds d5d74efbea Merge git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc-merge 2005-12-20 09:41:25 -08:00
Paul Mackerras 5a1244e9dd powerpc: update defconfigs
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-12-20 16:00:17 +11:00
Paul Mackerras 3eb6f26bcd powerpc: correct register usage in 64-bit syscall exit path
Since we don't restore the volatile registers in the syscall exit
path, we need to make sure we don't leak any potentially interesting
values from the kernel to userspace.  This was already the case for
all except r11.  This makes it use r11 for an MSR value, so r11 will
have an (uninteresting) MSR value in it on return to userspace.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-12-20 15:38:47 +11:00
Al Viro ebbd1bce79 [PATCH] arch/powerpc/kernel/syscalls.c __user annotations
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-12-15 10:04:31 -08:00
Keshavamurthy Anil S bf8d5c52c3 [PATCH] kprobes: increment kprobe missed count for multiprobes
When multiple probes are registered at the same address and if due to some
recursion (probe getting triggered within a probe handler), we skip calling
pre_handlers and just increment nmissed field.

The below patch make sure it walks the list for multiple probes case.
Without the below patch we get incorrect results of nmissed count for
multiple probe case.

Signed-off-by: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-12-12 08:57:45 -08:00
Benjamin Herrenschmidt b39f9485e6 [PATCH] powerpc: Fix clock spreading setting on some powermacs
The code that sets the clock spreading feature of the Intrepid ASIC
must not be run on some machine models or those won't boot. This
fixes it.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-12-12 14:16:09 +11:00
David Gibson 23ed6cb9a2 [PATCH] powerpc: Fix SLB flushing path in hugepage
On ppc64, when opening a new hugepage region, we need to make sure any
old normal-page SLBs for the area are flushed on all CPUs.  There was
a bug in this logic - after putting the new hugepage area masks into
the thread structure, we copied it into the paca (read by the SLB miss
handler) only on one CPU, not on all.  This could cause incorrect SLB
entries to be loaded when a multithreaded program was running
simultaneously on several CPUs.  This patch corrects the error,
copying the context information into the PACA on all CPUs using the mm
in question before flushing any existing SLB entries.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-12-09 16:57:35 +11:00
David Gibson cbf52afdc0 [PATCH] powerpc: Add missing icache flushes for hugepages
On most powerpc CPUs, the dcache and icache are not coherent so
between writing and executing a page, the caches must be flushed.
Userspace programs assume pages given to them by the kernel are icache
clean, so we must do this flush between the kernel clearing a page and
it being mapped into userspace for execute.  We were not doing this
for hugepages, this patch corrects the situation.

We use the same lazy mechanism as we use for normal pages, delaying
the flush until userspace actually attempts to execute from the page
in question.

Tested on G5.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-12-09 16:30:48 +11:00
Olof Johansson dabcafd3f3 [PATCH] powerpc: Set cache info defaults
Cache info is setup by walking the device tree in initialize_cache_info().
However, icache_flush_range might be called before that, in
slb_initialize()->patch_slb_encoding, which modifies the load immediate
instructions used with SLB fault code.

Not only that, but depending on memory layout, we might take SLB faults
during unflatten_device_tree. So that fault will load an SLB entry that
might not contain the right LLP flags for the segment.

Either we can walk the flattened device tree to setup cache info, or
we can pick the known defaults that are known to work. Doing it in the
flattened device tree is hairier since we need to know the machine type
to know what property to look for, etc, etc.

For now, it's just easier to go with the defaults. Worst thing that
happens from it is that we might waste a few cycles doing too small
dcbst/icbi increments.

Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-12-09 15:42:52 +11:00
Benjamin Herrenschmidt 6184b72387 [PATCH] powerpc: Remove debug code in hash path
Some debug code wasn't properly removed from the initial 64k pages
patch, and while it's harmless, it's also slowing down significantly a
very hot code path, thus it should really be removed.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-12-08 16:57:47 +11:00
Benjamin Herrenschmidt 325c82a029 [PATCH] powerpc: Fix a huge page bug
The 64k pages patch changed the meaning of one argument passed to the
low level hash functions (from "large" it became "psize" or page size
index), but one of the call sites wasn't properly updated, causing
potential random weird problems with huge pages. This fixes it.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-12-08 16:57:41 +11:00
Mike Kravetz 6d91bb93e4 [PATCH] powerpc/pseries: boot failures on numa if no memory on node
This bug exists in the current code and prevents machines from booting
with numa enabled if there is a node that does not contain memory.
Workaround is to boot with 'numa=off'.  Looks like a simple typo.

Signed-off-by: Mike Kravetz <kravetz@us.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-12-08 16:54:39 +11:00
Olof Johansson ca507eaf32 [PATCH] powerpc: remove redundant code in stab init
There's never been a hardware platform that has both pSeries/RPA LPAR
hypervisor and stab (pre-POWER4 segment management). This removes
the redundant code in stab_initalize().

Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-12-05 15:41:35 +11:00
Paul Mackerras 6fbb618f5d powerpc/pseries: Optimize IOMMU setup
The previous commit will use the page-at-a-time hypervisor call for
setting up IOMMU entries when we are using 64k pages and setting up
one 64k page, even though that means 16 calls to the hypervisor, since
the hypervisor still works on 4k pages.  This optimizes this case by
using the multi-page IOMMU setup hypervisor call instead.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-12-05 14:19:10 +11:00
Olaf Hering e8a167accb [PATCH] powerpc: correct the NR_CPUS description text
Update the help text to match the allowed range.

Signed-off-by: Olaf Hering <olh@suse.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-12-02 14:51:35 +11:00
Michal Ostrowski cc8b5c96a7 [PATCH] powerpc/pseries: Fix TCE building with 64k pagesize
Must adjust tcenum and npages by TCE_PAGE_FACTOR to convert between
64KB pages and TCE (4K) pages.  (This is done in other places, except
for this one location.)

Signed-off-by: Michal Ostrowski <mostrows at watson ibm com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-12-02 14:51:22 +11:00
Olaf Hering ed1189b7e8 [PATCH] powerpc: prevent stack corruption in call_prom_ret
Use the correct pointer to clear the memory of the return values,
to prevent stack corruption in the callers stackframe.

Signed-off-by: Olaf Hering <olh@suse.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-30 13:55:59 +11:00
Paul Mackerras 48abec07cf powerpc: Fix bug causing FP registers corruption on UP + preempt
This fixes a bug noticed by Paolo Galtieri and fixed for ARCH=ppc in
the previous commit (ppc: fix floating point register corruption).
This fixes the arch/powerpc code by adding preempt_disable/enable,
and also cleans it up a bit by pulling out the code that discards
any lazily-switched CPU register state into a new function, rather
than having that code repeated in three places.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-30 13:20:54 +11:00
Paul Mackerras 666acb94d1 powerpc: Export __flush_icache_range for 32-bit
Both 32-bit and 64-bit use the same inline flush_icache_range definition
now, so both need to export __flush_icache_range, not just 64-bit.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-29 15:50:58 +11:00
Linus Torvalds 6aab341e0a mm: re-architect the VM_UNPAGED logic
This replaces the (in my opinion horrible) VM_UNMAPPED logic with very
explicit support for a "remapped page range" aka VM_PFNMAP.  It allows a
VM area to contain an arbitrary range of page table entries that the VM
never touches, and never considers to be normal pages.

Any user of "remap_pfn_range()" automatically gets this new
functionality, and doesn't even have to mark the pages reserved or
indeed mark them any other way.  It just works.  As a side effect, doing
mmap() on /dev/mem works for arbitrary ranges.

Sparc update from David in the next commit.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-28 14:34:23 -08:00
David Gibson 9a94c5793a [PATCH] powerpc: More hugepage boundary case fixes
Blah.  The patch [0] I recently sent fixing errors with
in_hugepage_area() and prepare_hugepage_range() for powerpc itself has
an off-by-one bug.  Furthermore, the related functions
touches_hugepage_*_range() and within_hugepage_*_range() are also
buggy.  Some of the bugs, like those addressed in [0] originated with
commit 7d24f0b8a5 where we tweaked the
semantics of where hugepages are allowed.  Other bugs have been there
essentially forever, and are due to the undefined behaviour of '<<'
with shift counts greater than the type width (LOW_ESID_MASK could
return non-zero for high ranges with the right congruences).

The good news is that I now have a testsuite which should pick up
things like this if they creep in again.

[0] "powerpc-fix-for-hugepage-areas-straddling-4gb-boundary"

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-25 22:12:45 +11:00
Paul Mackerras 26925c5910 Merge ../linux-2.6 2005-11-25 22:12:01 +11:00
Stephen Rothwell 55bb239e54 [PATCH] powerpc: remove arch/powerpc/include hack for 64 bit
With the removal of include/asm-powerpc, we no longer need
arch/powerpc/include/asm for the 64 bit build.  We also do not need
-Iarch/powerpc for the 64 bit build either.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-25 22:11:23 +11:00
David Gibson 5e391dc9e3 [PATCH] powerpc: fix for hugepage areas straddling 4GB boundary
Commit 7d24f0b8a5 fixed bugs in the ppc64 SLB
miss handler with respect to hugepage handling, and in the process tweaked
the semantics of the hugepage address masks in mm_context_t.

Unfortunately, it left out a couple of necessary changes to go with that
change.  First, the in_hugepage_area() macro was not updated to match,
second prepare_hugepage_range() was not updated to correctly handle
hugepages regions which straddled the 4GB point.

The latter appears only to cause process-hangs when attempting to map such
a region, but the former can cause oopses if a get_user_pages() is
triggered at the wrong point.  This patch addresses both bugs.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-23 16:08:39 -08:00
Jim Keniston 8bf1101bd5 [PATCH] kprobes: Fix return probes on sys_execve
Fix a bug in kprobes that can cause an Oops or even a crash when a return
probe is installed on one of the following functions: sys_execve,
do_execve, load_*_binary, flush_old_exec, or flush_thread.  The fix is to
remove the call to kprobe_flush_task() in flush_thread().  This fix has
been tested on all architectures for which the return-probes feature has
been implemented (i386, x86_64, ppc64, ia64).  Please apply.

BACKGROUND

Up to now, we have called kprobe_flush_task() under two situations: when a
task exits, and when it execs.  Flushing kretprobe_instances on exit is
correct because (a) do_exit() doesn't return, and (b) one or more
return-probed functions may be active when a task calls do_exit().  Neither
is the case for sys_execve() and its callees.

Initially, the mistaken call to kprobe_flush_task() on exec was harmless
because we put the "real" return address of each active probed function
back in the stack, just to be safe, when we recycled its
kretprobe_instance.  When support for ppc64 and ia64 was added, this safety
measure couldn't be employed, and was eventually dropped even for i386 and
x86_64.  sys_execve() and its callees were informally blacklisted for
return probes until this fix was developed.

Acked-by: Prasanna S Panchamukhi <prasanna@in.ibm.com>
Signed-off-by: Jim Keniston <jkenisto@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-23 16:08:39 -08:00
Hugh Dickins 7ce774b480 [PATCH] mm: powerpc init_mm without ptlock
Restore an earlier mod which went missing in the powerpc reshuffle: the 4xx
mmu_mapin_ram does not need to take init_mm.page_table_lock.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-23 16:08:38 -08:00
Hugh Dickins 01edcd891c [PATCH] mm: powerpc ptlock comments
Update comments (only) on page_table_lock and mmap_sem in arch/powerpc.
Removed the comment on page_table_lock from hash_huge_page: since it's no
longer taking page_table_lock itself, it's irrelevant whether others are; but
how it is safe (even against huge file truncation?) I can't say.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-23 16:08:38 -08:00
Olof Johansson 91f14480a5 [PATCH] powerpc: update my email address
Email address update, changing old work address to personal (permanent)
one.

Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-23 21:23:20 +11:00
Hugh Dickins 0b14c179a4 [PATCH] unpaged: VM_UNPAGED
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: Hugh Dickins <hugh@veritas.com>
Acked-by: William Irwin <wli@holomorphy.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-22 09:13:42 -08:00
Paul Mackerras 54c4e6b5fe powerpc: Fix bug in timebase synchronization on 32-bit SMP powermac
We were using udelay in the loop on the primary cpu waiting for the
secondary cpu to take the timebase value.  Unfortunately now that
udelay uses the timebase, and the timebase is stopped at this point,
the udelay never terminated.  This fixes it by not using udelay, and
increases the number of loops before we time out to compensate.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-19 21:24:55 +11:00
Paul Mackerras 21a6290220 powerpc: move include/asm-ppc64/ptrace-common.h to arch/powerpc/kernel
It's only used by arch/powerpc/kernel/ptrace{,32}.c.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-19 20:47:22 +11:00
Paul Mackerras f8ef270596 powerpc: Merge pci.h
This involves some minor changes: a few unused functions that the
ppc32 pci.c provides are no longer declared here or exported;
pcibios_assign_all_busses now just refers to the pci_assign_all_buses
variable on both 32-bit and 64-bit; pcibios_scan_all_fns is now
just 0 instead of a function that always returns 0 on 64-bit.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-19 20:46:04 +11:00
David Gibson 800fc3eeb0 [PATCH] powerpc: Remove imalloc.h
asm-ppc64/imalloc.h is only included from files in arch/powerpc/mm.
We already have a header for mm local definitions,
arch/powerpc/mm/mmu_decl.h.  Thus, this patch moves the contents of
imalloc.h into mmu_decl.h.  The only exception are the definitions of
PHBS_IO_BASE, IMALLOC_BASE and IMALLOC_END.  Those are moved into
pgtable.h, next to similar definitions of VMALLOC_START and
VMALLOC_SIZE.

Built for multiplatform 32bit and 64bit (ARCH=powerpc).

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-19 14:46:02 +11:00
Benjamin Herrenschmidt e53566409c [PATCH] powerpc: Fix setting MPIC priority
Trying to set the priority would just disable the interrupt due to an
incorrect mask used. We rarely use that call, in fact, I think only in
the powermac code for the cmd-power key combo that triggers xmon. So it
got unnoticed for a while.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-19 14:19:13 +11:00
Paul Mackerras 8a5abdf80e powerpc: Move defconfig over and remove remaining arch/ppc64 files
make defconfig will now use arch/powerpc/configs/ppc64_defconfig
if running on a ppc64 system.  I need to add an
arch/powerpc/configs/ppc_defconfig sometime.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-18 16:39:08 +11:00
Paul Mackerras 44aedfe7de powerpc: Fix a couple of compile warnings for 32-bit compiles
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-18 15:54:12 +11:00
Paul Mackerras 49e16b7bec powerpc: time-of-day fixes for 32-bit CHRP systems
This makes 32-bit CHRP systems use the RTAS time-of-day routines if
available.  It fixes a bug in the RTAS time-of-day routines where they
were storing a 64-bit timebase value in an unsigned long by making
those variables u64.  Also, the direct-access time-of-day routines
had the wrong convention for the month and year in the struct rtc_time.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-18 15:52:38 +11:00
Paul Mackerras 6146eed1e9 powerpc: Fix compile error on pSeries arising from delay.h changes
pseries_dedicated_idle() was using __get_tb which used to be defined
in asm/delay.h.  Change it to use get_tb from asm/time.h, which is
in fact exactly the same thing.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-18 15:47:18 +11:00
Paul Mackerras 437a58db57 powerpc: Move remaining .c files from arch/ppc64 to arch/powerpc
This also deletes the now-unused Makefiles under arch/ppc64.

Both of the files moved over could use some merging, but for now I
have moved them as-is and arranged for them to be used only in 64-bit
kernels.  For 32-bit kernels we still use arch/ppc/kernel/idle.c and
drivers/char/generic_nvram.c as before.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-18 15:43:34 +11:00
Mike Kravetz f62859bb68 [PATCH] Remove SPAN_OTHER_NODES config definition
The config option SPAN_OTHER_NODES was created so that we could
make pSeries numa layouts work within the DISCONTIG memory model.
Now that DISCONTIG has been replaced by SPARSEMEM, we can eliminate
this option.

I'll be sending a separate patch to Andrew to remove the arch
independent code as pSeries was the only arch that needed this.

Signed-off-by: Mike Kravetz <kravetz@us.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-18 14:45:54 +11:00
Benjamin Herrenschmidt 5daf9071b5 [PATCH] powerpc: merge align.c
This patch merges align.c, the result isn't quite what was in ppc64 nor
what was in ppc32 :) It should implement all the functionalities of both
though. Kumar, since you played with that in the past, I suppose you
have some test cases for verifying that it works properly before I dig
out the 601 machine ? :)

Since it's likely that I won't be able to test all scenario, code
inspection is much welcome.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-18 14:39:23 +11:00
Paul Mackerras 6defa38b37 powerpc: Fix delay functions for 601 processors
My earlier merge of delay.h introduced a timebase-based udelay for
32-bit machines but also broke the 601, which doesn't have the
timebase register.  This fixes it by using the 601's RTC register on
the 601, and also moves __delay() and udelay() to be out-of-line in
arch/powerpc/kernel/time.c.  These functions aren't really performance
critical, after all.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-18 14:08:12 +11:00
Segher Boessenkool a097a35c9a [PATCH] powerpc: Maple: request I/O resource.
Reserve the Maple RTC I/O resource.  Needed now we use genrtc.

Signed-off-by: Segher Boessenkool <segher@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-18 13:31:20 +11:00
Olaf Hering 68643cfb87 [PATCH] ppc boot: replace string labels with numbers
Replacing the string labels with numbers saves 117 bytes in the final zImage.
These local labels are not discared.

Signed-off-by: Olaf Hering <olh@suse.de>

 arch/powerpc/boot/crt0.S |   23 +++++++++++------------
 1 files changed, 11 insertions(+), 12 deletions(-)
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-18 13:18:16 +11:00
David Woodhouse 1e28a7ddd3 [PATCH] Avoid use of uninitialised spinlock in EEH.
If the kernel supports both G5 and pSeries, and CONFIG_EEH is enabled,
eeh_init() is (quite reasonably) never called when we boot on a G5. Yet
eeh_check_failure() still gets called. We should avoid doing that if
!eeh_subsystem_enabled.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-17 16:53:38 +11:00
Linus Torvalds d58a75ef75 Merge git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc-merge 2005-11-16 07:58:48 -08:00
Benjamin Herrenschmidt 5d66da3d71 [PATCH] powerpc: Make the vDSO functions set error code (#2)
The vDSO functions should have the same calling convention as a syscall.
Unfortunately, they currently don't set the cr0.so bit which is used to
indicate an error. This patch makes them clear this bit unconditionally
since all functions currently succeed. The syscall fallback done by some
of them will eventually override this if the syscall fails.

This also changes the symbol version of all vdso exports to make sure
glibc can differenciate between old and fixed calls for existing ones
like __kernel_gettimeofday.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-16 14:05:11 +11:00
Paul Mackerras 94b212c29f powerpc: Move ppc64 boot wrapper code over to arch/powerpc
This also extends the code to handle 32-bit ELF vmlinux files as well
as 64-bit ones.  This is sufficient for booting on new-world 32-bit
powermacs (i.e. all recent machines).

Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-16 13:52:21 +11:00
Olof Johansson 950fc0025f [PATCH] powerpc: add new powerbooks to feature table
Hi,

The previous PowerBook patch didn't contain the feature table updates
for ARCH=powerpc. Here they are.

Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-16 13:52:06 +11:00
Benjamin Herrenschmidt b5166cc252 [PATCH] powerpc: pci_64 fixes & cleanups
I discovered that in some cases (PowerMac for example) we wouldn't
properly map the PCI IO space on recent kernels. In addition, the code
for initializing PCI host bridges was scattered all over the place with
some duplication between platforms.

This patch fixes the problem and does a small cleanup by creating a
pcibios_alloc_controller() in pci_64.c that is similar to the one in
pci_32.c (just takes an additional device node argument) that takes care
of all the grunt allocation and initialisation work. It should work for
both boot time and dynamically allocated PHBs.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-16 13:29:46 +11:00
Michael Ellerman f9e4ec57c6 [PATCH] powerpc: More debugging fixups
Add a few more missing includes of udbg.h

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-16 13:29:40 +11:00
Michael Ellerman eb481899aa [PATCH] powerpc: Fixup debugging in lmb.c
Somewhere we lost the include of udbg.h in lmb.c. While we're there, add a DBG
macro like every other file has and use it in lmb_dump_all().

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-16 13:28:40 +11:00
Benjamin Herrenschmidt 5444a5e9e8 [PATCH] powerpc: update defconfigs
My patch moving ppc64 RTC to genrtc was supposed to update all
defconfigs, but for some reason, the patch actually posted only had the
pseries one... ouch. This patch properly updates all defconfigs.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-16 13:28:32 +11:00
Paul Mackerras fb6d73d301 [PATCH] powerpc: Fix sparsemem with memory holes [was Re: ppc64 oops..]
This patch should fix the crashes we have been seeing on 64-bit
powerpc systems with a memory hole when sparsemem is enabled.
I'd appreciate it if people who know more about NUMA and sparsemem
than me could look over it.

There were two bugs.  The first was that if NUMA was enabled but there
was no NUMA information for the machine, the setup_nonnuma() function
was adding a single region, assuming memory was contiguous.  The
second was that the loops in mem_init() and show_mem() assumed that
all pages within the span of a pgdat were valid (had a valid struct
page).

I also fixed the incorrect setting of num_physpages that Mike Kravetz
pointed out.

Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-15 16:57:12 -08:00
Ben Collins fa63b22982 [PATCH] Add missing EXPORT_SYMBOLS() for __ide_mm_* functions on powerpc
These exported symbols are in arch/ppc/ but missing from arch/powerpc/ for
ppc32 builds.

Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-15 08:59:19 -08:00
Paul Mackerras ba76cd575f powerpc: Remove __init from a function used in suspend/resume.
Suspend/resume on powermacs uses the pmac_get_boot_time function,
so it can't be marked as __init.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-15 11:17:09 +11:00
Paul Mackerras cc657f5392 powerpc: Fix clearing of the FPSCR when invoking a signal handler
As pointed out by Gary Byers, we were clearing the image of the FPSCR
(floating point status and control register) in the thread_struct before
copying it to the user stack when invoking a signal.  Thus the task
would see its FPSCR getting cleared when it took a signal.

While fixing it I noticed that our swapcontext system call was also
clearing FPSCR.  It shouldn't, so I fixed that too.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-15 11:11:32 +11:00
Paul Mackerras 5be396b00c powerpc: Mark PREP and embedded as broken for now
These machines don't have working ARCH=powerpc support yet, so make
them depend on BROKEN so people don't enable them inadvertently and
get compile errors.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-14 17:31:55 +11:00
Paul Mackerras 1dfc677209 powerpc: Export a couple of prom functions
These are needed by the TPM driver, apparently.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-14 17:30:40 +11:00
Paul Mackerras 7568cb4ef6 powerpc: Move most remaining ppc64 files over to arch/powerpc
Also deletes files in arch/ppc64 that are no longer used now that
we don't compile with ARCH=ppc64 any more.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-14 17:30:17 +11:00
Paul Mackerras 821077b261 Merge git://oak/home/sfr/kernels/iseries/work 2005-11-14 17:15:45 +11:00
Stephen Rothwell d7867959e7 powerpc: iSeries build fixes
log_plpar_hcall_return is only used on PPC_PSERIES, so move
it closer to its users and inside ifdef CONFIG_PPC_PSERIES.

remove the last vestiges of systemcfg in iSeries.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
2005-11-14 17:14:51 +11:00
Benjamin Herrenschmidt 3136254ca5 [PATCH] powerpc: kill ppc64 rtc.c, use genrtc instead
This moves the rtas RTC callbacks to rtas-rtc.c in arch/powerpc/kernel,
and kills the rest of arch/ppc64/kernel/rtc.c which was just a duplicate
of the genrtc functionality. Also enable build of genrtc for
CONFIG_PPC64 (it just works are we already have the required callbacks)
and enable it in all defconfigs.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-14 16:36:08 +11:00
Benjamin Herrenschmidt 0c37ec2aa8 [PATCH] powerpc: vdso fixes (take #2)
This fixes various errors in the new functions added in the vDSO's,
I've now verified all functions on both 32 and 64 bits vDSOs. It also
fix a sign extension bug getting the initial time of day at boot that
could cause the monotonic clock value to be completely on bogus for
64 bits applications (with either the vDSO or the syscall) on
powermacs.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-14 16:35:58 +11:00
Benjamin Herrenschmidt 50092b233a [PATCH] powerpc: Always rebuild arch/powerpc/include/asm symlink
This patch uses a FORCE dependency on the arch/powerpc/include/asm
symlink so that it always gets rebuilt, thus avoiding all sort of funny
errors if the .config is changed between 32 and 64 bits.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-14 16:35:50 +11:00
Michael Ellerman 593e537b93 [PATCH] powerpc: Export htab start/end via device tree
The userspace kexec-tools need to know the location of the htab on non-lpar
machines, as well as the end of the kernel. Export via the device tree.

NB. This patch has been updated to use "linux,x" property names. You may
need to update your kexec-tools to match.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-14 16:34:06 +11:00
Michael Ellerman c5e24354ef [PATCH] powerpc: Turn cpu_irq_down into kexec_cpu_down
We currently have a ppc_md member called cpu_irq_down, which disables IRQs
for the cpu in question. The only caller of cpu_irq_down is the kexec code.

On pSeries we need to do more than just teardown IRQs at kexec time, so rename
the ppc_md member to kexec_cpu_down and expand it. The pSeries code needs to
know, and other platforms might too, whether we're doing a crash shutdown (ie.
panicking) or a regular kexec, so add a flag for that.

The pSeries implementation of kexec_cpu_down does an unregister VPA call, which
tells the Hypervisor to stop writing stuff into our pacas. Without this we can
get weird memory corruption bugs when we kexec, caused by the Hypervisor
writing into the first kernel's pacas which happens to be somewhere interesting
in the second kernel's memory.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-14 16:33:09 +11:00
Stephen Rothwell 868accb7b9 powerpc: have only one definition of __irq_offset_value
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
2005-11-14 14:44:33 +11:00
Stephen Rothwell d9ae2bad5c powerpc: make iSeries use generic virtual irq mapping
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
2005-11-14 14:44:24 +11:00
Andrew Morton 4694ca02d1 [PATCH] powerpc-xmon-build-fix
arch/powerpc/xmon/xmon.c:525: error: syntax error before "xmon_irq"
arch/powerpc/xmon/xmon.c:526: warning: return type defaults to `int'
arch/powerpc/xmon/xmon.c: In function `xmon_irq':
arch/powerpc/xmon/xmon.c:532: error: `IRQ_HANDLED' undeclared (first use in this function)
arch/powerpc/xmon/xmon.c:532: error: (Each undeclared identifier is reported only once
arch/powerpc/xmon/xmon.c:532: error: for each function it appears in.)

Cc: Paul Mackerras <paulus@samba.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-13 18:14:13 -08:00
Kumar Gala 4c8d3d997e [PATCH] Update email address for Kumar
Changed jobs and the Freescale address is no longer valid.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-13 18:14:10 -08:00
Christoph Hellwig 535f8d65d8 [SPARC]: Fix RTC compat ioctl kernel log spam.
On Fri, Nov 11, 2005 at 12:58:40PM -0800, David S. Miller wrote:
> 
> This change:
> 
> diff-tree 8ca2bdc7a9 (from feee207e44d3643d19e648aAuthor: Christoph Hellwig <hch@lst.de>
> Date:   Wed Nov 9 12:07:18 2005 -0800
> 
>     [SPARC] sbus rtc: implement ->compat_ioctl
>     
>     Signed-off-by: Christoph Hellwig <hch@lst.de>
>     Signed-off-by: David S. Miller <davem@davemloft.net>
> 
> results in the console now getting spewed on sparc64 systems
> with messages like:
> 
> [   11.968298] ioctl32(hwclock:464): Unknown cmd fd(3) cmd(401c7014){00} arg(efc
> What's happening is hwclock tries first the SBUS rtc device ioctls
> then the normal rtc driver ones.
> 
> So things actually worked better when we had the SBUS rtc compat ioctl
> directly handled via the generic compat ioctl code.
> 
> There are _so_ many rtc drivers in the kernel implementing the
> generic rtc ioctls that I don't think putting a ->compat_ioctl
> into all of them to fix this problem is feasible.  Unless we
> write a single rtc_compat_ioctl(), export it to modules, and hook
> it into all of those somehow.
> 
> But even that doesn't appear to have any pretty implementation.
> 
> Any better ideas?

We had similar problems with other ioctls where userspace did things
like that.  What we did there was to put the compat handler to generic
code.  The patch below does that, adding a big comment about what's
going on and removing the COMPAT_IOCTL entires for these on powerpc
that not only weren't ever useful but are duplicated now aswell.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2005-11-12 12:10:54 -08:00
Paul Mackerras 271c3f35bd powerpc: Fix some compile problems with the VDSO stuff
We needed the VDSO symbols in the arch/ppc asm-offsets.c, and there
were a few usages of _systemcfg still left lying around.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-11 23:04:40 +11:00
Paul Mackerras 548ccebc2a powerpc: Fix reading and writing SPRs from xmon on 32-bit
When we created the instructions to read/write SPRs in xmon, we were
setting up a ppc64-style procedure descriptor and calling that, which
doesn't work in 32-bit.  For 32-bit a function pointer just points
to the instructions of the function.  This fixes it to do the right
thing for both 32-bit and 64-bit.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-11 22:36:34 +11:00
Paul Mackerras 22c841c9a4 powerpc: Initialize secondary CPU setup for 32-bit SMP
32-bit SMP powermacs weren't booting with ARCH=powerpc because the
boot cpu wasn't saving away the state of various control registers,
but the secondary CPUs were loading them from the uninitialized
state.  This adds the necessary save-state call.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-11 22:34:43 +11:00
Benjamin Herrenschmidt a7f290dad3 [PATCH] powerpc: Merge vdso's and add vdso support to 32 bits kernel
This patch moves the vdso's to arch/powerpc, adds support for the 32
bits vdso to the 32 bits kernel, rename systemcfg (finally !), and adds
some new (still untested) routines to both vdso's: clock_gettime() with
support for CLOCK_REALTIME and CLOCK_MONOTONIC, clock_getres() (same
clocks) and get_tbfreq() for glibc to retreive the timebase frequency.

Tom,Steve: The implementation of get_tbfreq() I've done for 32 bits
returns a long long (r3, r4) not a long. This is such that if we ever
add support for >4Ghz timebases on ppc32, the userland interface won't
have to change.

I have tested gettimeofday() using some glibc patches in both ppc32 and
ppc64 kernels using 32 bits userland (I haven't had a chance to test a
64 bits userland yet, but the implementation didn't change and was
tested earlier). I haven't tested yet the new functions.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-11 22:25:39 +11:00
David Woodhouse 6761c4a073 [PATCH] powerpc: remove initrd debug printk
This removes a stray debugging printk which offended Anton.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-11 22:23:36 +11:00
David Gibson 35cd8785de [PATCH] powerpc: Move udbg code to arch/powerpc
Since the udbg code in ppc64 has no ppc32 equivalent, move it straight
over into arch/powerpc (and include/asm-powerpc for udbg.h).  In time,
we probably want to meld the various bits and pieces of 32-bit early
debugging code into udbg, but for now only include it on
CONFIG_PPC64=y builds.  The only change during the move is to
standardise the protecting #ifdef/#define in udbg.h, and move its
banner comment above the initial #ifdef (which seems to be normal
practice).

Built and booted on POWER5 LPAR (ARCH=powerpc and ARCH=ppc64).  Built
for 32bit multiplatform (ARCH=powerpc).

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-11 22:23:34 +11:00
Anton Blanchard 45fb6cea09 [PATCH] ppc64: Convert NUMA to sparsemem (3)
Convert to sparsemem and remove all the discontigmem code in the
process. This has a few advantages:

- The old numa_memory_lookup_table can go away
- All the arch specific discontigmem magic can go away

We also remove the triple pass of memory properties and instead create a
list of per node extents that we iterate through. A final cleanup would
be to change our lmb code to store extents per node, then we can reuse
that information in the numa code.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-11 22:21:11 +11:00
Anton Blanchard 3e66c4def1 [PATCH] ppc64: prep for NUMA sparsemem rework 2
Remove ppc64 specific version of nr_cpus_node and use the generic one
provided.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-11 22:20:57 +11:00
Anton Blanchard 50bcfec19f [PATCH] ppc64: Remove debug boot message
We have been printing the raw ppc64_firmware_features during boot. Since
we can work it out from the device tree, lets remove it.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-11 22:20:04 +11:00
Anton Blanchard 8acb888c9c [PATCH] ppc64: Quieten lparcfg
If we dont have permission to read some information from the hypervisor,
lparcfg outputs a warning on the console. Now that lparcfg is world
readable this is a problem.

Dont warn in the case of H_Authority, remove some unnecessary function
prototypes and fix whitespace damage in a structure as well.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-11 22:20:01 +11:00
Linus Torvalds 3ae0af12b4 Merge git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc-merge 2005-11-10 07:37:51 -08:00
Linas Vepstas d9564ad114 [PATCH] ppc64: mark failed devices
17-eeh-slot-marking-bug.patch

A device that experiences a PCI outage may be just one deivce out
of many that was affected. In order to avoid repeated reports of
a failure, the entire tree of affected devices should be marked
as failed. This patch marks up the entire tree.

Signed-off-by: Linas Vepstas <linas@linas.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-10 16:00:32 +11:00
Paul Mackerras 0c95fbb256 Merge git://oak/home/sfr/kernels/iseries/work 2005-11-10 15:54:00 +11:00
Paul Mackerras 49b09853df powerpc: Move some extern declarations from C code into headers
This also make klimit have the same type on 32-bit as on 64-bit,
namely unsigned long, and defines and initializes it in one place.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-10 15:53:40 +11:00
David Gibson d3d2176a0b [PATCH] powerpc: Move more ppc64 files with no ppc32 equivalent to powerpc
This patch moves a bunch more files from arch/ppc64 and
include/asm-ppc64 which have no equivalents in ppc32 code into
arch/powerpc and include/asm-powerpc.  The file affected are:
	hvcall.h
	proc_ppc64.c
	sysfs.c
	lparcfg.c
	rtas_pci.c

The only changes apart from the move and corresponding Makefile
changes are:
	- #ifndef/#define in includes updated to _ASM_POWERPC_ form
	- trailing whitespace removed
	- comments giving full paths removed

Built and booted on POWER5 LPAR (ARCH=powerpc and ARCH=ppc64), built
for 32-bit powermac (ARCH=powerpc).

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-10 15:32:37 +11:00
Benjamin Herrenschmidt 0f34f49029 [PATCH] ppc64: fix PCI IO mapping
phbs_remap_io(), which maps the PCI IO space into the kernel virtual space,
is called too early on powermac, and thus doesn't work.

This fixes it by removing the call from all platforms and putting it back
into the ppc64 common code where it belongs, after the actual probing of
the bus.

That means that before that call, only the ISA IO space (if any) is mapped,
any PIO access (from quirks for example) will fail. This happens not to be
a problem for now, but we'll have to rework that code if it becomes one in
the future.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-10 15:32:37 +11:00
Benjamin Herrenschmidt 47c2ac8cc3 [PATCH] powerpc: 64k pages vs. U3 iommu
That DART (U3 iommu) code didn't properly scale the number of entries
when using !4k pages. That caused crashes when booting G5s with more
than 2Gb of RAM. This fixes it.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-10 15:03:37 +11:00
Benjamin Herrenschmidt 87655ff268 [PATCH] powerpc: 64k pages pmd alloc fix
This patch makes the kernel use a different kmem cache for PMD pages
as they are smaller than PTE pages. Avoids waste of memory.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-10 15:03:29 +11:00
Stephen Rothwell 676e2497f8 powerpc: remove some warnings when building iSeries
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
2005-11-10 14:40:43 +11:00
Paul Mackerras e1449ed956 powerpc: 32-bit fixes for xmon
This makes the memory examine/change command print the address as
8 digits instead of 16, and makes the memory dump command print
4 4-byte values per line instead of 2 8-byte values.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-10 14:30:20 +11:00
Paul Mackerras a7ddc5e853 powerpc: Add user CPU features for POWER4, POWER5, POWER5+ and Cell.
This is at the request of the glibc folks, who want to use these bits
to select libraries optimized for the microarchitecture and new
instructions in these processors.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-10 14:29:18 +11:00
Paul Mackerras cbe62e2b4a powerpc: Fix SMP time initialization problem
We were getting the last_jiffy per-cpu variable set ahead of the current
timebase in smp_space_timers on SMP machines.  This caused the loop in
timer_interrupt to loop virtually forever, since tb_ticks_since assumes
that it will never be called with the timebase behind the last_jiffy
value.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-10 14:28:03 +11:00
Paul Mackerras 094fe2e712 powerpc: Fixes for 32-bit powermac SMP
A couple of bugs crept in with the merge of smp.c...

Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-10 14:26:12 +11:00
Paul Mackerras 0a5cab42a1 powerpc: Fix compile error in EEH code with gcc4
Gcc 4 doesn't like being told to inline a recursive function...

Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-10 14:23:54 +11:00
Paul Mackerras 799d6046d3 [PATCH] powerpc: merge code values for identifying platforms
This patch merges platform codes.  systemcfg->platform is no longer used,
systemcfg use in general is deprecated as much as possible (and renamed
_systemcfg before it gets completely moved elsewhere in a future patch),
_machine is now used on ppc64 along as ppc32.  Platform codes aren't gone
yet but we are getting a step closer. A bunch of asm code in head[_64].S
is also turned into C code.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-10 13:37:51 +11:00
David Gibson 3ddfbcf19b [PATCH] powerpc: Consolidate asm compatibility macros
This patch consolidates macros used to generate assembly for
compatibility across different CPUs or configs.  A new header,
asm-powerpc/asm-compat.h contains the main compatibility macros.  It
uses some preprocessor magic to make the macros suitable both for use
in .S files, and in inline asm in .c files.  Headers (bitops.h,
uaccess.h, atomic.h, bug.h) which had their own such compatibility
macros are changed to use asm-compat.h.

ppc_asm.h is now for use in .S files *only*, and a #error enforces
that.  As such, we're a lot more careless about namespace pollution
here than in asm-compat.h.

While we're at it, this patch adds a call to the PPC405_ERR77 macro in
futex.h which should have had it already, but didn't.

Built and booted on pSeries, Maple and iSeries (ARCH=powerpc).  Built
for 32-bit powermac (ARCH=powerpc) and Walnut (ARCH=ppc).

Signed-off-by: David Gibson <dwg@au1.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-10 13:10:38 +11:00
David Gibson f6d3577da1 [PATCH] powerpc: Move scanlog.c to platforms/pseries
scanlog.c is only compiled on pSeries.  Thus, this patch moves it to
platforms/pseries.

Built and booted on pSeries LPAR (ARCH=powerpc and ARCH=ppc64).  Built
for iSeries (ARCH=powerpc).

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-10 13:09:27 +11:00
David Gibson 26ef5c0957 [PATCH] powerpc: Merge cacheflush.h and cache.h
The ppc32 and ppc64 versions of cacheflush.h were almost identical.
The two versions of cache.h are fairly similar, except for a bunch of
register definitions in the ppc32 version which probably belong better
elsewhere.  This patch, therefore, merges both headers.  Notable
points:
	- there are several functions in cacheflush.h which exist only
on ppc32 or only on ppc64.  These are handled by #ifdef for now, but
these should probably be consolidated, along with the actual code
behind them later.
	- Confusingly, both ppc32 and ppc64 have a
flush_dcache_range(), but they're subtly different: it uses dcbf on
ppc32 and dcbst on ppc64, ppc64 has a flush_inval_dcache_range() which
uses dcbf.  These too should be merged and consolidated later.
	- Also flush_dcache_range() was defined in cacheflush.h on
ppc64, and in cache.h on ppc32.  In the merged version it's in
cacheflush.h
	- On ppc32 flush_icache_range() is a normal function from
misc.S.  On ppc64, it was wrapper, testing a feature bit before
calling __flush_icache_range() which does the actual flush.  This
patch takes the ppc64 approach, which amounts to no change on ppc32,
since CPU_FTR_COHERENT_ICACHE will never be set there, but does mean
renaming flush_icache_range() to __flush_icache_range() in
arch/ppc/kernel/misc.S and arch/powerpc/kernel/misc_32.S
	- The PReP register info from asm-ppc/cache.h has moved to
arch/ppc/platforms/prep_setup.c
	- The 8xx register info from asm-ppc/cache.h has moved to a
new asm-powerpc/reg_8xx.h, included from reg.h
	- flush_dcache_all() was defined on ppc32 (only), but was
never called (although it was exported).  Thus this patch removes it
from cacheflush.h and from ARCH=powerpc (misc_32.S) entirely.  It's
left in ARCH=ppc for now, with the prototype moved to ppc_ksyms.c.

Built for Walnut (ARCH=ppc), 32-bit multiplatform (pmac, CHRP and PReP
ARCH=ppc, pmac and CHRP ARCH=powerpc).  Built and booted on POWER5
LPAR (ARCH=powerpc and ARCH=ppc64).

Built for 32-bit powermac (ARCH=ppc and ARCH=powerpc).  Built and
booted on POWER5 LPAR (ARCH=powerpc and ARCH=ppc64).  Built and booted
on G5 (ARCH=powerpc)

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-10 13:09:22 +11:00
Paul Mackerras e130bedb7c Merge git://oak/home/sfr/kernels/iseries/work 2005-11-10 13:08:55 +11:00
Paul Mackerras 00557b59c6 powerpc: Fix find_next_bit on 32-bit
We had a "64" that didn't get changed to BITS_PER_LONG, resulting
in find_next_bit not working correctly.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-10 12:01:41 +11:00
Paul Mackerras a23414beb6 ppc/powerpc: workarounds for old Open Firmware versions
This adds code to work around some problems with old versions of
Open Firmware, such as on the early powermacs (7500 etc.) and the
"Longtrail" CHRP machine.  On these machines we have to claim
the physical and virtual address ranges explicitly when claiming
memory and then set up a V->P mapping.

The Longtrail has more problems: setprop doesn't work, and we have
to set an "allow-reclaim" variable to 0 in order to get claim on
physical memory ranges to fail if the memory is already claimed.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-10 12:00:55 +11:00
Linas Vepstas 8b553f32db [PATCH] ppc64: Save & restore of PCI device BARS
14-eeh-device-bar-save.patch

After a PCI device has been resest, the device BAR's and other config
space info must be restored to the same state as they were in when
the firmware first handed us this device.  This will allow the
PCI device driver, when restarted, to correctly recognize and set up
the device.

Tis patch saves the device config space as early as reasonable after
the firmware has handed over the device.  Te state resore funcion
is inteded for use by the EEH recovery routines.

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-10 11:38:14 +11:00
Linas Vepstas 6dee3fb940 [PATCH] ppc64: PCI reset support routines
13-eeh-recovery-support-routines.patch

EEH Recovery support routines

This patch adds routines required to help drive the recovery of
EEH-frozen slots.  The main function is to drive the PCI #RST
signal line high for a qurter of a second, and then allow for
a second & a half of settle time.

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-10 11:38:11 +11:00
Linas Vepstas 172ca92618 [PATCH] ppc64: PCI error event dispatcher
12-eeh-event-dispatcher.patch

ppc64: EEH Recovery dispatcher thread

This patch adds a mechanism to create recovery threads when an
EEH event is received.  Since an EEH freeze state may be detected
within an interrupt context, we need to get out of the interrupt
context before starting recovery. This dispatcher does this in
two steps: first, it uses a workqueue to get out, and then
lanuches a kernel thread, so that the recovery routine can
sleep for exteded periods without upseting the keventd.

A kernel thread is created with each EEH event, rather than
having one long-running daemon started at boot time.  This is
because it is anticipated that EEH events will be very rare
(very very rare, ideally) and so its pointless to cluter the
process tables with a daemon that will almost never run.

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-10 11:38:05 +11:00
Linas Vepstas 7f79da7acc [PATCH] ppc64: move eeh.c to powerpc directory from ppc64
11-eeh-move-to-powerpc.patch

Move arch/ppc64/kernel/eeh.c to arch//powerpc/platforms/pseries/eeh.c
No other changes (except for Makefile to build it)

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-10 11:37:59 +11:00
Benjamin Herrenschmidt 77ac166fba [PATCH] ppc64: Don't panic when early __ioremap fails
Early calls to __ioremap() will panic if the hash insertion fails. This
patch makes them return NULL instead. It happens with some pSeries users
who enabled CONFIG_BOOTX_TEXT. The later is getting an incorrect address
for the fame buffer and the hash insertion fails. With this patch, it
will display an error instead of crashing at boot.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-10 11:26:06 +11:00
David Gibson 8882a4da1c [PATCH] powerpc: Move various ppc64 files with no ppc32 equivalent to powerpc
This patch moves a bunch of files from arch/ppc64 and
include/asm-ppc64 which have no equivalents in ppc32 code into
arch/powerpc and include/asm-powerpc.  The file affected are:
	abs_addr.h
	compat.h
	lppaca.h
	paca.h
	tce.h
	cpu_setup_power4.S
	ioctl32.c
	firmware.c
	pacaData.c

The only changes apart from the move and corresponding Makefile
changes are:
	- #ifndef/#define in includes updated to _ASM_POWERPC_ form
	- trailing whitespace removed
	- comments giving full paths removed
	- pacaData.c renamed paca.c to remove studlyCaps
	- Misplaced { moved in lppaca.h

Built and booted on POWER5 LPAR (ARCH=powerpc and ARCH=ppc64), built
for 32-bit powermac (ARCH=powerpc).

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-10 11:24:04 +11:00
David Gibson c5ff700116 [PATCH] powerpc: Merge signal.h
Having already merged the ppc and ppc64 versions of signal.c, this
patch finishes the job by merging signal.h.  The two versions were
almost identical already.  Notable changes:
	- We use BITS_PER_LONG to correctly size sigset_t
	- Remove some uneeded #includes and struct forward
declarations.  This does mean adding an include to signal_32.c which
relied on the indirect inclusion of sigcontext.h
	- As the ppc64 version, the merged signal.h has prototypes for
do_signal() and do_signal32().  Thus remove extra prototypes from
ppc_ksyms.c which had them directly.

Built and booted on POWER5 LPAR (ARCH=ppc64 and ARCH=powerpc).  Built
for 32-bit powermac (ARCH=ppc and ARCH=powerpc) and Walnut (ARCH=ppc).

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-10 11:23:46 +11:00
Andrew Morton e4d76e1c0b [PATCH] powerpc: sched fixups
- Re-add a hunk lost during merge: ppc64 is missing the hunk that disables
  preempt on the secondary CPUs before they call cpu_idle().

- ppc's cpu_idle() had the need_resched() test wrong.

Cc: Nick Piggin <nickpiggin@yahoo.com.au>
CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Anton Blanchard <anton@samba.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-09 16:07:44 -08:00
Paul Mackerras 31e7f1ff3c Merge ../linux-2.6 2005-11-10 11:06:04 +11:00
Nick Piggin 64c7c8f885 [PATCH] sched: resched and cpu_idle rework
Make some changes to the NEED_RESCHED and POLLING_NRFLAG to reduce
confusion, and make their semantics rigid.  Improves efficiency of
resched_task and some cpu_idle routines.

* In resched_task:
- TIF_NEED_RESCHED is only cleared with the task's runqueue lock held,
  and as we hold it during resched_task, then there is no need for an
  atomic test and set there. The only other time this should be set is
  when the task's quantum expires, in the timer interrupt - this is
  protected against because the rq lock is irq-safe.

- If TIF_NEED_RESCHED is set, then we don't need to do anything. It
  won't get unset until the task get's schedule()d off.

- If we are running on the same CPU as the task we resched, then set
  TIF_NEED_RESCHED and no further action is required.

- If we are running on another CPU, and TIF_POLLING_NRFLAG is *not* set
  after TIF_NEED_RESCHED has been set, then we need to send an IPI.

Using these rules, we are able to remove the test and set operation in
resched_task, and make clear the previously vague semantics of
POLLING_NRFLAG.

* In idle routines:
- Enter cpu_idle with preempt disabled. When the need_resched() condition
  becomes true, explicitly call schedule(). This makes things a bit clearer
  (IMO), but haven't updated all architectures yet.

- Many do a test and clear of TIF_NEED_RESCHED for some reason. According
  to the resched_task rules, this isn't needed (and actually breaks the
  assumption that TIF_NEED_RESCHED is only cleared with the runqueue lock
  held). So remove that. Generally one less locked memory op when switching
  to the idle thread.

- Many idle routines clear TIF_POLLING_NRFLAG, and only set it in the inner
  most polling idle loops. The above resched_task semantics allow it to be
  set until before the last time need_resched() is checked before going into
  a halt requiring interrupt wakeup.

  Many idle routines simply never enter such a halt, and so POLLING_NRFLAG
  can be always left set, completely eliminating resched IPIs when rescheduling
  the idle task.

  POLLING_NRFLAG width can be increased, to reduce the chance of resched IPIs.

Signed-off-by: Nick Piggin <npiggin@suse.de>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Con Kolivas <kernel@kolivas.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-09 07:56:33 -08:00
Nick Piggin 5bfb5d690f [PATCH] sched: disable preempt in idle tasks
Run idle threads with preempt disabled.

Also corrected a bugs in arm26's cpu_idle (make it actually call schedule()).
How did it ever work before?

Might fix the CPU hotplugging hang which Nigel Cunningham noted.

We think the bug hits if the idle thread is preempted after checking
need_resched() and before going to sleep, then the CPU offlined.

After calling stop_machine_run, the CPU eventually returns from preemption and
into the idle thread and goes to sleep.  The CPU will continue executing
previous idle and have no chance to call play_dead.

By disabling preemption until we are ready to explicitly schedule, this bug is
fixed and the idle threads generally become more robust.

From: alexs <ashepard@u.washington.edu>

  PPC build fix

From: Yoichi Yuasa <yuasa@hh.iij4u.or.jp>

  MIPS build fix

Signed-off-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-09 07:56:33 -08:00
Matt Porter a31751e04e [PATCH] ppc32: fix perf_irq extern on e500
Fixes e500 build and cleans up traps.c by moving perf_irq extern to
pmc.h.

Signed-off-by: Matt Porter <mporter@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-09 07:55:52 -08:00
Olaf Hering 143dcec2f7 [PATCH] ppc64: add MODALIAS= for vio bus
A non-broken udev would autoload also the drivers for devices on the
pseries vio bus, like ibmveth, ibmvscsic and hvsc.  This is similar to pci,
usb and ieee1394:

 /lib/modules/`uname -r`/modules.alias
alias vio:TvscsiSIBM,v-scsi* ibmvscsic
alias vio:TnetworkSIBM,l-lan* ibmveth
alias vio:Tserial-serverShvterm2* hvcs

/events/debug.00004.pci.add.1394:MODALIAS='pci:v00001014d00000188sv00000000sd00000000bc06sc04i0f'
/events/debug.00005.pci.add.1509:MODALIAS='pci:v00008086d00001229sv00001014sd000001FFbc02sc00i00'
/events/debug.00026.vio.add.1519:MODALIAS='vio:TserialShvterm1'
/events/debug.00027.vio.add.1446:MODALIAS='vio:TvscsiSIBM,v-scsi'
/events/debug.00028.vio.add.1451:MODALIAS='vio:TnetworkSIBM,l-lan'

 modprobe -v vio:TnetworkSIBM,l-lan
insmod /lib/modules/2.6.14-20051030_vio-ppc64/kernel/drivers/net/ibmveth.ko

Signed-off-by: Olaf Hering <olh@suse.de>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-09 07:55:51 -08:00
Stephen Rothwell 756e7104fe powerpc: merge irq.c
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
2005-11-09 18:07:45 +11:00
Stephen Rothwell d4be4f37d9 ppc64: remove ppc_irq_dispatch_handler
Use __do_IRQ instead.  The only difference is that every controller
is now assumed to have an end() routine (only xics_8259 did not).

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
2005-11-09 16:19:53 +11:00
Stephen Rothwell 5a7b3ff467 ppc64: allow iSeries to use IRQSTACKS again
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
2005-11-09 15:07:16 +11:00
Stephen Rothwell b709c08328 ppc64: move stack switching up in interrupt processing
This will make the ppc64 multiplatform irq handling more like
the generic handling.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
2005-11-09 13:28:33 +11:00
Stephen Rothwell 66ba135c5a powerpc: create kernel/setup.h
for functions defined by setup-common.c and used in setup_xx.c

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
2005-11-09 11:35:26 +11:00
Paul Mackerras fca5dcd483 powerpc: Simplify and clean up the xmon terminal I/O
This factors out the common bits of arch/powerpc/xmon/start_*.c into
a new nonstdio.c, and removes some stuff that was supposed to make
xmon's I/O routines somewhat stdio-like but was never used.

It also makes the parsing of the xmon= command line option common,
so that ppc32 can now use xmon={off,on,early} also.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-08 22:55:08 +11:00
Paul Mackerras 3825ac0ee6 powerpc: Fix crash in early boot on some powermacs
Some powermac machines were crashing in the quiesce firmware call
in prom_init.c because we have just closed the OF stdin device;
notably my 1999 G3 powerbook does this.  To avoid this, don't
close the OF stdin device on powermacs.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-08 22:48:08 +11:00
Mike Kravetz 7e9191daf6 [PATCH] Memory Add Fixes for ppc64
ppc64 needs a special sysfs probe file for adding new memory.

Signed-off-by: Mike Kravetz <kravetz@us.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-08 15:17:38 +11:00
Mike Kravetz dd7ccbd3ee [PATCH] Memory Add Fixes for ppc64
memmap_init_zone() sets page count to 1.  Before 'freeing' the
page, we need to clear the count.  This is the same that is done
on free_all_bootmem_core() for memory discovered at boot time.

Signed-off-by: Mike Kravetz <kravetz@us.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-08 15:17:19 +11:00
Mike Kravetz 54b79248b2 [PATCH] revised Memory Add Fixes for ppc64
Add the create_section_mapping() routine to create hptes for memory
sections dynamically added after system boot.

Signed-off-by: Mike Kravetz <kravetz@us.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-08 15:17:13 +11:00
Benjamin Herrenschmidt 76c8e25b90 [PATCH] ppc64: Fix the lazy icache/dcache code for non-RAM pages
For some stupid reason I can't explain (brown paper bag is at hand), I
removed the check pfn_valid() in the code that does the icache/dcache
coherency on POWER4 and later. That causes us to eventually try to
access non existing struct page when hashing in IO pages.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-08 13:07:50 +11:00
Paul Mackerras 22358ea8e1 powerpc: Fix typo in pmac_cpufreq_resume
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-08 12:13:38 +11:00
Mike Kravetz 0286486783 [PATCH] Memory Add Fixes for ppc64
On Tue, Nov 08, 2005 at 08:12:56AM +1100, Benjamin Herrenschmidt wrote:
> Yes, the MAX_ORDER should be different indeed. But can Kconfig do that ?
> That is have the default value be different based on a Kconfig option ?
> I don't see that ... We may have to do things differently here...

This seems to be done in other parts of the Kconfig file.  Using those
as an example, this should keep the MAX_ORDER block size at 16MB.

Signed-off-by: Mike Kravetz <kravetz@us.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-08 11:20:00 +11:00
Anton Blanchard 570142ca37 [PATCH] ppc64: remove some direct xmon calls
Even though we can enable and disable xmon at runtime now, there are a
few places in the merge tree that call xmon and xmon_printf directly.

In the case below we call die() which will call xmon if it is enabled.

Also remove an unnecessary include of xmon.h in smp.c.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-08 11:19:57 +11:00
Anton Blanchard cb09cff30a [PATCH] ppc64: fix oprofile sample bit handling
Oprofile was hardwiring the MMCRA sample bit to 1 but on newer cpus
(eg POWER5) we want to vary it based on the group being sampled.

Add a temporary workaround until people update their oprofile userspace.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-08 11:19:55 +11:00
Anton Blanchard bcb3557694 [PATCH] ppc64: fix Memory: summary line
On ppc64 we end up with a negative value for the data size in the memory
boot message:

Memory: 2035560k/2097152k available (5792k kernel code, 89564k reserved,
18014398509481632k data, 870k bss, 352k init)

It turns out the section ordering of the linker script is different on
ppc32 and ppc64, so just count data as _edata - _sdata which should work
on both.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-08 11:19:53 +11:00
Benjamin Herrenschmidt 21fe3301f1 [PATCH] ppc: fix a bunch of warnings
Building a PowerMac kernel with ARCH=powerpc causes a bunch of warnings,
this fixes some of them

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-08 11:19:36 +11:00
Benjamin Herrenschmidt 7d49697ef9 [PATCH] ppc64: More U3 device-tree fixes
Some more U3 revisions have the missing "interrupts" property in U3,
this adds them to the fixup code in prom_init.c

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-08 11:17:53 +11:00
Benjamin Herrenschmidt c618cf1999 [PATCH] ppc64: Update g5_defconfig for ARCH=powerpc
This patch updates g5_defconfig for ARCH=powerpc in order to add the SMU
support & thermal drivers to it, the pmac sound driver (works on some
G5s) and replaces rivafb with nvidiafb which works better for the cards
found in G5 based machines.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-08 11:17:50 +11:00
Benjamin Herrenschmidt 183d020258 [PATCH] ppc64: SMU partition recovery
This patch adds the ability to the SMU driver to recover missing
calibration partitions from the SMU chip itself. It also adds some
dynamic mecanism to /proc/device-tree so that new properties are visible
to userland.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-08 11:17:40 +11:00
Benjamin Herrenschmidt 4350147a81 [PATCH] ppc64: SMU based macs cpufreq support
CPU freq support using 970FX powertune facility for iMac G5 and SMU
based single CPU desktop.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-08 11:17:34 +11:00
David Woodhouse a82765b6ee [PATCH] powerpc: Fix ppc32 initrd
OK, the Fedora ppc32 and ppc64 kernels should both be arch/powerpc by
tomorrow. They're booting on G5, POWER5, and my powerbook. I'll test
pmac SMP and Pegasos later -- but pmac smp is known broken in arch/ppc
anyway, and I'll live with a potential Pegasos regression for now; it
wasn't supported officially in FC4 either.

I needed to fix ppc32 initrd -- we were never setting initrd_start.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-08 11:16:41 +11:00
Paul Mackerras 24bfb00123 Merge ../linux-2.6 2005-11-08 11:14:20 +11:00
Jesper Juhl b2325fe1b7 [PATCH] kfree cleanup: arch
This is the arch/ part of the big kfree cleanup patch.

Remove pointless checks for NULL prior to calling kfree() in arch/.

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Acked-by: Grant Grundler <grundler@parisc-linux.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-07 07:54:06 -08:00
Christoph Hellwig 481bed4542 [PATCH] consolidate sys_ptrace()
The sys_ptrace boilerplate code (everything outside the big switch
statement for the arch-specific requests) is shared by most architectures.
This patch moves it to kernel/ptrace.c and leaves the arch-specific code as
arch_ptrace.

Some architectures have a too different ptrace so we have to exclude them.
They continue to keep their implementations.  For sh64 I had to add a
sh64_ptrace wrapper because it does some initialization on the first call.
For um I removed an ifdefed SUBARCH_PTRACE_SPECIAL block, but
SUBARCH_PTRACE_SPECIAL isn't defined anywhere in the tree.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Paul Mackerras <paulus@samba.org>
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Acked-By: David Howells <dhowells@redhat.com>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-07 07:53:42 -08:00
Prasanna S Panchamukhi cd6b0762a0 [PATCH] Move Kprobes and Oprofile to "Instrumentation Support" menu
Andrew Morton suggested to move kprobes from kernel hacking menu, since
kernel hacking menu is in-appropriate for the Kprobes.  This patch moves
Kprobes and Oprofile under instrumentation menu.

(akpm: it's not a natural fit, but things like djprobes and the s390 guys'
statistics library need a home)

Signed-of-by: Prasanna S Panchamukhi <prasanna@in.ibm.com>
Cc: Philippe Elie <phil.el@wanadoo.fr>
Cc: John Levon <levon@movementarian.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-07 07:53:35 -08:00
Roland Dreier b0f7b8bc57 [PATCH] ppc32: Add 440SPe support
Add support for the AMCC PowerPC 440SPe SoC, including PCI Express in root
port mode.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
Cc: Matt Porter <mporter@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-07 07:53:26 -08:00
Benjamin Herrenschmidt 863c84b97c [PATCH] ppc: Fix ppc32 build after 64K pages
Oops, some last minute changes caused the 64K pages patch to break ppc32
build, this fixes it.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-07 07:53:23 -08:00
Olof Johansson 732ee21f28 [PATCH] POWERPC/PPC64: Fix CONFIG_SMP=n build for ppc64
Two CONFIG_SMP=n build fixes due to missing <asm/smp.h> includes.

Signed-off-by: Olof Johansson <olof@lixom.net>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-07 07:53:23 -08:00
David Gibson 7d24f0b8a5 [PATCH] ppc64: Fix bug in SLB miss handler for hugepages
This patch, however, should be applied on top of the 64k-page-size patch to
fix some problems with hugepage (some pre-existing, another introduced by
this patch).

The patch fixes a bug in the SLB miss handler for hugepages on ppc64
introduced by the dynamic hugepage patch (commit id
c594adad56) due to a misunderstanding of the
srd instruction's behaviour (mea culpa).  The problem arises when a 64-bit
process maps some hugepages in the low 4GB of the address space (unusual).
In this case, as well as the 256M segment in question being marked for
hugepages, other segments at 32G intervals will be incorrectly marked for
hugepages.

In the process, this patch tweaks the semantics of the hugepage bitmaps to
be more sensible.  Previously, an address below 4G was marked for hugepages
if the appropriate segment bit in the "low areas" bitmask was set *or* if
the low bit in the "high areas" bitmap was set (which would mark all
addresses below 1TB for hugepage).  With this patch, any given address is
governed by a single bitmap.  Addresses below 4GB are marked for hugepage
if and only if their bit is set in the "low areas" bitmap (256M
granularity).  Addresses between 4GB and 1TB are marked for hugepage iff
the low bit in the "high areas" bitmap is set.  Higher addresses are marked
for hugepage iff their bit in the "high areas" bitmap is set (1TB
granularity).

To avoid conflicts, this patch must be applied on top of BenH's pending
patch for 64k base page size [0].  As such, this patch also addresses a
hugepage problem introduced by that patch.  That patch allows hugepages of
1MB in size on hardware which supports it, however, that won't work when
using 4k pages (4 level pagetable), because in that case hugepage PTEs are
stored at the PMD level, and each PMD entry maps 2MB.  This patch simply
disallows hugepages in that case (we can do something cleverer to re-enable
them some other day).

Built, booted, and a handful of hugepage related tests passed on POWER5
LPAR (both ARCH=powerpc and ARCH=ppc64).

[0] http://gate.crashing.org/~benh/ppc64-64k-pages.diff

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-07 07:53:23 -08:00
Paul Mackerras c613523455 Merge ../linux-2.6 2005-11-07 14:42:09 +11:00
Michael Ellerman 76032de898 [PATCH] powerpc: Make ppc_md.set_dabr non 64-bit specific
Define ppc_md.set_dabr for both 32 + 64 bit. Cleanup the implementation for
pSeries also, it was needlessly complex. Now we just do two firmware tests at
setup time, and use one of two functions, rather than using one function and
testing on every call.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-07 13:31:13 +11:00
Paul Mackerras 2249ca9d60 powerpc: Various UP build fixes
Mostly this involves adding #include <asm/smp.h>, since that defines
things like boot_cpuid[_phys] and [gs]et_hard_smp_processor_id, which
are SMP-related but still needed on UP.  This incorporates fixes
posted by Olof Johansson and Heikki Lindholm.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-07 13:18:13 +11:00