0xAX / linux-insides

A little bit about a linux kernel
http://0xax.gitbooks.io/linux-insides/content/index.html
Other
30.01k stars 3.37k forks source link

About the minus 64 when setting the irq_stack_ptr #175

Closed blastrock closed 7 years ago

blastrock commented 9 years ago

Hi,

In this chapter https://github.com/0xAX/linux-insides/blob/master/interrupts/interrupts-1.md , and more precisely, this snippet:

    per_cpu(irq_stack_ptr, cpu) =
            per_cpu(irq_stack_union.irq_stack, cpu) +
            IRQ_STACK_SIZE - 64;

I don't understand why the minus 64.

You say it's because of the stack canary, but the canary is at the bottom of the irq_stack_union, not the top. Also, you say it's because the canary is 64 bits long, but here we are reserving 64 bytes, not bits. Did I misunderstand something? Maybe this part needs clarification.

And thanks for the good work :)

0xAX commented 9 years ago

Hello @blastrock,

Yes that's my fault, you're right something else here. I'll make a research and update post. Thank you for issue

0xAX commented 7 years ago

Hi @blastrock,

seems nobody does not remember why these 64-bytes hole :) and now it is removed in the https://github.com/torvalds/linux/commit/4950d6d48a0c43cc61d0bbb76fb10e0214b79c66.

I have update first part of interrupts charpter.

Thank you for catch 👍