sfrench/cifs-2.6.git
16 years agods1wm: report bus reset error
Anton Vorontsov [Tue, 4 Mar 2008 22:28:44 +0000 (14:28 -0800)]
ds1wm: report bus reset error

The patch replaces dev_dbg() by dev_err(), so the user could actually see the
error, instead of wondering why w1 doesn't work.  The root cause of the bus
reset error isn't yet debugged though, but this sometimes happens on iPaq
H5555.

And while I'm at it, some cosmetic cleanups also made (few lines were using
spaces instead of tabs).

Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
Acked-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agods1wm: should check for IS_ERR(clk) instead of NULL
Anton Vorontsov [Tue, 4 Mar 2008 22:28:43 +0000 (14:28 -0800)]
ds1wm: should check for IS_ERR(clk) instead of NULL

On the error condition clk_get() returns ERR_PTR(..), so checking for NULL
doesn't work.  ds1wm module causes a kernel oops when ds1wm clock isn't
registered.

This patch converts NULL check to IS_ERR(), plus uses PTR_ERR()
for the return code.

Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
Acked-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agopowerpc: mpc5200: fix build error on mpc52xx_psc_spi device driver
Grant Likely [Tue, 4 Mar 2008 22:28:42 +0000 (14:28 -0800)]
powerpc: mpc5200: fix build error on mpc52xx_psc_spi device driver

Commit id 94f389485e27641348c1951ab8d65157122a8939 (Separate MPC52xx PSC FIOF
regsiters from the rest of PSC) split the PSC fifo registers away from the
core PSC regs.  Doing so broke the mpc52xx_psc_spi driver.

This patch teaches the mpc52xx_psc_spi driver about the new PSC fifo
register definitions.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Cc: David Brownell <david-b@pacbell.net>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Kumar Gala <galak@gate.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agopktcdvd: reduce stack consumption
Peter Osterlund [Tue, 4 Mar 2008 22:28:41 +0000 (14:28 -0800)]
pktcdvd: reduce stack consumption

On my system, pkt_open() consumes 584 bytes because the compiler decides to
inline lots of functions that would not normally be part of long call chains.
The following patch fixes that problem on my system.

Signed-off-by: Peter Osterlund <petero2@telia.com>
Cc: Nix <nix@esperi.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoadd noinline_for_stack
Andrew Morton [Tue, 4 Mar 2008 22:28:40 +0000 (14:28 -0800)]
add noinline_for_stack

People are adding `noinline' in various places to prevent excess stack
consumption due to gcc inlining.  But once this is done, it is quite unobvious
why the `noinline' is present in the code.  We can comment each and every
site, or we can use noinline_for_stack.

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agotridentfb: resource management fixes in probe function
Krzysztof Helt [Tue, 4 Mar 2008 22:28:39 +0000 (14:28 -0800)]
tridentfb: resource management fixes in probe function

Correct error paths in probe function.

The probe function enables mmio mode so it important to disable the mmio
mode before exiting the probe function.  Otherwise, the console is left in
unusable state (garbled fonts at least, lock up at worst).

[akpm@linux-foundation.org: cleanups]
Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoMemory controller: rename to Memory Resource Controller
Balbir Singh [Tue, 4 Mar 2008 22:28:39 +0000 (14:28 -0800)]
Memory controller: rename to Memory Resource Controller

Rename Memory Controller to Memory Resource Controller.  Reflect the same
changes in the CONFIG definition for the Memory Resource Controller.  Group
together the config options for Resource Counters and Memory Resource
Controller.

Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com>
Cc: Paul Menage <menage@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoKprobes: move kprobe examples to samples/
Ananth N Mavinakayanahalli [Tue, 4 Mar 2008 22:28:38 +0000 (14:28 -0800)]
Kprobes: move kprobe examples to samples/

Move kprobes examples from Documentation/kprobes.txt to under samples/.
Patch originally by Randy Dunlap.

o Updated the patch to apply on 2.6.25-rc3
o Modified examples code to build on multiple architectures. Currently,
  the kprobe and jprobe examples code works for x86 and powerpc
o Cleaned up unneeded #includes
o Cleaned up Kconfig per Sam Ravnborg's suggestions to fix build break
  on archs that don't have kretprobes
o Implemented suggestions by Mathieu Desnoyers on CONFIG_KRETPROBES
o Included Andrew Morton's cleanup based on x86-git
o Modified kretprobe_example to act as a arch-agnostic module to
  determine routine execution times:
Use 'modprobe kretprobe_example func=<func_name>' to determine
execution time of func_name in nanoseconds.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Acked-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoKprobes: indicate kretprobe support in Kconfig
Ananth N Mavinakayanahalli [Tue, 4 Mar 2008 22:28:37 +0000 (14:28 -0800)]
Kprobes: indicate kretprobe support in Kconfig

Add CONFIG_HAVE_KRETPROBES to the arch/<arch>/Kconfig file for relevant
architectures with kprobes support.  This facilitates easy handling of
in-kernel modules (like samples/kprobes/kretprobe_example.c) that depend on
kretprobes being present in the kernel.

Thanks to Sam Ravnborg for helping make the patch more lean.

Per Mathieu's suggestion, added CONFIG_KRETPROBES and fixed up dependencies.

Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Acked-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoVT notifier fix for VT switch
Samuel Thibault [Tue, 4 Mar 2008 22:28:36 +0000 (14:28 -0800)]
VT notifier fix for VT switch

VT notifier callbacks need to be aware of console switches.  This is already
partially done from console_callback(), but at that time fg_console, cursor
positions, etc.  are not yet updated and hence screen readers fetch the old
values.

This adds an update notify after all of the values are updated in
redraw_screen(vc, 1).

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoalloc_percpu() fails to allocate percpu data
Eric Dumazet [Tue, 4 Mar 2008 22:28:35 +0000 (14:28 -0800)]
alloc_percpu() fails to allocate percpu data

Some oprofile results obtained while using tbench on a 2x2 cpu machine were
very surprising.

For example, loopback_xmit() function was using high number of cpu cycles
to perform the statistic updates, supposed to be real cheap since they use
percpu data

        pcpu_lstats = netdev_priv(dev);
        lb_stats = per_cpu_ptr(pcpu_lstats, smp_processor_id());
        lb_stats->packets++;  /* HERE : serious contention */
        lb_stats->bytes += skb->len;

struct pcpu_lstats is a small structure containing two longs.  It appears
that on my 32bits platform, alloc_percpu(8) allocates a single cache line,
instead of giving to each cpu a separate cache line.

Using the following patch gave me impressive boost in various benchmarks
( 6 % in tbench)
(all percpu_counters hit this bug too)

Long term fix (ie >= 2.6.26) would be to let each CPU allocate their own
block of memory, so that we dont need to roudup sizes to L1_CACHE_BYTES, or
merging the SGI stuff of course...

Note : SLUB vs SLAB is important here to *show* the improvement, since they
dont have the same minimum allocation sizes (8 bytes vs 32 bytes).  This
could very well explain regressions some guys reported when they switched
to SLUB.

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agovfs: fix NULL pointer dereference in fsync_buffers_list()
Jan Kara [Tue, 4 Mar 2008 22:28:33 +0000 (14:28 -0800)]
vfs: fix NULL pointer dereference in fsync_buffers_list()

Fix NULL pointer dereference in fsync_buffers_list() introduced by recent fix
of races in private_list handling.  Since bh->b_assoc_map has been cleared in
__remove_assoc_queue() we should really use original value stored in the
'mapping' variable.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agozlc_setup(): handle jiffies wraparound
KOSAKI Motohiro [Tue, 4 Mar 2008 22:28:32 +0000 (14:28 -0800)]
zlc_setup(): handle jiffies wraparound

jiffies subtraction may cause an overflow problem.  It should be using
time_after().

[akpm@linux-foundation.org: include jiffies.h]
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
Cc: Paul Jackson <pj@sgi.com>
Cc: Mel Gorman <mel@csn.ul.ie>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoFix "Malformed early option 'loglevel'"
Alex Riesen [Tue, 4 Mar 2008 22:28:31 +0000 (14:28 -0800)]
Fix "Malformed early option 'loglevel'"

Keith Mannthey said:

  The parameter hotadd_percent is setup right but there is a "Malformed
  early option 'numa'" message.

Rusty Russell said:

  This happens when the function registered with early_param() returns
  non-zero.  __setup() functions return 1 if OK, module_param() and
  early_param() return 0 or a -ve error code.

For instance:

Linux version 2.6.25-rc3-t (raa@steel) (gcc version 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)) #22 SMP PREEMPT Tue Feb 26
BIOS-provided physical RAM map:
 BIOS-e820: 0000000000000000 - 00000000000a0000 (usable)
 BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved)
 BIOS-e820: 0000000000100000 - 000000003fff0000 (usable)
 BIOS-e820: 000000003fff0000 - 000000003fff3000 (ACPI NVS)
 BIOS-e820: 000000003fff3000 - 0000000040000000 (ACPI data)
 BIOS-e820: 00000000fec00000 - 0000000100000000 (reserved)
Malformed early option 'loglevel'
127MB HIGHMEM available.
896MB LOWMEM available.

Command line:

BOOT_IMAGE=2.6.25-t ro root=809 ro console=ttyS0,57600n8 console=tty0 loglevel=5

Acked-by: Yinghai Lu <yhlu.kernel@gmai.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Keith Mannthey <kmannth@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agocore dump: user_regset writeback
Roland McGrath [Tue, 4 Mar 2008 22:28:30 +0000 (14:28 -0800)]
core dump: user_regset writeback

This makes the user_regset-based core dump code call user_regset writeback
hooks when available.  This is necessary groundwork to allow IA64 to set
CORE_DUMP_USE_REGSET.

Cc: Shaohua Li <shaohua.li@intel.com>
Signed-off-by: Roland McGrath <roland@redhat.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>
16 years agoAdd memory resource controller maintainers
akpm@linux-foundation.org [Tue, 4 Mar 2008 22:28:29 +0000 (14:28 -0800)]
Add memory resource controller maintainers

Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Cc: Paul Menage <menage@google.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Cc: Hugh Dickins <hugh@veritas.com>
Cc: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoControl Groups: add Paul Menage as maintainer
Paul Menage [Tue, 4 Mar 2008 22:28:28 +0000 (14:28 -0800)]
Control Groups: add Paul Menage as maintainer

Control Groups: Add Paul Menage as maintainer

Signed-off-by: Paul Menage <menage@google.com>
Cc: Balbir Singh <balbir@linux.vnet.ibm.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Cc: Hugh Dickins <hugh@veritas.com>
Cc: Pavel Emelyanov <xemul@openvz.org>
Cc: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agogpio: <linux/gpio.h> and "no GPIO support here" stubs
David Brownell [Tue, 4 Mar 2008 22:28:27 +0000 (14:28 -0800)]
gpio: <linux/gpio.h> and "no GPIO support here" stubs

Add a <linux/gpio.h> defining fail/warn stubs for GPIO calls on platforms that
don't support the GPIO programming interface.  That includes the arch-specific
implementation glue otherwise.

This facilitates a new model for GPIO usage: drivers that can use GPIOs if
they're available, but don't require them.  One example of such a driver is
NAND driver for various FreeScale chips.  On platforms update with GPIO
support, they can be used instead of a worst-case delay to verify that the
BUSY signal is off.

(Also includes a couple minor unrelated doc updates.)

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>
16 years agospecialix.c: fix possible double-unlock
Harvey Harrison [Tue, 4 Mar 2008 22:28:26 +0000 (14:28 -0800)]
specialix.c: fix possible double-unlock

Noticed by sparse, trivial to see:
drivers/char/specialix.c:2112:3: warning: context imbalance in 'sx_throttle' - unexpected unlock

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agortc: add support for the S-35390A RTC chip
Byron Bradley [Tue, 4 Mar 2008 22:28:25 +0000 (14:28 -0800)]
rtc: add support for the S-35390A RTC chip

This adds basic get/set time support for the Seiko Instruments S-35390A.
This chip communicates using I2C and is used on the QNAP TS-109/TS-209 NAS
devices.

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Byron Bradley <byron.bbradley@gmail.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
Acked-by: David Brownell <david-b@pacbell.net>
Tested-by: Tim Ellis <tim@ngndg.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoMemory Resource Controller use strstrip while parsing arguments
Balbir Singh [Tue, 4 Mar 2008 22:28:24 +0000 (14:28 -0800)]
Memory Resource Controller use strstrip while parsing arguments

The memory controller has a requirement that while writing values, we need
to use echo -n. This patch fixes the problem and makes the UI more consistent.

Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com>
Cc: Paul Menage <menage@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoCRIS v10: Include mm.h instead of vmstat.h in kernel/time.c
Jesper Nilsson [Tue, 4 Mar 2008 22:28:23 +0000 (14:28 -0800)]
CRIS v10: Include mm.h instead of vmstat.h in kernel/time.c

Commit 2f569afd9ced9ebec9a6eb3dbf6f83429be0a7b4
(CONFIG_HIGHPTE vs. sub-page page tables) introduced use of
inc_zone_page_state and dec_zone_page_state in include/linux/mm.h.

Those are defined in include/linux/vmstat.h, but after it includes
mm.h, making it impossible to include vmstat.h since inc_zone_page_state
and dec_zone_page_state then would be undefined.

arch/cris/arch-v10/kernel/time.c does just this, which makes the
CRIS v10 build break with the following error:

...
  CC      arch/cris/arch-v10/kernel/time.o
In file included from include/linux/vmstat.h:7,
                 from arch/cris/arch-v10/kernel/time.c:17:
include/linux/mm.h: In function 'pgtable_page_ctor':
include/linux/mm.h:902: error: implicit declaration of function 'inc_zone_page_state'
include/linux/mm.h: In function 'pgtable_page_dtor':
include/linux/mm.h:908: error: implicit declaration of function 'dec_zone_page_state'
make[2]: *** [arch/cris/arch-v10/kernel/time.o] Error 1
make[1]: *** [arch/cris/arch-v10/kernel] Error 2
make: *** [sub-make] Error 2
...

By changing kernel/time.c to include linux/mm.h, the build succeeds.

Signed-off-by: Jesper Nilsson <jesper.nilsson@axis.com>
Cc: Mikael Starvik <mikael.starvik@axis.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoserial: add PNP ID GVC0303 for Archtek 3334BRV ISA modem
Bjorn Helgaas [Tue, 4 Mar 2008 22:28:21 +0000 (14:28 -0800)]
serial: add PNP ID GVC0303 for Archtek 3334BRV ISA modem

Thomas Lehmann <thomas.lehmann@alumni.tu-berlin.de> verified that this
entry works.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoupdate checkpatch.pl to version 0.15
Andy Whitcroft [Tue, 4 Mar 2008 22:28:20 +0000 (14:28 -0800)]
update checkpatch.pl to version 0.15

This version brings a number of minor fixes updating the type detector and
the unary tracker.  It also brings a few small fixes for false positives.
It also reverts the --file warning.  Of note:

 - limit CVS checks to added lines
 - improved type detections
 - fixes to the unary tracker

Andy Whitcroft (13):
      Version: 0.15
      EXPORT_SYMBOL checks need to accept array variables
      export checks must match DECLARE_foo and LIST_HEAD
      possible types: cleanup debugging missing line
      values: track values through preprocessor conditional paths
      typeof is actually a type
      possible types: detect definitions which cross lines
      values: include line numbers on value debug information
      values: ensure we find correctly record pending brackets
      values: simplify the brace history stack
      CVS keyword checks should only apply to added lines
      loosen spacing for comments
      allow braces for single statement blocks with multiline conditionals

Harvey Harrison (1):
      checkpatch: remove fastcall

Ingo Molnar (1):
      checkpatch.pl: revert wrong --file message

Uwe Kleine-Koenig (1):
      fix typo "goot" -> "good"

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Cc: Randy Dunlap <rdunlap@xenotime.net>
Cc: Joel Schopp <jschopp@austin.ibm.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agocgroup: fix default notify_on_release setting
Li Zefan [Tue, 4 Mar 2008 22:28:19 +0000 (14:28 -0800)]
cgroup: fix default notify_on_release setting

The documentation says the default value of notify_on_release of a child
cgroup is inherited from its parent, which is reasonable, but the
implementation just sets the flag disabled.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: Paul Menage <menage@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agob43legacy: Fix module init message
Michael Buesch [Tue, 4 Mar 2008 19:31:13 +0000 (20:31 +0100)]
b43legacy: Fix module init message

This fixes the module init message to tell that the legacy
driver loaded. This makes it less confusing, in case both drivers are loaded.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agorndis_wlan: fix broken data copy
Jussi Kivilinna [Tue, 4 Mar 2008 18:05:27 +0000 (20:05 +0200)]
rndis_wlan: fix broken data copy

Replace broken code that attempted to copy 6 byte array to 64-bit
integer. Due to missing cast to 64-bit integer, left shift operation
were 32-bit and lead to bytes been copied over each other. New code
uses simple memcpy, for greater readability and efficiency.

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agolibertas: compare the current command with response
Sebastian Siewior [Tue, 4 Mar 2008 17:22:27 +0000 (18:22 +0100)]
libertas: compare the current command with response

instead of with itself.

Signed-off-by: Sebastian Siewior <bigeasy@linutronix.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agolibertas: fix sanity check on sequence number in command response
David Woodhouse [Mon, 3 Mar 2008 11:20:12 +0000 (12:20 +0100)]
libertas: fix sanity check on sequence number in command response

Slightly more useful if we compare it against the sequence number of the
command we have outstanding, rather than comparing the reply with itself.

Doh. Pointed out by Sebastian Siewior

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agop54: fix eeprom parser length sanity checks
Johannes Berg [Fri, 29 Feb 2008 22:28:25 +0000 (23:28 +0100)]
p54: fix eeprom parser length sanity checks

When I called p54_parse_eeprom() on a hand-coded structure
I managed to make a small mistake with wrap->len which caused
a segfault a few lines down when trying to read entry->len.
This patch changes the validation code to avoid such problems.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Tested-by: Florian Fainelli <florian.fainelli@telecomint.eu>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agop54: fix EEPROM structure endianness
Johannes Berg [Fri, 29 Feb 2008 12:56:33 +0000 (13:56 +0100)]
p54: fix EEPROM structure endianness

Since the EEPROM structure is read from hardware, it is
always little endian, annotate that in the struct and
make sure to convert where applicable.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Cc: Michael Wu <flamingice@sourmilk.net>
Tested-by: Florian Fainelli <florian.fainelli@telecomint.eu>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agossb: Add pcibios_enable_device() return value check
Yoichi Yuasa [Fri, 29 Feb 2008 10:09:31 +0000 (11:09 +0100)]
ssb: Add pcibios_enable_device() return value check

This patch has added pcibios_enable_device() return value check.

Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agorc80211-pid: fix rate adjustment
Stefano Brivio [Sun, 2 Mar 2008 10:33:10 +0000 (11:33 +0100)]
rc80211-pid: fix rate adjustment

Merge rate_control_pid_shift_adjust() to rate_control_pid_adjust_rate()
in order to make the learning algorithm aware of constraints on rates. Also
add some comments and rename variables.

This fixes a bug which prevented 802.11b/g non-AP STAs from working with
802.11b only AP STAs.

This patch was originally destined for 2.6.26, and is being backported
to fix a user reported problem in post-2.6.24 kernels.

Signed-off-by: Stefano Brivio <stefano.brivio@polimi.it>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agopci: hotplug: pciehp: fix error code path in hpc_power_off_slot
Kenji Kaneshige [Tue, 4 Mar 2008 21:01:14 +0000 (13:01 -0800)]
pci: hotplug: pciehp: fix error code path in hpc_power_off_slot

Fix the error code path in hpc_power_off_slot().

The Bad DLLP Mask bit must be restored before return.

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: Add DECLARE_PCI_DEVICE_TABLE macro
Jonas Bonn [Fri, 22 Feb 2008 10:02:21 +0000 (11:02 +0100)]
PCI: Add DECLARE_PCI_DEVICE_TABLE macro

The definitions of struct pci_device_id arrays should generally follow
the same pattern across the entire kernel.  This macro defines this
array as const and puts it into the __devinitconst section.

There are currently many definitions scattered about the kernel that
omit the __devinitdata modifier despite the documentation stating that
it should always be there.  These definitions really also should have
been const, which wasn't possible before but has become so with the
addition of the __devinitconst attribute.

Furthermore, there are definitions that use "const" and __devinitdata,
which is explicitly wrong but the compiler doesn't catch section
mismatches if there's only one such one case in the module (which is
often the case).

Adding the __devinitconst modifier where there was nothing before buys
us memory.  Adding the const modifier gives the compiler a chance to do
its thing.  Changing __devinitdata to __devinitconst where it was wrong
actually fixes some compiler errors in older (mid-release) kernels that
were patched over by "removing" the section attribute altogether (which
wastes memory).

This macro makes it pretty difficult to get this definition wrong in
the future...

Signed-off-by: Jonas Bonn <jonas@southpole.se>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: fix up error messages for pci_bus registering
Greg Kroah-Hartman [Mon, 3 Mar 2008 22:47:13 +0000 (14:47 -0800)]
PCI: fix up error messages for pci_bus registering

Due to the class_device cleanup of pci_bus, the error messages when
things go wrong are incorrect.  So fix this up to properly report what
is really happening, if things go wrong.

Thanks to Kay for pointing out the issue.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: fix section mismatch warning in pci_scan_child_bus
Sam Ravnborg [Sun, 17 Feb 2008 09:45:28 +0000 (10:45 +0100)]
PCI: fix section mismatch warning in pci_scan_child_bus

Fix following warning:
WARNING: vmlinux.o(.text+0x47bdb1): Section mismatch in reference from the function pci_scan_child_bus() to the function .devinit.text:pcibios_fixup_bus()

We had plenty of functions that could be annotated __devinit but due to
the former restriction that exported symbols could not be annotated
they were not so.  So annotate these function and fix the references
from the pci/hotplug/* code to silence the resuting warnings.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: consolidate duplicated MSI enable functions
Bjorn Helgaas [Fri, 29 Feb 2008 23:04:39 +0000 (16:04 -0700)]
PCI: consolidate duplicated MSI enable functions

Two recent patches added basically the same code to turn on
HT MSI mapping:

    http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=6bae1d96c6d7dde078994f6cb98235fd46f8736b
    http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=9dc625e72309e1c919ea3e7f51d0ffca96123787

There's no need to have both, so this patch removes one copy.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: use dev_printk in quirk messages
Bjorn Helgaas [Fri, 29 Feb 2008 23:12:18 +0000 (16:12 -0700)]
PCI: use dev_printk in quirk messages

Convert quirk printks to dev_printk().

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: ftdi_sio - really enable EM1010PC
Sven Andersen [Tue, 4 Mar 2008 21:09:11 +0000 (22:09 +0100)]
USB: ftdi_sio - really enable EM1010PC

Add EM1010PC to ftdi_sio.c

Signed-off-by: Sven Andersen <s.andersen@cryonet.de>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: remove incorrect struct class_device from the printer gadget
Tony Jones [Thu, 21 Feb 2008 23:13:36 +0000 (00:13 +0100)]
USB: remove incorrect struct class_device from the printer gadget

This field does nothing, and should not be allowed to stick around
incase someone gets any other ideas...

Signed-off-by: Tony Jones <tonyj@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: pxa2xx_udc: fix misuse of clock enable/disable calls
Dmitry Baryshkov [Sat, 23 Feb 2008 01:17:19 +0000 (17:17 -0800)]
USB: pxa2xx_udc: fix misuse of clock enable/disable calls

Fix pxa2xx_udc to balance calls to clk_enable/clk_disable.

[db: remove inline #ifdefs for IXP non-support of <linux/clk.h> calls]

Signed-off-by: Dmitry Baryshkov dbaryshkov@gmail.com
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: ftdi_sio: Workaround for broken Matrix Orbital serial port
Kevin Vance [Sat, 1 Mar 2008 18:49:59 +0000 (13:49 -0500)]
USB: ftdi_sio: Workaround for broken Matrix Orbital serial port

Workaround for the FT232RL-based, Matrix Orbital VK204-25-USB serial port
added to the ftdi_sio driver.

The device has an invalid endpoint descriptor, which must be modified
before it can be used.

Signed-off-by: Kevin Vance <kvance@kvance.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: Add support for AXESSTEL MV110H CDMA modem
Daniel Kozák [Tue, 4 Mar 2008 17:54:53 +0000 (18:54 +0100)]
USB: Add support for AXESSTEL MV110H CDMA modem

Add entry for Axesstel MV110H CDMA modem (ID: 1726:1000) to option driver

Signed-off-by: Daniel Kozák <kozzi11@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousb-storage: update earlier scatter-gather bug fix
Alan Stern [Fri, 22 Feb 2008 22:00:06 +0000 (17:00 -0500)]
usb-storage: update earlier scatter-gather bug fix

This patch (as1037) makes a small update to the earlier as1035 patch.
The minimum-length computation shouldn't be done in
usb_stor_access_xfer_buf(), since that routine can be called multiple
times for a single transfer.  It should be done in
usb_stor_set_xfer_buf() instead, which gets called only once.

The way it is now isn't really _wrong_, but it isn't really _right_
either.  Moving the statement will be an improvement.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: isp116x: fix enumeration on boot
Anti Sullin [Mon, 3 Mar 2008 13:39:54 +0000 (15:39 +0200)]
USB: isp116x: fix enumeration on boot

This patch removes the buffering of the status register.
USB core behavior has changed a bit and this buffering was not refreshed
at the right time.  The core got buffered old value of HCRHPORT and it
did not detect any devices on boot.

Signed-off-by: Anti Sullin <anti.sullin@artecdesign.ee>
Acked by: Olav Kongas <ok@artecdesign.ee>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: ehci: handle large bulk URBs correctly (again)
Misha Zhilin [Thu, 28 Feb 2008 02:05:24 +0000 (18:05 -0800)]
USB: ehci: handle large bulk URBs correctly (again)

USB: ehci: Fixes completion for multi-qtd URB the short read case

When use of urb->status in the EHCI driver was reworked last August
(commit 14c04c0f88f228fee1f412be91d6edcb935c78aa), a bug was inserted
in the handling of early completion for bulk transactions that need
more than one qTD (e.g. more than 20KB in one URB).

This patch resolves that problem by ensuring that the early completion
status is preserved until the URB is handed back to its submitter,
instead of resetting it after each qTD.

Signed-off-by: Misha Zhilin <misha@epiphan.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: stable@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: spruce up the device blacklist
Alan Stern [Wed, 27 Feb 2008 20:43:47 +0000 (15:43 -0500)]
USB: spruce up the device blacklist

This patch (as1040) fixes up the blacklist of USB device quirks.  A
couple of lines are broken to comply with the 80-column rule, and
entries are sorted into the proper numerical order.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: fix comment of struct usb_interface
Lei Ming [Mon, 25 Feb 2008 10:07:28 +0000 (18:07 +0800)]
USB: fix comment of struct usb_interface

update the comment for the removed "driver" field  and  being
out-of-order of  @cur_altsetting and @num_altsetting.

Signed-off-by: Lei Ming <tom.leiming@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: update Kconfig entry for USB_SUSPEND
Alan Stern [Mon, 25 Feb 2008 16:43:32 +0000 (11:43 -0500)]
USB: update Kconfig entry for USB_SUSPEND

This patch (as1039) updates the Kconfig entry for USB_SUSPEND.  The
out-of-date reference to "power/state" is fixed, autosuspend is
mentioned, and the dependency on EXPERIMENTAL is removed.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousb: Add support for the mos7820/7840-based B&B USB/RS485 converter to mos7840.c
David Ludlow [Mon, 25 Feb 2008 22:30:52 +0000 (17:30 -0500)]
usb: Add support for the mos7820/7840-based B&B USB/RS485 converter to mos7840.c

Add support for the mos7820/7840-based B&B USOPTL4_2/USOPTL4_4 USB/RS485
converter to mos7840.c

Signed-off-by: Dave Ludlow <dave.ludlow@bay.ws>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agodebugfs: fix sparse warnings
Harvey Harrison [Thu, 14 Feb 2008 01:08:16 +0000 (17:08 -0800)]
debugfs: fix sparse warnings

extern does not belong in C files, move declaration to linux/debugfs.h
fs/debugfs/file.c:42:30: warning: symbol 'debugfs_file_operations' was not declared. Should it be static?
fs/debugfs/file.c:54:31: warning: symbol 'debugfs_link_operations' was not declared. Should it be static?

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoDriver core: Fix cleanup when failing device_add().
Cornelia Huck [Wed, 27 Feb 2008 14:38:23 +0000 (15:38 +0100)]
Driver core: Fix cleanup when failing device_add().

Driver core: Fix cleanup when failing device_add().

 - Don't call cleanup_device_parent() if we didn't call setup_parent().
 - dev->kobj.parent may be NULL when cleanup_device_parent() is called,
   so we need to handle glue_dir == NULL in cleanup_glue_dir().

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agodriver core: Remove dpm_sysfs_remove() from error path of device_add()
Rafael J. Wysocki [Mon, 3 Mar 2008 22:46:51 +0000 (23:46 +0100)]
driver core: Remove dpm_sysfs_remove() from error path of device_add()

Since device_pm_remove(dev) calls dpm_sysfs_remove(dev), it's
incorrect to call the latter after the former in the device_add()
error path.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPM: fix new mutex-locking bug in the PM core
Alan Stern [Fri, 29 Feb 2008 16:50:22 +0000 (11:50 -0500)]
PM: fix new mutex-locking bug in the PM core

This patch (as1041) fixes a bug introduced by the
acquire-all-device-semaphores reversion.  The error pathway of
dpm_suspend() fails to reacquire a mutex it should be holding.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPM: Do not acquire device semaphores upfront during suspend
Rafael J. Wysocki [Sun, 24 Feb 2008 23:35:04 +0000 (00:35 +0100)]
PM: Do not acquire device semaphores upfront during suspend

Remove the code that acquires all device semaphores from the suspend
code path as it causes multiple problems to appear (most notably,
http://bugzilla.kernel.org/show_bug.cgi?id=10030) and revert the
change introduced by commit 4145ed6dc597a9bea5f6ae8c574653b2de10620f
depending on the code being removed.

Remove pm_sleep_lock()/pm_sleep_unlock() from device_add() to avoid
the issue reported at http://bugzilla.kernel.org/show_bug.cgi?id=9874.

It should fix the regreesions reported at:
http://bugzilla.kernel.org/show_bug.cgi?id=9874
http://bugzilla.kernel.org/show_bug.cgi?id=10030

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agokobject: properly initialize ksets
Greg Kroah-Hartman [Tue, 26 Feb 2008 17:36:38 +0000 (09:36 -0800)]
kobject: properly initialize ksets

kset_initialize was calling kobject_init_internal() which didn't
initialize the kobject as well as kobject_init() was.  So have
kobject_init() call kobject_init_internal() and move the logic to
initalize the kobject there.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: Hannes Reinecke <hare@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agosysfs: CONFIG_SYSFS_DEPRECATED fix
Ingo Molnar [Tue, 4 Mar 2008 13:54:47 +0000 (14:54 +0100)]
sysfs: CONFIG_SYSFS_DEPRECATED fix

CONFIG_SYSFS_DEPRECATED=y changed its meaning recently and causes
regressions in working setups that had SYSFS_DEPRECATED disabled.

so rename it to SYSFS_DEPRECATED_V2 so that testers pick up the new
default via 'make oldconfig', even if their old .config's disabled
CONFIG_SYSFS_DEPRECATED ...

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agodriver core: fix up Kconfig text for CONFIG_SYSFS_DEPRECATED
Greg Kroah-Hartman [Mon, 3 Mar 2008 22:47:13 +0000 (14:47 -0800)]
driver core: fix up Kconfig text for CONFIG_SYSFS_DEPRECATED

As things get moved into this config option, the hard date of 2006 does
not work anymore, so update the text to be more descriptive.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years ago[IA64] fix ia64 kprobes compilation
Adrian Bunk [Mon, 3 Mar 2008 18:07:22 +0000 (20:07 +0200)]
[IA64] fix ia64 kprobes compilation

This patch fixes the following compile error with a recent gcc:
  CC      kernel/kprobes.o
/home/bunk/linux/kernel-2.6/git/linux-2.6/kernel/kprobes.c:1066: error: __ksymtab_jprobe_return causes a section type conflict

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Tony Luck <tony.luck@intel.com>
16 years ago[ESP]: Add select on AUTHENC
Herbert Xu [Tue, 4 Mar 2008 22:29:21 +0000 (14:29 -0800)]
[ESP]: Add select on AUTHENC

Now the ESP uses the AEAD interface even for algorithms which are
not combined mode, we need to select CONFIG_CRYPTO_AUTHENC as
otherwise only combined mode algorithms will work.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[TCP]: Improve ipv4 established hash function.
David S. Miller [Tue, 4 Mar 2008 22:28:41 +0000 (14:28 -0800)]
[TCP]: Improve ipv4 established hash function.

If all of the entropy is in the local and foreign addresses,
but xor'ing together would cancel out that entropy, the
current hash performs poorly.

Suggested by Cosmin Ratiu:

Basically, the situation is as follows: There is a client
machine and a server machine. Both create 15000 virtual
interfaces, open up a socket for each pair of interfaces and
do SIP traffic. By profiling I noticed that there is a lot of
time spent walking the established hash chains with this
particular setup.

The addresses were distributed like this: client interfaces
were 198.18.0.1/16 with increments of 1 and server interfaces
were 198.18.128.1/16 with increments of 1. As I said, there
were 15000 interfaces. Source and destination ports were 5060
for each connection.  So in this case, ports don't matter for
hashing purposes, and the bits from the address pairs used
cancel each other, meaning there are no differences in the
whole lot of pairs, so they all end up in the same hash chain.

Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[IA64] move gcc_intrin.h from header-y to unifdef-y
Doug Chapman [Fri, 29 Feb 2008 20:28:43 +0000 (15:28 -0500)]
[IA64] move gcc_intrin.h from header-y to unifdef-y

When I submitted 0df29025fd0379d5950d206314d0b10a2c8a9607 to ad
an #ifdef __KERNEL__ to include/asm-ia64/gcc_intrin.h a few weeks
ago I neglected to move gcc_intrin.h from header-y to unifdef-y.
Thanks to David Woodhouse for pointing this out.

Signed-off-by: Doug Chapman <doug.chapman@hp.com>
Signed-off-by: Jarod Wilson <jwilson@redhat.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
16 years ago[IA64] workaround tiger ia64_sal_get_physical_id_info hang
Alex Chiang [Thu, 28 Feb 2008 01:41:38 +0000 (18:41 -0700)]
[IA64] workaround tiger ia64_sal_get_physical_id_info hang

This fixes regression introduced in 113134fcbca83619be4c68d0ca66db6093777b5d

Intel Tiger platforms hang when calling SAL_GET_PHYSICAL_ID_INFO
instead of properly returning -1 for unimplemented, so add a
version check.

SGI Altix platforms have an incorrect SAL version hard-coded into
their prom -- they encode 2.9, but actually implement 3.2 -- so
fix it up and allow ia64_sal_get_physical_id_info to keep
working.

Signed-off-by: Alex Chiang <achiang@hp.com>
Acked-by: Russ Anderson <rja@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
16 years ago[IA64] move defconfig to arch/ia64/configs/
Adrian Bunk [Tue, 26 Feb 2008 19:54:46 +0000 (21:54 +0200)]
[IA64] move defconfig to arch/ia64/configs/

This patch moves the default ia64 defconfig to
arch/ia64/configs/generic_defconfig where it belongs and selects it as
the default defconfig through KBUILD_DEFCONFIG.

Signed-off-by: Adrian Bunk <adrian.bunk@movial.fi>
Signed-off-by: Tony Luck <tony.luck@intel.com>
16 years ago[IA64] Fix irq migration in multiple vector domain
Kenji Kaneshige [Mon, 25 Feb 2008 05:32:22 +0000 (14:32 +0900)]
[IA64] Fix irq migration in multiple vector domain

Fix the problem that the following error message is sometimes displayed
at irq migration when vector domain is enabled.

    "Unexpected interrupt vector %d on CPU %d is not mapped to any IRQ!"

The cause of this problem is an interrupt is sent to the previous
target CPU after cleaning up vector to irq mapping table. To clean up
vector to irq map on the previous target CPU safty, change the irq
migration in multiple vector domain as follows. The original idea is
from x86 interrupt management code.

    - Delay vector to irq table cleanup until the interrupts are sent
      to new target CPUs. By this, it is ensured that target CPU is
      completely changed on the interrupt controller side.

    - Even after the interrupts are sent to new target CPUs, there can
      be pended interrupts remaining on the previous target CPU. So we
      need to delay clearning up vector to irq table until the pended
      interrupt is handled. For this, send IPI to the previous target
      CPU with lower priority vector and clean up vector to irq table
      in its handler.

This patch affects only to irq migration code with multiple vector
domain is enabled.

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
16 years ago[IA64] signal(ia64_ia32): add a signal stack overflow check
Shi Weihua [Tue, 19 Feb 2008 02:26:19 +0000 (10:26 +0800)]
[IA64] signal(ia64_ia32): add a signal stack overflow check

The similar check has been added to x86_32(i386) in commit
id 83bd01024b1fdfc41d9b758e5669e80fca72df66.
So we add this check to ia64_ia32 and improve it a liitle bit in that
we need to check for stack overflow only when the signal is on stack.

Signed-off-by: Shi Weihua <shiwh@cn.fujitsu.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
16 years ago[IA64] signal(ia64): add a signal stack overflow check
Shi Weihua [Tue, 19 Feb 2008 02:25:09 +0000 (10:25 +0800)]
[IA64] signal(ia64): add a signal stack overflow check

The similar check has been added to x86_32(i386) in commit
id 83bd01024b1fdfc41d9b758e5669e80fca72df66.
So we add this check to ia64 and improve it a liitle bit in that
we need to check for stack overflow only when the signal is on stack.

Signed-off-by: Shi Weihua <shiwh@cn.fujitsu.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
16 years ago[IA64] CONFIG_SGI_SN2 - auto select NUMA and ACPI_NUMA
Jes Sorensen [Mon, 11 Feb 2008 14:10:19 +0000 (15:10 +0100)]
[IA64] CONFIG_SGI_SN2 - auto select NUMA and ACPI_NUMA

Auto select CONFIG_NUMA and CONFIG_ACPI_NUMA when picking SN2, similar
to how they are selected automatically for CONFIG_IA64_GENERIC.

Signed-off-by: Jes Sorensen <jes@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
16 years ago[NETPOLL]: Revert two bogus cleanups that broke netconsole.
David S. Miller [Tue, 4 Mar 2008 20:28:49 +0000 (12:28 -0800)]
[NETPOLL]: Revert two bogus cleanups that broke netconsole.

Based upon a report by Andrew Morton and code analysis done
by Jarek Poplawski.

This reverts 33f807ba0d9259e7c75c7a2ce8bd2787e5b540c7 ("[NETPOLL]:
Kill NETPOLL_RX_DROP, set but never tested.")  and
c7b6ea24b43afb5749cb704e143df19d70e23dea ("[NETPOLL]: Don't need
rx_flags.").

The rx_flags did get tested for zero vs. non-zero and therefore we do
need those tests and that code which sets NETPOLL_RX_DROP et al.

Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agox86: a P4 is a P6 not an i486
Hugh Dickins [Tue, 4 Mar 2008 19:33:24 +0000 (19:33 +0000)]
x86: a P4 is a P6 not an i486

P4 has been coming out as CPU_FAMILY=4 instead of 6: fix MPENTIUM4 typo.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoMerge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
Linus Torvalds [Tue, 4 Mar 2008 19:37:36 +0000 (11:37 -0800)]
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block

* 'for-linus' of git://git.kernel.dk/linux-2.6-block:
  scsi: missing add of padded bytes to io completion byte count

16 years agoMerge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mfashe...
Linus Torvalds [Tue, 4 Mar 2008 19:27:32 +0000 (11:27 -0800)]
Merge branch 'upstream-linus' of git://git./linux/kernel/git/mfasheh/ocfs2

* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mfasheh/ocfs2:
  [PATCH] fs/ocfs2/aops.c: Correct use of ! and &
  [2.6 patch] ocfs2: make dlm_do_assert_master() static
  [2.6 patch] make ocfs2_downconvert_thread() static
  [2.6 patch] fs/ocfs2/: possible cleanups
  [PATCH] ocfs2: le*_add_cpu conversion
  ocfs2: Fix writeout in ocfs2_data_convert_worker()
  ocfs2: Enable localalloc for local mounts

16 years agoMerge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/djbw/async_tx
Linus Torvalds [Tue, 4 Mar 2008 19:26:01 +0000 (11:26 -0800)]
Merge branch 'fixes' of git://git./linux/kernel/git/djbw/async_tx

* 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/djbw/async_tx:
  ioat: fix 'ack' handling, driver must ensure that 'ack' is zero
  dmaengine: fix sparse warning
  fsldma: do not cleanup descriptors in hardirq context
  dmaengine: add driver for Freescale MPC85xx DMA controller

16 years agoscsi: missing add of padded bytes to io completion byte count
Jens Axboe [Tue, 4 Mar 2008 19:22:54 +0000 (20:22 +0100)]
scsi: missing add of padded bytes to io completion byte count

Original patch from Tejun Heo <htejun@gmail.com> but should use ->extra_len
and not ->data_len, as we would then overshoot the original request size.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
16 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux...
Linus Torvalds [Tue, 4 Mar 2008 17:23:28 +0000 (09:23 -0800)]
Merge branch 'for-linus' of git://git./linux/kernel/git/mingo/linux-2.6-sched-devel

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-sched-devel:
  sched: revert load_balance_monitor() changes

16 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux...
Linus Torvalds [Tue, 4 Mar 2008 17:22:32 +0000 (09:22 -0800)]
Merge branch 'for-linus' of git://git./linux/kernel/git/x86/linux-2.6-x86

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86:
  x86/xen: fix DomU boot problem
  x86: not set node to cpu_to_node if the node is not online
  x86, i387: fix ptrace leakage using init_fpu()

16 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm
Linus Torvalds [Tue, 4 Mar 2008 17:22:05 +0000 (09:22 -0800)]
Merge branch 'for-linus' of git://git./linux/kernel/git/avi/kvm

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm:
  x86: disable KVM for Voyager and friends
  KVM: VMX: Avoid rearranging switched guest msrs while they are loaded
  KVM: MMU: Fix race when instantiating a shadow pte
  KVM: Route irq 0 to vcpu 0 exclusively
  KVM: Avoid infinite-frequency local apic timer
  KVM: make MMU_DEBUG compile again
  KVM: move alloc_apic_access_page() outside of non-preemptable region
  KVM: SVM: fix Windows XP 64 bit installation crash
  KVM: remove the usage of the mmap_sem for the protection of the memory slots.
  KVM: emulate access to MSR_IA32_MCG_CTL
  KVM: Make the supported cpuid list a host property rather than a vm property
  KVM: Fix kvm_arch_vcpu_ioctl_set_sregs so that set_cr0 works properly
  KVM: SVM: set NM intercept when enabling CR0.TS in the guest
  KVM: SVM: Fix lazy FPU switching

16 years agoioat: fix 'ack' handling, driver must ensure that 'ack' is zero
Dan Williams [Sat, 1 Mar 2008 14:52:14 +0000 (07:52 -0700)]
ioat: fix 'ack' handling, driver must ensure that 'ack' is zero

Initialize 'ack' to zero in case the descriptor has been recycled.

Prevents "kernel BUG at crypto/async_tx/async_xor.c:185!"

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Acked-by: Shannon Nelson <shannon.nelson@intel.com>
Cc: stable@kernel.org
16 years agodmaengine: fix sparse warning
Dan Williams [Sat, 1 Mar 2008 14:51:29 +0000 (07:51 -0700)]
dmaengine: fix sparse warning

include/linux/dmaengine.h:364:2: warning: returning void-valued expression

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
16 years agofsldma: do not cleanup descriptors in hardirq context
Dan Williams [Sat, 1 Mar 2008 14:51:17 +0000 (07:51 -0700)]
fsldma: do not cleanup descriptors in hardirq context

"Cleaning" descriptors involves calling pending callbacks and clients
assume that their callback will only ever happen in softirq context.
Delay cleanup to the tasklet.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Acked-by: Zhang Wei <wei.zhang@freescale.com>
16 years agodmaengine: add driver for Freescale MPC85xx DMA controller
Zhang Wei [Sat, 1 Mar 2008 14:42:48 +0000 (07:42 -0700)]
dmaengine: add driver for Freescale MPC85xx DMA controller

The driver implements DMA engine API for Freescale MPC85xx DMA controller,
which could be used by devices in the silicon.  The driver supports the
Basic mode of Freescale MPC85xx DMA controller.  The MPC85xx processors
supported include MPC8540/60, MPC8555, MPC8548, MPC8641 and so on.

The MPC83xx(MPC8349, MPC8360) are also supported.

[kamalesh@linux.vnet.ibm.com: build fix]
[dan.j.williams@intel.com: merge mm fixes, rebase on async_tx-2.6.25]
Signed-off-by: Zhang Wei <wei.zhang@freescale.com>
Signed-off-by: Ebony Zhu <ebony.zhu@freescale.com>
Acked-by: Kumar Gala <galak@gate.crashing.org>
Cc: Shannon Nelson <shannon.nelson@intel.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
16 years agosched: revert load_balance_monitor() changes
Peter Zijlstra [Mon, 25 Feb 2008 16:34:02 +0000 (17:34 +0100)]
sched: revert load_balance_monitor() changes

The following commits cause a number of regressions:

  commit 58e2d4ca581167c2a079f4ee02be2f0bc52e8729
  Author: Srivatsa Vaddagiri <vatsa@linux.vnet.ibm.com>
  Date:   Fri Jan 25 21:08:00 2008 +0100
  sched: group scheduling, change how cpu load is calculated

  commit 6b2d7700266b9402e12824e11e0099ae6a4a6a79
  Author: Srivatsa Vaddagiri <vatsa@linux.vnet.ibm.com>
  Date:   Fri Jan 25 21:08:00 2008 +0100
  sched: group scheduler, fix fairness of cpu bandwidth allocation for task groups

Namely:
 - very frequent wakeups on SMP, reported by PowerTop users.
 - cacheline trashing on (large) SMP
 - some latencies larger than 500ms

While there is a mergeable patch to fix the latter, the former issues
are not fixable in a manner suitable for .25 (we're at -rc3 now).

Hence we revert them and try again in v2.6.26.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
CC: Srivatsa Vaddagiri <vatsa@linux.vnet.ibm.com>
Tested-by: Alexey Zaytsev <alexey.zaytsev@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86/xen: fix DomU boot problem
Ian Campbell [Thu, 28 Feb 2008 23:16:49 +0000 (23:16 +0000)]
x86/xen: fix DomU boot problem

Construct Xen guest e820 map with a hole between 640K-1M.

It's pure luck that Xen kernels have gotten away with it in the past.

The patch below seems like the right thing to do. It certainly boots in
a domU without the DMI problem (without any of the other related patches
such as Alexander's).

Signed-off-by: Ian Campbell <ijc@hellion.org.uk>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Tested-by: Mark McLoughlin <markmc@redhat.com>
Acked-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
16 years agox86: not set node to cpu_to_node if the node is not online
Yinghai Lu [Tue, 19 Feb 2008 23:35:54 +0000 (15:35 -0800)]
x86: not set node to cpu_to_node if the node is not online

resolve boot problem reported by Mel Gorman:

   http://lkml.org/lkml/2008/2/13/404

init_cpu_to_node will use cpu->apic (from MADT or mptable) and
apic->node(from SRAT or AMD config space with k8_bus_64.c) to have
cpu->node mapping, and later identify_cpu will overwrite them
again...(with nearby_node...)

this patch checks if the node is online, otherwise it will not
update cpu_node map. so keep cpu_node map to online node before
identify_cpu..., to prevent possible error.

Signed-off-by: Yinghai Lu <yinghai.lu@sun.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
16 years agox86, i387: fix ptrace leakage using init_fpu()
Suresh Siddha [Mon, 3 Mar 2008 21:01:08 +0000 (13:01 -0800)]
x86, i387: fix ptrace leakage using init_fpu()

This bug got introduced by the recent i387 merge:

  commit 4421011120b2304e5c248ae4165a2704588aedf1
  Author: Roland McGrath <roland@redhat.com>
  Date:   Wed Jan 30 13:31:50 2008 +0100

      x86: x86 i387 user_regset

Current usage of unlazy_fpu() in ptrace specific routines is wrong.
unlazy_fpu() will not init fpu if the task never used math. So the
ptrace calls can expose the parent tasks FPU data in some cases.

Replace it with the init_fpu() which will init the math state, if the
task never used math before.

Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
16 years agoMerge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
Linus Torvalds [Tue, 4 Mar 2008 16:08:05 +0000 (08:08 -0800)]
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block

* 'for-linus' of git://git.kernel.dk/linux-2.6-block:
  block: fix blkdev_issue_flush() not detecting and passing EOPNOTSUPP back
  block: fix shadowed variable warning in blk-map.c
  block: remove extern on function definition
  cciss: remove READ_AHEAD define and use block layer defaults
  make cdrom.c:check_for_audio_disc() static
  block/genhd.c: proper externs
  unexport blk_rq_map_user_iov
  unexport blk_{get,put}_queue
  block/genhd.c: cleanups
  proper prototype for blk_dev_init()
  block/blk-tag.c should #include "blk.h"
  Fix DMA access of block device in 64-bit kernel on some non-x86 systems with 4GB or upper 4GB memory
  block: separate out padding from alignment
  block: restore the meaning of rq->data_len to the true data length
  resubmit: cciss: procfs updates to display info about many
  splice: only return -EAGAIN if there's hope of more data
  block: fix kernel-docbook parameters and files

16 years agom68k{,nommu}: Wire up new timerfd syscalls
Geert Uytterhoeven [Tue, 4 Mar 2008 08:18:16 +0000 (09:18 +0100)]
m68k{,nommu}: Wire up new timerfd syscalls

m68k{,nommu}: Wire up the new timerfd syscalls, which were introduced in
commit 4d672e7ac79b5ec5cdc90e450823441e20464691 ("timerfd: new timerfd API").

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Greg Ungerer <gerg@uclinux.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agom68knommu: fix fec driver interrupt races
Greg Ungerer [Tue, 4 Mar 2008 06:52:01 +0000 (16:52 +1000)]
m68knommu: fix fec driver interrupt races

The FEC driver has a common interrupt handler for all interrupt event
types. It is raised on a number of distinct interrupt vectors.
This handler can't be re-entered while processing an interrupt, so
make sure all requested vectors are flagged as IRQF_DISABLED.

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agom68knommu: declare do_IRQ()
Greg Ungerer [Tue, 4 Mar 2008 06:35:04 +0000 (16:35 +1000)]
m68knommu: declare do_IRQ()

Need a declaration of do_IRQ for the 68328 interrupt handling code.
It is common to all m68knommu targets, so a common declaration makes
sense.

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agom68knommu: remove duplicate hw_tick() code
Greg Ungerer [Tue, 4 Mar 2008 06:24:17 +0000 (16:24 +1000)]
m68knommu: remove duplicate hw_tick() code

Remove duplicate hw_tick() function from 68328 timers code.

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agom68knommu: update defconfig
Greg Ungerer [Tue, 4 Mar 2008 05:44:23 +0000 (15:44 +1000)]
m68knommu: update defconfig

Update the m68knommu defconfig.

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoBuild fix for drivers/s390/char/defkeymap.c
Tony Breeds [Tue, 4 Mar 2008 05:05:06 +0000 (16:05 +1100)]
Build fix for drivers/s390/char/defkeymap.c

Commit 5ce2087ed0eb424e0889bdc9102727f65d2ecdde (Fix default compose
table initialization) left a trailing quote.

  CC      drivers/s390/char/defkeymap.o
drivers/s390/char/defkeymap.c:155: error: missing terminating ' character
drivers/s390/char/defkeymap.c:156: error: syntax error before ';' token
make[3]: *** [drivers/s390/char/defkeymap.o] Error 1

Fix that.

Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
Linus Torvalds [Tue, 4 Mar 2008 16:00:34 +0000 (08:00 -0800)]
Merge git://git./linux/kernel/git/sfrench/cifs-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6:
  [CIFS] remove unused variable
  [CIFS] consolidate duplicate code in posix/unix inode handling
  [CIFS] fix build break when proc disabled
  [CIFS] factoring out common code in get_inode_info functions
  [CIFS] fix prepath conversion when server supports posix paths
  [CIFS] Only convert / when server does not support posix paths
  [CIFS] Fix mixed case name in structure dfs_info3_param
  [CIFS] fixup prefixpaths which contain multiple path components
  [CIFS] fix typo
  [CIFS] patch to fix incorrect encoding of number of aces on set mode
  [CIFS] Fix typo in quota operations
  [CIFS] clean up some hard to read ifdefs
  [CIFS] reduce checkpatch warnings
  [CIFS] fix warning in cifs_spnego.c

16 years agofreezer vs stopped or traced
Roland McGrath [Tue, 4 Mar 2008 04:22:05 +0000 (20:22 -0800)]
freezer vs stopped or traced

This changes the "freezer" code used by suspend/hibernate in its treatment
of tasks in TASK_STOPPED (job control stop) and TASK_TRACED (ptrace) states.

As I understand it, the intent of the "freezer" is to hold all tasks
from doing anything significant.  For this purpose, TASK_STOPPED and
TASK_TRACED are "frozen enough".  It's possible the tasks might resume
from ptrace calls (if the tracer were unfrozen) or from signals
(including ones that could come via timer interrupts, etc).  But this
doesn't matter as long as they quickly block again while "freezing" is
in effect.  Some minor adjustments to the signal.c code make sure that
try_to_freeze() very shortly follows all wakeups from both kinds of
stop.  This lets the freezer code safely leave stopped tasks unmolested.

Changing this fixes the longstanding bug of seeing after resuming from
suspend/hibernate your shell report "[1] Stopped" and the like for all
your jobs stopped by ^Z et al, as if you had freshly fg'd and ^Z'd them.
It also removes from the freezer the arcane special case treatment for
ptrace'd tasks, which relied on intimate knowledge of ptrace internals.

Signed-off-by: Roland McGrath <roland@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agox86: disable KVM for Voyager and friends
Randy Dunlap [Wed, 20 Feb 2008 17:20:08 +0000 (09:20 -0800)]
x86: disable KVM for Voyager and friends

Most classic Pentiums don't have hardware virtualization extension,
and building kvm with Voyager, Visual Workstation, or NUMAQ
generates spurious failures.

Signed-off-by: Avi Kivity <avi@qumranet.com>
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
16 years agoKVM: VMX: Avoid rearranging switched guest msrs while they are loaded
Avi Kivity [Wed, 27 Feb 2008 14:06:57 +0000 (16:06 +0200)]
KVM: VMX: Avoid rearranging switched guest msrs while they are loaded

KVM tries to run as much as possible with the guest msrs loaded instead of
host msrs, since switching msrs is very expensive.  It also tries to minimize
the number of msrs switched according to the guest mode; for example,
MSR_LSTAR is needed only by long mode guests.  This optimization is done by
setup_msrs().

However, we must not change which msrs are switched while we are running with
guest msr state:

 - switch to guest msr state
 - call setup_msrs(), removing some msrs from the list
 - switch to host msr state, leaving a few guest msrs loaded

An easy way to trigger this is to kexec an x86_64 linux guest.  Early during
setup, the guest will switch EFER to not include SCE.  KVM will stop saving
MSR_LSTAR, and on the next msr switch it will leave the guest LSTAR loaded.
The next host syscall will end up in a random location in the kernel.

Fix by reloading the host msrs before changing the msr list.

Signed-off-by: Avi Kivity <avi@qumranet.com>
16 years agoKVM: MMU: Fix race when instantiating a shadow pte
Avi Kivity [Tue, 26 Feb 2008 20:12:10 +0000 (22:12 +0200)]
KVM: MMU: Fix race when instantiating a shadow pte

For improved concurrency, the guest walk is performed concurrently with other
vcpus.  This means that we need to revalidate the guest ptes once we have
write-protected the guest page tables, at which point they can no longer be
modified.

The current code attempts to avoid this check if the shadow page table is not
new, on the assumption that if it has existed before, the guest could not have
modified the pte without the shadow lock.  However the assumption is incorrect,
as the racing vcpu could have modified the pte, then instantiated the shadow
page, before our vcpu regains control:

  vcpu0        vcpu1

  fault
  walk pte

               modify pte
               fault in same pagetable
               instantiate shadow page

  lookup shadow page
  conclude it is old
  instantiate spte based on stale guest pte

We could do something clever with generation counters, but a test run by
Marcelo suggests this is unnecessary and we can just do the revalidation
unconditionally.  The pte will be in the processor cache and the check can
be quite fast.

Signed-off-by: Avi Kivity <avi@qumranet.com>
16 years agoKVM: Route irq 0 to vcpu 0 exclusively
Avi Kivity [Mon, 25 Feb 2008 08:28:31 +0000 (10:28 +0200)]
KVM: Route irq 0 to vcpu 0 exclusively

Some Linux versions allow the timer interrupt to be processed by more than
one cpu, leading to hangs due to tsc instability.  Work around the issue
by only disaptching the interrupt to vcpu 0.

Problem analyzed (and patch tested) by Sheng Yang.

Signed-off-by: Avi Kivity <avi@qumranet.com>
16 years agoKVM: Avoid infinite-frequency local apic timer
Avi Kivity [Sun, 24 Feb 2008 12:37:50 +0000 (14:37 +0200)]
KVM: Avoid infinite-frequency local apic timer

If the local apic initial count is zero, don't start a an hrtimer with infinite
frequency, locking up the host.

Signed-off-by: Avi Kivity <avi@qumranet.com>