Messages in this thread | | | Date | Fri, 24 Jul 2015 12:25:03 +0200 | From | Borislav Petkov <> | Subject | Re: [PATCH 1/3] x86/entry/64: Refactor IRQ stacks and make then NMI-safe |
| |
On Thu, Jul 23, 2015 at 11:08:39PM -0700, Andy Lutomirski wrote: > To be obviously safe against any local exception, we want a single > instruction that will change %rsp and some in-memory flag at the same > time. There aren't a whole lot of candidates. Cmpxchg isn't useful > (cmpxchg with a memory operand doesn't modify its register operand).
Why would you even need that?
You do LOCK; CMPXCHG on a per_cpu variable and then test ZF? I.e., use it as a mutex in asm. With ZF=1, you switch stacks, with ZF=0, you busy-wait ...
Or am I missing something?
This way you serialize all irq stack switchers...
-- Regards/Gruss, Boris.
ECO tip #101: Trim your mails when you reply. --
| |