<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/arch/arc, branch v3.9</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v3.9</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v3.9'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2013-04-08T23:10:26Z</updated>
<entry>
<title>ARC: Add implicit compiler barrier to raw_local_irq* functions</title>
<updated>2013-04-08T23:10:26Z</updated>
<author>
<name>Christian Ruppert</name>
<email>christian.ruppert@abilis.com</email>
</author>
<published>2013-04-08T07:35:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=79e5f05edcbf85825d19eb8a425cd6c36c6c66f1'/>
<id>urn:sha1:79e5f05edcbf85825d19eb8a425cd6c36c6c66f1</id>
<content type='text'>
ARC irqsave/restore macros were missing the compiler barrier, causing a
stale load in irq-enabled region be used in irq-safe region, despite
being changed, because the register holding the value was still live.

The problem manifested as random crashes in timer code when stress
testing ARCLinux (3.9-rc3) on a !SMP &amp;&amp; !PREEMPT_COUNT

Here's the exact sequence which caused this:
 (0). tv1[x] &lt;----&gt; t1 &lt;---&gt; t2
 (1). mod_timer(t1) interrupted after it calls timer_pending()
 (2). mod_timer(t2) completes
 (3). mod_timer(t1) resumes but messes up the list
 (4). __runt_timers( ) uses bogus timer_list entry / crashes in
      timer-&gt;function

Essentially mod_timer() was racing against itself and while the spinlock
serialized the tv1[] timer link list, timer_pending() called outside the
spinlock, cached timer link list element in a register.
With low register pressure (and a deep register file), lack of barrier
in raw_local_irqsave() as well as preempt_disable (!PREEMPT_COUNT
version), there was nothing to force gcc to reload across the spinlock,
causing a stale value in reg be used for link list manipulation - ensuing
a corruption.

ARcompact disassembly which shows the culprit generated code:

mod_timer:
    push_s blink
    mov_s r13,r0	# timer, timer
..
    ###### timer_pending( )
    ld_s r3,[r13]       # &lt;------ &lt;variable&gt;.entry.next LOADED
    brne r3, 0, @.L163

.L163:
..
    ###### spin_lock_irq( )
    lr  r5, [status32]  # flags
    bic r4, r5, 6       # temp, flags,
    and.f 0, r5, 6      # flags,
    flag.nz r4

    ###### detach_if_pending( ) begins

    tst_s r3,r3  &lt;--------------
			# timer_pending( ) checks timer-&gt;entry.next
                        # r3 is NOT reloaded by gcc, using stale value
    beq.d @.L169
    mov.eq r0,0

    #####  detach_timer( ): __list_del( )

    ld r4,[r13,4]    	# &lt;variable&gt;.entry.prev, D.31439
    st r4,[r3,4]     	# &lt;variable&gt;.prev, D.31439
    st r3,[r4]       	# &lt;variable&gt;.next, D.30246

We initially tried to fix this by adding barrier() to preempt_* macros
for !PREEMPT_COUNT but Linus clarified that it was anything but wrong.
http://www.spinics.net/lists/kernel/msg1512709.html

[vgupta: updated commitlog]

Reported-by/Signed-off-by: Christian Ruppert &lt;christian.ruppert@abilis.com&gt;
Cc: Christian Ruppert &lt;christian.ruppert@abilis.com&gt;
Cc: Pierrick Hascoet &lt;pierrick.hascoet@abilis.com&gt;
Debugged-by/Signed-off-by: Vineet Gupta &lt;vgupta@synopsys.com&gt;

Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>ARC: Fix the typo in event identifier flags used by ptrace</title>
<updated>2013-03-20T13:15:45Z</updated>
<author>
<name>Vineet Gupta</name>
<email>vgupta@synopsys.com</email>
</author>
<published>2013-03-20T11:23:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=367f3fcd9296977bc4689546f55c5f4a9c680e8d'/>
<id>urn:sha1:367f3fcd9296977bc4689546f55c5f4a9c680e8d</id>
<content type='text'>
orig_r8_IS_EXCPN and orig_r8_IS_BRKPT were same values due to a
copy/paste error. Although it looks bad and is wrong, it really doesn't
affect gdb working.

orig_r8_IS_BRKPT is the one relevant to debugging (breakpoints), since
it is used to provide EFA vs. ERET to a ptrace "stop_pc" request.

So when gdb has inserted a breakpoint, orig_r8_IS_BRKPT is already set,
and anything else (i.e. orig_r8_IS_EXCPN) becoming same as it, really
doesn't hurt gdb. The corollary case, could be nasty but nobody uses the
ptrace "stop_pc" request in that case

Signed-off-by: Vineet Gupta &lt;vgupta@synopsys.com&gt;
</content>
</entry>
<entry>
<title>arc: fix dma_address assignment during dma_map_sg()</title>
<updated>2013-03-19T10:04:53Z</updated>
<author>
<name>Pierrick Hascoet</name>
<email>pierrick.hascoet@abilis.com</email>
</author>
<published>2013-03-18T16:04:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2105fd550ca7dbdd490934f487852c2a399b20cf'/>
<id>urn:sha1:2105fd550ca7dbdd490934f487852c2a399b20cf</id>
<content type='text'>
Signed-off-by: Pierrick Hascoet &lt;pierrick.hascoet@abilis.com&gt;
Signed-off-by: Vineet Gupta &lt;vgupta@synopsys.com&gt;
</content>
</entry>
<entry>
<title>ARC: Remove SET_PERSONALITY (tracks cross-arch change)</title>
<updated>2013-03-18T09:07:05Z</updated>
<author>
<name>Vineet Gupta</name>
<email>vgupta@synopsys.com</email>
</author>
<published>2013-03-02T07:01:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a37b2dc52b88ccd926099d852eae1bb324bc92eb'/>
<id>urn:sha1:a37b2dc52b88ccd926099d852eae1bb324bc92eb</id>
<content type='text'>
Tracks commit e72837e3e7b "default SET_PERSONALITY() in linux/elf.h"

Signed-off-by: Vineet Gupta &lt;vgupta@synopsys.com&gt;
</content>
</entry>
<entry>
<title>ARC: ABIv3: fork/vfork wrappers not needed in "no-legacy-syscall" ABI</title>
<updated>2013-03-11T13:31:10Z</updated>
<author>
<name>Vineet Gupta</name>
<email>vgupta@synopsys.com</email>
</author>
<published>2013-03-04T10:31:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=180d406e4948faee6e63781f3e062f40ec7c6fc3'/>
<id>urn:sha1:180d406e4948faee6e63781f3e062f40ec7c6fc3</id>
<content type='text'>
When switching to clone() only ABI - I missed out pruning the low level
asm syscall wrappers

Signed-off-by: Vineet Gupta &lt;vgupta@synopsys.com&gt;
</content>
</entry>
<entry>
<title>ARC: ABIv3: Print the correct ABI ver</title>
<updated>2013-03-11T13:31:09Z</updated>
<author>
<name>Vineet Gupta</name>
<email>vgupta@synopsys.com</email>
</author>
<published>2013-03-06T09:03:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8ff14bbc6a2083e83c6d387d025fb67ba639807c'/>
<id>urn:sha1:8ff14bbc6a2083e83c6d387d025fb67ba639807c</id>
<content type='text'>
Signed-off-by: Vineet Gupta &lt;vgupta@synopsys.com&gt;
</content>
</entry>
<entry>
<title>ARC: make allyesconfig build breakages</title>
<updated>2013-03-11T13:31:09Z</updated>
<author>
<name>Vineet Gupta</name>
<email>vgupta@synopsys.com</email>
</author>
<published>2013-03-07T11:17:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1540c85b176180e5e0b312dd98db7f438baf8a24'/>
<id>urn:sha1:1540c85b176180e5e0b312dd98db7f438baf8a24</id>
<content type='text'>
  CC      drivers/mmc/host/mmc_spi.o
drivers/mmc/host/mmc_spi.c:118: error: redefinition of 'struct scratch'
make[3]: *** [drivers/mmc/host/mmc_spi.o] Error 1
make[2]: *** [drivers/mmc/host] Error 2
make[1]: *** [drivers/mmc] Error 2
make: *** [drivers] Error 2

  CC      arch/arc/kernel/kgdb.o
In file included from include/linux/kgdb.h:20,
                 from arch/arc/kernel/kgdb.c:11:
/home/vineetg/arc/k.org/arc-port/arch/arc/include/asm/kgdb.h:34:
warning: 'struct pt_regs' declared inside parameter list
/home/vineetg/arc/k.org/arc-port/arch/arc/include/asm/kgdb.h:34:
warning: its scope is only this definition or declaration, which is
probably not what you want
arch/arc/kernel/kgdb.c:172: error: conflicting types for 'kgdb_trap'

  CC      arch/arc/kernel/kgdb.o
arch/arc/kernel/kgdb.c: In function 'pt_regs_to_gdb_regs':
arch/arc/kernel/kgdb.c:62: error: dereferencing pointer to incomplete
type

Signed-off-by: Vineet Gupta &lt;vgupta@synopsys.com&gt;
</content>
</entry>
<entry>
<title>ARC: split elf.h into uapi and export it for userspace</title>
<updated>2013-02-27T14:30:26Z</updated>
<author>
<name>Vineet Gupta</name>
<email>vgupta@synopsys.com</email>
</author>
<published>2013-02-27T12:57:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8ccfe6675fa974bd06d64f74d0fdee6a5267d2aa'/>
<id>urn:sha1:8ccfe6675fa974bd06d64f74d0fdee6a5267d2aa</id>
<content type='text'>
Signed-off-by: Vineet Gupta &lt;vgupta@synopsys.com&gt;
</content>
</entry>
<entry>
<title>ARC: Fixup the current ABI version</title>
<updated>2013-02-27T14:30:25Z</updated>
<author>
<name>Vineet Gupta</name>
<email>vgupta@synopsys.com</email>
</author>
<published>2013-02-27T12:53:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=17139053eb96bc09a6d6248aae17c9316f5bcd86'/>
<id>urn:sha1:17139053eb96bc09a6d6248aae17c9316f5bcd86</id>
<content type='text'>
The upstream kernel ABI (v3) is different from current out-of-tree (v2):
* no-legacy-syscalls
* user_regs_struct layout has changed

So we rev up the ABI version

Signed-off-by: Vineet Gupta &lt;vgupta@synopsys.com&gt;
</content>
</entry>
<entry>
<title>ARC: gdbserver using regset interface possibly broken</title>
<updated>2013-02-27T14:29:55Z</updated>
<author>
<name>Vineet Gupta</name>
<email>vgupta@synopsys.com</email>
</author>
<published>2013-02-27T10:34:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5dc99e50d2d66f8ddeb4e20af1908ad99db0cb98'/>
<id>urn:sha1:5dc99e50d2d66f8ddeb4e20af1908ad99db0cb98</id>
<content type='text'>
ptrace regset interface relies on ELF_NGREG for ceiling the size of user
request. So any larger request (even if legit)  would be clipped.

The existing def of ELF_NGREG didn't use user_regs_struct and was
technically one placeholder short (stop_pc) - although the current code
would still work because pt_regs includes a bunch of extra fields,
making
      ELF_NGREG &gt;= sizeof(struct user_regs_struct)/sizeof(long)

But we need to remove this ambiguity, specially since pt_regs should NOT
be directly associated with with anything userspace-ish.

Signed-off-by: Vineet Gupta &lt;vgupta@synopsys.com&gt;
</content>
</entry>
</feed>
