|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Minios-devel] [UNIKRAFT PATCH 03/23] plat: Hardware context - Use interrupt stack when handling interrupts
Now that we use a special "stack" for saving the thread registers when entering
interrupt context, we have to get back to using the interrupt stack for the
rest of job.
Signed-off-by: Costin Lupu <costin.lupu@xxxxxxxxx>
---
plat/kvm/x86/cpu_vectors_x86_64.S | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/plat/kvm/x86/cpu_vectors_x86_64.S
b/plat/kvm/x86/cpu_vectors_x86_64.S
index 1af2fd00..41bd6f88 100644
--- a/plat/kvm/x86/cpu_vectors_x86_64.S
+++ b/plat/kvm/x86/cpu_vectors_x86_64.S
@@ -24,6 +24,8 @@
*/
/* Taken from solo5 */
+#include <uk/config.h>
+#include <uk/arch/limits.h>
#include <x86/traps.h>
#include <x86/regs.h>
@@ -92,11 +94,28 @@ ENTRY(cpu_irq_\irqno)
pushq $0 /* no error code */
PUSH_CALLER_SAVE
+#if CONFIG_HAVE_SCHED_PREEMPT
+ pushq $1f /* save continuation */
+ /* Set kernel stack */
+ movq intr_stack_start(%rip), %rsp
+#else
subq $REGS_PAD_SIZE, %rsp /* we have some padding */
+#endif /* CONFIG_HAVE_SCHED_PREEMPT */
+
movq $\irqno, %rdi
call _ukplat_irq_handle
+#if CONFIG_HAVE_SCHED_PREEMPT
+1:
+ /* Load current thread */
+ and $STACK_MASK_TOP, %rsp
+ mov (%rsp), %rsp
+ /* Load thread exception stack */
+ mov OFFSETOF_UKTHREAD_REGS(%rsp), %rsp
+ mov (%rsp), %rsp
+#endif
+
addq $REGS_PAD_SIZE, %rsp /* we have some padding */
POP_CALLER_SAVE
addq $8, %rsp
@@ -104,6 +123,11 @@ ENTRY(cpu_irq_\irqno)
iretq
.endm
+#if CONFIG_HAVE_SCHED_PREEMPT
+intr_stack_start:
+ .quad cpu_intr_stack + __STACK_SIZE - 8
+#endif
+
TRAP_ENTRY divide_error, 0
TRAP_ENTRY debug, 0
TRAP_ENTRY nmi, 0
--
2.20.1
_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |