mirror of
https://github.com/genesi/linux-legacy.git
synced 2026-05-19 13:06:19 +00:00
[PATCH] uml: Fix sysrq-r support for skas mode
The old code had the IP and SP coming from the registers in the thread struct, which are completely wrong since those are the userspace registers. This fixes that by pulling the correct values from the jmp_buf in which the kernel state of each thread is stored. Signed-off-by: Allan Graves <allan.graves@oracle.com> Signed-off-by: Jeff Dike <jdike@addtoit.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
committed by
Linus Torvalds
parent
71dc036247
commit
fad1c45c93
@@ -13,6 +13,7 @@ struct task_struct;
|
||||
#include "linux/config.h"
|
||||
#include "asm/ptrace.h"
|
||||
#include "choose-mode.h"
|
||||
#include "registers.h"
|
||||
|
||||
struct mm_struct;
|
||||
|
||||
@@ -136,19 +137,15 @@ extern struct cpuinfo_um cpu_data[];
|
||||
#define current_cpu_data boot_cpu_data
|
||||
#endif
|
||||
|
||||
#define KSTK_EIP(tsk) (PT_REGS_IP(&tsk->thread.regs))
|
||||
#define KSTK_ESP(tsk) (PT_REGS_SP(&tsk->thread.regs))
|
||||
|
||||
#ifdef CONFIG_MODE_SKAS
|
||||
#define KSTK_REG(tsk, reg) \
|
||||
({ union uml_pt_regs regs; \
|
||||
get_thread_regs(®s, tsk->thread.mode.skas.switch_buf); \
|
||||
UPT_REG(®s, reg); })
|
||||
#else
|
||||
#define KSTK_REG(tsk, reg) (0xbadbabe)
|
||||
#endif
|
||||
#define get_wchan(p) (0)
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Overrides for Emacs so that we follow Linus's tabbing style.
|
||||
* Emacs will notice this stuff at the end of the file and automatically
|
||||
* adjust the settings for this buffer only. This must remain at the end
|
||||
* of the file.
|
||||
* ---------------------------------------------------------------------------
|
||||
* Local variables:
|
||||
* c-file-style: "linux"
|
||||
* End:
|
||||
*/
|
||||
|
||||
@@ -43,17 +43,10 @@ static inline void rep_nop(void)
|
||||
#define ARCH_IS_STACKGROW(address) \
|
||||
(address + 32 >= UPT_SP(¤t->thread.regs.regs))
|
||||
|
||||
#define KSTK_EIP(tsk) KSTK_REG(tsk, EIP)
|
||||
#define KSTK_ESP(tsk) KSTK_REG(tsk, UESP)
|
||||
#define KSTK_EBP(tsk) KSTK_REG(tsk, EBP)
|
||||
|
||||
#include "asm/processor-generic.h"
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Overrides for Emacs so that we follow Linus's tabbing style.
|
||||
* Emacs will notice this stuff at the end of the file and automatically
|
||||
* adjust the settings for this buffer only. This must remain at the end
|
||||
* of the file.
|
||||
* ---------------------------------------------------------------------------
|
||||
* Local variables:
|
||||
* c-file-style: "linux"
|
||||
* End:
|
||||
*/
|
||||
|
||||
@@ -36,17 +36,9 @@ extern inline void rep_nop(void)
|
||||
#define ARCH_IS_STACKGROW(address) \
|
||||
(address + 128 >= UPT_SP(¤t->thread.regs.regs))
|
||||
|
||||
#define KSTK_EIP(tsk) KSTK_REG(tsk, RIP)
|
||||
#define KSTK_ESP(tsk) KSTK_REG(tsk, RSP)
|
||||
|
||||
#include "asm/processor-generic.h"
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Overrides for Emacs so that we follow Linus's tabbing style.
|
||||
* Emacs will notice this stuff at the end of the file and automatically
|
||||
* adjust the settings for this buffer only. This must remain at the end
|
||||
* of the file.
|
||||
* ---------------------------------------------------------------------------
|
||||
* Local variables:
|
||||
* c-file-style: "linux"
|
||||
* End:
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user