-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag 'riscv-for-linus-5.9-mw0' of git://git.kernel.org/pub/scm/l…
…inux/kernel/git/riscv/linux Pull RISC-V updates from Palmer Dabbelt: "We have a lot of new kernel features for this merge window: - ARCH_SUPPORTS_ATOMIC_RMW, to allow OSQ locks to be enabled - The ability to enable NO_HZ_FULL - Support for enabling kcov, kmemleak, stack protector, and VM debugging - JUMP_LABEL support There are also a handful of cleanups" * tag 'riscv-for-linus-5.9-mw0' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: (24 commits) riscv: disable stack-protector for vDSO RISC-V: Fix build warning for smpboot.c riscv: fix build warning of mm/pageattr riscv: Fix build warning for mm/init RISC-V: Setup exception vector early riscv: Select ARCH_HAS_DEBUG_VM_PGTABLE riscv: Use generic pgprot_* macros from <linux/pgtable.h> mm: pgtable: Make generic pgprot_* macros available for no-MMU riscv: Cleanup unnecessary define in asm-offset.c riscv: Add jump-label implementation riscv: Support R_RISCV_ADD64 and R_RISCV_SUB64 relocs Replace HTTP links with HTTPS ones: RISC-V riscv: Add STACKPROTECTOR supported riscv: Fix typo in asm/hwcap.h uapi header riscv: Add kmemleak support riscv: Allow building with kcov coverage riscv: Enable context tracking riscv: Support irq_work via self IPIs riscv: Enable LOCKDEP_SUPPORT & fixup TRACE_IRQFLAGS_SUPPORT riscv: Fixup lockdep_assert_held with wrong param cpu_running ...
- Loading branch information
Showing
32 changed files
with
356 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/* SPDX-License-Identifier: GPL-2.0 */ | ||
#ifndef _ASM_RISCV_IRQ_WORK_H | ||
#define _ASM_RISCV_IRQ_WORK_H | ||
|
||
static inline bool arch_irq_work_has_interrupt(void) | ||
{ | ||
return true; | ||
} | ||
extern void arch_irq_work_raise(void); | ||
#endif /* _ASM_RISCV_IRQ_WORK_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* SPDX-License-Identifier: GPL-2.0-only */ | ||
/* | ||
* Copyright (C) 2020 Emil Renner Berthing | ||
* | ||
* Based on arch/arm64/include/asm/jump_label.h | ||
*/ | ||
#ifndef __ASM_JUMP_LABEL_H | ||
#define __ASM_JUMP_LABEL_H | ||
|
||
#ifndef __ASSEMBLY__ | ||
|
||
#include <linux/types.h> | ||
#include <asm/asm.h> | ||
|
||
#define JUMP_LABEL_NOP_SIZE 4 | ||
|
||
static __always_inline bool arch_static_branch(struct static_key *key, | ||
bool branch) | ||
{ | ||
asm_volatile_goto( | ||
" .option push \n\t" | ||
" .option norelax \n\t" | ||
" .option norvc \n\t" | ||
"1: nop \n\t" | ||
" .option pop \n\t" | ||
" .pushsection __jump_table, \"aw\" \n\t" | ||
" .align " RISCV_LGPTR " \n\t" | ||
" .long 1b - ., %l[label] - . \n\t" | ||
" " RISCV_PTR " %0 - . \n\t" | ||
" .popsection \n\t" | ||
: : "i"(&((char *)key)[branch]) : : label); | ||
|
||
return false; | ||
label: | ||
return true; | ||
} | ||
|
||
static __always_inline bool arch_static_branch_jump(struct static_key *key, | ||
bool branch) | ||
{ | ||
asm_volatile_goto( | ||
" .option push \n\t" | ||
" .option norelax \n\t" | ||
" .option norvc \n\t" | ||
"1: jal zero, %l[label] \n\t" | ||
" .option pop \n\t" | ||
" .pushsection __jump_table, \"aw\" \n\t" | ||
" .align " RISCV_LGPTR " \n\t" | ||
" .long 1b - ., %l[label] - . \n\t" | ||
" " RISCV_PTR " %0 - . \n\t" | ||
" .popsection \n\t" | ||
: : "i"(&((char *)key)[branch]) : : label); | ||
|
||
return false; | ||
label: | ||
return true; | ||
} | ||
|
||
#endif /* __ASSEMBLY__ */ | ||
#endif /* __ASM_JUMP_LABEL_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* SPDX-License-Identifier: GPL-2.0 */ | ||
|
||
#ifndef _ASM_RISCV_STACKPROTECTOR_H | ||
#define _ASM_RISCV_STACKPROTECTOR_H | ||
|
||
#include <linux/random.h> | ||
#include <linux/version.h> | ||
#include <asm/timex.h> | ||
|
||
extern unsigned long __stack_chk_guard; | ||
|
||
/* | ||
* Initialize the stackprotector canary value. | ||
* | ||
* NOTE: this must only be called from functions that never return, | ||
* and it must always be inlined. | ||
*/ | ||
static __always_inline void boot_init_stack_canary(void) | ||
{ | ||
unsigned long canary; | ||
unsigned long tsc; | ||
|
||
/* Try to get a semi random initial value. */ | ||
get_random_bytes(&canary, sizeof(canary)); | ||
tsc = get_cycles(); | ||
canary += tsc + (tsc << BITS_PER_LONG/2); | ||
canary ^= LINUX_VERSION_CODE; | ||
canary &= CANARY_MASK; | ||
|
||
current->stack_canary = canary; | ||
__stack_chk_guard = current->stack_canary; | ||
} | ||
#endif /* _ASM_RISCV_STACKPROTECTOR_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.