<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/arm/mm/context.c, branch linux-3.11.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.11.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.11.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2013-07-26T11:02:09Z</updated>
<entry>
<title>ARM: 7789/1: Do not run dummy_flush_tlb_a15_erratum() on non-Cortex-A15</title>
<updated>2013-07-26T11:02:09Z</updated>
<author>
<name>Fabio Estevam</name>
</author>
<published>2013-07-23T14:13:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1f49856bb029779d8f1b63517a3a3b34ffe672c7'/>
<id>urn:sha1:1f49856bb029779d8f1b63517a3a3b34ffe672c7</id>
<content type='text'>
Commit 93dc688 (ARM: 7684/1: errata: Workaround for Cortex-A15 erratum 798181 (TLBI/DSB operations)) causes the following undefined instruction error on a mx53 (Cortex-A8):

Internal error: Oops - undefined instruction: 0 [#1] SMP ARM
CPU: 0 PID: 275 Comm: modprobe Not tainted 3.11.0-rc2-next-20130722-00009-g9b0f371 #881
task: df46cc00 ti: df48e000 task.ti: df48e000
PC is at check_and_switch_context+0x17c/0x4d0
LR is at check_and_switch_context+0xdc/0x4d0

This problem happens because check_and_switch_context() calls dummy_flush_tlb_a15_erratum() without checking if we are really running on a Cortex-A15 or not.

To avoid this issue, only call dummy_flush_tlb_a15_erratum() inside
check_and_switch_context() if erratum_a15_798181() returns true, which means that we are really running on a Cortex-A15.

Signed-off-by: Fabio Estevam &lt;fabio.estevam@freescale.com&gt;
Acked-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Reviewed-by: Roger Quadros &lt;rogerq@ti.com&gt;
Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>Merge branch 'devel-stable' into for-next</title>
<updated>2013-06-29T10:44:43Z</updated>
<author>
<name>Russell King</name>
</author>
<published>2013-06-29T10:44:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3c0c01ab742ddfaf6b6f2d64b890e77cda4b7727'/>
<id>urn:sha1:3c0c01ab742ddfaf6b6f2d64b890e77cda4b7727</id>
<content type='text'>
Conflicts:
	arch/arm/Makefile
	arch/arm/include/asm/glue-proc.h
</content>
</entry>
<entry>
<title>ARM: 7769/1: Cortex-A15: fix erratum 798181 implementation</title>
<updated>2013-06-24T14:27:35Z</updated>
<author>
<name>Marc Zyngier</name>
</author>
<published>2013-06-21T11:07:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0d0752bca1f9a91fb646647aa4abbb21156f316c'/>
<id>urn:sha1:0d0752bca1f9a91fb646647aa4abbb21156f316c</id>
<content type='text'>
Looking into the active_asids array is not enough, as we also need
to look into the reserved_asids array (they both represent processes
that are currently running).

Also, not holding the ASID allocator lock is racy, as another CPU
could schedule that process and trigger a rollover, making the erratum
workaround miss an IPI.

Exposing this outside of context.c is a little ugly on the side, so
let's define a new entry point that the erratum workaround can call
to obtain the cpumask.

Cc: &lt;stable@vger.kernel.org&gt; # 3.9
Acked-by: Will Deacon &lt;will.deacon@arm.com&gt;
Acked-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Signed-off-by: Marc Zyngier &lt;marc.zyngier@arm.com&gt;
Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>ARM: 7768/1: prevent risks of out-of-bound access in ASID allocator</title>
<updated>2013-06-24T14:26:41Z</updated>
<author>
<name>Marc Zyngier</name>
</author>
<published>2013-06-21T11:06:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b8e4a4740fa2b17c0a447b3ab783b3dc10702e27'/>
<id>urn:sha1:b8e4a4740fa2b17c0a447b3ab783b3dc10702e27</id>
<content type='text'>
On a CPU that never ran anything, both the active and reserved ASID
fields are set to zero. In this case the ASID_TO_IDX() macro will
return -1, which is not a very useful value to index a bitmap.

Instead of trying to offset the ASID so that ASID #1 is actually
bit 0 in the asid_map bitmap, just always ignore bit 0 and start
the search from bit 1. This makes the code a bit more readable,
and without risk of OoB access.

Cc: &lt;stable@vger.kernel.org&gt; # 3.9
Acked-by: Will Deacon &lt;will.deacon@arm.com&gt;
Acked-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Reported-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Signed-off-by: Marc Zyngier &lt;marc.zyngier@arm.com&gt;
Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>ARM: 7767/1: let the ASID allocator handle suspended animation</title>
<updated>2013-06-24T14:24:54Z</updated>
<author>
<name>Marc Zyngier</name>
</author>
<published>2013-06-21T11:06:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ae120d9edfe96628f03d87634acda0bfa7110632'/>
<id>urn:sha1:ae120d9edfe96628f03d87634acda0bfa7110632</id>
<content type='text'>
When a CPU is running a process, the ASID for that process is
held in a per-CPU variable (the "active ASIDs" array). When
the ASID allocator handles a rollover, it copies the active
ASIDs into a "reserved ASIDs" array to ensure that a process
currently running on another CPU will continue to run unaffected.
The active array is zero-ed to indicate that a rollover occurred.

Because of this mechanism, a reserved ASID is only remembered for
a single rollover. A subsequent rollover will completely refill
the reserved ASIDs array.

In a severely oversubscribed environment where a CPU can be
prevented from running for extended periods of time (think virtual
machines), the above has a horrible side effect:

[P{a} denotes process P running with ASID a]

	CPU-0		CPU-1

	A{x}				[active = &lt;x 0&gt;]

	[suspended]	runs B{y}	[active = &lt;x y&gt;]

					[rollover:
					 active = &lt;0 0&gt;
					 reserved = &lt;x y&gt;]

			runs B{y}	[active = &lt;0 y&gt;
					 reserved = &lt;x y&gt;]

					[rollover:
					 active = &lt;0 0&gt;
					 reserved = &lt;0 y&gt;]

			runs C{x}	[active = &lt;0 x&gt;]

	[resumes]

	runs A{x}

At that stage, both A and C have the same ASID, with deadly
consequences.

The fix is to preserve reserved ASIDs across rollovers if
the CPU doesn't have an active ASID when the rollover occurs.

Cc: &lt;stable@vger.kernel.org&gt; # 3.9
Acked-by: Will Deacon &lt;will.deacon@arm.com&gt;
Acked-by: Catalin Carinas &lt;catalin.marinas@arm.com&gt;
Signed-off-by: Marc Zyngier &lt;marc.zyngier@arm.com&gt;
Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>ARM: LPAE: use 64-bit accessors for TTBR registers</title>
<updated>2013-05-30T15:02:07Z</updated>
<author>
<name>Cyril Chemparathy</name>
</author>
<published>2012-07-16T21:20:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1fc84ae84b5153e32a4b6ace507f9663e10b0cb2'/>
<id>urn:sha1:1fc84ae84b5153e32a4b6ace507f9663e10b0cb2</id>
<content type='text'>
This patch adds TTBR accessor macros, and modifies cpu_get_pgd() and
the LPAE version of cpu_set_reserved_ttbr0() to use these instead.

In the process, we also fix these functions to correctly handle cases
where the physical address lies beyond the 4G limit of 32-bit addressing.

Signed-off-by: Cyril Chemparathy &lt;cyril@ti.com&gt;
Signed-off-by: Vitaly Andrianov &lt;vitalya@ti.com&gt;
Acked-by: Nicolas Pitre &lt;nico@linaro.org&gt;
Reviewed-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Tested-by: Santosh Shilimkar &lt;santosh.shilimkar@ti.com&gt;
Tested-by: Subash Patel &lt;subash.rp@samsung.com&gt;
Signed-off-by: Will Deacon &lt;will.deacon@arm.com&gt;
</content>
</entry>
<entry>
<title>ARM: 7684/1: errata: Workaround for Cortex-A15 erratum 798181 (TLBI/DSB operations)</title>
<updated>2013-04-03T15:45:49Z</updated>
<author>
<name>Catalin Marinas</name>
</author>
<published>2013-03-26T22:35:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=93dc68876b608da041fe40ed39424b0fcd5aa2fb'/>
<id>urn:sha1:93dc68876b608da041fe40ed39424b0fcd5aa2fb</id>
<content type='text'>
On Cortex-A15 (r0p0..r3p2) the TLBI/DSB are not adequately shooting down
all use of the old entries. This patch implements the erratum workaround
which consists of:

1. Dummy TLBIMVAIS and DSB on the CPU doing the TLBI operation.
2. Send IPI to the CPUs that are running the same mm (and ASID) as the
   one being invalidated (or all the online CPUs for global pages).
3. CPU receiving the IPI executes a DMB and CLREX (part of the exception
   return code already).

Signed-off-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>ARM: 7661/1: mm: perform explicit branch predictor maintenance when required</title>
<updated>2013-03-03T22:54:16Z</updated>
<author>
<name>Will Deacon</name>
</author>
<published>2013-02-28T16:48:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=89c7e4b8bbb3d4fa52df5746a8ad38e610143651'/>
<id>urn:sha1:89c7e4b8bbb3d4fa52df5746a8ad38e610143651</id>
<content type='text'>
The ARM ARM requires branch predictor maintenance if, for a given ASID,
the instructions at a specific virtual address appear to change.

From the kernel's point of view, that means:

	- Changing the kernel's view of memory (e.g. switching to the
	  identity map)
	- ASID rollover (since ASIDs will be re-allocated to new tasks)

This patch adds explicit branch predictor maintenance when either of the
two conditions above are met.

Reviewed-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Signed-off-by: Will Deacon &lt;will.deacon@arm.com&gt;
Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>ARM: 7659/1: mm: make mm-&gt;context.id an atomic64_t variable</title>
<updated>2013-03-03T22:54:14Z</updated>
<author>
<name>Will Deacon</name>
</author>
<published>2013-02-28T16:47:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8a4e3a9ead7e37ce1505602b564c15da09ac039f'/>
<id>urn:sha1:8a4e3a9ead7e37ce1505602b564c15da09ac039f</id>
<content type='text'>
mm-&gt;context.id is updated under asid_lock when a new ASID is allocated
to an mm_struct. However, it is also read without the lock when a task
is being scheduled and checking whether or not the current ASID
generation is up-to-date.

If two threads of the same process are being scheduled in parallel and
the bottom bits of the generation in their mm-&gt;context.id match the
current generation (that is, the mm_struct has not been used for ~2^24
rollovers) then the non-atomic, lockless access to mm-&gt;context.id may
yield the incorrect ASID.

This patch fixes this issue by making mm-&gt;context.id and atomic64_t,
ensuring that the generation is always read consistently. For code that
only requires access to the ASID bits (e.g. TLB flushing by mm), then
the value is accessed directly, which GCC converts to an ldrb.

Cc: &lt;stable@vger.kernel.org&gt; # 3.8
Reviewed-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Signed-off-by: Will Deacon &lt;will.deacon@arm.com&gt;
Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>ARM: 7658/1: mm: fix race updating mm-&gt;context.id on ASID rollover</title>
<updated>2013-03-03T22:54:13Z</updated>
<author>
<name>Will Deacon</name>
</author>
<published>2013-02-28T16:47:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=37f47e3d62533c931b04cb409f2eb299e6342331'/>
<id>urn:sha1:37f47e3d62533c931b04cb409f2eb299e6342331</id>
<content type='text'>
If a thread triggers an ASID rollover, other threads of the same process
must be made to wait until the mm-&gt;context.id for the shared mm_struct
has been updated to new generation and associated book-keeping (e.g.
TLB invalidation) has ben performed.

However, there is a *tiny* window where both mm-&gt;context.id and the
relevant active_asids entry are updated to the new generation, but the
TLB flush has not been performed, which could allow another thread to
return to userspace with a dirty TLB, potentially leading to data
corruption. In reality this will never occur because one CPU would need
to perform a context-switch in the time it takes another to do a couple
of atomic test/set operations but we should plug the race anyway.

This patch moves the active_asids update until after the potential TLB
flush on context-switch.

Cc: &lt;stable@vger.kernel.org&gt; # 3.8
Reviewed-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Signed-off-by: Will Deacon &lt;will.deacon@arm.com&gt;
Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
</content>
</entry>
</feed>
