Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save satoru-takeuchi/687fb72c65c65e4896cc8836ae24d4c4 to your computer and use it in GitHub Desktop.
Save satoru-takeuchi/687fb72c65c65e4896cc8836ae24d4c4 to your computer and use it in GitHub Desktop.
Subject: [RFC] [PATCH] workaround for Ryzen random SEGV problem
Limit the range of the virtual address map for user process, from 47 bit (128TB)
to 46 bit (64TB). It prevent processes to high memory address which would
cause random semgentation fault and some other problems on Ryzen.
For more detaul, please see the following links for detail.
The discussions about this problem on AMD support community.
https://community.amd.com/thread/215773
FreeBSD's workaround patch.
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=219399#c89
Signed-off-by: Satoru Takeuchi <[email protected]>
---
I confirmed v4.12.4 with this patch can boot successfully..
---
arch/x86/include/asm/processor.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
index a28b671..b5ebc919 100644
--- a/arch/x86/include/asm/processor.h
+++ b/arch/x86/include/asm/processor.h
@@ -834,7 +834,7 @@ static inline void spin_lock_prefetch(const void *x)
* particular problem by preventing anything from being mapped
* at the maximum canonical address.
*/
-#define TASK_SIZE_MAX ((1UL << 47) - PAGE_SIZE)
+#define TASK_SIZE_MAX ((1UL << 47) - (1UL << 46))
/* This decides where the kernel will search for a free chunk of vm
* space during mmap's.
--
2.7.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment