Commit Graph

25165 Commits (12b7a1523eda9cd72362fdda928ddb995ecdc06d)

Author SHA1 Message Date
David Howells 02c3638089 MN10300: Wire up new system calls
Wire up system calls added in the last merge window for the MN10300 arch.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-08-01 13:03:48 -07:00
Linus Torvalds 84ff7a0012 Merge branch 'kvm-updates-2.6.27' of git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm
* 'kvm-updates-2.6.27' of git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm:
  KVM: s390: Fix kvm on IBM System z10
  KVM: Advertise synchronized mmu support to userspace
  KVM: Synchronize guest physical memory map to host virtual memory map
  KVM: Allow browsing memslots with mmu_lock
  KVM: Allow reading aliases with mmu_lock
2008-08-01 12:48:16 -07:00
Paul Mundt 9e5e21170e sh: Fix up the audit arch endian specification.
Presently this was always being set to AUDIT_ARCH_SH, which assumes
big endian. Fix this up so that the architecture actually reflects
what we're running on.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-08-02 04:39:33 +09:00
Paul Mundt ab99c733ae sh: Make syscall tracer use tracehook notifiers, add TIF_NOTIFY_RESUME.
This follows the changes in commits:

7d6d637dac
4f72c4279e

on powerpc. Adding in TIF_NOTIFY_RESUME, and cleaning up the syscall
tracing to be more generic. This is an incremental step to turning
on tracehook, as well as unifying more of the ptrace and signal code
across the 32/64 split.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-08-02 04:39:33 +09:00
Paul Mundt c459dbf294 sh: ptrace single stepping cleanups.
This converts the single stepping done by sh/sh64 ptrace implementations
to use the generic user_enable/disable_single_step(), and subsequently
rips out a lot of ptrace request cases that are now handled generically.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-08-02 04:39:33 +09:00
Paul Mundt c4637d4751 sh: seccomp support.
This hooks up the seccomp thread flag and associated callback from the
syscall tracer.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-08-02 04:39:32 +09:00
Paul Mundt cec3fd3e2a sh: Tidy up the _TIF work masks, and fix syscall trace bug on singlestep.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-08-02 04:39:32 +09:00
Simon Horman daf423db3b kdump: sh: parse elfcorehdr command line argument
A quick cut and paste from other architectures to allow SH
to parse the elfcorehdr command line argument which is required
for both is_kdump_kernel() and vmcore to function.
(the former is as yet unused on SH).

Tested compilation only

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-08-02 04:39:32 +09:00
Martin Schwidefsky c6557e7f2b [S390] move include/asm-s390 to arch/s390/include/asm
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2008-08-01 20:42:05 +02:00
Linus Torvalds 9a5467fd60 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (46 commits)
  tcp: MD5: Fix IPv6 signatures
  skbuff: add missing kernel-doc for do_not_encrypt
  net/ipv4/route.c: fix build error
  tcp: MD5: Fix MD5 signatures on certain ACK packets
  ipv6: Fix ip6_xmit to send fragments if ipfragok is true
  ipvs: Move userspace definitions to include/linux/ip_vs.h
  netdev: Fix lockdep warnings in multiqueue configurations.
  netfilter: xt_hashlimit: fix race between htable_destroy and htable_gc
  netfilter: ipt_recent: fix race between recent_mt_destroy and proc manipulations
  netfilter: nf_conntrack_tcp: decrease timeouts while data in unacknowledged
  irda: replace __FUNCTION__ with __func__
  nsc-ircc: default to dongle type 9 on IBM hardware
  bluetooth: add quirks for a few hci_usb devices
  hysdn: remove the packed attribute from PofTimStamp_tag
  isdn: use the common ascii hex helpers
  tg3: adapt tg3 to use reworked PCI PM code
  atm: fix direct casts of pointers to u32 in the InterPhase driver
  atm: fix const assignment/discard warnings in the ATM networking driver
  net: use the common ascii hex helpers
  random32: seeding improvement
  ...
2008-08-01 11:35:16 -07:00
Linus Torvalds 623fa579e6 Merge git://git.infradead.org/mtd-2.6
* git://git.infradead.org/mtd-2.6:
  [MTD] [NAND] drivers/mtd/nand/nandsim.c: fix printk warnings
  [MTD] [NAND] Blackfin NFC Driver: Cleanup the error exit path of bf5xx_nand_probe function
  [MTD] [NAND] Blackfin NFC Driver: use standard dev_err() rather than printk()
  [MTD] [NAND] Blackfin NFC Driver: enable Blackfin nand HWECC support by default
  [MTD] [NAND] Blackfin NFC Driver: add proper devinit/devexit markings to probe/remove functions
  [MTD] [NAND] Blackfin NFC Driver: add support for the ECC layout the Blackfin bootrom uses
  [MTD] [NAND] Blackfin NFC Driver: fix bug - hw ecc calc by making sure we extract 11 bits from each register instead of 10
  [MTD] [NAND] Blackfin NFC Driver: fix bug - do not clobber the status from the first 256 bytes if operating on 512 pages
  [MTD] [NAND] diskonchip.c fix sparse endian warnings
  [MTD] [NAND] drivers/mtd/nand/nandsim.c needs div64.h
  [JFFS2] Fix allocation of summary buffer
  Fix rename of at91_nand -> atmel_nand
  [MTD] [NOR] drivers/mtd/chips/jedec_probe.c: fix Am29DL800BB device ID
  [MTD] MTD_DEBUG always does compile-time typechecks
  [MTD] DataFlash: bugfix, binary page sizes now handled
  [MTD] [NAND] fsl_elbc_nand.c: fix printk warning
  [MTD] [NAND] nandsim: support random page read command
  [MTD] [NAND] fix subpage read for small page NAND
2008-08-01 11:29:54 -07:00
Linus Torvalds 561b35b341 Merge branch 'reg-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6
* 'reg-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6:
  regulator: TI bq24022 Li-Ion Charger driver
  regulator: maintainers - add maintainers for regulator framework.
  regulator: documentation - ABI
  regulator: documentation - machine
  regulator: documentation - regulator driver
  regulator: documentation - consumer interface
  regulator: documentation - overview
  regulator: core kbuild files
  regulator: regulator test harness
  regulator: add support for fixed regulators.
  regulator: regulator framework core
  regulator: fixed regulator interface
  regulator: machine driver interface
  regulator: regulator driver interface
  regulator: consumer device interface
2008-08-01 10:56:40 -07:00
Linus Torvalds 00e9028a95 Merge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6: (28 commits)
  mm/hugetlb.c must #include <asm/io.h>
  video: Fix up hp6xx driver build regressions.
  sh: defconfig updates.
  sh: Kill off stray mach-rsk7203 reference.
  serial: sh-sci: Fix up SH7760/SH7780/SH7785 early printk regression.
  sh: Move out individual boards without mach groups.
  sh: Make sure AT_SYSINFO_EHDR is exposed to userspace in asm/auxvec.h.
  sh: Allow SH-3 and SH-5 to use common headers.
  sh: Provide common CPU headers, prune the SH-2 and SH-2A directories.
  sh/maple: clean maple bus code
  sh: More header path fixups for mach dir refactoring.
  sh: Move out the solution engine headers to arch/sh/include/mach-se/
  sh: I2C fix for AP325RXA and Migo-R
  sh: Shuffle the board directories in to mach groups.
  sh: dma-sh: Fix up dreamcast dma.h mach path.
  sh: Switch KBUILD_DEFCONFIG to shx3_defconfig.
  sh: Add ARCH_DEFCONFIG entries for sh and sh64.
  sh: Fix compile error of Solution Engine
  sh: Proper __put_user_asm() size mismatch fix.
  sh: Stub in a dummy ENTRY_OFFSET for uImage offset calculation.
  ...
2008-08-01 10:53:43 -07:00
Linus Torvalds 57b1494d2b Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/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:
  generic, x86: fix add iommu_num_pages helper function
  x86: remove stray <6> in BogoMIPS printk
  x86: move dma32_reserve_bootmem() after reserve_crashkernel()
2008-08-01 10:28:17 -07:00
Linus Torvalds 9fe3b64be3 Merge branch 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6
* 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6:
  [S390] qeth: avoid use of include/asm-s390
  [S390] dont use kthread for smp_rescan_cpus().
  [S390] virtio console: fix section mismatch warning.
  [S390] cio: Include linux/string.h in schid.h.
  [S390] qdio: fix section mismatch bug.
  [S390] stp: fix section mismatch warning.
  [S390] Remove diag 0x260 call from memory detection.
  [S390] qdio: make sure qdr is aligned to page size
  [S390] Add support for memory hot-remove.
  [S390] Wire up new syscalls.
  [S390] cio: Memory allocation for idset changed.
  [S390] qeth: preallocated qeth header for hiper socket
  [S390] Optimize storage key operations for anon pages
  [S390] nohz/sclp: disable timer on synchronous waits.
  [S390] ipl: Reboot from alternate device does not work when booting from file
  [S390] dasd: Add support for enhanced VM UID
  [S390] Remove last P390 trace.
2008-08-01 10:27:10 -07:00
Tony Luck 7f30491ccd [IA64] Move include/asm-ia64 to arch/ia64/include/asm
After moving the the include files there were a few clean-ups:

1) Some files used #include <asm-ia64/xyz.h>, changed to <asm/xyz.h>

2) Some comments alerted maintainers to look at various header files to
make matching updates if certain code were to be changed. Updated these
comments to use the new include paths.

3) Some header files mentioned their own names in initial comments. Just
deleted these self references.

Signed-off-by: Tony Luck <tony.luck@intel.com>
2008-08-01 10:21:21 -07:00
Heiko Carstens 8f84700325 [S390] stp: fix section mismatch warning.
Fix these two (false positive) warnings by adding an __init annoation:

WARNING: vmlinux.o(.text+0x7e6a): Section mismatch in reference from the function stp_reset() to the function .init.text:__alloc_bootmem()
The function stp_reset() references
the function __init __alloc_bootmem().
This is often because stp_reset lacks a __init
annotation or the annotation of __alloc_bootmem is wrong.

WARNING: vmlinux.o(.text+0x7ece): Section mismatch in reference from the function stp_reset() to the function .init.text:free_bootmem()
The function stp_reset() references
the function __init free_bootmem().
This is often because stp_reset lacks a __init
annotation or the annotation of free_bootmem is wrong.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2008-08-01 16:39:34 +02:00
Heiko Carstens d918fe2bd7 [S390] Remove diag 0x260 call from memory detection.
The result of the diag 0x260 call is not always what one would expect.
So just remove it.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2008-08-01 16:39:34 +02:00
Gerald Schaefer 7e9238fbc1 [S390] Add support for memory hot-remove.
This patch enables memory hot-remove on s390.

Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
2008-08-01 16:39:33 +02:00
Heiko Carstens 519620cc3d [S390] Wire up new syscalls.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2008-08-01 16:39:32 +02:00
Heiko Carstens 934b2857cc [S390] nohz/sclp: disable timer on synchronous waits.
sclp_sync_wait wait synchronously for an sclp interrupt and disables
timer interrupts. However on the irq enter paths there is an extra
check if a timer interrupt would be due and calls the timer callback.
This would schedule softirqs in the wrong context.
So introduce local_tick_enable/disable which prevents this.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2008-08-01 16:39:30 +02:00
Michael Holzheu 3a95e8eb34 [S390] ipl: Reboot from alternate device does not work when booting from file
During startup we check if diag308 works using diag 308 subcode 6,
which stores the actual ipl information. This fails with rc = 0x102, if
the system has been ipled from the HMC using load from CD or load from file.
In the case of rc = 0x102 we have to assume that diag 308 is working,
since it still can be used to ipl from an alternative device.

Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2008-08-01 16:39:30 +02:00
Pieter du Preez f6ed6f78d4 Fix rename of at91_nand -> atmel_nand
Structs called at91_nand_data where renamed to atmel_nand_data
and configs called *MTD_NAND_AT91* where renamed to
*MTD_NAND_ATMEL*. This was unfortunately not done consistently,
causing NAND chips not being initialised on several ARM boards.

I am aware that the author of the original change did not rename
MTD_NAND_AT91_BUSWIDTH to MTD_NAND_ATMEL_BUSWIDTH, for example.
All *MTD_NAND_AT91* where renamed to *MTD_NAND_ATMEL* in order
to keep naming consistency.

This patch was only tested on a MACH_SAM9_L9260, as this is the
only ARM board I have to my disposal.

Before this patch:

$ git-ls-files |xargs grep atmel_nand |wc -l
105
$ git-ls-files |xargs grep at91_nand |wc -l
4
$ git-ls-files |xargs grep MTD_NAND_ATMEL |wc -l
8
$ git-ls-files |xargs grep MTD_NAND_AT91 |wc -l
47

After this patch:

$ git-ls-files |xargs grep atmel_nand |wc -l
109
$ git-ls-files |xargs grep at91_nand |wc -l
0
$ git-ls-files |xargs grep MTD_NAND_ATMEL |wc -l
55
$ git-ls-files |xargs grep MTD_NAND_AT91 |wc -l
0

Signed-off-by: Pieter du Preez <pdupreez@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2008-08-01 10:06:40 +01:00
David S. Miller 0a4949c441 sparc64: Do not clobber %g7 in setcontext() trap.
That's the userland thread register, so we should never try to change
it like this.

Based upon glibc bug nptl/6577 and suggestions by Jakub Jelinek.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-07-31 20:40:46 -07:00
David S. Miller dbf3e95067 sparc64: Kill __show_regs().
The story is that what we used to do when we actually used
smp_report_regs() is that if you specifically only wanted to have the
current cpu's registers dumped you would call "__show_regs()"
otherwise you would call show_regs() which also invoked
smp_report_regs().

Now that we killed off smp_report_regs() there is no longer any
reason to have these two routines, just show_regs() is sufficient.

Also kill off a stray declaration of show_regs() in sparc64_ksym.c

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-07-31 20:33:43 -07:00
David S. Miller 6717c282e4 sparc: Add __KERNEL__ ifdef protection to pt_regs helpers.
Some of them use 'bool' and whatnot and therefore are not
kosher for userspace, so don't export them there.

Reported by Roland McGrath.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-07-31 20:32:35 -07:00
Christian Borntraeger 1f4170e12d KVM: s390: Fix kvm on IBM System z10
The z10 system supports large pages, kvm-s390 doesnt.
Make sure that we dont advertise large pages to avoid the guest crashing as
soon as the guest kernel activates DAT.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
2008-07-31 11:57:18 +03:00
David S. Miller 9c636e30a3 sparc64: Kill smp_report_regs().
All the call sites are #if 0'd out and we have a much more
useful global cpu dumping facility these days.  smp_report_regs()
is way too verbose to be usable.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-07-31 01:06:02 -07:00
David S. Miller a014821340 sparc64: Kill VERBOSE_SHOWREGS code.
It just clutters everything up and even though I wrote that hack I
can't remember having used it in the last 5 years or so.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-07-31 00:58:35 -07:00
David S. Miller 09ee167cbf sparc64: Hook up trigger_all_cpu_backtrace().
We already have code that does this, but it is only currently attached
to sysrq-'y'.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-07-30 22:35:00 -07:00
David S. Miller 5afe27380b sparc64: Make global reg dumping even more useful.
Record one more level of stack frame program counter.

Particularly when lockdep and all sorts of spinlock debugging is
enabled, figuring out the caller of spin_lock() is difficult when the
cpu is stuck on the lock.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-07-30 21:57:59 -07:00
David S. Miller e62112c53a Merge branch 'upstream-davem' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6 2008-07-30 15:44:30 -07:00
Mikael Pettersson d72609e17f sparc64: FUTEX_OP_ANDN fix
Correct sparc64's implementation of FUTEX_OP_ANDN to do a
bitwise negate of the oparg parameter before applying the
AND operation. All other archs that support FUTEX_OP_ANDN
either negate oparg explicitly (frv, ia64, mips, sh, x86),
or do so indirectly by using an and-not instruction (powerpc).
Since sparc64 has and-not, I chose to use that solution.

I've not found any use of FUTEX_OP_ANDN in glibc so the
impact of this bug is probably minor. But other user-space
components may try to use it so it should still get fixed.

Signed-off-by: Mikael Pettersson <mikpe@it.uu.se>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-07-30 15:40:50 -07:00
Yoichi Yuasa de1d7bb638 [MIPS] Cobalt: update defconfig
Select new LCD framebuffer driver.

Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2008-07-30 21:54:43 +01:00
Jason Wessel 8854700115 [MIPS] kgdb: add arch support for the kernel's kgdb core
The new kgdb architecture specific handler registers and unregisters
dynamically for exceptions depending on when you configure a kgdb I/O
driver.

Aside from initializing the exceptions earlier in the boot process,
kgdb should have no impact on a device when it is compiled in so long
as an I/O module is not configured for use.

There have been quite a number of contributors during the existence of
this patch (see arch/mips/kernel/kgdb.c).  Most recently Jason
re-wrote the mips kgdb logic to use the die notification handlers.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2008-07-30 21:54:42 +01:00
Jason Wessel 8d60a903d9 [MIPS] kgdb: Remove existing implementation
This patch explicitly removes the kgdb implementation, for mips which
is intended to be followed by a patch that adds a kgdb implementation
for MIPS that makes use of the kgdb core in the kernel.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2008-07-30 21:54:42 +01:00
Atsushi Nemoto 8f8da9adeb [MIPS] TXx9: Kconfig cleanup
Unify some entries in txx9/Kconfig.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2008-07-30 21:54:41 +01:00
Atsushi Nemoto e352953ce0 [MIPS] TXx9: Support early_printk
Kill jmr3927-specific prom_putchar and add txx9-generic prom_putchar
to support early_printk.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2008-07-30 21:54:41 +01:00
Atsushi Nemoto 7779a5e07d [MIPS] TXx9: Unify serial_txx9 setup
* Unify calling of early_serial_txx9_setup.
* Use dedicated serial clock on RBTX4938.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2008-07-30 21:54:40 +01:00
Atsushi Nemoto bb72f1f729 [MIPS] TXx9: Random cleanup
* Random cleanups spotted by checkpatch script.
* Do not initialize panic_timeout.  "panic=" kernel parameter can be used.
* Do not add "ip=any" or "ip=bootp".  This options is not board specific.
* Do not add "root=/dev/nfs".  This is default on CONFIG_ROOT_NFS.
* Kill unused error checking.
* Fix IRQ comment to match current code.
* Kill some unneeded includes
* ST0_ERL is already cleared in generic code.
* conswitchp is initialized generic code.
* __init is not needed in prototype.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2008-07-30 21:54:40 +01:00
Atsushi Nemoto c49f91f51e [MIPS] TXx9: Make tx4938-specific code more independent
Make some TX4938 SoC specific code independent from board specific code.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2008-07-30 21:54:39 +01:00
Atsushi Nemoto f6727fb889 [MIPS] TXx9: Make tx3927-specific code more independent
Make some TX3927 SoC specific code independent from board specific code.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2008-07-30 21:54:39 +01:00
Atsushi Nemoto 683147254e [MIPS] TXx9: Cleanup watchdog
Unify registration of txx9wdt platform device.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2008-07-30 21:54:39 +01:00
Atsushi Nemoto a49297e8fc [MIPS] TXx9: Cleanup restart/halt/power_off
Unify machine_restart/machine_halt/pm_power_off and add fallback
machine_halt routine.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2008-07-30 21:54:38 +01:00
Atsushi Nemoto 455cc256eb [MIPS] TXx9: PCI error handling
From: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Date: Thu, 24 Jul 2008 00:25:16 +0900
Subject: [PATCH] txx9: PCI error handling

Add more control and detailed report on PCI error interrupt.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2008-07-30 21:54:38 +01:00
Atsushi Nemoto 0751752922 [MIPS] TXx9: Add some pci options
Add pci options for backplane type, clock selection, error handling,
timeout values.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2008-07-30 21:54:38 +01:00
Atsushi Nemoto 47a5c97648 [MIPS] Introduce pcibios_plat_setup
Introduce pcibios_plat_setup for platform-specific pcibios_setup.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2008-07-30 21:54:36 +01:00
Atsushi Nemoto 32d00d0f93 [MIPS] TXx9: PCI fixes for tx3927/tx4927
* Fix tx3927 pci ops for Type-1 configuration
* Fix abort checking of tx3927 pci ops
* Flush write buffer to avoid spurious PCI error interrupt
* Add a quirk for FPCIB backplane

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2008-07-30 21:54:35 +01:00
Atsushi Nemoto a0e31fb090 [MIPS] TXx9: Fix JMR3927 irq numbers
* Fix wrong txx9_clockevent interrupt number
* Fix TXX9_IRQ_BASE for JMR3927+FPCIB case

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2008-07-30 21:54:34 +01:00
Adrian Bunk 8b32d6d00c [MIPS] RB532: Flags are unsigned long
A recent generic change now catches such bugs:

<--  snip  -->

...
  CC      arch/mips/rb532/time.o
cc1: warnings being treated as errors
/home/bunk/linux/kernel-2.6/git/linux-2.6/arch/mips/rb532/time.c: In function 'plat_time_init':
/home/bunk/linux/kernel-2.6/git/linux-2.6/arch/mips/rb532/time.c:55: error: comparison of distinct pointer types lacks a cast
/home/bunk/linux/kernel-2.6/git/linux-2.6/arch/mips/rb532/time.c:66: error: comparison of distinct pointer types lacks a cast
make[2]: *** [arch/mips/rb532/time.o] Error 1

<--  snip  -->

Reported-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2008-07-30 21:54:34 +01:00
Kevin Hickey fd7ccfa7ac [MIPS] Initialization of Alchemy boards
An earlier update changed some calls from simple_strotl to strict_strtol but
did not account for the differences in the syntax between the calls.
simple_strotl returns the integer; strict_strtol returns an error code and
takes a pointer to the result.  As it was, NULL was being passed in place of
the result, which led to failures during kernel initialization when using
YAMON.

Signed-off-by: Kevin Hickey <khickey@rmicorp.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2008-07-30 21:54:34 +01:00
Ralf Baechle af6dc22b03 [MIPS] tlb-r4k: Nuke broken paranoia error test.
Bug originally found and reported by Julia Lawall <julia@diku.dk>.  I
decieded that the whole error check was mostly useless paranoia and should
be discarded.  It would only ever trigger if r3k_have_wired_reg has a wrong
value.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2008-07-30 21:54:33 +01:00
Russell King b962a286e5 [ARM] initrd: claim initrd memory exclusively
Claim the initrd memory exclusively, and order other memory
reservations beforehand.  This allows us to determine whether
the initrd memory was overwritten, and disable the initrd in
that case.

This avoids a 'bad page state' bug.

Tested-by: Ralph Siemsen <ralphs@netwinder.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-07-30 21:24:56 +01:00
Linus Torvalds 660fc1f4d8 Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc:
  powerpc/mm: Lockless get_user_pages_fast() for 64-bit (v3)
  powerpc: Don't use the wrong thread_struct for ptrace get/set VSX regs
  powerpc: Fix ptrace buffer size for VSX
  powerpc: Correctly hookup PTRACE_GET/SETVSRREGS for 32 bit processes
  ide/powermac: Fix use of uninitialized pointer on media-bay
  powerpc: Allow non-hcall return values for lparcfg writes
  ipmi/powerpc: Use linux/of_{device,platform}.h instead of asm
  powerpc/fsl: proliferate simple-bus compatibility to soc nodes
  Documentation: remove old sbc8260 board specific information
  cpm2: Rework baud rate generators configuration to support external clocks.
  powerpc: rtc_cmos_setup: assign interrupts only if there is i8259 PIC
  cpm_uart: Add generic clock API support to set baudrates
  cpm_uart: Modem control lines support
  powerpc: implement GPIO LIB API on CPM1 Freescale SoC.
  cpm2: Implement GPIO LIB API on CPM2 Freescale SoC.
  powerpc: Fix 8xx build failure
  powerpc: clean up the Book-E HW watchpoint support
2008-07-30 10:43:56 -07:00
Vitaly Mayatskikh afd962a9e8 x86: wrong register was used in align macro
New ALIGN_DESTINATION macro has sad typo: r8d register was used instead
of ecx in fixup section. This can be considered as a regression.

Register ecx was also wrongly loaded with value in r8d in
copy_user_nocache routine.

Signed-off-by: Vitaly Mayatskikh <v.mayatskih@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-30 10:10:39 -07:00
Jack Steiner 0d39741a27 GRU Driver: export is_uv_system(), zap_page_range() & follow_page()
Exports needed by the GRU driver.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-30 09:41:48 -07:00
Jack Steiner 34d8a380d7 GRU Driver: hardware data structures
This series of patches adds a driver for the SGI UV GRU.  The driver is
still in development but it currently compiles for both x86_64 & IA64.
All simple regression tests pass on IA64.  Although features remain to be
added, I'd like to start the process of getting the driver into the
kernel.  Additional kernel drivers will depend on services provide by the
GRU driver.

The GRU is a hardware resource located in the system chipset.  The GRU
contains memory that is mmaped into the user address space.  This memory
is used to communicate with the GRU to perform functions such as
load/store, scatter/gather, bcopy, AMOs, etc.  The GRU is directly
accessed by user instructions using user virtual addresses.  GRU
instructions (ex., bcopy) use user virtual addresses for operands.

The GRU contains a large TLB that is functionally very similar to
processor TLBs.  Because the external contains a TLB with user virtual
address, it requires callouts from the core VM system when certain types
of changes are made to the process page tables.  There are several MMUOPS
patches currently being discussed but none has been accepted into the
kernel.  The GRU driver is built using version V18 from Andrea Arcangeli.

This patch:

Contains the definitions of the hardware GRU data structures that are used
by the driver to manage the GRU.

[akpm@linux-foundation;org: export hpage_shift]
Signed-off-by: Jack Steiner <steiner@sgi.com>
Cc: "Luck, Tony" <tony.luck@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-30 09:41:47 -07:00
WANG Cong 06ac667903 uml: fix tty-related build error
/home/wangcong/Projects/linux-2.6/arch/um/drivers/line.c: In function `line_write_interrupt':
/home/wangcong/Projects/linux-2.6/arch/um/drivers/line.c:366: error: `struct tty_ldisc' has no member named `write_wakeup'
/home/wangcong/Projects/linux-2.6/arch/um/drivers/line.c:367: error: `struct tty_ldisc' has no member named `write_wakeup'

Signed-off-by: WANG Cong <wangcong@zeuux.org>
Cc: Jeff Dike <jdike@addtoit.com>
Acked-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-30 09:41:45 -07:00
Thomas Renninger a1531acd43 cpufreq acpi: only call _PPC after cpufreq ACPI init funcs got called already
Ingo Molnar provided a fix to not call _PPC at processor driver
initialization time in "[PATCH] ACPI: fix cpufreq regression" (git
commit e4233dec74)

But it can still happen that _PPC is called at processor driver
initialization time.

This patch should make sure that this is not possible anymore.

Signed-off-by: Thomas Renninger <trenn@suse.de>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Len Brown <lenb@kernel.org>
Cc: Dave Jones <davej@codemonkey.org.uk>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-30 09:41:43 -07:00
Liam Girdwood ba7e476343 regulator: core kbuild files
This patch adds kernel build support for the regulator core.

Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: Liam Girdwood <lg@opensource.wolfsonmicro.com>
2008-07-30 10:10:22 +01:00
Stephen Rothwell 19fd3cabba sparc: merge of_platform_{32,64}.h
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-07-29 23:54:33 -07:00
David S. Miller 71fc324b5b sparc64: Kill isa_bus_type.
I forgot to delete this when I removed the ISA bus layer
from the sparc ports.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-07-29 23:47:17 -07:00
Nick Piggin ce0ad7f095 powerpc/mm: Lockless get_user_pages_fast() for 64-bit (v3)
Implement lockless get_user_pages_fast for 64-bit powerpc.

Page table existence is guaranteed with RCU, and speculative page references
are used to take a reference to the pages without having a prior existence
guarantee on them.

Signed-off-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2008-07-30 15:26:54 +10:00
Michael Neuling 7d2a175b9b powerpc: Don't use the wrong thread_struct for ptrace get/set VSX regs
In PTRACE_GET/SETVSRREGS, we should be using the thread we are
ptracing rather than current.

Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2008-07-30 15:26:54 +10:00
Michael Neuling 1ac42ef844 powerpc: Fix ptrace buffer size for VSX
Fix cut-and-paste error in the size setting for ptrace buffers for VSX.

Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2008-07-30 15:26:54 +10:00
Michael Neuling 33b3f03dcc powerpc: Correctly hookup PTRACE_GET/SETVSRREGS for 32 bit processes
Fix bug where PTRACE_GET/SETVSRREGS are not connected for 32 bit processes.

Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2008-07-30 15:26:54 +10:00
Nathan Fontenot 9ee07f91a1 powerpc: Allow non-hcall return values for lparcfg writes
The code to handle writes to /proc/ppc64/lparcfg incorrectly
assumes that the return code from the helper routines to update
processor or memory entitlement return a hcall return value. It
then assumes any non-hcall return value is bad and sets the return
code for the write to be -EIO.

The update_[mp]pp routines can return values other than a hcall
return value. This patch removes the automatic setting of any
return code that is not an hcall return value from these routines
to -EIO.

Signed-off-by: Nathan Fontenot <nfont@austin.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2008-07-30 15:26:53 +10:00
Benjamin Herrenschmidt 3a1a8acf69 Merge commit 'kumar/kumar-next' 2008-07-30 14:36:03 +10:00
Kim Phillips cf0d19fb30 powerpc/fsl: proliferate simple-bus compatibility to soc nodes
add simple-bus compatible property to soc nodes for 83xx/85xx platforms
that were missing them.  Add same to platform probe code.

This fixes SoC device drivers (such as talitos) to succeed in matching
devices present in the soc node.

also update mpc836x_rdk dts to new SEC bindings (overlooked in commit
3fd4473: powerpc/fsl: update crypto node definition and device tree
instances).

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2008-07-29 17:48:35 -05:00
Jeff Garzik 16b237dc44 Merge branch 'for-2.6.27' of git://git.marvell.com/mv643xx_eth into upstream-fixes 2008-07-29 18:23:13 -04:00
Paul Mundt cc8dccdc74 sh: defconfig updates.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-30 02:15:20 +09:00
Paul Mundt 9b4d10ff24 sh: Kill off stray mach-rsk7203 reference.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-30 01:01:08 +09:00
Paul Mundt c8b5d9dcbc sh: Move out individual boards without mach groups.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-30 00:13:39 +09:00
Paul Mundt c170f86e31 sh: Make sure AT_SYSINFO_EHDR is exposed to userspace in asm/auxvec.h.
Presently this is protected by a CONFIG_VSYSCALL ifdef so we don't
inadvertently trigger the creation of the gate VMA on CPUs where we don't
enable the vDSO, which is obviously not visible to userspace. Fix this up
by adding in an ifndef __KERNEL__ check at the same time.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-29 23:12:25 +09:00
Paul Mundt 51f3547d61 sh: Allow SH-3 and SH-5 to use common headers.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-29 22:52:49 +09:00
Paul Mundt 93dc544cf4 sh: Provide common CPU headers, prune the SH-2 and SH-2A directories.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-29 22:46:55 +09:00
Paul Mundt 0764bff445 sh: More header path fixups for mach dir refactoring.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-29 22:10:01 +09:00
Paul Mundt 939a24a6df sh: Move out the solution engine headers to arch/sh/include/mach-se/
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-29 21:41:37 +09:00
Magnus Damm e565b518ec sh: I2C fix for AP325RXA and Migo-R
Fix recently introduced I2C build breakage on AP325RXA and Migo-R.

Reported-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-29 21:05:04 +09:00
Paul Mundt da2014a2b0 sh: Shuffle the board directories in to mach groups.
This flattens out the board directories in to individual mach groups,
we will use this for getting rid of unneeded directories, simplifying
the build system, and becoming more coherent with the refactored
arch/sh/include topology.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-29 21:01:19 +09:00
Paul Mundt 71b8064e7d sh: dma-sh: Fix up dreamcast dma.h mach path.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-29 20:20:36 +09:00
Paul Mundt cfb81f361a sh: Switch KBUILD_DEFCONFIG to shx3_defconfig.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-29 20:19:43 +09:00
Paul Mundt f42b7e3dbe sh: Add ARCH_DEFCONFIG entries for sh and sh64.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-29 20:12:51 +09:00
FUJITA Tomonori 8978b74253 generic, x86: fix add iommu_num_pages helper function
This IOMMU helper function doesn't work for some architectures:

  http://marc.info/?l=linux-kernel&m=121699304403202&w=2

It also breaks POWER and SPARC builds:

  http://marc.info/?l=linux-kernel&m=121730388001890&w=2

Currently, only x86 IOMMUs use this so let's move it to x86 for
now.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-07-29 12:12:48 +02:00
Ingo Molnar 35780c8ea7 Merge commit 'v2.6.27-rc1' into x86/urgent 2008-07-29 12:10:50 +02:00
Avi Kivity ed84862433 KVM: Advertise synchronized mmu support to userspace
Signed-off-by: Avi Kivity <avi@qumranet.com>
2008-07-29 12:34:02 +03:00
Andrea Arcangeli e930bffe95 KVM: Synchronize guest physical memory map to host virtual memory map
Synchronize changes to host virtual addresses which are part of
a KVM memory slot to the KVM shadow mmu.  This allows pte operations
like swapping, page migration, and madvise() to transparently work
with KVM.

Signed-off-by: Andrea Arcangeli <andrea@qumranet.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
2008-07-29 12:33:53 +03:00
Andrea Arcangeli 604b38ac03 KVM: Allow browsing memslots with mmu_lock
This allows reading memslots with only the mmu_lock hold for mmu
notifiers that runs in atomic context and with mmu_lock held.

Signed-off-by: Andrea Arcangeli <andrea@qumranet.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
2008-07-29 12:33:50 +03:00
Andrea Arcangeli a1708ce8a3 KVM: Allow reading aliases with mmu_lock
This allows the mmu notifier code to run unalias_gfn with only the
mmu_lock held.  Only alias writes need the mmu_lock held. Readers will
either take the slots_lock in read mode or the mmu_lock.

Signed-off-by: Andrea Arcangeli <andrea@qumranet.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
2008-07-29 12:33:40 +03:00
Nobuhiro Iwamatsu 4864841a34 sh: Fix compile error of Solution Engine
When I compiled Solution Engine, this become compile error
because plaform device of sh_eth device becomes enable.
When sh7710/sh7712 which could use sh_eth was chosen,
revised it so that platform device of sh_eth device became enable.

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-29 17:39:58 +09:00
Linus Torvalds 7874d35173 Merge git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus
* git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus:
  lguest: turn Waker into a thread, not a process
  lguest: Enlarge virtio rings
  lguest: Use GSO/IFF_VNET_HDR extensions on tun/tap
  lguest: Remove 'network: no dma buffer!' warning
  lguest: Adaptive timeout
  lguest: Tell Guest net not to notify us on every packet xmit
  lguest: net block unneeded receive queue update notifications
  lguest: wrap last_avail accesses.
  lguest: use cpu capability accessors
  lguest: virtio-rng support
  lguest: Support assigning a MAC address
  lguest: Don't leak /dev/zero fd
  lguest: fix verbose printing of device features.
  lguest: fix switcher_page leak on unload
  lguest: Guest int3 fix
  lguest: set max_pfn_mapped, growl loudly at Yinghai Lu
2008-07-28 18:16:26 -07:00
Linus Torvalds 1d9b9f6a53 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6: (21 commits)
  x86/PCI: use dev_printk when possible
  PCI: add D3 power state avoidance quirk
  PCI: fix bogus "'device' may be used uninitialized" warning in pci_slot
  PCI: add an option to allow ASPM enabled forcibly
  PCI: disable ASPM on pre-1.1 PCIe devices
  PCI: disable ASPM per ACPI FADT setting
  PCI MSI: Don't disable MSIs if the mask bit isn't supported
  PCI: handle 64-bit resources better on 32-bit machines
  PCI: rewrite PCI BAR reading code
  PCI: document pci_target_state
  PCI hotplug: fix typo in pcie hotplug output
  x86 gart: replace to_pages macro with iommu_num_pages
  x86, AMD IOMMU: replace to_pages macro with iommu_num_pages
  iommu: add iommu_num_pages helper function
  dma-coherent: add documentation to new interfaces
  Cris: convert to using generic dma-coherent mem allocator
  Sh: use generic per-device coherent dma allocator
  ARM: support generic per-device coherent dma mem
  Generic dma-coherent: fix DMA_MEMORY_EXCLUSIVE
  x86: use generic per-device dma coherent allocator
  ...
2008-07-28 18:14:24 -07:00
Linus Torvalds 9b79022ca9 Fix 'get_user_pages_fast()' with non-page-aligned start address
Alexey Dobriyan reported trouble with LTP with the new fast-gup code,
and Johannes Weiner debugged it to non-page-aligned addresses, where the
new get_user_pages_fast() code would do all the wrong things, including
just traversing past the end of the requested area due to 'addr' never
matching 'end' exactly.

This is not a pretty fix, and we may actually want to move the alignment
into generic code, leaving just the core code per-arch, but Alexey
verified that the vmsplice01 LTP test doesn't crash with this.

Reported-and-tested-by: Alexey Dobriyan <adobriyan@gmail.com>
Debugged-by: Johannes Weiner <hannes@saeurebad.de>
Cc: Nick Piggin <npiggin@suse.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-28 17:54:21 -07:00
OGAWA Hirofumi 6de9c6481d sh: Proper __put_user_asm() size mismatch fix.
This fixes up the workaround in 2b4b2bb421
and cleans up __put_user_asm() to get the sizing right from the onset.

Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-29 09:16:33 +09:00
Paul Mundt d27e0854d5 sh: Stub in a dummy ENTRY_OFFSET for uImage offset calculation.
If none is defined, provide a sane default, as we do for the other
options.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-29 09:15:01 +09:00
Rusty Russell 5d006d8d09 lguest: set max_pfn_mapped, growl loudly at Yinghai Lu
6af61a7614 'x86: clean up max_pfn_mapped
usage - 32-bit' makes the following comment:

    XEN PV and lguest may need to assign max_pfn_mapped too.

But no CC.  Yinghai, wasting fellow developers' time is a VERY bad
habit.  If you do it again, I will hunt you down and try to extract
the three hours of my life I just lost :)

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Cc: Yinghai Lu <yhlu.kernel@gmail.com>
2008-07-29 09:58:31 +10:00
Andrea Arcangeli cddb8a5c14 mmu-notifiers: core
With KVM/GFP/XPMEM there isn't just the primary CPU MMU pointing to pages.
 There are secondary MMUs (with secondary sptes and secondary tlbs) too.
sptes in the kvm case are shadow pagetables, but when I say spte in
mmu-notifier context, I mean "secondary pte".  In GRU case there's no
actual secondary pte and there's only a secondary tlb because the GRU
secondary MMU has no knowledge about sptes and every secondary tlb miss
event in the MMU always generates a page fault that has to be resolved by
the CPU (this is not the case of KVM where the a secondary tlb miss will
walk sptes in hardware and it will refill the secondary tlb transparently
to software if the corresponding spte is present).  The same way
zap_page_range has to invalidate the pte before freeing the page, the spte
(and secondary tlb) must also be invalidated before any page is freed and
reused.

Currently we take a page_count pin on every page mapped by sptes, but that
means the pages can't be swapped whenever they're mapped by any spte
because they're part of the guest working set.  Furthermore a spte unmap
event can immediately lead to a page to be freed when the pin is released
(so requiring the same complex and relatively slow tlb_gather smp safe
logic we have in zap_page_range and that can be avoided completely if the
spte unmap event doesn't require an unpin of the page previously mapped in
the secondary MMU).

The mmu notifiers allow kvm/GRU/XPMEM to attach to the tsk->mm and know
when the VM is swapping or freeing or doing anything on the primary MMU so
that the secondary MMU code can drop sptes before the pages are freed,
avoiding all page pinning and allowing 100% reliable swapping of guest
physical address space.  Furthermore it avoids the code that teardown the
mappings of the secondary MMU, to implement a logic like tlb_gather in
zap_page_range that would require many IPI to flush other cpu tlbs, for
each fixed number of spte unmapped.

To make an example: if what happens on the primary MMU is a protection
downgrade (from writeable to wrprotect) the secondary MMU mappings will be
invalidated, and the next secondary-mmu-page-fault will call
get_user_pages and trigger a do_wp_page through get_user_pages if it
called get_user_pages with write=1, and it'll re-establishing an updated
spte or secondary-tlb-mapping on the copied page.  Or it will setup a
readonly spte or readonly tlb mapping if it's a guest-read, if it calls
get_user_pages with write=0.  This is just an example.

This allows to map any page pointed by any pte (and in turn visible in the
primary CPU MMU), into a secondary MMU (be it a pure tlb like GRU, or an
full MMU with both sptes and secondary-tlb like the shadow-pagetable layer
with kvm), or a remote DMA in software like XPMEM (hence needing of
schedule in XPMEM code to send the invalidate to the remote node, while no
need to schedule in kvm/gru as it's an immediate event like invalidating
primary-mmu pte).

At least for KVM without this patch it's impossible to swap guests
reliably.  And having this feature and removing the page pin allows
several other optimizations that simplify life considerably.

Dependencies:

1) mm_take_all_locks() to register the mmu notifier when the whole VM
   isn't doing anything with "mm".  This allows mmu notifier users to keep
   track if the VM is in the middle of the invalidate_range_begin/end
   critical section with an atomic counter incraese in range_begin and
   decreased in range_end.  No secondary MMU page fault is allowed to map
   any spte or secondary tlb reference, while the VM is in the middle of
   range_begin/end as any page returned by get_user_pages in that critical
   section could later immediately be freed without any further
   ->invalidate_page notification (invalidate_range_begin/end works on
   ranges and ->invalidate_page isn't called immediately before freeing
   the page).  To stop all page freeing and pagetable overwrites the
   mmap_sem must be taken in write mode and all other anon_vma/i_mmap
   locks must be taken too.

2) It'd be a waste to add branches in the VM if nobody could possibly
   run KVM/GRU/XPMEM on the kernel, so mmu notifiers will only enabled if
   CONFIG_KVM=m/y.  In the current kernel kvm won't yet take advantage of
   mmu notifiers, but this already allows to compile a KVM external module
   against a kernel with mmu notifiers enabled and from the next pull from
   kvm.git we'll start using them.  And GRU/XPMEM will also be able to
   continue the development by enabling KVM=m in their config, until they
   submit all GRU/XPMEM GPLv2 code to the mainline kernel.  Then they can
   also enable MMU_NOTIFIERS in the same way KVM does it (even if KVM=n).
   This guarantees nobody selects MMU_NOTIFIER=y if KVM and GRU and XPMEM
   are all =n.

The mmu_notifier_register call can fail because mm_take_all_locks may be
interrupted by a signal and return -EINTR.  Because mmu_notifier_reigster
is used when a driver startup, a failure can be gracefully handled.  Here
an example of the change applied to kvm to register the mmu notifiers.
Usually when a driver startups other allocations are required anyway and
-ENOMEM failure paths exists already.

 struct  kvm *kvm_arch_create_vm(void)
 {
        struct kvm *kvm = kzalloc(sizeof(struct kvm), GFP_KERNEL);
+       int err;

        if (!kvm)
                return ERR_PTR(-ENOMEM);

        INIT_LIST_HEAD(&kvm->arch.active_mmu_pages);

+       kvm->arch.mmu_notifier.ops = &kvm_mmu_notifier_ops;
+       err = mmu_notifier_register(&kvm->arch.mmu_notifier, current->mm);
+       if (err) {
+               kfree(kvm);
+               return ERR_PTR(err);
+       }
+
        return kvm;
 }

mmu_notifier_unregister returns void and it's reliable.

The patch also adds a few needed but missing includes that would prevent
kernel to compile after these changes on non-x86 archs (x86 didn't need
them by luck).

[akpm@linux-foundation.org: coding-style fixes]
[akpm@linux-foundation.org: fix mm/filemap_xip.c build]
[akpm@linux-foundation.org: fix mm/mmu_notifier.c build]
Signed-off-by: Andrea Arcangeli <andrea@qumranet.com>
Signed-off-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Jack Steiner <steiner@sgi.com>
Cc: Robin Holt <holt@sgi.com>
Cc: Nick Piggin <npiggin@suse.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Kanoj Sarcar <kanojsarcar@yahoo.com>
Cc: Roland Dreier <rdreier@cisco.com>
Cc: Steve Wise <swise@opengridcomputing.com>
Cc: Avi Kivity <avi@qumranet.com>
Cc: Hugh Dickins <hugh@veritas.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Anthony Liguori <aliguori@us.ibm.com>
Cc: Chris Wright <chrisw@redhat.com>
Cc: Marcelo Tosatti <marcelo@kvack.org>
Cc: Eric Dumazet <dada1@cosmosbay.com>
Cc: "Paul E. McKenney" <paulmck@us.ibm.com>
Cc: Izik Eidus <izike@qumranet.com>
Cc: Anthony Liguori <aliguori@us.ibm.com>
Cc: Rik van Riel <riel@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-28 16:30:21 -07:00
David Brownell 93686ae835 arm: fix HAVE_CLK merge goof
This fixes a merge goof whereby ARCH_EP93XX got the "select HAVE_CLK" line
which belongs instead with ARCH_AT91.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-28 16:30:20 -07:00
Paul Mundt b9edb17cc2 sh: Add an arch/sh/kernel/.gitignore
Ignore vmlinux.lds.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-29 08:29:32 +09:00
Paul Mundt cc64f7f700 sh: dreamcast: fix build failure from header reorg.
Oops, machvec.h is in asm/, it was previously removed due to overzealous
trimming. Fix up the path again.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-29 08:24:50 +09:00