1. 10 2月, 2016 3 次提交
  2. 09 2月, 2016 8 次提交
  3. 06 2月, 2016 3 次提交
    • N
      um: asm/page.h: remove the pte_high member from struct pte_t · 012a4163
      Nicolai Stange 提交于
      Commit 16da3068 ("um: kill pfn_t") introduced a compile warning for
      defconfig (SUBARCH=i386):
      
        arch/um/kernel/skas/mmu.c:38:206:
            warning: right shift count >= width of type [-Wshift-count-overflow]
      
      Aforementioned patch changes the definition of the phys_to_pfn() macro
      from
      
        ((pfn_t) ((p) >> PAGE_SHIFT))
      
      to
      
        ((p) >> PAGE_SHIFT)
      
      This effectively changes the phys_to_pfn() expansion's type from
      unsigned long long to unsigned long.
      
      Through the callchain init_stub_pte() => mk_pte(), the expansion of
      phys_to_pfn() is (indirectly) fed into the 'phys' argument of the
      pte_set_val(pte, phys, prot) macro, eventually leading to
      
        (pte).pte_high = (phys) >> 32;
      
      This results in the warning from above.
      
      Since UML only deals with 32 bit addresses, the upper 32 bits from
      'phys' used to be always zero anyway.  Also, all page protection flags
      defined by UML don't use any bits beyond bit 9.  Since the contents of a
      PTE are defined within architecture scope only, the ->pte_high member
      can be safely removed.
      
      Remove the ->pte_high member from struct pte_t.
      Rename ->pte_low to ->pte.
      Adapt the pte helper macros in arch/um/include/asm/page.h.
      
      Noteworthy is the pte_copy() macro where a smp_wmb() gets dropped.  This
      write barrier doesn't seem to be paired with any read barrier though and
      thus, was useless anyway.
      
      Fixes: 16da3068 ("um: kill pfn_t")
      Signed-off-by: NNicolai Stange <nicstange@gmail.com>
      Cc: Dan Williams <dan.j.williams@intel.com>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Nicolai Stange <nicstange@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      012a4163
    • V
      mm, hugetlb: don't require CMA for runtime gigantic pages · 080fe206
      Vlastimil Babka 提交于
      Commit 944d9fec ("hugetlb: add support for gigantic page allocation
      at runtime") has added the runtime gigantic page allocation via
      alloc_contig_range(), making this support available only when CONFIG_CMA
      is enabled.  Because it doesn't depend on MIGRATE_CMA pageblocks and the
      associated infrastructure, it is possible with few simple adjustments to
      require only CONFIG_MEMORY_ISOLATION instead of full CONFIG_CMA.
      
      After this patch, alloc_contig_range() and related functions are
      available and used for gigantic pages with just CONFIG_MEMORY_ISOLATION
      enabled.  Note CONFIG_CMA selects CONFIG_MEMORY_ISOLATION.  This allows
      supporting runtime gigantic pages without the CMA-specific checks in
      page allocator fastpaths.
      Signed-off-by: NVlastimil Babka <vbabka@suse.cz>
      Cc: Luiz Capitulino <lcapitulino@redhat.com>
      Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Cc: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
      Cc: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
      Cc: Mel Gorman <mgorman@techsingularity.net>
      Cc: Davidlohr Bueso <dave@stgolabs.net>
      Cc: Hillf Danton <hillf.zj@alibaba-inc.com>
      Cc: Mike Kravetz <mike.kravetz@oracle.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      080fe206
    • S
      m32r: fix build failure due to SMP and MMU · af1ddcb5
      Sudip Mukherjee 提交于
      One of the randconfig build failed with the error:
      
        arch/m32r/kernel/smp.c: In function 'smp_flush_tlb_mm':
        arch/m32r/kernel/smp.c:283:20: error: subscripted value is neither array nor pointer nor vector
          mmc = &mm->context[cpu_id];
                            ^
        arch/m32r/kernel/smp.c: In function 'smp_flush_tlb_page':
        arch/m32r/kernel/smp.c:353:20: error: subscripted value is neither array nor pointer nor vector
          mmc = &mm->context[cpu_id];
                            ^
        arch/m32r/kernel/smp.c: In function 'smp_invalidate_interrupt':
        arch/m32r/kernel/smp.c:479:41: error: subscripted value is neither array nor pointer nor vector
          unsigned long *mmc = &flush_mm->context[cpu_id];
      
      It turned out that CONFIG_SMP was defined but CONFIG_MMU was not
      defined.  But arch/m32r/include/asm/mmu.h only defines mm_context_t as
      an array when both CONFIG_SMP and CONFIG_MMU are defined.  And
      arch/m32r/kernel/smp.c is always using context as an array.  So without
      MMU SMP can not work.
      Signed-off-by: NSudip Mukherjee <sudip@vectorindia.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      af1ddcb5
  4. 05 2月, 2016 3 次提交
    • M
      regmap: mmio: Revert to v4.4 endianness handling · 320549a2
      Mark Brown 提交于
      Commit 29bb45f2 (regmap-mmio: Use native endianness for read/write)
      attempted to fix some long standing bugs in the MMIO implementation for
      big endian systems caused by duplicate byte swapping in both regmap and
      readl()/writel() which affected MIPS systems as when they are in big
      endian mode they flip the endianness of all registers in the system, not
      just the CPU.  MIPS systems had worked around this by declaring regmap
      using IPs as little endian which is inaccurate, unfortunately the issue
      had not been reported.
      
      Sadly the fix makes things worse rather than better.  By changing the
      behaviour to match the documentation it caused behaviour changes for
      other IPs which broke them and by using the __raw I/O accessors to avoid
      the endianness swapping in readl()/writel() it removed some memory
      ordering guarantees and could potentially generate unvirtualisable
      instructions on some architectures.
      
      Unfortunately sorting out all this mess in any half way sensible fashion
      was far too invasive to go in during an -rc cycle so instead let's go
      back to the old broken behaviour for v4.5, the better fixes are already
      queued for v4.6.  This does mean that we keep the broken MIPS DTs for
      another release but that seems the least bad way of handling the
      situation.
      Reported-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      320549a2
    • D
      ARM: multi_v7_defconfig: enable DW_WATCHDOG · 381a65c2
      Dinh Nguyen 提交于
      The watchdog timer on the SoCFPGA platform is the Synopsys Designware watchdog.
      Enable CONFIG_DW_WATCHDOG for the driver to get built.
      Signed-off-by: NDinh Nguyen <dinguyen@opensource.altera.com>
      Tested-by: NKevin Hilman <khilman@baylibre.com>
      Signed-off-by: NOlof Johansson <olof@lixom.net>
      381a65c2
    • L
      ARM: nomadik: fix up SD/MMC DT settings · 418d5516
      Linus Walleij 提交于
      The DTSI file for the Nomadik does not properly specify how the
      PL180 levelshifter is connected: the Nomadik actually needs all
      the five st,sig-dir-* flags set to properly control all lines out.
      
      Further this board supports full power cycling of the card, and
      since this variant has no hardware clock gating, it needs a
      ridiculously low frequency setting to keep up with the ever
      overflowing FIFO.
      
      The pin configuration set-up is a bit of a mystery, because of
      course these pins are a mix of inputs and outputs. However the
      reference implementation sets all pins to "output" with
      unspecified initial value, so let's do that here as well.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      Acked-by: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NOlof Johansson <olof@lixom.net>
      418d5516
  5. 04 2月, 2016 1 次提交
  6. 02 2月, 2016 7 次提交
  7. 01 2月, 2016 1 次提交
  8. 29 1月, 2016 3 次提交
    • M
      x86/mm/pat: Avoid truncation when converting cpa->numpages to address · 74256377
      Matt Fleming 提交于
      There are a couple of nasty truncation bugs lurking in the pageattr
      code that can be triggered when mapping EFI regions, e.g. when we pass
      a cpa->pgd pointer. Because cpa->numpages is a 32-bit value, shifting
      left by PAGE_SHIFT will truncate the resultant address to 32-bits.
      
      Viorel-Cătălin managed to trigger this bug on his Dell machine that
      provides a ~5GB EFI region which requires 1236992 pages to be mapped.
      When calling populate_pud() the end of the region gets calculated
      incorrectly in the following buggy expression,
      
        end = start + (cpa->numpages << PAGE_SHIFT);
      
      And only 188416 pages are mapped. Next, populate_pud() gets invoked
      for a second time because of the loop in __change_page_attr_set_clr(),
      only this time no pages get mapped because shifting the remaining
      number of pages (1048576) by PAGE_SHIFT is zero. At which point the
      loop in __change_page_attr_set_clr() spins forever because we fail to
      map progress.
      
      Hitting this bug depends very much on the virtual address we pick to
      map the large region at and how many pages we map on the initial run
      through the loop. This explains why this issue was only recently hit
      with the introduction of commit
      
        a5caa209 ("x86/efi: Fix boot crash by mapping EFI memmap
         entries bottom-up at runtime, instead of top-down")
      
      It's interesting to note that safe uses of cpa->numpages do exist in
      the pageattr code. If instead of shifting ->numpages we multiply by
      PAGE_SIZE, no truncation occurs because PAGE_SIZE is a UL value, and
      so the result is unsigned long.
      
      To avoid surprises when users try to convert very large cpa->numpages
      values to addresses, change the data type from 'int' to 'unsigned
      long', thereby making it suitable for shifting by PAGE_SHIFT without
      any type casting.
      
      The alternative would be to make liberal use of casting, but that is
      far more likely to cause problems in the future when someone adds more
      code and fails to cast properly; this bug was difficult enough to
      track down in the first place.
      Reported-and-tested-by: NViorel-Cătălin Răpițeanu <rapiteanu.catalin@gmail.com>
      Acked-by: NBorislav Petkov <bp@alien8.de>
      Cc: Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NMatt Fleming <matt@codeblueprint.co.uk>
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=110131
      Link: http://lkml.kernel.org/r/1454067370-10374-1-git-send-email-matt@codeblueprint.co.ukSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      74256377
    • P
      perf/x86: De-obfuscate code · 8f04b853
      Peter Zijlstra 提交于
      Get rid of the 'onln' obfuscation.
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Vince Weaver <vincent.weaver@maine.edu>
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      8f04b853
    • P
      perf/x86: Fix uninitialized value usage · e01d8718
      Peter Zijlstra 提交于
      When calling intel_alt_er() with .idx != EXTRA_REG_RSP_* we will not
      initialize alt_idx and then use this uninitialized value to index an
      array.
      
      When that is not fatal, it can result in an infinite loop in its
      caller __intel_shared_reg_get_constraints(), with IRQs disabled.
      
      Alternative error modes are random memory corruption due to the
      cpuc->shared_regs->regs[] array overrun, which manifest in either
      get_constraints or put_constraints doing weird stuff.
      
      Only took 6 hours of painful debugging to find this. Neither GCC nor
      Smatch warnings flagged this bug.
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Kan Liang <kan.liang@intel.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Vince Weaver <vincent.weaver@maine.edu>
      Fixes: ae3f011f ("perf/x86/intel: Fix SLM MSR_OFFCORE_RSP1 valid_mask")
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      e01d8718
  9. 28 1月, 2016 11 次提交