History log of /arch/powerpc/xmon/xmon.c
Revision Date Author Comments
3b8a3c01096925a824ed3272601082289d9c23a5 24-Nov-2014 Laurent Dufour <ldufour@linux.vnet.ibm.com> powerpc/pseries: Fix endiannes issue in RTAS call from xmon

On pseries system (LPAR) xmon failed to enter when running in LE mode,
system is hunging. Inititating xmon will lead to such an output on the
console:

SysRq : Entering xmon
cpu 0x15: Vector: 0 at [c0000003f39ffb10]
pc: c00000000007ed7c: sysrq_handle_xmon+0x5c/0x70
lr: c00000000007ed7c: sysrq_handle_xmon+0x5c/0x70
sp: c0000003f39ffc70
msr: 8000000000009033
current = 0xc0000003fafa7180
paca = 0xc000000007d75e80 softe: 0 irq_happened: 0x01
pid = 14617, comm = bash
Bad kernel stack pointer fafb4b0 at eca7cc4
cpu 0x15: Vector: 300 (Data Access) at [c000000007f07d40]
pc: 000000000eca7cc4
lr: 000000000eca7c44
sp: fafb4b0
msr: 8000000000001000
dar: 10000000
dsisr: 42000000
current = 0xc0000003fafa7180
paca = 0xc000000007d75e80 softe: 0 irq_happened: 0x01
pid = 14617, comm = bash
cpu 0x15: Exception 300 (Data Access) in xmon, returning to main loop
xmon: WARNING: bad recursive fault on cpu 0x15

The root cause is that xmon is calling RTAS to turn off the surveillance
when entering xmon, and RTAS is requiring big endian parameters.

This patch is byte swapping the RTAS arguments when running in LE mode.

Cc: stable@vger.kernel.org
Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
a71d64b4dc4067808549935583d984c7fc9ea647 05-Aug-2014 Anton Blanchard <anton@samba.org> powerpc: Hard disable interrupts in xmon

xmon only soft disables interrupts. This seems like a bad idea - we
certainly don't want decrementer and PMU exceptions going off when
we are debugging something inside xmon.

This issue was uncovered when the hard lockup detector went off
inside xmon. To ensure we wont get a spurious hard lockup warning,
I also call touch_nmi_watchdog() when exiting xmon.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
13b3d13b813ab834fac67dc05f8b86dbcc29c134 09-Jul-2014 Michael Ellerman <mpe@ellerman.id.au> powerpc: Remove MMU_FTR_SLB

We now only support cpus that use an SLB, so we don't need an MMU
feature to indicate that.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
376af5947c0e441ccbf98f0212d4ffbf171528f6 09-Jul-2014 Michael Ellerman <mpe@ellerman.id.au> powerpc: Remove STAB code

Old cpus didn't have a Segment Lookaside Buffer (SLB), instead they had
a Segment Table (STAB). Now that we've dropped support for those cpus,
we can remove the STAB support entirely.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
736256e4f1bc50bb8198c9b61dffd5fd0de17477 26-May-2014 Michael Ellerman <mpe@ellerman.id.au> powerpc/xmon: Fix up xmon format strings

There are a couple of places where xmon is using %x to print values that
are unsigned long.

I found this out the hard way recently:

0:mon> p c000000000d0e7c8 c00000033dc90000 00000000a0000089 c000000000000000
return value is 0x96300500

Which is calling find_linux_pte_or_hugepte(), the result should be a
kernel pointer. After decoding the page tables by hand I discovered the
correct value was c000000396300500.

So fix up that case and a few others.

We also use a mix of 0x%x, %x and %u to print cpu numbers. So
standardise on 0x%x.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
21f585073d6347651f2262da187606fa1c4ee16d 29-Apr-2014 Paul Gortmaker <paul.gortmaker@windriver.com> powerpc: Fix smp_processor_id() in preemptible splat in set_breakpoint

Currently, on 8641D, which doesn't set CONFIG_HAVE_HW_BREAKPOINT
we get the following splat:

BUG: using smp_processor_id() in preemptible [00000000] code: login/1382
caller is set_breakpoint+0x1c/0xa0
CPU: 0 PID: 1382 Comm: login Not tainted 3.15.0-rc3-00041-g2aafe1a4d451 #1
Call Trace:
[decd5d80] [c0008dc4] show_stack+0x50/0x158 (unreliable)
[decd5dc0] [c03c6fa0] dump_stack+0x7c/0xdc
[decd5de0] [c01f8818] check_preemption_disabled+0xf4/0x104
[decd5e00] [c00086b8] set_breakpoint+0x1c/0xa0
[decd5e10] [c00d4530] flush_old_exec+0x2bc/0x588
[decd5e40] [c011c468] load_elf_binary+0x2ac/0x1164
[decd5ec0] [c00d35f8] search_binary_handler+0xc4/0x1f8
[decd5ef0] [c00d4ee8] do_execve+0x3d8/0x4b8
[decd5f40] [c001185c] ret_from_syscall+0x0/0x38
--- Exception: c01 at 0xfeee554
LR = 0xfeee7d4

The call path in this case is:

flush_thread
--> set_debug_reg_defaults
--> set_breakpoint
--> __get_cpu_var

Since preemption is enabled in the cleanup of flush thread, and
there is no need to disable it, introduce the distinction between
set_breakpoint and __set_breakpoint, leaving only the flush_thread
instance as the current user of set_breakpoint.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
72eceef67abbe596a4e93ee79e08d9e6c35430ae 02-Dec-2013 Philippe Bergheaud <felix@linux.vnet.ibm.com> powerpc: Fix xmon disassembler for little-endian

This patch fixes the disassembler of the powerpc kernel debugger xmon,
for little-endian.

Signed-off-by: Philippe Bergheaud <felix@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
d2b496e5e1fa7a6796534e435440eb9d3ed184dd 23-Dec-2013 Michael Ellerman <mpe@ellerman.id.au> powerpc/xmon: Don't signal we've entered until we're finished printing

Currently we set our cpu's bit in cpus_in_xmon, and then we take the
output lock and print the exception information.

This can race with the master cpu entering the command loop and printing
the backtrace. The result is that the backtrace gets garbled with
another cpu's exception print out.

Fix it by delaying the set of cpus_in_xmon until we are finished
printing.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
1507589787529b0d8e2a9e66e0c6f113ecab5181 23-Dec-2013 Michael Ellerman <mpe@ellerman.id.au> powerpc/xmon: Fix timeout loop in get_output_lock()

As far as I can tell, our 70s era timeout loop in get_output_lock() is
generating no code.

This leads to the hostile takeover happening more or less simultaneously
on all cpus. The result is "interesting", some example output that is
more readable than most:

cpu 0x1: Vector: 100 (Scypsut e0mx bR:e setV)e catto xc0p:u[ c 00
c0:0 000t0o0V0erc0td:o5 rfc28050000]0c00 0 0 0 6t(pSrycsV1ppuot
uxe 1m 2 0Rx21e3:0s0ce000c00000t00)00 60602oV2SerucSayt0y 0p 1sxs

Fix it by using udelay() in the timeout loop. The wait time and check
frequency are arbitrary, but seem to work OK. We already rely on
udelay() working so this is not a new dependency.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
730efb6193f8568354fd80849612291afa9fa81e 23-Dec-2013 Michael Ellerman <michael@ellerman.id.au> powerpc/xmon: Don't loop forever in get_output_lock()

If we enter with xmon_speaker != 0 we skip the first cmpxchg(), we also
skip the while loop because xmon_speaker != last_speaker (0) - meaning we
skip the second cmpxchg() also.

Following that code path the compiler sees no memory barriers and so is
within its rights to never reload xmon_speaker. The end result is we loop
forever.

This manifests as all cpus being in xmon ('c' command), but they refuse
to take control when you switch to them ('c x' for cpu # x).

I have seen this deadlock in practice and also checked the generated code to
confirm this is what's happening.

The simplest fix is just to always try the cmpxchg().

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
729b0f715371ce1e7636b4958fc45d6882442456 30-Oct-2013 Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com> powerpc/book3s: Introduce exclusive emergency stack for machine check exception.

This patch introduces exclusive emergency stack for machine check exception.
We use emergency stack to handle machine check exception so that we can save
MCE information (srr1, srr0, dar and dsisr) before turning on ME bit and be
ready for re-entrancy. This helps us to prevent clobbering of MCE information
in case of nested machine checks.

The reason for using emergency stack over normal kernel stack is that the
machine check might occur in the middle of setting up a stack frame which may
result into improper use of kernel stack.

Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
Acked-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
fd3bb91287b600d8b389c159e8dd96391410087b 03-Sep-2013 Paul Mackerras <paulus@samba.org> powerpc/xmon: Fix printing of set of CPUs in xmon

Commit 24ec2125f3 ("powerpc/xmon: Use cpumask iterator to avoid warning")
replaced a loop from 0 to NR_CPUS-1 with a for_each_possible_cpu() loop,
which means that if the last possible cpu is in xmon, we print the
wrong value for the end of the range. For example, if 4 cpus are
possible, NR_CPUS is 128, and all cpus are in xmon, we print "0-7f"
rather than "0-3". The code also assumes that the set of possible
cpus is contiguous, which may not necessarily be true.

This fixes the code to check explicitly for contiguity, and to print
the ending value correctly.

Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
660e034ce167b0954b83fd024c8be02c2911dbc9 15-Aug-2013 Michael Ellerman <michael@ellerman.id.au> powerpc: Add more trap names to xmon

We haven't updated these for a while it seems, it's nice to have in the
oops output.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
90a102e59ab9c94071fe1993134daff462d17a3f 01-May-2013 zhangwei(Jovi) <jovi.zhangwei@huawei.com> powerpc/xmon/sysrq: fix inconstistent help message of sysrq key

Currently help message of /proc/sysrq-trigger highlight its
upper-case characters, like below:

SysRq : HELP : loglevel(0-9) reBoot Crash terminate-all-tasks(E)
memory-full-oom-kill(F) kill-all-tasks(I) ...

this would confuse user trigger sysrq by upper-case character, which is
inconsistent with the real lower-case character registed key.

This inconsistent help message will also lead more confused when
26 upper-case letters put into use in future.

This patch fix powerpc xmon sysrq key: "xmon(x)"

Signed-off-by: zhangwei(Jovi) <jovi.zhangwei@huawei.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
ce54152f429ed5e6ad83e5e9f61825b5a795dd1e 28-Apr-2013 Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> powerpc: Save DAR and DSISR in pt_regs on MCE

We were not saving DAR and DSISR on MCE. Save then and also print the values
along with exception details in xmon.

Acked-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
b9818c3312da66f4b83a4a2e8650628be1237cb5 10-Jan-2013 Michael Neuling <mikey@neuling.org> powerpc: Rename set_break to avoid naming conflict

With allmodconfig we are getting:
drivers/tty/synclink_gt.c:160:12: error: conflicting types for 'set_break'
arch/powerpc/include/asm/debug.h:49:5: note: previous declaration of 'set_break' was here

drivers/tty/synclinkmp.c:526:12: error: conflicting types for 'set_break'
arch/powerpc/include/asm/debug.h:49:5: note: previous declaration of 'set_break' was here

This renames set_break to set_breakpoint to avoid this naming conflict

Signed-off-by: Michael Neuling <mikey@neuling.org>
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
9422de3e953d0e60eb95f5430a9dd803eec1c6d7 20-Dec-2012 Michael Neuling <mikey@neuling.org> powerpc: Hardware breakpoints rewrite to handle non DABR breakpoint registers

This is a rewrite so that we don't assume we are using the DABR throughout the
code. We now use the arch_hw_breakpoint to store the breakpoint in a generic
manner in the thread_struct, rather than storing the raw DABR value.

The ptrace GET/SET_DEBUGREG interface currently passes the raw DABR in from
userspace. We keep this functionality, so that future changes (like the POWER8
DAWR), will still fake the DABR to userspace.

Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
0104cd6839bd575f0aa1af4125eb865dc0391aae 09-Oct-2012 Michael Ellerman <michael@ellerman.id.au> powerpc/xmon: Fiddle xmon_depth_to_print logic in xmon_show_stack()

Currently xmon_depth_to_print is static and global, but it's only
ever used in xmon_show_stack().

At least with a modern compiler it's inlined, so there's no point
in it being static, we could #define it but it's only used in one
place.

By reworking the logic we can drop count and just decrement the
max value as a loop counter. Also switch to a while loop so we
actually print no more than 64 frames as you'd expect based on the
variable name.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
c4de38093ed9fe94fa35c3adb14afc40bf05e1da 09-Oct-2012 Michael Ellerman <michael@ellerman.id.au> powerpc/xmon: Use STACK_FRAME_OVERHEAD in xmon_show_stack()

We use STACK_FRAME_OVERHEAD in the exception vectors to establish
the exception frame, so it should be good enough to use here.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
c5c5714d5093e677ec962921210eae14156f7179 09-Oct-2012 Michael Ellerman <michael@ellerman.id.au> powerpc/xmon: Remove unused #defines

Neither REGS_PER_LINE or LAST_VOLATILE are used, nor have they ever
been as far back as I can see.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
b3dc19cddce37a1aaebc911c8db94e5209a9764d 09-Oct-2012 Michael Ellerman <michael@ellerman.id.au> powerpc/xmon: Remove renaming #defines of scanhex() and skipbl()

We have two #defines that rename scanhex() and skipbl() to
xmon_scanhex() and xmon_skipbl() - but no one ever uses those
names.

So the only effect is to rename the actual symbols in the generated
code, and AFACIS there is no reason to do that, so drop them.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
08702c73a6182d0f6a429271383a553abc92c0b8 09-Oct-2012 Michael Ellerman <michael@ellerman.id.au> powerpc/xmon: Remove empty xmon_map_scc()

This has been empty since 2005, commit 51d3082 "Unify udbg (#2)".

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
ddadb6b8e88979a00ac44fba9c92896eec113bd1 14-Sep-2012 Michael Ellerman <michael@ellerman.id.au> powerpc: Add an xmon command to dump one or all pacas

This was originally motivated by a desire to see the mapping between
logical and hardware cpu numbers.

But it seemed that it made more sense to just add a command to dump
(most of) the paca.

With no arguments "dp" will dump the paca for the current cpu.

It also takes an argument, eg. "dp 3" which is the logical cpu number
in hex. This form does not check if the cpu is possible, but displays
the paca regardless, as well as the cpu's state in the possible, present
and online masks.

Thirdly, "dpa" will display the paca for all possible cpus. If there are
no possible cpus, like early in boot, it will tell you that.

Sample output, number in brackets is the offset into the struct:

2:mon> dp 3
paca for cpu 0x3 @ c00000000ff20a80:
possible = yes
present = yes
online = yes
lock_token = 0x8000 (0x8)
paca_index = 0x3 (0xa)
kernel_toc = 0xc00000000144f990 (0x10)
kernelbase = 0xc000000000000000 (0x18)
kernel_msr = 0xb000000000001032 (0x20)
stab_real = 0x0 (0x28)
stab_addr = 0x0 (0x30)
emergency_sp = 0xc00000003ffe4000 (0x38)
data_offset = 0xa40000 (0x40)
hw_cpu_id = 0x9 (0x50)
cpu_start = 0x1 (0x52)
kexec_state = 0x0 (0x53)
__current = 0xc00000007e568680 (0x218)
kstack = 0xc00000007e5a3e30 (0x220)
stab_rr = 0x1a (0x228)
saved_r1 = 0xc00000007e7cb450 (0x230)
trap_save = 0x0 (0x240)
soft_enabled = 0x0 (0x242)
irq_happened = 0x0 (0x243)
io_sync = 0x0 (0x244)
irq_work_pending = 0x0 (0x245)
nap_state_lost = 0x0 (0x246)

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
4474ef055c5d8cb8eaf002d69e49af71e3aa3a88 06-Sep-2012 Michael Neuling <mikey@neuling.org> powerpc: Rework set_dabr so it can take a DABRX value as well

Rework set_dabr to take a DABRX value as well.

Both the pseries and PS3 hypervisors do some checks on the DABRX
values that are passed in the hcall. This patch stops bogus values
from being passed to hypervisor. Also, in the case where we are
clearing the breakpoint, where DABR and DABRX are zero, we modify the
DABRX value to make it valid so that the hcall won't fail.

Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
e3bc8049e524f13e09a58f5bad70b6738494277a 24-Aug-2012 Michael Ellerman <michael@ellerman.id.au> powerpc: Fixup whitespace in xmon

There are a few whitespace goolies in xmon.c, some of them appear to
be my fault. Fix them all in one go.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
ca5dd3954a62dc14c2afff1c34b3b5d8dc74f777 24-Aug-2012 Michael Ellerman <michael@ellerman.id.au> powerpc: Fix xmon dl command for new printk implementation

Since the printk internals were reworked the xmon 'dl' command which
dumps the content of __log_buf has stopped working.

It is now a structured buffer, so just dumping it doesn't really work.

Use the helpers added for kgdb to print out the content.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
bc1d7702910c7c7e88eb60b58429dbfe293683ce 28-Jun-2012 Anton Blanchard <anton@samba.org> powerpc/xmon: Use cpumask iterator to avoid warning

We have a bug report where the kernel hits a warning in the cpumask
code:

WARNING: at include/linux/cpumask.h:107

Which is:
WARN_ON_ONCE(cpu >= nr_cpumask_bits);

The backtrace is:
cpu_cmd
cmds
xmon_core
xmon
die

xmon is iterating through 0 to NR_CPUS. I'm not sure why we are still
open coding this but iterating above nr_cpu_ids is definitely a bug.

This patch iterates through all possible cpus, in case we issue a
system reset and CPUs in an offline state call in.

Perhaps the old code was trying to handle CPUs that were in the
partition but were never started (eg kexec into a kernel with an
nr_cpus= boot option). They are going to die way before we get into
xmon since we haven't set any kernel state up for them.

Signed-off-by: Anton Blanchard <anton@samba.org>
CC: <stable@kernel.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
ae3a197e3d0bfe3f4bf1693723e82dc018c096f3 28-Mar-2012 David Howells <dhowells@redhat.com> Disintegrate asm/system.h for PowerPC

Disintegrate asm/system.h for PowerPC.

Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
cc: linuxppc-dev@lists.ozlabs.org
f5339277eb8d3aed37f12a27988366f68ab68930 15-Mar-2012 Stephen Rothwell <sfr@canb.auug.org.au> powerpc: Remove FW_FEATURE ISERIES from arch code

This is no longer selectable, so just remove all the dependent code.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
7230c5644188cd9e3fb380cc97dde00c464a3ba7 06-Mar-2012 Benjamin Herrenschmidt <benh@kernel.crashing.org> powerpc: Rework lazy-interrupt handling

The current implementation of lazy interrupts handling has some
issues that this tries to address.

We don't do the various workarounds we need to do when re-enabling
interrupts in some cases such as when returning from an interrupt
and thus we may still lose or get delayed decrementer or doorbell
interrupts.

The current scheme also makes it much harder to handle the external
"edge" interrupts provided by some BookE processors when using the
EPR facility (External Proxy) and the Freescale Hypervisor.

Additionally, we tend to keep interrupts hard disabled in a number
of cases, such as decrementer interrupts, external interrupts, or
when a masked decrementer interrupt is pending. This is sub-optimal.

This is an attempt at fixing it all in one go by reworking the way
we do the lazy interrupt disabling from the ground up.

The base idea is to replace the "hard_enabled" field with a
"irq_happened" field in which we store a bit mask of what interrupt
occurred while soft-disabled.

When re-enabling, either via arch_local_irq_restore() or when returning
from an interrupt, we can now decide what to do by testing bits in that
field.

We then implement replaying of the missed interrupts either by
re-using the existing exception frame (in exception exit case) or via
the creation of a new one from an assembly trampoline (in the
arch_local_irq_enable case).

This removes the need to play with the decrementer to try to create
fake interrupts, among others.

In addition, this adds a few refinements:

- We no longer hard disable decrementer interrupts that occur
while soft-disabled. We now simply bump the decrementer back to max
(on BookS) or leave it stopped (on BookE) and continue with hard interrupts
enabled, which means that we'll potentially get better sample quality from
performance monitor interrupts.

- Timer, decrementer and doorbell interrupts now hard-enable
shortly after removing the source of the interrupt, which means
they no longer run entirely hard disabled. Again, this will improve
perf sample quality.

- On Book3E 64-bit, we now make the performance monitor interrupt
act as an NMI like Book3S (the necessary C code for that to work
appear to already be present in the FSL perf code, notably calling
nmi_enter instead of irq_enter). (This also fixes a bug where BookE
perfmon interrupts could clobber r14 ... oops)

- We could make "masked" decrementer interrupts act as NMIs when doing
timer-based perf sampling to improve the sample quality.

Signed-off-by-yet: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---

v2:

- Add hard-enable to decrementer, timer and doorbells
- Fix CR clobber in masked irq handling on BookE
- Make embedded perf interrupt act as an NMI
- Add a PACA_HAPPENED_EE_EDGE for use by FSL if they want
to retrigger an interrupt without preventing hard-enable

v3:

- Fix or vs. ori bug on Book3E
- Fix enabling of interrupts for some exceptions on Book3E

v4:

- Fix resend of doorbells on return from interrupt on Book3E

v5:

- Rebased on top of my latest series, which involves some significant
rework of some aspects of the patch.

v6:
- 32-bit compile fix
- more compile fixes with various .config combos
- factor out the asm code to soft-disable interrupts
- remove the C wrapper around preempt_schedule_irq

v7:
- Fix a bug with hard irq state tracking on native power7
7ac21cd465391802d931bd5e692302639383b8f5 02-Mar-2012 Benjamin Herrenschmidt <benh@kernel.crashing.org> powerpc/xmon: Add display of soft & hard irq states

Also use local_paca instead of get_paca() to avoid getting into
the smp_processor_id() debugging code from the debugger

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
08f6d6abc3eadb88f020075910e6f3a849e56690 29-Sep-2011 Jimi Xenidis <jimix@pobox.com> powerpc/xmon: Fix #if typo for systems without MSR[RI]

Sorry, there was a typo in the #if

signed-off-by: Jimi Xenidis <jimix@pobox.com>

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
79873e8df64cc124cdcad56d1d8330b3f45690bc 29-Sep-2011 Jimi Xenidis <jimix@pobox.com> powerpc/xmon: Fix the 'u' command description

The 'u' command will print the TLB on book3e parts and the SLB on
Book3s parts, but the help system doesn't say that correctly.

Signed-off-by: Jimi Xenidis <jimix@pobox.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
4b16f8e2d6d64249f0ed3ca7fe2a319d0dde2719 23-Jul-2011 Paul Gortmaker <paul.gortmaker@windriver.com> powerpc: various straight conversions from module.h --> export.h

All these files were including module.h just for the basic
EXPORT_SYMBOL infrastructure. We can shift them off to the
export.h header which is a way smaller footprint and thus
realize some compile time gains.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
66857b3a9e88ac6f6e279eaa06b84367e662c0dd 23-Sep-2011 Jimi Xenidis <jimix@pobox.com> powerpc: Fix xmon for systems without MSR[RI]

Based on patch by David Gibson <dwg@au1.ibm.com>

xmon has a longstanding bug on systems which are SMP-capable but lack
the MSR[RI] bit. In these cases, xmon invoked by IPI on secondary
CPUs will not properly keep quiet, but will print stuff, thereby
garbling the primary xmon's output. This patch fixes it, by ignoring
the RI bit if the processor does not support it.

There's already a version of this for 4xx upstream, which we'll need
to extend to other RI-lacking CPUs at some point. For now this adds
Book3e processors to the mix.

Signed-off-by: Jimi Xenidis <jimix@pobox.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
e04763713286b1e00e1c2a33fe2741caf9470f2b 10-May-2011 Milton Miller <miltonm@bga.com> powerpc: Remove call sites of MSG_ALL_BUT_SELF

The only user of MSG_ALL_BUT_SELF in the whole kernel tree is powerpc,
and it only uses it to start the debugger. Both debuggers always call
smp_send_debugger_break with MSG_ALL_BUT_SELF, and only mpic can do
anything more optimal than a loop over all online cpus, but all message
passing implementations have to code for this special delivery target.

Convert smp_send_debugger_break to take void and loop calling the smp_ops
message_pass function for each of the other cpus in the online cpumask.

Use raw_smp_processor_id() because we are either entering the debugger
or trying to start kdump and the additional warning it not useful were
it to trigger.

Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
104699c0ab473535793b5fea156adaf309afd29b 28-Apr-2011 KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> powerpc: Convert old cpumask API into new one

Adapt new API.

Almost change is trivial. Most important change is the below line
because we plan to change task->cpus_allowed implementation.

- ctx->cpus_allowed = current->cpus_allowed;

Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
48404f2e95ef0ffd8134d89c8abcd1a15e15f1b0 01-May-2011 Paul Mackerras <paulus@samba.org> powerpc: Save Come-From Address Register (CFAR) in exception frame

Recent 64-bit server processors (POWER6 and POWER7) have a "Come-From
Address Register" (CFAR), that records the address of the most recent
branch or rfid (return from interrupt) instruction for debugging purposes.

This saves the value of the CFAR in the exception entry code and stores
it in the exception frame. We also make xmon print the CFAR value in
its register dump code.

Rather than extend the pt_regs struct at this time, we steal the orig_gpr3
field, which is only used for system calls, and use it for the CFAR value
for all exceptions/interrupts other than system calls. This means we
don't save the CFAR on system calls, which is not a great problem since
system calls tend not to happen unexpectedly, and also avoids adding the
overhead of reading the CFAR to the system call entry path.

Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
44ae3ab3358e962039c36ad4ae461ae9fb29596c 06-Apr-2011 Matt Evans <matt@ozlabs.org> powerpc: Free up some CPU feature bits by moving out MMU-related features

Some of the 64bit PPC CPU features are MMU-related, so this patch moves
them to MMU_FTR_ bits. All cpu_has_feature()-style tests are moved to
mmu_has_feature(), and seven feature bits are freed as a result.

Signed-off-by: Matt Evans <matt@ozlabs.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
9f0b079320ad1cc71ad7ea4e0ed0b64cd72bbd6d 07-Apr-2011 Michael Ellerman <michael@ellerman.id.au> powerpc: Use MSR_64BIT in places

Use the new MSR_64BIT in a few places. Some of these are already ifdef'ed
for BOOKE vs BOOKS, but it's still clearer, MSR_SF does not immediately
parse as "MSR bit for 64bit".

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
b2b755b5f10eb32fbdc73a9907c07006b17f714b 24-Mar-2011 David Rientjes <rientjes@google.com> lib, arch: add filter argument to show_mem and fix private implementations

Commit ddd588b5dd55 ("oom: suppress nodes that are not allowed from
meminfo on oom kill") moved lib/show_mem.o out of lib/lib.a, which
resulted in build warnings on all architectures that implement their own
versions of show_mem():

lib/lib.a(show_mem.o): In function `show_mem':
show_mem.c:(.text+0x1f4): multiple definition of `show_mem'
arch/sparc/mm/built-in.o:(.text+0xd70): first defined here

The fix is to remove __show_mem() and add its argument to show_mem() in
all implementations to prevent this breakage.

Architectures that implement their own show_mem() actually don't do
anything with the argument yet, but they could be made to filter nodes
that aren't allowed in the current context in the future just like the
generic implementation.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Reported-by: James Bottomley <James.Bottomley@hansenpartnership.com>
Suggested-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David Rientjes <rientjes@google.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1495cc9df4e81f5a8fa9b0b8f1034b14d24b7d8c 18-Aug-2010 Dmitry Torokhov <dmitry.torokhov@gmail.com> Input: sysrq - drop tty argument from sysrq ops handlers

Noone is using tty argument so let's get rid of it.

Acked-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Acked-by: Jason Wessel <jason.wessel@windriver.com>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
03247157f73912c98baa918cf46b98ee5483d7f8 09-Jul-2010 Benjamin Herrenschmidt <benh@kernel.crashing.org> powerpc/book3e: Add TLB dump in xmon for Book3E

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
5be3492f972b73051ead7ecbac6fb9efd1e8e0ec 12-Jan-2010 Anton Blanchard <anton@samba.org> powerpc: Mark some variables in the page fault path __read_mostly

Using perf to trace L1 dcache misses and dumping data addresses I found a few
variables taking a lot of misses. Since they are almost never written, they
should go into the __read_mostly section.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
69ddb57cbea0b3dd851ea5f1edd1e609ad4da04e 29-Oct-2009 Gautham R Shenoy <ego@in.ibm.com> powerpc/pseries: Add extended_cede_processor() helper function.

This patch provides an extended_cede_processor() helper function
which takes the cede latency hint as an argument. This hint is to be passed
on to the hypervisor to cede to the corresponding state on platforms
which support it.

Signed-off-by: Gautham R Shenoy <ego@in.ibm.com>
Signed-off-by: Arun R Bharadwaj <arun@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
cdd3904dcc56d9d24ef86be897e421d3cc364226 05-Oct-2009 Josh Boyer <jwboyer@linux.vnet.ibm.com> powerpc/booke: Fix xmon single step on PowerPC Book-E

Prior to the arch/ppc -> arch/powerpc transition, xmon had support for single
stepping on 4xx boards. The functionality was lost when arch/ppc was removed.
This patch restores single step support for 44x boards, and Book-E in general.

Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
daf8f40391b2a1978ea2071c20959d91fade6b1a 23-Sep-2009 Josh Boyer <jwboyer@linux.vnet.ibm.com> powerpc/4xx: Fix erroneous xmon warning on PowerPC 4xx

The xmon code relies on MSR_RI being non-zero to indicate that an exception
is recoverable. If it is not, it prints a warning message. However, the
PowerPC 4xx cores do not have an MSR_RI bit and this warning is produced for
every xmon event.

This introduces an unrecoverable_excp function to determine if an exception
is recoverable or not. This gets rid of the erroneous warnings on 4xx.

Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2d27cfd3286966c04d4192a9db5a6c7ea60eebf1 24-Jul-2009 Benjamin Herrenschmidt <benh@kernel.crashing.org> powerpc: Remaining 64-bit Book3E support

This contains all the bits that didn't fit in previous patches :-) This
includes the actual exception handlers assembly, the changes to the
kernel entry, other misc bits and wiring it all up in Kconfig.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
6d1386d517e2b9b0de994cc47b1e490db7972a2a 02-Jun-2009 Stephen Rothwell <sfr@canb.auug.org.au> powerpc/xmon: Remove unused variable in xmon.c

Gets rid of this warning:

arch/powerpc/xmon/xmon.c: In function 'dump_log_buf':
arch/powerpc/xmon/xmon.c:2133: warning: unused variable 'i'

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
f312deb4cd0c88196edf6dab192b7d42514398d6 15-May-2009 Vinay Sridhar <vinay@linux.vnet.ibm.com> powerpc/xmon: Add dl command to dump contents of __log_buf

Hello All,

Quite a while back Michael Ellerman had posted a patch to add support to xmon to print the contents of the console log pointed to by __log_buf.
Here's the link to that patch - http://ozlabs.org/pipermail/linuxppc64-dev/2005-March/003657.html
I've ported the patch in the above link to 2.6.30-rc5 and have tested it.

Thanks & regards,
Vinay

Signed-off-by: Michael Ellerman <michael at ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
322b439455ea62e6480e300c77b258e872896381 17-Dec-2008 Anton Vorontsov <avorontsov@ru.mvista.com> powerpc: Prepare xmon_save_regs for use with kdump

Today the arch/powerpc/xmon/setjmp.S file contains only the
xmon_save_regs function. We want to use it for kdump purposes, so
let's move the file into arch/powerpc/kernel/ and give the function a
more generic name (ppc_save_regs).

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
ebdba9af940d63e469dc8e46b4aa1fc474e8ee2d 31-Oct-2008 Paul Mackerras <paulus@samba.org> powerpc: Fix compile errors with CONFIG_BUG=n

This makes sure we don't try to call find_bug or is_warning_bug when
CONFIG_BUG=n and CONFIG_XMON=y. Otherwise we get these errors:

arch/powerpc/xmon/xmon.c: In function ‘print_bug_trap’:
arch/powerpc/xmon/xmon.c:1364: error: implicit declaration of function ‘find_bug’
arch/powerpc/xmon/xmon.c:1364: warning: assignment makes pointer from integer without a cast
arch/powerpc/xmon/xmon.c:1367: error: implicit declaration of function ‘is_warning_bug’
arch/powerpc/xmon/xmon.c:1374: error: dereferencing pointer to incomplete type
make[2]: *** [arch/powerpc/xmon/xmon.o] Error 1
make[1]: *** [arch/powerpc/xmon] Error 2
make: *** [sub-make] Error 2

Signed-off-by: Paul Mackerras <paulus@samba.org>
1f64643aa5f5a17f1723f7ea0f17b7a3a8f632b3 05-Jun-2008 Luke Browning <lukebrowning@us.ibm.com> powerpc/spufs: remove class_0_dsisr from spu exception handling

According to the CBEA, the SPU dsisr is not updated for class 0
exceptions.

spu_stopped() is testing the dsisr that was passed to it from the class
0 exception handler, so we return a false positive here.

This patch cleans up the interrupt handler and erroneous tests in
spu_stopped. It also removes the fields from the csa since it is not
needed to process class 0 events.

Signed-off-by: Luke Browning <lukebrowning@us.ibm.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
1c8950ff87de950a3b6ccfb26650fc0a56278836 08-May-2008 Michael Ellerman <michael@ellerman.id.au> [POWERPC] Make cpus_in_xmon static and remove extern mess from hvc_console.c

This is a little messier than I'd like because xmon.h only exists
on powerpc and we can't have a static inline and an extern declaration
visible at the same time.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
9f1067c2d98ac1c43f0c82892f5647774a6ac759 08-May-2008 Michael Ellerman <michael@ellerman.id.au> [POWERPC] Fix sparse warnings in xmon.c

warning: Using plain integer as NULL pointer
warning: Using plain integer as NULL pointer
warning: symbol 'excprint' was not declared. Should it be static?
warning: symbol 'prregs' was not declared. Should it be static?
warning: symbol 'cacheflush' was not declared. Should it be static?
warning: symbol 'read_spr' was not declared. Should it be static?
warning: symbol 'write_spr' was not declared. Should it be static?
warning: symbol 'super_regs' was not declared. Should it be static?
warning: symbol 'mread' was not declared. Should it be static?
warning: symbol 'mwrite' was not declared. Should it be static?
warning: symbol 'byterev' was not declared. Should it be static?
warning: symbol 'memex' was not declared. Should it be static?
warning: symbol 'bsesc' was not declared. Should it be static?
warning: symbol 'dump' was not declared. Should it be static?
warning: symbol 'prdump' was not declared. Should it be static?
warning: symbol 'generic_inst_dump' was not declared. Should it be static?
warning: symbol 'ppc_inst_dump' was not declared. Should it be static?
warning: symbol 'memops' was not declared. Should it be static?
warning: symbol 'memdiffs' was not declared. Should it be static?
warning: symbol 'memlocate' was not declared. Should it be static?
warning: symbol 'memzcan' was not declared. Should it be static?
warning: symbol 'proccall' was not declared. Should it be static?
warning: symbol 'scannl' was not declared. Should it be static?
warning: symbol 'hexdigit' was not declared. Should it be static?
warning: symbol 'flush_input' was not declared. Should it be static?
warning: symbol 'inchar' was not declared. Should it be static?
warning: symbol 'take_input' was not declared. Should it be static?
warning: symbol 'xmon_init' was not declared. Should it be static?

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
f3d69e0507f84903059d456c5d19f10b2df3ac69 27-Apr-2008 Luke Browning <lukebr@linux.vnet.ibm.com> [POWERPC] spufs: fix concurrent delivery of class 0 & 1 exceptions

SPU class 0 & 1 exceptions may occur in parallel, so we may end up
overwriting csa.dsisr.

This change adds dedicated fields for each class to the spu and the spu
context so that fault data is not overwritten.

Signed-off-by: Luke Browning <lukebr@linux.vnet.ibm.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
ec2b36b9f23cfbbe94d89724b796b44fd57d5221 17-Apr-2008 Benjamin Herrenschmidt <benh@kernel.crashing.org> [POWERPC] Move stackframe definitions to common header

This moves various definitions used all over the place to parse stack
frames to ptrace.h so only one definition is needed.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
30ff2e87ed55e83b4eb436f5f14a7e49ff81ad99 10-Apr-2008 Stephen Rothwell <sfr@canb.auug.org.au> [POWERPC] iSeries: Make iseries_reg_save private to iSeries

Now that we have the alpaca, the reg_save_ptr is no longer needed in the
paca. Eradicate all global uses of it and make it static in the iSeries
lpardata.c

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
c3b75bd7bbf4a0438dc140033b80657995fd30ed 18-Jan-2008 Michael Neuling <mikey@neuling.org> [POWERPC] Make setjmp/longjmp code usable outside of xmon

This makes the setjmp/longjmp code used by xmon, generically available
to other code. It also removes the requirement for debugger hooks to
be only called on 0x300 (data storage) exception.

Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
b3b9595f50f73f0d53ebd71c463c5f09a6e64a21 06-Dec-2007 will schmidt <will_schmidt@vnet.ibm.com> [POWERPC] Update xmon slb code

This adds a bit more detail to the xmon SLB output. When the valid
bit is set, this displays the ESID and VSID values, as well as
decoding the segment size -- 1T or 256M -- and displaying the LLP
bits. This supresses the output for any slb entries that contain only
zeros.

sample output from power6 (1T segment support):
00 c000000008000000 40004f7ca3000500 1T ESID= c00000 VSID= 4f7ca3 LLP:100
01 d000000008000000 4000eb71b0000400 1T ESID= d00000 VSID= eb71b0 LLP: 0
08 0000000018000000 0000c8499f8ccc80 256M ESID= 1 VSID= c8499f8cc LLP: 0
09 00000000f8000000 0000d2c1a8e46c80 256M ESID= f VSID= d2c1a8e46 LLP: 0
10 0000000048000000 0000ca87eab1dc80 256M ESID= 4 VSID= ca87eab1d LLP: 0
43 cf00000008000000 400011b260000500 1T ESID= cf0000 VSID= 11b260 LLP:100

sample output from power5 (notice the non-valid but non-zero entries)
10 0000000008000000 00004fd0e077ac80 256M ESID= 0 VSID= 4fd0e077a LLP: 0
11 00000000f8000000 00005b085830fc80 256M ESID= f VSID= 5b085830f LLP: 0
12 0000000048000000 000052ce99fe6c80 256M ESID= 4 VSID= 52ce99fe6 LLP: 0
13 0000000018000000 000050904ed95c80 256M ESID= 1 VSID= 50904ed95 LLP: 0
14 cf00000008000000 0000d59aca40f500 256M ESID=cf0000000 VSID= d59aca40f LLP:100
15 c000000078000000 000045cb97751500 256M ESID=c00000007 VSID= 45cb97751 LLP:100

Tested on power5 and power6.

Signed-Off-By: Will Schmidt <will_schmidt@vnet.ibm.com>

Signed-off-by: Paul Mackerras <paulus@samba.org>
584f8b71a2e8abdaeb4b6f4fddaf542b61392453 06-Dec-2007 Michael Neuling <mikey@neuling.org> [POWERPC] Use SLB size from the device tree

Currently we hardwire the number of SLBs to 64, but PAPR says we
should use the ibm,slb-size property to obtain the number of SLB
entries. This uses this property instead of assuming 64. If no
property is found, we assume 64 entries as before.

This soft patches the SLB handler, so it shouldn't change performance
at all.

Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
5a8a1a28bb35a62561367c0a1144dbc5dcb95230 16-Nov-2007 Benjamin Herrenschmidt <benh@kernel.crashing.org> [POWERPC] Add xmon function to dump 44x TLB

This adds a function to xmon to dump the content of the 44x processor
TLB with a little bit of decoding (but not much).

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
4d404edce30f911004850d472e05a31efd751662 18-Jul-2007 Ishizaki Kou <kou.ishizaki@toshiba.co.jp> [POWERPC] fix showing xmon help

In some configuration, xmon help string is larger than xmon_printf
buffer. We need not to use printf. This patch adds xmon_puts and
change to use it to show help string.

Signed-off-by: Kou Ishizaki <kou.ishizaki@toshiba.co.jp>
Signed-off-by: Paul Mackerras <paulus@samba.org>
f5e6a280d153bff3b0cd15651d29d409f8dea698 24-Jun-2007 Olaf Hering <olaf@aepfle.de> [POWERPC] Make two xmon variables static

xmon_early and xmon_off are only used in this file.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>
ffb45122766db220d0bf3d01848d575fbbcb6430 08-May-2007 Alexey Dobriyan <adobriyan@sw.ru> Simplify kallsyms_lookup()

Several kallsyms_lookup() pass dummy arguments but only need, say, module's
name. Make kallsyms_lookup() accept NULLs where possible.

Also, makes picture clearer about what interfaces are needed for all symbol
resolving business.

Signed-off-by: Alexey Dobriyan <adobriyan@sw.ru>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
f13659e0b3907548402ce1f47bf866544b804260 20-Mar-2007 Anton Blanchard <anton@samba.org> [POWERPC] Fix WARN_ON when entering xmon

Whenever we enter xmon we get a WARN_ON out of the rtas code since it
thinks interrupts are still on:

Unable to handle kernel paging request for data at address 0x00000000
Faulting instruction address: 0xd000000000080008
cpu 0x3: Vector: 300 (Data Access) at [c0000000075dba00]
pc: d000000000080008: .doit+0x8/0x40 [oopser]
lr: c000000000077704: .sys_init_module+0x1664/0x1824
sp: c0000000075dbc80
msr: 9000000000009032
dar: 0
dsisr: 42000000
current = 0xc000000003fa64b0
paca = 0xc000000000694280
pid = 2260, comm = insmod

------------[ cut here ]------------
Badness at arch/powerpc/kernel/entry_64.S:651
Call Trace:
[C0000000075DAE70] [C00000000000EB64] .show_stack+0x68/0x1b0 (unreliable)
[C0000000075DAF10] [C000000000216254] .report_bug+0x94/0xe8
[C0000000075DAFA0] [C00000000047B140] __kprobes_text_start+0x178/0x584
[C0000000075DB040] [C0000000000044F4] program_check_common+0xf4/0x100

Signed-off-by: Paul Mackerras <paulus@samba.org>
0a7c7efccc08f00ae6fc8e1f2de0ee61f07357fd 04-Mar-2007 Stephen Rothwell <sfr@canb.auug.org.au> [POWERPC] Allow xmon to build without CONFIG_DEBUG_BUGVERBOSE

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
c99176a230097b076c2f98e4bf963399fe114ffd 26-Feb-2007 Michael Ellerman <michael@ellerman.id.au> [POWERPC] Add missing newline in xmon help output

My patch to add spu disassembly (af89fb8041562508895c8f3ba04790d7c2f4338c)
removed a newline from the xmon help that it shouldn't have, put it back.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
8389998ae9ea2888c86c446f7911ddced50052a1 13-Feb-2007 Christoph Hellwig <hch@lst.de> [POWERPC] spufs: move prio to spu_context

It doesn't make any sense to have a priority field in the physical spu
structure. Move it into the spu context instead.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
73c9ceab40b1269d6195e556773167c078ac8311 08-Dec-2006 Jeremy Fitzhardinge <jeremy@goop.org> [POWERPC] Generic BUG for powerpc

This makes powerpc use the generic BUG machinery. The biggest reports the
function name, since it is redundant with kallsyms, and not needed in general.

There is an overall reduction of code, since module_32/64 duplicated several
functions.

Unfortunately there's no way to tell gcc that BUG won't return, so the BUG
macro includes a goto loop. This will generate a real jmp instruction, which
is never used.

[akpm@osdl.org: build fix]
[paulus@samba.org: remove infinite loop in BUG_ON]
Signed-off-by: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Andi Kleen <ak@muc.de>
Cc: Hugh Dickens <hugh@veritas.com>
Cc: Michael Ellerman <michael@ellerman.id.au>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
bbb681779012fae778c0a53081bbb19cf43bca4e 30-Nov-2006 Stephen Rothwell <sfr@canb.auug.org.au> [POWERPC] Allow xmon to build on legacy iSeries

xmon still does not run on iSeries, but this allows us to build a combined
kernel that includes it.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
e055595d3e5f5233374211bc6893e5d16976df99 27-Nov-2006 Arnd Bergmann <arnd@arndb.de> [POWERPC] cell: fix building without spufs

It may be desireable to build a kernel for cell without
spufs, e.g. as the initial kboot kernel. This requires
that the SPU specific parts of the core dump and the xmon
code depend on CONFIG_SPU_BASE instead of CONFIG_PPC_CELL.

Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
a985239bdf017e00e985c3a31149d6ae128fdc5f 23-Nov-2006 Michael Ellerman <michael@ellerman.id.au> [POWERPC] cell: spu management xmon routines

This fixes the xmon support for the cell spu to be compatable with the split
spu platform code.

Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
e0426047cb684842700f0098f74842a38260dbae 23-Nov-2006 Michael Ellerman <michael@ellerman.id.au> [POWERPC] Make xmon disassembly optional

While adding spu disassembly support it struck me that we're actually
carrying quite a lot of code around, just to do disassembly in the case
of a crash.

While on large systems it's not an issue, on smaller ones it might be
nice to have xmon - but without the weight of the disassembly support.
For a Cell build this saves ~230KB (!), and for pSeries ~195KB.

We still support the 'di' and 'sdi' commands, however they just dump
the instruction in hex.

Move the definitions into a header to clean xmon.c just a tiny bit.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
af89fb8041562508895c8f3ba04790d7c2f4338c 23-Nov-2006 Michael Ellerman <michael@ellerman.id.au> [POWERPC] Add spu disassembly to xmon

This patch adds a "sdi" command to xmon, to disassemble the contents
of an spu's local store.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
4c4c8723684b1b2cd0dfdf5e0685f35642bde253 23-Nov-2006 Michael Ellerman <michael@ellerman.id.au> [POWERPC] Prepare for spu disassembly in xmon

In order to do disassembly of spu binaries in xmon, we need to abstract
the disassembly function from ppc_inst_dump.

We do this by making the actual disassembly function a function pointer
that we pass to ppc_inst_dump(). To save updating all the callers, we
turn ppc_inst_dump() into generic_inst_dump() and make ppc_inst_dump()
a wrapper which always uses print_insn_powerpc().

Currently we pass the dialect into print_insn_powerpc(), but we always
pass 0 - so just make it a local.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
24a24c85d3c35790a355138d7cd34c074cb1b3ac 23-Nov-2006 Michael Ellerman <michael@ellerman.id.au> [POWERPC] Add a sd command (spu dump) to xmon to dump spu local store

Add a command to xmon to dump the memory of a spu's local store.
This mimics the 'd' command which dumps regular memory, but does
a little hand holding by taking the user supplied address and
finding that offset in the local store for the specified spu.

This makes it easy for example to look at what was executing on a spu:

1:mon> ss
...
Stopped spu 04 (was running)
...
1:mon> sf 4
Dumping spu fields at address c0000000019e0a00:
...
problem->spu_npc_RW = 0x228
...
1:mon> sd 4 0x228
d000080080318228 01a00c021cffc408 4020007f217ff488 |........@ ..!...|

Aha, 01a00c02, which is of course rdch $2,$ch24 !

--

Updated to only do the setjmp goo around the spu access, and not
around prdump because it does its own (via mread).

Also the num variable is now common between sf and sd, so you don't
have to keep typing the spu number in if you're repeating commands
on the same spu.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
2a14442bfebfea23d004fa4dfd067a94f5720ed7 23-Nov-2006 Michael Ellerman <michael@ellerman.id.au> [POWERPC] Show state of spus as theyre stopped in Cell xmon helper

After stopping spus in xmon I often find myself trawling through the
field dumps to find out which spus were running. The spu stopping
code actually knows what's running, so let's print it out to save
the user some futzing.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
437a0706837d09d8ab071c6790da07d9d6bb3d22 23-Nov-2006 Michael Ellerman <michael@ellerman.id.au> [POWERPC] Fix sparse warning in xmon Cell code

My patch to add spu helpers to xmon (a898497088f46252e6750405504064e2dce53117)
introduced a few sparse warnings, because I was dereferencing an __iomem
pointer.

I think the best way to handle it is to actually use the appropriate in_beXX
functions. Need to rejigger the DUMP macro a little to accomodate that.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
1d13581d00a041797c2c14adaccd306c91f87d46 13-Nov-2006 Stephen Rothwell <sfr@canb.auug.org.au> [POWERPC] iSeries: fix xmon.c for combined build

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
a898497088f46252e6750405504064e2dce53117 24-Oct-2006 Michael Ellerman <michael@ellerman.id.au> [POWERPC] add support for dumping spu info from xmon

This patch adds a command to xmon for dumping information about
spu structs. The command is 'sf' for "spu fields" perhaps, and
takes the spu number as an argument. This is the same value as the
spu->number field, or the "phys-id" value of a context when it is
bound to a physical spu.

We try to catch memory errors as we dump each field, hopefully this
will make the command reasonably robust, but YMMV. If people see a
need we can easily add more fields to the dump in future.

Output looks something like this:

0:mon> sf 0
Dumping spu fields at address c00000001ffd9e80:
number = 0x0
name = spe
devnode->full_name = /cpus/PowerPC,BE@0/spes/spe@0
nid = 0x0
local_store_phys = 0x20000000000
local_store = 0xd0000800801e0000
ls_size = 0x0
isrc = 0x4
node = 0x0
flags = 0x0
dar = 0x0
dsisr = 0x0
class_0_pending = 0
irqs[0] = 0x16
irqs[1] = 0x17
irqs[2] = 0x24
slb_replace = 0x0
pid = 0
prio = 0
mm = 0x0000000000000000
ctx = 0x0000000000000000
rq = 0x0000000000000000
timestamp = 0x0000000000000000
problem_phys = 0x20000040000
problem = 0xd000080080220000
problem->spu_runcntl_RW = 0x0
problem->spu_status_R = 0x0
problem->spu_npc_RW = 0x0
priv1 = 0xd000080080240000
priv1->mfc_sr1_RW = 0x33
priv2 = 0xd000080080250000

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
ff8a8f25976aa58bbae7883405b00dcbaf4cc823 24-Oct-2006 Michael Ellerman <michael@ellerman.id.au> [POWERPC] add support for stopping spus from xmon

This patch adds support for stopping, and restarting, spus
from xmon. We use the spu master runcntl bit to stop execution,
this is apparently the "right" way to control spu execution and
spufs will be changed in the future to use this bit.

Testing has shown that to restart execution we have to turn the
master runcntl bit on and also rewrite the spu runcntl bit, even
if it is already set to 1 (running).

Stopping spus is triggered by the xmon command 'ss' - "spus stop"
perhaps. Restarting them is triggered via 'sr'. Restart doesn't
start execution on spus unless they were running prior to being
stopped by xmon.

Walking the spu->full_list in xmon after a panic, would mean
corruption of any spu struct would make all the others
inaccessible. To avoid this, and also to make the next patch
easier, we cache pointers to all spus during boot.

We attempt to catch and recover from errors while stopping and
restarting the spus, but as with most xmon functionality there are
no guarantees that performing these operations won't crash xmon
itself.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
f583ffce1aac783fd16d5d75cd69ac5ebb8f4933 10-Oct-2006 Paul Mackerras <paulus@samba.org> [POWERPC] Fix xmon IRQ handler for pt_regs removal

Signed-off-by: Paul Mackerras <paulus@samba.org>
7d12e780e003f93433d49ce78cfedf4b4c52adc5 05-Oct-2006 David Howells <dhowells@redhat.com> IRQ: Maintain regs pointer globally rather than passing to IRQ handlers

Maintain a per-CPU global "struct pt_regs *" variable which can be used instead
of passing regs around manually through all ~1800 interrupt handlers in the
Linux kernel.

The regs pointer is used in few places, but it potentially costs both stack
space and code to pass it around. On the FRV arch, removing the regs parameter
from all the genirq function results in a 20% speed up of the IRQ exit path
(ie: from leaving timer_interrupt() to leaving do_IRQ()).

Where appropriate, an arch may override the generic storage facility and do
something different with the variable. On FRV, for instance, the address is
maintained in GR28 at all times inside the kernel as part of general exception
handling.

Having looked over the code, it appears that the parameter may be handed down
through up to twenty or so layers of functions. Consider a USB character
device attached to a USB hub, attached to a USB controller that posts its
interrupts through a cascaded auxiliary interrupt controller. A character
device driver may want to pass regs to the sysrq handler through the input
layer which adds another few layers of parameter passing.

I've build this code with allyesconfig for x86_64 and i386. I've runtested the
main part of the code on FRV and i386, though I can't test most of the drivers.
I've also done partial conversion for powerpc and MIPS - these at least compile
with minimal configurations.

This will affect all archs. Mostly the changes should be relatively easy.
Take do_IRQ(), store the regs pointer at the beginning, saving the old one:

struct pt_regs *old_regs = set_irq_regs(regs);

And put the old one back at the end:

set_irq_regs(old_regs);

Don't pass regs through to generic_handle_irq() or __do_IRQ().

In timer_interrupt(), this sort of change will be necessary:

- update_process_times(user_mode(regs));
- profile_tick(CPU_PROFILING, regs);
+ update_process_times(user_mode(get_irq_regs()));
+ profile_tick(CPU_PROFILING);

I'd like to move update_process_times()'s use of get_irq_regs() into itself,
except that i386, alone of the archs, uses something other than user_mode().

Some notes on the interrupt handling in the drivers:

(*) input_dev() is now gone entirely. The regs pointer is no longer stored in
the input_dev struct.

(*) finish_unlinks() in drivers/usb/host/ohci-q.c needs checking. It does
something different depending on whether it's been supplied with a regs
pointer or not.

(*) Various IRQ handler function pointers have been moved to type
irq_handler_t.

Signed-Off-By: David Howells <dhowells@redhat.com>
(cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)
0a730ae59960165ae50de3284fb50316d1755d98 03-Oct-2006 Paul Mackerras <paulus@samba.org> [POWERPC] Don't try to just continue if xmon has no input device

Currently, if xmon has no input device (as is generally the case on
G5 powermacs), and we drop into xmon as a result of a fatal exception,
it will return 1, which die() interprets as "continue without causing
an oops". This fixes it by making xmon() return 0 in the case where
it has no input device.

Signed-off-by: Paul Mackerras <paulus@samba.org>
476792839467c08ddeedd8b44a7423d415b68259 03-Oct-2006 Michael Ellerman <michael@ellerman.id.au> [POWERPC] Fix xmon=off and cleanup xmon initialisation

My patch to make the early xmon logic work with earlier early param
parsing (480f6f35a149802a94ad5c1a2673ed6ec8d2c158) breaks xmon=off.

No one does this obviously as xmon rocks, but it should really work
as documented.

While fixing that it struck me that we could move the xmon param
handling into xmon.c, and also consolidate the
xmon_init()/do_early_xmon logic into xmon_setup(). This means
xmon=early drops into xmon a little earlier on 32-bit, but it
seems to work just fine.

Tested on PSERIES and CLASSIC32.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
26c8af5f01dfb91f709cc2ba07fb650949aae13e 08-Sep-2006 Olaf Hering <olaf@aepfle.de> [POWERPC] print backtrace when entering xmon

xmon does not print a backtrace per default. This is bad on systems with
USB keyboard, the most needed info about the crash is lost.
print a backtrace during the very first xmon entry.

Booting with xmon=nobt disables the autobacktrace functionality.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>
6ab3d5624e172c553004ecc862bfeac16d9d68b7 30-Jun-2006 Jörn Engel <joern@wohnheim.fh-wedel.de> Remove obsolete #include <linux/config.h>

Signed-off-by: Jörn Engel <joern@wohnheim.fh-wedel.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
5474c120aafe78ca54bf272f7a01107c42da2b21 25-Jun-2006 Michael Hanselmann <linux-kernel@hansmi.ch> [PATCH] Rewritten backlight infrastructure for portable Apple computers

This patch contains a total rewrite of the backlight infrastructure for
portable Apple computers. Backward compatibility is retained. A sysfs
interface allows userland to control the brightness with more steps than
before. Userland is allowed to upload a brightness curve for different
monitors, similar to Mac OS X.

[akpm@osdl.org: add needed exports]
Signed-off-by: Michael Hanselmann <linux-kernel@hansmi.ch>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
7e5b59384eebe35bff8429243f089931ce1cdf38 08-Mar-2006 Olaf Hering <olh@suse.de> [PATCH] powerpc: add a raw dump command to xmon

Dump a stream of rawbytes with a new 'dr' command.
Produces less output and it is simpler to feed the output to scripts.
Also, dr has no dumpsize limits.

Signed-off-by: Olaf Hering <olh@suse.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>
b0da985644faa45def84ce5d8e18af6f1680f490 11-Jan-2006 Arnd Bergmann <arnd@arndb.de> [PATCH] powerpc: xmon namespace cleanups

These symbols are only used in the file that they are defined in,
so they should not be in the global namespace.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>
51fae6de24da57bc6cdaa1b253595c3513ecbf2d 04-Dec-2005 Michael Ellerman <michael@ellerman.id.au> [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>
bb6b9b28d6847bc71f910e2e82c9040ff4b97ec0 30-Nov-2005 Benjamin Herrenschmidt <benh@kernel.crashing.org> [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>
4694ca02d19f42f5fd0b62cc2d0c7d3e5a0eef47 14-Nov-2005 Andrew Morton <akpm@osdl.org> [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>
548ccebc2a79c780724529948c79de0613f96776 11-Nov-2005 Paul Mackerras <paulus@samba.org> 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>
e1449ed956ae29129bde3e5137dde1d579d585ff 10-Nov-2005 Paul Mackerras <paulus@samba.org> 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>
fca5dcd4835ed09bb1a48a355344aff7a25c76e0 08-Nov-2005 Paul Mackerras <paulus@samba.org> 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>
eb66ce6333742e32825f0294310ff53e284fa828 29-Oct-2005 Paul Mackerras <paulus@samba.org> powerpc: Remove T command from xmon help text since it no longer exists

Signed-off-by: Paul Mackerras <paulus@samba.org>
f78541dcec327b0c46b150ee7d727f3db80275c4 28-Oct-2005 Paul Mackerras <paulus@samba.org> powerpc: Merge xmon

The merged version follows the ppc64 version pretty closely mostly,
and in fact ARCH=ppc64 now uses the arch/powerpc/xmon version.
The main difference for ppc64 is that the 'p' command to call
show_state (which was always pretty dodgy) has been replaced by
the ppc32 'p' command, which calls a given procedure (so in fact
the old 'p' command behaviour can be achieved with 'p $show_state').

Signed-off-by: Paul Mackerras <paulus@samba.org>