1. 18 12月, 2013 2 次提交
    • P
      KVM: PPC: Book3S HV: Don't drop low-order page address bits · df9059bb
      Paul Mackerras 提交于
      Commit caaa4c80 ("KVM: PPC: Book3S HV: Fix physical address
      calculations") unfortunately resulted in some low-order address bits
      getting dropped in the case where the guest is creating a 4k HPTE
      and the host page size is 64k.  By getting the low-order bits from
      hva rather than gpa we miss out on bits 12 - 15 in this case, since
      hva is at page granularity.  This puts the missing bits back in.
      Reported-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      df9059bb
    • A
      powerpc: book3s: kvm: Don't abuse host r2 in exit path · 36e7bb38
      Aneesh Kumar K.V 提交于
      We don't use PACATOC for PR. Avoid updating HOST_R2 with PR
      KVM mode when both HV and PR are enabled in the kernel. Without this we
      get the below crash
      
      (qemu)
      Unable to handle kernel paging request for data at address 0xffffffffffff8310
      Faulting instruction address: 0xc00000000001d5a4
      cpu 0x2: Vector: 300 (Data Access) at [c0000001dc53aef0]
          pc: c00000000001d5a4: .vtime_delta.isra.1+0x34/0x1d0
          lr: c00000000001d760: .vtime_account_system+0x20/0x60
          sp: c0000001dc53b170
         msr: 8000000000009032
         dar: ffffffffffff8310
       dsisr: 40000000
        current = 0xc0000001d76c62d0
        paca    = 0xc00000000fef1100   softe: 0        irq_happened: 0x01
          pid   = 4472, comm = qemu-system-ppc
      enter ? for help
      [c0000001dc53b200] c00000000001d760 .vtime_account_system+0x20/0x60
      [c0000001dc53b290] c00000000008d050 .kvmppc_handle_exit_pr+0x60/0xa50
      [c0000001dc53b340] c00000000008f51c kvm_start_lightweight+0xb4/0xc4
      [c0000001dc53b510] c00000000008cdf0 .kvmppc_vcpu_run_pr+0x150/0x2e0
      [c0000001dc53b9e0] c00000000008341c .kvmppc_vcpu_run+0x2c/0x40
      [c0000001dc53ba50] c000000000080af4 .kvm_arch_vcpu_ioctl_run+0x54/0x1b0
      [c0000001dc53bae0] c00000000007b4c8 .kvm_vcpu_ioctl+0x478/0x730
      [c0000001dc53bca0] c0000000002140cc .do_vfs_ioctl+0x4ac/0x770
      [c0000001dc53bd80] c0000000002143e8 .SyS_ioctl+0x58/0xb0
      [c0000001dc53be30] c000000000009e58 syscall_exit+0x0/0x98
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      36e7bb38
  2. 11 12月, 2013 1 次提交
    • S
      powerpc/kvm/booke: Fix build break due to stack frame size warning · f5f97210
      Scott Wood 提交于
      Commit ce11e48b ("KVM: PPC: E500: Add
      userspace debug stub support") added "struct thread_struct" to the
      stack of kvmppc_vcpu_run().  thread_struct is 1152 bytes on my build,
      compared to 48 bytes for the recently-introduced "struct debug_reg".
      Use the latter instead.
      
      This fixes the following error:
      
      cc1: warnings being treated as errors
      arch/powerpc/kvm/booke.c: In function 'kvmppc_vcpu_run':
      arch/powerpc/kvm/booke.c:760:1: error: the frame size of 1424 bytes is larger than 1024 bytes
      make[2]: *** [arch/powerpc/kvm/booke.o] Error 1
      make[1]: *** [arch/powerpc/kvm] Error 2
      make[1]: *** Waiting for unfinished jobs....
      Signed-off-by: NScott Wood <scottwood@freescale.com>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      f5f97210
  3. 10 12月, 2013 7 次提交
  4. 09 12月, 2013 4 次提交
    • A
      KVM: PPC: Book3S: PR: Enable interrupts earlier · 3d3319b4
      Alexander Graf 提交于
      Now that the svcpu sync is interrupt aware we can enable interrupts
      earlier in the exit code path again, moving 32bit and 64bit closer
      together.
      
      While at it, document the fact that we're always executing the exit
      path with interrupts enabled so that the next person doesn't trap
      over this.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      3d3319b4
    • A
      KVM: PPC: Book3S: PR: Make svcpu -> vcpu store preempt savvy · 40fdd8c8
      Alexander Graf 提交于
      As soon as we get back to our "highmem" handler in virtual address
      space we may get preempted. Today the reason we can get preempted is
      that we replay interrupts and all the lazy logic thinks we have
      interrupts enabled.
      
      However, it's not hard to make the code interruptible and that way
      we can enable and handle interrupts even earlier.
      
      This fixes random guest crashes that happened with CONFIG_PREEMPT=y
      for me.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      40fdd8c8
    • A
      KVM: PPC: Book3S: PR: Export kvmppc_copy_to|from_svcpu · c9dad7f9
      Alexander Graf 提交于
      The kvmppc_copy_{to,from}_svcpu functions are publically visible,
      so we should also export them in a header for others C files to
      consume.
      
      So far we didn't need this because we only called it from asm code.
      The next patch will introduce a C caller.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      c9dad7f9
    • A
      KVM: PPC: Book3S: PR: Don't clobber our exit handler id · d825a043
      Alexander Graf 提交于
      We call a C helper to save all svcpu fields into our vcpu. The C
      ABI states that r12 is considered volatile. However, we keep our
      exit handler id in r12 currently.
      
      So we need to save it away into a non-volatile register instead
      that definitely does get preserved across the C call.
      
      This bug usually didn't hit anyone yet since gcc is smart enough
      to generate code that doesn't even need r12 which means it stayed
      identical throughout the call by sheer luck. But we can't rely on
      that.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      d825a043
  5. 07 12月, 2013 1 次提交
    • G
      powerpc/512x: dts: remove misplaced IRQ spec from 'soc' node · c65ec135
      Gerhard Sittig 提交于
      the 'soc' node in the common .dtsi for MPC5121 has an '#interrupt-cells'
      property although this node is not an interrupt controller
      
      remove this erroneously placed property because starting with v3.13-rc1
      lookup and resolution of 'interrupts' specs for peripherals gets misled,
      emits 'no irq domain found' WARN() messages and breaks the boot process
      
        irq: no irq domain found for /soc@80000000 !
        ------------[ cut here ]------------
        WARNING: at drivers/of/platform.c:171
        Modules linked in:
        CPU: 0 PID: 1 Comm: swapper Tainted: G        W    3.13.0-rc1-00001-g8a66234 #8
        task: df823bb0 ti: df834000 task.ti: df834000
        NIP: c02b5190 LR: c02b5180 CTR: c01cf4e0
        REGS: df835c50 TRAP: 0700   Tainted: G        W     (3.13.0-rc1-00001-g8a66234)
        MSR: 00029032 <EE,ME,IR,DR,RI>  CR: 229a9d42  XER: 20000000
      
        GPR00: c02b5180 df835d00 df823bb0 00000000 00000000 df835b18 ffffffff 00000308
        GPR08: c0479cc0 c0480000 c0479cc0 00000308 00000308 00000000 c00040fc 00000000
        GPR16: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 df850880
        GPR24: df84d670 00000000 00000001 df8561a0 dffffccc df85089c 00000020 00000001
        NIP [c02b5190] of_device_alloc+0xf4/0x1a0
        LR [c02b5180] of_device_alloc+0xe4/0x1a0
        Call Trace:
        [df835d00] [c02b5180] of_device_alloc+0xe4/0x1a0 (unreliable)
        [df835d50] [c02b5278] of_platform_device_create_pdata+0x3c/0xc8
        [df835d70] [c02b53fc] of_platform_bus_create+0xf8/0x170
        [df835dc0] [c02b5448] of_platform_bus_create+0x144/0x170
        [df835e10] [c02b55a8] of_platform_bus_probe+0x98/0xe8
        [df835e30] [c0437508] mpc512x_init+0x28/0x1c4
        [df835e70] [c0435de8] ppc_init+0x4c/0x60
        [df835e80] [c0003b28] do_one_initcall+0x150/0x1a4
        [df835ef0] [c0432048] kernel_init_freeable+0x114/0x1c0
        [df835f30] [c0004114] kernel_init+0x18/0x124
        [df835f40] [c000e910] ret_from_kernel_thread+0x5c/0x64
        Instruction dump:
        409effd4 57c9103a 57de2834 7c89f050 7f83e378 7c972214 7f45d378 48001f55
        7c63d278 7c630034 5463d97e 687a0001 <0f1a0000> 2f990000 387b0010 939b0098
        ---[ end trace 2257f10e5a20cbdd ]---
      
        ...
        irq: no irq domain found for /soc@80000000 !
        fsl-diu-fb 80002100.display: could not get DIU IRQ
        fsl-diu-fb: probe of 80002100.display failed with error -22
        irq: no irq domain found for /soc@80000000 !
        mpc512x_dma 80014000.dma: Error mapping IRQ!
        mpc512x_dma: probe of 80014000.dma failed with error -22
        ...
        irq: no irq domain found for /soc@80000000 !
        fs_enet: probe of 80002800.ethernet failed with error -22
        ...
        irq: no irq domain found for /soc@80000000 !
        mpc5121-rtc 80000a00.rtc: mpc5121_rtc_probe: could not request irq: 0
        mpc5121-rtc: probe of 80000a00.rtc failed with error -22
        ...
      
      Cc: Anatolij Gustschin <agust@denx.de>
      Cc: linuxppc-dev@lists.ozlabs.org
      Cc: devicetree@vger.kernel.org
      Signed-off-by: NGerhard Sittig <gsi@denx.de>
      Signed-off-by: NAnatolij Gustschin <agust@denx.de>
      c65ec135
  6. 25 11月, 2013 5 次提交
    • C
      arch/powerpc/kernel: Use %12.12s instead of %12s to avoid memory overflow · e0513d9e
      Chen Gang 提交于
      for tmp_part->header.name:
          it is "Terminating null required only for names < 12 chars".
          so need to limit the %.12s for it in printk
      
        additional info:
      
          %12s  limit the width, not for the original string output length
                if name length is more than 12, it still can be fully displayed.
                if name length is less than 12, the ' ' will be filled before name.
      
          %.12s truly limit the original string output length (precision)
      Signed-off-by: NChen Gang <gang.chen@asianux.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      e0513d9e
    • M
      powerpc/signals: Improved mark VSX not saved with small contexts fix · ec67ad82
      Michael Neuling 提交于
      In a recent patch:
        commit c13f20ac
        Author: Michael Neuling <mikey@neuling.org>
        powerpc/signals: Mark VSX not saved with small contexts
      
      We fixed an issue but an improved solution was later discussed after the patch
      was merged.
      
      Firstly, this patch doesn't handle the 64bit signals case, which could also hit
      this issue (but has never been reported).
      
      Secondly, the original patch isn't clear what MSR VSX should be set to.  The
      new approach below always clears the MSR VSX bit (to indicate no VSX is in the
      context) and sets it only in the specific case where VSX is available (ie. when
      VSX has been used and the signal context passed has space to provide the
      state).
      
      This reverts the original patch and replaces it with the improved solution.  It
      also adds a 64 bit version.
      Signed-off-by: NMichael Neuling <mikey@neuling.org>
      Cc: stable@vger.kernel.org
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      ec67ad82
    • H
      powerpc/kdump: Adding symbols in vmcoreinfo to facilitate dump filtering · 8ff81271
      Hari Bathini 提交于
      When CONFIG_SPARSEMEM_VMEMMAP option is used in kernel, makedumpfile fails
      to filter vmcore dump as it fails to do vmemmap translations. So far
      dump filtering on ppc64 never had to deal with vmemmap addresses seperately
      as vmemmap regions where mapped in zone normal. But with the inclusion of
      CONFIG_SPARSEMEM_VMEMMAP config option in kernel, this vmemmap address
      translation support becomes necessary for dump filtering. For vmemmap adress
      translation, few kernel symbols are needed by dump filtering tool. This patch
      adds those symbols to vmcoreinfo, which a dump filtering tool can use for
      filtering the kernel dump. Tested this changes successfully with makedumpfile
      tool that supports vmemmap to physical address translation outside zone normal.
      
      [ Removed unneeded #ifdef as suggested by Michael Ellerman --BenH ]
      Signed-off-by: NHari Bathini <hbathini@linux.vnet.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      8ff81271
    • A
      powerpc: allyesconfig should not select CONFIG_CPU_LITTLE_ENDIAN · 962bc221
      Anton Blanchard 提交于
      Stephen reported a failure in an allyesconfig build.
      CONFIG_CPU_LITTLE_ENDIAN=y gets set but his toolchain is not
      new enough to support little endian. We really want to
      default to a big endian build; Ben suggested using a choice
      which defaults to CPU_BIG_ENDIAN.
      Signed-off-by: NAnton Blanchard <anton@samba.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      962bc221
    • M
      powerpc: Fix error when cross building TAGS & cscope · 924dd50b
      Michael Neuling 提交于
      Currently if I cross build TAGS or cscope from x86 I get this:
        % make ARCH=powerpc TAGS
        gcc-4.8.real: error: unrecognized command line option ‘-mbig-endian’
        GEN     TAGS
        %
      
      I'm not setting CROSS_COMPILE= as logically I shouldn't need to and I
      haven't needed to in the past when building TAGS or cscope.  Also, the
      above completess correct as the error is not fatal to the build.
      
      This was caused by:
          commit d72b0801
          Author: Ian Munsie <imunsie@au1.ibm.com>
          powerpc: Add ability to build little endian kernels
      
      The below fixes this by testing for the -mbig-endian option before
      adding it.
      
      I've not done the same thing in the little endian case as if
      -mlittle-endian doesn't exist, we probably want to fail quickly as you
      probably have an old big endian compiler.
      Signed-off-by: NMichael Neuling <mikey@neuling.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      924dd50b
  7. 23 11月, 2013 4 次提交
  8. 21 11月, 2013 16 次提交