From mboxrd@z Thu Jan 1 00:00:00 1970 From: nstange@suse.de (Nicolai Stange) Date: Sun, 28 Apr 2019 23:22:54 +0200 Subject: [PATCH 1/4] x86/thread_info: introduce ->ftrace_int3_stack member In-Reply-To: <20190428135143.09d35bb6@oasis.local.home> (Steven Rostedt's message of "Sun, 28 Apr 2019 13:51:43 -0400") References: <20190427100639.15074-1-nstange@suse.de> <20190427100639.15074-2-nstange@suse.de> <20190428135143.09d35bb6@oasis.local.home> Message-ID: <87k1fdygcx.fsf@suse.de> Content-Type: text/plain; charset="UTF-8" Message-ID: <20190428212254.eYidGDvN3M7xXfssHbHedJp2CcOcBnL7R1OiS5jX2vQ@z> Steven Rostedt writes: > On Sun, 28 Apr 2019 10:41:10 -0700 > Andy Lutomirski wrote: > > >> > Note that at any given point >> > in time, there can be at most four such call insn emulations pending: >> > namely at most one per "process", "irq", "softirq" and "nmi" context. >> > >> >> That’s quite an assumption. I think your list should also contain >> exception, exceptions nested inside that exception, and machine >> check, at the very least. I’m also wondering why irq and softirq are >> treated separately. You're right, I missed the machine check case. > 4 has usually been the context count we choose. But I guess in theory, > if we get exceptions then I could potentially be more. After having seen the static_call discussion, I'm in no way defending this limited approach here, but out of curiosity: can the code between the push onto the stack from ftrace_int3_handler() and the subsequent pop from the stub actually trigger an (non-#MC) exception? There's an iret inbetween, but that can fault only when returning to user space, correct? > As for irq vs softirq, an interrupt can preempt a softirq. Interrupts > are enabled while softirqs are running. When sofirqs run, softirqs are > disabled to prevent nested softirqs. But interrupts are enabled again, > and another interrupt may come in while a softirq is executing. > Thanks, Nicolai -- SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)