[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] [UNIKRAFT PATCH v2 1/5] plat/xen: Align x86 interrupt stack address at compile time


  • To: minios-devel@xxxxxxxxxxxxx
  • From: Costin Lupu <costin.lupu@xxxxxxxxx>
  • Date: Wed, 29 May 2019 07:56:28 +0300
  • Cc: Florian.Schmidt@xxxxxxxxx
  • Delivery-date: Wed, 29 May 2019 04:56:52 +0000
  • Ironport-phdr: 9a23:MYp4whHil0Z5xexVR+be1Z1GYnF86YWxBRYc798ds5kLTJ7zpc6wAkXT6L1XgUPTWs2DsrQY0rOQ6vq+Ejxfqb+681k6OKRWUBEEjchE1ycBO+WiTXPBEfjxciYhF95DXlI2t1uyMExSBdqsLwaK+i764jEdAAjwOhRoLerpBIHSk9631+ev8JHPfglEnjWwba5vIBmssAndqMgbjYRhJ6sz1xDEvmZGd+NKyG1yOFmdhQz85sC+/J5i9yRfpfcs/NNeXKv5Yqo1U6VWACwpPG4p6sLrswLDTRaU6XsHTmoWiBtIDBPb4xz8Q5z8rzH1tut52CmdIM32UbU5Uims4qt3VBPljjoMOjgk+2/Vl8NwlrpWrhK/qRJizYDaY4abO/hwfq7GYd8WWXBMUtpLWiBdHo+xaZYEAeobPeZfqonwv0UDrRylBQmwBePvzCJDiHnr3a0izuQqDAbL0xAnH9IVrHTUrdP1OL0WUeCo1KnI0C7OYO9N2Tvn8IjIbwsureuWXbJ3aMfcz1QkGQDdjliItIDoMC6Z2v4OvmWb9eZsS/yjhmw9pwx/ujSj28ghhpTTio8Wyl3I7zt1zYg7KNGiVUJ2bsCoHZ1NvC+ALYR2WNktQ2RwtSY/zb0JpIC0cTARyJQi2x7fc/uHc5WU4h77VOaePzN4hHV9dbKhgha960mgyunmWsaoy1ZGtDJFksTXuXwXzRzT7dCLSvp7/ki/xTaCzx3f5+5ZLUwulqfWK4QtzqAumpcRq0jOEDf6mEDsg6+XckUk9PKo6+PiYrj+upCcMJR0ih3/MqQogMC/Bfk4MhATX2WA5eu8z6fv/VXkQLpRlPE2iK7ZvIjAJcsHvq65HxNV0oE75ha6Djem1tUYnX4cLF5cZR2IkZbpNE/KIP3jCfe/gk+skCtwx/zcMbzuHJPNImLEkLf7crZ381RcxxYrzdBD+5JUDakMLvL3Wk/2rtzYDwU2Mwquz+j6FNp91oYeWWOSDa+FK67St0GH6f4rI+aWf4AZoijyK+V2r8Lp2Ho4n14aZuyl0IUabFi8H+96OAOJbHyqhc0OQkkQuQ9rZ+vxlFyEGRpOf2v6C6k7/S06DsSiEJ/ebou2xqSc1mGhGcsFNSh9FlmQHCKwJM2/UPAWZXfKLw==
  • Ironport-sdr: 4L+piREc1Or4xxqbgKS4XjTXhGxiLsrctpM8tA0dl4OraHmenQ0idz0AQFAs57PxCEibFkjPDG UxCW+3iH5eOg==
  • List-id: Mini-os development list <minios-devel.lists.xenproject.org>

This patch aligns the stack base address at compile time and makes the
irqstack variable public. Before this patch, the IRQ stack size was
2 * STACK_SIZE bytes because the aligned address was computed at runtime
and the bottom half of the stack was wasted. This patch fixes that and
aligns the stack address at build time, therefore avoiding a waste of
STACK_SIZE bytes.

Signed-off-by: Costin Lupu <costin.lupu@xxxxxxxxx>
---
 plat/xen/x86/arch_events.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/plat/xen/x86/arch_events.c b/plat/xen/x86/arch_events.c
index 1e165c81..7d7289fc 100644
--- a/plat/xen/x86/arch_events.c
+++ b/plat/xen/x86/arch_events.c
@@ -30,9 +30,10 @@
 #include <stdint.h>
 #include <x86/cpu.h>
 #include <uk/plat/config.h>
+#include <uk/essentials.h>
 
 #if defined(__x86_64__)
-static char irqstack[2 * STACK_SIZE];
+char irqstack[STACK_SIZE] __align(STACK_SIZE);
 
 static struct pda {
        int irqcount;       /* offset 0 (used in x86_64.S) */
@@ -48,8 +49,7 @@ void arch_init_events(void)
        wrmsrl(0xc0000101, (uint64_t) &cpu0_pda);
        cpu0_pda.irqcount = -1;
        cpu0_pda.irqstackptr =
-                       (void *) (((unsigned long)irqstack + 2 * STACK_SIZE)
-                       & STACK_MASK_TOP);
+                       (void *) ((unsigned long) irqstack + STACK_SIZE);
 #endif
 }
 
-- 
2.11.0


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.