safe/jmp/linux-2.6
16 years agovirtio: fix trivial build bug
Ingo Molnar [Wed, 6 Feb 2008 21:39:45 +0000 (22:39 +0100)]
virtio: fix trivial build bug

fix build bug:

  drivers/virtio/virtio_balloon.c: In function 'fill_balloon':
  drivers/virtio/virtio_balloon.c:98: error: implicit declaration of function 'msleep'

Acked-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: fix mttr trimming
Yinghai Lu [Wed, 6 Feb 2008 21:39:45 +0000 (22:39 +0100)]
x86: fix mttr trimming

Pavel Emelyanov reported that his networking card did not work
and bisected it down to:

"
The commit

  093af8d7f0ba3c6be1485973508584ef081e9f93
  x86_32: trim memory by updating e820

broke my e1000 card: on loading driver says that

  e1000: probe of 0000:04:03.0 failed with error -5

and the interface doesn't appear.
"

on a 32-bit kernel, base will overflow when try to do PAGE_SHIFT,
and highest_addr will always less 4G.

So use pfn instead of address to avoid the overflow when more than
4g RAM is installed on a 32-bit kernel.

Many thanks to Pavel Emelyanov for reporting and testing it.

Bisected-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: Yinghai Lu <yinghai.lu@sun.com>
Tested-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: delay CPA self-test and repeat it
Ingo Molnar [Wed, 6 Feb 2008 21:39:45 +0000 (22:39 +0100)]
x86: delay CPA self-test and repeat it

delay the CPA self-test so that any impact (corruption) of
user-space pagetables can be triggered. Repeat the test
every 30 seconds.

this would have prevented the bug fixed by 8cb2a7c1e95e472b5,
at its source.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: fix 64-bit sections
Sam Ravnborg [Wed, 6 Feb 2008 21:39:45 +0000 (22:39 +0100)]
x86: fix 64-bit sections

fix 64-bit section warnings.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agogeneric: add __FINITDATA
Ingo Molnar [Wed, 6 Feb 2008 21:39:45 +0000 (22:39 +0100)]
generic: add __FINITDATA

Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: remove suprious ifdefs from pageattr.c
Arjan van de Ven [Wed, 6 Feb 2008 21:39:45 +0000 (22:39 +0100)]
x86: remove suprious ifdefs from pageattr.c

The .rodata section really should just be read only; the config option
is there to make breaking up the 2Mb page an option (so people whos machines
give more performance for the 2Mb case can opt to do so).
But when the page gets split anyway, this is no longer an issue, so
clean up the code and remove the ifdefs

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: mark the .rodata section also NX
Arjan van de Ven [Wed, 6 Feb 2008 21:39:45 +0000 (22:39 +0100)]
x86: mark the .rodata section also NX

The .rodata section shouldn't just be read-only,
but also non-executable. This is free since we've broken
up the 2MB page already anyway.

also update test_nx to check for this.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: fix iret exception recovery on 64-bit
Roland McGrath [Wed, 6 Feb 2008 21:39:45 +0000 (22:39 +0100)]
x86: fix iret exception recovery on 64-bit

This change broke recovery of exceptions in iret:

   commit 72fe4858544292ad64600765cb78bc02298c6b1c
   Author: Glauber de Oliveira Costa <gcosta@redhat.com>

       x86: replace privileged instructions with paravirt macros

The ENTRY(native_iret) macro adds alignment padding before the iretq
instruction, so "iret_label" no longer points exactly at the instruction.
It was sloppy to leave the old "iret_label" label behind when replacing
its nearby use.  Removing it would have revealed the other use of the
label later in the file, and upon noticing that use, anyone exercising
the minimum of attention to detail expected of anyone touching this
subtle code would realize it needed to change as well.

Signed-off-by: Roland McGrath <roland@redhat.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agocpuidle: dubious one-bit signed bitfield in cpuidle.h
Harvey Harrison [Wed, 6 Feb 2008 21:39:44 +0000 (22:39 +0100)]
cpuidle: dubious one-bit signed bitfield in cpuidle.h

fix these sparse warnings:

  CHECK   arch/x86/kernel/acpi/cstate.c
include/linux/cpuidle.h:82:17: error: dubious one-bit signed bitfield
  CHECK   arch/x86/kernel/acpi/processor.c
include/linux/cpuidle.h:82:17: error: dubious one-bit signed bitfield
  CHECK   arch/x86/kernel/cpu/cpufreq/powernow-k7.c
include/linux/cpuidle.h:82:17: error: dubious one-bit signed bitfield
  CHECK   arch/x86/kernel/cpu/cpufreq/powernow-k8.c
include/linux/cpuidle.h:82:17: error: dubious one-bit signed bitfield
  CHECK   arch/x86/kernel/cpu/cpufreq/longhaul.c
include/linux/cpuidle.h:82:17: error: dubious one-bit signed bitfield
  CHECK   arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
include/linux/cpuidle.h:82:17: error: dubious one-bit signed bitfield

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: fix sparse warnings in powernow-k8.c
Harvey Harrison [Wed, 6 Feb 2008 21:39:44 +0000 (22:39 +0100)]
x86: fix sparse warnings in powernow-k8.c

arch/x86/kernel/cpu/cpufreq/powernow-k8.c:830:7: warning: symbol 'hi' shadows an earlier one
arch/x86/kernel/cpu/cpufreq/powernow-k8.c:824:6: originally declared here
arch/x86/kernel/cpu/cpufreq/powernow-k8.c:830:15: warning: symbol 'lo' shadows an earlier one
arch/x86/kernel/cpu/cpufreq/powernow-k8.c:824:14: originally declared here

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: fix sparse error in traps_32.c
Harvey Harrison [Wed, 6 Feb 2008 21:39:44 +0000 (22:39 +0100)]
x86: fix sparse error in traps_32.c

This was being used to ensure the proper alignment of the FXSAVE/FXRSTOR data.
This would create a sparse error in the _correct_ cases, hiding further
warnings.  Use BUILD_BUG_ON instead.

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: trivial sparse/checkpatch in quirks.c
Harvey Harrison [Wed, 6 Feb 2008 21:39:44 +0000 (22:39 +0100)]
x86: trivial sparse/checkpatch in quirks.c

arch/x86/kernel/quirks.c:384:3: warning: returning void-valued expression
arch/x86/kernel/quirks.c:387:3: warning: returning void-valued expression
arch/x86/kernel/quirks.c:390:3: warning: returning void-valued expression
arch/x86/kernel/quirks.c:393:3: warning: returning void-valued expression

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86 ptrace: disallow null cs/ss
Roland McGrath [Wed, 6 Feb 2008 21:39:44 +0000 (22:39 +0100)]
x86 ptrace: disallow null cs/ss

In my revamp of the x86 ptrace code for setting register values,
I accidentally omitted a check that was there in the old code.
Allowing %cs to be 0 causes a bad crash in recovery from iret failure.
This patch fixes that regression against 2.6.24, and adds a comment
that should help prevent this subtlety from being overlooked again.

Signed-off-by: Roland McGrath <roland@redhat.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agoMAINTAINERS: RDC R-321x SoC maintainer
Florian Fainelli [Wed, 6 Feb 2008 21:39:44 +0000 (22:39 +0100)]
MAINTAINERS: RDC R-321x SoC maintainer

Signed-off-by: Florian Fainelli <florian.fainelli@telecomint.eu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agobrk randomization: introduce CONFIG_COMPAT_BRK
Ingo Molnar [Wed, 6 Feb 2008 21:39:44 +0000 (22:39 +0100)]
brk randomization: introduce CONFIG_COMPAT_BRK

based on similar patch from: Pavel Machek <pavel@ucw.cz>

Introduce CONFIG_COMPAT_BRK. If disabled then the kernel is free
(but not obliged to) randomize the brk area.

Heap randomization breaks ancient binaries, so we keep COMPAT_BRK
enabled by default.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agobrk: check the lower bound properly
Jiri Kosina [Wed, 6 Feb 2008 21:39:44 +0000 (22:39 +0100)]
brk: check the lower bound properly

There is a check in sys_brk(), that tries to make sure that we do not
underflow the area that is dedicated to brk heap.

The check is however wrong, as it assumes that brk area starts immediately
after the end of the code (+bss), which is wrong for example in
environments with randomized brk start. The proper way is to check whether
the address is not below the start_brk address.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: remove X2 workaround
Ingo Molnar [Wed, 6 Feb 2008 21:39:44 +0000 (22:39 +0100)]
x86: remove X2 workaround

With the spurious handler fix, the X2 does not lock up anymore.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: make spurious fault handler aware of large mappings
Thomas Gleixner [Wed, 6 Feb 2008 21:39:43 +0000 (22:39 +0100)]
x86: make spurious fault handler aware of large mappings

In very rare cases, on certain CPUs, we could end up in the spurious
fault handler and ignore a large pud/pmd mapping. The resulting pte
pointer points into the mapped physical space and dereferencing it
will fault recursively.

Make the code aware of large mappings and do the permission check
on the pmd/pud entry, when a large pud/pmd mapping is detected.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: make traps on entry code be debuggable in user space, 64-bit
Roland McGrath [Wed, 6 Feb 2008 21:39:43 +0000 (22:39 +0100)]
x86: make traps on entry code be debuggable in user space, 64-bit

Unify the x86-64 behavior for 32-bit processes that set
bogus %cs/%ss values (the only ones that can fault in iret)
match what the native i386 behavior is. (do not kill the task
via do_exit but generate a SIGSEGV signal)

[ tglx@linutronix.de: build fix ]

Signed-off-by: Roland McGrath <roland@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6
Linus Torvalds [Wed, 6 Feb 2008 03:06:25 +0000 (19:06 -0800)]
Merge git://git./linux/kernel/git/bart/ide-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6: (29 commits)
  ide-tape: bump minor driver version
  ide-tape: cleanup the remaining codestyle issues
  ide-tape: fix syntax error in idetape_identify_device()
  ide-tape: remove leftover OnStream support warning
  ide-tape: collect module-related macro calls at the end
  ide-tape: include proper headers
  ide-tape: remove unused "length" arg from idetape_create_read_buffer_cmd()
  ide-tape: remove struct idetape_id_gcw
  ide-tape: cleanup and fix comments
  ide-tape: shorten some function names
  ide-tape: remove idetape_increase_max_pipeline_stages()
  ide-tape: struct idetape_tape_t: shorten member names v2
  ide-tape: struct idetape_tape_t: remove unused members
  ide-tape: remove typedef idetape_chrdev_direction_t
  ide-tape: simplify code branching in the interrupt handler
  ide-tape: remove unreachable code chunk
  ide-tape: remove struct idetape_read_position_result_t
  ide-tape: refactor the debug logging facility
  ide: add ide_read_error() inline helper
  ide: add ide_read_[alt]status() inline helpers
  ...

16 years agoMerge branch 'dmapool' of git://git.kernel.org/pub/scm/linux/kernel/git/willy/misc
Linus Torvalds [Wed, 6 Feb 2008 03:05:48 +0000 (19:05 -0800)]
Merge branch 'dmapool' of git://git./linux/kernel/git/willy/misc

* 'dmapool' of git://git.kernel.org/pub/scm/linux/kernel/git/willy/misc:
  pool: Improve memory usage for devices which can't cross boundaries
  Change dmapool free block management
  dmapool: Tidy up includes and add comments
  dmapool: Validate parameters to dma_pool_create
  Avoid taking waitqueue lock in dmapool
  dmapool: Fix style problems
  Move dmapool.c to mm/ directory

16 years agoide-tape: bump minor driver version
Borislav Petkov [Wed, 6 Feb 2008 01:57:55 +0000 (02:57 +0100)]
ide-tape: bump minor driver version

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: cleanup the remaining codestyle issues
Borislav Petkov [Wed, 6 Feb 2008 01:57:54 +0000 (02:57 +0100)]
ide-tape: cleanup the remaining codestyle issues

... thus decreasing checkpatch.pl errors to 0.

Bart:
- remove needless function prototypes while at it
- remove needless parentheses while at it
- add missing KERN_ level to ide_tape_probe()
- other minor fixups

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: fix syntax error in idetape_identify_device()
Borislav Petkov [Wed, 6 Feb 2008 01:57:54 +0000 (02:57 +0100)]
ide-tape: fix syntax error in idetape_identify_device()

Spotted by Sergei Shtylyov.

CC: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: remove leftover OnStream support warning
Borislav Petkov [Wed, 6 Feb 2008 01:57:54 +0000 (02:57 +0100)]
ide-tape: remove leftover OnStream support warning

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: collect module-related macro calls at the end
Borislav Petkov [Wed, 6 Feb 2008 01:57:54 +0000 (02:57 +0100)]
ide-tape: collect module-related macro calls at the end

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: include proper headers
Borislav Petkov [Wed, 6 Feb 2008 01:57:54 +0000 (02:57 +0100)]
ide-tape: include proper headers

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: remove unused "length" arg from idetape_create_read_buffer_cmd()
Borislav Petkov [Wed, 6 Feb 2008 01:57:54 +0000 (02:57 +0100)]
ide-tape: remove unused "length" arg from idetape_create_read_buffer_cmd()

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: remove struct idetape_id_gcw
Borislav Petkov [Wed, 6 Feb 2008 01:57:53 +0000 (02:57 +0100)]
ide-tape: remove struct idetape_id_gcw

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: cleanup and fix comments
Borislav Petkov [Wed, 6 Feb 2008 01:57:53 +0000 (02:57 +0100)]
ide-tape: cleanup and fix comments

Also, remove redundant ones and cleanup whitespace.

Bart:
- minor fixups

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: shorten some function names
Borislav Petkov [Wed, 6 Feb 2008 01:57:53 +0000 (02:57 +0100)]
ide-tape: shorten some function names

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: remove idetape_increase_max_pipeline_stages()
Borislav Petkov [Wed, 6 Feb 2008 01:57:52 +0000 (02:57 +0100)]
ide-tape: remove idetape_increase_max_pipeline_stages()

This function was being used only at one place so fold it in there.

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: struct idetape_tape_t: shorten member names v2
Borislav Petkov [Wed, 6 Feb 2008 01:57:52 +0000 (02:57 +0100)]
ide-tape: struct idetape_tape_t: shorten member names v2

Shorten some member names not too aggressively since this driver might be gone
anyway soon.

Bart:
- minor fixes

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: struct idetape_tape_t: remove unused members
Borislav Petkov [Wed, 6 Feb 2008 01:57:52 +0000 (02:57 +0100)]
ide-tape: struct idetape_tape_t: remove unused members

- last_frame_position: only being written to once
- firmware_revision, product_id, vendor_id: used once, remove from struct
  idetape_tape_t and deal with them locally
- firmware_revision_num: only written to once
- tape_still_time_begin: completely unused
- tape_still_time: never written to; remove corresponding code chunk
- uncontrolled_last_pipeline_head: only once written to
- blocks_in_buffer: only written to

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: remove typedef idetape_chrdev_direction_t
Borislav Petkov [Wed, 6 Feb 2008 01:57:52 +0000 (02:57 +0100)]
ide-tape: remove typedef idetape_chrdev_direction_t

.. and replace it with plain enums.

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: simplify code branching in the interrupt handler
Borislav Petkov [Wed, 6 Feb 2008 01:57:52 +0000 (02:57 +0100)]
ide-tape: simplify code branching in the interrupt handler

... by adding a new typedef function pointer idetape_io_buf in order to call
the proper buffer i/o handler depending on the data direction.

Bart:
- move idetape_io_buf before idetape_pc_intr() comment

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: remove unreachable code chunk
Borislav Petkov [Wed, 6 Feb 2008 01:57:52 +0000 (02:57 +0100)]
ide-tape: remove unreachable code chunk

tape->speed_control is set to 1 in idetape_setup(), but, in calculate_speeds()
its value is tested for being 0, 1, or 2. Remove the if-branches where
tape->speed_control != 1 since they are never executed. Also, rename
calculate_speeds() by adding driver's prefix as is with the other function
names.

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: remove struct idetape_read_position_result_t
Borislav Petkov [Wed, 6 Feb 2008 01:57:51 +0000 (02:57 +0100)]
ide-tape: remove struct idetape_read_position_result_t

There should be no functional changes resulting from this patch.

Bart:
- remove needless "!!"

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: refactor the debug logging facility
Borislav Petkov [Wed, 6 Feb 2008 01:57:51 +0000 (02:57 +0100)]
ide-tape: refactor the debug logging facility

Teach the debug logging macro to differentiate between log levels based on the
type of debug level enabled specifically instead of a threshold-based one.
Thus, convert tape->debug_level to a bitmask that is written to over /proc.

Also,
- cleanup and simplify the debug macro thus removing a lot of code lines,
- get rid of unused debug levels,
- adjust the loglevel at several places where it was simply missing (e.g.
  idetape_chrdev_open())
- move the tape ptr initialization up in idetape_chrdev_open() so that we can
  use it in the debug_log macro earlier in the function.

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: add ide_read_error() inline helper
Bartlomiej Zolnierkiewicz [Wed, 6 Feb 2008 01:57:51 +0000 (02:57 +0100)]
ide: add ide_read_error() inline helper

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: add ide_read_[alt]status() inline helpers
Bartlomiej Zolnierkiewicz [Wed, 6 Feb 2008 01:57:51 +0000 (02:57 +0100)]
ide: add ide_read_[alt]status() inline helpers

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: remove ide_setup_ports()
Bartlomiej Zolnierkiewicz [Wed, 6 Feb 2008 01:57:50 +0000 (02:57 +0100)]
ide: remove ide_setup_ports()

ide-cris.c:
* Add cris_setup_ports() helper and use it instead of ide_setup_ports()
  (fixes random value being set in ->io_ports[IDE_IRQ_OFFSET]).

buddha.c:
* Add buddha_setup_ports() helper and use it instead of ide_setup_ports().

falconide.c:
* Add falconide_setup_ports() helper and use it instead of ide_setup_ports(),
  also fix return value of falconide_init() while at it.

gayle.c:
* Add gayle_setup_ports() helper and use it instead of ide_setup_ports().

macide.c:
* Add macide_setup_ports() helper and use it instead of ide_setup_ports()
  (fixes incorrect value being set in ->io_ports[IDE_IRQ_OFFSET]).

q40ide.c:
* Fix q40_ide_setup_ports() comments.

ide.c:
* Remove no longer needed ide_setup_ports().

Cc: Mikael Starvik <starvik@axis.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: remove redundant BUG_ON() from [atapi_]reset_pollfunc()
Bartlomiej Zolnierkiewicz [Wed, 6 Feb 2008 01:57:50 +0000 (02:57 +0100)]
ide: remove redundant BUG_ON() from [atapi_]reset_pollfunc()

Same BUG_ON() is present inside ide_set_handler().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: remove write-only ->sata_misc[] from ide_hwif_t
Bartlomiej Zolnierkiewicz [Wed, 6 Feb 2008 01:57:50 +0000 (02:57 +0100)]
ide: remove write-only ->sata_misc[] from ide_hwif_t

* Remove write-only ->sata_misc[] from ide_hwif_t.

* Remove no longer used SATA_{MISC,PHY,IEN}_OFFSET defines.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoppc: fix #ifdef-s in mediabay driver (take 2)
Bartlomiej Zolnierkiewicz [Wed, 6 Feb 2008 01:57:50 +0000 (02:57 +0100)]
ppc: fix #ifdef-s in mediabay driver (take 2)

* Replace incorrect CONFIG_BLK_DEV_IDE #ifdef in
  check_media_bay() by CONFIG_MAC_FLOPPY one.

* Replace incorrect CONFIG_BLK_DEV_IDE #ifdef-s by
  CONFIG_BLK_DEV_IDE_PMAC ones.

* check_media_bay() is used only by drivers/block/swim3.c
  so make this function available only if CONFIG_MAC_FLOPPY
  is defined.

* check_media_bay_by_base() and media_bay_set_ide_infos()
  are used only by drivers/ide/ppc/pmac.c so so make these
  functions available only if CONFIG_MAC_FLOPPY is defined.

v2:
* Remove ifdefs from function prototypes. (Andrew Morton)

Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-pci-generic: kill the unused ifdef/endif/MODULE code
Denis Cheng [Wed, 6 Feb 2008 01:57:49 +0000 (02:57 +0100)]
ide-pci-generic: kill the unused ifdef/endif/MODULE code

with module_param macro, the __setup code can be killed now:
const __setup("all-generic-ide", ide_generic_all_on);

and the module name "generic.ko" is not descriptive to its functionality,
can be changed in Makefile, the "ide-pci-generic.ko" is better.

the ide-pci-generic.all-generic-ide parameter also documented
in Documentation/kernel-parameters.txt

Signed-off-by: Denis Cheng <crquan@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agodrivers/ide/legacy/hd.c: fix uninitialized var warning
Andrew Morton [Wed, 6 Feb 2008 01:57:49 +0000 (02:57 +0100)]
drivers/ide/legacy/hd.c: fix uninitialized var warning

drivers/ide/legacy/hd.c: In function 'hd_request':
drivers/ide/legacy/hd.c:424: warning: 'stat' may be used uninitialized in this function

gcc is being stupid.

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agodrivers/ide/ide-acpi.c: fix uninitialized var warning
Andrew Morton [Wed, 6 Feb 2008 01:57:49 +0000 (02:57 +0100)]
drivers/ide/ide-acpi.c: fix uninitialized var warning

drivers/ide/ide-acpi.c: In function 'ide_acpi_init':
drivers/ide/ide-acpi.c:175: warning: 'dev_handle' may be used uninitialized in this function

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoPalmchip BK3710 IDE driver
Anton Salnikov [Wed, 6 Feb 2008 01:57:48 +0000 (02:57 +0100)]
Palmchip BK3710 IDE driver

This is Palmchip BK3710 IDE controller support.

The IDE controller logic supports PIO, MultiWord-DMA and Ultra-DMA modes.
Supports interface to Compact Flash (CF) configured in True-IDE mode.

Bart:
- remove dead code
- fix ide_hwif_setup_dma() build problem

Signed-off-by: Anton Salnikov <asalnikov@ru.mvista.com>
Reviewed-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Reviewed-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-generic: probing bugfix
Bartlomiej Zolnierkiewicz [Wed, 6 Feb 2008 01:57:48 +0000 (02:57 +0100)]
ide-generic: probing bugfix

On Tuesday 05 February 2008, Linus Torvalds wrote:
>
> On Sat, 2 Feb 2008, Bartlomiej Zolnierkiewicz wrote:
> >
> > * next part of IDE probing code re-organization saga
> > Â  (that would be me)
>
> This seems to cause very irritating and bogus messages for me:
>
> Â Â Â Â Â Â Probing IDE interface ide0...
> Â Â Â Â Â Â Probing IDE interface ide1...
> Â Â Â Â Â Â ide2: I/O resource 0x0-0x7 not free.
> Â Â Â Â Â Â ide2: ports already in use, skipping probe
> Â Â Â Â Â Â ide3: I/O resource 0x0-0x7 not free.
> Â Â Â Â Â Â ide3: ports already in use, skipping probe
> Â Â Â Â Â Â ide4: I/O resource 0x0-0x7 not free.
> Â Â Â Â Â Â ide4: ports already in use, skipping probe
> Â Â Â Â Â Â ide5: I/O resource 0x0-0x7 not free.
> Â Â Â Â Â Â ide5: ports already in use, skipping probe
> Â Â Â Â Â Â ide6: I/O resource 0x0-0x7 not free.
> Â Â Â Â Â Â ide6: ports already in use, skipping probe
> Â Â Â Â Â Â ide7: I/O resource 0x0-0x7 not free.
> Â Â Â Â Â Â ide7: ports already in use, skipping probe
> Â Â Â Â Â Â ide8: I/O resource 0x0-0x7 not free.
> Â Â Â Â Â Â ide8: ports already in use, skipping probe
> Â Â Â Â Â Â ide9: I/O resource 0x0-0x7 not free.
> Â Â Â Â Â Â ide9: ports already in use, skipping probe
>
> and that's just totally bogus. It shouldn't even request that region,
> since it's not been allocated!

The commit 139ddfcab50e5eabcc88341c8743a990ac1be6a2 ("ide: move handling of
I/O resources out of ide_probe_port()") changed the ordering of hwif->noprobe
check vs ide_hwif_request_regions() call (so that we now reserve I/O regions
before checking for hwif->noprobe).  However ide-generic host driver depended
on hwif->noprobe to be set for skipping probing of empty ide_hwifs[] slots.

Fix it by passing only indexes of non-empty slots to ide_device_add_all()
from ide_generic_init().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agodeprecate smbfs in favour of cifs
Andrew Morton [Tue, 5 Feb 2008 22:22:58 +0000 (14:22 -0800)]
deprecate smbfs in favour of cifs

smbfs is a bit buggy and has no maintainer.  Change it to shout at the user on
the first five mount attempts - tell them to switch to CIFS.

Come December we'll mark it BROKEN and see what happens.

[olecom@flower.upol.cz: documentation update]
Cc: Urban Widmark <urban@teststation.com>
Acked-by: Steven French <sfrench@us.ibm.com>
Signed-off-by: Oleg Verych <olecom@flower.upol.cz>
Cc: Jeff Layton <jlayton@redhat.com>
Cc: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agotimerfd: fix remaining architectures
Andrew Morton [Tue, 5 Feb 2008 22:22:56 +0000 (14:22 -0800)]
timerfd: fix remaining architectures

Cc: David Howells <dhowells@redhat.com>
Cc: Hirokazu Takata <takata@linux-m32r.org>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Kazumoto Kojima <kkojima@rr.iij4u.or.jp>
Cc: Richard Curnow <rc@rc0.org.uk>
Cc: Davide Libenzi <davidel@xmailserver.org>
Cc: Michael Kerrisk <mtk-manpages@gmx.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoFix timerfd breakage on avr32
Haavard Skinnemoen [Tue, 5 Feb 2008 22:22:55 +0000 (14:22 -0800)]
Fix timerfd breakage on avr32

Hmm. Someone removed the timerfd() syscall...

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agostop c_p_a corrupting the pds
Hugh Dickins [Tue, 5 Feb 2008 22:26:01 +0000 (22:26 +0000)]
stop c_p_a corrupting the pds

When change_page_attr splits a large page on x86_32 (without PAE), it is
currently corrupting every process's page directory: fix that by removing
the thinko which passes down a physical instead of a virtual address.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoMerge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6
Linus Torvalds [Tue, 5 Feb 2008 18:24:52 +0000 (10:24 -0800)]
Merge branch 'release' of git://git./linux/kernel/git/aegl/linux-2.6

* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6:
  [IA64] make pfm_get_task work with virtual pids
  [IA64] honor notify_die() returning NOTIFY_STOP
  [IA64] remove dead code: __cpu_{down,die} from !HOTPLUG_CPU
  [IA64] Appoint kvm/ia64 Maintainers
  [IA64] ia64_set_psr should use srlz.i
  [IA64] Export three symbols for module use
  [IA64] mca style cleanup
  [IA64] sn_hwperf semaphore to mutex
  [IA64] generalize attribute of fsyscall_gtod_data
  [IA64] efi.c Add /* never reached */ annotation
  [IA64] efi.c Spelling/punctuation fixes
  [IA64] Make efi.c mostly fit in 80 columns
  [IA64] aliasing-test: fix gcc warnings on non-ia64
  [IA64] Slim-down __clear_bit_unlock
  [IA64] Fix the order of atomic operations in restore_previous_kprobes on ia64
  [IA64] constify function pointer tables
  [IA64] fix userspace compile error in gcc_intrin.h

16 years agoMerge branch 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6
Linus Torvalds [Tue, 5 Feb 2008 18:11:02 +0000 (10:11 -0800)]
Merge branch 'for-linus' of git://git390.osdl.marist.edu/linux-2.6

* 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6:
  [S390] dcss: Initialize workqueue before using it.
  [S390] Remove BUILD_BUG_ON() in vmem code.
  [S390] sclp_tty/sclp_vt220: Fix scheduling while atomic
  [S390] dasd: fix panic caused by alias device offline
  [S390] dasd: add ifcc handling
  [S390] latencytop s390 support.
  [S390] Implement ext2_find_next_bit.
  [S390] Cleanup & optimize bitops.
  [S390] Define GENERIC_LOCKBREAK.
  [S390] console: allow vt220 console to be the only console
  [S390] Fix couple of section mismatches.
  [S390] Fix smp_call_function_mask semantics.
  [S390] Fix linker script.
  [S390] DEBUG_PAGEALLOC support for s390.
  [S390] cio: Add shutdown callback for ccwgroup.
  [S390] cio: Update documentation.
  [S390] cio: Clean up chsc response code handling.
  [S390] cio: make sense id procedure work with partial hardware response

16 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
Linus Torvalds [Tue, 5 Feb 2008 18:09:07 +0000 (10:09 -0800)]
Merge git://git./linux/kernel/git/davem/net-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (21 commits)
  [PKT_SCHED]: vlan tag match
  [NET]: Add if_addrlabel.h to sanitized headers.
  [NET] rtnetlink.c: remove no longer used functions
  [ICMP]: Restore pskb_pull calls in receive function
  [INET]: Fix accidentally broken inet(6)_hash_connect's port offset calculations.
  [NET]: Remove further references to net-modules.txt
  bluetooth rfcomm tty: destroy before tty_close()
  bluetooth: blacklist another Broadcom BCM2035 device
  drivers/bluetooth/btsdio.c: fix double-free
  drivers/bluetooth/bpa10x.c: fix memleak
  bluetooth: uninlining
  bluetooth: hidp_process_hid_control remove unnecessary parameter dealing
  tun: impossible to deassert IFF_ONE_QUEUE or IFF_NO_PI
  hamradio: fix dmascc section mismatch
  [SCTP]: Fix kernel panic while received AUTH chunk with BAD shared key identifier
  [SCTP]: Fix kernel panic while received AUTH chunk while enabled auth
  [IPV4]: Formatting fix for /proc/net/fib_trie.
  [IPV6]: Fix sysctl compilation error.
  [NET_SCHED]: Add #ifdef CONFIG_NET_EMATCH in net/sched/cls_flow.c (latest git broken build)
  [IPV4]: Fix compile error building without CONFIG_FS_PROC
  ...

16 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6
Linus Torvalds [Tue, 5 Feb 2008 18:08:47 +0000 (10:08 -0800)]
Merge git://git./linux/kernel/git/davem/sparc-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6:
  [SPARC64]  pci_sun4v.c: Section fixes.

16 years agoMerge branch 'agp-patches' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied...
Linus Torvalds [Tue, 5 Feb 2008 17:54:10 +0000 (09:54 -0800)]
Merge branch 'agp-patches' of git://git./linux/kernel/git/airlied/agp-2.6

* 'agp-patches' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/agp-2.6:
  agp: remove flush_agp_mappings calls from new flush handling code
  intel-agp: introduce IS_I915 and do some cleanups..
  [intel_agp] fix name for G35 chipset
  intel-agp: fixup resource handling in flush code.
  intel-agp: add new chipset ID
  agp: remove unnecessary pci_dev_put
  agp: remove uid comparison as security check
  fix AGP warning
  agp/intel: Add chipset flushing support for i8xx chipsets.
  intel-agp: add chipset flushing support
  agp: add chipset flushing support to AGP interface

16 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland...
Linus Torvalds [Tue, 5 Feb 2008 17:52:46 +0000 (09:52 -0800)]
Merge branch 'for-linus' of git://git./linux/kernel/git/roland/infiniband

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband:
  RDMA/nes: Add a driver for NetEffect RNICs
  IB/mthca: Return proper error codes from mthca_fmr_alloc()
  IB: Avoid marking __devinitdata as const
  IB/mlx4: Actually print out the driver version
  IB/ib_mthca: Pre-link receive WQEs in Tavor mode
  IB/mthca: Remove checks for srq->first_free < 0
  IB/fmr_pool: Allocate page list for pool FMRs only when caching enabled
  IB/srp: Retry stale connections
  mlx4_core: Don't read reserved fields in mlx4_QUERY_ADAPTER()
  IB/mthca: Don't read reserved fields in mthca_QUERY_ADAPTER()
  IPoIB: Remove a misleading debug print
  IPoIB: Handle bonding failover race for connected neighbours too
  IB/mthca: Fix and simplify page size calculation in mthca_reg_phys_mr()
  IB/ehca: Add PMA support
  IB/ehca: Update sma_attr also in case of disruptive config change
  IB/ehca: Prevent sending UD packets to QP0
  IB/cm: Add interim support for routed paths
  mlx4_core: Fix more section mismatches

16 years agouml: make mconsole_stack namespace-aware
Jeff Dike [Tue, 5 Feb 2008 06:31:29 +0000 (22:31 -0800)]
uml: make mconsole_stack namespace-aware

Also fixed the include syntax while I was there.

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Cc: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agouml: redo the calculation of NR_syscalls
Jeff Dike [Tue, 5 Feb 2008 06:31:29 +0000 (22:31 -0800)]
uml: redo the calculation of NR_syscalls

Redo the calculation of NR_syscalls since that disappeared from i386 and
use a similar mechanism on x86_64.

We now figure out the size of the system call table in arch code and stick
that in syscall_table_size.  arch/um/kernel/skas/syscall.c defines
NR_syscalls in terms of that since its the only thing that needs to know
how many system calls there are.

The old mechananism that was used on x86_64 is gone.

arch/um/include/sysdep-i386/syscalls.h got some formatting since I was
looking at it.

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Cc: WANG Cong <xiyou.wangcong@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agouml: defconfig tweaks
Jeff Dike [Tue, 5 Feb 2008 06:31:28 +0000 (22:31 -0800)]
uml: defconfig tweaks

Tweak the UML defconfig -
      we probably don't need 256 old-style ptys - this slows down udev
noticably
      enable hostfs
      disable slab debugging - another noticable performance hit

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agouml: port mutex conversion
Daniel Walker [Tue, 5 Feb 2008 06:31:27 +0000 (22:31 -0800)]
uml: port mutex conversion

The port_sem is already used as a mutex since it's using DECLARE_MUTEX(), but
the underlying construct is still a semaphore ..  This patch switches it over
to a struct mutex.

Signed-off-by: Daniel Walker <dwalker@mvista.com>
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agouml: mconsole mutex conversion
Daniel Walker [Tue, 5 Feb 2008 06:31:27 +0000 (22:31 -0800)]
uml: mconsole mutex conversion

The plug_mem_mutex is already used as a mutex since it's using
DECLARE_MUTEX(), but the underlying construct is still a semaphore ..  This
patch switches it over to a struct mutex.

Signed-off-by: Daniel Walker <dwalker@mvista.com>
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agouml: LDT mutex conversion
Daniel Walker [Tue, 5 Feb 2008 06:31:26 +0000 (22:31 -0800)]
uml: LDT mutex conversion

The ldt.semaphore conforms to the new struct mutex requirments, so I converted
it to use the new API and changed the name.

Signed-off-by: Daniel Walker <dwalker@mvista.com>
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agouml: use of a public MAC is a warning, not an error
Jeff Dike [Tue, 5 Feb 2008 06:31:25 +0000 (22:31 -0800)]
uml: use of a public MAC is a warning, not an error

Downgrade one of the MAC validity checks.  If it's one that could be possibly
assigned to a physical NIC, then nothing will break.  So, emit a warning in
this case, but keep the requested MAC.

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agouml: fix infinite mconsole loop
Karol Swietlicki [Tue, 5 Feb 2008 06:31:25 +0000 (22:31 -0800)]
uml: fix infinite mconsole loop

This patch takes care of a problem with the stopping code.

The function inside the while condition returns 0 to signify a problem.  A
problem could be for example a bad command or a bad version of the mconsole
client.  A bad command would terminate the stopping loop and resume the
kernel.  This is a problem.

A better solution is to make the loop infinite and don't leave it until we are
explicitly told to.

Signed-off-by: Karol Swietlicki <magotari@gmail.com>
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agouml: remove map_cb
Jeff Dike [Tue, 5 Feb 2008 06:31:24 +0000 (22:31 -0800)]
uml: remove map_cb

John Reiser noticed that a physical memory region was being mapped twice.

This patch fixes that, and it inlines the responsible function, as that had
only one caller.

Cc: John Reiser <jreiser@BitWagon.com>
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agouml: remove TOPDIR
WANG Cong [Tue, 5 Feb 2008 06:31:23 +0000 (22:31 -0800)]
uml: remove TOPDIR

TOPDIR is obsolete, use srctree instead.  This patch removes TOPDIR from all
UML Makefiles.

Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agouml: remove unused fields from mm_context
Jeff Dike [Tue, 5 Feb 2008 06:31:22 +0000 (22:31 -0800)]
uml: remove unused fields from mm_context

The 3-level page table fixes forgot to remove a couple now-unused fields from
struct mm_context.

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agouml: move register initialization
Jeff Dike [Tue, 5 Feb 2008 06:31:22 +0000 (22:31 -0800)]
uml: move register initialization

Calling init_registers inside the skas3 checking causes mysterious crashes if
it doesn't happen because the skas3 checking is bypassed.  This patch moves it
to os_early_checks.

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agouml: add newlines to printks
Jeff Dike [Tue, 5 Feb 2008 06:31:21 +0000 (22:31 -0800)]
uml: add newlines to printks

Some printks were missing newlines.

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agouml: style fixes in arch/um/sys-x86_64
Jeff Dike [Tue, 5 Feb 2008 06:31:20 +0000 (22:31 -0800)]
uml: style fixes in arch/um/sys-x86_64

Style fixes in arch/um/sys-x86_64:
updated copyrights
CodingStyle fixes
added severities to printks which needed them

A bunch of functions in sys-*/ptrace_user.c turn out to be unused, so they and
their declarations are gone.

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agouml: add back CONFIG_HZ
Jeff Dike [Tue, 5 Feb 2008 06:31:19 +0000 (22:31 -0800)]
uml: add back CONFIG_HZ

avoid-overflows-in-kernel-timec.patch makes CONFIG_HZ necessary for a
successful build.  UML lacks a definition, so this patch adds one.  It also
changes the hard-wired definition of HZ to CONFIG_HZ.

Note: this patch is a good idea even in the absence of hpa's time fixes.

Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agouml: DEBUG_SHIRQ fixes
Jeff Dike [Tue, 5 Feb 2008 06:31:19 +0000 (22:31 -0800)]
uml: DEBUG_SHIRQ fixes

A couple more DEBUG_SHIRQ fixes.

The previous mconsole blocking fix exposed the lack of O_NONBLOCK on the
mconsole socket.

Also, winch_interrupt started crashing because it is called at irq free time
and it tries to dereference tty->driver_data, which has already been set to
NULL.

I added some error cleanup in mconsole_init while I was there.

Cc: "Karol Swietlicki" <magotari@gmail.com>
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agouml: remove fakehd
Jeff Dike [Tue, 5 Feb 2008 06:31:18 +0000 (22:31 -0800)]
uml: remove fakehd

The fakehd switch lost its implementation at some point.  Since no one is
screaming for it, we might as well remove it.

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agouml: implement O_APPEND
Jeff Dike [Tue, 5 Feb 2008 06:31:18 +0000 (22:31 -0800)]
uml: implement O_APPEND

The .a flags in openflags never had an implementation.

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agouml: SMP locking commentary
Jeff Dike [Tue, 5 Feb 2008 06:31:17 +0000 (22:31 -0800)]
uml: SMP locking commentary

Add some more commentary about various pieces of global data not needing
locking.

Also got rid of unmap_physmem since that is no longer used.

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agouml: remove init_irq_signals
Jeff Dike [Tue, 5 Feb 2008 06:31:16 +0000 (22:31 -0800)]
uml: remove init_irq_signals

init_irq_signals doesn't need to be called from the context of a new process.
It initializes handlers, which are useless in process context.  With that call
gone, init_irq_signals has only one caller, so it can be inlined into
init_new_thread_signals.

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agouml: signal handling tidying
Jeff Dike [Tue, 5 Feb 2008 06:31:16 +0000 (22:31 -0800)]
uml: signal handling tidying

This patch tidies the signal handling code slightly.

pending is renamed to signals_pending for symmetry with signals_enabled.

remove_sigstack was unused, so can be deleted.

The value of change_sig was never used, so it is now void and the
return value is not calculated any more.

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agouml: fix hostfs tv_usec calculations
Dominique Quatravaux [Tue, 5 Feb 2008 06:31:15 +0000 (22:31 -0800)]
uml: fix hostfs tv_usec calculations

To convert from tv_nsec to tv_usec, one needs to divide by 1000, not multiply.

Signed-off-by: Dominique Quatravaux <dominique@quatravaux.org>
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agouml: style fixes in arch/um/kernel
Jeff Dike [Tue, 5 Feb 2008 06:31:14 +0000 (22:31 -0800)]
uml: style fixes in arch/um/kernel

Joe Perches noticed some printks in smp.c that needed fixing.

While I was in there, I did the usual tidying in arch/um/kernel, which
should be fairly style-clean at this point:
copyright updates
emacs formatting comments removal
include tidying
style fixes

Cc: Joe Perches <joe@perches.com>
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agouml: clean up sig_handler_common_skas
Jeff Dike [Tue, 5 Feb 2008 06:31:13 +0000 (22:31 -0800)]
uml: clean up sig_handler_common_skas

sig_handler_common_skas needs significant modernization, starting with
its name and storage class.

There is no need to hide the true type of the sigcontext pointer, so
the void * dummy parameter can be replaced with a sigcontext *sc.

The array of uml_pt_regs structs used in the page fault case are gone,
replaced by a local variable.  This is also used in the non-segfault
case instead of the copy in the task_struct.  Since it's local, the
special handling of the is_user flag can go away.

There hasn't been any special treatment of SIGUSR1 in ages, so the
line that enables it can be deleted.

The special treatment of SIGSEGV similarly goes away, but to
compensate, SA_NODEFER is added to sa_mask when registering a signal
handler.

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agouml: move sig_handler_common_skas
Jeff Dike [Tue, 5 Feb 2008 06:31:12 +0000 (22:31 -0800)]
uml: move sig_handler_common_skas

This patch moves sig_handler_common_skas from
arch/um/os-Linux/skas/trap.c to its only caller in
arch/um/os-Linux/signal.c.  trap.c is now empty, so it can be removed.

This is code movement only - the significant cleanup needed here is
done in the next patch.

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agouml: don't allow processes to call into stub
Jeff Dike [Tue, 5 Feb 2008 06:31:12 +0000 (22:31 -0800)]
uml: don't allow processes to call into stub

Kill a process that tries to branch into a stub and execute a system
call.  There are no security implications here - a system call in a
stub is treated the same as a system call anywhere else.  But if a
process is trying to branch into a stub, either it is trying something
nasty or it has gone haywire, so it's a good idea to get rid of it in
either case.

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agouml: get rid of syscall counters
Jeff Dike [Tue, 5 Feb 2008 06:31:11 +0000 (22:31 -0800)]
uml: get rid of syscall counters

Get rid of some syscall counters which haven't been useful in ages.

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agouml: don't kill pid 0
Jeff Dike [Tue, 5 Feb 2008 06:31:10 +0000 (22:31 -0800)]
uml: don't kill pid 0

A bit of defensive programming - during development, it ocassionally
happens that a call to init_new_context is missed, resulting in
context holding a host pid of zero.  When that address space is torn
down, destroy_context does a kill(0), which instantly kills the whole
UML without any errors whatsoever.

This patch add a check for pids less than 2, to also catch 1 and
negative pids.

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agouml: tidy helper code
Jeff Dike [Tue, 5 Feb 2008 06:31:10 +0000 (22:31 -0800)]
uml: tidy helper code

Style fixes to arch/um/os/helper.c and tidying up the breakpoint fix a
bit.

helper.c gets all the usual style fixes -
 updated copyright
 all printks get severities

Also -
 errval changes to err in helper_child
 fixed an obsolete comment
 run_helper was killing a child process which is guaranteed to
be dead or dying anyway

Removed the nohang and pname arguments from helper_wait and fixed the
declaration and callers.  nohang was used only in the slirp driver and
I don't think it was needed.  I think pname was a bit of overkill in
putting out an error message when something goes wrong.

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agouml: use barrier() instead of mb()
Jeff Dike [Tue, 5 Feb 2008 06:31:09 +0000 (22:31 -0800)]
uml: use barrier() instead of mb()

signals_enabled and pending have requirements on the order in which they are
modified.  This used to be done by declaring them volatile and putting an mb()
where the ordering requirements were in effect.

After getting a better (I hope) understanding of how to do this correctly, the
volatile declarations are gone and the mb()'s replaced by barrier()'s.

One of the mb()'s was deleted because I see no problematic writes that could
be re-ordered past that point.

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agouml: install panic notifier earlier
Jeff Dike [Tue, 5 Feb 2008 06:31:08 +0000 (22:31 -0800)]
uml: install panic notifier earlier

It turns out that if there's a panic early enough, UML will just sit there in
the LED-blinking loop because the panic notifier hadn't been installed yet.

This patch installs it earlier.

It also fixes the problem which exposed the hang, namely that if you give UML
a zero-sized initrd, it will ask alloc_bootmem for zero bytes, and that will
cause the panic.

While I was in initrd.c, I gave it a style makeover.

Prompted by checkpatch, I moved a couple extern declarations of uml_exitcode
to kern_util.h.

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agouml: eliminate setjmp_wrapper
Jeff Dike [Tue, 5 Feb 2008 06:31:07 +0000 (22:31 -0800)]
uml: eliminate setjmp_wrapper

setjmp_wrapper existed to provide setjmp to kernel code when UML used libc's
setjmp and longjmp.  Now that UML has its own implementation, this isn't
needed and kernel code can invoke setjmp directly.

do_buffer_op is massively cleaned up since it is no longer a callback from
setjmp_wrapper and given a va_list from which it must extract its arguments.

The actual setjmp is moved from buffer_op to do_op_one_page because the copy
operation is inside an atomic section (kmap_atomic to kunmap_atomic) and it
shouldn't be longjmp-ed out of.

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agouml: customize tlb.h
Jeff Dike [Tue, 5 Feb 2008 06:31:07 +0000 (22:31 -0800)]
uml: customize tlb.h

Customize the hooks in tlb.h to optimize TLB flushing some more.

Add start and end fields to tlb_gather_mmu, which are used to limit
the address space range scanned when a region is unmapped.

The interfaces which just free page tables, without actually changing
mappings, don't need to cause a TLB flush.

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agouml: 64-bit tlb fixes
Jeff Dike [Tue, 5 Feb 2008 06:31:06 +0000 (22:31 -0800)]
uml: 64-bit tlb fixes

Some 64-bit tlb fixes -
moved pmd_page_vaddr to pgtable.h since it's the same for both
2-level and 3-level page tables
fixed a bogus cast on pud_page_vaddr
made the address checking in update_*_range more careful

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agouml: style fixes in file.c
Jeff Dike [Tue, 5 Feb 2008 06:31:05 +0000 (22:31 -0800)]
uml: style fixes in file.c

arch/um/os-Linux/file.c needed some style work -
updated the copyright
cleaned up the includes
CodingStyle fixes
added some missing CATCH_EINTRs
os_set_owner was unused, so it is gone
all printks now have severities
fcntl(F_GETFL) was being called without checking the return
removed an obsolete comment

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agouml: miscellaneous code cleanups
Jeff Dike [Tue, 5 Feb 2008 06:31:04 +0000 (22:31 -0800)]
uml: miscellaneous code cleanups

Code tidying -
the pid field of struct irq_fd isn't used, so it is removed
      os_set_fd_async needed to read flags before changing them, it
doesn't need a pid passed in because it can call getpid itself, and a
block of unused code needed deleting
os_get_exec_close was unused, so it is removed
ptrace_child called _exit for historical reasons which are no
longer valid, so just calls exit instead

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agouml: fix mconsole stop
Karol Swietlicki [Tue, 5 Feb 2008 06:31:04 +0000 (22:31 -0800)]
uml: fix mconsole stop

Bring back the functionality of stopping user mode linux with the help of
mconsole.

[jdike - the bug being fixed is that the mconsole file descriptor is already
set O_NONBLOCK or not, depending on whether we want no blocking (the normal
case) or we want blocking (when an mconsole stop is in effect), so the
MSG_DONTWAIT is redundant in the normal case, and wrong when we want to
block.]

Signed-off-by: Karol Swietlicki <magotari@gmail.com>
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agouml: remove duplicate config symbol and unused file and variables
Karol Swietlicki [Tue, 5 Feb 2008 06:31:03 +0000 (22:31 -0800)]
uml: remove duplicate config symbol and unused file and variables

Fix the repetition of the NET symbol.  It was once in UML specific options and
once in networking.  I removed the first occurrence, as it makes more sense to
me to keep it only in networking.

It also removes a mostly empty file which is not used anymore and some
unused variables.

Signed-off-by: Karol Swietlicki <magotari@gmail.com>
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agouml: syle fixes in arch/um/os-Linux
Jeff Dike [Tue, 5 Feb 2008 06:31:02 +0000 (22:31 -0800)]
uml: syle fixes in arch/um/os-Linux

Style fixes in arch/um/os-Linux/irq.c and arch/um/os-Linux/sigio.c:
Updated copyrights
trimmed includes
added severity indicators to printks
CodingStyle fixes
turned an bunch of panics into printks
call some libc functions directly instead of going through the
os_* wrappers

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agouml: fx command-line CFLAGS and LDFLAGS support
Jeff Dike [Tue, 5 Feb 2008 06:31:02 +0000 (22:31 -0800)]
uml: fx command-line CFLAGS and LDFLAGS support

UML still needed some work in order to allow CFLAGS to be passed in from the
command line.

USER_CFLAGS is produced from KBUILD_CFLAGS in part by removing all the -I
switches.  This is so that kernel headers don't accidentally get pulled into
libc files.  However, a common use of command-line CFLAGS would be to add -I
switches to the build.  This patch specifically adds any command-line -I flags
back to USER_CFLAGS.

I also corrected the spelling of LFLAGS to LDFLAGS.

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>