Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp3786031pxb; Mon, 4 Oct 2021 09:33:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyvEI8zPGdGceitiouXAxK9BUYWe8kmqnGFciHwPYcmt5T1dJMfAkhDHF6/cF1JZwGSEtfn X-Received: by 2002:a17:906:2b90:: with SMTP id m16mr18619135ejg.344.1633365195933; Mon, 04 Oct 2021 09:33:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633365195; cv=none; d=google.com; s=arc-20160816; b=YDS0jSNJ4EW+o0Iu8nfY7lUeXCpdPAw7sB64W1k4BHdH9uxOc4jclHGfUNnvLbwLgx 0OeJUZK8n1AIucY+Wjuw1erM5eZMTaLU7YLbWLsBPbl+YDeD258St+SN9o1KvopL0qMT NMs1GRlMmO64EE55rQaIaqDA1vkl19lzxF82II9tiSsUTAz3KRWc2si+648/jDjex+pV uDce2GtP4CZBg4CQTfJOObDee6NDgh2vzvbnnlKjBenU9olIJR/gGE4mOrEgN0f1AOMv uADJdLXDp6e9Jc7u6sZgRKGmcUcGEY7WIrS11QoEqfZpdgsvoCtVFhkmIXW8yCRVkWvZ XYRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=onJEVs5VbeVK/GXm3f4A6hletVgdjPhWG7F+7wlZrgQ=; b=DaYuVPt7Dff34fPfhQIY9UEC9+Dr3TAVHMcn9M6+kM/hUoH7vgufWNYlBgUcgzhM1p g50Fy7Jb8/K2+y8dL5V26mY6LsxpX9L/2A/rXnF8nBEuvcsbBYmRtoOA6KFWeZjVi2lO IMV/qONHpNy9v+whAlnW94bgRUdcyViUiFVo+uHG8dO4JtuJx4VRQK/x9xzSftULyQtS iB9ReSn6RJOY5FUQfDOReZfHDcZHMla80tIQrYOIc/orkGTWVenlUGl9xVhjzlXFeiMc ByZzoRQgh8U0uWzGhykW+d0GkGoG3J4hvq4RuneIt987Z04exgMdDhELg211MxpVCBQJ whIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=WfoMA3tq; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m23si9706469eje.259.2021.10.04.09.32.38; Mon, 04 Oct 2021 09:33:15 -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=@linuxfoundation.org header.s=korg header.b=WfoMA3tq; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235396AbhJDNfr (ORCPT + 99 others); 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; }