Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2995717yba; Sun, 28 Apr 2019 14:24:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqy5v+5O049rmvgb6JHXsEP6PBecyxntM9J1mCxol3SKB4MBjDcy4FQs39YLVikELrOK5jJG X-Received: by 2002:a63:1446:: with SMTP id 6mr46165906pgu.227.1556486684893; Sun, 28 Apr 2019 14:24:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556486684; cv=none; d=google.com; s=arc-20160816; b=n1AdvsiPC38aHvMYCEORfFeErMULh4vu4Mulv9ct0Z08XVJS0JByGrwC3puM1dbR2Z spBDh4V4temql7O6AESSuRV45Uai6VSpB+NHF55Dk9cLMj6BncdwFj+HLwKim4vvhH+Z TpgBZ9i8qYrk2WxNdQUtRjkhtCu5KNgBUlC6IyOa7u41wJO8F37tCkowLv7qynRyGFaa HYw7XCbaaW/cY5X26yZiNh8mVq2NATGXeml2aYMOk7hqvAgyZcsdSeGES/vMxTjixLVz HVVFMGxICYYuwjzFgVpyU4nM7s+K5dplF3sBNQmVVTm8nuNLoYIYXrrVmpRbDJBQDlTy E1yQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:message-id:in-reply-to:date:references:subject:cc:to :from; bh=Ow3/zrMtlsEAQzNDtmqocwyYOCs0vC72xTfueMQVLjc=; b=DZ6V5zRRZARkaUvqmml+ZxhNXJ61Ys9nyJ5vBxfzSpTt/HostwhnPdr6GIBroK92mz +arvw7eNjxcYwPrcZUishxcZ1lwJe77Mybawxx/skFZxCq6xe5FsIUZPskYEIPN4A190 8rh72wkbEM6Kr0I4lRrrY9/nRtTRCCZmzu3b73exdZ0DOQvuEhMAZL2zRc9HKa1OvdOL 4hcMZ8Dq6q0EhwzoO6chasxoril/T15UpxsWMI2tMLt3sJkxyfo41TagCdLqN/F5TyNI bH98sTaonAQPcHAjbj5mBaGW6FbPuOwsA9ZA7HmJsaMUAHkfKRTbnnphOCuygtEePRYe mEhw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i23si6734540pfd.57.2019.04.28.14.24.19; Sun, 28 Apr 2019 14:24:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726496AbfD1VW7 convert rfc822-to-8bit (ORCPT + 99 others); Sun, 28 Apr 2019 17:22:59 -0400 Received: from mx2.suse.de ([195.135.220.15]:46358 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725982AbfD1VW6 (ORCPT ); Sun, 28 Apr 2019 17:22:58 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id B2C0EADF7; Sun, 28 Apr 2019 21:22:56 +0000 (UTC) From: Nicolai Stange To: Steven Rostedt Cc: Andy Lutomirski , Nicolai Stange , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , x86@kernel.org, Josh Poimboeuf , Jiri Kosina , Miroslav Benes , Petr Mladek , Joe Lawrence , Shuah Khan , Konrad Rzeszutek Wilk , Tim Chen , Sebastian Andrzej Siewior , Mimi Zohar , Juergen Gross , Nick Desaulniers , Nayna Jain , Masahiro Yamada , Andy Lutomirski , Joerg Roedel , linux-kernel@vger.kernel.org, live-patching@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH 1/4] x86/thread_info: introduce ->ftrace_int3_stack member References: <20190427100639.15074-1-nstange@suse.de> <20190427100639.15074-2-nstange@suse.de> <20190428135143.09d35bb6@oasis.local.home> Date: Sun, 28 Apr 2019 23:22:54 +0200 In-Reply-To: <20190428135143.09d35bb6@oasis.local.home> (Steven Rostedt's message of "Sun, 28 Apr 2019 13:51:43 -0400") Message-ID: <87k1fdygcx.fsf@suse.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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)