Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp851383yba; Sat, 4 May 2019 14:40:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqwzr/Y9NJsecsYGZzcJ4K8dGSXwpdwZsDtnzOMRgo+iJwWuBEjDWK5SXKQnXrNnTW21aBpX X-Received: by 2002:a65:6282:: with SMTP id f2mr21120434pgv.152.1557006015319; Sat, 04 May 2019 14:40:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557006015; cv=none; d=google.com; s=arc-20160816; b=R6/+Yj3qwzCz4Csn5MrxPlCJJ2cL0Qgt4EqcVqFEsWVVtK8wEz4ZLCGK4ayXqWMvoE fIeDIKN4ZNXVE4E/rCuO7iFYLO2Ekpq4ULIYs6HD+/yrTozBOR3M1poWXdxt/QZEvqQw Sf5vEeWFBWRfYYBSQfdJr1RMuVMz1PSC59rmmtLhkZOD2TSv9CZsP/uSFdxdSqN3g7rr D2q4YkxajbVgGWvdMjBjN8HNLxesgN3jKYBLP0ep3Una5+agh+n94JFN5nJCtEf1TCba pHgMGSHKFIilnDpnVmkMVih9ptnuapGKIsrVQy9OZ8HpdWYVbAlXDQeRJgRKsGMk7N/y kNfw== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=SaUefhj41Vo9ICd62i3E2YPs3qFZSdkbgRUMEL66AdI=; b=n2HbfhSdYZHPZckbTRmtWXz4KAHT+lXFUm0D/Z0W7a5R/rBONsKRdOYQwDcf8bwdr2 hHsfEmZwa3A7ahiGBOrRgPtO4tTnbV0p/b6ncNb3sVCYYMrpRrLlxrj+yXw4WysP8vY1 5ChwpEAvMlpurkhXk7dlvTtqdU3W/qe1FUCSQ4uW1QTp5WDP8YOik0RxErhwKX/UnmCR 8vAwexZjaS/CvP9+O/YUAT1SWzq1fqKh3mCYlDIj9p/40Dhvtij+NdVCEEbe5nVDMaI8 3T/ok685NsXYnRBJx/g6+Tg8EYyfpAGNf9r2XBaBVPVBosapJULZ9QXsCYdezRbK3b39 amCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=YWFWemqJ; 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 s2si8452162plr.110.2019.05.04.14.40.00; Sat, 04 May 2019 14:40:15 -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=@linux-foundation.org header.s=google header.b=YWFWemqJ; 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 S1727454AbfEDUfd (ORCPT + 99 others); Sat, 4 May 2019 16:35:33 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:43779 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727404AbfEDUfd (ORCPT ); Sat, 4 May 2019 16:35:33 -0400 Received: by mail-lf1-f68.google.com with SMTP id u27so6338498lfg.10 for ; Sat, 04 May 2019 13:35:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=SaUefhj41Vo9ICd62i3E2YPs3qFZSdkbgRUMEL66AdI=; b=YWFWemqJ0JLsacxwcohY3H1Ru+7m68bmnSG7LYrodNEBsa1vqFIe7N+Z7/ib2SOef8 WWNNvU+E2HH25gh9czdMXSA1W+PtOHyDLxhTntgAp0nZMXOMd6zYnlK0dQqvtzAQo8bz LSBMlFzIL2Q2R5LmuSDspX30nFFTSIPoTZtwA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=SaUefhj41Vo9ICd62i3E2YPs3qFZSdkbgRUMEL66AdI=; b=K/aKQCCw4JNTcZfXYpqVwtFLx7w/Nu3EhouOXptDp3U3w/9vl/iB3lgSI47cFYGV7G PwOmuhUxgo7GMiR9q4WzzVXdPm82xe2nctie8qNYU7ch90lpui6eJHC4GnIFybbEVy+l J3psBnKLF7MggNv4eLHdfIIP6q2nRd/8UzmjeV3zNDnNJtLPoNg2jPkkUdNfYgRnAU8S sTgRMKzFCUncuVDPe81PbFMwgWnGQIhfjToa4KrFW8dErnDEyHrsK5oJZFp54xk8H5B3 vYU9PDuTJacQUK02PVaqO/mt2NXLlAYWtfi0Xu8hmMg0EIZ5ZM2MCmLTY+Q1Te26RKqD YfqA== X-Gm-Message-State: APjAAAW8O03C/zcoCPsWO2dOUEyqHHWUpHtOn7z/P6baj58fAljvZS02 uX8Y73Iz0mOyKmwDNnGw9gMwvQEtKyc= X-Received: by 2002:a19:ec12:: with SMTP id b18mr8359518lfa.149.1557002131001; Sat, 04 May 2019 13:35:31 -0700 (PDT) Received: from mail-lj1-f178.google.com (mail-lj1-f178.google.com. [209.85.208.178]) by smtp.gmail.com with ESMTPSA id p4sm1075426lji.41.2019.05.04.13.35.30 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 04 May 2019 13:35:30 -0700 (PDT) Received: by mail-lj1-f178.google.com with SMTP id z26so3153217ljj.2 for ; Sat, 04 May 2019 13:35:30 -0700 (PDT) X-Received: by 2002:a2e:3e0e:: with SMTP id l14mr8970707lja.125.1557001696580; Sat, 04 May 2019 13:28:16 -0700 (PDT) MIME-Version: 1.0 References: <20190501202830.347656894@goodmis.org> <20190501203152.397154664@goodmis.org> <20190501232412.1196ef18@oasis.local.home> <20190502162133.GX2623@hirez.programming.kicks-ass.net> <20190502181811.GY2623@hirez.programming.kicks-ass.net> <20190502202146.GZ2623@hirez.programming.kicks-ass.net> <20190503152405.2d741af8@gandalf.local.home> <20190503184919.2b7ef242@gandalf.local.home> <20190504001756.17fad840@oasis.local.home> <2BF1AE4B-8105-49F0-8B6A-AA3B11FD66FD@amacapital.net> In-Reply-To: <2BF1AE4B-8105-49F0-8B6A-AA3B11FD66FD@amacapital.net> From: Linus Torvalds Date: Sat, 4 May 2019 13:28:00 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC][PATCH 1/2] x86: Allow breakpoints to emulate call functions To: Andy Lutomirski Cc: Steven Rostedt , Peter Zijlstra , Linux List Kernel Mailing , Ingo Molnar , Andrew Morton , Andy Lutomirski , Nicolai Stange , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , "the arch/x86 maintainers" , 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 , Joerg Roedel , "open list:KERNEL SELFTEST FRAMEWORK" , stable Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, May 4, 2019 at 1:12 PM Andy Lutomirski wrote: > > As an aside, is it even *possible* to get #BP from v8086 mode? On a quic= k SDM read, the INT3 instruction causes #GP if VM=3D1 and IOPL<3. And, if = we allow vm86() to have IOPL=3D3, we should just remove that ability. It=E2= =80=99s nuts. We've definitely historically allowed IOPL=3D3 with the whole "iopl()" system call. And yes, afaik it works together with the vm86 system call too. I think we copy the unsafe bits from the original eflags, so if you do iopl(3) followed by vm86(), you will be running in vm86 mode with iopl 3. > (We should maybe consider a config option for iopl() that defaults off. W= e=E2=80=99ve supported ioperm() for a long, long time.) It's entirely possible that nobody uses iopl() and we should make it a config option that defaults to off. But we've already done that with the VM86 support entirely, and I'm not sure modern distros even enable it. And obviously vm86 mode isn't available at all with a 64-bit kernel, so this is all slowly becoming more or less moot. Linus