Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3944522ybt; Sun, 5 Jul 2020 11:23:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzscKhtyRCNZ/HYs8ub8X4+nUTT6KfWt7s/0gCl8f4tWneDuFaP9JEQxvGY3gRPPm8idVcG X-Received: by 2002:a50:e408:: with SMTP id d8mr50384732edm.375.1593973419320; Sun, 05 Jul 2020 11:23:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593973419; cv=none; d=google.com; s=arc-20160816; b=e8UHp2f0ySztjwWmw/7C0zu4Bg8kq4oQhI1W6s5pFtN2UYp3foXLV9A9nV6X+mOCAw HVsmUapB8tYoPwR8jREyjC1wBwLbX9K2JLV9n6eNNknlexRCzRsl0h5kNkrmWi8dd+79 9SXf0cgqdoD+6XmvEzsKnz1cUNVRnRFpcGkbw03eLs6SVJOD+JS1kXW6n4MUMFH6ydUh KoOFS4UPWWZADv1a7WLyBMr5w2juv+cchL0mkj/WEHZF54pVHOb/GVrA+3cZxPOw29G4 xwyDE2DrXIcupDOwd4Vtxs5HmdJt7qHil4oCc8t8xm8Y6DvSsC4UuyOapIQOG/vY5cBh e7TA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=Co+f0NhH8osQyLG9JtJnw9aD3HWD44FqVmj8c1PSoNo=; b=JQEqsT+8TbJuia2R6j3HivrTmpVvkWwpkmqmPhdbrZ9VFIAFE3t3ddXPYOjbhPWaiH WRszFDqkUOQbjkVcSE866LO09G6/6uRysHJik1qr/Eie4980a+1cVvdVyco2JZGHjUNZ ABgUt5n2PzWtiy6qL3O/7utj/D9v8BbEHhYUwmU/E1BR1FKlqAQ1ZOm/jJzTAkQKSXqb MEy/MIMQ2qXdQ5Uz230nTXEbrMEU8ahQ26JmTcUZHAqM9oSowVg+WbFohGFRNq6WicRE e2yLBItYBJtjP3//eTxBURaJy02r6PcSAdl5WZASNFTAYuj0s276TG7CAQXlPE03BWcY RBEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=howxMOBX; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bg25si11681445ejb.230.2020.07.05.11.23.16; Sun, 05 Jul 2020 11:23:39 -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=@kernel.org header.s=default header.b=howxMOBX; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727976AbgGESW4 (ORCPT + 99 others); Sun, 5 Jul 2020 14:22:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:55598 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727892AbgGESW4 (ORCPT ); Sun, 5 Jul 2020 14:22:56 -0400 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 69C5A20936 for ; Sun, 5 Jul 2020 18:22:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593973375; bh=Tv+vnChtxZf8reTGqSpw/7WA9YmfLwCc4rTCJANU6pQ=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=howxMOBXFc79K1vp1YDY37NP5WQUQEgo/R3TbpOoN1nSaDjx1Y3u8wd8e6sJEb1QN 96YzXaBlM7AjqYFi+1bxAVxA2Bt3nNW20U5XAwRkRg/rW5DkoF6j09K+Yp3HCvakMd utnQIFJ1ELlV+eUhfQDrMljUbLHhSgqgtZ8NtORk= Received: by mail-wm1-f46.google.com with SMTP id l17so36816698wmj.0 for ; Sun, 05 Jul 2020 11:22:55 -0700 (PDT) X-Gm-Message-State: AOAM530b9Z2rgI72VZvEqSXrsC/axLx+bIX5qQvit1aUN8h6cxT3PrTo O1YRLKAkxLp0eMpGoX9Z/HXdioNyJxVSKtLLwjGxdA== X-Received: by 2002:a1c:2402:: with SMTP id k2mr45904253wmk.138.1593973373941; Sun, 05 Jul 2020 11:22:53 -0700 (PDT) MIME-Version: 1.0 References: <20200629214956.GA12962@linux.intel.com> <20200704203809.76391-1-dpreed@deepplum.com> <20200704203809.76391-3-dpreed@deepplum.com> In-Reply-To: <20200704203809.76391-3-dpreed@deepplum.com> From: Andy Lutomirski Date: Sun, 5 Jul 2020 11:22:42 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 2/3] Fix undefined operation fault that can hang a cpu on crash or panic To: "David P. Reed" Cc: Sean Christopherson , Thomas Gleixner , Ingo Molnar , Borislav Petkov , X86 ML , "H. Peter Anvin" , Allison Randal , Enrico Weigelt , Greg Kroah-Hartman , Kate Stewart , "Peter Zijlstra (Intel)" , Randy Dunlap , Martin Molnar , Andy Lutomirski , Alexandre Chartre , Jann Horn , Dave Hansen , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jul 4, 2020 at 1:38 PM David P. Reed wrote: > > Fix: Mask undefined operation fault during emergency VMXOFF that must be > attempted to force cpu exit from VMX root operation. > Explanation: When a cpu may be in VMX root operation (only possible when > CR4.VMXE is set), crash or panic reboot tries to exit VMX root operation > using VMXOFF. This is necessary, because any INIT will be masked while cpu > is in VMX root operation, but that state cannot be reliably > discerned by the state of the cpu. > VMXOFF faults if the cpu is not actually in VMX root operation, signalling > undefined operation. > Discovered while debugging an out-of-tree x-visor with a race. Can happen > due to certain kinds of bugs in KVM. Can you re-wrap lines to 68 characters? Also, the Fix: and Explanation: is probably unnecessary. You could say: Ignore a potential #UD failut during emergency VMXOFF ... When a cpu may be in VMX ... > > Fixes: 208067 > Reported-by: David P. Reed It's not really necessary to say that you, the author, reported the problem, but I guess it's harmless. > Suggested-by: Thomas Gleixner > Suggested-by: Sean Christopherson > Suggested-by: Andy Lutomirski > Signed-off-by: David P. Reed > --- > arch/x86/include/asm/virtext.h | 20 ++++++++++++++------ > 1 file changed, 14 insertions(+), 6 deletions(-) > > diff --git a/arch/x86/include/asm/virtext.h b/arch/x86/include/asm/virtext.h > index 0ede8d04535a..0e0900eacb9c 100644 > --- a/arch/x86/include/asm/virtext.h > +++ b/arch/x86/include/asm/virtext.h > @@ -30,11 +30,11 @@ static inline int cpu_has_vmx(void) > } > > > -/* Disable VMX on the current CPU > +/* Exit VMX root mode and isable VMX on the current CPU. s/isable/disable/ > /* Disable VMX if it is supported and enabled on the current CPU > -- > 2.26.2 > Other than that: Reviewed-by: Andy Lutomirski --Andy