Skip to content

Instantly share code, notes, and snippets.

View tpruzina's full-sized avatar

Tomáš Pružina tpruzina

View GitHub Profile
@tpruzina
tpruzina / gist:d30eb213b15e57b8158c5cf0bb528c1c
Created August 10, 2017 21:00
Radare2 automatic session store (.zshrc function)
# automatically calculates md5 of binary path and saves it as a name for project file
function r2()
{
BACKUP="$@"
MD5=""
NAME=""
while [[ "$#" -gt 0 ]]; do
if [ -f "$1" ]; then
NAME=$(realpath $1)
@tpruzina
tpruzina / gist:c4d9c0ca6bdbb6e78ab2126a7cdf8f1c
Last active May 10, 2017 08:09
NVIDIA-378.13-KERNEL-4.10.patch
diff -ur NVIDIA-Linux-x86_64-378.13/kernel/common/inc/nv-mm.h NVIDIA-Linux-x86_64-378.13.patched/kernel/common/inc/nv-mm.h
--- NVIDIA-Linux-x86_64-378.13/kernel/common/inc/nv-mm.h 2017-02-08 04:58:34.000000000 +0100
+++ NVIDIA-Linux-x86_64-378.13.patched/kernel/common/inc/nv-mm.h 2017-02-23 18:57:34.655592444 +0100
@@ -46,6 +46,8 @@
* 2016 Dec 14:5b56d49fc31dbb0487e14ead790fc81ca9fb2c99
*/
+#include <linux/version.h>
+
#if defined(NV_GET_USER_PAGES_REMOTE_PRESENT)
@tpruzina
tpruzina / gist:4a4aef53b266aa04606385b92ca6d042
Last active February 25, 2017 12:47
NVIDIA-378.13-KERNEL-4.10-stageing-7bb033829ef3ecfc491c0ed0197966e8f197fbdc.patch
diff -ur NVIDIA-Linux-x86_64-378.13/kernel/common/inc/nv-mm.h NVIDIA-Linux-x86_64-378.13.patched/kernel/common/inc/nv-mm.h
--- NVIDIA-Linux-x86_64-378.13/kernel/common/inc/nv-mm.h 2017-02-08 04:58:34.000000000 +0100
+++ NVIDIA-Linux-x86_64-378.13.patched/kernel/common/inc/nv-mm.h 2017-02-24 21:38:54.126260185 +0100
@@ -46,6 +46,8 @@
* 2016 Dec 14:5b56d49fc31dbb0487e14ead790fc81ca9fb2c99
*/
+#include <linux/version.h>
+
#if defined(NV_GET_USER_PAGES_REMOTE_PRESENT)
@tpruzina
tpruzina / gist:3e36f7da0673c1bf4b421f53b8d99b02
Last active December 13, 2018 21:08
NVIDIA-Linux-x86_64-378.13-kernel-4.10-rc8.patch
diff -ur NVIDIA-Linux-x86_64-378.13/kernel/common/inc/nv-linux.h NVIDIA-Linux-x86_64-378.13.patched/kernel/common/inc/nv-linux.h
--- NVIDIA-Linux-x86_64-378.13/kernel/common/inc/nv-linux.h 2017-02-08 04:58:34.000000000 +0100
+++ NVIDIA-Linux-x86_64-378.13.patched/kernel/common/inc/nv-linux.h 2017-02-15 04:14:46.304110124 +0100
@@ -294,7 +294,8 @@
extern int nv_pat_mode;
-#if defined(CONFIG_HOTPLUG_CPU)
+//#if defined(CONFIG_HOTPLUG_CPU)
+#if 0
diff -ur NVIDIA-Linux-x86_64-378.09/kernel/common/inc/nv-linux.h NVIDIA-Linux-x86_64-378.09.patched/kernel/common/inc/nv-linux.h
--- NVIDIA-Linux-x86_64-378.09/kernel/common/inc/nv-linux.h 2017-01-15 07:33:26.000000000 +0100
+++ NVIDIA-Linux-x86_64-378.09.patched/kernel/common/inc/nv-linux.h 2017-01-19 14:47:21.389272354 +0100
@@ -294,7 +294,8 @@
extern int nv_pat_mode;
-#if defined(CONFIG_HOTPLUG_CPU)
+//#if defined(CONFIG_HOTPLUG_CPU)
+#if 0
@tpruzina
tpruzina / gist:939ca3170d1aa48a601228b7773e2bb1
Created January 1, 2017 12:38
NVIDIA 375.26 Kernel 4.10-rc1 (w/ CPU hotplug workaround)
diff -ur NVIDIA-Linux-x86_64-375.26/kernel/common/inc/nv-linux.h NVIDIA-Linux-x86_64-375.26.patched/kernel/common/inc/nv-linux.h
--- NVIDIA-Linux-x86_64-375.26/kernel/common/inc/nv-linux.h 2016-12-09 02:17:49.000000000 +0100
+++ NVIDIA-Linux-x86_64-375.26.patched/kernel/common/inc/nv-linux.h 2016-12-31 10:55:17.637374373 +0100
@@ -294,7 +294,8 @@
extern int nv_pat_mode;
-#if defined(CONFIG_HOTPLUG_CPU)
+//#if defined(CONFIG_HOTPLUG_CPU)
+#if 0
@tpruzina
tpruzina / 370.20-4.9.0+-stageing50.patch
Created December 15, 2016 09:25 — forked from anonymous/370.20-4.9.0+-stageing50.patch
370.20-4.9.0+-stageing50.patch
diff -ur NVIDIA-Linux-x86_64-375.20/kernel/common/inc/nv-mm.h NVIDIA-Linux-x86_64-375.20-patched/kernel/common/inc/nv-mm.h
--- NVIDIA-Linux-x86_64-375.20/kernel/common/inc/nv-mm.h 2016-11-16 00:53:45.000000000 +0100
+++ NVIDIA-Linux-x86_64-375.20-patched/kernel/common/inc/nv-mm.h 2016-12-15 09:54:13.755753901 +0100
@@ -83,7 +83,7 @@
if (force)
flags |= FOLL_FORCE;
- return get_user_pages_remote(tsk, mm, start, nr_pages, flags, pages, vmas);
+ return get_user_pages_remote(tsk, mm, start, nr_pages, flags, pages, vmas, NULL);
}
@tpruzina
tpruzina / p6_nop.patch
Created December 13, 2016 02:50
P6_NOP_patch
diff --git a/arch/x86/Kconfig.cpu b/arch/x86/Kconfig.cpu
index a4bb92600b0a..e753d31e7fb4 100644
--- a/arch/x86/Kconfig.cpu
+++ b/arch/x86/Kconfig.cpu
@@ -319,6 +319,7 @@ config MPSC
config MATOM
bool "Intel Atom"
+ select X86_P6_NOP
---help---
diff --git a/arch/x86/Kconfig.cpu b/arch/x86/Kconfig.cpu
index a4bb92600b0a..e753d31e7fb4 100644
--- a/arch/x86/Kconfig.cpu
+++ b/arch/x86/Kconfig.cpu
@@ -319,6 +319,7 @@ config MPSC
config MATOM
bool "Intel Atom"
+ select X86_P6_NOP
---help---