1. 15 May, 2018 3 commits
  2. 14 May, 2018 5 commits
  3. 11 May, 2018 5 commits
    • Michael Ellerman's avatar
      powerpc/prom: Drop support for old FDT versions · 89c19062
      Michael Ellerman authored
      In commit e6a6928c ("of/fdt: Convert FDT functions to use
      libfdt") (Apr 2014), the generic flat device tree code dropped support
      for flat device tree's older than version 0x10 (16).
      
      We still have code in our CPU scanning to cope with flat device tree
      versions earlier than 2, which can now never trigger, so drop it.
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      89c19062
    • Michael Ellerman's avatar
      powerpc/lib: Add alt patching test of branching past the last instruction · 6158faed
      Michael Ellerman authored
      Add a test of the relative branch patching logic in the alternate
      section feature fixup code. This tests that if we branch past the last
      instruction of the alternate section, the branch is not patched.
      That's because the assembler will have created a branch that already
      points to the first instruction after the patched section, which is
      correct and needs no further patching.
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      6158faed
    • Michael Ellerman's avatar
      powerpc/lib: Rename ftr_fixup_test7 to ftr_fixup_test_too_big · b58e7987
      Michael Ellerman authored
      We want this to remain the last test (because it's disabled by
      default), so give it a non-numbered name so we don't have to renumber
      it when adding new tests before it.
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      b58e7987
    • Michael Ellerman's avatar
      powerpc/lib: Fix the feature fixup tests to actually work · cad0e390
      Michael Ellerman authored
      The code patching code has always been a bit confused about whether
      it's best to use void *, unsigned int *, char *, etc. to point to
      instructions. In fact in the feature fixups tests we use both unsigned
      int[] and u8[] in different places.
      
      Unfortunately the tests that use unsigned int[] calculate the size of
      the code blocks using subtraction of those unsigned int pointers, and
      then pass the result to memcmp(). This means we're only comparing 1/4
      of the bytes we need to, because we need to multiply by
      sizeof(unsigned int) to get the number of *bytes*.
      
      The result is that the tests do all the patching and then only compare
      some of the resulting code, so patching bugs that only effect that
      last 3/4 of the code could slip through undetected. It turns out that
      hasn't been happening, although one test had a bad expected case (see
      previous commit).
      
      Fix it for now by multiplying the size by 4 in the affected functions.
      
      Fixes: 362e7701 ("powerpc: Add self-tests of the feature fixup code")
      Epic-brown-paper-bag-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      cad0e390
    • Michael Ellerman's avatar
      powerpc/lib: Fix feature fixup test of external branch · 32810d91
      Michael Ellerman authored
      The expected case for this test was wrong, the source of the alternate
      code sequence is:
      
        FTR_SECTION_ELSE
        2:	or	2,2,2
        	PPC_LCMPI	r3,1
        	beq	3f
        	blt	2b
        	b	3f
        	b	1b
        ALT_FTR_SECTION_END(0, 1)
        3:	or	1,1,1
        	or	2,2,2
        4:	or	3,3,3
      
      So when it's patched the '3' label should still be on the 'or 1,1,1',
      and the 4 label is irrelevant and can be removed.
      
      Fixes: 362e7701 ("powerpc: Add self-tests of the feature fixup code")
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      32810d91
  4. 10 May, 2018 21 commits
  5. 07 May, 2018 4 commits
  6. 03 May, 2018 2 commits
    • Mahesh Salgaonkar's avatar
      powerpc/fadump: Unregister fadump on kexec down path. · 722cde76
      Mahesh Salgaonkar authored
      Unregister fadump on kexec down path otherwise the fadump registration
      in new kexec-ed kernel complains that fadump is already registered.
      This makes new kernel to continue using fadump registered by previous
      kernel which may lead to invalid vmcore generation. Hence this patch
      fixes this issue by un-registering fadump in fadump_cleanup() which is
      called during kexec path so that new kernel can register fadump with
      new valid values.
      
      Fixes: b500afff ("fadump: Invalidate registration and release reserved memory for general use.")
      Cc: stable@vger.kernel.org # v3.4+
      Signed-off-by: default avatarMahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      722cde76
    • Hari Bathini's avatar
      powerpc/fadump: Do not use hugepages when fadump is active · 85975387
      Hari Bathini authored
      FADump capture kernel boots in restricted memory environment preserving
      the context of previous kernel to save vmcore. Supporting hugepages in
      such environment makes things unnecessarily complicated, as hugepages
      need memory set aside for them. This means most of the capture kernel's
      memory is used in supporting hugepages. In most cases, this results in
      out-of-memory issues while booting FADump capture kernel. But hugepages
      are not of much use in capture kernel whose only job is to save vmcore.
      So, disabling hugepages support, when fadump is active, is a reliable
      solution for the out of memory issues. Introducing a flag variable to
      disable HugeTLB support when fadump is active.
      Signed-off-by: default avatarHari Bathini <hbathini@linux.vnet.ibm.com>
      Reviewed-by: default avatarMahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      85975387