Re: [PATCH] parisc: Add alternative coding when running UP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Oct 12, 2018 at 1:50 PM Helge Deller <deller@xxxxxx> wrote:
>
> This patch adds the necessary code to patch a running SMP kernel
> at runtime to improve performance when running on a single CPU.
>
> The current implementation offers two patching variants:
> - Unwanted assembler statements like locking functions are overwritten
>   with NOPs
> - Some pdtlb and pitlb instructions are patched to become pdtlb,l and
>   pitlb,l which only flushes the CPU-local tlb entries instead of
>   broadcasting the flush to other CPUs in the system and thus may
>   improve performance.
>
> Signed-off-by: Helge Deller <deller@xxxxxx>
>
> diff --git a/arch/parisc/include/asm/alternative.h b/arch/parisc/include/asm/alternative.h
> new file mode 100644
> index 000000000000..b8632b0fe55e
> --- /dev/null
> +++ b/arch/parisc/include/asm/alternative.h
> @@ -0,0 +1,39 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +#ifndef __ASM_PARISC_ALTERNATIVE_H
> +#define __ASM_PARISC_ALTERNATIVE_H
> +
> +#define INSN_PxTLB   0x01       /* pdtlb, pitlb */
> +
> +#ifndef __ASSEMBLY__
> +
> +#include <linux/init.h>
> +#include <linux/types.h>
> +#include <linux/stddef.h>
> +#include <linux/stringify.h>
> +
> +struct alt_instr {
> +        u32 from_addr;         /* offset to original instructions */

Just noticed a little whitespace mistake here. Spaces instead of a tab.

> +       u32 to_addr;            /* end of original instructions */
> +       u32 replacement;        /* replacement instruction or code */
> +};



[Index of Archives]     [Linux SoC]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux