1. 18 4月, 2008 40 次提交
    • L
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-kgdb · 9732b611
      Linus Torvalds 提交于
      * 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()
      9732b611
    • L
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86 · 9e9abecf
      Linus Torvalds 提交于
      * '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
        ...
      9e9abecf
    • L
      Merge branch 'semaphore' of git://git.kernel.org/pub/scm/linux/kernel/git/willy/misc · d7bb545d
      Linus Torvalds 提交于
      * '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
      d7bb545d
    • L
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband · 75e98b34
      Linus Torvalds 提交于
      * '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
        ...
      75e98b34
    • L
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/selinux-2.6 · 30bc9456
      Linus Torvalds 提交于
      * '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
      30bc9456
    • L
      Merge branch 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6 · 4cba84b5
      Linus Torvalds 提交于
      * '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.
        ...
      4cba84b5
    • L
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/penberg/slab-2.6 · 7d939fbd
      Linus Torvalds 提交于
      * '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
      7d939fbd
    • R
      ptrace_signal subroutine · 18c98b65
      Roland McGrath 提交于
      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: NRoland McGrath <roland@redhat.com>
      Acked-by: NKyle McMartin <kyle@mcmartin.ca>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      18c98b65
    • L
      cgroup: fix a race condition in manipulating tsk->cg_list · 0e04388f
      Li Zefan 提交于
      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: NLi Zefan <lizf@cn.fujitsu.com>
      Acked-by: NPaul Menage <menage@google.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: stable@kernel.org
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      0e04388f
    • M
      security: enhance DEFAULT_MMAP_MIN_ADDR description · 5f46ce14
      maximilian attems 提交于
      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: Nmaximilian attems <max@stro.at>
      Cc: Martin Michlmayr <tbm@cyrius.com>
      Cc: Gordon Farquharson <gordonfarquharson@gmail.com>
      Acked-by: NEric Paris <eparis@redhat.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      5f46ce14
    • J
      SELinux: add netport.[ch] · 27cc2a6e
      James Morris 提交于
      Thank you, git.
      Signed-off-by: NJames Morris <jmorris@namei.org>
      27cc2a6e
    • P
      SELinux: Add network port SID cache · 3e112172
      Paul Moore 提交于
      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: NPaul Moore <paul.moore@hp.com>
      Acked-by: NStephen Smalley <sds@tycho.nsa.gov>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      3e112172
    • E
      SELinux: turn mount options strings into defines · 832cbd9a
      Eric Paris 提交于
      Convert the strings used for mount options into #defines rather than
      retyping the string throughout the SELinux code.
      Signed-off-by: NEric Paris <eparis@redhat.com>
      Acked-by: NStephen Smalley <sds@tycho.nsa.gov>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      832cbd9a
    • A
      selinux/ss/services.c should #include <linux/selinux.h> · 0e55a004
      Adrian Bunk 提交于
      Every file should include the headers containing the externs for its global
      code.
      Signed-off-by: NAdrian Bunk <bunk@kernel.org>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      0e55a004
    • E
      selinux: introduce permissive types · 64dbf074
      Eric Paris 提交于
      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: NEric Paris <eparis@redhat.com>
      Acked-by: NStephen Smalley <sds@tycho.nsa.gov>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      64dbf074
    • R
      selinux: remove ptrace_sid · 0356357c
      Roland McGrath 提交于
      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: NRoland McGrath <roland@redhat.com>
      Acked-by: NStephen Smalley <sds@tycho.nsa.gov>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      0356357c
    • E
      SELinux: requesting no permissions in avc_has_perm_noaudit is a BUG() · eda4f69c
      Eric Paris 提交于
      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: NEric Paris <eparis@redhat.com>
      Acked-by: NStephen D. Smalley <sds@tycho.nsa.gov>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      eda4f69c
    • A
      security: code cleanup · f0115e6c
      Andrew Morton 提交于
      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: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      f0115e6c
    • H
      security: replace remaining __FUNCTION__ occurrences · dd6f953a
      Harvey Harrison 提交于
      __FUNCTION__ is gcc-specific, use __func__
      Signed-off-by: NHarvey Harrison <harvey.harrison@gmail.com>
      Cc: James Morris <jmorris@namei.org>
      Cc: Stephen Smalley <sds@tycho.nsa.gov>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      dd6f953a
    • E
      SELinux: create new open permission · b0c636b9
      Eric Paris 提交于
      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: NEric Paris <eparis@redhat.com>
      Acked-by: NStephen Smalley <sds@tycho.nsa.gov>
      Reviewed-by: NPaul Moore <paul.moore@hp.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      b0c636b9
    • A
      selinux: selinux/netlabel.c should #include "netlabel.h" · d4ee4231
      Adrian Bunk 提交于
      Every file should include the headers containing the externs for its
      global code.
      Signed-off-by: NAdrian Bunk <bunk@kernel.org>
      Acked-by: NPaul Moore <paul.moore@hp.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      d4ee4231
    • J
      SELinux: unify printk messages · 454d972c
      James Morris 提交于
      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: NJames Morris <jmorris@namei.org>
      454d972c
    • J
      SELinux: remove unused backpointers from security objects · 98e98946
      James Morris 提交于
      Remove unused backpoiters from security objects.
      Signed-off-by: NJames Morris <jmorris@namei.org>
      98e98946
    • P
      SELinux: Correct the NetLabel locking for the sk_security_struct · f74af6e8
      Paul Moore 提交于
      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: NPaul Moore <paul.moore@hp.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      f74af6e8
    • J
      kgdb: always use icache flush for sw breakpoints · 1a9a3e76
      Jason Wessel 提交于
      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: NJason Wessel <jason.wessel@windriver.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      1a9a3e76
    • J
      kgdb: fix SMP NMI kgdb_handle_exception exit race · 56fb7093
      Jason Wessel 提交于
      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: NJason Wessel <jason.wessel@windriver.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      56fb7093
    • J
      kgdb: documentation fixes · 225a4424
      Jason Wessel 提交于
      Minor cleanups to kgdb docs.
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      225a4424
    • J
      kgdb: allow static kgdbts boot configuration · 974460c5
      Jason Wessel 提交于
      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: NJason Wessel <jason.wessel@windriver.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      974460c5
    • J
      kgdb: add documentation · e3e2aaf7
      Jason Wessel 提交于
      Add in the kgdb documentation for kgdb.
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      e3e2aaf7
    • A
      kgdb: Kconfig fix · 4a1b5502
      Andrew Morton 提交于
      ERROR: "uart_parse_options" [drivers/serial/serial_core.ko] undefined!
      
      Cc: Jason Wessel <jason.wessel@windriver.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      4a1b5502
    • J
      kgdb: add kgdb internal test suite · e8d31c20
      Jason Wessel 提交于
      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: NJason Wessel <jason.wessel@windriver.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      e8d31c20
    • J
      kgdb: fix several kgdb regressions · 737a460f
      Jason Wessel 提交于
      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: NJason Wessel <jason.wessel@windriver.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      737a460f
    • J
      kgdb: kgdboc pl011 I/O module · 84b5ae15
      Jason Wessel 提交于
      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: NJason Wessel <jason.wessel@windriver.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      84b5ae15
    • J
      kgdb: fix optional arch functions and probe_kernel_* · b4b8ac52
      Jason Wessel 提交于
      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: NJason Wessel <jason.wessel@windriver.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      b4b8ac52
    • J
      kgdb: add x86 HW breakpoints · 64e9ee30
      Jason Wessel 提交于
      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: NJason Wessel <jason.wessel@windriver.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      64e9ee30
    • J
      kgdb: print breakpoint removed on exception · 67baf94c
      Jason Wessel 提交于
      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: NJason Wessel <jason.wessel@windriver.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      67baf94c
    • J
      kgdb: clocksource watchdog · 7c3078b6
      Jason Wessel 提交于
      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: NJason Wessel <jason.wessel@windriver.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      7c3078b6
    • J
      kgdb: fix NMI hangs · d3597524
      Jason Wessel 提交于
      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: NJason Wessel <jason.wessel@windriver.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      d3597524
    • J
      kgdb: fix kgdboc dynamic module configuration · c191e5ad
      Jason Wessel 提交于
      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: NJason Wessel <jason.wessel@windriver.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      c191e5ad
    • J
      kgdb: document parameters · 6cdf6e06
      Jason Wessel 提交于
      document the kgdboc module/boot parameter.
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      Signed-off-by: NJan Kiszka <jan.kiszka@web.de>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      6cdf6e06