Received: by 2002:ab2:2994:0:b0:1ef:ca3e:3cd5 with SMTP id n20csp490415lqb; Thu, 14 Mar 2024 18:33:52 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVy2HeIIqVt00diiQM2m1siCW6XnAT3JznQr+SxOhueHpg0xBfRjB/syfBZPJXT/ibcFJzf0sDirBBVUxpCuQLcxsiN911EPLIeSoADGA== X-Google-Smtp-Source: AGHT+IGdYe6VFplB6/qyP89FjQJ9Y/tx+B1/tzXu0tfU+6JK+gBPh15fgkS6vevQQsxM3hUaYFOP X-Received: by 2002:a05:622a:1816:b0:42e:db75:3cf9 with SMTP id t22-20020a05622a181600b0042edb753cf9mr11876261qtc.27.1710466432307; Thu, 14 Mar 2024 18:33:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710466432; cv=pass; d=google.com; s=arc-20160816; b=uAd8FV0B6gz/Ac8qG49NEfdjlimQ+UZ7krfJQJcN94lMFjevTClZNj7bKicsJ07uP8 LH/qwbHsyuzXIgCMtK/FVxrj4J955bpZYapOgMI6vxncYvS8Uvua6BpwkRyKe5lsFRTm S/ROU/VG1PgANznYqD6VjyakFWDfvE52BYQE1WPT+fTXF00r5Rs1cXQNqkFYBIgwFHYV ZdQlkdRBBVZ6yrndEI5zoW0qenZHjnv2Z/i8xX3xE0KOyOqILJlRkpomKgelJW4BTO22 lkuc4BSDN4QRwUaPv2c52m4Zt8efrKXt5/nR6qJbqrG65Qwx8Y+sjEG56GqGhq5b/l1L ntyw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=LsTbMhq6KiuvnKC2US/LY65BQAYnDGQo7bIxfYmBp/8=; fh=ej0ioDg9PStGry0H4D6mKK6m2Ltm1w/Op0YcE4fdNwM=; b=xTVy96N8mEkYdQVWz3fn2rk2Cb2bbmImbySX/WQEEjIWtOmwUnBxMnfay8oiX2soIi QyUphDygKmFucfWbVmQYVwbx4X2J0sk2kAFIZh3uvDf1BD2gDo7TbB63P2kkitm44n7y uHQ5mraf91TGZJhVhZ2sspI5mIKcER1mj7NiKuXTTWtG6JUTWvEDNJJ1vpO8AVDdqEs6 QQjaqgHhVX2qKnkLGIlHD7x0KoONoDgzn7ZzFUzsWWMCWyjEm8OZnq1qB7SScHfUUkIk tZ2zp0+fNAqSV35ofpIJTHihI9oXmwzOYYVDE7vAZfEmnaNe0lVFayJuAI4oLdZdODpv lFaA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=RW7VGGNW; 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-103967-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-103967-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d18-20020a05622a101200b0042ef61faf18si2789591qte.457.2024.03.14.18.33.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Mar 2024 18:33:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-103967-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=RW7VGGNW; 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-103967-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-103967-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 F32DB1C21C61 for ; Fri, 15 Mar 2024 01:33:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C86BB63D9; Fri, 15 Mar 2024 01:33:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="RW7VGGNW" 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 9CEEE4C6E; Fri, 15 Mar 2024 01:33:39 +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=1710466421; cv=none; b=ergOhS+139Kobzcd7M0Fm6fx2cdo2Z/WECQ9NvJTBCrBCYIzP8X8XffZNjN/+Aiu1vSURXAq0p7seFrjPJ+SAOp1DfDT7POdEMKTnLE0LpE8sMBw40WT3H8t8omdqBYC2+Fv9cYVAKsL4oJylM0fhqMdlKYAigYK6FnxXbUhHNE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710466421; c=relaxed/simple; bh=v7M7u4Pp7kLd6yUc1nN7ioNoZPIRE2rVYXNjQsyQFBw=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=k9Qc5YOxv3lXtURh1AuAXxPi0smDhske2t+CQkO7QtNTZwrrsEX2WP1/AlrZIlJgCxnGQmFhqr5U/zjiHPC9WwVFpR8kKnIz+dQA0uDveG6mX0zvf8c9gyg8I1t05qBBL64cJxGYr/29e7/N3HlSsKNpZKYn8uHP7W7QtU4k2ic= 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=RW7VGGNW; 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=1710466419; x=1742002419; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=v7M7u4Pp7kLd6yUc1nN7ioNoZPIRE2rVYXNjQsyQFBw=; b=RW7VGGNWHzdon7KbPlxIkhA717p/4Y8oWXai5bjn2A8Ld1KPht9zIXJZ VWneEYPY2ZW8jKU72JJf5O1mDp2lJyRwCAarJayiBvbjuM2TeGcycC/LP 86CO+NvrV+DvDA7PcV3l+gc5jMce+Dg+iIB1W8l1dQ5YS0JRbrDQSu5uj 8MK7hjI6OcE+cgTCo+Wb/8ZcXl/j14zWIiCD2JR49O0IsF8bJqukXWPp7 Ms2imY8otRbn1A59Fl4ciDgnCPVwFAz10M6BwmF0bZGPVaFlTGHdjD5TE 5pl4AtkaHP2rpNGRUx3Cj+2GA5/u94gt0fUZOMR/fOHaBM8PtZlvF7a3f g==; X-IronPort-AV: E=McAfee;i="6600,9927,11013"; a="8258737" X-IronPort-AV: E=Sophos;i="6.07,127,1708416000"; d="scan'208";a="8258737" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Mar 2024 18:33:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,127,1708416000"; d="scan'208";a="12402029" Received: from laallen-mobl.amr.corp.intel.com (HELO [10.209.21.198]) ([10.209.21.198]) by fmviesa010-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Mar 2024 18:33:37 -0700 Message-ID: <54ae3bbb-34dc-4b10-a14e-2af9e9240ef1@intel.com> Date: Thu, 14 Mar 2024 18:33:38 -0700 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 v19 007/130] x86/virt/tdx: Export SEAMCALL functions Content-Language: en-US To: "Edgecombe, Rick P" , "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "Huang, Kai" , "Yamahata, Isaku" , "x86@kernel.org" Cc: "Zhang, Tina" , "seanjc@google.com" , "Yuan, Hang" , "Chen, Bo2" , "sagis@google.com" , "isaku.yamahata@gmail.com" , "Aktas, Erdem" , "pbonzini@redhat.com" References: <8f64043a6c393c017347bf8954d92b84b58603ec.1708933498.git.isaku.yamahata@intel.com> From: Dave Hansen Autocrypt: addr=dave.hansen@intel.com; keydata= xsFNBE6HMP0BEADIMA3XYkQfF3dwHlj58Yjsc4E5y5G67cfbt8dvaUq2fx1lR0K9h1bOI6fC oAiUXvGAOxPDsB/P6UEOISPpLl5IuYsSwAeZGkdQ5g6m1xq7AlDJQZddhr/1DC/nMVa/2BoY 2UnKuZuSBu7lgOE193+7Uks3416N2hTkyKUSNkduyoZ9F5twiBhxPJwPtn/wnch6n5RsoXsb ygOEDxLEsSk/7eyFycjE+btUtAWZtx+HseyaGfqkZK0Z9bT1lsaHecmB203xShwCPT49Blxz VOab8668QpaEOdLGhtvrVYVK7x4skyT3nGWcgDCl5/Vp3TWA4K+IofwvXzX2ON/Mj7aQwf5W iC+3nWC7q0uxKwwsdd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B2l asInUTeb9EiVfL/Zjdg5VWiF9LL7iS+9hTeVdR09vThQ/DhVbCNxVk+DtyBHsjOKifrVsYep WpRGBIAu3bK8eXtyvrw1igWTNs2wazJ71+0z2jMzbclKAyRHKU9JdN6Hkkgr2nPb561yjcB8 sIq1pFXKyO+nKy6SZYxOvHxCcjk2fkw6UmPU6/j/nQlj2lfOAgNVKuDLothIxzi8pndB8Jju KktE5HJqUUMXePkAYIxEQ0mMc8Po7tuXdejgPMwgP7x65xtfEqI0RuzbUioFltsp1jUaRwQZ MTsCeQDdjpgHsj+P2ZDeEKCbma4m6Ez/YWs4+zDm1X8uZDkZcfQlD9NldbKDJEXLIjYWo1PH hYepSffIWPyvBMBTW2W5FRjJ4vLRrJSUoEfJuPQ3vW9Y73foyo/qFoURHO48AinGPZ7PC7TF vUaNOTjKedrqHkaOcqB185ahG2had0xnFsDPlx5y In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 3/14/24 18:17, Edgecombe, Rick P wrote: > I guess there are three options: > 1. Export the low level seamcall function > 2. Export a bunch of higher level helper functions > 3. Duplicate __seamcall asm in KVM > > Letting modules make unrestricted seamcalls is not ideal. Preventing > the compiler from inlining the small logic in the static inline helpers > is not ideal. Duplicating code is not ideal. Hmm. > > I want to say 2 sounds the least worst of the three. But I'm not sure. > I'm not sure if x86 folks would like to police new seamcalls, or be > bothered by it, either. #3 is the only objectively awful one. :) In the end, we actually _want_ to have conversations about these things. There are going to be considerations about what functionality should be in KVM or the core kernel. We don't want KVM doing any calls that could affect global TDX module state, for instance. But I'd also defer to the KVM maintainers on this. They're the ones that have to play the symbol exporting game a lot more than I ever do. If they cringe at the idea of adding 20 (or whatever) exports, then that's a lot more important than the possibility of some other silly module abusing the generic exported __seamcall.