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
/** | |
* v5.10.37 | |
* https://elixir.bootlin.com/linux/v5.10.37/source/mm/rmap.c#L1617 | |
*/ | |
/* | |
* @arg: enum ttu_flags will be passed to this argument | |
*/ | |
static bool try_to_unmap_one(struct page *page, struct vm_area_struct *vma, | |
unsigned long address, void *arg) |
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
make clean | |
make defconfig | |
sed -i 's/-O2/-Og/g' Makefile | |
make -j $(nproc) | |
make -j8 cscope tags | |
<< 'MULTILINE-COMMENT' | |
~/linux$ git diff | |
diff --git a/Makefile b/Makefile | |
index 18b4cebe5564..cd61d89aebfb 100644 |
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
~/qemu/build/qemu-system-riscv64 \ | |
-cpu sifive-u54 \ | |
-smp cpus=4,maxcpus=4 \ | |
-M virt \ | |
-m 4096 \ | |
-nographic \ | |
-no-reboot \ | |
-kernel ~/linux/arch/riscv/boot/Image \ | |
-append "root=/dev/vda rw console=ttyS0" \ | |
-drive file=~/busybox/root.bin,format=raw,id=hd0 \ |
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
#!/bin/bash | |
qemu-system-riscv64 -s -S \ | |
-cpu sifive-u54 \ | |
-smp cpus=4,maxcpus=4 \ | |
-M sifive_u \ | |
-m 4096 \ | |
-kernel arch/riscv/boot/Image \ | |
-bios none \ | |
-nographic \ |
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
export CFLAGS="-g -Wall -Wextra" | |
export ARCH=riscv | |
export CROSS_COMPILE=riscv64-linux-gnu- |
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
sudo apt -y install build-essential cscope universal-ctags curl \ | |
crossbuild-essential-riscv64 gdb-multiarch \ | |
autoconf automake autotools-dev gawk bison flex texinfo gperf libtool patchutils bc \ | |
libncurses-dev libssl-dev libmpc-dev libmpfr-dev libgmp-dev zlib1g-dev libexpat-dev | |
# sudo apt -y install qemu-system-misc # latest debian package too old (archived 2019 version) |
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
// Physical memory layout | |
// qemu -machine virt is set up like this, | |
// based on qemu's hw/riscv/virt.c: | |
// | |
// 00001000 -- boot ROM, provided by qemu | |
// 02000000 -- CLINT | |
// 0C000000 -- PLIC | |
// 10000000 -- uart0 | |
// 10001000 -- virtio disk |
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
#include <stdlib.h> | |
#include <stdio.h> | |
#include <math.h> | |
#include <string.h> | |
#define SEED 35791246 | |
int main(int argc, char* argv) { | |
int niter = 1UL << 20; | |
double x, y; |
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
<< 'MULTILINE-COMMENT' | |
sudo apt -y install git git-email ninja-build libglib2.0-dev libfdt-dev libpixman-1-dev zlib1g-dev \ | |
libaio-dev libbluetooth-dev libbrlapi-dev libbz2-dev \ | |
libcap-dev libcap-ng-dev libcurl4-gnutls-dev libgtk-3-dev \ | |
libibverbs-dev libjpeg8-dev libncurses5-dev libnuma-dev \ | |
librbd-dev librdmacm-dev \ | |
libsasl2-dev libsdl1.2-dev libseccomp-dev libsnappy-dev libssh2-1-dev \ | |
libvde-dev libvdeplug-dev libvte-dev libxen-dev liblzo2-dev \ | |
valgrind xfslibs-dev \ |
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
git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git | |
# git tag | grep v5.4.123 | |
# git checkout v5.4.123 |
OlderNewer