]> asedeno.scripts.mit.edu Git - linux.git/commit
MIPS: VZ: Update helpers to use new asm macros
authorJames Hogan <jhogan@kernel.org>
Wed, 22 Nov 2017 11:30:28 +0000 (11:30 +0000)
committerJames Hogan <jhogan@kernel.org>
Mon, 22 Jan 2018 20:51:37 +0000 (20:51 +0000)
commit00b4eb408aaff21aeb806de24c5ff25b398083a4
treef7e20d8d48d0c6761cec47fddca6fd38f59c6c40
parentfc62f53bb2f1a436fa69c42c82e207a7c7062efc
MIPS: VZ: Update helpers to use new asm macros

Update VZ guest register & guest TLB access helpers to use the new
assembly macros for parsing register names and creating custom assembly
macro instructions, which has a number of advantages:

 - Better code can be generated on toolchains which don't support VZ,
   more closely matching those which do, since there is no need to
   bounce values via the $at register. Some differences still remain due
   to the inability to safely fill branch delay slots and R6 compact
   branch forbidden slots with explicitly encoded instructions,
   resulting in some extra NOPs added by the assembler.

 - Some code duplication between toolchains which do and don't support
   VZ instructions is removed, since the helpers are only implemented
   once. When the toolchain doesn't implement the instruction an
   assembly macro implements it instead.

 - Instruction encodings are kept together in the source.

On a generic kernel with KVM VZ support enabled this change saves about
2.5KiB of kernel code when TOOLCHAIN_SUPPORTS_VIRT=n, bringing it down
to about 0.5KiB more than when TOOLCHAIN_SUPPORTS_VIRT=y on r6, and just
68 bytes more on r2.

Signed-off-by: James Hogan <jhogan@kernel.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/17772/
arch/mips/include/asm/mipsregs.h