Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp4475208ybz; Tue, 28 Apr 2020 11:56:26 -0700 (PDT) X-Google-Smtp-Source: APiQypK92u6eAnmjH/NlD+ku4PUeOR7EwknZs098waJdxDg6i6t3zB9PHdxvoHuk5/xMKiTJPpgY X-Received: by 2002:a17:906:9518:: with SMTP id u24mr26220544ejx.320.1588100186678; Tue, 28 Apr 2020 11:56:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588100186; cv=none; d=google.com; s=arc-20160816; b=QrZyOcyL4xkIOFf6enNBDDY42t/h1dA3K+J/aI21uJqeJ3THbXef3ogsPum8i8e22K ACLGcDhOBWaKQGlPTV9m9L8RQaiINLHsAshwOhWj1qfJb2N146DuLkh+Vzf5QkP9G2o1 XkLr5W0qGY7S7i9R/KD3gF/N+wy6Tr9SK7zuHx+lGI3znM7wr+4Cu/beQnYKiRkVyM/C ygiTrN9H8K8ZBJKjm6n+o13ELc/dSr62Z/d1fY+DFAO1Z/Ytco3fHzwqfFdkFmn1jZrR f5tFGCVieApjO28mJPsNCp0t7NGP1pcA93b2JIY7HRPqT+R0QgAkmTdC6lr+UV+KwOie blGg== 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=C18IvcKIUPmqhWrNgGQA3HNdNJlQg6Mgu7oxvCya4yA=; b=xnhsOEPWgX0sHwmQx/wBl4pSOdJp3l6HU4IlP61uInJ83gV3Q5up+GDFJ/C94mtLCj mK5l3HI69lS9WwZJbC/96MXBTgppaUcXbTx9vB7zSWpKsGKypw7dcchDE2qJsmrvSETp zmXFozuEDLvAVIuUTDmeKhwATKXjIVTnEZm7B0+Wkeh3bwjYSTksiPw+ninBG+tP2Uhh DZDIreigCfjE6R8HHbuki6t+OG0nhu+0Vb1XUfGKpz9sOQq0JR1hXW79e0cJ4JqCuM36 9V05uObxrI1pHjw0ZfHzgQdNVL32E24Z31HhgElzAxxpS9UKrTmjydSHz0AdHZB59piw G6AA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=L9xOTWTy; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t6si2021958edj.527.2020.04.28.11.56.03; Tue, 28 Apr 2020 11:56:26 -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=@google.com header.s=20161025 header.b=L9xOTWTy; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731513AbgD1Syu (ORCPT + 99 others); Tue, 28 Apr 2020 14:54:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1731504AbgD1Sys (ORCPT ); Tue, 28 Apr 2020 14:54:48 -0400 Received: from mail-io1-xd42.google.com (mail-io1-xd42.google.com [IPv6:2607:f8b0:4864:20::d42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26B3CC03C1AC for ; Tue, 28 Apr 2020 11:54:47 -0700 (PDT) Received: by mail-io1-xd42.google.com with SMTP id e9so24371259iok.9 for ; Tue, 28 Apr 2020 11:54:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=C18IvcKIUPmqhWrNgGQA3HNdNJlQg6Mgu7oxvCya4yA=; b=L9xOTWTy9tw1EFj+TKRAx32qbXnmGcmWjC9j+1VFE2M+ENXZSCUF5FaAziHTxmF4H0 OyMKlGYZ2xM60lfspQhpw9mEylRaIPO32BPXwBYQSIz4taZP3Ui7derpShjsvTSAHNKo hs32y1/Re/uF3tXYVScQ7RyDjnYTLYKpVWNJTtHWTkVaackmgtpv1sDnV1FxOh4uq2F9 4RDSvp0pwjqMIry4z+GsOylTQPvWIjwpv3hWcK8HvhFbAt5Xut9zXnDzTAAhtFKdSvV+ Ky0ttH1cEZ4Eqly2TWn+V2KcFl11plVaHKk+n7PifWmJegn4DSSsqLOLodv1QIOjOl1E XE/w== 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; bh=C18IvcKIUPmqhWrNgGQA3HNdNJlQg6Mgu7oxvCya4yA=; b=fuxlNjwQHIFjC/OhQtPv4XPqdpZ90eiDXlz1hJ6MRhBuZ0fINyLD38eAE4ltosZtLD uc6/qUUmoIOOepdpqykyRYaocu4mEUET/dxkaRxytSRJzwDpo5r8IwI2PgH93x2FL8en PVVyvSjA3Hi60EO5iDeGpHCcsUauwJeFwoc0BGg/jHcZflXzwrCw/SgNgDZpmhyNvSFN o7i4rbz0ml8LJixtDn97sqDezLNPyUcdLInJMmOIBNJID8negUVknpH89m/8Jh9uZXOA K+XvyRYlUgDdAhP5w/BgXYwdQBuJ8lI3994JQ278Xn9orb1sdToD7wtQzwEwnjvsUQk5 c7qQ== X-Gm-Message-State: AGi0PuaWf0z1riQO4xHIQuG1tJFSTvyIOjbzhi2FxRnG1qrqYljnUAZp ACqIvEcl5Wivvs2Mte4tF6MbmaT8TboeXaDoRPTErA== X-Received: by 2002:a5e:a610:: with SMTP id q16mr27415990ioi.75.1588100086060; Tue, 28 Apr 2020 11:54:46 -0700 (PDT) MIME-Version: 1.0 References: <20200423022550.15113-1-sean.j.christopherson@intel.com> <20200423022550.15113-2-sean.j.christopherson@intel.com> In-Reply-To: <20200423022550.15113-2-sean.j.christopherson@intel.com> From: Jim Mattson Date: Tue, 28 Apr 2020 11:54:35 -0700 Message-ID: Subject: Re: [PATCH 01/13] KVM: nVMX: Preserve exception priority irrespective of exiting behavior To: Sean Christopherson Cc: Paolo Bonzini , Vitaly Kuznetsov , Wanpeng Li , Joerg Roedel , kvm list , LKML , Oliver Upton , Peter Shier 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 Wed, Apr 22, 2020 at 7:26 PM Sean Christopherson wrote: > > Short circuit vmx_check_nested_events() if an exception is pending and > needs to be injected into L2, priority between coincident events is not > dependent on exiting behavior. This fixes a bug where a single-step #DB > that is not intercepted by L1 is incorrectly dropped due to servicing a > VMX Preemption Timer VM-Exit. > > Injected exceptions also need to be blocked if nested VM-Enter is > pending or an exception was already injected, otherwise injecting the > exception could overwrite an existing event injection from L1. > Technically, this scenario should be impossible, i.e. KVM shouldn't > inject its own exception during nested VM-Enter. This will be addressed > in a future patch. > > Note, event priority between SMI, NMI and INTR is incorrect for L2, e.g. > SMI should take priority over VM-Exit on NMI/INTR, and NMI that is > injected into L2 should take priority over VM-Exit INTR. This will also > be addressed in a future patch. > > Fixes: b6b8a1451fc4 ("KVM: nVMX: Rework interception of IRQs and NMIs") > Reported-by: Jim Mattson > Cc: Oliver Upton > Cc: Peter Shier > Signed-off-by: Sean Christopherson Reviewed-by: Jim Mattson