From patchwork Mon Feb 24 02:07:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiaoyao Li X-Patchwork-Id: 11399183 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1E6F114BC for ; Mon, 24 Feb 2020 02:13:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 07EF420836 for ; Mon, 24 Feb 2020 02:13:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727183AbgBXCND (ORCPT ); Sun, 23 Feb 2020 21:13:03 -0500 Received: from mga06.intel.com ([134.134.136.31]:24747 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727151AbgBXCND (ORCPT ); Sun, 23 Feb 2020 21:13:03 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Feb 2020 18:13:02 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,478,1574150400"; d="scan'208";a="255437173" Received: from lxy-dell.sh.intel.com ([10.239.13.109]) by orsmga002.jf.intel.com with ESMTP; 23 Feb 2020 18:13:00 -0800 From: Xiaoyao Li To: Paolo Bonzini , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Xiaoyao Li Subject: [PATCH 0/2] KVM: VMX: Use basic exit reason for cheking and indexing Date: Mon, 24 Feb 2020 10:07:49 +0800 Message-Id: <20200224020751.1469-1-xiaoyao.li@intel.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Current KVM directly uses the whole 32-bit EXIT REASON when 1) checking: if (vmx->exit_reason == EXIT_REASON_*) 2) indexing: kvm_vmx_exit_handlers[exit_reason] However, only the low 16-bit of EXIT REASON serves as basic Exit Reason. Fix it by using the 16-bit basic exit reason. BTW, I'm not sure if it's necessary to split nested case into a seperate patch. Xiaoyao Li (2): kvm: vmx: Use basic exit reason to check if it's the specific VM EXIT kvm: nvmx: Use basic(exit_reason) when checking specific EXIT_REASON arch/x86/kvm/vmx/nested.c | 6 +++--- arch/x86/kvm/vmx/nested.h | 2 +- arch/x86/kvm/vmx/vmx.c | 44 ++++++++++++++++++++------------------- arch/x86/kvm/vmx/vmx.h | 2 ++ 4 files changed, 29 insertions(+), 25 deletions(-)