Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp541519rdb; Thu, 1 Feb 2024 17:02:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IETqQje0XRAbofDOAk52rx5840ntmDbwYzduPaDCnZtUFIBwPkKkejaK5uLv04Gv5aT7ey/ X-Received: by 2002:ac8:5f0c:0:b0:42a:5d70:e346 with SMTP id x12-20020ac85f0c000000b0042a5d70e346mr635104qta.56.1706835768780; Thu, 01 Feb 2024 17:02:48 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706835768; cv=pass; d=google.com; s=arc-20160816; b=Bm9Xv84T+9ac2l7O6d+Xg1c7rw35W7XmPhSVeh6Jgd8UpADU1+T0uix7Sn40JcPDQU X10Vgs8u7Vhn0HVmyJA6E9C3YkY0pj4mUyFvfG3zsLLcROshtXSGy+lTz1Fp3JoexCnn KFz+UZhFyaOj8Tujh9hwu67WS0xMFMT1zUrR1ZhOiihG7b+dZDWuEXO+iHiuo4P+jPS6 uyAHt2bmHl9s+lo+IBT1uwVL9oYqwJ82J5SRgbByx1vzUofASzji67a9F4Hxhu+f5yWe do8dhZqzMmq5nIwYqclIWDE8AcHBlYT673alZ/yyqVadwdyJIXh6OaXfKWEi7Z7xmLzh jAVQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=wsTpyugK2eyIwPNiJgO9VfKoYo4vEDMCEGSOV2Ub8Ik=; fh=S6sVyBSBC+RT4jgEtfOQeJs/HkDcgLYboF2hVDnysR8=; b=KUQlUZbJrYb/I0iItRLIsNeILYiiTc5qUbv2myOpNYylU0cjRknEKWXPbhZ68cZB4Y RAbu3oHVHRCIhyDPdknOhppED4HIC0K2VnT5SrKJVODOK/YdhQDjpI+/4DYpseO2lSc/ ig8FhrggZSTy8war4AiRjWCHinTHdmnwi4LQhk9vNXecgR5+wNDqLdEKBZkdtydfBI9H /cLs/HHwS0WW4FcLyRsG8ibw0atYO0a/jZgyd0Hl70yXDtae2PZKGBBzCAgfM4kP94iU t+6Jl1PViplbfg6FQPx9xqi1C06tbquHP1ptOGZbSEge3AiqPtKkJduBuEZmXpJizvj2 nGEw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=YrXFGgoe; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-49041-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49041-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=1; AJvYcCWnM32epRO2u6tm4KfZHkohmJZhJIGCwigRo7QNEUu6QqS/EKW1PL5XIIJXZkWAEkEOfYVyvGZZbUz/mJ+wRreSYjeCZiUd5iyh8B3Xzw== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id e22-20020a05622a111600b0042bef93f113si849389qty.26.2024.02.01.17.02.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 17:02:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-49041-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=YrXFGgoe; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-49041-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49041-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 899181C22F13 for ; Fri, 2 Feb 2024 01:02:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B802A63A8; Fri, 2 Feb 2024 01:02:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="YrXFGgoe" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EE92353BA; Fri, 2 Feb 2024 01:02:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.13 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706835757; cv=none; b=aesriCBhk/6TOufXr66rzy0L5ZBJrZLB4igff4iv8HNZeTi/c08uZ4qn/L+D/eJLHUZnLoADvZwrhjUhVzJUk14SdxxQVESsyn+LgmG+l5DHrx7Sw7e9j93A5YpPY60mkpNZtRNEPoRvZt6mvY7iFDLiNw/TWL7k7LmCmPFtl54= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706835757; c=relaxed/simple; bh=zes1QjIgFX8iTfNqPGsOdXG8Tg4Fxj/wCEPnLquZkdQ=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Jxkf17uZhTYOchVlC7uf93poTfqNN7g2IruUrpzkgJXFf4dK4r/GixpAJSmBol6r/LQ55wMODgvAYwah1czYeU4e3mFKA7BDSlSdbEEyfGzTh5KX9PgtzqNquTk26KZF8iBtRc2D2MnSZpkl/Gqv+xb45FM8p64xFJ27ILaxxIY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=YrXFGgoe; arc=none smtp.client-ip=192.198.163.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1706835756; x=1738371756; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=zes1QjIgFX8iTfNqPGsOdXG8Tg4Fxj/wCEPnLquZkdQ=; b=YrXFGgoeQFmSy65mfLhYxndweRQIPK2Ujqv7PraM2yx3HKS22cY+ezZL /NjLBe2k/fG1mc76y6VBaUm9wq3489FGzFjf3GMsZnSs7ItEXwo1zAEkP B2ZBDpSI9QdQjgOhwG5Ed+ZZIgUKujbLCfUN8ltbCNHg8TSGN5XFgnBiK Px26BN/u6KM5aN+8MU9m1oZ6Vf5wGLYA81eRVeVpCt83PmB2EI7FnXHid q/FFs2JOVPG29yxDIz//HIUI5kbmHSaTGoxNkNW6TLgW8QXeumQQ3yZA8 iinnqx/kPXHK1qzkGaLML2IhN9mq0whilp6q2w4QNL+ruCwPCPlFBSQpK A==; X-IronPort-AV: E=McAfee;i="6600,9927,10971"; a="2980024" X-IronPort-AV: E=Sophos;i="6.05,236,1701158400"; d="scan'208";a="2980024" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Feb 2024 17:02:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,236,1701158400"; d="scan'208";a="30759782" Received: from xiaoyaol-hp-g830.ccr.corp.intel.com (HELO [10.93.33.17]) ([10.93.33.17]) by orviesa002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Feb 2024 17:02:31 -0800 Message-ID: Date: Fri, 2 Feb 2024 09:02:27 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v18 012/121] KVM: TDX: Define TDX architectural definitions Content-Language: en-US To: isaku.yamahata@intel.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: isaku.yamahata@gmail.com, Paolo Bonzini , erdemaktas@google.com, Sean Christopherson , Sagi Shahar , Kai Huang , chen.bo@intel.com, hang.yuan@intel.com, tina.zhang@intel.com, Sean Christopherson References: <958dfa60e2570a38b4c4e997be2a72b294e6d91b.1705965634.git.isaku.yamahata@intel.com> From: Xiaoyao Li In-Reply-To: <958dfa60e2570a38b4c4e997be2a72b294e6d91b.1705965634.git.isaku.yamahata@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 1/23/2024 7:52 AM, isaku.yamahata@intel.com wrote: > From: Isaku Yamahata > > Define architectural definitions for KVM to issue the TDX SEAMCALLs. > > Structures and values that are architecturally defined in the TDX module > specifications the chapter of ABI Reference. > > Co-developed-by: Sean Christopherson > Signed-off-by: Sean Christopherson > Signed-off-by: Isaku Yamahata > Reviewed-by: Paolo Bonzini > --- > v18: > - Add metadata field id > --- > arch/x86/kvm/vmx/tdx_arch.h | 269 ++++++++++++++++++++++++++++++++++++ > 1 file changed, 269 insertions(+) > create mode 100644 arch/x86/kvm/vmx/tdx_arch.h > > diff --git a/arch/x86/kvm/vmx/tdx_arch.h b/arch/x86/kvm/vmx/tdx_arch.h > new file mode 100644 > index 000000000000..569d59c55229 > --- /dev/null > +++ b/arch/x86/kvm/vmx/tdx_arch.h > @@ -0,0 +1,269 @@ > +/* SPDX-License-Identifier: GPL-2.0 */ > +/* architectural constants/data definitions for TDX SEAMCALLs */ > + > +#ifndef __KVM_X86_TDX_ARCH_H > +#define __KVM_X86_TDX_ARCH_H > + > +#include > + > +/* > + * TDX SEAMCALL API function leaves > + */ > +#define TDH_VP_ENTER 0 > +#define TDH_MNG_ADDCX 1 > +#define TDH_MEM_PAGE_ADD 2 > +#define TDH_MEM_SEPT_ADD 3 > +#define TDH_VP_ADDCX 4 > +#define TDH_MEM_PAGE_RELOCATE 5 > +#define TDH_MEM_PAGE_AUG 6 > +#define TDH_MEM_RANGE_BLOCK 7 > +#define TDH_MNG_KEY_CONFIG 8 > +#define TDH_MNG_CREATE 9 > +#define TDH_VP_CREATE 10 > +#define TDH_MNG_RD 11 > +#define TDH_MR_EXTEND 16 > +#define TDH_MR_FINALIZE 17 > +#define TDH_VP_FLUSH 18 > +#define TDH_MNG_VPFLUSHDONE 19 > +#define TDH_MNG_KEY_FREEID 20 > +#define TDH_MNG_INIT 21 > +#define TDH_VP_INIT 22 > +#define TDH_MEM_SEPT_RD 25 > +#define TDH_VP_RD 26 > +#define TDH_MNG_KEY_RECLAIMID 27 > +#define TDH_PHYMEM_PAGE_RECLAIM 28 > +#define TDH_MEM_PAGE_REMOVE 29 > +#define TDH_MEM_SEPT_REMOVE 30 > +#define TDH_SYS_RD 34 > +#define TDH_MEM_TRACK 38 > +#define TDH_MEM_RANGE_UNBLOCK 39 > +#define TDH_PHYMEM_CACHE_WB 40 > +#define TDH_PHYMEM_PAGE_WBINVD 41 > +#define TDH_VP_WR 43 > +#define TDH_SYS_LP_SHUTDOWN 44 > + > +#define TDG_VP_VMCALL_GET_TD_VM_CALL_INFO 0x10000 > +#define TDG_VP_VMCALL_MAP_GPA 0x10001 > +#define TDG_VP_VMCALL_GET_QUOTE 0x10002 > +#define TDG_VP_VMCALL_REPORT_FATAL_ERROR 0x10003 > +#define TDG_VP_VMCALL_SETUP_EVENT_NOTIFY_INTERRUPT 0x10004 > + these are definitions shared with TDX guest codes, and already defined in arch/x86/include/asm/shared/tdx.h. Please drop it. Other than above, Reviewed-by: Xiaoyao Li