<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/sh/mm, branch linux-4.17.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.17.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.17.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2018-05-11T17:35:46Z</updated>
<entry>
<title>sh: switch to NO_BOOTMEM</title>
<updated>2018-05-11T17:35:46Z</updated>
<author>
<name>Rob Herring</name>
</author>
<published>2018-05-11T13:45:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ac21fc2dcb405cf250ad3f1228f64f64930d9211'/>
<id>urn:sha1:ac21fc2dcb405cf250ad3f1228f64f64930d9211</id>
<content type='text'>
Commit 0fa1c579349f ("of/fdt: use memblock_virt_alloc for early alloc")
inadvertently switched the DT unflattening allocations from memblock to
bootmem which doesn't work because the unflattening happens before
bootmem is initialized. Swapping the order of bootmem init and
unflattening could also fix this, but removing bootmem is desired. So
enable NO_BOOTMEM on SH like other architectures have done.

Fixes: 0fa1c579349f ("of/fdt: use memblock_virt_alloc for early alloc")
Reported-by: Rich Felker &lt;dalias@libc.org&gt;
Cc: Yoshinori Sato &lt;ysato@users.sourceforge.jp&gt;
Signed-off-by: Rob Herring &lt;robh@kernel.org&gt;
Signed-off-by: Rich Felker &lt;dalias@libc.org&gt;
</content>
</entry>
<entry>
<title>sh: mm: Fix unprotected access to struct device</title>
<updated>2018-05-05T20:51:46Z</updated>
<author>
<name>Jacopo Mondi</name>
</author>
<published>2018-04-18T09:42:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b9826a4929bbd4dcb245429fd7434145c4fcdc9b'/>
<id>urn:sha1:b9826a4929bbd4dcb245429fd7434145c4fcdc9b</id>
<content type='text'>
With commit ce88313069c36eef80f21fd7 ("arch/sh: make the DMA mapping
operations observe dev-&gt;dma_pfn_offset") the generic DMA allocation
function on which the SH 'dma_alloc_coherent()' function relies on,
accesses the 'dma_pfn_offset' field of struct device.

Unfortunately the 'dma_generic_alloc_coherent()' function is called from
several places with a NULL struct device argument, halting the CPU
during the boot process.

This patch fixes the issue by protecting access to dev-&gt;dma_pfn_offset,
with a trivial check for validity. It also passes a valid 'struct device'
in the 'platform_resource_setup_memory()' function which is the main user
of 'dma_alloc_coherent()', and inserts a WARN_ON() check to remind to future
(and existing) bogus users of this function to provide a valid 'struct device'
whenever possible.

Fixes: ce88313069c36eef80f21fd7 ("arch/sh: make the DMA mapping operations observe dev-&gt;dma_pfn_offset")
Signed-off-by: Jacopo Mondi &lt;jacopo+renesas@jmondi.org&gt;
Reviewed-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Reviewed-by: Thomas Petazzoni &lt;thomas.petazzoni@bootlin.com&gt;
Signed-off-by: Rich Felker &lt;dalias@libc.org&gt;
</content>
</entry>
<entry>
<title>Merge branch 'akpm' (patches from Andrew)</title>
<updated>2018-04-14T15:50:50Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2018-04-14T15:50:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=18b7fd1c93e5204355ddbf2608a097d64df81b88'/>
<id>urn:sha1:18b7fd1c93e5204355ddbf2608a097d64df81b88</id>
<content type='text'>
Merge yet more updates from Andrew Morton:

 - various hotfixes

 - kexec_file updates and feature work

* emailed patches from Andrew Morton &lt;akpm@linux-foundation.org&gt;: (27 commits)
  kernel/kexec_file.c: move purgatories sha256 to common code
  kernel/kexec_file.c: allow archs to set purgatory load address
  kernel/kexec_file.c: remove mis-use of sh_offset field during purgatory load
  kernel/kexec_file.c: remove unneeded variables in kexec_purgatory_setup_sechdrs
  kernel/kexec_file.c: remove unneeded for-loop in kexec_purgatory_setup_sechdrs
  kernel/kexec_file.c: split up __kexec_load_puragory
  kernel/kexec_file.c: use read-only sections in arch_kexec_apply_relocations*
  kernel/kexec_file.c: search symbols in read-only kexec_purgatory
  kernel/kexec_file.c: make purgatory_info-&gt;ehdr const
  kernel/kexec_file.c: remove checks in kexec_purgatory_load
  include/linux/kexec.h: silence compile warnings
  kexec_file, x86: move re-factored code to generic side
  x86: kexec_file: clean up prepare_elf64_headers()
  x86: kexec_file: lift CRASH_MAX_RANGES limit on crash_mem buffer
  x86: kexec_file: remove X86_64 dependency from prepare_elf64_headers()
  x86: kexec_file: purge system-ram walking from prepare_elf64_headers()
  kexec_file,x86,powerpc: factor out kexec_file_ops functions
  kexec_file: make use of purgatory optional
  proc: revalidate misc dentries
  mm, slab: reschedule cache_reap() on the same CPU
  ...
</content>
</entry>
<entry>
<title>mm/gup.c: document return value</title>
<updated>2018-04-14T00:10:27Z</updated>
<author>
<name>Michael S. Tsirkin</name>
</author>
<published>2018-04-13T22:35:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d081107867b85cc7454b9d4f5aea47f65bcf06d1'/>
<id>urn:sha1:d081107867b85cc7454b9d4f5aea47f65bcf06d1</id>
<content type='text'>
__get_user_pages_fast handles errors differently from
get_user_pages_fast: the former always returns the number of pages
pinned, the later might return a negative error code.

Link: http://lkml.kernel.org/r/1522962072-182137-6-git-send-email-mst@redhat.com
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Reviewed-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Kirill A. Shutemov &lt;kirill.shutemov@linux.intel.com&gt;
Cc: Huang Ying &lt;ying.huang@intel.com&gt;
Cc: Jonathan Corbet &lt;corbet@lwn.net&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Thorsten Leemhuis &lt;regressions@leemhuis.info&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'sh-for-4.17' of git://git.libc.org/linux-sh</title>
<updated>2018-04-13T19:27:11Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2018-04-13T19:27:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1bad9ce155a7c010a9a5f3261ad12a6a8eccfb2c'/>
<id>urn:sha1:1bad9ce155a7c010a9a5f3261ad12a6a8eccfb2c</id>
<content type='text'>
Pull arch/sh updates from Rich Felker:
 "Fixes for bugs in futex, device tree, and userspace breakpoint traps,
  and for PCI issues on SH7786"

* tag 'sh-for-4.17' of git://git.libc.org/linux-sh:
  arch/sh: pcie-sh7786: handle non-zero DMA offset
  arch/sh: pcie-sh7786: adjust the memory mapping
  arch/sh: pcie-sh7786: adjust PCI MEM and IO regions
  arch/sh: pcie-sh7786: exclude unusable PCI MEM areas
  arch/sh: pcie-sh7786: mark unavailable PCI resource as disabled
  arch/sh: pci: don't use disabled resources
  arch/sh: make the DMA mapping operations observe dev-&gt;dma_pfn_offset
  arch/sh: add sh7786_mm_sel() function
  sh: fix debug trap failure to process signals before return to user
  sh: fix memory corruption of unflattened device tree
  sh: fix futex FUTEX_OP_SET op on userspace addresses
</content>
</entry>
<entry>
<title>arch/sh: make the DMA mapping operations observe dev-&gt;dma_pfn_offset</title>
<updated>2018-04-12T23:47:53Z</updated>
<author>
<name>Thomas Petazzoni</name>
</author>
<published>2017-12-04T15:09:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ce88313069c36eef80f21fd7403f16620ecd21a2'/>
<id>urn:sha1:ce88313069c36eef80f21fd7403f16620ecd21a2</id>
<content type='text'>
Some devices may have a non-zero DMA offset, i.e an offset between the
DMA address and the physical address. Such an offset can be encoded
into the dma_pfn_offset field of "struct device", but the SuperH
implementation of the DMA mapping API does not observe this
information.

This commit fixes that by ensuring the DMA address is properly
calculated depending on this DMA offset.

Signed-off-by: Thomas Petazzoni &lt;thomas.petazzoni@free-electrons.com&gt;
Signed-off-by: Rich Felker &lt;dalias@libc.org&gt;
</content>
</entry>
<entry>
<title>mm: fix races between swapoff and flush dcache</title>
<updated>2018-04-06T04:36:26Z</updated>
<author>
<name>Huang Ying</name>
</author>
<published>2018-04-05T23:24:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=cb9f753a3731f7fe16447bea45cb6f8e8bb432fb'/>
<id>urn:sha1:cb9f753a3731f7fe16447bea45cb6f8e8bb432fb</id>
<content type='text'>
Thanks to commit 4b3ef9daa4fc ("mm/swap: split swap cache into 64MB
trunks"), after swapoff the address_space associated with the swap
device will be freed.  So page_mapping() users which may touch the
address_space need some kind of mechanism to prevent the address_space
from being freed during accessing.

The dcache flushing functions (flush_dcache_page(), etc) in architecture
specific code may access the address_space of swap device for anonymous
pages in swap cache via page_mapping() function.  But in some cases
there are no mechanisms to prevent the swap device from being swapoff,
for example,

  CPU1					CPU2
  __get_user_pages()			swapoff()
    flush_dcache_page()
      mapping = page_mapping()
        ...				  exit_swap_address_space()
        ...				    kvfree(spaces)
        mapping_mapped(mapping)

The address space may be accessed after being freed.

But from cachetlb.txt and Russell King, flush_dcache_page() only care
about file cache pages, for anonymous pages, flush_anon_page() should be
used.  The implementation of flush_dcache_page() in all architectures
follows this too.  They will check whether page_mapping() is NULL and
whether mapping_mapped() is true to determine whether to flush the
dcache immediately.  And they will use interval tree (mapping-&gt;i_mmap)
to find all user space mappings.  While mapping_mapped() and
mapping-&gt;i_mmap isn't used by anonymous pages in swap cache at all.

So, to fix the race between swapoff and flush dcache, __page_mapping()
is add to return the address_space for file cache pages and NULL
otherwise.  All page_mapping() invoking in flush dcache functions are
replaced with page_mapping_file().

[akpm@linux-foundation.org: simplify page_mapping_file(), per Mike]
Link: http://lkml.kernel.org/r/20180305083634.15174-1-ying.huang@intel.com
Signed-off-by: "Huang, Ying" &lt;ying.huang@intel.com&gt;
Reviewed-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Minchan Kim &lt;minchan@kernel.org&gt;
Cc: Michal Hocko &lt;mhocko@suse.com&gt;
Cc: Johannes Weiner &lt;hannes@cmpxchg.org&gt;
Cc: Mel Gorman &lt;mgorman@techsingularity.net&gt;
Cc: Dave Hansen &lt;dave.hansen@intel.com&gt;
Cc: Chen Liqin &lt;liqin.linux@gmail.com&gt;
Cc: Russell King &lt;linux@armlinux.org.uk&gt;
Cc: Yoshinori Sato &lt;ysato@users.sourceforge.jp&gt;
Cc: "James E.J. Bottomley" &lt;jejb@parisc-linux.org&gt;
Cc: Guan Xuetao &lt;gxt@mprc.pku.edu.cn&gt;
Cc: "David S. Miller" &lt;davem@davemloft.net&gt;
Cc: Chris Zankel &lt;chris@zankel.net&gt;
Cc: Vineet Gupta &lt;vgupta@synopsys.com&gt;
Cc: Ley Foon Tan &lt;lftan@altera.com&gt;
Cc: Ralf Baechle &lt;ralf@linux-mips.org&gt;
Cc: Andi Kleen &lt;ak@linux.intel.com&gt;
Cc: Mike Rapoport &lt;rppt@linux.vnet.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>mm: pass the vmem_altmap to arch_remove_memory and __remove_pages</title>
<updated>2018-01-08T19:46:23Z</updated>
<author>
<name>Christoph Hellwig</name>
</author>
<published>2017-12-29T07:53:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=da024512a1fa5c979257e442130ee1d468285057'/>
<id>urn:sha1:da024512a1fa5c979257e442130ee1d468285057</id>
<content type='text'>
We can just pass this on instead of having to do a radix tree lookup
without proper locking 2 levels into the callchain.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
</content>
</entry>
<entry>
<title>mm: pass the vmem_altmap to arch_add_memory and __add_pages</title>
<updated>2018-01-08T19:46:23Z</updated>
<author>
<name>Christoph Hellwig</name>
</author>
<published>2017-12-29T07:53:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=24e6d5a59ac7d31adc0322de2d0117dfa370936f'/>
<id>urn:sha1:24e6d5a59ac7d31adc0322de2d0117dfa370936f</id>
<content type='text'>
We can just pass this on instead of having to do a radix tree lookup
without proper locking 2 levels into the callchain.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
</content>
</entry>
<entry>
<title>mm: don't export arch_add_memory</title>
<updated>2018-01-08T19:46:23Z</updated>
<author>
<name>Christoph Hellwig</name>
</author>
<published>2017-12-29T07:53:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4dfeeaad630f6261f30314faab46cc2f512450d3'/>
<id>urn:sha1:4dfeeaad630f6261f30314faab46cc2f512450d3</id>
<content type='text'>
Only x86_64 and sh export this symbol, and it is not used by any
modular code.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
</content>
</entry>
</feed>
