Loading Makefile +1 −1 Original line number Diff line number Diff line # SPDX-License-Identifier: GPL-2.0 VERSION = 4 PATCHLEVEL = 14 SUBLEVEL = 103 SUBLEVEL = 104 EXTRAVERSION = NAME = Petit Gorille Loading arch/arc/include/asm/cache.h +11 −0 Original line number Diff line number Diff line Loading @@ -52,6 +52,17 @@ #define cache_line_size() SMP_CACHE_BYTES #define ARCH_DMA_MINALIGN SMP_CACHE_BYTES /* * Make sure slab-allocated buffers are 64-bit aligned when atomic64_t uses * ARCv2 64-bit atomics (LLOCKD/SCONDD). This guarantess runtime 64-bit * alignment for any atomic64_t embedded in buffer. * Default ARCH_SLAB_MINALIGN is __alignof__(long long) which has a relaxed * value of 4 (and not 8) in ARC ABI. */ #if defined(CONFIG_ARC_HAS_LL64) && defined(CONFIG_ARC_HAS_LLSC) #define ARCH_SLAB_MINALIGN 8 #endif extern void arc_cache_init(void); extern char *arc_cache_mumbojumbo(int cpu_id, char *buf, int len); extern void read_decode_cache_bcr(void); Loading arch/arc/kernel/head.S +12 −2 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ #include <asm/entry.h> #include <asm/arcregs.h> #include <asm/cache.h> #include <asm/irqflags.h> .macro CPU_EARLY_SETUP Loading Loading @@ -47,6 +48,15 @@ sr r5, [ARC_REG_DC_CTRL] 1: #ifdef CONFIG_ISA_ARCV2 ; Unaligned access is disabled at reset, so re-enable early as ; gcc 7.3.1 (ARC GNU 2018.03) onwards generates unaligned access ; by default lr r5, [status32] bset r5, r5, STATUS_AD_BIT kflag r5 #endif .endm .section .init.text, "ax",@progbits Loading Loading @@ -93,9 +103,9 @@ ENTRY(stext) #ifdef CONFIG_ARC_UBOOT_SUPPORT ; Uboot - kernel ABI ; r0 = [0] No uboot interaction, [1] cmdline in r2, [2] DTB in r2 ; r1 = magic number (board identity, unused as of now ; r1 = magic number (always zero as of now) ; r2 = pointer to uboot provided cmdline or external DTB in mem ; These are handled later in setup_arch() ; These are handled later in handle_uboot_args() st r0, [@uboot_tag] st r2, [@uboot_arg] #endif Loading arch/arc/kernel/setup.c +62 −25 Original line number Diff line number Diff line Loading @@ -414,44 +414,81 @@ void setup_processor(void) arc_chk_core_config(); } static inline int is_kernel(unsigned long addr) static inline bool uboot_arg_invalid(unsigned long addr) { if (addr >= (unsigned long)_stext && addr <= (unsigned long)_end) return 1; return 0; /* * Check that it is a untranslated address (although MMU is not enabled * yet, it being a high address ensures this is not by fluke) */ if (addr < PAGE_OFFSET) return true; /* Check that address doesn't clobber resident kernel image */ return addr >= (unsigned long)_stext && addr <= (unsigned long)_end; } void __init setup_arch(char **cmdline_p) #define IGNORE_ARGS "Ignore U-boot args: " /* uboot_tag values for U-boot - kernel ABI revision 0; see head.S */ #define UBOOT_TAG_NONE 0 #define UBOOT_TAG_CMDLINE 1 #define UBOOT_TAG_DTB 2 void __init handle_uboot_args(void) { bool use_embedded_dtb = true; bool append_cmdline = false; #ifdef CONFIG_ARC_UBOOT_SUPPORT /* make sure that uboot passed pointer to cmdline/dtb is valid */ if (uboot_tag && is_kernel((unsigned long)uboot_arg)) panic("Invalid uboot arg\n"); /* check that we know this tag */ if (uboot_tag != UBOOT_TAG_NONE && uboot_tag != UBOOT_TAG_CMDLINE && uboot_tag != UBOOT_TAG_DTB) { pr_warn(IGNORE_ARGS "invalid uboot tag: '%08x'\n", uboot_tag); goto ignore_uboot_args; } /* See if u-boot passed an external Device Tree blob */ machine_desc = setup_machine_fdt(uboot_arg); /* uboot_tag == 2 */ if (!machine_desc) if (uboot_tag != UBOOT_TAG_NONE && uboot_arg_invalid((unsigned long)uboot_arg)) { pr_warn(IGNORE_ARGS "invalid uboot arg: '%px'\n", uboot_arg); goto ignore_uboot_args; } /* see if U-boot passed an external Device Tree blob */ if (uboot_tag == UBOOT_TAG_DTB) { machine_desc = setup_machine_fdt((void *)uboot_arg); /* external Device Tree blob is invalid - use embedded one */ use_embedded_dtb = !machine_desc; } if (uboot_tag == UBOOT_TAG_CMDLINE) append_cmdline = true; ignore_uboot_args: #endif { /* No, so try the embedded one */ if (use_embedded_dtb) { machine_desc = setup_machine_fdt(__dtb_start); if (!machine_desc) panic("Embedded DT invalid\n"); } /* * If we are here, it is established that @uboot_arg didn't * point to DT blob. Instead if u-boot says it is cmdline, * append to embedded DT cmdline. * setup_machine_fdt() would have populated @boot_command_line * NOTE: @boot_command_line is populated by setup_machine_fdt() so this * append processing can only happen after. */ if (uboot_tag == 1) { if (append_cmdline) { /* Ensure a whitespace between the 2 cmdlines */ strlcat(boot_command_line, " ", COMMAND_LINE_SIZE); strlcat(boot_command_line, uboot_arg, COMMAND_LINE_SIZE); strlcat(boot_command_line, uboot_arg, COMMAND_LINE_SIZE); } } void __init setup_arch(char **cmdline_p) { handle_uboot_args(); /* Save unparsed command line copy for /proc/cmdline */ *cmdline_p = boot_command_line; Loading arch/arm/probes/kprobes/opt-arm.c +1 −1 Original line number Diff line number Diff line Loading @@ -247,7 +247,7 @@ int arch_prepare_optimized_kprobe(struct optimized_kprobe *op, struct kprobe *or } /* Copy arch-dep-instance from template. */ memcpy(code, (unsigned char *)optprobe_template_entry, memcpy(code, (unsigned long *)&optprobe_template_entry, TMPL_END_IDX * sizeof(kprobe_opcode_t)); /* Adjust buffer according to instruction. */ Loading Loading
Makefile +1 −1 Original line number Diff line number Diff line # SPDX-License-Identifier: GPL-2.0 VERSION = 4 PATCHLEVEL = 14 SUBLEVEL = 103 SUBLEVEL = 104 EXTRAVERSION = NAME = Petit Gorille Loading
arch/arc/include/asm/cache.h +11 −0 Original line number Diff line number Diff line Loading @@ -52,6 +52,17 @@ #define cache_line_size() SMP_CACHE_BYTES #define ARCH_DMA_MINALIGN SMP_CACHE_BYTES /* * Make sure slab-allocated buffers are 64-bit aligned when atomic64_t uses * ARCv2 64-bit atomics (LLOCKD/SCONDD). This guarantess runtime 64-bit * alignment for any atomic64_t embedded in buffer. * Default ARCH_SLAB_MINALIGN is __alignof__(long long) which has a relaxed * value of 4 (and not 8) in ARC ABI. */ #if defined(CONFIG_ARC_HAS_LL64) && defined(CONFIG_ARC_HAS_LLSC) #define ARCH_SLAB_MINALIGN 8 #endif extern void arc_cache_init(void); extern char *arc_cache_mumbojumbo(int cpu_id, char *buf, int len); extern void read_decode_cache_bcr(void); Loading
arch/arc/kernel/head.S +12 −2 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ #include <asm/entry.h> #include <asm/arcregs.h> #include <asm/cache.h> #include <asm/irqflags.h> .macro CPU_EARLY_SETUP Loading Loading @@ -47,6 +48,15 @@ sr r5, [ARC_REG_DC_CTRL] 1: #ifdef CONFIG_ISA_ARCV2 ; Unaligned access is disabled at reset, so re-enable early as ; gcc 7.3.1 (ARC GNU 2018.03) onwards generates unaligned access ; by default lr r5, [status32] bset r5, r5, STATUS_AD_BIT kflag r5 #endif .endm .section .init.text, "ax",@progbits Loading Loading @@ -93,9 +103,9 @@ ENTRY(stext) #ifdef CONFIG_ARC_UBOOT_SUPPORT ; Uboot - kernel ABI ; r0 = [0] No uboot interaction, [1] cmdline in r2, [2] DTB in r2 ; r1 = magic number (board identity, unused as of now ; r1 = magic number (always zero as of now) ; r2 = pointer to uboot provided cmdline or external DTB in mem ; These are handled later in setup_arch() ; These are handled later in handle_uboot_args() st r0, [@uboot_tag] st r2, [@uboot_arg] #endif Loading
arch/arc/kernel/setup.c +62 −25 Original line number Diff line number Diff line Loading @@ -414,44 +414,81 @@ void setup_processor(void) arc_chk_core_config(); } static inline int is_kernel(unsigned long addr) static inline bool uboot_arg_invalid(unsigned long addr) { if (addr >= (unsigned long)_stext && addr <= (unsigned long)_end) return 1; return 0; /* * Check that it is a untranslated address (although MMU is not enabled * yet, it being a high address ensures this is not by fluke) */ if (addr < PAGE_OFFSET) return true; /* Check that address doesn't clobber resident kernel image */ return addr >= (unsigned long)_stext && addr <= (unsigned long)_end; } void __init setup_arch(char **cmdline_p) #define IGNORE_ARGS "Ignore U-boot args: " /* uboot_tag values for U-boot - kernel ABI revision 0; see head.S */ #define UBOOT_TAG_NONE 0 #define UBOOT_TAG_CMDLINE 1 #define UBOOT_TAG_DTB 2 void __init handle_uboot_args(void) { bool use_embedded_dtb = true; bool append_cmdline = false; #ifdef CONFIG_ARC_UBOOT_SUPPORT /* make sure that uboot passed pointer to cmdline/dtb is valid */ if (uboot_tag && is_kernel((unsigned long)uboot_arg)) panic("Invalid uboot arg\n"); /* check that we know this tag */ if (uboot_tag != UBOOT_TAG_NONE && uboot_tag != UBOOT_TAG_CMDLINE && uboot_tag != UBOOT_TAG_DTB) { pr_warn(IGNORE_ARGS "invalid uboot tag: '%08x'\n", uboot_tag); goto ignore_uboot_args; } /* See if u-boot passed an external Device Tree blob */ machine_desc = setup_machine_fdt(uboot_arg); /* uboot_tag == 2 */ if (!machine_desc) if (uboot_tag != UBOOT_TAG_NONE && uboot_arg_invalid((unsigned long)uboot_arg)) { pr_warn(IGNORE_ARGS "invalid uboot arg: '%px'\n", uboot_arg); goto ignore_uboot_args; } /* see if U-boot passed an external Device Tree blob */ if (uboot_tag == UBOOT_TAG_DTB) { machine_desc = setup_machine_fdt((void *)uboot_arg); /* external Device Tree blob is invalid - use embedded one */ use_embedded_dtb = !machine_desc; } if (uboot_tag == UBOOT_TAG_CMDLINE) append_cmdline = true; ignore_uboot_args: #endif { /* No, so try the embedded one */ if (use_embedded_dtb) { machine_desc = setup_machine_fdt(__dtb_start); if (!machine_desc) panic("Embedded DT invalid\n"); } /* * If we are here, it is established that @uboot_arg didn't * point to DT blob. Instead if u-boot says it is cmdline, * append to embedded DT cmdline. * setup_machine_fdt() would have populated @boot_command_line * NOTE: @boot_command_line is populated by setup_machine_fdt() so this * append processing can only happen after. */ if (uboot_tag == 1) { if (append_cmdline) { /* Ensure a whitespace between the 2 cmdlines */ strlcat(boot_command_line, " ", COMMAND_LINE_SIZE); strlcat(boot_command_line, uboot_arg, COMMAND_LINE_SIZE); strlcat(boot_command_line, uboot_arg, COMMAND_LINE_SIZE); } } void __init setup_arch(char **cmdline_p) { handle_uboot_args(); /* Save unparsed command line copy for /proc/cmdline */ *cmdline_p = boot_command_line; Loading
arch/arm/probes/kprobes/opt-arm.c +1 −1 Original line number Diff line number Diff line Loading @@ -247,7 +247,7 @@ int arch_prepare_optimized_kprobe(struct optimized_kprobe *op, struct kprobe *or } /* Copy arch-dep-instance from template. */ memcpy(code, (unsigned char *)optprobe_template_entry, memcpy(code, (unsigned long *)&optprobe_template_entry, TMPL_END_IDX * sizeof(kprobe_opcode_t)); /* Adjust buffer according to instruction. */ Loading