GitHub/LineageOS/android_kernel_motorola_exynos9610.git
16 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/tglx/linux-2.6-hrt
Linus Torvalds [Fri, 18 Apr 2008 15:37:41 +0000 (08:37 -0700)]
Merge git://git./linux/kernel/git/tglx/linux-2.6-hrt

* git://git.kernel.org/pub/scm/linux/kernel/git/tglx/linux-2.6-hrt:
  clocksource: make clocksource watchdog cycle through online CPUs
  Documentation: move timer related documentation to a single place
  clockevents: optimise tick_nohz_stop_sched_tick() a bit
  locking: remove unused double_spin_lock()
  hrtimers: simplify lockdep handling
  timers: simplify lockdep handling
  posix-timers: fix shadowed variables
  timer_list: add annotations to workqueue.c
  hrtimer: use nanosleep specific restart_block fields
  hrtimer: add nanosleep specific restart_block member

16 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/shaggy...
Linus Torvalds [Fri, 18 Apr 2008 15:37:19 +0000 (08:37 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/shaggy/jfs-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/shaggy/jfs-2.6:
  jfs: replace __inline with inline
  jfs: le*_add_cpu conversion

16 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-kgdb
Linus Torvalds [Fri, 18 Apr 2008 15:37:01 +0000 (08:37 -0700)]
Merge git://git./linux/kernel/git/mingo/linux-2.6-kgdb

* git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-kgdb:
  kgdb: always use icache flush for sw breakpoints
  kgdb: fix SMP NMI kgdb_handle_exception exit race
  kgdb: documentation fixes
  kgdb: allow static kgdbts boot configuration
  kgdb: add documentation
  kgdb: Kconfig fix
  kgdb: add kgdb internal test suite
  kgdb: fix several kgdb regressions
  kgdb: kgdboc pl011 I/O module
  kgdb: fix optional arch functions and probe_kernel_*
  kgdb: add x86 HW breakpoints
  kgdb: print breakpoint removed on exception
  kgdb: clocksource watchdog
  kgdb: fix NMI hangs
  kgdb: fix kgdboc dynamic module configuration
  kgdb: document parameters
  x86: kgdb support
  consoles: polling support, kgdboc
  kgdb: core
  uaccess: add probe_kernel_write()

16 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux...
Linus Torvalds [Fri, 18 Apr 2008 15:25:51 +0000 (08:25 -0700)]
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: (613 commits)
  x86: standalone trampoline code
  x86: move suspend wakeup code to C
  x86: coding style fixes to arch/x86/kernel/acpi/sleep.c
  x86: setup_trampoline() - fix section mismatch warning
  x86: section mismatch fixes, #1
  x86: fix paranoia about using BIOS quickboot mechanism.
  x86: print out buggy mptable
  x86: use cpu_online()
  x86: use cpumask_of_cpu()
  x86: remove unnecessary tmp local variable
  x86: remove unnecessary memset()
  x86: use ioapic_read_entry() and ioapic_write_entry()
  x86: avoid redundant loop in io_apic_level_ack_pending()
  x86: remove superfluous initialisation in boot code.
  x86: merge mpparse_{32,64}.c
  x86: unify mp_register_gsi
  x86: unify mp_config_acpi_legacy_irqs
  x86: unify mp_register_ioapic
  x86: unify uniq_io_apic_id
  x86: unify smp_scan_config
  ...

16 years agoMerge branch 'semaphore' of git://git.kernel.org/pub/scm/linux/kernel/git/willy/misc
Linus Torvalds [Fri, 18 Apr 2008 15:25:29 +0000 (08:25 -0700)]
Merge branch 'semaphore' of git://git./linux/kernel/git/willy/misc

* 'semaphore' of git://git.kernel.org/pub/scm/linux/kernel/git/willy/misc:
  Remove DEBUG_SEMAPHORE from Kconfig
  Improve semaphore documentation
  Simplify semaphore implementation
  Add down_timeout and change ACPI to use it
  Introduce down_killable()
  Generic semaphore implementation
  Add semaphore.h to kernel_lock.c
  Fix quota.h includes

16 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland...
Linus Torvalds [Fri, 18 Apr 2008 15:20:06 +0000 (08:20 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/roland/infiniband

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband: (104 commits)
  IB/iser: Don't change itt endianness
  IB/mlx4: Update module version and release date
  IPoIB: Handle case when P_Key is deleted and re-added at same index
  IB/iser: Release connection resources on RDMA_CM_EVENT_DEVICE_REMOVAL event
  IB/mlx4: Fix incorrect comment
  IB/mlx4: Fix race when detaching a QP from a multicast group
  IB/ehca: Support all ibv_devinfo values in query_device() and query_port()
  RDMA/nes: Free IRQ before killing tasklet
  IB/mthca: Update module version and release date
  IB/mlx4: Update QP state if query QP succeeds
  IB/mthca: Update QP state if query QP succeeds
  RDMA/amso1100: Add check for NULL reply_msg in c2_intr()
  IB/mlx4: Add support for resizing CQs
  IB/mlx4: Add support for modifying CQ moderation parameters
  IPoIB: Support modifying IPoIB CQ event moderation
  IB/core: Add support for modify CQ
  IPoIB: Add basic ethtool support
  mlx4_core: Increase max number of QPs to 128K
  RDMA/amso1100: Add support for "send with invalidate" work requests
  IB/core: Add support for "send with invalidate" work requests
  ...

16 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris...
Linus Torvalds [Fri, 18 Apr 2008 15:19:40 +0000 (08:19 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/jmorris/selinux-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/selinux-2.6:
  security: enhance DEFAULT_MMAP_MIN_ADDR description
  SELinux: add netport.[ch]
  SELinux: Add network port SID cache
  SELinux: turn mount options strings into defines
  selinux/ss/services.c should #include <linux/selinux.h>
  selinux: introduce permissive types
  selinux: remove ptrace_sid
  SELinux: requesting no permissions in avc_has_perm_noaudit is a BUG()
  security: code cleanup
  security: replace remaining __FUNCTION__ occurrences
  SELinux: create new open permission
  selinux: selinux/netlabel.c should #include "netlabel.h"
  SELinux: unify printk messages
  SELinux: remove unused backpointers from security objects
  SELinux: Correct the NetLabel locking for the sk_security_struct

16 years agoMerge branch 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6
Linus Torvalds [Fri, 18 Apr 2008 15:19:15 +0000 (08:19 -0700)]
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: (36 commits)
  [S390] Remove code duplication from monreader / dcssblk.
  [S390] kernel: show last breaking-event-address on oops
  [S390] lowcore: Change type of lowcores softirq_pending to __u32.
  [S390] zcrypt: Comments and kernel-doc cleanup
  [S390] uaccess: Always access the correct address space.
  [S390] Fix a lot of sparse warnings.
  [S390] Convert s390 to GENERIC_CLOCKEVENTS.
  [S390] genirq/clockevents: move irq affinity prototypes/inlines to interrupt.h
  [S390] Convert monitor calls to function calls.
  [S390] qdio (new feature): enhancing info-retrieval from QDIO-adapters
  [S390] replace remaining __FUNCTION__ occurrences
  [S390] remove redundant display of free swap space in show_mem()
  [S390] qdio: remove outdated developerworks link.
  [S390] Add debug_register_mode() function to debug feature API
  [S390] crypto: use more descriptive function names for init/exit routines.
  [S390] switch sched_clock to store-clock-extended.
  [S390] zcrypt: add support for large random numbers
  [S390] hw_random: allow rng_dev_read() to return hardware errors.
  [S390] Vertical cpu management.
  [S390] cpu topology support for s390.
  ...

16 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/penberg...
Linus Torvalds [Fri, 18 Apr 2008 15:19:00 +0000 (08:19 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/penberg/slab-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/penberg/slab-2.6:
  slub: No need for per node slab counters if !SLUB_DEBUG
  slub: Move map/flag clearing to __free_slab
  slub: Fixes to per cpu stat output in sysfs
  slub: Deal with config variable dependencies
  slub: Reduce #ifdef ZONE_DMA by moving kmalloc_caches_dma near dma logic
  slub: Initialize per-cpu stats

16 years agoptrace_signal subroutine
Roland McGrath [Fri, 18 Apr 2008 01:44:38 +0000 (18:44 -0700)]
ptrace_signal subroutine

This breaks out the ptrace handling from get_signal_to_deliver into a
new subroutine.  The actual code there doesn't change, and it gets
inlined into nearly identical compiled code.  This makes the function
substantially shorter and thus easier to read, and it nicely isolates
the ptrace magic.

Signed-off-by: Roland McGrath <roland@redhat.com>
Acked-by: Kyle McMartin <kyle@mcmartin.ca>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agocgroup: fix a race condition in manipulating tsk->cg_list
Li Zefan [Thu, 17 Apr 2008 03:37:15 +0000 (11:37 +0800)]
cgroup: fix a race condition in manipulating tsk->cg_list

When I ran a test program to fork mass processes and at the same time
'cat /cgroup/tasks', I got the following oops:

  ------------[ cut here ]------------
  kernel BUG at lib/list_debug.c:72!
  invalid opcode: 0000 [#1] SMP
  Pid: 4178, comm: a.out Not tainted (2.6.25-rc9 #72)
  ...
  Call Trace:
   [<c044a5f9>] ? cgroup_exit+0x55/0x94
   [<c0427acf>] ? do_exit+0x217/0x5ba
   [<c0427ed7>] ? do_group_exit+0.65/0x7c
   [<c0427efd>] ? sys_exit_group+0xf/0x11
   [<c0404842>] ? syscall_call+0x7/0xb
   [<c05e0000>] ? init_cyrix+0x2fa/0x479
  ...
  EIP: [<c04df671>] list_del+0x35/0x53 SS:ESP 0068:ebc7df4
  ---[ end trace caffb7332252612b ]---
  Fixing recursive fault but reboot is needed!

After digging into the code and debugging, I finlly found out a race
situation:

do_exit()
  ->cgroup_exit()
    ->if (!list_empty(&tsk->cg_list))
        list_del(&tsk->cg_list);

  cgroup_iter_start()
    ->cgroup_enable_task_cg_list()
      ->list_add(&tsk->cg_list, ..);

In this case the list won't be deleted though the process has exited.

We got two bug reports in the past, which seem to be the same bug as
this one:
http://lkml.org/lkml/2008/3/5/332
http://lkml.org/lkml/2007/10/17/224

Actually sometimes I got oops on list_del, sometimes oops on list_add.
And I can change my test program a bit to trigger other oops.

The patch has been tested both on x86_32 and x86_64.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: Paul Menage <menage@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agosecurity: enhance DEFAULT_MMAP_MIN_ADDR description
maximilian attems [Wed, 16 Apr 2008 17:36:36 +0000 (19:36 +0200)]
security: enhance DEFAULT_MMAP_MIN_ADDR description

Got burned by setting the proposed default of 65536
across all Debian archs.

Thus proposing to be more specific on which archs you may
set this. Also propose a value for arm and friends that
doesn't break sshd.

Reword to mention working archs ia64 and ppc64 too.

Signed-off-by: maximilian attems <max@stro.at>
Cc: Martin Michlmayr <tbm@cyrius.com>
Cc: Gordon Farquharson <gordonfarquharson@gmail.com>
Acked-by: Eric Paris <eparis@redhat.com>
Signed-off-by: James Morris <jmorris@namei.org>
16 years agoSELinux: add netport.[ch]
James Morris [Mon, 14 Apr 2008 05:09:53 +0000 (15:09 +1000)]
SELinux: add netport.[ch]

Thank you, git.

Signed-off-by: James Morris <jmorris@namei.org>
16 years agoSELinux: Add network port SID cache
Paul Moore [Thu, 10 Apr 2008 14:48:14 +0000 (10:48 -0400)]
SELinux: Add network port SID cache

Much like we added a network node cache, this patch adds a network port
cache. The design is taken almost completely from the network node cache
which in turn was taken from the network interface cache.  The basic idea is
to cache entries in a hash table based on protocol/port information.  The
hash function only takes the port number into account since the number of
different protocols in use at any one time is expected to be relatively
small.

Signed-off-by: Paul Moore <paul.moore@hp.com>
Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: James Morris <jmorris@namei.org>
16 years agoSELinux: turn mount options strings into defines
Eric Paris [Tue, 1 Apr 2008 17:24:09 +0000 (13:24 -0400)]
SELinux: turn mount options strings into defines

Convert the strings used for mount options into #defines rather than
retyping the string throughout the SELinux code.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: James Morris <jmorris@namei.org>
16 years agoselinux/ss/services.c should #include <linux/selinux.h>
Adrian Bunk [Sun, 30 Mar 2008 22:54:02 +0000 (01:54 +0300)]
selinux/ss/services.c should #include <linux/selinux.h>

Every file should include the headers containing the externs for its global
code.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: James Morris <jmorris@namei.org>
16 years agoselinux: introduce permissive types
Eric Paris [Mon, 31 Mar 2008 01:17:33 +0000 (12:17 +1100)]
selinux: introduce permissive types

Introduce the concept of a permissive type.  A new ebitmap is introduced to
the policy database which indicates if a given type has the permissive bit
set or not.  This bit is tested for the scontext of any denial.  The bit is
meaningless on types which only appear as the target of a decision and never
the source.  A domain running with a permissive type will be allowed to
perform any action similarly to when the system is globally set permissive.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: James Morris <jmorris@namei.org>
16 years agoselinux: remove ptrace_sid
Roland McGrath [Wed, 26 Mar 2008 22:46:39 +0000 (15:46 -0700)]
selinux: remove ptrace_sid

This changes checks related to ptrace to get rid of the ptrace_sid tracking.
It's good to disentangle the security model from the ptrace implementation
internals.  It's sufficient to check against the SID of the ptracer at the
time a tracee attempts a transition.

Signed-off-by: Roland McGrath <roland@redhat.com>
Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: James Morris <jmorris@namei.org>
16 years agoSELinux: requesting no permissions in avc_has_perm_noaudit is a BUG()
Eric Paris [Tue, 11 Mar 2008 18:19:34 +0000 (14:19 -0400)]
SELinux: requesting no permissions in avc_has_perm_noaudit is a BUG()

This patch turns the case where we have a call into avc_has_perm with no
requested permissions into a BUG_ON.  All callers to this should be in
the kernel and thus should be a function we need to fix if we ever hit
this.  The /selinux/access permission checking it done directly in the
security server and not through the avc, so those requests which we
cannot control from userspace should not be able to trigger this BUG_ON.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Stephen D. Smalley <sds@tycho.nsa.gov>
Signed-off-by: James Morris <jmorris@namei.org>
16 years agosecurity: code cleanup
Andrew Morton [Wed, 5 Mar 2008 23:05:08 +0000 (10:05 +1100)]
security: code cleanup

ERROR: "(foo*)" should be "(foo *)"
#168: FILE: security/selinux/hooks.c:2656:
+        "%s, rc=%d\n", __func__, (char*)value, -rc);

total: 1 errors, 0 warnings, 195 lines checked

./patches/security-replace-remaining-__function__-occurences.patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

Please run checkpatch prior to sending patches

Cc: Harvey Harrison <harvey.harrison@gmail.com>
Cc: James Morris <jmorris@namei.org>
Cc: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: James Morris <jmorris@namei.org>
16 years agosecurity: replace remaining __FUNCTION__ occurrences
Harvey Harrison [Wed, 5 Mar 2008 23:03:59 +0000 (10:03 +1100)]
security: replace remaining __FUNCTION__ occurrences

__FUNCTION__ is gcc-specific, use __func__

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Cc: James Morris <jmorris@namei.org>
Cc: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: James Morris <jmorris@namei.org>
16 years agoSELinux: create new open permission
Eric Paris [Thu, 28 Feb 2008 17:58:40 +0000 (12:58 -0500)]
SELinux: create new open permission

Adds a new open permission inside SELinux when 'opening' a file.  The idea
is that opening a file and reading/writing to that file are not the same
thing.  Its different if a program had its stdout redirected to /tmp/output
than if the program tried to directly open /tmp/output. This should allow
policy writers to more liberally give read/write permissions across the
policy while still blocking many design and programing flaws SELinux is so
good at catching today.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
Reviewed-by: Paul Moore <paul.moore@hp.com>
Signed-off-by: James Morris <jmorris@namei.org>
16 years agoselinux: selinux/netlabel.c should #include "netlabel.h"
Adrian Bunk [Wed, 27 Feb 2008 21:20:42 +0000 (23:20 +0200)]
selinux: selinux/netlabel.c should #include "netlabel.h"

Every file should include the headers containing the externs for its
global code.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Acked-by: Paul Moore <paul.moore@hp.com>
Signed-off-by: James Morris <jmorris@namei.org>
16 years agoSELinux: unify printk messages
James Morris [Tue, 26 Feb 2008 09:42:02 +0000 (20:42 +1100)]
SELinux: unify printk messages

Replace "security:" prefixes in printk messages with "SELinux"
to help users identify the source of the messages.  Also fix a
couple of minor formatting issues.

Signed-off-by: James Morris <jmorris@namei.org>
16 years agoSELinux: remove unused backpointers from security objects
James Morris [Mon, 25 Feb 2008 22:52:58 +0000 (09:52 +1100)]
SELinux: remove unused backpointers from security objects

Remove unused backpoiters from security objects.

Signed-off-by: James Morris <jmorris@namei.org>
16 years agoSELinux: Correct the NetLabel locking for the sk_security_struct
Paul Moore [Mon, 25 Feb 2008 16:40:33 +0000 (11:40 -0500)]
SELinux: Correct the NetLabel locking for the sk_security_struct

The RCU/spinlock locking approach for the nlbl_state in the sk_security_struct
was almost certainly overkill.  This patch removes both the RCU and spinlock
locking, relying on the existing socket locks to handle the case of multiple
writers.  This change also makes several code reductions possible.

Less locking, less code - it's a Good Thing.

Signed-off-by: Paul Moore <paul.moore@hp.com>
Signed-off-by: James Morris <jmorris@namei.org>
16 years agokgdb: always use icache flush for sw breakpoints
Jason Wessel [Tue, 1 Apr 2008 21:55:28 +0000 (16:55 -0500)]
kgdb: always use icache flush for sw breakpoints

On the ppc 4xx architecture the instruction cache must be flushed as
well as the data cache.  This patch just makes it generic for all
architectures where CACHE_FLUSH_IS_SAFE is set to 1.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agokgdb: fix SMP NMI kgdb_handle_exception exit race
Jason Wessel [Tue, 1 Apr 2008 21:55:27 +0000 (16:55 -0500)]
kgdb: fix SMP NMI kgdb_handle_exception exit race

Fix the problem of protecting the kgdb handle_exception exit
which had an NMI race condition, while trying to restore
normal system operation.

There was a small window after the master processor sets cpu_in_debug
to zero but before it has set kgdb_active to zero where a
non-master processor in an SMP system could receive an NMI and
re-enter the kgdb_wait() loop.

As long as the master processor sets the cpu_in_debug before sending
the cpu roundup the cpu_in_debug variable can also be used to guard
against the race condition.

The kgdb_wait() function no longer needs to check
kgdb_active because it is done in the arch specific code
and handled along with the nmi traps at the low level.
This also allows kgdb_wait() to exit correctly if it was
entered for some unknown reason due to a spurious NMI that
could not be handled by the arch specific code.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agokgdb: documentation fixes
Jason Wessel [Tue, 1 Apr 2008 21:55:26 +0000 (16:55 -0500)]
kgdb: documentation fixes

Minor cleanups to kgdb docs.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agokgdb: allow static kgdbts boot configuration
Jason Wessel [Thu, 20 Mar 2008 18:43:44 +0000 (13:43 -0500)]
kgdb: allow static kgdbts boot configuration

This patch adds in the ability to compile the kgdb internal test
string into the kernel so as to run the tests at boot without changing
the kernel boot arguments.  This patch also changes all the error
paths to invoke WARN_ON(1) which will emit the line number of the file
and dump the kernel stack when an error occurs.

You can disable the tests in a kernel that is built this way
using "kgdbts="

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agokgdb: add documentation
Jason Wessel [Thu, 20 Mar 2008 18:43:45 +0000 (13:43 -0500)]
kgdb: add documentation

Add in the kgdb documentation for kgdb.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agokgdb: Kconfig fix
Andrew Morton [Fri, 7 Mar 2008 23:51:16 +0000 (15:51 -0800)]
kgdb: Kconfig fix

ERROR: "uart_parse_options" [drivers/serial/serial_core.ko] undefined!

Cc: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agokgdb: add kgdb internal test suite
Jason Wessel [Fri, 7 Mar 2008 22:34:17 +0000 (16:34 -0600)]
kgdb: add kgdb internal test suite

This patch adds regression tests for testing the kgdb core and arch
specific implementation.

The kgdb test suite is designed to be built into the kernel and not as
a module because it uses a number of low level kernel and kgdb
primitives which should not be exported externally.

The kgdb test suite is designed as a KGDB I/O module which
simulates the communications that a debugger would have with kgdb.
The tests are broken up in to a line by line and referenced here as
a "get" which is kgdb requesting input and "put" which is kgdb
sending a response.

The kgdb suite can be invoked from the kernel command line
arguments system or executed dynamically at run time.  The test
suite uses the variable "kgdbts" to obtain the information about
which tests to run and to configure the verbosity level.  The
following are the various characters you can use with the kgdbts=
line:

When using the "kgdbts=" you only choose one of the following core
test types:
A = Run all the core tests silently
V1 = Run all the core tests with minimal output
V2 = Run all the core tests in debug mode

You can also specify optional tests:
N## = Go to sleep with interrupts of for ## seconds
      to test the HW NMI watchdog
F## = Break at do_fork for ## iterations
S## = Break at sys_open for ## iterations

NOTE: that the do_fork and sys_open tests are mutually exclusive.

To invoke the kgdb test suite from boot you use a kernel start
argument as follows:
kgdbts=V1 kgdbwait
Or if you wanted to perform the NMI test for 6 seconds and do_fork
test for 100 forks, you could use:
kgdbts=V1N6F100 kgdbwait

The test suite can also be invoked at run time with:
echo kgdbts=V1N6F100 > /sys/module/kgdbts/parameters/kgdbts
Or as another example:
echo kgdbts=V2 > /sys/module/kgdbts/parameters/kgdbts

When developing a new kgdb arch specific implementation or
using these tests for the purpose of regression testing,
several invocations are required.

1) Boot with the test suite enabled by using the kernel arguments
      "kgdbts=V1F100 kgdbwait"
   ## If kgdb arch specific implementation has NMI use
      "kgdbts=V1N6F100

2) After the system boot run the basic test.
echo kgdbts=V1 > /sys/module/kgdbts/parameters/kgdbts

3) Run the concurrency tests.  It is best to use n+1
   while loops where n is the number of cpus you have
   in your system.  The example below uses only two
   loops.

## This tests break points on sys_open
while [ 1 ] ; do find / > /dev/null 2>&1 ; done &
while [ 1 ] ; do find / > /dev/null 2>&1 ; done &
echo kgdbts=V1S10000 > /sys/module/kgdbts/parameters/kgdbts
fg # and hit control-c
fg # and hit control-c
## This tests break points on do_fork
while [ 1 ] ; do date > /dev/null ; done &
while [ 1 ] ; do date > /dev/null ; done &
echo kgdbts=V1F1000 > /sys/module/kgdbts/parameters/kgdbts
fg # and hit control-c

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agokgdb: fix several kgdb regressions
Jason Wessel [Fri, 7 Mar 2008 22:34:16 +0000 (16:34 -0600)]
kgdb: fix several kgdb regressions

kgdb core fixes:
- Check to see that mm->mmap_cache is not null before calling
  flush_cache_range(), else on arch=ARM it will cause a fatal
  fault.

- Breakpoints should only be restored if they are in the BP_ACTIVE
  state.

- Fix a typo in comments to "kgdb_register_io_module"

x86 kgdb fixes:
- Fix the x86 arch handler such that on a kill or detach that the
  appropriate cleanup on the single stepping flags gets run.

- Add in the DIE_NMIWATCHDOG call for x86_64

- Touch the nmi watchdog before returning the system to normal
  operation after performing any kind of kgdb operation, else
  the possibility exists to trigger the watchdog.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agokgdb: kgdboc pl011 I/O module
Jason Wessel [Wed, 20 Feb 2008 19:33:39 +0000 (13:33 -0600)]
kgdb: kgdboc pl011 I/O module

Implement the serial polling hooks for the pl011 uart for use with
kgdboc.

This patch was specifically tested on the ARM Versatile AB reference
platform.

[ mingo@elte.hu: minor cleanups. ]

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
16 years agokgdb: fix optional arch functions and probe_kernel_*
Jason Wessel [Wed, 20 Feb 2008 19:33:38 +0000 (13:33 -0600)]
kgdb: fix optional arch functions and probe_kernel_*

Fix two regressions dealing with the kgdb core.

1) kgdb_skipexception and kgdb_post_primary_code are optional
functions that are only required on archs that need special exception
fixups.

2) The kernel address space scope must be set on any probe_kernel_*
function or archs such as ARCH=arm will not allow access to the kernel
memory space.  As an example, it is required to allow the full kernel
address space is when you the kernel debugger to inspect a system
call.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agokgdb: add x86 HW breakpoints
Jason Wessel [Fri, 15 Feb 2008 20:55:56 +0000 (14:55 -0600)]
kgdb: add x86 HW breakpoints

Add HW breakpoints into the arch specific portion of x86 kgdb.  In the
current x86 kernel.org kernels HW breakpoints are changed out in lazy
fashion because there is no infrastructure around changing them when
changing to a kernel task or entering the kernel mode via a system
call.  This lazy approach means that if a user process uses HW
breakpoints the kgdb will loose out.  This is an acceptable trade off
because the developer debugging the kernel is assumed to know what is
going on system wide and would be aware of this trade off.

There is a minor bug fix to the kgdb core so as to correctly call the
hw breakpoint functions with a valid value from the enum.

There is also a minor change to the x86_64 startup code when using
early HW breakpoints.  When the debugger is connected, the cpu startup
code must not zero out the HW breakpoint registers or you cannot hit
the breakpoints you are interested in, in the first place.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agokgdb: print breakpoint removed on exception
Jason Wessel [Fri, 15 Feb 2008 20:55:55 +0000 (14:55 -0600)]
kgdb: print breakpoint removed on exception

If kgdb does remove a breakpoint that had a problem on the recursion
check, it should also print the address of the breakpoint.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agokgdb: clocksource watchdog
Jason Wessel [Fri, 15 Feb 2008 20:55:54 +0000 (14:55 -0600)]
kgdb: clocksource watchdog

In order to not trip the clocksource watchdog, kgdb must touch the
clocksource watchdog on the return to normal system run state.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agokgdb: fix NMI hangs
Jason Wessel [Fri, 15 Feb 2008 20:55:53 +0000 (14:55 -0600)]
kgdb: fix NMI hangs

This patch fixes the hang regression with kgdb when the NMI interrupt
comes in while the master core is returning from an exception.

Adjust the NMI logic such that KGDB will not stop NMI exceptions from
occurring by in general returning NOTIFY_DONE.  It is not possible to
distinguish the debug NMI sync vs the normal NMI apic interrupt so
kgdb needs to catch the unknown NMI if it the debugger was previously
active on one of the cpus.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agokgdb: fix kgdboc dynamic module configuration
Jason Wessel [Fri, 15 Feb 2008 20:55:52 +0000 (14:55 -0600)]
kgdb: fix kgdboc dynamic module configuration

Fix the run time configuration of kgdboc such that it does not default
to 9600 baud if you use the "echo" command to configure the sysfs
module paramater.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agokgdb: document parameters
Jason Wessel [Thu, 17 Apr 2008 18:05:38 +0000 (20:05 +0200)]
kgdb: document parameters

document the kgdboc module/boot parameter.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Jan Kiszka <jan.kiszka@web.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: kgdb support
Ingo Molnar [Thu, 17 Apr 2008 18:05:37 +0000 (20:05 +0200)]
x86: kgdb support

simplified and streamlined kgdb support on x86, both 32-bit and 64-bit,
based on patch from:

  Subject: kgdb: core-lite
  From: Jason Wessel <jason.wessel@windriver.com>

[ and countless other authors - see the patch for details. ]

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Jan Kiszka <jan.kiszka@web.de>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
16 years agoconsoles: polling support, kgdboc
Jason Wessel [Thu, 17 Apr 2008 18:05:37 +0000 (20:05 +0200)]
consoles: polling support, kgdboc

polled console handling support, to access a console in an irq-less
way while in debug or irq context.

absolutely zero impact as long as CONFIG_CONSOLE_POLL is disabled.
(which is the default)

[ jan.kiszka@siemens.com: lots of cleanups ]
[ mingo@elte.hu: redesign, splitups, cleanups. ]

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Jan Kiszka <jan.kiszka@web.de>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
16 years agokgdb: core
Jason Wessel [Thu, 17 Apr 2008 18:05:37 +0000 (20:05 +0200)]
kgdb: core

kgdb core code. Handles the protocol and the arch details.

[ mingo@elte.hu: heavily modified, simplified and cleaned up. ]
[ xemul@openvz.org: use find_task_by_pid_ns ]

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Jan Kiszka <jan.kiszka@web.de>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
16 years agouaccess: add probe_kernel_write()
Ingo Molnar [Thu, 17 Apr 2008 18:05:36 +0000 (20:05 +0200)]
uaccess: add probe_kernel_write()

add probe_kernel_read() and probe_kernel_write().

Uninlined and restricted to kernel range memory only, as suggested
by Linus.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
16 years agox86: standalone trampoline code
Ingo Molnar [Fri, 21 Mar 2008 14:23:19 +0000 (15:23 +0100)]
x86: standalone trampoline code

move the trampoline setup code out of smpboot.c - UP kernels can have
suspend support too.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move suspend wakeup code to C
Pavel Machek [Thu, 10 Apr 2008 21:28:10 +0000 (23:28 +0200)]
x86: move suspend wakeup code to C

Move wakeup code to .c, so that video mode setting code can be shared
between boot and wakeup. Remove nasty assembly code in 64-bit case by
re-using trampoline code. Stack setup was fixed to clear high 16bits
of %esp, maybe that fixes some machines.

.c code sharing and morse code was done H. Peter Anvin, Sam Ravnborg
reviewed kbuild related stuff, and it seems okay to him. Rafael did
some cleanups.

[rjw:
* Made the patch stop breaking compilation on x86-32
* Added arch/x86/kernel/acpi/sleep.h
* Got rid of compiler warnings in arch/x86/kernel/acpi/sleep.c
* Fixed 32-bit compilation on x86-64 systems
* Added include/asm-x86/trampoline.h and fixed the non-SMP
  compilation on 64-bit x86
* Removed arch/x86/kernel/acpi/sleep_32.c which was not used
* Fixed some breakage caused by the integration of smpboot.c done
  under us in the meantime]

Signed-off-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: coding style fixes to arch/x86/kernel/acpi/sleep.c
Paolo Ciarrocchi [Fri, 22 Feb 2008 22:11:39 +0000 (23:11 +0100)]
x86: coding style fixes to arch/x86/kernel/acpi/sleep.c

Signed-off-by: Paolo Ciarrocchi <paolo.ciarrocchi@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: setup_trampoline() - fix section mismatch warning
Jacek Luczak [Thu, 10 Apr 2008 19:16:41 +0000 (21:16 +0200)]
x86: setup_trampoline() - fix section mismatch warning

this patch fixes section mismatch warnings (on x86_64 host) in setup_trampoline(),
which was referencing __initdata variables trampoline_data and trampoline_end.

Warning messages:
WARNING: arch/x86/kernel/built-in.o(.cpuinit.text+0x2b6a): Section mismatch in reference from the function setup_trampoline()
to the variable .init.data:trampoline_data
The function __cpuinit setup_trampoline() references
a variable __initdata trampoline_data.
If trampoline_data is only used by setup_trampoline then
annotate trampoline_data with a matching annotation.

WARNING: arch/x86/kernel/built-in.o(.cpuinit.text+0x2b71): Section mismatch in reference from the function setup_trampoline()
to the variable .init.data:trampoline_end
The function __cpuinit setup_trampoline() references
a variable __initdata trampoline_end.
If trampoline_end is only used by setup_trampoline then
annotate trampoline_end with a matching annotation.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: section mismatch fixes, #1
Jacek Luczak [Fri, 11 Apr 2008 11:28:37 +0000 (13:28 +0200)]
x86: section mismatch fixes, #1

This patch fixes mismatch warnings in smp_checks() (in arch/x86/kernel/smpboot.c):

WARNING: arch/x86/kernel/built-in.o(.text+0x11922): Section mismatch in reference from the function smp_checks()
to the variable .cpuinit.data:smp_b_stepping
The function smp_checks() references
the variable __cpuinitdata smp_b_stepping.
This is often because smp_checks lacks a __cpuinitdata
annotation or the annotation of smp_b_stepping is wrong.

Signed-off-by: Jacek Luczak <luczak.jacek@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: fix paranoia about using BIOS quickboot mechanism.
Alok Kataria [Mon, 7 Apr 2008 18:38:33 +0000 (11:38 -0700)]
x86: fix paranoia about using BIOS quickboot mechanism.

> > Make sure that we clear the "shutdown status flag" in the CMOS
> > register after each CPU is brought up.  This fixes a problem where the
> > "shutdown status flag" may remain set when a CPU is brought up after
> > booting.
>
> btw., what problem does this result in, exactly?

The shutdown status flag set to "0xA", corresponds to "JMP double word
request without INT init".

This JMP at reboot time is at an unintended location. And results in
Triple faults in our case.
Though this error at reboot can be safely ignored in a VM environment,
am not sure what the effect would be on a physical system. May be it
will result in a triple fault and an eventual hardware reset thus
masking this BUG in the kernel.

This fix just makes sure that we reset that status flag after
initialization is done.

Fix paranoia about using BIOS quickboot mechanism.

Make sure that we clear the "shutdown status flag" in the CMOS register
after each CPU is brought up.  This fixes a problem where the "shutdown
status flag" may remain set when a CPU is brought up after booting.

Signed-off-by: Alok N Kataria <akataria@vmware.com>
Signed-off-by: Dan Arai <arai@vmware.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: print out buggy mptable
Yinghai Lu [Mon, 7 Apr 2008 18:36:39 +0000 (11:36 -0700)]
x86: print out buggy mptable

print out buggy mptable, instead of skipping it quietly

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: use cpu_online()
Akinobu Mita [Sat, 5 Apr 2008 13:39:09 +0000 (22:39 +0900)]
x86: use cpu_online()

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: use cpumask_of_cpu()
Akinobu Mita [Sat, 5 Apr 2008 13:39:08 +0000 (22:39 +0900)]
x86: use cpumask_of_cpu()

Use cpumask_of_cpu() rather than the pair of cpus_clear() and cpu_set().

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: remove unnecessary tmp local variable
Akinobu Mita [Sat, 5 Apr 2008 13:39:07 +0000 (22:39 +0900)]
x86: remove unnecessary tmp local variable

There is no reason to use obscurer name.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: remove unnecessary memset()
Akinobu Mita [Sat, 5 Apr 2008 13:39:06 +0000 (22:39 +0900)]
x86: remove unnecessary memset()

No need to clear the memory allocated by alloc_bootmem().
It is already filled with zero.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: use ioapic_read_entry() and ioapic_write_entry()
Akinobu Mita [Sat, 5 Apr 2008 13:39:05 +0000 (22:39 +0900)]
x86: use ioapic_read_entry() and ioapic_write_entry()

Remove duplicate code by using ioapic_read_entry() and ioapic_write_entry()
in io_apic_{32,64}.c

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: avoid redundant loop in io_apic_level_ack_pending()
Akinobu Mita [Sat, 5 Apr 2008 13:39:04 +0000 (22:39 +0900)]
x86: avoid redundant loop in io_apic_level_ack_pending()

If one can find an ack pending pin, there is no need to check
the rest of them.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: remove superfluous initialisation in boot code.
Alexander van Heukelum [Sun, 6 Apr 2008 12:47:00 +0000 (14:47 +0200)]
x86: remove superfluous initialisation in boot code.

In arch/x86/boot/compressed/misc.c, the variable vidmem is
the only variable that ends up in de data segment. It's also
superfluous, because the first thing the code does is:

if (RM_SCREEN_INFO.orig_video_mode == 7) {
vidmem = (char *) 0xb0000;
vidport = 0x3b4;
} else {
vidmem = (char *) 0xb8000;
vidport = 0x3d4;
}

This patch removes the initialisation.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: merge mpparse_{32,64}.c
Alexey Starikovskiy [Fri, 4 Apr 2008 19:43:18 +0000 (23:43 +0400)]
x86: merge mpparse_{32,64}.c

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: unify mp_register_gsi
Alexey Starikovskiy [Fri, 4 Apr 2008 19:43:12 +0000 (23:43 +0400)]
x86: unify mp_register_gsi

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: unify mp_config_acpi_legacy_irqs
Alexey Starikovskiy [Fri, 4 Apr 2008 19:43:06 +0000 (23:43 +0400)]
x86: unify mp_config_acpi_legacy_irqs

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: unify mp_register_ioapic
Alexey Starikovskiy [Fri, 4 Apr 2008 19:43:00 +0000 (23:43 +0400)]
x86: unify mp_register_ioapic

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: unify uniq_io_apic_id
Alexey Starikovskiy [Fri, 4 Apr 2008 19:42:53 +0000 (23:42 +0400)]
x86: unify uniq_io_apic_id

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: unify smp_scan_config
Alexey Starikovskiy [Fri, 4 Apr 2008 19:42:46 +0000 (23:42 +0400)]
x86: unify smp_scan_config

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: unify get_smp_config
Alexey Starikovskiy [Fri, 4 Apr 2008 19:42:40 +0000 (23:42 +0400)]
x86: unify get_smp_config

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: unify construct_default_ioirq_mptable
Alexey Starikovskiy [Fri, 4 Apr 2008 19:42:34 +0000 (23:42 +0400)]
x86: unify construct_default_ioirq_mptable

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: unify smp_read_mpc
Alexey Starikovskiy [Fri, 4 Apr 2008 19:42:27 +0000 (23:42 +0400)]
x86: unify smp_read_mpc

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: unify mp_bus_info
Alexey Starikovskiy [Fri, 4 Apr 2008 19:42:21 +0000 (23:42 +0400)]
x86: unify mp_bus_info

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: unify arch/x86/kernel/mpparse_64.c
Alexey Starikovskiy [Fri, 4 Apr 2008 19:42:15 +0000 (23:42 +0400)]
x86: unify arch/x86/kernel/mpparse_64.c

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: add early flags to mpparse_32.c
Alexey Starikovskiy [Fri, 4 Apr 2008 19:42:09 +0000 (23:42 +0400)]
x86: add early flags to mpparse_32.c

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: lindent mpparse_32.c
Alexey Starikovskiy [Fri, 4 Apr 2008 19:42:03 +0000 (23:42 +0400)]
x86: lindent mpparse_32.c

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move mp_register_lapic_address to boot.c
Alexey Starikovskiy [Fri, 4 Apr 2008 19:41:57 +0000 (23:41 +0400)]
x86: move mp_register_lapic_address to boot.c

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move mp_register_lapic to boot.c
Alexey Starikovskiy [Fri, 4 Apr 2008 19:41:50 +0000 (23:41 +0400)]
x86: move mp_register_lapic to boot.c

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move up & smp variables to setup.c
Alexey Starikovskiy [Fri, 4 Apr 2008 19:41:44 +0000 (23:41 +0400)]
x86: move up & smp variables to setup.c

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move mp_irqs to io_apic_64.c
Alexey Starikovskiy [Fri, 4 Apr 2008 19:41:38 +0000 (23:41 +0400)]
x86: move mp_irqs to io_apic_64.c

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move mp_irqs to io_apics_32.c
Alexey Starikovskiy [Fri, 4 Apr 2008 19:41:32 +0000 (23:41 +0400)]
x86: move mp_irqs to io_apics_32.c

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move mp_ioapic_routing to boot.c
Alexey Starikovskiy [Fri, 4 Apr 2008 19:41:26 +0000 (23:41 +0400)]
x86: move mp_ioapic_routing to boot.c

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move mp_ioapics to io_apic_64.c
Alexey Starikovskiy [Fri, 4 Apr 2008 19:41:19 +0000 (23:41 +0400)]
x86: move mp_ioapics to io_apic_64.c

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move mp_ioapics to io_apic_32.c
Alexey Starikovskiy [Fri, 4 Apr 2008 19:41:13 +0000 (23:41 +0400)]
x86: move mp_ioapics to io_apic_32.c

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: don't set io apic features if io-apic is not enabled, fix
Ingo Molnar [Mon, 7 Apr 2008 11:11:09 +0000 (13:11 +0200)]
x86: don't set io apic features if io-apic is not enabled, fix

Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: don't set IO APIC features if IO APIC is not enabled
Alexey Starikovskiy [Fri, 4 Apr 2008 19:41:07 +0000 (23:41 +0400)]
x86: don't set IO APIC features if IO APIC is not enabled

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move x86_bios_cpu_apicid_init to smpboot.c
Alexey Starikovskiy [Fri, 4 Apr 2008 19:41:00 +0000 (23:41 +0400)]
x86: move x86_bios_cpu_apicid_init to smpboot.c

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move x86_cpu_to_apicid_init to smpboot.c
Alexey Starikovskiy [Fri, 4 Apr 2008 19:40:54 +0000 (23:40 +0400)]
x86: move x86_cpu_to_apicid_init to smpboot.c

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move phys_cpu_present_map to setup.c
Alexey Starikovskiy [Fri, 4 Apr 2008 19:40:48 +0000 (23:40 +0400)]
x86: move phys_cpu_present_map to setup.c

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move x86_cpu_to_apicid to setup.c
Alexey Starikovskiy [Fri, 4 Apr 2008 19:40:41 +0000 (23:40 +0400)]
x86: move x86_cpu_to_apicid to setup.c

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move x86_bios_cpu_apicid to io_apic_64.c
Alexey Starikovskiy [Fri, 4 Apr 2008 19:40:32 +0000 (23:40 +0400)]
x86: move x86_bios_cpu_apicid to io_apic_64.c

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: 4kstacks default
Ingo Molnar [Fri, 4 Apr 2008 15:11:09 +0000 (17:11 +0200)]
x86: 4kstacks default

Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: fix VisualWS and Voyager kexec build failures
Randy Dunlap [Tue, 1 Apr 2008 22:44:01 +0000 (15:44 -0700)]
x86: fix VisualWS and Voyager kexec build failures

without this patch:

VOYAGER:
kernel/built-in.o: In function `crash_kexec':
(.text+0x28588): undefined reference to `machine_crash_shutdown'

VISWS:
kernel/built-in.o: In function `crash_kexec':
/next-20080401/kernel/kexec.c:1074: undefined reference to `machine_crash_shutdown'
make[1]: *** [.tmp_vmlinux1] Error 1

because arch/x86/kernel/reboot.c isn't built since CONFIG_X86_BIOS_REBOOT=n,
so machine_crash_shutdown() isn't available.

This patch does seem a small bit odd since the KEXEC help text says that
kexec is independent of the system firmware.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Eric Biederman <ebiederm@xmission.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: MPSC should use P6 NOPs
Hugh Dickins [Thu, 3 Apr 2008 22:48:29 +0000 (23:48 +0100)]
x86: MPSC should use P6 NOPs

I've now noticed that the machine I call MPENTIUM4 for 32-bit kernels
is called MPSC for 64-bit kernels, and in that case it still doesn't
get the P6 NOPs it ought to.  hpa explains that MK8 should still be
excluded, so it's just a matter of including MPSC along with MPENTIUM4.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Acked-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: debug Store - call kfree if only we really need it
Cyrill Gorcunov [Tue, 1 Apr 2008 15:41:50 +0000 (19:41 +0400)]
x86: debug Store - call kfree if only we really need it

We should call for kfree if only we really need it.
Though it's safe to call kfree with NULL pointer passed
in this code we've already tested the pointer and can
eliminate the call

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: extend the scheduled bzImage symlinks removal
Ingo Molnar [Thu, 10 Apr 2008 08:12:27 +0000 (10:12 +0200)]
x86: extend the scheduled bzImage symlinks removal

use of the bzImage symlinks in developer scripts is still widespread,
so lets extend the removal period by 2 years. These symlinks cost
us near nothing.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: improve default idle
Ingo Molnar [Wed, 2 Apr 2008 11:23:22 +0000 (13:23 +0200)]
x86: improve default idle

Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: support for new UV apic, fix
Jack Steiner [Mon, 31 Mar 2008 02:02:07 +0000 (21:02 -0500)]
x86: support for new UV apic, fix

Yinghai Lu pointed out a bug in the previous patches,
fix double-shift of apicid.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: set_cyc2ns_scale() remove prev scale
Ingo Molnar [Mon, 31 Mar 2008 12:52:15 +0000 (14:52 +0200)]
x86: set_cyc2ns_scale() remove prev scale

Peter Zijlstra pointed out that it's unused.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: clean up non-smp usage of cpu maps
Mike Travis [Tue, 25 Mar 2008 22:06:51 +0000 (15:06 -0700)]
x86: clean up non-smp usage of cpu maps

Cleanup references to the early cpu maps for the non-SMP configuration
and remove some functions called for SMP configurations only.

Cc: Andi Kleen <ak@suse.de>
Cc: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Mike Travis <travis@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: uv fix
Ingo Molnar [Sun, 30 Mar 2008 10:17:12 +0000 (12:17 +0200)]
x86: uv fix

Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: support for new UV apic
Jack Steiner [Fri, 28 Mar 2008 19:12:16 +0000 (14:12 -0500)]
x86: support for new UV apic

UV supports really big systems. So big, in fact, that the APICID register
does not contain enough bits to contain an APICID that is unique across all
cpus.

The UV BIOS supports 3 APICID modes:

- legacy mode. This mode uses the old APIC mode where
  APICID is in bits [31:24] of the APICID register.

- x2apic mode. This mode is whitebox-compatible. APICIDs
  are unique across all cpus. Standard x2apic APIC operations
  (Intel-defined) can be used for IPIs. The node identifier
  fits within the Intel-defined portion of the APICID register.

- x2apic-uv mode. In this mode, the APICIDs on each node have
  unique IDs, but IDs on different node are not unique. For example,
  if each mode has 32 cpus, the APICIDs on each node might be
  0 - 31. Every node has the same set of IDs.
  The UV hub is used to route IPIs/interrupts to the correct node.
  Traditional APIC operations WILL NOT WORK.

In x2apic-uv mode, the ACPI tables all contain a full unique ID (note:
exact bit layout still changing but the following is close):

nnnnnnnnnnlc0cch
n = unique node number
l = socket number on board
c = core
h = hyperthread

Only the "lc0cch" bits are written to the APICID register. The remaining bits are
supplied by having the get_apic_id() function "OR" the extra bits into the value
read from the APICID register. (Hmmm.. why not keep the ENTIRE APICID register
in per-cpu data....)

The x2apic-uv mode is recognized by the MADT table containing:
  oem_id = "SGI"
  oem_table_id = "UV-X"

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: support for new UV apic, prepare
Ingo Molnar [Tue, 8 Apr 2008 10:20:50 +0000 (12:20 +0200)]
x86: support for new UV apic, prepare

Signed-off-by: Ingo Molnar <mingo@elte.hu>