1. 24 8月, 2008 1 次提交
  2. 21 8月, 2008 1 次提交
  3. 19 8月, 2008 1 次提交
  4. 17 8月, 2008 1 次提交
  5. 16 8月, 2008 1 次提交
  6. 13 8月, 2008 2 次提交
    • S
      crypto: padlock - fix VIA PadLock instruction usage with irq_ts_save/restore() · e4914012
      Suresh Siddha 提交于
      Wolfgang Walter reported this oops on his via C3 using padlock for
      AES-encryption:
      
      ##################################################################
      
      BUG: unable to handle kernel NULL pointer dereference at 000001f0
      IP: [<c01028c5>] __switch_to+0x30/0x117
      *pde = 00000000
      Oops: 0002 [#1] PREEMPT
      Modules linked in:
      
      Pid: 2071, comm: sleep Not tainted (2.6.26 #11)
      EIP: 0060:[<c01028c5>] EFLAGS: 00010002 CPU: 0
      EIP is at __switch_to+0x30/0x117
      EAX: 00000000 EBX: c0493300 ECX: dc48dd00 EDX: c0493300
      ESI: dc48dd00 EDI: c0493530 EBP: c04cff8c ESP: c04cff7c
       DS: 007b ES: 007b FS: 0000 GS: 0033 SS: 0068
      Process sleep (pid: 2071, ti=c04ce000 task=dc48dd00 task.ti=d2fe6000)
      Stack: dc48df30 c0493300 00000000 00000000 d2fe7f44 c03b5b43 c04cffc8 00000046
             c0131856 0000005a dc472d3c c0493300 c0493470 d983ae00 00002696 00000000
             c0239f54 00000000 c04c4000 c04cffd8 c01025fe c04f3740 00049800 c04cffe0
      Call Trace:
       [<c03b5b43>] ? schedule+0x285/0x2ff
       [<c0131856>] ? pm_qos_requirement+0x3c/0x53
       [<c0239f54>] ? acpi_processor_idle+0x0/0x434
       [<c01025fe>] ? cpu_idle+0x73/0x7f
       [<c03a4dcd>] ? rest_init+0x61/0x63
       =======================
      
      Wolfgang also found out that adding kernel_fpu_begin() and kernel_fpu_end()
      around the padlock instructions fix the oops.
      
      Suresh wrote:
      
      These padlock instructions though don't use/touch SSE registers, but it behaves
      similar to other SSE instructions. For example, it might cause DNA faults
      when cr0.ts is set. While this is a spurious DNA trap, it might cause
      oops with the recent fpu code changes.
      
      This is the code sequence  that is probably causing this problem:
      
      a) new app is getting exec'd and it is somewhere in between
         start_thread() and flush_old_exec() in the load_xyz_binary()
      
      b) At pont "a", task's fpu state (like TS_USEDFPU, used_math() etc) is
         cleared.
      
      c) Now we get an interrupt/softirq which starts using these encrypt/decrypt
         routines in the network stack. This generates a math fault (as
         cr0.ts is '1') which sets TS_USEDFPU and restores the math that is
         in the task's xstate.
      
      d) Return to exec code path, which does start_thread() which does
         free_thread_xstate() and sets xstate pointer to NULL while
         the TS_USEDFPU is still set.
      
      e) At the next context switch from the new exec'd task to another task,
         we have a scenarios where TS_USEDFPU is set but xstate pointer is null.
         This can cause an oops during unlazy_fpu() in __switch_to()
      
      Now:
      
      1) This should happen with or with out pre-emption. Viro also encountered
         similar problem with out CONFIG_PREEMPT.
      
      2) kernel_fpu_begin() and kernel_fpu_end() will fix this problem, because
         kernel_fpu_begin() will manually do a clts() and won't run in to the
         situation of setting TS_USEDFPU in step "c" above.
      
      3) This was working before the fpu changes, because its a spurious
         math fault  which doesn't corrupt any fpu/sse registers and the task's
         math state was always in an allocated state.
      
      With out the recent lazy fpu allocation changes, while we don't see oops,
      there is a possible race still present in older kernels(for example,
      while kernel is using kernel_fpu_begin() in some optimized clear/copy
      page and an interrupt/softirq happens which uses these padlock
      instructions generating DNA fault).
      
      This is the failing scenario that existed even before the lazy fpu allocation
      changes:
      
      0. CPU's TS flag is set
      
      1. kernel using FPU in some optimized copy  routine and while doing
      kernel_fpu_begin() takes an interrupt just before doing clts()
      
      2. Takes an interrupt and ipsec uses padlock instruction. And we
      take a DNA fault as TS flag is still set.
      
      3. We handle the DNA fault and set TS_USEDFPU and clear cr0.ts
      
      4. We complete the padlock routine
      
      5. Go back to step-1, which resumes clts() in kernel_fpu_begin(), finishes
      the optimized copy routine and does kernel_fpu_end(). At this point,
      we have cr0.ts again set to '1' but the task's TS_USEFPU is stilll
      set and not cleared.
      
      6. Now kernel resumes its user operation. And at the next context
      switch, kernel sees it has do a FP save as TS_USEDFPU is still set
      and then will do a unlazy_fpu() in __switch_to(). unlazy_fpu()
      will take a DNA fault, as cr0.ts is '1' and now, because we are
      in __switch_to(), math_state_restore() will get confused and will
      restore the next task's FP state and will save it in prev tasks's FP state.
      Remember, in __switch_to() we are already on the stack of the next task
      but take a DNA fault for the prev task.
      
      This causes the fpu leakage.
      
      Fix the padlock instruction usage by calling them inside the
      context of new routines irq_ts_save/restore(), which clear/restore cr0.ts
      manually in the interrupt context. This will not generate spurious DNA
      in the  context of the interrupt which will fix the oops encountered and
      the possible FPU leakage issue.
      Reported-and-bisected-by: NWolfgang Walter <wolfgang.walter@stwm.de>
      Signed-off-by: NSuresh Siddha <suresh.b.siddha@intel.com>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      e4914012
    • H
  7. 12 8月, 2008 7 次提交
    • C
      fix spinlock recursion in hvc_console · b1b135c8
      Christian Borntraeger 提交于
      commit 611e097d
      Author: Christian Borntraeger <borntraeger@de.ibm.com>
      hvc_console: rework setup to replace irq functions with callbacks
      introduced a spinlock recursion problem.
      
      request_irq tries to call the handler if the IRQ is shared.
      The irq handler of hvc_console calls hvc_poll and hvc_kill
      which might take the hvc_struct spinlock. Therefore, we have
      to call request_irq outside the spinlock.
      
      We can move the notifier_add safely outside the spinlock as ->data must
      not be changed by the backend. Otherwise, tty_hangup would fail anyway.
      Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      b1b135c8
    • K
      agp: fix SIS 5591/5592 wrong PCI id · 91397585
      Krzysztof Helt 提交于
      The correct id is the id of the main host (5591) not
      the id of the PCI-to-PCI bridge AGP (0001).
      Output from "lspci -nv" shows that only the former
      has AGP capabilities flag set:
      
      00:00.0 0600: 1039:5591 (rev 02)
              Flags: bus master, medium devsel, latency 64
              Memory at ec000000 (32-bit, non-prefetchable) [size=32M]
              Capabilities: [c0] AGP version 1.0
      
      00:02.0 0604: 1039:0001 (prog-if 00 [Normal decode])
              Flags: bus master, fast devsel, latency 0
              Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
              I/O behind bridge: 0000c000-0000cfff
              Memory behind bridge: eb500000-eb5fffff
              Prefetchable memory behind bridge: eb300000-eb3fffff
      Signed-off-by: NKrzysztof Helt <krzysztof.h1@wp.pl>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      91397585
    • K
      intel/agp: rewrite GTT on resume · a8c84df9
      Keith Packard 提交于
      On my Intel chipset (965GM), the GTT is entirely erased across
      suspend/resume.  This patch simply re-plays the current mapping at resume
      time to restore the table.=20
      
      I noticed this once I started relying on persistent GTT mappings across VT
      switch in our GEM work -- the old X server and DRM code carefully unbind
      all memory from the GTT on VT switch, but GEM does not bother.
      
      I placed the list management and rewrite code in the generic layer on the
      assumption that it will be needed on other hardware, but I did not add the
      rewrite call to anything other than the Intel resume function.
      
      Keep a list of current GATT mappings.  At resume time, rewrite them into
      the GATT.  This is needed on Intel (at least) as the entire GATT is
      cleared across suspend/resume.
      
      [akpm@linux-foundation.org: coding-style fixes]
      Signed-off-by: NKeith Packard <keithp@keithp.com>
      Cc: Dave Jones <davej@codemonkey.org.uk>
      Cc: Andi Kleen <andi@firstfloor.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      a8c84df9
    • B
      agp: use dev_printk when possible · e3cf6951
      Bjorn Helgaas 提交于
      Convert printks to use dev_printk().
      Signed-off-by: NBjorn Helgaas <bjorn.helgaas@hp.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      e3cf6951
    • B
      amd64-agp: run fallback when no bridges found, not when driver registration fails · 55814b74
      Bjorn Helgaas 提交于
      I think the intent was that if no bridges matched agp_amd64_pci_table[],
      we would fall back to checking for any bridge with the AGP capability.
      But in the current code, we execute the fallback path only when
      pci_register_driver() itself fails, which is unrelated to whether any
      matching devices were found.
      
      This patch counts the AGP bridges found in the probe() method and executes
      the fallback path when none is found.
      Signed-off-by: NBjorn Helgaas <bjorn.helgaas@hp.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      55814b74
    • Z
      intel_agp: official name for GM45 chipset · 99d32bd5
      Zhenyu Wang 提交于
      Signed-off-by: NZhenyu Wang <zhenyu.z.wang@intel.com>
      Cc: Dave Airlie <airlied@linux.ie>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      99d32bd5
    • C
      Fix race/oops in tty layer after BKL pushdown · 000b9151
      Christian Borntraeger 提交于
      While testing our KVM code for s390 (starting and killall kvm in a loop)
      I can reproduce the following oops:
      
        Unable to handle kernel pointer dereference at virtual kernel address 6b6b6b6b6b6b6000 Oops: 0038 [#1] SMP
        Modules linked in: dm_multipath sunrpc qeth_l3 qeth_l2 dm_mod qeth
        ccwgroup CPU: 1 Not tainted 2.6.27-rc1 #54
        Process kuli (pid: 4409, task: 00000000b6aa5940, ksp: 00000000b7343e10)
        Krnl PSW : 0704e00180000000 00000000002e0b8c
        (disassociate_ctty+0x1c0/0x288) R:0 T:1 IO:1 EX:1 Key:0 M:1 W:0 P:0 AS:3
        CC:2 PM:0 EA:3 Krnl GPRS: 0000000000000000 6b6b6b6b6b6b6b6b
        0000000000000001 00000000000003a6 00000000002e0a46 00000000004b4160
        0000000000000001 00000000bbd79758 00000000b7343e58 00000000b8854148
        00000000bd34dea0 00000000b7343c20 0000000000000001 00000000004b6d08
        00000000002e0a46 00000000b7343c20 Krnl Code: 00000000002e0b7e:
        eb9fb0a00004	lmg	%r9,%r15,160(%r11) 00000000002e0b84:
        07f4		bcr	15,%r4 00000000002e0b86:
        e31090080004	lg	%r1,8(%r9) >00000000002e0b8c:
        d501109cd000	clc	156(2,%r1),0(%r13) 00000000002e0b92:
        a784ff5d		brc	8,2e0a4c 00000000002e0b96:
        b9040029		lgr	%r2,%r9 00000000002e0b9a:
        c0e5fffff9c3	brasl	%r14,2dff20 00000000002e0ba0:
        a7f4ff56		brc	15,2e0a4c Call Trace:
        ([<00000000002e0a46>] disassociate_ctty+0x7a/0x288)
         [<0000000000141fe6>] do_exit+0x212/0x8d4
         [<0000000000142708>] do_group_exit+0x60/0xcc
         [<0000000000150660>] get_signal_to_deliver+0x270/0x3ac
         [<000000000010bfd6>] do_signal+0x8e/0x8dc
         [<0000000000113772>] sysc_sigpending+0xe/0x22
         [<000001ff0000b134>] 0x1ff0000b134
        INFO: lockdep is turned off.
        Last Breaking-Event-Address:
         [<00000000002e0a48>] disassociate_ctty+0x7c/0x288
        Kernel panic - not syncing: Fatal exception: panic_on_oops
      
      It seems that tty was already free in disassocate_ctty when it tries
      to dereference tty->driver.
      
      After moving the lock_kernel before the mutex_unlock, I can no longer
      reproduce the problem.
      
      [ This is a temporary partial fix for the documented and long standing
        race in disassociate_tty.  This stops most problem cases for now.
      
        For the next release the -next tree has an initial implementation of
        kref counting for tty structures and this quickfix will be dropped.
      
                                                                    - Alan ]
      Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      Signed-off-by; Alan Cox <alan@redhat.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      000b9151
  8. 08 8月, 2008 1 次提交
  9. 07 8月, 2008 5 次提交
  10. 05 8月, 2008 2 次提交
  11. 04 8月, 2008 1 次提交
  12. 02 8月, 2008 1 次提交
  13. 31 7月, 2008 1 次提交
  14. 30 7月, 2008 1 次提交
  15. 29 7月, 2008 1 次提交
  16. 28 7月, 2008 13 次提交