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

Re: [Minios-devel] [UNIKRAFT PATCH 4/8] plat/xen: Align x86 interrupt stack address at compile time



Hi Costin,

just one remark:

On 4/23/19 12:41 PM, Costin Lupu wrote:
This patch aligns the stack base address at compile time and makes the
irqstack variable public.

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);

So my understanding is that the way the code was originally set up, it basically wastes a bunch of memory at the top, just to guarantee alignment?

I like the patch, but I think it would benefit from an explanation in the patch note why going from 2*STACK_SIZE to STACK_SIZE is not an issue.

Cheers,
Florian



  #endif
  }

--
Dr. Florian Schmidt
フローリアン・シュミット
Research Scientist,
Systems and Machine Learning Group
NEC Laboratories Europe
Kurfürsten-Anlage 36, D-69115 Heidelberg
Tel.     +49 (0)6221 4342-265
Fax:     +49 (0)6221 4342-155
e-mail:  florian.schmidt@xxxxxxxxx
============================================================
Registered at Amtsgericht Mannheim, Germany, HRB728558

_______________________________________________
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®.