[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
@@ -5,6 +5,7 @@
|
||||
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <setjmp.h>
|
||||
#include "sysdep/ptrace_user.h"
|
||||
#include "sysdep/ptrace.h"
|
||||
#include "uml-config.h"
|
||||
@@ -126,13 +127,11 @@ void get_safe_registers(unsigned long *regs)
|
||||
memcpy(regs, exec_regs, HOST_FRAME_SIZE * sizeof(unsigned long));
|
||||
}
|
||||
|
||||
/*
|
||||
* 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:
|
||||
*/
|
||||
void get_thread_regs(union uml_pt_regs *uml_regs, void *buffer)
|
||||
{
|
||||
struct __jmp_buf_tag *jmpbuf = buffer;
|
||||
|
||||
UPT_SET(uml_regs, EIP, jmpbuf->__jmpbuf[JB_PC]);
|
||||
UPT_SET(uml_regs, UESP, jmpbuf->__jmpbuf[JB_SP]);
|
||||
UPT_SET(uml_regs, EBP, jmpbuf->__jmpbuf[JB_BP]);
|
||||
}
|
||||
|
Reference in New Issue
Block a user