<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/mips/include/asm/page.h, branch linux-5.1.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.1.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.1.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2018-11-05T18:15:28Z</updated>
<entry>
<title>MIPS: Enable IOREMAP_PROT config option for MIPS cpus</title>
<updated>2018-11-05T18:15:28Z</updated>
<author>
<name>Hassan Naveed</name>
</author>
<published>2018-10-30T01:27:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b3a428b4b18d495a06f39515568850f8db4c98ea'/>
<id>urn:sha1:b3a428b4b18d495a06f39515568850f8db4c98ea</id>
<content type='text'>
Allows the users of ptrace to access memory mapped by the ptraced process
using the same cache coherency attributes as the original process.
For example while using gdb with ioremap_prot() incorporated, both gdb and
the process being traced will have same cache coherency attributes.

Signed-off-by: Hassan Naveed &lt;hnaveed@wavecomp.com&gt;
Signed-off-by: Paul Burton &lt;paul.burton@mips.com&gt;
Patchwork: https://patchwork.linux-mips.org/patch/20955/
Cc: &lt;linux-mips@linux-mips.org&gt;
</content>
</entry>
<entry>
<title>MIPS: Allow auto-dection of ARCH_PFN_OFFSET &amp; PHYS_OFFSET</title>
<updated>2018-07-30T17:27:32Z</updated>
<author>
<name>Paul Burton</name>
</author>
<published>2018-07-28T01:23:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6c359eb1dcdb721908f4336171ed8eb6d78190c5'/>
<id>urn:sha1:6c359eb1dcdb721908f4336171ed8eb6d78190c5</id>
<content type='text'>
On systems where physical memory begins at a non-zero address, defining
PHYS_OFFSET (which influences ARCH_PFN_OFFSET) can save us time &amp; memory
by avoiding book-keeping for pages from address zero to the start of
memory.

Some MIPS platforms already make use of this, but with the definition of
PHYS_OFFSET being compile-time constant it hasn't been possible to
enable this optimization for a kernel which may run on systems with
varying physical memory base addresses.

Introduce a new Kconfig option CONFIG_MIPS_AUTO_PFN_OFFSET which, when
enabled, makes ARCH_PFN_OFFSET a variable &amp; detects it from the boot
memory map (which for example may have been populated from DT). The
relationship with PHYS_OFFSET is reversed, with PHYS_OFFSET now being
based on ARCH_PFN_OFFSET. This is because ARCH_PFN_OFFSET is used far
more often, so avoiding the need for runtime calculation gives us a
smaller impact on kernel text size (0.1% rather than 0.15% for
64r6el_defconfig).

Signed-off-by: Paul Burton &lt;paul.burton@mips.com&gt;
Suggested-by: Vladimir Kondratiev &lt;vladimir.kondratiev@intel.com&gt;
Patchwork: https://patchwork.linux-mips.org/patch/20048/
Cc: James Hogan &lt;jhogan@kernel.org&gt;
Cc: Ralf Baechle &lt;ralf@linux-mips.org&gt;
Cc: linux-mips@linux-mips.org
</content>
</entry>
<entry>
<title>MIPS: Make (UN)CAC_ADDR() PHYS_OFFSET-agnostic</title>
<updated>2018-07-30T17:27:20Z</updated>
<author>
<name>Paul Burton</name>
</author>
<published>2018-07-28T01:23:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0d0e14770d4487a7ede8df93d82305cbfac2d453'/>
<id>urn:sha1:0d0e14770d4487a7ede8df93d82305cbfac2d453</id>
<content type='text'>
Converting an address between cached &amp; uncached (typically addresses in
(c)kseg0 &amp; (c)kseg1 or 2 xkphys regions) should not depend upon
PHYS_OFFSET in any way - we're converting from a virtual address in one
unmapped region to a virtual address in another unmapped region.

For some reason our CAC_ADDR() &amp; UNCAC_ADDR() macros make use of
PAGE_OFFSET, which typically includes PHYS_OFFSET. This means that
platforms with a non-zero PHYS_OFFSET typically have to workaround
miscalculation by these 2 macros by also defining UNCAC_BASE to a value
that isn't really correct.

It appears that an attempt has previously been made to address this with
commit 3f4579252aa1 ("MIPS: make CAC_ADDR and UNCAC_ADDR account for
PHYS_OFFSET") which was later undone by commit ed3ce16c3d2b ("Revert
"MIPS: make CAC_ADDR and UNCAC_ADDR account for PHYS_OFFSET"") which
also introduced the ar7 workaround. That attempt at a fix was roughly
equivalent, but essentially caused the CAC_ADDR() &amp; UNCAC_ADDR() macros
to cancel out PHYS_OFFSET by adding &amp; then subtracting it again. In his
revert Leonid is correct that using PHYS_OFFSET makes no sense in the
context of these macros, but appears to have missed its inclusion via
PAGE_OFFSET which means PHYS_OFFSET actually had an effect after the
revert rather than before it.

Here we fix this by modifying CAC_ADDR() &amp; UNCAC_ADDR() to stop using
PAGE_OFFSET (&amp; thus PHYS_OFFSET), instead using __pa() &amp; __va() along
with UNCAC_BASE.

For UNCAC_ADDR(), __pa() will convert a cached address to a physical
address which we can simply use as an offset from UNCAC_BASE to obtain
an address in the uncached region.

For CAC_ADDR() we can undo the effect of UNCAC_ADDR() by subtracting
UNCAC_BASE and using __va() on the result.

With this change made, remove definitions of UNCAC_BASE from the ar7 &amp;
pic32 platforms which appear to have defined them only to workaround
this problem.

Signed-off-by: Paul Burton &lt;paul.burton@mips.com&gt;
References: 3f4579252aa1 ("MIPS: make CAC_ADDR and UNCAC_ADDR account for PHYS_OFFSET")
References: ed3ce16c3d2b ("Revert "MIPS: make CAC_ADDR and UNCAC_ADDR account for PHYS_OFFSET"")
Patchwork: https://patchwork.linux-mips.org/patch/20046/
Cc: Florian Fainelli &lt;f.fainelli@gmail.com&gt;
Cc: James Hogan &lt;jhogan@kernel.org&gt;
Cc: Ralf Baechle &lt;ralf@linux-mips.org&gt;
Cc: linux-mips@linux-mips.org
Cc: Vladimir Kondratiev &lt;vladimir.kondratiev@intel.com&gt;
</content>
</entry>
<entry>
<title>MIPS: page.h: Define virt_to_pfn()</title>
<updated>2017-11-09T13:25:44Z</updated>
<author>
<name>Florian Fainelli</name>
</author>
<published>2017-03-09T21:11:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=37d15948eb72533757ff352cf6f92dc64daa291f'/>
<id>urn:sha1:37d15948eb72533757ff352cf6f92dc64daa291f</id>
<content type='text'>
Define virt_to_pfn() based on the existing definition of virt_to_page()
which already does a PFN_DOWN(vir_to_phys(kaddr)).

Signed-off-by: Florian Fainelli &lt;f.fainelli@gmail.com&gt;
Cc: Ralf Baechle &lt;ralf@linux-mips.org&gt;
Cc: Paul Burton &lt;paul.burton@mips.com&gt;
Cc: Maciej W. Rozycki &lt;macro@linux-mips.org&gt;
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/15409/
Signed-off-by: James Hogan &lt;jhogan@kernel.org&gt;
</content>
</entry>
<entry>
<title>treewide: replace config_enabled() with IS_ENABLED() (2nd round)</title>
<updated>2016-08-27T00:39:35Z</updated>
<author>
<name>Masahiro Yamada</name>
</author>
<published>2016-08-25T22:17:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a5ff1b34e16c203397542d98c49c5c7783193946'/>
<id>urn:sha1:a5ff1b34e16c203397542d98c49c5c7783193946</id>
<content type='text'>
Commit 97f2645f358b ("tree-wide: replace config_enabled() with
IS_ENABLED()") mostly killed config_enabled(), but some new users have
appeared for v4.8-rc1.  They are all used for a boolean option, so can
be replaced with IS_ENABLED() safely.

Link: http://lkml.kernel.org/r/1471970749-24867-1-git-send-email-yamada.masahiro@socionext.com
Signed-off-by: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
Acked-by: Kees Cook &lt;keescook@chromium.org&gt;
Acked-by: Peter Oberparleiter &lt;oberpar@linux.vnet.ibm.com&gt;
Cc: Martin Schwidefsky &lt;schwidefsky@de.ibm.com&gt;
Cc: Heiko Carstens &lt;heiko.carstens@de.ibm.com&gt;
Cc: Ralf Baechle &lt;ralf@linux-mips.org&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: "H. Peter Anvin" &lt;hpa@zytor.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&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>MIPS: Use CPHYSADDR to implement mips32 __pa</title>
<updated>2016-08-02T12:01:02Z</updated>
<author>
<name>Paul Burton</name>
</author>
<published>2016-08-02T10:40:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0d8d83d0447deb526c3125250eb391b5d76a3472'/>
<id>urn:sha1:0d8d83d0447deb526c3125250eb391b5d76a3472</id>
<content type='text'>
Use CPHYSADDR to implement the __pa macro converting from a virtual to a
physical address for MIPS32, much as is already done for MIPS64 (though
without the complication of having both compatibility &amp; XKPHYS
segments).

This allows for __pa to work regardless of whether the address being
translated is in kseg0 or kseg1, unlike the previous subtraction based
approach which only worked for addresses in kseg0. Working for kseg1
addresses is important if __pa is used on addresses allocated by
dma_alloc_coherent, where on systems with non-coherent I/O we provide
addresses in kseg1. If this address is then used with
dma_map_single_attrs then it is provided to virt_to_page, which in turn
calls virt_to_phys which is a wrapper around __pa. The result is that we
end up with a physical address 0x20000000 bytes (ie. the size of kseg0)
too high.

In addition to providing consistency with MIPS64 &amp; fixing the kseg1 case
above this has the added bonus of generating smaller code for systems
implementing MIPS32r2 &amp; beyond, where a single ext instruction can
extract the physical address rather than needing to load an immediate
into a temp register &amp; subtract it. This results in ~1.3KB savings for a
boston_defconfig kernel adjusted to set CONFIG_32BIT=y.

This patch does not change the EVA case, which may or may not have
similar issues around handling both cached &amp; uncached addresses but is
beyond the scope of this patch.

Signed-off-by: Paul Burton &lt;paul.burton@imgtec.com&gt;
Cc: Dan Williams &lt;dan.j.williams@intel.com&gt;
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/13836/
Signed-off-by: Ralf Baechle &lt;ralf@linux-mips.org&gt;
</content>
</entry>
<entry>
<title>MIPS: non-exec stack &amp; heap when non-exec PT_GNU_STACK is present</title>
<updated>2016-08-02T07:29:27Z</updated>
<author>
<name>Paul Burton</name>
</author>
<published>2016-07-08T10:06:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1a770b85c1f1c1ee37afd7cef5237ffc4c970f04'/>
<id>urn:sha1:1a770b85c1f1c1ee37afd7cef5237ffc4c970f04</id>
<content type='text'>
The stack and heap have both been executable by default on MIPS until
now. This patch changes the default to be non-executable, but only for
ELF binaries with a non-executable PT_GNU_STACK header present. This
does apply to both the heap &amp; the stack, despite the name PT_GNU_STACK,
and this matches the behaviour of other architectures like ARM &amp; x86.

Current MIPS toolchains do not produce the PT_GNU_STACK header, which
means that we can rely upon this patch not changing the behaviour of
existing binaries. The new default will only take effect for newly
compiled binaries once toolchains are updated to support PT_GNU_STACK,
and since those binaries are newly compiled they can be compiled
expecting the change in default behaviour. Again this matches the way in
which the ARM &amp; x86 architectures handled their implementations of
non-executable memory.

Signed-off-by: Paul Burton &lt;paul.burton@imgtec.com&gt;
Cc: Leonid Yegoshin &lt;leonid.yegoshin@imgtec.com&gt;
Cc: Maciej Rozycki &lt;maciej.rozycki@imgtec.com&gt;
Cc: Faraz Shahbazker &lt;faraz.shahbazker@imgtec.com&gt;
Cc: Raghu Gandham &lt;raghu.gandham@imgtec.com&gt;
Cc: Matthew Fortune &lt;matthew.fortune@imgtec.com&gt;
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/13765/
Signed-off-by: Ralf Baechle &lt;ralf@linux-mips.org&gt;
</content>
</entry>
<entry>
<title>Revert "MIPS: Fix PAGE_MASK definition"</title>
<updated>2016-01-22T23:28:57Z</updated>
<author>
<name>Dan Williams</name>
</author>
<published>2016-01-22T17:20:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=800dc4f49cc002879e1e5e6b79926f86b60528e6'/>
<id>urn:sha1:800dc4f49cc002879e1e5e6b79926f86b60528e6</id>
<content type='text'>
This reverts commit 22b14523994588279ae9c5ccfe64073c1e5b3c00.

It was originally sent in an earlier revision of the pfn_t patchset.
Besides being broken, the warning is also fixed by PFN_FLAGS_MASK
casting the PAGE_MASK to an unsigned long.

Reported-by: Manuel Lauss &lt;manuel.lauss@gmail.com&gt;
Signed-off-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
Cc: linux-kernel@vger.kernel.org
Cc: Linux-MIPS &lt;linux-mips@linux-mips.org&gt;
Cc: stable@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/12182/
Signed-off-by: Ralf Baechle &lt;ralf@linux-mips.org&gt;
</content>
</entry>
<entry>
<title>MIPS: Fix flood of warnings about comparsion being always true.</title>
<updated>2015-11-16T11:07:10Z</updated>
<author>
<name>Ralf Baechle</name>
</author>
<published>2015-11-16T11:07:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=95486e4979e56e7da2fbb4fd32eb54d672b1e074'/>
<id>urn:sha1:95486e4979e56e7da2fbb4fd32eb54d672b1e074</id>
<content type='text'>
./arch/mips/include/asm/page.h:204:13: warning: comparison of unsigned expression &amp;gt;= 0 is always true [-Wtype-limits]

The default value of ARCH_PFN_OFFSET is 0 thus triggering this warning
for all platforms using the default value.

Signed-off-by: Ralf Baechle &lt;ralf@linux-mips.org&gt;
</content>
</entry>
<entry>
<title>MIPS: Fix PAGE_MASK definition</title>
<updated>2015-11-12T10:35:47Z</updated>
<author>
<name>Dan Williams</name>
</author>
<published>2015-10-10T00:56:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=22b14523994588279ae9c5ccfe64073c1e5b3c00'/>
<id>urn:sha1:22b14523994588279ae9c5ccfe64073c1e5b3c00</id>
<content type='text'>
Make PAGE_MASK an unsigned long, like it is on x86, to avoid:

In file included from arch/mips/kernel/asm-offsets.c:14:0:
include/linux/mm.h: In function '__pfn_to_pfn_t':
include/linux/mm.h:1050:2: warning: left shift count &gt;= width of type
  pfn_t pfn_t = { .val = pfn | (flags &amp; PFN_FLAGS_MASK), };

...where PFN_FLAGS_MASK is:

#define PFN_FLAGS_MASK (~PAGE_MASK &lt;&lt; (BITS_PER_LONG - PAGE_SHIFT))

Signed-off-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
Cc: ross.zwisler@linux.intel.com
Cc: hch@lst.de
Cc: linux-mips@linux-mips.org
Cc: linux-nvdimm@lists.01.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-mm@kvack.org
Patchwork: https://patchwork.linux-mips.org/patch/11280/
Signed-off-by: Ralf Baechle &lt;ralf@linux-mips.org&gt;
</content>
</entry>
</feed>
