1. 11 11月, 2008 1 次提交
  2. 09 11月, 2008 1 次提交
    • K
      powerpc/fsl-booke: Fix synchronization bug w/local tlb invalidates · b41d6fee
      Kumar Gala 提交于
      The implemetation of _tlbil_pid() on Freescale Book-E cores needs
      an msync & isync after we flash invalidate the TLBs.  This was causing
      the following oops reported by Sebastian Andrzej Siewior:
      
        VFS: Mounted root (nfs filesystem) readonly.
        Freeing unused kernel memory: 148k init
        BUG: sleeping function called from invalid context at /home/bigeasy/git/linux-2.6-powerpc/mm/mmap.c:234
        in_atomic():1, irqs_disabled():0
        Call Trace:
        [df189df0] [c0007160] show_stack+0x48/0x148 (unreliable)
        [df189e30] [c0029480] __might_sleep+0xf0/0x100
        [df189e40] [c0070ac0] remove_vma+0x28/0x98
        [df189e50] [c0070c1c] exit_mmap+0xec/0x128
        [df189e80] [c002d2f4] mmput+0x54/0xec
        [df189ea0] [c0030b6c] exit_mm+0x10c/0x120
        [df189ed0] [c003288c] do_exit+0x1ac/0x6e8
        [df189f20] [c0032e48] do_group_exit+0x80/0xac
        [df189f40] [c000e9dc] ret_from_syscall+0x0/0x3c
        BUG: scheduling while atomic: udevd/956/0x10000002
        Modules linked in:
        Call Trace:
        [df189df0] [c0007160] show_stack+0x48/0x148 (unreliable)
        [df189e30] [c002ac88] __schedule_bug+0x58/0x6c
        [df189e40] [c023e6cc] schedule+0xa8/0x4a8
        [df189e90] [c002ad6c] __cond_resched+0x38/0x64
        [df189ea0] [c023ebc8] _cond_resched+0x3c/0x58
        [df189eb0] [c0030e70] put_files_struct+0x90/0xec
        [df189ed0] [c00328a8] do_exit+0x1c8/0x6e8
        [df189f20] [c0032e48] do_group_exit+0x80/0xac
        [df189f40] [c000e9dc] ret_from_syscall+0x0/0x3c
      Signed-off-by: NKumar Gala <galak@kernel.crashing.org>
      b41d6fee
  3. 31 10月, 2008 11 次提交
    • P
      Revert "powerpc: Sync RPA note in zImage with kernel's RPA note" · 5663a123
      Paul Mackerras 提交于
      This reverts commit 91a00302, plus
      commit 0dcd4401 ("powerpc: Revert CHRP
      boot wrapper to real-base = 12MB on 32-bit") which depended on it.
      
      Commit 91a00302 was causing NVRAM corruption on some pSeries machines,
      for as-yet unknown reasons, so this reverts it until the cause is
      identified.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      5663a123
    • M
      powerpc: Update remaining dma_mapping_ops to use map/unmap_page · f9226d57
      Mark Nelson 提交于
      After the merge of the 32 and 64bit DMA code, dma_direct_ops lost
      their map/unmap_single() functions but gained map/unmap_page().  This
      caused a problem for Cell because Cell's dma_iommu_fixed_ops called
      the dma_direct_ops if the fixed linear mapping was to be used or the
      iommu ops if the dynamic window was to be used.  So in order to fix
      this problem we need to update the 64bit DMA code to use
      map/unmap_page.
      
      First, we update the generic IOMMU code so that iommu_map_single()
      becomes iommu_map_page() and iommu_unmap_single() becomes
      iommu_unmap_page().  Then we propagate these changes up through all
      the callers of these two functions and in the process update all the
      dma_mapping_ops so that they have map/unmap_page rahter than
      map/unmap_single.  We can do this because on 64bit there is no HIGHMEM
      memory so map/unmap_page ends up performing exactly the same function
      as map/unmap_single, just taking different arguments.
      
      This has no affect on drivers because the dma_map_single_attrs() just
      ends up calling the map_page() function of the appropriate
      dma_mapping_ops and similarly the dma_unmap_single_attrs() calls
      unmap_page().
      
      This fixes an oops on Cell blades, which oops on boot without this
      because they call dma_direct_ops.map_single, which is NULL.
      Signed-off-by: NMark Nelson <markn@au1.ibm.com>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      f9226d57
    • B
      powerpc/pci: Fix unmapping of IO space on 64-bit · b30115ea
      Benjamin Herrenschmidt 提交于
      A typo/thinko made us pass the wrong argument to __flush_hash_table_range
      when unplugging bridges, thus not flushing all the translations for
      the IO space on unplug.  The third parameter to __flush_hash_table_range
      is `end', not `size'.
      
      This causes the hypervisor to refuse unplugging slots.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      b30115ea
    • N
      powerpc/pci: Properly allocate bus resources for hotplug PHBs · e90a1318
      Nathan Fontenot 提交于
      Resources for PHB's that are dynamically added to a system are not
      properly allocated in the resource tree.
      
      Not having these resources allocated causes an oops when removing
      the PHB when we try to release them.
      
      The diff appears a bit messy, this is mainly due to moving everything
      one tab to the left in the pcibios_allocate_bus_resources routine.
      The functionality change in this routine is only that the
      list_for_each_entry() loop is pulled out and moved to the necessary
      calling routine.
      Signed-off-by: NNathan Fontenot <nfont@austin.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      e90a1318
    • J
      OF-device: Don't overwrite numa_node in device registration · 6098e2ee
      Jeremy Kerr 提交于
      Currently, the numa_node of OF-devices will be overwritten during
      device_register, which simply sets the node to -1.  On cell machines,
      this means that devices can't find their IOMMU, which is referenced
      through the device's numa node.
      
      Set the numa node for OF devices with no parent, and use the
      lower-level device_initialize and device_add functions, so that the
      node is preserved.
      
      We can remove the call to set_dev_node in of_device_alloc, as it
      will be overwritten during register.
      Signed-off-by: NJeremy Kerr <jk@ozlabs.org>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      6098e2ee
    • M
      powerpc: Fix swapcontext system for VSX + old ucontext size · 16c29d18
      Michael Neuling 提交于
      Since VSX support was added, we now have two sizes of ucontext_t;
      the older, smaller size without the extra VSX state, and the new
      larger size with the extra VSX state.  A program using the
      sys_swapcontext system call and supplying smaller ucontext_t
      structures will currently get an EINVAL error if the task has
      used VSX (e.g. because of calling library code that uses VSX) and
      the old_ctx argument is non-NULL (i.e. the program is asking for
      its current context to be saved).  Thus the program will start
      getting EINVAL errors on calls that previously worked.
      
      This commit changes this behaviour so that we don't send an EINVAL in
      this case.  It will now return the smaller context but the VSX MSR bit
      will always be cleared to indicate that the ucontext_t doesn't include
      the extra VSX state, even if the task has executed VSX instructions.
      
      Both 32 and 64 bit cases are updated.
      
      [paulus@samba.org - also fix some access_ok() and get_user() calls]
      
      Thanks to Ben Herrenschmidt for noticing this problem.
      Signed-off-by: NMichael Neuling <mikey@neuling.org>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      16c29d18
    • M
      powerpc: Fix compiler warning for the relocatable kernel · b160544c
      Michael Neuling 提交于
      Fixes this warning:
       arch/powerpc/kernel/setup_64.c:447:5: warning: "kernstart_addr" is not defined
      
      which arises because PHYSICAL_START is no longer a constant when
      CONFIG_RELOCATABLE=y.
      Signed-off-by: NMichael Neuling <mikey@neuling.org>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      b160544c
    • P
      powerpc: Work around ld bug in older binutils · 2a4b9c5a
      Paul Mackerras 提交于
      Commit 549e8152 ("powerpc: Make the
      64-bit kernel as a position-independent executable") added lines to
      vmlinux.lds.S to add the extra sections needed to implement a
      relocatable kernel.  However, those lines seem to trigger a bug in
      older versions of GNU ld (such as 2.16.1) when building a
      non-relocatable kernel.  Since ld 2.16.1 is still a popular choice for
      cross-toolchains, this adds an #ifdef to vmlinux.lds.S so the added
      lines are only included when building a relocatable kernel.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      2a4b9c5a
    • M
      powerpc/ppc64/kdump: Better flag for running relocatable · 8b8b0cc1
      Milton Miller 提交于
      The __kdump_flag ABI is overly constraining for future development.
      
      As of 2.6.27, the kernel entry point has 4 constraints:  Offset 0 is
      the starting point for the master (boot) cpu (entered with r3 pointing
      to the device tree structure), offset 0x60 is code for the slave cpus
      (entered with r3 set to their device tree physical id), offset 0x20 is
      used by the iseries hypervisor, and secondary cpus must be well behaved
      when the first 256 bytes are copied to address 0.
      
      Placing the __kdump_flag at 0x18 is bad because:
      
      - It was taking the last 8 bytes before the iseries hypervisor data.
      - It was 8 bytes for a boolean flag
      - It had no way of identifying that the flag was present
      - It does leave any room for the master to add any additional code
        before branching, which hurts debug.
      - It will be unnecessarily hard for 32 bit code to be common (8 bytes)
      
      Now that we have eliminated the use of __kdump_flag in favor of
      the standard is_kdump_kernel(), this flag only controls run without
      relocating the kernel to PHYSICAL_START (0), so rename it __run_at_load.
      
      Move the flag to 0x5c, 1 word before the secondary cpu entry point at
      0x60.  Initialize it with "run0" to say it will run at 0 unless it is
      set to 1.  It only exists if we are relocatable.
      Signed-off-by: NMilton Miller <miltonm@bga.com>
      Signed-off-by: NMichael Neuling <mikey@neuling.org>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      8b8b0cc1
    • M
      powerpc: Use is_kdump_kernel() · 62a8bd6c
      Milton Miller 提交于
      linux/crash_dump.h defines is_kdump_kernel() to be used by code that
      needs to know if the previous kernel crashed instead of a (clean) boot
      or reboot.
      
      This updates the just added powerpc code to use it.  This is needed
      for the next commit, which will remove __kdump_flag.
      Signed-off-by: NMilton Miller <miltonm@bga.com>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      62a8bd6c
    • M
      powerpc: Kexec exit should not use magic numbers · 1767c8f3
      Milton Miller 提交于
      Commit 54622f10 ("powerpc: Support for
      relocatable kdump kernel") added a magic flag value in a register to
      tell purgatory that it should be a panic kernel.  This part is wrong
      and is reverted by this commit.
      
      The kernel gets a list of memory blocks and a entry point from user space.
      Its job is to copy the blocks into place and then branch to the designated
      entry point (after turning "off" the mmu).
      
      The user space tool inserts a trampoline, called purgatory, that runs
      before the user supplied code.   Its job is to establish the entry
      environment for the new kernel or other application based on the contents
      of memory.  The purgatory code is compiled and embedded in the tool,
      where it is later patched using the elf symbol table using elf symbols.
      
      Since the tool knows it is creating a purgatory that will run after a
      kernel crash, it should just patch purgatory (or the kernel directly)
      if something needs to happen.
      Signed-off-by: NMilton Miller <miltonm@bga.com>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      1767c8f3
  4. 23 10月, 2008 3 次提交
  5. 22 10月, 2008 4 次提交
  6. 21 10月, 2008 6 次提交
  7. 20 10月, 2008 1 次提交
    • V
      kdump: make elfcorehdr_addr independent of CONFIG_PROC_VMCORE · 57cac4d1
      Vivek Goyal 提交于
      o elfcorehdr_addr is used by not only the code under CONFIG_PROC_VMCORE
        but also by the code which is not inside CONFIG_PROC_VMCORE.  For
        example, is_kdump_kernel() is used by powerpc code to determine if
        kernel is booting after a panic then use previous kernel's TCE table.
        So even if CONFIG_PROC_VMCORE is not set in second kernel, one should be
        able to correctly determine that we are booting after a panic and setup
        calgary iommu accordingly.
      
      o So remove the assumption that elfcorehdr_addr is under
        CONFIG_PROC_VMCORE.
      
      o Move definition of elfcorehdr_addr to arch dependent crash files.
        (Unfortunately crash dump does not have an arch independent file
        otherwise that would have been the best place).
      
      o kexec.c is not the right place as one can Have CRASH_DUMP enabled in
        second kernel without KEXEC being enabled.
      
      o I don't see sh setup code parsing the command line for
        elfcorehdr_addr.  I am wondering how does vmcore interface work on sh.
        Anyway, I am atleast defining elfcoredhr_addr so that compilation is not
        broken on sh.
      Signed-off-by: NVivek Goyal <vgoyal@redhat.com>
      Acked-by: N"Eric W. Biederman" <ebiederm@xmission.com>
      Acked-by: NSimon Horman <horms@verge.net.au>
      Acked-by: NPaul Mundt <lethal@linux-sh.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      57cac4d1
  8. 17 10月, 2008 5 次提交
  9. 15 10月, 2008 6 次提交
    • H
      KVM: powerpc: Map guest userspace with TID=0 mappings · 49dd2c49
      Hollis Blanchard 提交于
      When we use TID=N userspace mappings, we must ensure that kernel mappings have
      been destroyed when entering userspace. Using TID=1/TID=0 for kernel/user
      mappings and running userspace with PID=0 means that userspace can't access the
      kernel mappings, but the kernel can directly access userspace.
      
      The net is that we don't need to flush the TLB on privilege switches, but we do
      on guest context switches (which are far more infrequent). Guest boot time
      performance improvement: about 30%.
      Signed-off-by: NHollis Blanchard <hollisb@us.ibm.com>
      Signed-off-by: NAvi Kivity <avi@qumranet.com>
      49dd2c49
    • H
      KVM: ppc: Write only modified shadow entries into the TLB on exit · 83aae4a8
      Hollis Blanchard 提交于
      Track which TLB entries need to be written, instead of overwriting everything
      below the high water mark. Typically only a single guest TLB entry will be
      modified in a single exit.
      
      Guest boot time performance improvement: about 15%.
      Signed-off-by: NHollis Blanchard <hollisb@us.ibm.com>
      Signed-off-by: NAvi Kivity <avi@qumranet.com>
      83aae4a8
    • H
      KVM: ppc: Stop saving host TLB state · 20754c24
      Hollis Blanchard 提交于
      We're saving the host TLB state to memory on every exit, but never using it.
      Originally I had thought that we'd want to restore host TLB for heavyweight
      exits, but that could actually hurt when context switching to an unrelated host
      process (i.e. not qemu).
      
      Since this decreases the performance penalty of all exits, this patch improves
      guest boot time by about 15%.
      Signed-off-by: NHollis Blanchard <hollisb@us.ibm.com>
      Signed-off-by: NAvi Kivity <avi@qumranet.com>
      20754c24
    • B
      powerpc: Fix 32-bit SMP boot on CHRP · 2bda347b
      Benjamin Herrenschmidt 提交于
      prom_init was changed to take a new argument, the address
      where the kernel is loaded, which is now used to copy the
      SMP spin loop down before use.
      
      However, only head_64.S was adapted to pass this new value,
      not head_32.S, thus breaking SMP boot on 32-bit SMP CHRP
      machines.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      2bda347b
    • B
      powerpc: Fix link errors on 32-bit machines using legacy DMA · 7b6b574c
      Benjamin Herrenschmidt 提交于
      The new merged DMA code will try to access isa_bridge_pcidev when
      trying to DMA to/from legacy devices. This is however only defined
      on 64-bit. Fixes this for now by adding the variable, even if it
      stays NULL. In the long run, we'll make isa-bridge.c common to
      32 and 64-bit.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      7b6b574c
    • B
      powerpc/pci: Improve detection of unassigned bridge resources · b5561511
      Benjamin Herrenschmidt 提交于
      When the powerpc PCI layer is not configured to re-assign everything,
      it currently fails to detect that a PCI to PCI bridge has been left
      unassigned by the firmware and tries to allocate resource for the
      default window values in the bridge (0...X) (with the notable exception
      of a hack we have in there that detects some Apple firmware unassigned
      bridge resources).
      
      This results in resource allocation failures, which are generally
      fixed up later on but it causes scary warnings in the logs and we
      have seen the fixup code fall over in some circumstances (a different
      issue to fix as well).
      
      This code improves that by providing a more complete & useful function
      to intuit that a bridge was left unassigned by the firmware, and thus
      force a full re-allocation by the PCI code without trying to allocate
      the existing useless resources first.
      
      The algorithm we use basically considers unassigned a window that
      starts at 0 (PCI address) if the corresponding address space enable
      bit is not set. In addition, for memory space, it considers such a
      resource unassigned also if the host bridge isn't configured to
      forward cycles to address 0 (ie, the resource basically overlaps
      main memory).
      
      This fixes a range of problems with things like Bare-Metal support
      on pSeries machines, or attempt to use partial firmware PCI setup.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      b5561511
  10. 14 10月, 2008 2 次提交