Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1886797pxv; Fri, 2 Jul 2021 15:11:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxSer9ylBKfdh7JKwaXj/PiaAi8zgf+bKRpUfuJBxQ/8bJRSuCB2NykC0MmFrMo2MVY+Zse X-Received: by 2002:a17:906:1489:: with SMTP id x9mr1878384ejc.21.1625263863282; Fri, 02 Jul 2021 15:11:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625263863; cv=none; d=google.com; s=arc-20160816; b=cuJEJM1DbJ3Y2X66W5kw/O4KAmtQPY0CNlA6qSnAm8JOIQ7W+xnFkCS7c/O3UM+J84 x1Mjm9BL59xMtxhFf3JH8gbP7VivjoA7WsiWyS+PkIcOBij22xtZ9o5v+X78QleWs7Qv LUvXMJfaogMKLgXC3oZ085+SdVR/TXHVg9CSqhrSOhQo25fmE5fXykmsl7tmfmyAPkk3 aUS4qLjItxf+IMQVPLTwAefoQc+lEowyhb8CXAeIoVtNkXEtvly7NNz0bTrHhX4+8DV8 kwLWc8seWtw6wIQ8F7I4upMxeBCj7YQ0n2kIPgWeiWZCpdRzoEhIEkZLsutYCSDariAt kFwg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=NeEd/KzVxHzrPpZEXobJZUhl0jbzTRqqejBnas8RBZ4=; b=X3mAiTgJUnSXwFAzP9ed6OW4c5+sECu8Yqekguz809L74BK5B3Y5C1exU3RiwEXSpX zr2aYu/bU6CMfDNfR48COpdujBE5kiBB+E6CpTcELLudByTOnPzXDLol1ACYtJjaPyMi zElCxSrdiFtAnwdzS4K9egqw3YqjWbtbnBXfigCKeLnWc6d7xiYIYLWpc/+mPargMnJO eMbkV28inoBNPE9qJnYsNljg08UMJmxm/fwRlJQQw4/sbhmqr2lzuJ5vuS+p9SfSh494 EzUO5cXM1dPkUazrSZ22Yjpv5JZBffpg0zD2LLEqP9vSx5TR/CTRtCWnPZG4i1v4u1eK 2HqQ== 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 g18si4115166eds.64.2021.07.02.15.10.40; Fri, 02 Jul 2021 15:11:03 -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 S233121AbhGBWH5 (ORCPT + 99 others); Fri, 2 Jul 2021 18:07:57 -0400 Received: from mga02.intel.com ([134.134.136.20]:51166 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230415AbhGBWHx (ORCPT ); Fri, 2 Jul 2021 18:07:53 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10033"; a="195951882" X-IronPort-AV: E=Sophos;i="5.83,320,1616482800"; d="scan'208";a="195951882" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jul 2021 15:05:19 -0700 X-IronPort-AV: E=Sophos;i="5.83,320,1616482800"; d="scan'208";a="642814675" Received: from ls.sc.intel.com (HELO localhost) ([143.183.96.54]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jul 2021 15:05:19 -0700 From: isaku.yamahata@intel.com To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H . Peter Anvin" , Paolo Bonzini , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , erdemaktas@google.com, Connor Kuehl , Sean Christopherson , x86@kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: isaku.yamahata@intel.com, isaku.yamahata@gmail.com Subject: [RFC PATCH v2 03/69] KVM: X86: move out the definition vmcs_hdr/vmcs from kvm to x86 Date: Fri, 2 Jul 2021 15:04:09 -0700 Message-Id: <62b61eb968f867518aedd98a0753b7fd29958efb.1625186503.git.isaku.yamahata@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Isaku Yamahata This is preparation for TDX support. Because SEAMCALL instruction requires VMX enabled, it needs to initialize struct vmcs and load it before SEAMCALL instruction.[1] [2] Move out the definition of vmcs into a common x86 header, arch/x86/include/asm/vmx.h, so that seamloader code can share the same definition. [1] Intel Trust Domain CPU Architectural Extensions https://software.intel.com/content/dam/develop/external/us/en/documents/intel-tdx-cpu-architectural-specification.pdf [2] TDX Module spec https://software.intel.com/content/dam/develop/external/us/en/documents/tdx-module-1eas-v0.85.039.pdf Signed-off-by: Isaku Yamahata --- arch/x86/include/asm/vmx.h | 11 +++++++++++ arch/x86/kvm/vmx/vmcs.h | 11 ----------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/arch/x86/include/asm/vmx.h b/arch/x86/include/asm/vmx.h index 0ffaa3156a4e..035dfdafa2c1 100644 --- a/arch/x86/include/asm/vmx.h +++ b/arch/x86/include/asm/vmx.h @@ -17,6 +17,17 @@ #include #include +struct vmcs_hdr { + u32 revision_id:31; + u32 shadow_vmcs:1; +}; + +struct vmcs { + struct vmcs_hdr hdr; + u32 abort; + char data[]; +}; + #define VMCS_CONTROL_BIT(x) BIT(VMX_FEATURE_##x & 0x1f) /* diff --git a/arch/x86/kvm/vmx/vmcs.h b/arch/x86/kvm/vmx/vmcs.h index 1472c6c376f7..ac09bc4996a5 100644 --- a/arch/x86/kvm/vmx/vmcs.h +++ b/arch/x86/kvm/vmx/vmcs.h @@ -11,17 +11,6 @@ #include "capabilities.h" -struct vmcs_hdr { - u32 revision_id:31; - u32 shadow_vmcs:1; -}; - -struct vmcs { - struct vmcs_hdr hdr; - u32 abort; - char data[]; -}; - DECLARE_PER_CPU(struct vmcs *, current_vmcs); /* -- 2.25.1