Advertisement
emin_int11

irq-stack

Mar 4th, 2016
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1.  
  2. 4 #ifdef CONFIG_KASAN
  3. 5 #define KASAN_STACK_ORDER 1
  4. 6 #else
  5. 7 #define KASAN_STACK_ORDER 0
  6. 8 #endif
  7.  
  8.  
  9.  
  10. 20 #define IRQ_STACK_ORDER (2 + KASAN_STACK_ORDER)
  11. 21 #define IRQ_STACK_SIZE (PAGE_SIZE << IRQ_STACK_ORDER)
  12.  
  13. PAGE_SIZE -- 1<<12 = 4096
  14.  
  15. >>> 4096<<2
  16. 16384 kB
  17.  
  18. 324 union irq_stack_union {
  19. 325 char irq_stack[IRQ_STACK_SIZE]; //16 kB stack size
  20. 326 /*
  21. 327 * GCC hardcodes the stack canary as %gs:40. Since the
  22. 328 * irq_stack is the object at %gs:0, we reserve the bottom
  23. 329 * 48 bytes of the irq stack for the canary.
  24. 330 */
  25. 331 struct {
  26. 332 char gs_base[40];
  27. 333 unsigned long stack_canary;
  28. 334 };
  29. 335 };
  30.  
  31.  
  32.  
  33. setup_percpu.c:244
  34.  
  35. 244 #ifdef CONFIG_X86_64
  36. 245 per_cpu(irq_stack_ptr, cpu) =
  37. 246 per_cpu(irq_stack_union.irq_stack, cpu) +
  38. 247 IRQ_STACK_SIZE - 64;
  39.  
  40. setup IRQ stack pointer on per-cpu variable.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement