Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3070503yba; Sun, 28 Apr 2019 16:28:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqy2qTHcaCxu2mFMGOm/ftKcFuQ/nJwpWGVRqb2wZYX/1HW9886eTKlV3rarPVveZNCNRzjQ X-Received: by 2002:a63:ed10:: with SMTP id d16mr38856208pgi.75.1556494109759; Sun, 28 Apr 2019 16:28:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556494109; cv=none; d=google.com; s=arc-20160816; b=pEucvc8T7yUGmKByMwifTWic9tYGVZWXiaYay962DNVqvO7IrQyi1NYRcr5Qu3n/0e IvJz3G0bk5WtgfcQxkefMYNFovhyOdKop4eBJ9q8ZzgVviswfdqT8c0e3zjm0MjgsVzk k3Qt+mZgFZMvxX7gv++3QHbZiLYL+uhpwdxKBefYQpoyjEwbvAWNPxvwSGg2VvoIPS62 Vws/pgZ8LSt5Rl+JiozZINY+anmMWmTDy4tgUsiPIWl9J0jL/sP4lbalCFIPQJ+s+u9r C96zFALRDJTV2UAmxGrJLLTYXNa3Sz4Ad+9M7Ir1X5+nX+nc4iLD4u4toVPmt0hDHpJl gp7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=LYH/XS8nnf6efHlZx0B2St65dcm+60nIA8GvtyVKA2g=; b=iJGF4Z/VuxLLgcrc3RT5aszs7YeycWc6u0bJ6xM6a7Ang1izrPsUKVmzPGwaOFceNz lnd2Ut4ThGWQLdmcVK8DMLSr5s9Oh4gAcvG1lTfDdIJJgSMggevAOf/3qqRLglIA5Vra sQgVyIB5ctTxGq/ImDUnCYOHoir2e3SKUMy2p0oFtlSAkJeukUhrW6gbk3RCrhaP9YG6 3eWT3yk9hTRKE5k4HQE0YLU1J3gLVyUBpw69RNR1NnzVM2ge9p3/meWEEeo8lnHKMJNy vTQp/HN0ta7S0YzsKZqyTwZBeaYNQVsZ8vsqDGsWgKa8NYRyvwejV7A5g42sceUrkSV0 tsfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=DmRdpcQe; 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 h189si32611746pfc.283.2019.04.28.16.28.14; Sun, 28 Apr 2019 16:28:29 -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; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=DmRdpcQe; 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 S1726681AbfD1X1Z (ORCPT + 99 others); Sun, 28 Apr 2019 19:27:25 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:45891 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726545AbfD1X1Y (ORCPT ); Sun, 28 Apr 2019 19:27:24 -0400 Received: by mail-pl1-f195.google.com with SMTP id o5so4181126pls.12 for ; Sun, 28 Apr 2019 16:27:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amacapital-net.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=LYH/XS8nnf6efHlZx0B2St65dcm+60nIA8GvtyVKA2g=; b=DmRdpcQePn9pu6FxDsh1mK99BocSEh/feEMjXNQT5ibFOMXKxk7jGGikNVgPkQ/pOI UGmJYe/+bLddvlC3J8DvQsu56bjSCusqMfu8ME8NvlSzxN714OngT/6dh+33YkAcZv8i iM0dTbQx4WNLm2r5XvkUR/9p+AGYVJWQd1S1XltOigmfclHaDVEekiM8glCNctsFjsqe EjtGySHRM/yMeakMd4wY4/K6M7MwH6uRGoUakpsQfA1l/NMDHEwrki80UgpRapYjx/2A 8wv773Mjddy3w1YG0r8YpnUtenCQDHKuuF0sSQvKZb4Ba5u8UD1UTfrCsbCTdunO3Zef bgsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=LYH/XS8nnf6efHlZx0B2St65dcm+60nIA8GvtyVKA2g=; b=Kv17hE0pvLSnA/ZXPkc74jsUXWIBW4njKoBj+8beqbAFhPMU2IY5VzeXhTFHcs2VNF ZcKGNH//RFWpE0xzgWVsYEU4KwUWHw03yfMhJJzbIr0DD3pjoKYG1BxjpZ/MnHilBlpt 12cumndl15R6CzrwuDV/xuXFHC1iI8avZuMQpPkzlp9IfzrH2ePcqZLREEQuWRk9DyWS e6VJTVyWFVmrWFe9eT1/aDJYNthWEzeDB8NVbt0e4egfVboVGjUMDJhBnVlXPrCWZhvr CkKDciR+n1kl0fr5kM+r7LFnKgf1vV2Eyq3FUKImSot/EOAGFHRzHREkLhrHF9TsCJ6d 5fOg== X-Gm-Message-State: APjAAAW3w/J5yOCF78hex6dNHEzwdKIX1Y4MoPDISTECyGUx9JuVm8S3 TT9doH2pq+4DKTeGJ/EY1PsX8A== X-Received: by 2002:a17:902:2862:: with SMTP id e89mr60249446plb.203.1556494043721; Sun, 28 Apr 2019 16:27:23 -0700 (PDT) Received: from ?IPv6:2601:646:c200:1ef2:68a6:ac0c:7713:add7? ([2601:646:c200:1ef2:68a6:ac0c:7713:add7]) by smtp.gmail.com with ESMTPSA id s21sm41771309pfm.3.2019.04.28.16.27.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 28 Apr 2019 16:27:22 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: [PATCH 1/4] x86/thread_info: introduce ->ftrace_int3_stack member From: Andy Lutomirski X-Mailer: iPhone Mail (16E227) In-Reply-To: <87k1fdygcx.fsf@suse.de> Date: Sun, 28 Apr 2019 16:27:21 -0700 Cc: Steven Rostedt , 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 Content-Transfer-Encoding: quoted-printable Message-Id: References: <20190427100639.15074-1-nstange@suse.de> <20190427100639.15074-2-nstange@suse.de> <20190428135143.09d35bb6@oasis.local.home> <87k1fdygcx.fsf@suse.de> To: Nicolai Stange Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Apr 28, 2019, at 2:22 PM, Nicolai Stange wrote: >=20 > Steven Rostedt writes: >=20 >> On Sun, 28 Apr 2019 10:41:10 -0700 >> Andy Lutomirski wrote: >>=20 >>=20 >>>> 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. >>>>=20 >>>=20 >>> That=E2=80=99s quite an assumption. I think your list should also contai= n >>> exception, exceptions nested inside that exception, and machine >>> check, at the very least. I=E2=80=99m also wondering why irq and softir= q are >>> treated separately. >=20 > You're right, I missed the machine check case. >=20 >=20 >> 4 has usually been the context count we choose. But I guess in theory, >> if we get exceptions then I could potentially be more. >=20 > 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? IRET doesn=E2=80=99t do any fancy masking, so #DB, NMI and regular IRQs shou= ld all be possible. >=20 >=20 >> 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. >>=20 >=20 > Thanks, >=20 > Nicolai >=20 >=20 > --=20 > SUSE Linux GmbH, GF: Felix Imend=C3=B6rffer, Jane Smithard, Graham Norton,= > HRB 21284 (AG N=C3=BCrnberg)