From patchwork Mon Feb 26 08:25:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Isaku Yamahata X-Patchwork-Id: 206347 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp1938421dyb; Mon, 26 Feb 2024 00:31:30 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXolT91r9hYgj2dU8sM6tNPVhRtFClWmxMA0bkWIbrgR/1UOFBWi69h83MfinDqmilR6NdbMkyeh8Da9lkPhjBBaN8uTg== X-Google-Smtp-Source: AGHT+IHUKFoIK1a3kenr692AkvBT+5ar/ZhntS5cfhT5xfTkMGICpWsANl+anQMhNctlNi/qLLBh X-Received: by 2002:a05:6402:1845:b0:564:56e0:5643 with SMTP id v5-20020a056402184500b0056456e05643mr4079205edy.27.1708936290611; Mon, 26 Feb 2024 00:31:30 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708936290; cv=pass; d=google.com; s=arc-20160816; b=RJl5bBHDg/931KlsSZnxfo5HU0Z0FssGEaxRLbb62U1P/NQ3byBf6afYszL0ZYAq18 MrHjEsJ3mPDZky561VGBe3k+AQGlV82ZrzoE6b3iImfY5XMfksSt1nuX2lrkBcZYmRoi gpIXR3BSYqgkLc8dF7uSMplcncJ8+UKUDEp0VwgdJ1+x+YztNf2rx4EHTehAn+NnpWmX OWU0v6O31DBAVHVOdXELJm0QRjzMvhKbi1cSvh6k0JdvuOLT4pWSnSfx8sdtZRxJZaZs S+S3hO1uiZxc/ztzb9vwKAMrLRLdqLFCjfy5Ox+nMQPHktlIOdy9KNfph2Z6Kb/mkDHd jSLw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=acS8BDgYo6wD170aKV0Q0eZuGK3S+90SEuEeztzlQ4U=; fh=Itbyk7CEvizIrzGEESCqq3I2tZgG1kc/GkVOa3S7Hsg=; b=Vx8s1/K2sOFVUk1IJV32dKWePBix+BiQyQm8PYZGCAFo7By6DRjrbi8RNSOmJ5xbEF g0xZt0cZ4cXDqyCrfP5pBZNiwemo43A0g22P6Llvx0iVy0S8RV9qSJYIDL1kGOEKr55y FPndSKe473AO3JWwMMibVAG/ghwRbxy3sgWaTOsxLvzTA+z/DGISBQBR5KQDQ4XmpVrM cOJhY/Ho975MvDBhJ+SvuF3iG7gG17xuii6+HqKtqOuKW2sySmBbTalkP32KxnMHb5Ia 7kgiy53yH00PdxIiGeEgU/7mjxxIedd52rZJWaUEPOMuhLUuij2xJUotOZKZagioBcFq 0KrQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=VwLS2EQl; 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-80768-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80768-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id o5-20020a056402038500b0056455567553si1976621edv.236.2024.02.26.00.31.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 00:31:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-80768-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=VwLS2EQl; 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-80768-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80768-ouuuleilei=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 am.mirrors.kernel.org (Postfix) with ESMTPS id 2334C1F23EF4 for ; Mon, 26 Feb 2024 08:31:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 473EB4EB5E; Mon, 26 Feb 2024 08:27:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="VwLS2EQl" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) (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 064DA219FD; Mon, 26 Feb 2024 08:27:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708936062; cv=none; b=QFT12y6QG2nHYsGQhNv/fbiwqqSQA/1mR4aq+lXeyjfSVOFE8aAZGIpOlR9YgHWUBukXKA7k1NYqn+Y//A0GiRlhZ5KxuWdFwQKneCvooJq5jvJIU8apStEMHGcvPFEMqglthbtJGPXFjrip6Athm1gHwO9+nkpW/FlsS5acDIg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708936062; c=relaxed/simple; bh=jlfMA54rdGG+IPOKGOPLVKDQtiL3/PSTjptpBZUxEnw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=N2DpACiIFUnOrKHlPyLMt2r1o+1vtoi62te3UUrVY7L5kukc0krhHyMBnYAqxVqyx5LIQWNilUkoK42/APWXbyL1/yM61XqZevPtWUwScA4hk7b6MHarnrEgN+TifgttvPjND1rQSu/vy5XqHRLOlC4XRSQ6sq/zcVQFVu4EpV4= 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=VwLS2EQl; arc=none smtp.client-ip=192.198.163.7 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=1708936060; x=1740472060; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=jlfMA54rdGG+IPOKGOPLVKDQtiL3/PSTjptpBZUxEnw=; b=VwLS2EQlknHA1ShFnNsgAuvgmOM3dSUKMujoqfDPG1+ILG+vLryL5QXf aOkpbIG3vqUhTpqQwgszKeN7EoE6xGuyS3zZksIEpz4JWQQdu1T/p564I ooiqkIcWMs6wYlJ8rW9sQln++97hv34Eps4WB9Ys7afkQKG/VMuTOtrNe ssYa3kTCm5ydEyk99ywfAVo36P1I7At8I72tM61ecpoi+MHhEgNkkkmlJ RYQs2xRHsiFuiyCyvqaXs0vbYmJbYxx0gemOUrd2TVf4OruT2rIPoY9dQ +6TvoaG/WgpyY+pWTncVoI8uteUXc7V+1rS3RJ2U2lEcRon0JgRWZbX2W Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10995"; a="28631452" X-IronPort-AV: E=Sophos;i="6.06,185,1705392000"; d="scan'208";a="28631452" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Feb 2024 00:27:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,185,1705392000"; d="scan'208";a="6474307" Received: from ls.sc.intel.com (HELO localhost) ([172.25.112.31]) by fmviesa007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Feb 2024 00:27:39 -0800 From: isaku.yamahata@intel.com To: kvm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: isaku.yamahata@intel.com, 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 Subject: [PATCH v19 007/130] x86/virt/tdx: Export SEAMCALL functions Date: Mon, 26 Feb 2024 00:25:09 -0800 Message-Id: <8f64043a6c393c017347bf8954d92b84b58603ec.1708933498.git.isaku.yamahata@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791949579657560549 X-GMAIL-MSGID: 1791949579657560549 From: Kai Huang KVM will need to make SEAMCALLs to create and run TDX guests. Export SEAMCALL functions for KVM to use. Also add declaration of SEAMCALL functions to to support CONFIG_MODVERSIONS=y. Signed-off-by: Kai Huang Signed-off-by: Isaku Yamahata --- arch/x86/include/asm/asm-prototypes.h | 1 + arch/x86/virt/vmx/tdx/seamcall.S | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/arch/x86/include/asm/asm-prototypes.h b/arch/x86/include/asm/asm-prototypes.h index b1a98fa38828..0ec572ad75f1 100644 --- a/arch/x86/include/asm/asm-prototypes.h +++ b/arch/x86/include/asm/asm-prototypes.h @@ -13,6 +13,7 @@ #include #include #include +#include #ifndef CONFIG_X86_CMPXCHG64 extern void cmpxchg8b_emu(void); diff --git a/arch/x86/virt/vmx/tdx/seamcall.S b/arch/x86/virt/vmx/tdx/seamcall.S index 5b1f2286aea9..e32cf82ed47e 100644 --- a/arch/x86/virt/vmx/tdx/seamcall.S +++ b/arch/x86/virt/vmx/tdx/seamcall.S @@ -1,5 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0 */ #include +#include #include #include "tdxcall.S" @@ -21,6 +22,7 @@ SYM_FUNC_START(__seamcall) TDX_MODULE_CALL host=1 SYM_FUNC_END(__seamcall) +EXPORT_SYMBOL_GPL(__seamcall); /* * __seamcall_ret() - Host-side interface functions to SEAM software @@ -40,6 +42,7 @@ SYM_FUNC_END(__seamcall) SYM_FUNC_START(__seamcall_ret) TDX_MODULE_CALL host=1 ret=1 SYM_FUNC_END(__seamcall_ret) +EXPORT_SYMBOL_GPL(__seamcall_ret); /* * __seamcall_saved_ret() - Host-side interface functions to SEAM software @@ -59,3 +62,4 @@ SYM_FUNC_END(__seamcall_ret) SYM_FUNC_START(__seamcall_saved_ret) TDX_MODULE_CALL host=1 ret=1 saved=1 SYM_FUNC_END(__seamcall_saved_ret) +EXPORT_SYMBOL_GPL(__seamcall_saved_ret);