lkml.org 
[lkml]   [2015]   [Aug]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v10 10/20] x86/reboot: Add ljmp instructions to stackvalidate whitelist
Date
stackvalidate reports a false positive warning for the ljmp instruction
in machine_real_restart(). Normally, ljmp isn't allowed in a function,
but this is a special case where it's jumping into real mode.

Add the jumps to a whitelist which tells stackvalidate to ignore them.

Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
---
arch/x86/kernel/reboot.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
index 86db4bc..0931d87 100644
--- a/arch/x86/kernel/reboot.c
+++ b/arch/x86/kernel/reboot.c
@@ -9,6 +9,7 @@
#include <linux/sched.h>
#include <linux/tboot.h>
#include <linux/delay.h>
+#include <linux/stackvalidate.h>
#include <acpi/reboot.h>
#include <asm/io.h>
#include <asm/apic.h>
@@ -97,11 +98,13 @@ void __noreturn machine_real_restart(unsigned int type)

/* Jump to the identity-mapped low memory code */
#ifdef CONFIG_X86_32
- asm volatile("jmpl *%0" : :
+ asm volatile(STACKVALIDATE_IGNORE_INSN
+ "jmpl *%0;" : :
"rm" (real_mode_header->machine_real_restart_asm),
"a" (type));
#else
- asm volatile("ljmpl *%0" : :
+ asm volatile(STACKVALIDATE_IGNORE_INSN
+ "ljmpl *%0" : :
"m" (real_mode_header->machine_real_restart_asm),
"D" (type));
#endif
--
2.4.3


\
 
 \ /
  Last update: 2015-08-14 05:41    [W:0.150 / U:2.572 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site