question: trap handler query....
Hi all,
I've a question. how would a cpu know from an IPI, if it's on a trap handler
underneath. Looking at entry.S, I see that trap handlers push entry vector on stack, so I suppose one could walk down the frames (there's prob a better way). Moreover, what if the IPI comes right before the entry vector is pushed? Does x86 disable upon trap?
Thanks for any help,
Mukesh
Quoted 5 lines · Mukesh Rathor
Hi all,
I've a question. how would a cpu know from an IPI, if it's on a trap handler
underneath. Looking atentry.S, I see that trap handlers push entry vector on stack, so I suppose one could walk down the frames (there's prob a better way).
the better way is to check the interrupted privilege level in the pushed CS register (bits 1-0). if it's zero, it's been in xen when it happened.
Quoted 1 line
Moreover, what if the IPI comes right before the entry vector is pushed?
exception entry by itself is atomic. either you get a complete stack frame (as pushed by the cpu, i.e. up to rip/error_code, i.e. not including the SAVE_ALL macros) or remain at the instruction yet to cause the trap. nowhere in between.
Quoted 1 line
Does x86 disable upon trap?
..interrupts you mean? typically no. only on interrupt gates.
regards,
daniel
Signature · 5 lines
Daniel Stodden LRR - Lehrstuhl für Rechnertechnik und Rechnerorganisation Institut für Informatik der TU München D-85748 Garching http://www.lrr.in.tum.de/~stodden mailto:[email protected] PGP Fingerprint: F5A4 1575 4C56 E26A 0B33 3D80 457E 82AE B0D8 735B