Yup, as Octo said, the problem is that IST interrupts don't stack. The stack pointer is just hard reloaded with the value from the TSS, and if it already was in use then whatever was there before is now gone. PowerPC has a similar problem, but at least in PowerPC you can recognize the situation and panic accordingly. Here, you cannot recognize that this has taken place, and you will end up in an infinite loop
In practice, though, the absence of a red-zone in kernel is of little concern. Some functions may need a sub/add pair more than if they could utilize it. In a cost-benefit analysis, making it entirely impossible to stack faults and interrupts is probably not worth the instruction savings. There's libgcc, of course, but in practice I just don't link it in, because I don't want to faff about with multilib, and so far have not gotten a linker error. I figure, if I ever do something that requires a libgcc call, I can research the function called and write a quick version in assembler. I don't need it to be fast, only correct.
_________________ Carpe diem!
|