Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp966385pxu; Sun, 25 Oct 2020 23:56:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxtUnFnFqg7FXx9nH2qYSJ88gIMuIg+9d4Yoxb294lNL5DRKQKELvkdX6bKxBA2n8I9gDRS X-Received: by 2002:a17:906:8157:: with SMTP id z23mr13794859ejw.274.1603695367736; Sun, 25 Oct 2020 23:56:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603695367; cv=none; d=google.com; s=arc-20160816; b=orhjkW4sOatDhKZ7CnW6xiIJ+NM/nB3jcHOSOSBN9cLLyVACLveAd2YX75KTWKkAYC RzrWg28sCmfChLBwCu9i6aHBZfm6lrMrnz9C3hAgj0mUnMrWLQoD0DLLdS2INDcXW2c/ nH4ZglUNpa0eHuNFjnCnJy/jpEQVIDHvD/pZ0rf13t1iAjf9wzB2oyN0QIr6YweOGLH5 WJo4rTa0U8poBYfh6/mERq394h3RNQ4nUbkFK8ri8GCE5mD73mRXpdv71C3PLxUeASvz K2iZ9gLmh9QtYjFNY8pyofuwtfqGdgAtlPOjrpzgzoMAVOWu+bBha7XmkB/oZWvPZQlM 5Kbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:ironport-sdr:ironport-sdr; bh=sD6dEDsLfjb7lW9lA9qfO2qZ9fBYqm+zILlL4Vwj1oc=; b=pHPy0h9ermBItYTLS7xSHn4oxiD856CzTpAETM6qvYjUAZFkRh1mvswvrGCjm+e14D zslKgMWIhjgJ6OG+H9gYM+21FhwEQc+g7NpEtvoFm3uZQIQhloVo3fUgj3Rf9HE4QRUl P46YviTKHl2m4id13snAe/sBAm79ghZB9yrsiTY/8gJ22CP3f3CeTCHTZcKTX0QqcHi4 4lpAR9MsZ0l3+qmRIfMXHp9BxJBa9UcejlCbxiBZdrZ0uYdBxEmz9kChUCTal0uqY1M2 EPeYvJzFpngmGOJSjvaEm+18/s3JnkXxECEtuHYy26Pgaa1XdeNJXrB2QxWl3SLzbmBx MENQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y22si2253732edq.522.2020.10.25.23.55.46; Sun, 25 Oct 2020 23:56:07 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1768793AbgJZFbc (ORCPT + 99 others); Mon, 26 Oct 2020 01:31:32 -0400 Received: from mga06.intel.com ([134.134.136.31]:20356 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1768759AbgJZFbb (ORCPT ); Mon, 26 Oct 2020 01:31:31 -0400 IronPort-SDR: o9OC74CbH9MdownG5zJsjvi/ywkZcOj7sTgoyI89c/s0saeBNCGjesthziTiyV597j3SyjNFX/ ZEfNGOK6PYBQ== X-IronPort-AV: E=McAfee;i="6000,8403,9785"; a="229513258" X-IronPort-AV: E=Sophos;i="5.77,417,1596524400"; d="scan'208";a="229513258" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Oct 2020 22:31:27 -0700 IronPort-SDR: 4azQy4ttURtpUTFedYK+Vd55ONGatSITkNcYg8JSoLWcH1N0wti4GrvqD7aToobM2WNcfaS2n4 zIuSPOkXgKTg== X-IronPort-AV: E=Sophos;i="5.77,417,1596524400"; d="scan'208";a="535232981" Received: from cqiang-mobl.ccr.corp.intel.com (HELO [10.238.0.131]) ([10.238.0.131]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Oct 2020 22:31:24 -0700 Subject: Re: [RESEND v4 1/2] KVM: VMX: Convert vcpu_vmx.exit_reason to a union To: Sean Christopherson Cc: Paolo Bonzini , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , "Li, Xiaoyao" , "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" References: <20201012033542.4696-1-chenyi.qiang@intel.com> <20201012033542.4696-2-chenyi.qiang@intel.com> <20201020220158.GA9031@linux.intel.com> From: Chenyi Qiang Message-ID: Date: Mon, 26 Oct 2020 13:31:06 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 MIME-Version: 1.0 In-Reply-To: <20201020220158.GA9031@linux.intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/21/2020 6:01 AM, Sean Christopherson wrote: > On Mon, Oct 12, 2020 at 11:35:41AM +0800, Chenyi Qiang wrote: >> From: Sean Christopherson >> >> Convert vcpu_vmx.exit_reason from a u32 to a union (of size u32). The >> full VM_EXIT_REASON field is comprised of a 16-bit basic exit reason in >> bits 15:0, and single-bit modifiers in bits 31:16. >> >> Historically, KVM has only had to worry about handling the "failed >> VM-Entry" modifier, which could only be set in very specific flows and >> required dedicated handling. I.e. manually stripping the FAILED_VMENTRY >> bit was a somewhat viable approach. But even with only a single bit to >> worry about, KVM has had several bugs related to comparing a basic exit >> reason against the full exit reason store in vcpu_vmx. >> >> Upcoming Intel features, e.g. SGX, will add new modifier bits that can >> be set on more or less any VM-Exit, as opposed to the significantly more >> restricted FAILED_VMENTRY, i.e. correctly handling everything in one-off >> flows isn't scalable. Tracking exit reason in a union forces code to >> explicitly choose between consuming the full exit reason and the basic >> exit, and is a convenient way to document and access the modifiers. >> >> No functional change intended. >> >> Cc: Xiaoyao Li >> Signed-off-by: Sean Christopherson > > This needs your SOB since you are involved in the handling of the patch. Sorry for the late response, my mailbox encountered some issues... Will add the SOB here. >