Compare commits
79 Commits
master
...
private-da
Author | SHA1 | Date |
---|---|---|
David Abdurachmanov | c9a88c57af | |
Laura Abbott | 138f36aa16 | |
Peter Robinson | b07dd9aa6f | |
Peter Robinson | e0ac22bfc2 | |
Laura Abbott | 0498fb5dc5 | |
Laura Abbott | 06340ec177 | |
David Abdurachmanov | 51056b416e | |
David Abdurachmanov | f5451a35e8 | |
David Abdurachmanov | f7296f0f1f | |
David Abdurachmanov | 4874335a34 | |
David Abdurachmanov | 6fe4640c1a | |
Laura Abbott | 9f3562b7a0 | |
Laura Abbott | a948dfad97 | |
David Abdurachmanov | 576b1ae843 | |
David Abdurachmanov | 98989ae15a | |
David Abdurachmanov | d67f20b6af | |
David Abdurachmanov | c02a88f6c2 | |
David Abdurachmanov | 61f194cc7d | |
David Abdurachmanov | 1eeb636d12 | |
David Abdurachmanov | 43dcced80c | |
David Abdurachmanov | c12dd026dd | |
David Abdurachmanov | 6bc8810bf1 | |
David Abdurachmanov | e765a7ca2e | |
David Abdurachmanov | 0ebe98255d | |
David Abdurachmanov | 77b49c9b18 | |
David Abdurachmanov | b54ad78b02 | |
David Abdurachmanov | ecef7281d5 | |
David Abdurachmanov | 5e0efa7c70 | |
David Abdurachmanov | 6d70f5be5f | |
David Abdurachmanov | 601e6a0b25 | |
David Abdurachmanov | 394552ce0a | |
David Abdurachmanov | 509fb7c884 | |
David Abdurachmanov | 8a92f6bb9e | |
David Abdurachmanov | 0be8868348 | |
David Abdurachmanov | afe42142a2 | |
David Abdurachmanov | f27a56dd4f | |
David Abdurachmanov | 8c11451ed6 | |
David Abdurachmanov | 6a92c8e473 | |
David Abdurachmanov | 985dca2019 | |
David Abdurachmanov | da7a473ed6 | |
David Abdurachmanov | 32d304786a | |
David Abdurachmanov | 9d19b9acba | |
David Abdurachmanov | 73b70fe83d | |
David Abdurachmanov | 08e119a980 | |
David Abdurachmanov | 512dd80333 | |
David Abdurachmanov | da577e4814 | |
David Abdurachmanov | e644ae139d | |
David Abdurachmanov | 4d63228929 | |
David Abdurachmanov | d932ad52cf | |
David Abdurachmanov | 625fa4a062 | |
David Abdurachmanov | 6f9cf326c7 | |
David Abdurachmanov | a0a6f7a375 | |
David Abdurachmanov | fc9138ad11 | |
David Abdurachmanov | ff3e5b658b | |
David Abdurachmanov | 9db5e7124c | |
David Abdurachmanov | c84bdfed84 | |
David Abdurachmanov | f49ba59706 | |
David Abdurachmanov | e9615025d3 | |
David Abdurachmanov | 6e04e00c1f | |
David Abdurachmanov | 24ef14817b | |
David Abdurachmanov | f72820cd8f | |
David Abdurachmanov | 4b722cac34 | |
David Abdurachmanov | 22e71c9173 | |
David Abdurachmanov | bf6565ba91 | |
David Abdurachmanov | 7a2f3d62e7 | |
David Abdurachmanov | 6afa6a1d1d | |
David Abdurachmanov | 61da5462ab | |
David Abdurachmanov | 1838232458 | |
David Abdurachmanov | 8d4ff40415 | |
David Abdurachmanov | f47d31c65b | |
David Abdurachmanov | 80112e26ae | |
David Abdurachmanov | 676aad9847 | |
David Abdurachmanov | 65627459ed | |
David Abdurachmanov | fd01e1b407 | |
David Abdurachmanov | e93b45642b | |
David Abdurachmanov | 088edc4af9 | |
David Abdurachmanov | 681c2dab76 | |
David Abdurachmanov | 7094da6400 | |
David Abdurachmanov | b3c173bfe0 |
|
@ -0,0 +1,184 @@
|
||||||
|
From 0cb0b507d7eaff090b2607799de3acad464fa446 Mon Sep 17 00:00:00 2001
|
||||||
|
From: David Abdurachmanov <david.abdurachmanov@sifive.com>
|
||||||
|
Date: Mon, 24 Jun 2019 18:58:45 +0300
|
||||||
|
Subject: [PATCH] riscv: add SECCOMP support
|
||||||
|
|
||||||
|
Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
|
||||||
|
|
||||||
|
diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
|
||||||
|
index 0c4b12205632..6f89a83c1e9c 100644
|
||||||
|
--- a/arch/riscv/Kconfig
|
||||||
|
+++ b/arch/riscv/Kconfig
|
||||||
|
@@ -30,6 +30,7 @@ config RISCV
|
||||||
|
select GENERIC_SMP_IDLE_THREAD
|
||||||
|
select GENERIC_ATOMIC64 if !64BIT
|
||||||
|
select HAVE_ARCH_AUDITSYSCALL
|
||||||
|
+ select HAVE_ARCH_SECCOMP_FILTER
|
||||||
|
select HAVE_MEMBLOCK_NODE_MAP
|
||||||
|
select HAVE_DMA_CONTIGUOUS
|
||||||
|
select HAVE_FUTEX_CMPXCHG if FUTEX
|
||||||
|
@@ -223,6 +224,19 @@ menu "Kernel features"
|
||||||
|
|
||||||
|
source "kernel/Kconfig.hz"
|
||||||
|
|
||||||
|
+config SECCOMP
|
||||||
|
+ bool "Enable seccomp to safely compute untrusted bytecode"
|
||||||
|
+ help
|
||||||
|
+ This kernel feature is useful for number crunching applications
|
||||||
|
+ that may need to compute untrusted bytecode during their
|
||||||
|
+ execution. By using pipes or other transports made available to
|
||||||
|
+ the process as file descriptors supporting the read/write
|
||||||
|
+ syscalls, it's possible to isolate those applications in
|
||||||
|
+ their own address space using seccomp. Once seccomp is
|
||||||
|
+ enabled via prctl(PR_SET_SECCOMP), it cannot be disabled
|
||||||
|
+ and the task is only allowed to execute a few safe syscalls
|
||||||
|
+ defined by each seccomp mode.
|
||||||
|
+
|
||||||
|
endmenu
|
||||||
|
|
||||||
|
menu "Boot options"
|
||||||
|
diff --git a/arch/riscv/include/asm/seccomp.h b/arch/riscv/include/asm/seccomp.h
|
||||||
|
new file mode 100644
|
||||||
|
index 000000000000..bf7744ee3b3d
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/arch/riscv/include/asm/seccomp.h
|
||||||
|
@@ -0,0 +1,10 @@
|
||||||
|
+/* SPDX-License-Identifier: GPL-2.0 */
|
||||||
|
+
|
||||||
|
+#ifndef _ASM_SECCOMP_H
|
||||||
|
+#define _ASM_SECCOMP_H
|
||||||
|
+
|
||||||
|
+#include <asm/unistd.h>
|
||||||
|
+
|
||||||
|
+#include <asm-generic/seccomp.h>
|
||||||
|
+
|
||||||
|
+#endif /* _ASM_SECCOMP_H */
|
||||||
|
diff --git a/arch/riscv/include/asm/thread_info.h b/arch/riscv/include/asm/thread_info.h
|
||||||
|
index 905372d7eeb8..a0b2a29a0da1 100644
|
||||||
|
--- a/arch/riscv/include/asm/thread_info.h
|
||||||
|
+++ b/arch/riscv/include/asm/thread_info.h
|
||||||
|
@@ -75,6 +75,7 @@ struct thread_info {
|
||||||
|
#define TIF_MEMDIE 5 /* is terminating due to OOM killer */
|
||||||
|
#define TIF_SYSCALL_TRACEPOINT 6 /* syscall tracepoint instrumentation */
|
||||||
|
#define TIF_SYSCALL_AUDIT 7 /* syscall auditing */
|
||||||
|
+#define TIF_SECCOMP 8 /* syscall secure computing */
|
||||||
|
|
||||||
|
#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
|
||||||
|
#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
|
||||||
|
@@ -82,11 +83,13 @@ struct thread_info {
|
||||||
|
#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
|
||||||
|
#define _TIF_SYSCALL_TRACEPOINT (1 << TIF_SYSCALL_TRACEPOINT)
|
||||||
|
#define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT)
|
||||||
|
+#define _TIF_SECCOMP (1 << TIF_SECCOMP)
|
||||||
|
|
||||||
|
#define _TIF_WORK_MASK \
|
||||||
|
(_TIF_NOTIFY_RESUME | _TIF_SIGPENDING | _TIF_NEED_RESCHED)
|
||||||
|
|
||||||
|
#define _TIF_SYSCALL_WORK \
|
||||||
|
- (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_TRACEPOINT | _TIF_SYSCALL_AUDIT)
|
||||||
|
+ (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_TRACEPOINT | _TIF_SYSCALL_AUDIT | \
|
||||||
|
+ _TIF_SECCOMP )
|
||||||
|
|
||||||
|
#endif /* _ASM_RISCV_THREAD_INFO_H */
|
||||||
|
diff --git a/arch/riscv/kernel/entry.S b/arch/riscv/kernel/entry.S
|
||||||
|
index bc7a56e1ca6f..0bbedfa3e47d 100644
|
||||||
|
--- a/arch/riscv/kernel/entry.S
|
||||||
|
+++ b/arch/riscv/kernel/entry.S
|
||||||
|
@@ -203,8 +203,25 @@ check_syscall_nr:
|
||||||
|
/* Check to make sure we don't jump to a bogus syscall number. */
|
||||||
|
li t0, __NR_syscalls
|
||||||
|
la s0, sys_ni_syscall
|
||||||
|
- /* Syscall number held in a7 */
|
||||||
|
- bgeu a7, t0, 1f
|
||||||
|
+ /*
|
||||||
|
+ * The tracer can change syscall number to valid/invalid value.
|
||||||
|
+ * We use syscall_set_nr helper in syscall_trace_enter thus we
|
||||||
|
+ * cannot trust the current value in a7 and have to reload from
|
||||||
|
+ * the current task pt_regs.
|
||||||
|
+ */
|
||||||
|
+ REG_L a7, PT_A7(sp)
|
||||||
|
+ /*
|
||||||
|
+ * Syscall number held in a7.
|
||||||
|
+ * If syscall number is above allowed value, redirect to ni_syscall.
|
||||||
|
+ */
|
||||||
|
+ bge a7, t0, 1f
|
||||||
|
+ /*
|
||||||
|
+ * Check if syscall is rejected by tracer or seccomp, i.e., a7 == -1.
|
||||||
|
+ * If yes, we pretend it was executed.
|
||||||
|
+ */
|
||||||
|
+ li t1, -1
|
||||||
|
+ beq a7, t1, ret_from_syscall_rejected
|
||||||
|
+ /* Call syscall */
|
||||||
|
la s0, sys_call_table
|
||||||
|
slli t0, a7, RISCV_LGPTR
|
||||||
|
add s0, s0, t0
|
||||||
|
@@ -215,6 +232,12 @@ check_syscall_nr:
|
||||||
|
ret_from_syscall:
|
||||||
|
/* Set user a0 to kernel a0 */
|
||||||
|
REG_S a0, PT_A0(sp)
|
||||||
|
+ /*
|
||||||
|
+ * We didn't execute the actual syscall.
|
||||||
|
+ * Seccomp already set return value for the current task pt_regs.
|
||||||
|
+ * (If it was configured with SECCOMP_RET_ERRNO/TRACE)
|
||||||
|
+ */
|
||||||
|
+ret_from_syscall_rejected:
|
||||||
|
/* Trace syscalls, but only if requested by the user. */
|
||||||
|
REG_L t0, TASK_TI_FLAGS(tp)
|
||||||
|
andi t0, t0, _TIF_SYSCALL_WORK
|
||||||
|
diff --git a/arch/riscv/kernel/ptrace.c b/arch/riscv/kernel/ptrace.c
|
||||||
|
index 368751438366..63e47c9f85f0 100644
|
||||||
|
--- a/arch/riscv/kernel/ptrace.c
|
||||||
|
+++ b/arch/riscv/kernel/ptrace.c
|
||||||
|
@@ -154,6 +154,16 @@ void do_syscall_trace_enter(struct pt_regs *regs)
|
||||||
|
if (tracehook_report_syscall_entry(regs))
|
||||||
|
syscall_set_nr(current, regs, -1);
|
||||||
|
|
||||||
|
+ /*
|
||||||
|
+ * Do the secure computing after ptrace; failures should be fast.
|
||||||
|
+ * If this fails we might have return value in a0 from seccomp
|
||||||
|
+ * (via SECCOMP_RET_ERRNO/TRACE).
|
||||||
|
+ */
|
||||||
|
+ if (secure_computing(NULL) == -1) {
|
||||||
|
+ syscall_set_nr(current, regs, -1);
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
#ifdef CONFIG_HAVE_SYSCALL_TRACEPOINTS
|
||||||
|
if (test_thread_flag(TIF_SYSCALL_TRACEPOINT))
|
||||||
|
trace_sys_enter(regs, syscall_get_nr(current, regs));
|
||||||
|
diff --git a/tools/testing/selftests/seccomp/seccomp_bpf.c b/tools/testing/selftests/seccomp/seccomp_bpf.c
|
||||||
|
index dc66fe852768..e30864b25fb5 100644
|
||||||
|
--- a/tools/testing/selftests/seccomp/seccomp_bpf.c
|
||||||
|
+++ b/tools/testing/selftests/seccomp/seccomp_bpf.c
|
||||||
|
@@ -112,6 +112,8 @@ struct seccomp_data {
|
||||||
|
# define __NR_seccomp 383
|
||||||
|
# elif defined(__aarch64__)
|
||||||
|
# define __NR_seccomp 277
|
||||||
|
+# elif defined(__riscv)
|
||||||
|
+# define __NR_seccomp 277
|
||||||
|
# elif defined(__hppa__)
|
||||||
|
# define __NR_seccomp 338
|
||||||
|
# elif defined(__powerpc__)
|
||||||
|
@@ -1582,6 +1584,10 @@ TEST_F(TRACE_poke, getpid_runs_normally)
|
||||||
|
# define ARCH_REGS struct user_pt_regs
|
||||||
|
# define SYSCALL_NUM regs[8]
|
||||||
|
# define SYSCALL_RET regs[0]
|
||||||
|
+#elif defined(__riscv) && __riscv_xlen == 64
|
||||||
|
+# define ARCH_REGS struct user_regs_struct
|
||||||
|
+# define SYSCALL_NUM a7
|
||||||
|
+# define SYSCALL_RET a0
|
||||||
|
#elif defined(__hppa__)
|
||||||
|
# define ARCH_REGS struct user_regs_struct
|
||||||
|
# define SYSCALL_NUM gr[20]
|
||||||
|
@@ -1671,7 +1677,7 @@ void change_syscall(struct __test_metadata *_metadata,
|
||||||
|
EXPECT_EQ(0, ret) {}
|
||||||
|
|
||||||
|
#if defined(__x86_64__) || defined(__i386__) || defined(__powerpc__) || \
|
||||||
|
- defined(__s390__) || defined(__hppa__)
|
||||||
|
+ defined(__s390__) || defined(__hppa__) || defined(__riscv)
|
||||||
|
{
|
||||||
|
regs.SYSCALL_NUM = syscall;
|
||||||
|
}
|
||||||
|
--
|
||||||
|
2.21.0
|
||||||
|
|
|
@ -0,0 +1,92 @@
|
||||||
|
From af4e1c5eca95bed1192d8dc45c8ed63aea2209e8 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Marcel Bocu <marcel.p.bocu@gmail.com>
|
||||||
|
Date: Mon, 22 Jul 2019 20:45:10 +0300
|
||||||
|
Subject: [PATCH] x86/amd_nb: Add PCI device IDs for family 17h, model 70h
|
||||||
|
|
||||||
|
The AMD Ryzen gen 3 processors came with a different PCI IDs for the
|
||||||
|
function 3 & 4 which are used to access the SMN interface. The root
|
||||||
|
PCI address however remained at the same address as the model 30h.
|
||||||
|
|
||||||
|
Adding the F3/F4 PCI IDs respectively to the misc and link ids appear
|
||||||
|
to be sufficient for k10temp, so let's add them and follow up on the
|
||||||
|
patch if other functions need more tweaking.
|
||||||
|
|
||||||
|
Vicki Pfau sent an identical patch after I checked that no-one had
|
||||||
|
written this patch. I would have been happy about dropping my patch but
|
||||||
|
unlike for his patch series, I had already Cc:ed the x86 people and
|
||||||
|
they already reviewed the changes. Since Vicki has not answered to
|
||||||
|
any email after his initial series, let's assume she is on vacation
|
||||||
|
and let's avoid duplication of reviews from the maintainers and merge
|
||||||
|
my series. To acknowledge Vicki's anteriority, I added her S-o-b to
|
||||||
|
the patch.
|
||||||
|
|
||||||
|
v2, suggested by Guenter Roeck and Brian Woods:
|
||||||
|
- rename from 71h to 70h
|
||||||
|
|
||||||
|
Signed-off-by: Vicki Pfau <vi@endrift.com>
|
||||||
|
Signed-off-by: Marcel Bocu <marcel.p.bocu@gmail.com>
|
||||||
|
Tested-by: Marcel Bocu <marcel.p.bocu@gmail.com>
|
||||||
|
Acked-by: Thomas Gleixner <tglx@linutronix.de>
|
||||||
|
Acked-by: Brian Woods <brian.woods@amd.com>
|
||||||
|
Acked-by: Bjorn Helgaas <bhelgaas@google.com> # pci_ids.h
|
||||||
|
|
||||||
|
Cc: Thomas Gleixner <tglx@linutronix.de>
|
||||||
|
Cc: Ingo Molnar <mingo@redhat.com>
|
||||||
|
Cc: Borislav Petkov <bp@alien8.de>
|
||||||
|
Cc: "H. Peter Anvin" <hpa@zytor.com>
|
||||||
|
Cc: x86@kernel.org
|
||||||
|
Cc: "Woods, Brian" <Brian.Woods@amd.com>
|
||||||
|
Cc: Clemens Ladisch <clemens@ladisch.de>
|
||||||
|
Cc: Jean Delvare <jdelvare@suse.com>
|
||||||
|
Cc: Guenter Roeck <linux@roeck-us.net>
|
||||||
|
Cc: linux-hwmon@vger.kernel.org
|
||||||
|
Link: https://lore.kernel.org/r/20190722174510.2179-1-marcel.p.bocu@gmail.com
|
||||||
|
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
|
||||||
|
---
|
||||||
|
arch/x86/kernel/amd_nb.c | 3 +++
|
||||||
|
include/linux/pci_ids.h | 1 +
|
||||||
|
2 files changed, 4 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/arch/x86/kernel/amd_nb.c b/arch/x86/kernel/amd_nb.c
|
||||||
|
index d63e63b7d1d9..251c795b4eb3 100644
|
||||||
|
--- a/arch/x86/kernel/amd_nb.c
|
||||||
|
+++ b/arch/x86/kernel/amd_nb.c
|
||||||
|
@@ -21,6 +21,7 @@
|
||||||
|
#define PCI_DEVICE_ID_AMD_17H_DF_F4 0x1464
|
||||||
|
#define PCI_DEVICE_ID_AMD_17H_M10H_DF_F4 0x15ec
|
||||||
|
#define PCI_DEVICE_ID_AMD_17H_M30H_DF_F4 0x1494
|
||||||
|
+#define PCI_DEVICE_ID_AMD_17H_M70H_DF_F4 0x1444
|
||||||
|
|
||||||
|
/* Protect the PCI config register pairs used for SMN and DF indirect access. */
|
||||||
|
static DEFINE_MUTEX(smn_mutex);
|
||||||
|
@@ -50,6 +51,7 @@ const struct pci_device_id amd_nb_misc_ids[] = {
|
||||||
|
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M10H_DF_F3) },
|
||||||
|
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M30H_DF_F3) },
|
||||||
|
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_CNB17H_F3) },
|
||||||
|
+ { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M70H_DF_F3) },
|
||||||
|
{}
|
||||||
|
};
|
||||||
|
EXPORT_SYMBOL_GPL(amd_nb_misc_ids);
|
||||||
|
@@ -63,6 +65,7 @@ static const struct pci_device_id amd_nb_link_ids[] = {
|
||||||
|
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_DF_F4) },
|
||||||
|
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M10H_DF_F4) },
|
||||||
|
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M30H_DF_F4) },
|
||||||
|
+ { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M70H_DF_F4) },
|
||||||
|
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_CNB17H_F4) },
|
||||||
|
{}
|
||||||
|
};
|
||||||
|
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
|
||||||
|
index c842735a4f45..4b97f427cc92 100644
|
||||||
|
--- a/include/linux/pci_ids.h
|
||||||
|
+++ b/include/linux/pci_ids.h
|
||||||
|
@@ -548,6 +548,7 @@
|
||||||
|
#define PCI_DEVICE_ID_AMD_17H_DF_F3 0x1463
|
||||||
|
#define PCI_DEVICE_ID_AMD_17H_M10H_DF_F3 0x15eb
|
||||||
|
#define PCI_DEVICE_ID_AMD_17H_M30H_DF_F3 0x1493
|
||||||
|
+#define PCI_DEVICE_ID_AMD_17H_M70H_DF_F3 0x1443
|
||||||
|
#define PCI_DEVICE_ID_AMD_CNB17H_F3 0x1703
|
||||||
|
#define PCI_DEVICE_ID_AMD_LANCE 0x2000
|
||||||
|
#define PCI_DEVICE_ID_AMD_LANCE_HOME 0x2001
|
||||||
|
--
|
||||||
|
2.21.0
|
||||||
|
|
|
@ -0,0 +1,140 @@
|
||||||
|
From 8d741d97eeb3a0c1b9aa09da15fbb1c5c7214fcd Mon Sep 17 00:00:00 2001
|
||||||
|
From: Fedora Kernel Team <kernel-team@fedoraproject.org>
|
||||||
|
Date: Sun, 25 Aug 2019 06:58:34 +0000
|
||||||
|
Subject: [PATCH 2/2] SiFive Unleashed CPUFreq
|
||||||
|
|
||||||
|
Signed-off-by: Fedora Kernel Team <kernel-team@fedoraproject.org>
|
||||||
|
---
|
||||||
|
arch/riscv/Kconfig | 8 +++++
|
||||||
|
arch/riscv/boot/dts/sifive/fu540-c000.dtsi | 5 +++
|
||||||
|
.../boot/dts/sifive/hifive-unleashed-a00.dts | 34 +++++++++++++++++++
|
||||||
|
arch/riscv/configs/defconfig | 5 +++
|
||||||
|
4 files changed, 52 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
|
||||||
|
index 441e63f..ccd590c 100644
|
||||||
|
--- a/arch/riscv/Kconfig
|
||||||
|
+++ b/arch/riscv/Kconfig
|
||||||
|
@@ -298,6 +298,14 @@ endchoice
|
||||||
|
|
||||||
|
endmenu
|
||||||
|
|
||||||
|
+menu "CPU Power Management"
|
||||||
|
+
|
||||||
|
+source "drivers/cpuidle/Kconfig"
|
||||||
|
+
|
||||||
|
+source "drivers/cpufreq/Kconfig"
|
||||||
|
+
|
||||||
|
+endmenu
|
||||||
|
+
|
||||||
|
menu "Power management options"
|
||||||
|
|
||||||
|
source "kernel/power/Kconfig"
|
||||||
|
diff --git a/arch/riscv/boot/dts/sifive/fu540-c000.dtsi b/arch/riscv/boot/dts/sifive/fu540-c000.dtsi
|
||||||
|
index 42b5ec2..b07079f 100644
|
||||||
|
--- a/arch/riscv/boot/dts/sifive/fu540-c000.dtsi
|
||||||
|
+++ b/arch/riscv/boot/dts/sifive/fu540-c000.dtsi
|
||||||
|
@@ -29,6 +29,7 @@
|
||||||
|
i-cache-size = <16384>;
|
||||||
|
reg = <0>;
|
||||||
|
riscv,isa = "rv64imac";
|
||||||
|
+ clocks = <&prci PRCI_CLK_COREPLL>;
|
||||||
|
status = "disabled";
|
||||||
|
cpu0_intc: interrupt-controller {
|
||||||
|
#interrupt-cells = <1>;
|
||||||
|
@@ -53,6 +54,7 @@
|
||||||
|
reg = <1>;
|
||||||
|
riscv,isa = "rv64imafdc";
|
||||||
|
tlb-split;
|
||||||
|
+ clocks = <&prci PRCI_CLK_COREPLL>;
|
||||||
|
cpu1_intc: interrupt-controller {
|
||||||
|
#interrupt-cells = <1>;
|
||||||
|
compatible = "riscv,cpu-intc";
|
||||||
|
@@ -77,6 +79,7 @@
|
||||||
|
reg = <2>;
|
||||||
|
riscv,isa = "rv64imafdc";
|
||||||
|
tlb-split;
|
||||||
|
+ clocks = <&prci PRCI_CLK_COREPLL>;
|
||||||
|
cpu2_intc: interrupt-controller {
|
||||||
|
#interrupt-cells = <1>;
|
||||||
|
compatible = "riscv,cpu-intc";
|
||||||
|
@@ -101,6 +104,7 @@
|
||||||
|
reg = <3>;
|
||||||
|
riscv,isa = "rv64imafdc";
|
||||||
|
tlb-split;
|
||||||
|
+ clocks = <&prci PRCI_CLK_COREPLL>;
|
||||||
|
cpu3_intc: interrupt-controller {
|
||||||
|
#interrupt-cells = <1>;
|
||||||
|
compatible = "riscv,cpu-intc";
|
||||||
|
@@ -125,6 +129,7 @@
|
||||||
|
reg = <4>;
|
||||||
|
riscv,isa = "rv64imafdc";
|
||||||
|
tlb-split;
|
||||||
|
+ clocks = <&prci PRCI_CLK_COREPLL>;
|
||||||
|
cpu4_intc: interrupt-controller {
|
||||||
|
#interrupt-cells = <1>;
|
||||||
|
compatible = "riscv,cpu-intc";
|
||||||
|
diff --git a/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts b/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts
|
||||||
|
index 54fc701..5b43bdf 100644
|
||||||
|
--- a/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts
|
||||||
|
+++ b/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts
|
||||||
|
@@ -40,6 +40,40 @@
|
||||||
|
clock-frequency = <RTCCLK_FREQ>;
|
||||||
|
clock-output-names = "rtcclk";
|
||||||
|
};
|
||||||
|
+
|
||||||
|
+ fu540_c000_opp_table: opp-table {
|
||||||
|
+ compatible = "operating-points-v2";
|
||||||
|
+ opp-shared;
|
||||||
|
+
|
||||||
|
+ opp-350000000 {
|
||||||
|
+ opp-hz = /bits/ 64 <350000000>;
|
||||||
|
+ };
|
||||||
|
+ opp-700000000 {
|
||||||
|
+ opp-hz = /bits/ 64 <700000000>;
|
||||||
|
+ };
|
||||||
|
+ opp-999999999 {
|
||||||
|
+ opp-hz = /bits/ 64 <999999999>;
|
||||||
|
+ };
|
||||||
|
+ opp-1400000000 {
|
||||||
|
+ opp-hz = /bits/ 64 <1400000000>;
|
||||||
|
+ };
|
||||||
|
+ };
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+&cpu0 {
|
||||||
|
+ operating-points-v2 = <&fu540_c000_opp_table>;
|
||||||
|
+};
|
||||||
|
+&cpu1 {
|
||||||
|
+ operating-points-v2 = <&fu540_c000_opp_table>;
|
||||||
|
+};
|
||||||
|
+&cpu2 {
|
||||||
|
+ operating-points-v2 = <&fu540_c000_opp_table>;
|
||||||
|
+};
|
||||||
|
+&cpu3 {
|
||||||
|
+ operating-points-v2 = <&fu540_c000_opp_table>;
|
||||||
|
+};
|
||||||
|
+&cpu4 {
|
||||||
|
+ operating-points-v2 = <&fu540_c000_opp_table>;
|
||||||
|
};
|
||||||
|
|
||||||
|
&uart0 {
|
||||||
|
diff --git a/arch/riscv/configs/defconfig b/arch/riscv/configs/defconfig
|
||||||
|
index 3efff55..c9542a9 100644
|
||||||
|
--- a/arch/riscv/configs/defconfig
|
||||||
|
+++ b/arch/riscv/configs/defconfig
|
||||||
|
@@ -16,6 +16,11 @@ CONFIG_EXPERT=y
|
||||||
|
CONFIG_BPF_SYSCALL=y
|
||||||
|
CONFIG_SOC_SIFIVE=y
|
||||||
|
CONFIG_SMP=y
|
||||||
|
+CONFIG_CPU_IDLE=y
|
||||||
|
+CONFIG_CPU_FREQ=y
|
||||||
|
+CONFIG_CPU_FREQ_STAT=y
|
||||||
|
+CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
|
||||||
|
+CONFIG_CPUFREQ_DT=y
|
||||||
|
CONFIG_MODULES=y
|
||||||
|
CONFIG_MODULE_UNLOAD=y
|
||||||
|
CONFIG_NET=y
|
||||||
|
--
|
||||||
|
2.23.0
|
||||||
|
|
|
@ -81,6 +81,8 @@ function merge_configs()
|
||||||
echo "# arm64" > $name
|
echo "# arm64" > $name
|
||||||
elif [ "x$arch" == "xppc64le" ]; then
|
elif [ "x$arch" == "xppc64le" ]; then
|
||||||
echo "# powerpc" > $name
|
echo "# powerpc" > $name
|
||||||
|
elif [ "x$arch" == "xriscv64" ]; then
|
||||||
|
echo "# riscv" > $name
|
||||||
elif [ "x$arch" == "xs390x" ]; then
|
elif [ "x$arch" == "xs390x" ]; then
|
||||||
echo "# s390" > $name
|
echo "# s390" > $name
|
||||||
elif [ "x$arch" == "xarmv7hl" ]; then
|
elif [ "x$arch" == "xarmv7hl" ]; then
|
||||||
|
|
|
@ -28,6 +28,10 @@ s390x-debug=generic:generic-s390x:debug
|
||||||
aarch64=generic:generic-arm:generic-arm-aarch64
|
aarch64=generic:generic-arm:generic-arm-aarch64
|
||||||
aarch64-debug=generic:generic-arm:generic-arm-aarch64:debug:debug-arm
|
aarch64-debug=generic:generic-arm:generic-arm-aarch64:debug:debug-arm
|
||||||
|
|
||||||
|
# riscv64
|
||||||
|
riscv64=generic:generic-riscv:generic-riscv-riscv64
|
||||||
|
riscv64-debug=generic:generic-riscv:generic-riscv-riscv64:debug
|
||||||
|
|
||||||
# arm
|
# arm
|
||||||
armv7hl=generic:generic-arm:generic-arm-armv7:generic-arm-armv7-armv7
|
armv7hl=generic:generic-arm:generic-arm-armv7:generic-arm-armv7-armv7
|
||||||
armv7hl-debug=generic:generic-arm:generic-arm-armv7:generic-arm-armv7-armv7:debug:debug-arm
|
armv7hl-debug=generic:generic-arm:generic-arm-armv7:generic-arm-armv7-armv7:debug:debug-arm
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
# CONFIG_ARM_TIMER_SP804 is not set
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_NETFILTER_XT_TARGET_MASQUERADE=m
|
|
@ -0,0 +1 @@
|
||||||
|
# CONFIG_ARCH_RV32I is not set
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_AUTOFS4_FS=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_BLK_DEV=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_BLK_DEV_BSG=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_BLK_DEV_DM=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_BLK_DEV_DM_BUILTIN=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_BLK_DEV_LOOP=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_BLK_DEV_NBD=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_BRIDGE=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_BTRFS_FS_POSIX_ACL=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_CFS_BANDWIDTH=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_CGROUPS=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_CGROUP_SCHED=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_CHECKPOINT_RESTORE=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_CLK_SIFIVE=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_CLK_SIFIVE_FU540_PRCI=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_CMDLINE=""
|
|
@ -0,0 +1 @@
|
||||||
|
# CONFIG_CMDLINE_BOOL is not set
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_CMODEL_MEDANY=y
|
|
@ -0,0 +1 @@
|
||||||
|
# CONFIG_CMODEL_MEDLOW is not set
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_CPUFREQ_DT=y
|
|
@ -0,0 +1 @@
|
||||||
|
# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_CRYPTO_USER=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_CRYPTO_USER_API=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_CRYPTO_USER_API_AEAD=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_CRYPTO_USER_API_HASH=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_CRYPTO_USER_API_RNG=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_CRYPTO_USER_API_SKCIPHER=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_DEVPTS_MULTIPLE_INSTANCES=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_DEVTMPFS=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_DMIID=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_DM_BIO_PRISON=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_DM_BUFIO=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_DM_CACHE=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_DM_CACHE_SMQ=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_DM_CRYPT=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_DM_DEBUG=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_DM_DEBUG_BLOCK_MANAGER_LOCKING=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_DM_DELAY=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_DM_FLAKEY=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_DM_INTEGRITY=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_DM_LOG_USERSPACE=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_DM_LOG_WRITES=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_DM_MIRROR=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_DM_MULTIPATH=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_DM_MULTIPATH_QL=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_DM_MULTIPATH_ST=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_DM_PERSISTENT_DATA=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_DM_RAID=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_DM_SNAPSHOT=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_DM_SWITCH=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_DM_THIN_PROVISIONING=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_DM_UEVENT=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_DM_UNSTRIPED=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_DM_VERITY=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_DM_VERITY_FEC=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_DM_ZERO=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_DM_ZONED=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_DNS_RESOLVER=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_DRM_PANEL=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_DRM_VIRTIO_GPU=m
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_EDAC_SIFIVE=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_EFIVAR_FS=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_EFI_PARTITION=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_EPOLL=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_EXT4_FS=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_EXT4_FS_SECURITY=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_EXT4_POSIX_ACL=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_FAILOVER=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_FAIR_GROUP_SCHED=y
|
|
@ -0,0 +1 @@
|
||||||
|
# CONFIG_FB_SSD1307 is not set
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_FHANDLE=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_FILE_LOCKING=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_FPU=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_FRAME_WARN=2048
|
|
@ -0,0 +1 @@
|
||||||
|
# CONFIG_FW_LOADER_USER_HELPER is not set
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_GENERIC_PHY=y
|
|
@ -0,0 +1 @@
|
||||||
|
# CONFIG_GPIO_74XX_MMIO is not set
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_HOTPLUG_PCI=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_HOTPLUG_PCI_PCIE=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_HVC_RISCV_SBI=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_I2C_MUX=m
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_INET=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_INOTIFY_USER=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_INPUT_MATRIXKMAP=m
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_IP6_NF_FILTER=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_IP6_NF_IPTABLES=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_IP6_NF_MANGLE=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_IP6_NF_NAT=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_IP6_NF_RAW=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_IP6_NF_TARGET_REJECT=y
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_IPV6=y
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue