From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 744DBC433EF for ; Mon, 4 Oct 2021 13:34:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 55C4E611C7 for ; Mon, 4 Oct 2021 13:34:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235507AbhJDNfr (ORCPT ); Mon, 4 Oct 2021 09:35:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:47478 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237888AbhJDNdZ (ORCPT ); Mon, 4 Oct 2021 09:33:25 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D6E816322D; Mon, 4 Oct 2021 13:15:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1633353309; bh=z6mYA0ABvX36KU1qCO5fuQKeKIbVOqQUA7VW++61n0I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WfoMA3tq7Kq/U/AHCzflCt05vrIGZmCpF8O2uG/YX/pqguK5sdazK0VewBN9OdXIs ICRgzPgoNq8a+XShrEekRnYlNqzP59a+tNoVb2b2A/k9pRSLfbsPXWcZ9jJhK02usB MzEqeUZ0KJmrOGI9EI1V8aFfOo2lViogjTnWPDT0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chenyi Qiang , Sean Christopherson , Xiaoyao Li , Paolo Bonzini Subject: [PATCH 5.14 060/172] KVM: nVMX: Fix nested bus lock VM exit Date: Mon, 4 Oct 2021 14:51:50 +0200 Message-Id: <20211004125046.933779243@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211004125044.945314266@linuxfoundation.org> References: <20211004125044.945314266@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chenyi Qiang commit 24a996ade34d00deef5dee2c33aacd8fda91ec31 upstream. Nested bus lock VM exits are not supported yet. If L2 triggers bus lock VM exit, it will be directed to L1 VMM, which would cause unexpected behavior. Therefore, handle L2's bus lock VM exits in L0 directly. Fixes: fe6b6bc802b4 ("KVM: VMX: Enable bus lock VM exit") Signed-off-by: Chenyi Qiang Reviewed-by: Sean Christopherson Reviewed-by: Xiaoyao Li Message-Id: <20210914095041.29764-1-chenyi.qiang@intel.com> Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini Signed-off-by: Greg Kroah-Hartman --- arch/x86/kvm/vmx/nested.c | 6 ++++++ 1 file changed, 6 insertions(+) --- a/arch/x86/kvm/vmx/nested.c +++ b/arch/x86/kvm/vmx/nested.c @@ -5898,6 +5898,12 @@ static bool nested_vmx_l0_wants_exit(str case EXIT_REASON_VMFUNC: /* VM functions are emulated through L2->L0 vmexits. */ return true; + case EXIT_REASON_BUS_LOCK: + /* + * At present, bus lock VM exit is never exposed to L1. + * Handle L2's bus locks in L0 directly. + */ + return true; default: break; }