]> git.karo-electronics.de Git - linux-beck.git/commitdiff
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6
authorLinus Torvalds <torvalds@woody.linux-foundation.org>
Tue, 22 May 2007 23:46:29 +0000 (16:46 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Tue, 22 May 2007 23:46:29 +0000 (16:46 -0700)
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6:
  [IA64] fix kmalloc(0) in arch/ia64/pci/pci.c
  [IA64] Only unwind non-running tasks.
  [IA64] Improve unwind checking.
  [IA64] Yet another section mismatch warning
  [IA64] Fix bogus messages about system calls not implemented.

arch/ia64/kernel/process.c
arch/ia64/kernel/unwind.c
arch/ia64/pci/pci.c
arch/ia64/sn/kernel/setup.c
include/asm-ia64/unistd.h

index d1c3ed9943e52d8ccad85553e1d1008ae7dc3629..af73b8dfde282c0c91f84b3f8da062327d18a069 100644 (file)
@@ -763,6 +763,9 @@ get_wchan (struct task_struct *p)
        unsigned long ip;
        int count = 0;
 
+       if (!p || p == current || p->state == TASK_RUNNING)
+               return 0;
+
        /*
         * Note: p may not be a blocked task (it could be current or
         * another process running on some other CPU.  Rather than
@@ -773,6 +776,8 @@ get_wchan (struct task_struct *p)
         */
        unw_init_from_blocked_task(&info, p);
        do {
+               if (p->state == TASK_RUNNING)
+                       return 0;
                if (unw_unwind(&info) < 0)
                        return 0;
                unw_get_ip(&info, &ip);
index 7d3dd6cdafa4aeef31008c31bf62e45cab95da75..b0b08b5f3eca217ccecaced1d0188a66b98fd879 100644 (file)
@@ -1860,7 +1860,7 @@ int
 unw_unwind (struct unw_frame_info *info)
 {
        unsigned long prev_ip, prev_sp, prev_bsp;
-       unsigned long ip, pr, num_regs;
+       unsigned long ip, pr, num_regs, rp_loc, pfs_loc;
        STAT(unsigned long start, flags;)
        int retval;
 
@@ -1870,14 +1870,16 @@ unw_unwind (struct unw_frame_info *info)
        prev_sp = info->sp;
        prev_bsp = info->bsp;
 
-       /* restore the ip */
-       if (!info->rp_loc) {
+       /* validate the return IP pointer */
+       rp_loc = (unsigned long) info->rp_loc;
+       if ((rp_loc < info->regstk.limit) || (rp_loc > info->regstk.top)) {
                /* FIXME: should really be level 0 but it occurs too often. KAO */
                UNW_DPRINT(1, "unwind.%s: failed to locate return link (ip=0x%lx)!\n",
                           __FUNCTION__, info->ip);
                STAT(unw.stat.api.unwind_time += ia64_get_itc() - start; local_irq_restore(flags));
                return -1;
        }
+       /* restore the ip */
        ip = info->ip = *info->rp_loc;
        if (ip < GATE_ADDR) {
                UNW_DPRINT(2, "unwind.%s: reached user-space (ip=0x%lx)\n", __FUNCTION__, ip);
@@ -1885,12 +1887,14 @@ unw_unwind (struct unw_frame_info *info)
                return -1;
        }
 
-       /* restore the cfm: */
-       if (!info->pfs_loc) {
+       /* validate the previous stack frame pointer */
+       pfs_loc = (unsigned long) info->pfs_loc;
+       if ((pfs_loc < info->regstk.limit) || (pfs_loc > info->regstk.top)) {
                UNW_DPRINT(0, "unwind.%s: failed to locate ar.pfs!\n", __FUNCTION__);
                STAT(unw.stat.api.unwind_time += ia64_get_itc() - start; local_irq_restore(flags));
                return -1;
        }
+       /* restore the cfm: */
        info->cfm_loc = info->pfs_loc;
 
        /* restore the bsp: */
@@ -1992,13 +1996,16 @@ init_frame_info (struct unw_frame_info *info, struct task_struct *t,
        memset(info, 0, sizeof(*info));
 
        rbslimit = (unsigned long) t + IA64_RBS_OFFSET;
+       stklimit = (unsigned long) t + IA64_STK_OFFSET;
+
        rbstop   = sw->ar_bspstore;
-       if (rbstop - (unsigned long) t >= IA64_STK_OFFSET)
+       if (rbstop > stklimit || rbstop < rbslimit)
                rbstop = rbslimit;
 
-       stklimit = (unsigned long) t + IA64_STK_OFFSET;
        if (stktop <= rbstop)
                stktop = rbstop;
+       if (stktop > stklimit)
+               stktop = stklimit;
 
        info->regstk.limit = rbslimit;
        info->regstk.top   = rbstop;
index 3549f3b425929434fd334fd9630fc9e85ca25e68..73696b4a2eed42caafc4d7414f8ae38c6c3a6922 100644 (file)
@@ -354,10 +354,13 @@ pci_acpi_scan_root(struct acpi_device *device, int domain, int bus)
 
        acpi_walk_resources(device->handle, METHOD_NAME__CRS, count_window,
                        &windows);
-       controller->window = kmalloc_node(sizeof(*controller->window) * windows,
-                       GFP_KERNEL, controller->node);
-       if (!controller->window)
-               goto out2;
+       if (windows) {
+               controller->window =
+                       kmalloc_node(sizeof(*controller->window) * windows,
+                                    GFP_KERNEL, controller->node);
+               if (!controller->window)
+                       goto out2;
+       }
 
        name = kmalloc(16, GFP_KERNEL);
        if (!name)
index a574fcd163ddd57776031bffe8d0a151dcfb3991..684b1c984a445e3ba5a818aef22cb8f6d8437979 100644 (file)
@@ -194,7 +194,7 @@ void __init early_sn_setup(void)
 }
 
 extern int platform_intr_list[];
-static int __initdata shub_1_1_found;
+static int __cpuinitdata shub_1_1_found;
 
 /*
  * sn_check_for_wars
index d7781a2ddefec086fa085f1f9902e50cd69bbb77..441c9e0017762b0133c8a2e017e62596b2b8e11a 100644 (file)
 
 #define NR_syscalls                    286 /* length of syscall table */
 
+/*
+ * The following defines stop scripts/checksyscalls.sh from complaining about
+ * unimplemented system calls.  Glibc provides for each of these by using
+ * more modern equivalent system calls.
+ */
+#define __IGNORE_fork          /* clone() */
+#define __IGNORE_time          /* gettimeofday() */
+#define __IGNORE_alarm         /* setitimer(ITIMER_REAL, ... */
+#define __IGNORE_pause         /* rt_sigprocmask(), rt_sigsuspend() */
+#define __IGNORE_utime         /* utimes() */
+#define __IGNORE_getpgrp       /* getpgid() */
+#define __IGNORE_vfork         /* clone() */
+
 #define __ARCH_WANT_SYS_RT_SIGACTION
 #define __ARCH_WANT_SYS_RT_SIGSUSPEND