<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/arch/arc, branch v3.10.13</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/arch/arc?h=v3.10.13</id>
<link rel='self' href='https://git.amat.us/linux/atom/arch/arc?h=v3.10.13'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2013-08-29T16:47:34Z</updated>
<entry>
<title>ARC: [lib] strchr breakage in Big-endian configuration</title>
<updated>2013-08-29T16:47:34Z</updated>
<author>
<name>Joern Rennecke</name>
<email>joern.rennecke@embecosm.com</email>
</author>
<published>2013-08-24T06:33:06Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=0cbf39727e08f58246e763f8af2f8dcb8a9f648f'/>
<id>urn:sha1:0cbf39727e08f58246e763f8af2f8dcb8a9f648f</id>
<content type='text'>
commit b0f55f2a1a295c364be012e82dbab079a2454006 upstream.

For a search buffer, 2 byte aligned, strchr() was returning pointer
outside of buffer (buf - 1)

-------------&gt;8----------------
    // Input buffer (default 4 byte aigned)
    char *buffer = "1AA_";

    // actual search start (to mimick 2 byte alignment)
    char *current_line = &amp;(buffer[2]);

    // Character to search for
    char c = 'A';

    char *c_pos = strchr(current_line, c);

    printf("%s\n", c_pos) --&gt; 'AA_' as oppose to 'A_'
-------------&gt;8----------------

Reported-by: Anton Kolesov &lt;Anton.Kolesov@synopsys.com&gt;
Debugged-by: Anton Kolesov &lt;Anton.Kolesov@synopsys.com&gt;
Cc: Noam Camus &lt;noamc@ezchip.com&gt;
Signed-off-by: Joern Rennecke  &lt;joern.rennecke@embecosm.com&gt;
Signed-off-by: Vineet Gupta &lt;vgupta@synopsys.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>ARC: gdbserver breakage in Big-Endian configuration #2</title>
<updated>2013-08-29T16:47:29Z</updated>
<author>
<name>Vineet Gupta</name>
<email>Vineet.Gupta1@synopsys.com</email>
</author>
<published>2013-08-20T08:08:11Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=16a06df257641d466895454f0320b8ccb1583b21'/>
<id>urn:sha1:16a06df257641d466895454f0320b8ccb1583b21</id>
<content type='text'>
[Based on mainline commit 352c1d95e3220d0: "ARC: stop using
pt_regs-&gt;orig_r8"]

Stop using orig_r8 as it could get clobbered by ST in trap_with_param,
and further it is semantically not needed either.

Signed-off-by: Vineet Gupta &lt;vgupta@synopsys.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>ARC: gdbserver breakage in Big-Endian configuration #1</title>
<updated>2013-08-29T16:47:29Z</updated>
<author>
<name>Vineet Gupta</name>
<email>Vineet.Gupta1@synopsys.com</email>
</author>
<published>2013-08-20T08:08:10Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=9b2c750d8e81da33cdf6e16db911faa2008652cd'/>
<id>urn:sha1:9b2c750d8e81da33cdf6e16db911faa2008652cd</id>
<content type='text'>
[Based on mainline commit 502a0c775c7f0a: "ARC: pt_regs update #5"]

gdbserver needs @stop_pc, served by ptrace, but fetched from pt_regs
differently, based on in_brkpt_traps(), which in turn relies on
additional machine state in pt_regs-&gt;event bitfield.

        unsigned long orig_r8:16, event:16;

For big endian config, this macro was returning false, despite being in
breakpoint Trap exception, causing wrong @stop_pc to be returned to gdb.

Issue #1: In BE, @event above is at offset 2 in word, while a STW insn
          at offset 0 was used to update it. Resort to using ST insn
	  which updates the half-word at right location.

Issue #2: The union involving bitfields causes all the members to be
	  laid out at offset 0. So with fix #1 above, ASM was now
	  updating at offset 2, "C" code was still referencing at
	  offset 0. Fixed by wrapping bitfield in a struct.

Reported-by: Noam Camus &lt;noamc@ezchip.com&gt;
Tested-by: Anton Kolesov &lt;akolesov@synopsys.com&gt;
Signed-off-by: Vineet Gupta &lt;vgupta@synopsys.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>ARC: lazy dcache flush broke gdb in non-aliasing configs</title>
<updated>2013-05-25T08:45:55Z</updated>
<author>
<name>Vineet Gupta</name>
<email>vgupta@synopsys.com</email>
</author>
<published>2013-05-25T08:34:25Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=7bb66f6e6eecdd8e10ed3a63bd28c1e9105adc79'/>
<id>urn:sha1:7bb66f6e6eecdd8e10ed3a63bd28c1e9105adc79</id>
<content type='text'>
gdbserver inserting a breakpoint ends up calling copy_user_page() for a
code page. The generic version of which (non-aliasing config) didn't set
the PG_arch_1 bit hence update_mmu_cache() didn't sync dcache/icache for
corresponding dynamic loader code page - causing garbade to be executed.

So now aliasing versions of copy_user_highpage()/clear_page() are made
default. There is no significant overhead since all of special alias
handling code is compiled out for non-aliasing build

Signed-off-by: Vineet Gupta &lt;vgupta@synopsys.com&gt;
</content>
</entry>
<entry>
<title>ARC: Use enough bits for determining page's cache color</title>
<updated>2013-05-23T08:55:09Z</updated>
<author>
<name>Vineet Gupta</name>
<email>vgupta@synopsys.com</email>
</author>
<published>2013-05-19T08:36:44Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=006dfb3c9c44192f06093d65b3a876fa5ad1319a'/>
<id>urn:sha1:006dfb3c9c44192f06093d65b3a876fa5ad1319a</id>
<content type='text'>
The current code uses 2 bits for determining page's dcache color, thus
sorting pages into 4 bins, whereas the aliasing dcache really has 2 bins
(8k page, 64k dcache - 4 way-set-assoc).
This can cause extraneous flushes - e.g. color 0 and 2.

Signed-off-by: Vineet Gupta &lt;vgupta@synopsys.com&gt;
</content>
</entry>
<entry>
<title>ARC: Brown paper bag bug in macro for checking cache color</title>
<updated>2013-05-23T08:54:52Z</updated>
<author>
<name>Vineet Gupta</name>
<email>vgupta@synopsys.com</email>
</author>
<published>2013-05-22T13:08:10Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=3e87974dec5ec25a8a4852d9292db6be659164e6'/>
<id>urn:sha1:3e87974dec5ec25a8a4852d9292db6be659164e6</id>
<content type='text'>
The VM_EXEC check in update_mmu_cache() was getting optimized away
because of a stupid error in definition of macro addr_not_cache_congruent()

The intention was to have the equivalent of following:

	if (a || (1 ? b : 0))

but we ended up with following:

	if (a || 1 ? b : 0)

And because precedence of '||' is more that that of '?', gcc was optimizing
away evaluation of &lt;a&gt;

Nasty Repercussions:
1. For non-aliasing configs it would mean some extraneous dcache flushes
   for non-code pages if U/K mappings were not congruent.
2. For aliasing config, some needed dcache flush for code pages might
   be missed if U/K mappings were congruent.

Signed-off-by: Vineet Gupta &lt;vgupta@synopsys.com&gt;
</content>
</entry>
<entry>
<title>ARC: copy_(to|from)_user() to honor usermode-access permissions</title>
<updated>2013-05-23T05:03:03Z</updated>
<author>
<name>Vineet Gupta</name>
<email>vgupta@synopsys.com</email>
</author>
<published>2013-05-21T09:55:11Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=a950549c675f2c8c504469dec7d780da8a6433dc'/>
<id>urn:sha1:a950549c675f2c8c504469dec7d780da8a6433dc</id>
<content type='text'>
This manifested as grep failing psuedo-randomly:

--------------&gt;8---------------------
[ARCLinux]$ ip address show lo | grep inet
[ARCLinux]$ ip address show lo | grep inet
[ARCLinux]$ ip address show lo | grep inet
[ARCLinux]$
[ARCLinux]$ ip address show lo | grep inet
    inet 127.0.0.1/8 scope host lo
--------------&gt;8---------------------

ARC700 MMU provides fully orthogonal permission bits per page:
Ur, Uw, Ux, Kr, Kw, Kx

The user mode page permission templates used to have all Kernel mode
access bits enabled.
This caused a tricky race condition observed with uClibc buffered file
read and UNIX pipes.

1. Read access to an anon mapped page in libc .bss: write-protected
   zero_page mapped: TLB Entry installed with Ur + K[rwx]

2. grep calls libc:getc() -&gt; buffered read layer calls read(2) with the
   internal read buffer in same .bss page.
   The read() call is on STDIN which has been redirected to a pipe.
   read(2) =&gt; sys_read() =&gt; pipe_read() =&gt; copy_to_user()

3. Since page has Kernel-write permission (despite being user-mode
   write-protected), copy_to_user() suceeds w/o taking a MMU TLB-Miss
   Exception (page-fault for ARC). core-MM is unaware that kernel
   erroneously wrote to the reserved read-only zero-page (BUG #1)

4. Control returns to userspace which now does a write to same .bss page
   Since Linux MM is not aware that page has been modified by kernel, it
   simply reassigns a new writable zero-init page to mapping, loosing the
   prior write by kernel - effectively zero'ing out the libc read buffer
   under the hood - hence grep doesn't see right data (BUG #2)

The fix is to make all kernel-mode access permissions mirror the
user-mode ones. Note that the kernel still has full access to pages,
when accessed directly (w/o MMU) - this fix ensures that kernel-mode
access in copy_to_from() path uses the same faulting access model as for
pure user accesses to keep MM fully aware of page state.

The issue is peudo-random because it only shows up if the TLB entry
installed in #1 is present at the time of #3. If it is evicted out, due
to TLB pressure or some-such, then copy_to_user() does take a TLB Miss
Exception, with a routine write-to-anon COW processing installing a
fresh page for kernel writes and also usable as it is in userspace.

Further the issue was dormant for so long as it depends on where the
libc internal read buffer (in .bss) is mapped at runtime.
If it happens to reside in file-backed data mapping of libc (in the
page-aligned slack space trailing the file backed data), loader zero
padding the slack space, does the early cow page replacement, setting
things up at the very beginning itself.

With gcc 4.8 based builds, the libc buffer got pushed out to a real
anon mapping which triggers the issue.

Reported-by: Anton Kolesov &lt;akolesov@synopsys.com&gt;
Cc: &lt;stable@vger.kernel.org&gt; # 3.9
Signed-off-by: Vineet Gupta &lt;vgupta@synopsys.com&gt;
</content>
</entry>
<entry>
<title>ARC: [mm] Prevent stray dcache lines after__sync_icache_dcach()</title>
<updated>2013-05-23T04:56:33Z</updated>
<author>
<name>Vineet Gupta</name>
<email>vgupta@synopsys.com</email>
</author>
<published>2013-05-16T06:49:29Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=f538881cc672c1b049aa0a34a792d0953fcecba5'/>
<id>urn:sha1:f538881cc672c1b049aa0a34a792d0953fcecba5</id>
<content type='text'>
Flush and INVALIDATE the dcache page.

This helper is only used for writeback of CODE pages to memory. So
there's no value in keeping the dcache lines around. Infact it is risky
as a writeback on natural eviction under pressure can cause un-needed
writeback with weird issues on aliasing dcache configurations.

Signed-off-by: Vineet Gupta &lt;vgupta@synopsys.com&gt;
</content>
</entry>
<entry>
<title>ARC: [TB10x] Remove redundant abilis,simple-pinctrl mechanism</title>
<updated>2013-05-15T04:42:03Z</updated>
<author>
<name>Christian Ruppert</name>
<email>christian.ruppert@abilis.com</email>
</author>
<published>2013-05-10T14:05:50Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=7d19273cd0408f8520539d5d6b1f695cd311b109'/>
<id>urn:sha1:7d19273cd0408f8520539d5d6b1f695cd311b109</id>
<content type='text'>
The TB10x platform port includes a custom mechanism using to set up
default pin controller configurations using abilis,simple-default
pin configurations of nodes compatible with abilis,simple-pinctrl. This
mechanism is redundant with the Linux standard "default" pin
configuration, see commit ab78029ecc347debbd737f06688d788bd9d60c1d
"drivers/pinctrl: grab default handles from device core".
This patch removes the TB10x custom mechanism in favour of the Linux
standard.

Signed-off-by: Christian Ruppert &lt;christian.ruppert@abilis.com&gt;
Reviewed-by: Stephen Warren &lt;swarren@nvidia.com&gt;
Reviewed-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Signed-off-by: Vineet Gupta &lt;vgupta@synopsys.com&gt;
</content>
</entry>
<entry>
<title>Merge tag 'arc-v3.10-rc1-part2' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc</title>
<updated>2013-05-10T14:24:14Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2013-05-10T14:24:14Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=6019958d146a4f127dae727a930f902c92531e6e'/>
<id>urn:sha1:6019958d146a4f127dae727a930f902c92531e6e</id>
<content type='text'>
Pull second set of arc arch updates from Vineet Gupta:
 "Aliasing VIPT dcache support for ARC

  I'm satisified with testing, specially with fuse which has
  historically given grief to VIPT arches (ARM/PARISC...)"

* tag 'arc-v3.10-rc1-part2' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc:
  ARC: [TB10x] Remove GENERIC_GPIO
  ARC: [mm] Aliasing VIPT dcache support 4/4
  ARC: [mm] Aliasing VIPT dcache support 3/4
  ARC: [mm] Aliasing VIPT dcache support 2/4
  ARC: [mm] Aliasing VIPT dcache support 1/4
  ARC: [mm] refactor the core (i|d)cache line ops loops
  ARC: [mm] serious bug in vaddr based icache flush
</content>
</entry>
</feed>
