Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1396805ybk; Thu, 14 May 2020 08:02:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzpbhijR7CaJU35uGeAV7bUAbXS9NcF4w8m3vGGwUnNyxe9GANUEo0UG+V5i8ixZs0OXgBw X-Received: by 2002:a5d:444c:: with SMTP id x12mr5822785wrr.406.1589468541082; Thu, 14 May 2020 08:02:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589468541; cv=none; d=google.com; s=arc-20160816; b=uPIaRQnPk6eHi3yMUHx40Wht/HiDjq0M9G0nht5XPBT06LlIZylXyxIBriL6eaR0n1 ug8PFVxs+gh6hQzr2HmhpXZN63JW2xHvhfKFJRAxZ+5gJUWOcOxa9Zd6xiGFp3plLZ6Q RdOVlI+3VeNv5wv8H6/RNF5kF+t2XKpa6JaBhy2aEyt7P99yQLmpCD97TRDSve2J0NHc P4G4f8Tnx4hu8y0tmVQbM6VyKuZnsyx/iUJ+6GI4OLd27EXFF+1+oBbHLLjkgBgEnKdw VPSpBHthLHsM+xA7rRc8kkMoLCg7v/k4jic6ovWwnJEz+EIles04vPYLvoREL2hU87GV AuHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:in-reply-to:cc:references:message-id :date:subject:mime-version:from:content-transfer-encoding :dkim-signature; bh=LKDhIqkg4dk5I2yUUB4YPd6c5Rk5/qL/3S3piqwGyfk=; b=a7lVcUKtpClOqj5w0SdVuc+cP+07AjiE41IJ9peiaNuEdm23OZNSFvIYud2ovlXG7R XQYLpc8pz404X/gJjoDYnOKvjMop9ZTO1Ax552e1DjtQML/8YJJdL0vKBqbTVGRCeROw W8WeKKxySYMhap7Y3Cei8y1ADQj6RzSue5lBKPBa86EOKtWjT3ooCdDGckbXAH96aVTA W4A4y4I0l6HhXZXH7qflCNuZIisj3eQsMcyDDer4RhX0mjzLpxQeswKD2eqg2/5Uh030 aFjMxCMO76j0fIaaEQ6BxRB90S3efv5RQOhxg3sAGOn93dYy7jhzSU1lBnIMPIn0m1GS yNlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=x2IC35Ep; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g12si1930403ejw.314.2020.05.14.08.01.57; Thu, 14 May 2020 08:02:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=x2IC35Ep; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727977AbgENPAT (ORCPT + 99 others); Thu, 14 May 2020 11:00:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726146AbgENPAP (ORCPT ); Thu, 14 May 2020 11:00:15 -0400 Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3F18C061A0C for ; Thu, 14 May 2020 08:00:14 -0700 (PDT) Received: by mail-pf1-x442.google.com with SMTP id x2so1416487pfx.7 for ; Thu, 14 May 2020 08:00:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amacapital-net.20150623.gappssmtp.com; s=20150623; h=content-transfer-encoding:from:mime-version:subject:date:message-id :references:cc:in-reply-to:to; bh=LKDhIqkg4dk5I2yUUB4YPd6c5Rk5/qL/3S3piqwGyfk=; b=x2IC35EpcFxlDYphsQmsNFlsVgrnCmW3WwfF+86HN8Vu4f4gIl+8CqbVDxTq2+iNgF UrOjdI5l3xWeXpO0peEVbLIX+a3DLBpGvc6wFqIX93NJp5Wm6R/lnRETx3hH+UVi7ikL 3xDZRiYopAj81rMzzpVMBs/hJAcoYsCNns5tLG76h9peIIt22xuQZCVTNN8b3dLuG9Qd 7rohVQ/rYeO3qh/P2OEUP0QbQcrix3aedQ2+wE3iVo9MQ2O1ssPKldtwXHv4c3WUGOrW Gjs1CmG3RA1gCwgo3NHMq53Mc8tma1Cel99g15t1bN+so7bVZOWNMeffS2B+tuFlOjwA +wkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:content-transfer-encoding:from:mime-version :subject:date:message-id:references:cc:in-reply-to:to; bh=LKDhIqkg4dk5I2yUUB4YPd6c5Rk5/qL/3S3piqwGyfk=; b=pVqXh4WPCJjo1BDJuHOWgLAlG8652aVMFTTOlH7QQ91LTvOnJxyRGwYMyWEPQD8deA Q4e+rTwbOnNwzHIhqHncVNf56IE/H3dM3Hk+T96ETr9XiRkz/pGwRabRnzQ4H86UDKch 5Lz1GdvFj3AFaljgP3F/IicfOswDAQPaZbBBFkAFG499sx7d9fkdTLRD7zvkiZTWhMd2 1++1zK6rHiNZrxOTKPMQH2cL5ZnC9IwxHgruZaego/KaqrvHC/0qFkSVepqilbhXpadQ IO1Mym8s2HzArvbTf9afgxvm5rgmzrPqlRrUFCN3TiXAcKlNx38f/VAhL8OBflFhaKdw 6DTA== X-Gm-Message-State: AOAM53117REBAqjuJmMO16cipNnle4MDlovDc82k7jVgdP7aKMbdDl63 wkoOxbTKYALkIeZabhlD0jKgZw== X-Received: by 2002:a65:5287:: with SMTP id y7mr4211486pgp.86.1589468414210; Thu, 14 May 2020 08:00:14 -0700 (PDT) Received: from [100.80.46.139] (9.sub-174-194-209.myvzw.com. [174.194.209.9]) by smtp.gmail.com with ESMTPSA id h26sm2546754pfk.35.2020.05.14.08.00.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 14 May 2020 08:00:13 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Andy Lutomirski Mime-Version: 1.0 (1.0) Subject: Re: [patch V4 part 3 17/29] x86/entry: Convert Invalid Opcode exception to IDTENTRY Date: Thu, 14 May 2020 08:00:10 -0700 Message-Id: References: <87k11ezog1.fsf@nanos.tec.linutronix.de> Cc: Andy Lutomirski , LKML , X86 ML , "Paul E. McKenney" , Alexandre Chartre , Frederic Weisbecker , Paolo Bonzini , Sean Christopherson , Masami Hiramatsu , Petr Mladek , Steven Rostedt , Joel Fernandes , Boris Ostrovsky , Juergen Gross , Brian Gerst , Mathieu Desnoyers , Josh Poimboeuf , Will Deacon In-Reply-To: <87k11ezog1.fsf@nanos.tec.linutronix.de> To: Thomas Gleixner X-Mailer: iPhone Mail (17E262) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On May 14, 2020, at 5:33 AM, Thomas Gleixner wrote: >=20 > =EF=BB=BFAndy Lutomirski writes: >=20 >>> On Tue, May 5, 2020 at 7:15 AM Thomas Gleixner wrot= e: >>>=20 >>> From: Thomas Gleixner >>>=20 >>> Convert #UD to IDTENTRY: >>> - Implement the C entry point with DEFINE_IDTENTRY >>> - Emit the ASM stub with DECLARE_IDTENTRY >>> - Remove the ASM idtentry in 64bit >>> - Remove the open coded ASM entry code in 32bit >>> - Fixup the XEN/PV code >>> - Fixup the FOOF bug call in fault.c >>> - Remove the old prototyoes >>>=20 >>> No functional change. >>=20 >> I think there *is* a functional change: >>=20 >>=20 >>> --- a/arch/x86/mm/fault.c >>> +++ b/arch/x86/mm/fault.c >>> @@ -567,7 +567,7 @@ static int is_f00f_bug(struct pt_regs *r >>> nr =3D (address - idt_descr.address) >> 3; >>>=20 >>> if (nr =3D=3D 6) { >>> - do_invalid_op(regs, 0); >>> + handle_invalid_op(regs); >>=20 >> I suspect the old code was wrong and no one noticed because no one has >> a F00F-buggy machine any more. >=20 > I don't think so. It's really just the same thing. The old #UD C > function was: >=20 > void do_invalid_op(struct pt_regs *regs, long error_code) > { > do_error_trap(regs, error_code, "invalid opcode", X86_TRAP_UD, > SIGILL, ILL_ILLOPN, (void __user *)uprobe_get_trap_ad= dr(regs)); > } >=20 > after expanding the DO_ERROR() muck. >=20 > The new one does: >=20 > void handle_invalid_op(struct pt_regs *regs) > { > do_error_trap(regs, 0, "invalid opcode", X86_TRAP_UD, SIGILL, > ILL_ILLOPN, error_get_trap_addr(regs)); > } >=20 > which is exactly the same except for the error code being hardcoded to > zero in handle_invalid_op() because #UD does not have one. >=20 >> So maybe document that you fixed up the F00F bug, too. Otherwise: >=20 > Not sure what to document :) Duh, right, never mind. Here I was thinking the old C handlers did all the e= ntry/exit work. >=20 > Thanks, >=20 > tglx