diff options
author | Liav Rehana <liavr@mellanox.com> | 2017-06-15 04:44:00 -0400 |
---|---|---|
committer | Vineet Gupta <vgupta@synopsys.com> | 2017-08-28 18:17:36 -0400 |
commit | 28923f6b74060b183207a373ddae4ce4948cabea (patch) | |
tree | c2c393d1e3821cd51942614d94146f2af9601d0e | |
parent | 5b2189ab6ee0717babac912f779dcd440e942173 (diff) |
ARC: [plat-eznps] handle extra aux regs #2: kernel/entry exit
Preserve eflags and gpa1 aux during entry/exit into kernel as these
could be modified by kernel mode
These registers used by compare exchange instructions.
- GPA1 is used for compare value,
- EFLAGS got bit reflects atomic operation response.
EFLAGS is zeroed for each new user task so it won't get its
parent value.
Signed-off-by: Liav Rehana <liavr@mellanox.com>
Signed-off-by: Noam Camus <noamc@ezchip.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
-rw-r--r-- | arch/arc/include/asm/entry-compact.h | 24 | ||||
-rw-r--r-- | arch/arc/include/asm/ptrace.h | 5 | ||||
-rw-r--r-- | arch/arc/kernel/process.c | 4 |
3 files changed, 33 insertions, 0 deletions
diff --git a/arch/arc/include/asm/entry-compact.h b/arch/arc/include/asm/entry-compact.h index 14c310f2e0b1..ec36d5b6d435 100644 --- a/arch/arc/include/asm/entry-compact.h +++ b/arch/arc/include/asm/entry-compact.h | |||
@@ -192,6 +192,12 @@ | |||
192 | PUSHAX lp_start | 192 | PUSHAX lp_start |
193 | PUSHAX erbta | 193 | PUSHAX erbta |
194 | 194 | ||
195 | #ifdef CONFIG_ARC_PLAT_EZNPS | ||
196 | .word CTOP_INST_SCHD_RW | ||
197 | PUSHAX CTOP_AUX_GPA1 | ||
198 | PUSHAX CTOP_AUX_EFLAGS | ||
199 | #endif | ||
200 | |||
195 | lr r9, [ecr] | 201 | lr r9, [ecr] |
196 | st r9, [sp, PT_event] /* EV_Trap expects r9 to have ECR */ | 202 | st r9, [sp, PT_event] /* EV_Trap expects r9 to have ECR */ |
197 | .endm | 203 | .endm |
@@ -208,6 +214,12 @@ | |||
208 | * by hardware and that is not good. | 214 | * by hardware and that is not good. |
209 | *-------------------------------------------------------------*/ | 215 | *-------------------------------------------------------------*/ |
210 | .macro EXCEPTION_EPILOGUE | 216 | .macro EXCEPTION_EPILOGUE |
217 | #ifdef CONFIG_ARC_PLAT_EZNPS | ||
218 | .word CTOP_INST_SCHD_RW | ||
219 | POPAX CTOP_AUX_EFLAGS | ||
220 | POPAX CTOP_AUX_GPA1 | ||
221 | #endif | ||
222 | |||
211 | POPAX erbta | 223 | POPAX erbta |
212 | POPAX lp_start | 224 | POPAX lp_start |
213 | POPAX lp_end | 225 | POPAX lp_end |
@@ -265,6 +277,12 @@ | |||
265 | PUSHAX lp_end | 277 | PUSHAX lp_end |
266 | PUSHAX lp_start | 278 | PUSHAX lp_start |
267 | PUSHAX bta_l\LVL\() | 279 | PUSHAX bta_l\LVL\() |
280 | |||
281 | #ifdef CONFIG_ARC_PLAT_EZNPS | ||
282 | .word CTOP_INST_SCHD_RW | ||
283 | PUSHAX CTOP_AUX_GPA1 | ||
284 | PUSHAX CTOP_AUX_EFLAGS | ||
285 | #endif | ||
268 | .endm | 286 | .endm |
269 | 287 | ||
270 | /*-------------------------------------------------------------- | 288 | /*-------------------------------------------------------------- |
@@ -277,6 +295,12 @@ | |||
277 | * by hardware and that is not good. | 295 | * by hardware and that is not good. |
278 | *-------------------------------------------------------------*/ | 296 | *-------------------------------------------------------------*/ |
279 | .macro INTERRUPT_EPILOGUE LVL | 297 | .macro INTERRUPT_EPILOGUE LVL |
298 | #ifdef CONFIG_ARC_PLAT_EZNPS | ||
299 | .word CTOP_INST_SCHD_RW | ||
300 | POPAX CTOP_AUX_EFLAGS | ||
301 | POPAX CTOP_AUX_GPA1 | ||
302 | #endif | ||
303 | |||
280 | POPAX bta_l\LVL\() | 304 | POPAX bta_l\LVL\() |
281 | POPAX lp_start | 305 | POPAX lp_start |
282 | POPAX lp_end | 306 | POPAX lp_end |
diff --git a/arch/arc/include/asm/ptrace.h b/arch/arc/include/asm/ptrace.h index 5297faa8a378..5a8cb22724a1 100644 --- a/arch/arc/include/asm/ptrace.h +++ b/arch/arc/include/asm/ptrace.h | |||
@@ -19,6 +19,11 @@ | |||
19 | #ifdef CONFIG_ISA_ARCOMPACT | 19 | #ifdef CONFIG_ISA_ARCOMPACT |
20 | struct pt_regs { | 20 | struct pt_regs { |
21 | 21 | ||
22 | #ifdef CONFIG_ARC_PLAT_EZNPS | ||
23 | unsigned long eflags; /* Extended FLAGS */ | ||
24 | unsigned long gpa1; /* General Purpose Aux */ | ||
25 | #endif | ||
26 | |||
22 | /* Real registers */ | 27 | /* Real registers */ |
23 | unsigned long bta; /* bta_l1, bta_l2, erbta */ | 28 | unsigned long bta; /* bta_l1, bta_l2, erbta */ |
24 | 29 | ||
diff --git a/arch/arc/kernel/process.c b/arch/arc/kernel/process.c index 5c631a111240..5ac3b547453f 100644 --- a/arch/arc/kernel/process.c +++ b/arch/arc/kernel/process.c | |||
@@ -234,6 +234,10 @@ void start_thread(struct pt_regs * regs, unsigned long pc, unsigned long usp) | |||
234 | */ | 234 | */ |
235 | regs->status32 = STATUS_U_MASK | STATUS_L_MASK | ISA_INIT_STATUS_BITS; | 235 | regs->status32 = STATUS_U_MASK | STATUS_L_MASK | ISA_INIT_STATUS_BITS; |
236 | 236 | ||
237 | #ifdef CONFIG_EZNPS_MTM_EXT | ||
238 | regs->eflags = 0; | ||
239 | #endif | ||
240 | |||
237 | /* bogus seed values for debugging */ | 241 | /* bogus seed values for debugging */ |
238 | regs->lp_start = 0x10; | 242 | regs->lp_start = 0x10; |
239 | regs->lp_end = 0x80; | 243 | regs->lp_end = 0x80; |