<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/arm/include/asm/assembler.h, branch linux-5.16.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.16.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.16.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2022-03-11T11:42:08Z</updated>
<entry>
<title>ARM: fix co-processor register typo</title>
<updated>2022-03-11T11:42:08Z</updated>
<author>
<name>Russell King (Oracle)</name>
</author>
<published>2022-03-09T19:08:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3c685791cedff04001160b9788e1809ad4d8695f'/>
<id>urn:sha1:3c685791cedff04001160b9788e1809ad4d8695f</id>
<content type='text'>
commit 33970b031dc4653cc9dc80f2886976706c4c8ef1 upstream.

In the recent Spectre BHB patches, there was a typo that is only
exposed in certain configurations: mcr p15,0,XX,c7,r5,4 should have
been mcr p15,0,XX,c7,c5,4

Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Fixes: b9baf5c8c5c3 ("ARM: Spectre-BHB workaround")
Signed-off-by: Russell King (Oracle) &lt;rmk+kernel@armlinux.org.uk&gt;
Acked-by: Catalin Marinas &lt;catalin.marinas@arm.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>ARM: Spectre-BHB workaround</title>
<updated>2022-03-11T11:42:06Z</updated>
<author>
<name>Russell King (Oracle)</name>
</author>
<published>2022-02-10T16:05:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9fd1d31810ccf6b4e4df8ccf2e68bbdcf528d186'/>
<id>urn:sha1:9fd1d31810ccf6b4e4df8ccf2e68bbdcf528d186</id>
<content type='text'>
commit b9baf5c8c5c356757f4f9d8180b5e9d234065bc3 upstream.

Workaround the Spectre BHB issues for Cortex-A15, Cortex-A57,
Cortex-A72, Cortex-A73 and Cortex-A75. We also include Brahma B15 as
well to be safe, which is affected by Spectre V2 in the same ways as
Cortex-A15.

Reviewed-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Signed-off-by: Russell King (Oracle) &lt;rmk+kernel@armlinux.org.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>ARM: 9180/1: Thumb2: align ALT_UP() sections in modules sufficiently</title>
<updated>2022-02-01T16:29:00Z</updated>
<author>
<name>Ard Biesheuvel</name>
</author>
<published>2022-01-18T18:32:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7bb2b4df4cf9273b135f9a4b9e332bb4dbfecdcf'/>
<id>urn:sha1:7bb2b4df4cf9273b135f9a4b9e332bb4dbfecdcf</id>
<content type='text'>
commit 9f80ccda53b9417236945bc7ece4b519037df74d upstream.

When building for Thumb2, the .alt.smp.init sections that are emitted by
the ALT_UP() patching code may not be 32-bit aligned, even though the
fixup_smp_on_up() routine expects that. This results in alignment faults
at module load time, which need to be fixed up by the fault handler.

So let's align those sections explicitly, and prevent this from occurring.

Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Ard Biesheuvel &lt;ardb@kernel.org&gt;
Signed-off-by: Russell King (Oracle) &lt;rmk+kernel@armlinux.org.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>ARM: smp: Enable THREAD_INFO_IN_TASK</title>
<updated>2021-09-27T14:54:02Z</updated>
<author>
<name>Ard Biesheuvel</name>
</author>
<published>2021-09-18T08:44:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=18ed1c01a7dd3d7c780b06a49124da237a4c1790'/>
<id>urn:sha1:18ed1c01a7dd3d7c780b06a49124da237a4c1790</id>
<content type='text'>
Now that we no longer rely on thread_info living at the base of the task
stack to be able to access the 'current' pointer, we can wire up the
generic support for moving thread_info into the task struct itself.

Note that this requires us to update the cpu field in thread_info
explicitly, now that the core code no longer does so. Ideally, we would
switch the percpu code to access the cpu field in task_struct instead,
but this unleashes #include circular dependency hell.

Co-developed-by: Keith Packard &lt;keithpac@amazon.com&gt;
Signed-off-by: Keith Packard &lt;keithpac@amazon.com&gt;
Signed-off-by: Ard Biesheuvel &lt;ardb@kernel.org&gt;
Reviewed-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Tested-by: Amit Daniel Kachhap &lt;amit.kachhap@arm.com&gt;
</content>
</entry>
<entry>
<title>ARM: smp: Store current pointer in TPIDRURO register if available</title>
<updated>2021-09-27T14:54:02Z</updated>
<author>
<name>Ard Biesheuvel</name>
</author>
<published>2021-09-18T08:44:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=50596b7559bf226bb35ad55855ee979453ec06a1'/>
<id>urn:sha1:50596b7559bf226bb35ad55855ee979453ec06a1</id>
<content type='text'>
Now that the user space TLS register is assigned on every return to user
space, we can use it to keep the 'current' pointer while running in the
kernel. This removes the need to access it via thread_info, which is
located at the base of the stack, but will be moved out of there in a
subsequent patch.

Use the __builtin_thread_pointer() helper when available - this will
help GCC understand that reloading the value within the same function is
not necessary, even when using the per-task stack protector (which also
generates accesses via the TLS register). For example, the generated
code below loads TPIDRURO only once, and uses it to access both the
stack canary and the preempt_count fields.

&lt;do_one_initcall&gt;:
       e92d 41f0       stmdb   sp!, {r4, r5, r6, r7, r8, lr}
       ee1d 4f70       mrc     15, 0, r4, cr13, cr0, {3}
       4606            mov     r6, r0
       b094            sub     sp, #80 ; 0x50
       f8d4 34e8       ldr.w   r3, [r4, #1256] ; 0x4e8  &lt;- stack canary
       9313            str     r3, [sp, #76]   ; 0x4c
       f8d4 8004       ldr.w   r8, [r4, #4]             &lt;- preempt count

Co-developed-by: Keith Packard &lt;keithpac@amazon.com&gt;
Signed-off-by: Keith Packard &lt;keithpac@amazon.com&gt;
Signed-off-by: Ard Biesheuvel &lt;ardb@kernel.org&gt;
Reviewed-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Tested-by: Amit Daniel Kachhap &lt;amit.kachhap@arm.com&gt;
</content>
</entry>
<entry>
<title>ARM: 9039/1: assembler: generalize byte swapping macro into rev_l</title>
<updated>2021-02-01T19:41:30Z</updated>
<author>
<name>Ard Biesheuvel</name>
</author>
<published>2020-12-09T16:21:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6468e898c67b905ec0f95d9678929135bcaf7f67'/>
<id>urn:sha1:6468e898c67b905ec0f95d9678929135bcaf7f67</id>
<content type='text'>
Take the 4 instruction byte swapping sequence from the decompressor's
head.S, and turn it into a rev_l GAS macro for general use. While
at it, make it use the 'rev' instruction when compiling for v6 or
later.

Reviewed-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Tested-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Reviewed-by: Nicolas Pitre &lt;nico@fluxnic.net&gt;
Signed-off-by: Ard Biesheuvel &lt;ardb@kernel.org&gt;
Signed-off-by: Russell King &lt;rmk+kernel@armlinux.org.uk&gt;
</content>
</entry>
<entry>
<title>ARM: kernel: use relative references for UP/SMP alternatives</title>
<updated>2020-10-28T16:05:39Z</updated>
<author>
<name>Ard Biesheuvel</name>
</author>
<published>2020-09-14T08:48:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=450abd38fe6c6313ce9bdd9dce81c1dd604f6fb0'/>
<id>urn:sha1:450abd38fe6c6313ce9bdd9dce81c1dd604f6fb0</id>
<content type='text'>
Currently, the .alt.smp.init section contains the virtual addresses
of the patch sites. Since patching may occur both before and after
switching into virtual mode, this requires some manual handling of
the address when applying the UP alternative.

Let's simplify this by using relative offsets in the table entries:
this allows us to simply add each entry's address to its contents,
regardless of whether we are running in virtual mode or not.

Reviewed-by: Nicolas Pitre &lt;nico@fluxnic.net&gt;
Signed-off-by: Ard Biesheuvel &lt;ardb@kernel.org&gt;
</content>
</entry>
<entry>
<title>ARM: assembler: introduce adr_l, ldr_l and str_l macros</title>
<updated>2020-10-28T15:59:43Z</updated>
<author>
<name>Ard Biesheuvel</name>
</author>
<published>2020-09-14T08:23:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0b1674638a5c69cbace63278625c199100955490'/>
<id>urn:sha1:0b1674638a5c69cbace63278625c199100955490</id>
<content type='text'>
Like arm64, ARM supports position independent code sequences that
produce symbol references with a greater reach than the ordinary
adr/ldr instructions. Since on ARM, the adrl pseudo-instruction is
only supported in ARM mode (and not at all when using Clang), having
a adr_l macro like we do on arm64 is useful, and increases symmetry
as well.

Currently, we use open coded instruction sequences involving literals
and arithmetic operations. Instead, we can use movw/movt pairs on v7
CPUs, circumventing the D-cache entirely.

E.g., on v7+ CPUs, we can emit a PC-relative reference as follows:

       movw         &lt;reg&gt;, #:lower16:&lt;sym&gt; - (1f + 8)
       movt         &lt;reg&gt;, #:upper16:&lt;sym&gt; - (1f + 8)
  1:   add          &lt;reg&gt;, &lt;reg&gt;, pc

For older CPUs, we can emit the literal into a subsection, allowing it
to be emitted out of line while retaining the ability to perform
arithmetic on label offsets.

E.g., on pre-v7 CPUs, we can emit a PC-relative reference as follows:

       ldr          &lt;reg&gt;, 2f
  1:   add          &lt;reg&gt;, &lt;reg&gt;, pc
       .subsection  1
  2:   .long        &lt;sym&gt; - (1b + 8)
       .previous

This is allowed by the assembler because, unlike ordinary sections,
subsections are combined into a single section in the object file, and
so the label references are not true cross-section references that are
visible as relocations. (Subsections have been available in binutils
since 2004 at least, so they should not cause any issues with older
toolchains.)

So use the above to implement the macros mov_l, adr_l, ldr_l and str_l,
all of which will use movw/movt pairs on v7 and later CPUs, and use
PC-relative literals otherwise.

Reviewed-by: Nicolas Pitre &lt;nico@fluxnic.net&gt;
Reviewed-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Signed-off-by: Ard Biesheuvel &lt;ardb@kernel.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm</title>
<updated>2020-06-01T22:36:32Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2020-06-01T22:36:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c2b0fc847f3122e5a4176c3772626a7a8facced0'/>
<id>urn:sha1:c2b0fc847f3122e5a4176c3772626a7a8facced0</id>
<content type='text'>
Pull ARM updates from Russell King:

 - remove a now unnecessary usage of the KERNEL_DS for
   sys_oabi_epoll_ctl()

 - update my email address in a number of drivers

 - decompressor EFI updates from Ard Biesheuvel

 - module unwind section handling updates

 - sparsemem Kconfig cleanups

 - make act_mm macro respect THREAD_SIZE

* tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm:
  ARM: 8980/1: Allow either FLATMEM or SPARSEMEM on the multiplatform build
  ARM: 8979/1: Remove redundant ARCH_SPARSEMEM_DEFAULT setting
  ARM: 8978/1: mm: make act_mm() respect THREAD_SIZE
  ARM: decompressor: run decompressor in place if loaded via UEFI
  ARM: decompressor: move GOT into .data for EFI enabled builds
  ARM: decompressor: defer loading of the contents of the LC0 structure
  ARM: decompressor: split off _edata and stack base into separate object
  ARM: decompressor: move headroom variable out of LC0
  ARM: 8976/1: module: allow arch overrides for .init section names
  ARM: 8975/1: module: fix handling of unwind init sections
  ARM: 8974/1: use SPARSMEM_STATIC when SPARSEMEM is enabled
  ARM: 8971/1: replace the sole use of a symbol with its definition
  ARM: 8969/1: decompressor: simplify libfdt builds
  Update rmk's email address in various drivers
  ARM: compat: remove KERNEL_DS usage in sys_oabi_epoll_ctl()
</content>
</entry>
<entry>
<title>ARM: uaccess: consolidate uaccess asm to asm/uaccess-asm.h</title>
<updated>2020-05-03T16:30:24Z</updated>
<author>
<name>Russell King</name>
</author>
<published>2020-05-03T12:03:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=747ffc2fcf969eff9309d7f2d1d61cb8b9e1bb40'/>
<id>urn:sha1:747ffc2fcf969eff9309d7f2d1d61cb8b9e1bb40</id>
<content type='text'>
Consolidate the user access assembly code to asm/uaccess-asm.h.  This
moves the csdb, check_uaccess, uaccess_mask_range_ptr, uaccess_enable,
uaccess_disable, uaccess_save, uaccess_restore macros, and creates two
new ones for exception entry and exit - uaccess_entry and uaccess_exit.

This makes the uaccess_save and uaccess_restore macros private to
asm/uaccess-asm.h.

Signed-off-by: Russell King &lt;rmk+kernel@armlinux.org.uk&gt;
</content>
</entry>
</feed>
