linux-2.6-block.git
14 years agoMerge branch 'kvm' into next
Benjamin Herrenschmidt [Thu, 5 Nov 2009 06:16:13 +0000 (17:16 +1100)]
Merge branch 'kvm' into next

14 years agopowerpc/kvm: Remove problematic BUILD_BUG_ON statement
Benjamin Herrenschmidt [Thu, 5 Nov 2009 06:10:34 +0000 (17:10 +1100)]
powerpc/kvm: Remove problematic BUILD_BUG_ON statement

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agoUse hrtimers for the decrementer
Alexander Graf [Mon, 2 Nov 2009 12:02:31 +0000 (12:02 +0000)]
Use hrtimers for the decrementer

Following S390's good example we should use hrtimers for the decrementer too!
This patch converts the timer from the old mechanism to hrtimers.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agoUse Little Endian for Dirty Bitmap
Alexander Graf [Fri, 30 Oct 2009 05:47:26 +0000 (05:47 +0000)]
Use Little Endian for Dirty Bitmap

We currently use host endian long types to store information
in the dirty bitmap.

This works reasonably well on Little Endian targets, because the
u32 after the first contains the next 32 bits. On Big Endian this
breaks completely though, forcing us to be inventive here.

So Ben suggested to always use Little Endian, which looks reasonable.

We only have dirty bitmap implemented in Little Endian targets so far
and since PowerPC would be the first Big Endian platform, we can just
as well switch to Little Endian always with little effort without
breaking existing targets.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agoFix trace.h
Alexander Graf [Fri, 30 Oct 2009 05:47:25 +0000 (05:47 +0000)]
Fix trace.h

It looks like the variable "pc" is defined. At least the current code always
failed on me stating that "pc" is already defined somewhere else.

Let's use _pc instead, because that doesn't collide.

Is this the right approach? Does it break on 440 too? If not, why not?

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agoInclude Book3s_64 target in buildsystem
Alexander Graf [Fri, 30 Oct 2009 05:47:24 +0000 (05:47 +0000)]
Include Book3s_64 target in buildsystem

Now we have everything in place to be able to build KVM, so let's add it
as config option and in the Makefile.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agoExport new PACA constants in asm-offsets
Alexander Graf [Fri, 30 Oct 2009 05:47:23 +0000 (05:47 +0000)]
Export new PACA constants in asm-offsets

In order to access fields in the PACA from assembly code, we need
to generate offsets using asm-offsets.c.

So let's add the new PACA related bits, we just introduced!

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agoAdd fields to PACA
Alexander Graf [Fri, 30 Oct 2009 05:47:22 +0000 (05:47 +0000)]
Add fields to PACA

For KVM we need to store some information in the PACA, so we
need to extend it.

This patch adds KVM SLB shadow related entries to the PACA and
a field that indicates if we're inside a guest.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agoExport KVM symbols for module
Alexander Graf [Fri, 30 Oct 2009 05:47:21 +0000 (05:47 +0000)]
Export KVM symbols for module

To be able to keep KVM as module, we need to export the SLB trampoline
addresses to the module, so it knows where to jump to.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agoSplit init_new_context and destroy_context
Alexander Graf [Mon, 2 Nov 2009 12:02:30 +0000 (12:02 +0000)]
Split init_new_context and destroy_context

For KVM we need to allocate a new context id, but don't really care about
all the mm context around it.

So let's split the alloc and destroy functions for the context id, so we can
grab one without allocating an mm context.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agoExport symbols for KVM module
Alexander Graf [Fri, 30 Oct 2009 05:47:19 +0000 (05:47 +0000)]
Export symbols for KVM module

We want to be able to build KVM as a module. To enable us doing so, we
need some more exports from core Linux parts.

This patch exports all functions and variables that are required for KVM.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agoAdd Book3s_64 offsets to asm-offsets.c
Alexander Graf [Fri, 30 Oct 2009 05:47:18 +0000 (05:47 +0000)]
Add Book3s_64 offsets to asm-offsets.c

We need to access some VCPU fields from assembly code. In order to get
the proper offsets, we have to define them in asm-offsets.c.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agoMake head_64.S aware of KVM real mode code
Alexander Graf [Fri, 30 Oct 2009 05:47:17 +0000 (05:47 +0000)]
Make head_64.S aware of KVM real mode code

We need to run some KVM trampoline code in real mode. Unfortunately, real mode
only covers 8MB on Cell so we need to squeeze ourselves as low as possible.

Also, we need to trap interrupts to get us back from guest state to host state
without telling Linux about it.

This patch adds interrupt traps and includes the KVM code that requires real
mode in the real mode parts of Linux.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agoAdd desktop PowerPC specific emulation
Alexander Graf [Fri, 30 Oct 2009 05:47:16 +0000 (05:47 +0000)]
Add desktop PowerPC specific emulation

Little opcodes behave differently on desktop and embedded PowerPC cores.
In order to reflect those differences, let's add some #ifdef code to emulate.c.

We could probably also handle them in the core specific emulation files, but I
would prefer to reuse as much code as possible.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agoAdd mfdec emulation
Alexander Graf [Fri, 30 Oct 2009 05:47:15 +0000 (05:47 +0000)]
Add mfdec emulation

We support setting the DEC to a certain value right now. Doing that basically
triggers the CPU local timer.

But there's also an mfdec command that enabled the OS to read the decrementor.

This is required at least by all desktop and server PowerPC Linux kernels. It
can't really hurt to allow embedded ones to do it as well though.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agoAdd book3s_64 specific opcode emulation
Alexander Graf [Fri, 30 Oct 2009 05:47:14 +0000 (05:47 +0000)]
Add book3s_64 specific opcode emulation

There are generic parts of PowerPC that can be shared across all
implementations and specific parts that only apply to BookE or desktop PPCs.

This patch adds emulation for desktop specific opcodes that don't apply
to BookE CPUs.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agoAdd book3s_32 guest MMU
Alexander Graf [Fri, 30 Oct 2009 05:47:13 +0000 (05:47 +0000)]
Add book3s_32 guest MMU

This patch adds an implementation for a G3/G4 MMU, so we can run G3 and
G4 guests in KVM on Book3s_64.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agoAdd book3s_64 guest MMU
Alexander Graf [Fri, 30 Oct 2009 05:47:12 +0000 (05:47 +0000)]
Add book3s_64 guest MMU

To be able to run a guest, we also need to implement a guest MMU.

This patch adds MMU handling for Book3s_64 guests.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agoAdd book3s_64 Host MMU handling
Alexander Graf [Fri, 30 Oct 2009 05:47:11 +0000 (05:47 +0000)]
Add book3s_64 Host MMU handling

We designed the Book3S port of KVM as modular as possible. Most
of the code could be easily used on a Book3S_32 host as well.

The main difference between 32 and 64 bit cores is the MMU. To keep
things well separated, we treat the book3s_64 MMU as one possible compile
option.

This patch adds all the MMU helpers the rest of the code needs in
order to modify the host's MMU, like setting PTEs and segments.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agoAdd book3s.c
Alexander Graf [Fri, 30 Oct 2009 05:47:10 +0000 (05:47 +0000)]
Add book3s.c

This adds the book3s core handling file. Here everything that is generic to
desktop PowerPC cores is handled, including interrupt injections, MSR settings,
etc.

It basically takes over the same role as booke.c for embedded PowerPCs.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agoAdd interrupt handling code
Alexander Graf [Fri, 30 Oct 2009 05:47:09 +0000 (05:47 +0000)]
Add interrupt handling code

Getting from host state to the guest is only half the story. We also need
to return to our host context and handle whatever happened to get us out of
the guest.

On PowerPC every guest exit is an interrupt. So all we need to do is trap
the host's interrupt handlers and get into our #VMEXIT code to handle it.

PowerPCs also have a register that can add an offset to the interrupt handlers'
adresses which is what the booke KVM code uses. Unfortunately that is a
hypervisor ressource and we also want to be able to run KVM when we're running
in an LPAR. So we have to hook into the Linux interrupt handlers.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agoAdd SLB switching code for entry/exit
Alexander Graf [Mon, 2 Nov 2009 12:02:29 +0000 (12:02 +0000)]
Add SLB switching code for entry/exit

This is the really low level of guest entry/exit code.

Book3s_64 has an SLB, which stores all ESID -> VSID mappings we're
currently aware of.

The segments in the guest differ from the ones on the host, so we need
to switch the SLB to tell the MMU that we're in a new context.

So we store a shadow of the guest's SLB in the PACA, switch to that on
entry and only restore bolted entries on exit, leaving the rest to the
Linux SLB fault handler.

That way we get a really clean way of switching the SLB.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agoAdd book3s_64 highmem asm code
Alexander Graf [Fri, 30 Oct 2009 05:47:07 +0000 (05:47 +0000)]
Add book3s_64 highmem asm code

This is the of entry / exit code. In order to switch between host and guest
context, we need to switch register state and call the exit code handler on
exit.

This assembly file does exactly that. To finally enter the guest it calls
into book3s_64_slb.S. On exit it gets jumped at from book3s_64_slb.S too.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agoAdd Book3s_64 intercept helpers
Alexander Graf [Fri, 30 Oct 2009 05:47:06 +0000 (05:47 +0000)]
Add Book3s_64 intercept helpers

We need to intercept interrupt vectors. To do that, let's add a file
we can always include which only activates the intercepts when we have
then configured.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agoAdd asm/kvm_book3s.h
Alexander Graf [Fri, 30 Oct 2009 05:47:05 +0000 (05:47 +0000)]
Add asm/kvm_book3s.h

This adds the book3s specific header file that contains structs that
are only valid on book3s specific code.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agoAdd Book3s fields to vcpu structs
Alexander Graf [Fri, 30 Oct 2009 05:47:04 +0000 (05:47 +0000)]
Add Book3s fields to vcpu structs

We need to store more information than we currently have for vcpus
when running on Book3s.

So let's extend the internal struct definitions.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agoAdd Book3s definitions
Alexander Graf [Fri, 30 Oct 2009 05:47:03 +0000 (05:47 +0000)]
Add Book3s definitions

We need quite a bunch of new constants for KVM on Book3s,
so let's define them now.

These constants will be used in later patches.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agoPass PVR in sregs
Alexander Graf [Fri, 30 Oct 2009 05:47:02 +0000 (05:47 +0000)]
Pass PVR in sregs

Right now sregs is unused on PPC, so we can use it for initialization
of the CPU.

KVM on BookE always virtualizes the host CPU. On Book3s we go a step further
and take the PVR from userspace that tells us what kind of CPU we are supposed
to virtualize, because we support Book3s_32 and Book3s_64 guests.

In order to get that information, we use the sregs ioctl, because we don't
want to reset the guest CPU on every normal register set.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agoMove dirty logging code to sub-arch
Alexander Graf [Fri, 30 Oct 2009 05:47:01 +0000 (05:47 +0000)]
Move dirty logging code to sub-arch

PowerPC code handles dirty logging in the generic parts atm. While this
is great for "return -ENOTSUPP", we need to be rather target specific
when actually implementing it.

So let's split it to implementation specific code, so we can implement
it for book3s.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agopowerpc/8xx: Fix build breakage with sparse irq changes
Benjamin Herrenschmidt [Fri, 30 Oct 2009 05:59:44 +0000 (16:59 +1100)]
powerpc/8xx: Fix build breakage with sparse irq changes

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agopowerpc: pasemi_defconfig update
Olof Johansson [Tue, 6 Oct 2009 05:52:50 +0000 (05:52 +0000)]
powerpc: pasemi_defconfig update

pasemi_defconfig hasn't been updated for a year.

Mostly a refresh of defaults, but this also disables 64K pages.

Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agopowerpc/therm_adt746x: Don't access non-existing register
Jean Delvare [Wed, 14 Oct 2009 05:31:32 +0000 (05:31 +0000)]
powerpc/therm_adt746x: Don't access non-existing register

The ADT746x don't have any register at sub-address 0, so better use an
existing register for the initial test read.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Colin Leroy <colin@colino.net>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agopowerpc: Enable sparse irq_descs on powerpc
Michael Ellerman [Tue, 13 Oct 2009 19:45:03 +0000 (19:45 +0000)]
powerpc: Enable sparse irq_descs on powerpc

Defining CONFIG_SPARSE_IRQ enables generic code that gets rid of the
static irq_desc array, and replaces it with an array of pointers to
irq_descs.

It also allows node local allocation of irq_descs, however we
currently don't have the information available to do that, so we just
allocate them on all on node 0.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agopowerpc: Rearrange and fix show_interrupts() for sparse irq_descs
Michael Ellerman [Tue, 13 Oct 2009 19:45:00 +0000 (19:45 +0000)]
powerpc: Rearrange and fix show_interrupts() for sparse irq_descs

Move the default case out of the if, ie. when we're just displaying
an irq. And consolidate all the odd cases at the top, ie. printing
the header and footer.

And in the process cope with sparse irq_descs.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agopowerpc: Make virq_debug_show() cope with sparse irq_descs
Michael Ellerman [Tue, 13 Oct 2009 19:44:56 +0000 (19:44 +0000)]
powerpc: Make virq_debug_show() cope with sparse irq_descs

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agopowerpc/nvram_64: Mark init code __init
Thomas Gleixner [Wed, 14 Oct 2009 22:54:46 +0000 (22:54 +0000)]
powerpc/nvram_64: Mark init code __init

Mark all functions which are only called from nvram_init() __init.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: linuxppc-dev@ozlabs.org
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agopowerpc/nvram_64: Check nvram_error_log_index in nvram_clear_error_log()
Thomas Gleixner [Wed, 14 Oct 2009 22:54:40 +0000 (22:54 +0000)]
powerpc/nvram_64: Check nvram_error_log_index in nvram_clear_error_log()

nvram_clear_error_log() calls ppc_md.nvram_write() even when
nvram_error_log_index is -1 (invalid). The nvram_write() function does
not check for a negative offset.

Check nvram_error_log_index as the other nvram log functions do.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: linuxppc-dev@ozlabs.org
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agopowerpc/nvram_64: Remove unused code
Thomas Gleixner [Wed, 14 Oct 2009 22:54:36 +0000 (22:54 +0000)]
powerpc/nvram_64: Remove unused code

nvram_find_partition() has no user. The call site was removed in the
arch/powerpc move, but the function stayed. Remove it.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: linuxppc-dev@ozlabs.org
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agopowerpc: Fix potential compile error irqs_disabled_flags
Michael Neuling [Wed, 21 Oct 2009 20:15:43 +0000 (20:15 +0000)]
powerpc: Fix potential compile error irqs_disabled_flags

irqs_disabled_flags is #defined in linux/irqflags.h when
CONFIG_TRACE_IRQFLAGS_SUPPORT is enabled.  64 and 32 bit always have
CONFIG_TRACE_IRQFLAGS_SUPPORT enabled so just remove
irqs_disabled_flags.

This fixes the case when someone needs to include both linux/irqflags.h
and asm/hw_irq.h.

Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agopowerpc/mm: Bring hugepage PTE accessor functions back into sync with normal accessors
David Gibson [Mon, 26 Oct 2009 19:24:31 +0000 (19:24 +0000)]
powerpc/mm: Bring hugepage PTE accessor functions back into sync with normal accessors

The hugepage arch code provides a number of hook functions/macros
which mirror the functionality of various normal page pte access
functions.  Various changes in the normal page accessors (in
particular BenH's recent changes to the handling of lazy icache
flushing and PAGE_EXEC) have caused the hugepage versions to get out
of sync with the originals.  In some cases, this is a bug, at least on
some MMU types.

One of the reasons that some hooks were not identical to the normal
page versions, is that the fact we're dealing with a hugepage needed
to be passed down do use the correct dcache-icache flush function.
This patch makes the main flush_dcache_icache_page() function hugepage
aware (by checking for the PageCompound flag).  That in turn means we
can make set_huge_pte_at() just a call to set_pte_at() bringing it
back into sync.  As a bonus, this lets us remove the
hash_huge_page_do_lazy_icache() function, replacing it with a call to
the hash_page_do_lazy_icache() function it was based on.

Some other hugepage pte access hooks - huge_ptep_get_and_clear() and
huge_ptep_clear_flush() - are not so easily unified, but this patch at
least brings them back into sync with the current versions of the
corresponding normal page functions.

Signed-off-by: David Gibson <dwg@au1.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agopowerpc/mm: Split hash MMU specific hugepage code into a new file
David Gibson [Mon, 26 Oct 2009 19:24:31 +0000 (19:24 +0000)]
powerpc/mm: Split hash MMU specific hugepage code into a new file

This patch separates the parts of hugetlbpage.c which are inherently
specific to the hash MMU into a new hugelbpage-hash64.c file.

Signed-off-by: David Gibson <dwg@au1.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agopowerpc/mm: Cleanup initialization of hugepages on powerpc
David Gibson [Mon, 26 Oct 2009 19:24:31 +0000 (19:24 +0000)]
powerpc/mm: Cleanup initialization of hugepages on powerpc

This patch simplifies the logic used to initialize hugepages on
powerpc.  The somewhat oddly named set_huge_psize() is renamed to
add_huge_page_size() and now does all necessary verification of
whether it's given a valid hugepage sizes (instead of just some) and
instantiates the generic hstate structure (but no more).

hugetlbpage_init() now steps through the available pagesizes, checks
if they're valid for hugepages by calling add_huge_page_size() and
initializes the kmem_caches for the hugepage pagetables.  This means
we can now eliminate the mmu_huge_psizes array, since we no longer
need to pass the sizing information for the pagetable caches from
set_huge_psize() into hugetlbpage_init()

Determination of the default huge page size is also moved from the
hash code into the general hugepage code.

Signed-off-by: David Gibson <dwg@au1.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agopowerpc/mm: Allow more flexible layouts for hugepage pagetables
David Gibson [Mon, 26 Oct 2009 19:24:31 +0000 (19:24 +0000)]
powerpc/mm: Allow more flexible layouts for hugepage pagetables

Currently each available hugepage size uses a slightly different
pagetable layout: that is, the bottem level table of pointers to
hugepages is a different size, and may branch off from the normal page
tables at a different level.  Every hugepage aware path that needs to
walk the pagetables must therefore look up the hugepage size from the
slice info first, and work out the correct way to walk the pagetables
accordingly.  Future hardware is likely to add more possible hugepage
sizes, more layout options and more mess.

This patch, therefore reworks the handling of hugepage pagetables to
reduce this complexity.  In the new scheme, instead of having to
consult the slice mask, pagetable walking code can check a flag in the
PGD/PUD/PMD entries to see where to branch off to hugepage pagetables,
and the entry also contains the information (eseentially hugepage
shift) necessary to then interpret that table without recourse to the
slice mask.  This scheme can be extended neatly to handle multiple
levels of self-describing "special" hugepage pagetables, although for
now we assume only one level exists.

This approach means that only the pagetable allocation path needs to
know how the pagetables should be set out.  All other (hugepage)
pagetable walking paths can just interpret the structure as they go.

There already was a flag bit in PGD/PUD/PMD entries for hugepage
directory pointers, but it was only used for debug.  We alter that
flag bit to instead be a 0 in the MSB to indicate a hugepage pagetable
pointer (normally it would be 1 since the pointer lies in the linear
mapping).  This means that asm pagetable walking can test for (and
punt on) hugepage pointers with the same test that checks for
unpopulated page directory entries (beq becomes bge), since hugepage
pointers will always be positive, and normal pointers always negative.

While we're at it, we get rid of the confusing (and grep defeating)
#defining of hugepte_shift to be the same thing as mmu_huge_psizes.

Signed-off-by: David Gibson <dwg@au1.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agopowerpc/mm: Cleanup management of kmem_caches for pagetables
David Gibson [Wed, 28 Oct 2009 16:27:18 +0000 (16:27 +0000)]
powerpc/mm: Cleanup management of kmem_caches for pagetables

Currently we have a fair bit of rather fiddly code to manage the
various kmem_caches used to store page tables of various levels.  We
generally have two caches holding some combination of PGD, PUD and PMD
tables, plus several more for the special hugepage pagetables.

This patch cleans this all up by taking a different approach.  Rather
than the caches being designated as for PUDs or for hugeptes for 16M
pages, the caches are simply allocated to be a specific size.  Thus
sharing of caches between different types/levels of pagetables happens
naturally.  The pagetable size, where needed, is passed around encoded
in the same way as {PGD,PUD,PMD}_INDEX_SIZE; that is n where the
pagetable contains 2^n pointers.

Signed-off-by: David Gibson <dwg@au1.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agopowerpc/mm: Make hpte_need_flush() correctly mask for multiple page sizes
David Gibson [Mon, 26 Oct 2009 19:24:31 +0000 (19:24 +0000)]
powerpc/mm: Make hpte_need_flush() correctly mask for multiple page sizes

Currently, hpte_need_flush() only correctly flushes the given address
for normal pages.  Callers for hugepages are required to mask the
address themselves.

But hpte_need_flush() already looks up the page sizes for its own
reasons, so this is a rather silly imposition on the callers.  This
patch alters it to mask based on the pagesize it has looked up itself,
and removes the awkward masking code in the hugepage caller.

Signed-off-by: David Gibson <dwg@au1.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agopowerpc: Add kdump support to Collaborative Memory Manager
Brian King [Mon, 19 Oct 2009 05:51:34 +0000 (05:51 +0000)]
powerpc: Add kdump support to Collaborative Memory Manager

When running Active Memory Sharing, the Collaborative Memory Manager (CMM)
may mark some pages as "loaned" with the hypervisor. Periodically, the
CMM will query the hypervisor for a loan request, which is a single signed
value. When kexec'ing into a kdump kernel, the CMM driver in the kdump
kernel is not aware of the pages the previous kernel had marked as "loaned",
so the hypervisor and the CMM driver are out of sync. Fix the CMM driver
to handle this scenario by ignoring requests to decrease the number of loaned
pages if we don't think we have any pages loaned. Pages that are marked as
"loaned" which are not in the balloon will automatically get switched to "active"
the next time we touch the page. This also fixes the case where totalram_pages
is smaller than min_mem_mb, which can occur during kdump.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agopowerpc: Remove get_irq_desc()
Michael Ellerman [Tue, 13 Oct 2009 19:44:51 +0000 (19:44 +0000)]
powerpc: Remove get_irq_desc()

get_irq_desc() is a powerpc-specific version of irq_to_desc(). That
is reason enough to remove it, but it also doesn't know about sparse
irq_desc support which irq_to_desc() does (when we enable it).

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agopowerpc/pseries: Use irq_has_action() in eeh_disable_irq()
Michael Ellerman [Tue, 13 Oct 2009 19:44:47 +0000 (19:44 +0000)]
powerpc/pseries: Use irq_has_action() in eeh_disable_irq()

Rather than open-coding our own check, use irq_has_action()
to check if an irq has an action - ie. is "in use".

irq_has_action() doesn't take the descriptor lock, but it
shouldn't matter - we're just using it as an indicator
that the irq is in use. disable_irq_nosync() will take
the descriptor lock before doing anything also.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agopowerpc: Make NR_IRQS a CONFIG option
Michael Ellerman [Tue, 13 Oct 2009 19:44:44 +0000 (19:44 +0000)]
powerpc: Make NR_IRQS a CONFIG option

The irq_desc array consumes quite a lot of space, and for systems
that don't need or can't have 512 irqs it's just wasted space.

The first 16 are reserved for ISA, so the minimum of 32 is really
16 - and no one has asked for more than 512 so leave that as the
maximum.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agoof/platform: Implement support for dev_pm_ops
Anton Vorontsov [Mon, 12 Oct 2009 05:50:41 +0000 (05:50 +0000)]
of/platform: Implement support for dev_pm_ops

Linux power management subsystem supports vast amount of new PM
callbacks that are crucial for proper suspend and hibernation support
in drivers.

This patch implements support for dev_pm_ops, preserving support
for legacy callbacks.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agopowerpc/chrp: Use the same RTAS daemon as pSeries
Benjamin Herrenschmidt [Thu, 24 Sep 2009 19:30:05 +0000 (19:30 +0000)]
powerpc/chrp: Use the same RTAS daemon as pSeries

The CHRP code has some fishy timer based code to scan the RTAS event
log, which uses a 1KB stack buffer and doesn't even use the results.

The pSeries code as a nicer daemon that allows userspace to read the
event log and basically uses the same RTAS interface

This patch moves rtasd.c out of platform/pseries and makes it usable
by CHRP, after removing the old crufty event log mechanism in there.

The nvram logging part of the daemon is still only available on 64-bit
since the underlying nvram management routines aren't currently shared.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agopowerpc: Move /proc/ppc64 to /proc/powerpc and add symlink
Benjamin Herrenschmidt [Thu, 24 Sep 2009 19:29:13 +0000 (19:29 +0000)]
powerpc: Move /proc/ppc64 to /proc/powerpc and add symlink

Some of the stuff in /proc/ppc64 such as the RTAS bits are actually
useful to some 32-bit platforms. Rename the file, and create a
symlink on 64-bit for backward compatibility

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agopowerpc: Make it possible to select hibernation on all PowerPCs
Anton Vorontsov [Mon, 5 Oct 2009 07:44:27 +0000 (07:44 +0000)]
powerpc: Make it possible to select hibernation on all PowerPCs

Just as with kexec, hibernation may fail even on well-tested platforms:
some PCI device, a driver of which doesn't play well with hibernation,
is enough to break resuming.

Hibernation code is not much platform dependent, and hiding features only
because these were not verified on a particular hardware is
counterproductive: we just prevent the features from being widely tested.

For example, with this patch I just tested hibernation on a MPC83xx
board, and it works quite well, modulo a few drivers that need some
fixing.

So, let's make it possible to select hibernation support for all
PowerPCs, then let's wait for any possible bug reports, and actually fix
(or just collect ;-) the bugs instead of hiding them. If some platforms
really can't stand hibernation, we can make a blacklist, with proper
comments why exactly hibernation doesn't work, whether it is possible to
fix, and what needs to be done to fix it.

CONFIG_HIBERNATION is still =n by default, so the commit doesn't change
anything apart from ability to set it to =y.

I'm not sure if EXPERIMENTAL dependency is needed, I'd rather not add it
for a few reasons:

1) It doesn't matter much, for distro kernels user has no clue that some
   feature is experimental. Majority of defconfigs enable EXPERIMENTAL
   anyway (90 vs. 4, which, btw, means that EXPERIMENTAL is overused
   in Kconfigs);

2) EXPERIMENTAL is a good thing for features that change default
   behaviour of a kernel, while for hibernation user has to explicitly
   issue 'echo disk > /sys/power/state' to trigger any hibernation bugs;

3) Per init/Kconfig, EXPERIMENTAL is a good thing to scare and discourage
   users from 'widespread use of a feature', while we want to encourage
   that use.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agopowerpc/ps3: Use pr_devel() in ps3/mm.c
Michael Ellerman [Mon, 22 Jun 2009 15:56:39 +0000 (15:56 +0000)]
powerpc/ps3: Use pr_devel() in ps3/mm.c

The non-debug case in ps3/mm.c uses pr_debug(), so that the compiler
still does type checks etc. and doesn't complain about unused
variables in the non-debug case.

However with DEBUG=n and CONFIG_DYNAMIC_DEBUG=y there's still code
generated for those pr_debugs().

size before:
   text    data     bss     dec     hex filename
  17553    4112      88   21753    54f9 arch/powerpc/platforms/ps3/mm.o

size after:
   text    data     bss     dec     hex filename
   7377     776      88    8241    2031 arch/powerpc/platforms/ps3/mm.o

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Acked-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agoConvert /proc/device-tree/ to seq_file
Alexey Dobriyan [Sun, 6 Sep 2009 23:31:25 +0000 (23:31 +0000)]
Convert /proc/device-tree/ to seq_file

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agopowerpc: Cleanup Kconfig selection of hugetlbfs support
Benjamin Herrenschmidt [Fri, 30 Oct 2009 04:03:54 +0000 (15:03 +1100)]
powerpc: Cleanup Kconfig selection of hugetlbfs support

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
14 years agoMerge branch 'bugfix' of git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen
Linus Torvalds [Thu, 29 Oct 2009 22:03:36 +0000 (15:03 -0700)]
Merge branch 'bugfix' of git://git./linux/kernel/git/jeremy/xen

* 'bugfix' of git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen:
  xen: set up mmu_ops before trying to set any ptes

14 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide-2.6
Linus Torvalds [Thu, 29 Oct 2009 16:22:34 +0000 (09:22 -0700)]
Merge git://git./linux/kernel/git/davem/ide-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide-2.6:
  ide: Serialize CMD643 and CMD646 to fix a hardware bug with SSD

14 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
Linus Torvalds [Thu, 29 Oct 2009 16:22:08 +0000 (09:22 -0700)]
Merge git://git./linux/kernel/git/davem/net-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (43 commits)
  net: Fix 'Re: PACKET_TX_RING: packet size is too long'
  netdev: usb: dm9601.c can drive a device not supported yet, add support for it
  qlge: Fix firmware mailbox command timeout.
  qlge: Fix EEH handling.
  AF_RAW: Augment raw_send_hdrinc to expand skb to fit iphdr->ihl (v2)
  bonding: fix a race condition in calls to slave MII ioctls
  virtio-net: fix data corruption with OOM
  sfc: Set ip_summed correctly for page buffers passed to GRO
  cnic: Fix L2CTX_STATUSB_NUM offset in context memory.
  MAINTAINERS: rt2x00 list is moderated
  airo: Reorder tests, check bounds before element
  mac80211: fix for incorrect sequence number on hostapd injected frames
  libertas spi: fix sparse errors
  mac80211: trivial: fix spelling in mesh_hwmp
  cfg80211: sme: deauthenticate on assoc failure
  mac80211: keep auth state when assoc fails
  mac80211: fix ibss joining
  b43: add 'struct b43_wl' missing declaration
  b43: Fix Bugzilla #14181 and the bug from the previous 'fix'
  rt2x00: Fix crypto in TX frame for rt2800usb
  ...

14 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu
Linus Torvalds [Thu, 29 Oct 2009 16:19:29 +0000 (09:19 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/tj/percpu

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu:
  sched: move rq_weight data array out of .percpu
  percpu: allow pcpu_alloc() to be called with IRQs off

14 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-param-fixes
Linus Torvalds [Thu, 29 Oct 2009 16:18:20 +0000 (09:18 -0700)]
Merge git://git./linux/kernel/git/rusty/linux-2.6-param-fixes

* git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-param-fixes:
  param: fix setting arrays of bool
  param: fix NULL comparison on oom
  param: fix lots of bugs with writing charp params from sysfs, by leaking mem.

14 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus
Linus Torvalds [Thu, 29 Oct 2009 16:17:59 +0000 (09:17 -0700)]
Merge git://git./linux/kernel/git/rusty/linux-2.6-for-linus

* git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus:
  virtio: order used ring after used index read
  virtio-pci: fix per-vq MSI-X request logic

14 years agoMerge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
Linus Torvalds [Thu, 29 Oct 2009 16:17:19 +0000 (09:17 -0700)]
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block

* 'for-linus' of git://git.kernel.dk/linux-2.6-block:
  backing-dev: ensure that a removed bdi no longer has super_block referencing it
  block: use after free bug in __blkdev_get
  block: silently error unsupported empty barriers too

14 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes...
Linus Torvalds [Thu, 29 Oct 2009 16:17:02 +0000 (09:17 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/jbarnes/pci-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6:
  Revert "PCI: get larger bridge ranges when space is available"

14 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland...
Linus Torvalds [Thu, 29 Oct 2009 16:16:23 +0000 (09:16 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/roland/infiniband

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband:
  mlx4_core: Add a new supported 40 GigE device ID

14 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6
Linus Torvalds [Thu, 29 Oct 2009 16:16:01 +0000 (09:16 -0700)]
Merge git://git./linux/kernel/git/jejb/scsi-rc-fixes-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6:
  [SCSI] zfcp: Flush SCSI registration work when adding unit
  [SCSI] zfcp: Fix timer initialization for ct and els requests
  [SCSI] zfcp: Warn about storage devices with broken PLOGI data
  [SCSI] zfcp: Handle WWPN mismatch in PLOGI payload
  [SCSI] zfcp: fix kfree handling in zfcp_init_device_setup
  [SCSI] fix memory leak in initialization

14 years agoMerge branch 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied...
Linus Torvalds [Thu, 29 Oct 2009 16:15:02 +0000 (09:15 -0700)]
Merge branch 'drm-fixes' of git://git./linux/kernel/git/airlied/drm-2.6

* 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6:
  drm/kms: fix kms/fbdev colormap support properly.
  drm: Add the basic check for the detailed timing in EDID
  drm/radeon/kms: ignore vga arbiter return.

14 years agoMerge branch 'sh/for-2.6.32' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal...
Linus Torvalds [Thu, 29 Oct 2009 16:07:15 +0000 (09:07 -0700)]
Merge branch 'sh/for-2.6.32' of git://git./linux/kernel/git/lethal/sh-2.6

* 'sh/for-2.6.32' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6:
  sh: Fix hugetlbfs dependencies for SH-3 && MMU configurations.
  sh: Document uImage.bin target in archhelp.
  sh: add uImage.bin target
  sh: rsk7203 CONFIG_MTD=n fix
  sh: Check for return_to_handler when unwinding the stack
  sh: Build fix: define more __movmem* symbols
  sh: __irq_entry annotate do_IRQ().

Fix up sh/powerpc conflicts in fs/Kconfig

14 years agoMerge branch 'bugfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6
Linus Torvalds [Thu, 29 Oct 2009 16:02:24 +0000 (09:02 -0700)]
Merge branch 'bugfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6

* 'bugfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6:
  NFSv4: The link() operation should return any delegation on the file
  NFSv4: Fix two unbalanced put_rpccred() issues.
  NFSv4: Fix a bug when the server returns NFS4ERR_RESOURCE
  nfs: Panic when commit fails

14 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
Linus Torvalds [Thu, 29 Oct 2009 16:02:01 +0000 (09:02 -0700)]
Merge git://git./linux/kernel/git/sfrench/cifs-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6:
  [CIFS] Fixing to avoid invalid kfree() in cifs_get_tcp_session()

14 years agoray_cs: Fix copy_from_user handling
Alan Cox [Tue, 27 Oct 2009 15:35:55 +0000 (15:35 +0000)]
ray_cs: Fix copy_from_user handling

I've not touched the other stuff here but the word "locking" comes to mind.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agodpt_i2o: Fix up copy*user
Alan Cox [Tue, 27 Oct 2009 15:35:35 +0000 (15:35 +0000)]
dpt_i2o: Fix up copy*user

Signed-off-by: Alan Cox <alan@linux.intel.com>
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agoMerge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
Linus Torvalds [Thu, 29 Oct 2009 15:59:06 +0000 (08:59 -0700)]
Merge branch 'merge' of git://git./linux/kernel/git/benh/powerpc

* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc:
  powerpc/ppc64: Use preempt_schedule_irq instead of preempt_schedule
  powerpc: Minor cleanup to lib/Kconfig.debug
  powerpc: Minor cleanup to sound/ppc/Kconfig
  powerpc: Minor cleanup to init/Kconfig
  powerpc: Limit memory hotplug support to PPC64 Book-3S machines
  powerpc: Limit hugetlbfs support to PPC64 Book-3S machines
  powerpc: Fix compile errors found by new ppc64e_defconfig
  powerpc: Add a Book-3E 64-bit defconfig
  powerpc/booke: Fix xmon single step on PowerPC Book-E
  powerpc: Align vDSO base address
  powerpc: Fix segment mapping in vdso32
  powerpc/iseries: Remove compiler version dependent hack
  powerpc/perf_events: Fix priority of MSR HV vs PR bits
  powerpc/5200: Update defconfigs
  drivers/serial/mpc52xx_uart.c: Use UPIO_MEM rather than SERIAL_IO_MEM
  powerpc/boot/dts: drop obsolete 'fsl5200-clocking'
  of: Remove nested function
  mpc5200: support for the MAN mpc5200 based board mucmc52
  mpc5200: support for the MAN mpc5200 based board uc101

14 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6
Linus Torvalds [Thu, 29 Oct 2009 15:44:04 +0000 (08:44 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/sameo/mfd-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6:
  mfd: Do not dereference null pointer in twl4030 error path
  mfd: Always initialise WM831x IRQ mutex

14 years agoMerge branch 'hwpoison-2.6.32' of git://git.kernel.org/pub/scm/linux/kernel/git/ak...
Linus Torvalds [Thu, 29 Oct 2009 15:20:00 +0000 (08:20 -0700)]
Merge branch 'hwpoison-2.6.32' of git://git./linux/kernel/git/ak/linux-mce-2.6

* 'hwpoison-2.6.32' of git://git.kernel.org/pub/scm/linux/kernel/git/ak/linux-mce-2.6:
  HWPOISON: fix invalid page count in printk output
  HWPOISON: Allow schedule_on_each_cpu() from keventd
  HWPOISON: fix/proc/meminfo alignment
  HWPOISON: fix oops on ksm pages
  HWPOISON: Fix page count leak in hwpoison late kill in do_swap_page
  HWPOISON: return early on non-LRU pages
  HWPOISON: Add brief hwpoison description to Documentation
  HWPOISON: Clean up PR_MCE_KILL interface

14 years agoMerge branch 'for-linus' of git://oss.sgi.com/xfs/xfs
Linus Torvalds [Thu, 29 Oct 2009 15:18:25 +0000 (08:18 -0700)]
Merge branch 'for-linus' of git://oss.sgi.com/xfs/xfs

* 'for-linus' of git://oss.sgi.com/xfs/xfs:
  xfs: fix double IRELE in xfs_dqrele_inode

14 years agoMerge branch 'omap-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Thu, 29 Oct 2009 15:16:42 +0000 (08:16 -0700)]
Merge branch 'omap-fixes-for-linus' of git://git./linux/kernel/git/tmlind/linux-omap-2.6

* 'omap-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6:
  omap4: Fix UART4 platform data on omap4
  omap4: Allow omap_serial_early_init() for OMAP4430 board
  omap3: PM: enable UART3 module wakeups
  omap2: Fix console serial port number for n8x0
  omap2: Fix detection of n8x0
  omap1: Fix DSP public peripherals support for ams-delta
  omap1: Fix redundant UARTs pin muxing that can break other hardware support
  omap: iommu: fix wrong condition check for SUPERSECTION
  omap: SDMA: Fix omap_stop_dma() API for channel linking
  omap: Fix omap-keypad by restoring old keypad.h without breaking omap2 boards that use matrix_keypad

14 years agoMerge branch 'for-linus' of git://git.infradead.org/ubi-2.6
Linus Torvalds [Thu, 29 Oct 2009 15:15:34 +0000 (08:15 -0700)]
Merge branch 'for-linus' of git://git.infradead.org/ubi-2.6

* 'for-linus' of git://git.infradead.org/ubi-2.6:
  UBI: fix check on unsigned long
  UBI: fix backward compatibility

14 years agoMerge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelv...
Linus Torvalds [Thu, 29 Oct 2009 15:14:58 +0000 (08:14 -0700)]
Merge branch 'hwmon-for-linus' of git://git./linux/kernel/git/jdelvare/staging

* 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
  hwmon: (it87) Fix VID reading on IT8718F/IT8720F
  hwmon: (dme1737) No vid attributes for SCH311x
  hwmon: (fschmd) Fix check on unsigned in watchdog_write()
  hwmon: (coretemp) Maintainer update

14 years agoMerge branch 'urgent-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmci...
Linus Torvalds [Thu, 29 Oct 2009 15:14:14 +0000 (08:14 -0700)]
Merge branch 'urgent-v2' of git://git./linux/kernel/git/brodo/pcmcia-2.6

* 'urgent-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6:
  pcmcia: do not load the pd6729 driver if io_base is NULL
  pcmcia: Fix possible printk format warnings
  pcmcia: do not try to store more than 4 version strings
  pcmcia: pccard_read_tuple and TUPLE_RETURN_COMMON cleanup
  pcmcia: properly close previous dev_printk if kzalloc fails in do_io_probe
  pcmcia: fix controller printk format warnings

14 years agoMerge master.kernel.org:/home/rmk/linux-2.6-arm
Linus Torvalds [Thu, 29 Oct 2009 15:13:03 +0000 (08:13 -0700)]
Merge master.kernel.org:/home/rmk/linux-2.6-arm

* master.kernel.org:/home/rmk/linux-2.6-arm: (22 commits)
  ARM: Fix lubbock defconfig build
  ARM: 5769/1: CPU_ARM920T: remove dead Maverick EP9312 URL
  ARM: 5768/1: ep93xx: remove dead code in ep93xx_gpio_ab_irq_handler()
  ARM: 5767/1: ep93xx: remove ep93xx_init_time() prototype
  ARM: 5765/1: Updated U300 defconfig
  ARM: 5766/1: Fix watchdog enabling for AT91SAM9G45
  ARM: 5764/1: bcmring: add oprofile pmu support
  [ARM] pxa/spitz: add gpio button support (fixes regression)
  [ARM] pxa/cm-x300: fix mmc numbering
  ARM: 5763/1: ARM: SMP: Fix the BUG with CONFIG_PREEMPT enabled
  ARM: 5760/1: ep93xx: fix build error in edb93xx.c
  ARM: 5759/1: Add register information of threads to coredump
  ARM: 5757/1: Thumb-2: Correct "mov.w pc, lr" instruction which is unpredictable
  MXC: fix reset for mx31, mx35 and mx27 SoCs
  fix pcm037_eet compilation with the new SPI driver
  fix compilation of i.MX31 platforms
  pcm970 mmc: Fix ro switch
  pcm038: Add SPI/MC13783 support
  mx25: Add missing copyright / license header
  mx25pdk: remove nand support as it is not present in current tree
  ...

14 years agoMerge branch 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Thu, 29 Oct 2009 15:12:20 +0000 (08:12 -0700)]
Merge branch 'core-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  futex: Move drop_futex_key_refs out of spinlock'ed region
  rcu: Fix TREE_PREEMPT_RCU CPU_HOTPLUG bad-luck hang
  rcu: Stopgap fix for synchronize_rcu_expedited() for TREE_PREEMPT_RCU
  rcu: Prevent RCU IPI storms in presence of high call_rcu() load
  futex: Check for NULL keys in match_futex
  futex: Handle spurious wake up

14 years agoMerge branch 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Thu, 29 Oct 2009 15:12:00 +0000 (08:12 -0700)]
Merge branch 'perf-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  perf timechart: Improve the visual appearance of scheduler delays
  perf timechart: Fix the wakeup-arrows that point to non-visible processes
  perf top: Fix --delay_secs 0 division by zero
  perf tools: Bump version to 0.0.2
  perf_event: Adjust frequency and unthrottle for non-group-leader events

14 years agoMerge branch 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Thu, 29 Oct 2009 15:10:38 +0000 (08:10 -0700)]
Merge branch 'sched-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  sched: Do less agressive buddy clearing
  sched: Disable SD_PREFER_LOCAL for MC/CPU domains

14 years agoMerge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Thu, 29 Oct 2009 15:10:26 +0000 (08:10 -0700)]
Merge branch 'x86-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  x86, UV: Set DELIVERY_MODE=4 for vector=NMI_VECTOR in uv_hub_send_ipi()
  x86, UV: Fix and clean up bau code to use uv_gpa_to_pnode()
  x86: Don't print number of MCE banks for every CPU
  x86, UV: Fix information in __uv_hub_info structure
  x86: Document linker script ASSERT() quirk

14 years agofrv: fix check on unsigned in do_signal()
Roel Kluin [Mon, 26 Oct 2009 23:50:23 +0000 (16:50 -0700)]
frv: fix check on unsigned in do_signal()

syscallno is unsigned

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agomm: don't call pte_unmap() against an improper pte
Daisuke Nishimura [Mon, 26 Oct 2009 23:50:23 +0000 (16:50 -0700)]
mm: don't call pte_unmap() against an improper pte

There are some places where we do like:

pte = pte_map();
do {
(do break in some conditions)
} while (pte++, ...);
pte_unmap(pte - 1);

But if the loop breaks at the first loop, pte_unmap() unmaps invalid pte.

This patch is a fix for this problem.

Signed-off-by: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Reviewd-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Acked-by: Hugh Dickins <hugh.dickins@tiscali.co.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agolis3: add support for the HP HDX 18
Ian E. Morgan [Mon, 26 Oct 2009 23:50:21 +0000 (16:50 -0700)]
lis3: add support for the HP HDX 18

I have an HP HDX 18 laptop, and noted that the configuration of the
accelerometer needs to be x_inverted.

Signed-off-by: Ian E. Morgan <penguin.wrangler@gmail.com>
Signed-off-by: Éric Piel <eric.piel@tremplin-utc.net>
Cc: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agolis3: add support for the HP EliteBook 8530w
Éric Piel [Mon, 26 Oct 2009 23:50:20 +0000 (16:50 -0700)]
lis3: add support for the HP EliteBook 8530w

Correct orientation for  HP EliteBook 8530w.

Reported-by: Jörgen Jonssson <jorgen.jonsson@saitek.se>
Signed-off-by: Éric Piel <eric.piel@tremplin-utc.net>
Cc: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agolis3: better support for hp 6730x
Pavel Herrmann [Mon, 26 Oct 2009 23:50:19 +0000 (16:50 -0700)]
lis3: better support for hp 6730x

I have learned that the 6730b and 6730s have different accelerometer
orientation, and have modified the driver accordingly (diff attached),
while dropping the wild guess for AMD based 6735 having the same
orientation as Intel based 6730 (this is not true for any other related
series/family, thus is not probable for 673x).

Signed-off-by: Pavel Herrmann <morpheus.ibis@gmail.com>
Signed-off-by: Éric Piel <eric.piel@tremplin-utc.net>
Cc: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agocpuidle: always return with interrupts enabled
Kevin Hilman [Mon, 26 Oct 2009 23:50:18 +0000 (16:50 -0700)]
cpuidle: always return with interrupts enabled

In the case where cpuidle_idle_call() returns before changing state due to
a need_resched(), it was returning with IRQs disabled.

The idle path assumes that the platform specific idle code returns with
interrupts enabled (although this too is undocumented AFAICT) and on ARM
we have a WARN_ON(!(irqs_disabled()) when returning from the idle loop, so
the user-visible effects were only a warning since interrupts were
eventually re-enabled later.

On x86, this same problem exists, but there is no WARN_ON() to detect it.
As on ARM, the interrupts are eventually re-enabled, so I'm not sure of
any actual bugs triggered by this.  It's primarily a
correctness/consistency fix.

This patch ensures IRQs are (re)enabled before returning.

Reported-by: Hemanth V <hemanthv@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Cc: Arjan van de Ven <arjan@linux.intel.com>
Cc: Len Brown <len.brown@intel.com>
Cc: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Tested-by: Martin Michlmayr <tbm@cyrius.com>
Cc: <stable@kernel.org> [2.6.31.x]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agocheckpatch: version 0.30
Andy Whitcroft [Mon, 26 Oct 2009 23:50:17 +0000 (16:50 -0700)]
checkpatch: version 0.30

Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agocheckpatch: fix false EXPORT_SYMBOL warning
Andy Whitcroft [Mon, 26 Oct 2009 23:50:16 +0000 (16:50 -0700)]
checkpatch: fix false EXPORT_SYMBOL warning

Ingo reported that the following lines triggered a false warning,

static struct lock_class_key rcu_lock_key;
struct lockdep_map rcu_lock_map =
        STATIC_LOCKDEP_MAP_INIT("rcu_read_lock", &rcu_lock_key);
EXPORT_SYMBOL_GPL(rcu_lock_map);

from kernel/rcutree.c , and the false warning looked like this,

WARNING: EXPORT_SYMBOL(foo); should immediately follow its
function/variable
+EXPORT_SYMBOL_GPL(rcu_lock_map);

We actually should be checking the statement before the EXPORT_* for a
mention of the exported object, and complain where it is not there.

[akpm@linux-foundation.org: coding-style fixes]
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reported-by: Daniel Walker <dwalker@fifo99.com>
Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agocheckpatch: fix __attribute__ matching
Andy Whitcroft [Mon, 26 Oct 2009 23:50:15 +0000 (16:50 -0700)]
checkpatch: fix __attribute__ matching

In the following code,

union thread_union init_thread_union
__attribute__((__section__(".data.init_task"))) =
{ INIT_THREAD_INFO(init_task) };

There is a non-conforming declaration. It should really be like the
following,

union thread_union init_thread_union
__attribute__((__section__(".data.init_task"))) = {
INIT_THREAD_INFO(init_task)
};

However, checkpatch doesn't catch this right now because it doesn't
correctly evaluate the "__attribute__".

It is not at all clear that we care what preceeds an assignment style
attribute when we find the open brace.  Relax the test so we do not need
to check the __attribute__.

Reported-by: Daniel Walker <dwalker@fifo99.com>
Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agocheckpatch: fix false errors due to macro concatenation
Andy Whitcroft [Mon, 26 Oct 2009 23:50:14 +0000 (16:50 -0700)]
checkpatch: fix false errors due to macro concatenation

The macro concatenation (##) sequence can cause false errors when checking
macro's.  Checkpatch doesn't currently know about the operator.

For example this line,

+  entry = (struct ftrace_raw_##call *)raw_data;                   \

is correct but it produces the following error,

ERROR: need consistent spacing around '*' (ctx:WxB)
+       entry = (struct ftrace_raw_##call *)raw_data;\
                                          ^

The line above doesn't have any spacing problems, and if you remove the
macro concatenation sequence checkpatch doesn't give any errors.

Extend identifier handling to include ## concatenation within the
definition of an identifier.

Reported-by: Daniel Walker <dwalker@fifo99.com>
Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agocheckpatch: update copyright dates
Andy Whitcroft [Mon, 26 Oct 2009 23:50:14 +0000 (16:50 -0700)]
checkpatch: update copyright dates

Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agocheckpatch: correctly stop scanning at the bottom of a hunk
Andy Whitcroft [Mon, 26 Oct 2009 23:50:13 +0000 (16:50 -0700)]
checkpatch: correctly stop scanning at the bottom of a hunk

We are allowing context scanning checks to apply against the first line of
context outside at the end of the hunk.  This can lead to false matches to
patch names leading to various perl warnings.  Correctly stop at the
bottom of the hunk.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agocheckpatch: possible types -- prevent illegal modifiers being added
Andy Whitcroft [Mon, 26 Oct 2009 23:50:12 +0000 (16:50 -0700)]
checkpatch: possible types -- prevent illegal modifiers being added

Prevent known non types being detected as modifiers.  Ensure we do not
look at any type which starts with a keyword.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agomm: fix sparsemem configuration
Russell King [Mon, 26 Oct 2009 23:50:12 +0000 (16:50 -0700)]
mm: fix sparsemem configuration

Currently, sparsemem is only available if EXPERIMENTAL is enabled.
However, it hasn't ever been marked experimental.

It's been about four years since sparsemem was merged, and we have
platforms which depend on it; allow architectures to decide whether
sparsemem should be the default memory model.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agoedac: i5100 fix initialization code
Keith Mannthey [Mon, 26 Oct 2009 23:50:11 +0000 (16:50 -0700)]
edac: i5100 fix initialization code

Allow csrows to properly initialize when the topology only has active
channels on 2 and 3.  This new check allows proper detection and
initialization in this topology.  Only checking the first mrt that
represented channels 0 and 1 is not sufficient.

I also fixed up the related debug information path.  I can submit as a 2nd
patch if needed.

Signed-off-by: Keith Mannthey <kmannth@us.ibm.com>
Acked-by: Aristeu Rozanski <aris@ruivo.org>
Signed-off-by: Doug Thompson <dougthompson@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>