diff options
author | Michal Simek <monstr@monstr.eu> | 2010-06-22 11:46:27 -0400 |
---|---|---|
committer | Michal Simek <monstr@monstr.eu> | 2010-08-04 04:29:44 -0400 |
commit | b318067e2c946a560035faf47e24a20e50696cce (patch) | |
tree | 7818d4285ef257f9b989bd032d3b59d9e0b5732c /arch | |
parent | 77f6d226050e2d8f046e268a9f84ec834172f0de (diff) |
microblaze: Implement clear_ums macro and fix SAVE_STATE macro
VMS is always setup because VM mode was before
exception/syscall/interrupt. Kernel continues in kernel mode
that's why we have to clear UMS bit if kernel comes from
user space.
Signed-off-by: Michal Simek <monstr@monstr.eu>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/microblaze/kernel/entry.S | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/microblaze/kernel/entry.S b/arch/microblaze/kernel/entry.S index 5318ad375fec..5529f64e97e8 100644 --- a/arch/microblaze/kernel/entry.S +++ b/arch/microblaze/kernel/entry.S | |||
@@ -91,6 +91,11 @@ | |||
91 | nop | 91 | nop |
92 | .endm | 92 | .endm |
93 | 93 | ||
94 | .macro clear_ums | ||
95 | msrclr r11, MSR_UMS | ||
96 | nop | ||
97 | .endm | ||
98 | |||
94 | .macro clear_vms_ums | 99 | .macro clear_vms_ums |
95 | msrclr r11, MSR_VMS | MSR_UMS | 100 | msrclr r11, MSR_VMS | MSR_UMS |
96 | nop | 101 | nop |
@@ -162,6 +167,14 @@ | |||
162 | nop | 167 | nop |
163 | .endm | 168 | .endm |
164 | 169 | ||
170 | .macro clear_ums | ||
171 | mfs r11, rmsr | ||
172 | nop | ||
173 | andni r11, r11, MSR_UMS | ||
174 | mts rmsr,r11 | ||
175 | nop | ||
176 | .endm | ||
177 | |||
165 | .macro clear_vms_ums | 178 | .macro clear_vms_ums |
166 | mfs r11, rmsr | 179 | mfs r11, rmsr |
167 | nop | 180 | nop |
@@ -526,6 +539,8 @@ C_ENTRY(sys_rt_sigreturn_wrapper): | |||
526 | swi r0, r1, PTO + PT_MODE; /* Was in user-mode. */ \ | 539 | swi r0, r1, PTO + PT_MODE; /* Was in user-mode. */ \ |
527 | lwi r11, r0, TOPHYS(PER_CPU(ENTRY_SP)); \ | 540 | lwi r11, r0, TOPHYS(PER_CPU(ENTRY_SP)); \ |
528 | swi r11, r1, PTO+PT_R1; /* Store user SP. */ \ | 541 | swi r11, r1, PTO+PT_R1; /* Store user SP. */ \ |
542 | /* MS: I am clearing UMS even in case when I come from kernel space */ \ | ||
543 | clear_ums; \ | ||
529 | 2: lwi CURRENT_TASK, r0, TOPHYS(PER_CPU(CURRENT_SAVE)); | 544 | 2: lwi CURRENT_TASK, r0, TOPHYS(PER_CPU(CURRENT_SAVE)); |
530 | 545 | ||
531 | C_ENTRY(full_exception_trap): | 546 | C_ENTRY(full_exception_trap): |