aboutsummaryrefslogtreecommitdiff
path: root/arch/riscv/kernel
AgeCommit message (Collapse)AuthorFilesLines
2017-12-11RISC-V: Remove unused CONFIG_HVC_RISCV_SBI codePalmer Dabbelt1-11/+0
This is code that probably should never have made it into the kernel in the first place: it depends on a driver that hadn't been reviewed yet. During the HVC_SBI_RISCV review process a better way of doing this was suggested, but that means this code is defunct. It's compile-time disabled in 4.15 because the driver isn't in, so I think it's safe to just remove this for now. CC: Greg KH <[email protected]> Signed-off-by: Palmer Dabbelt <[email protected]>
2017-12-11RISC-V: Logical vs Bitwise typoDan Carpenter1-1/+1
In the current code, there is a ! logical NOT where a bitwise ~ NOT was intended. It means that we never return -EINVAL. Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Palmer Dabbelt <[email protected]>
2017-12-04riscv: use linux/uaccess.h, not asm/uaccess.h...Al Viro1-1/+1
Signed-off-by: Al Viro <[email protected]>
2017-12-01RISC-V: Fixes for clean allmodconfig buildPalmer Dabbelt4-3/+15
Olaf said: Here's a short series of patches that produces a working allmodconfig. Would be nice to see them go in so we can add build coverage. I've dropped patches 8 and 10 from the original set: * [PATCH 08/10] (RISC-V: Set __ARCH_WANT_RENAMEAT to pick up generic version) has a better fix that I've sent out for review, we don't want renameat. * [PATCH 10/10] (input: joystick: riscv has get_cycles) has already been taken into Dmitry Torokhov's tree.
2017-11-30RISC-V: Clean up an unused includePalmer Dabbelt1-1/+0
We used to have some cmpxchg syscalls. They're no longer there, so we no longer need the include. CC: Christoph Hellwig <[email protected]> Signed-off-by: Palmer Dabbelt <[email protected]>
2017-11-30RISC-V: Allow userspace to flush the instruction cacheAndrew Waterman5-0/+67
Despite RISC-V having a direct 'fence.i' instruction available to userspace (which we can't trap!), that's not actually viable when running on Linux because the kernel might schedule a process on another hart. There is no way for userspace to handle this without invoking the kernel (as it doesn't know the thread->hart mappings), so we've defined a RISC-V specific system call to flush the instruction cache. This patch adds both a system call and a VDSO entry. If possible, we'd like to avoid having the system call be considered part of the user-facing ABI and instead restrict that to the VDSO entry -- both just in general to avoid having additional user-visible ABI to maintain, and because we'd prefer that users just call the VDSO entry because there might be a better way to do this in the future (ie, one that doesn't require entering the kernel). Signed-off-by: Andrew Waterman <[email protected]> Signed-off-by: Palmer Dabbelt <[email protected]>
2017-11-30RISC-V: Flush I$ when making a dirty page executableAndrew Waterman1-0/+48
The RISC-V ISA allows for instruction caches that are not coherent WRT stores, even on a single hart. As a result, we need to explicitly flush the instruction cache whenever marking a dirty page as executable in order to preserve the correct system behavior. Local instruction caches aren't that scary (our implementations actually flush the cache, but RISC-V is defined to allow higher-performance implementations to exist), but RISC-V defines no way to perform an instruction cache shootdown. When explicitly asked to do so we can shoot down remote instruction caches via an IPI, but this is a bit on the slow side. Instead of requiring an IPI to all harts whenever marking a page as executable, we simply flush the currently running harts. In order to maintain correct behavior, we additionally mark every other hart as needing a deferred instruction cache which will be taken before anything runs on it. Signed-off-by: Andrew Waterman <[email protected]> Signed-off-by: Palmer Dabbelt <[email protected]>
2017-11-30RISC-V: Provide stub of setup_profiling_timer()Olof Johansson1-0/+7
Fixes the following on allmodconfig build: profile.c:(.text+0x3e4): undefined reference to `setup_profiling_timer' Signed-off-by: Olof Johansson <[email protected]> Signed-off-by: Palmer Dabbelt <[email protected]>
2017-11-30RISC-V: Export some expected symbols for modulesOlof Johansson2-0/+5
These are the ones needed by current allmodconfig, so add them instead of everything other architectures are exporting -- the rest can be added on demand later if needed. Signed-off-by: Olof Johansson <[email protected]> Signed-off-by: Palmer Dabbelt <[email protected]>
2017-11-30RISC-V: move empty_zero_page definition to C and export itOlof Johansson2-3/+3
Needed by some modules (exported by other architectures). Signed-off-by: Olof Johansson <[email protected]> Signed-off-by: Palmer Dabbelt <[email protected]>
2017-11-27RISC-V: Add VDSO entries for clock_get/gettimeofday/getcpuAndrew Waterman6-1/+113
For now these are just placeholders that execute the syscall. We will later optimize them to avoid kernel crossings, but we'd like to have the VDSO entries from the first released kernel version to make the ABI simpler. Signed-off-by: Andrew Waterman <[email protected]> Signed-off-by: Palmer Dabbelt <[email protected]>
2017-11-27RISC-V: Remove __vdso_cmpxchg{32,64} symbol versionsPalmer Dabbelt1-2/+0
These were left over from an earlier version of the port. Signed-off-by: Palmer Dabbelt <[email protected]>
2017-09-26RISC-V: Build InfrastructurePalmer Dabbelt3-0/+126
This patch contains all the build infrastructure that actually enables the RISC-V port. This includes Makefiles, linker scripts, and Kconfig files. It also contains the only top-level change, which adds RISC-V to the list of architectures that need a sed run to produce the ARCH variable when building locally. Signed-off-by: Palmer Dabbelt <[email protected]>
2017-09-26RISC-V: User-facing APIPalmer Dabbelt12-0/+977
This patch contains code that is in some way visible to the user: including via system calls, the VDSO, module loading and signal handling. It also contains some generic code that is ABI visible. Signed-off-by: Palmer Dabbelt <[email protected]>
2017-09-26RISC-V: Task implementationPalmer Dabbelt3-0/+915
This patch contains the implementation of tasks on RISC-V, most of which is involved in task switching. Signed-off-by: Palmer Dabbelt <[email protected]>
2017-09-26RISC-V: Generic library routines and assemblyPalmer Dabbelt1-0/+177
This patch contains code that is more specific to the RISC-V ISA than it is to Linux. It contains string and math operations, C wrappers for various assembly instructions, stack walking code, and uaccess. Signed-off-by: Palmer Dabbelt <[email protected]>
2017-09-26RISC-V: Init and Halt CodePalmer Dabbelt11-0/+1292
This contains the various __init C functions, the initial assembly kernel entry point, and the code to reset the system. When a file was init-related this patch contains the entire file. Signed-off-by: Palmer Dabbelt <[email protected]>