Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp3012306lqp; Mon, 25 Mar 2024 16:59:34 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW6id5fOSj26hWUT2hRsAhKZlB6kWztSbbB4QsqV6DMLrqoHwmWQ94TenuTuUs7Nm4Cr76IWI6z5KB5Ir2/ZH0S8FHT9k8NVMjGONwT8w== X-Google-Smtp-Source: AGHT+IHO9e0zxm2+Ih9an0Heosf2Pbn9dPV3z7R2uJyuZQ+N2yHDYJPFocKHEkfgGnjFhhu8/aFq X-Received: by 2002:a05:6358:7242:b0:17e:bbaf:406c with SMTP id i2-20020a056358724200b0017ebbaf406cmr10321559rwa.28.1711411173798; Mon, 25 Mar 2024 16:59:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711411173; cv=pass; d=google.com; s=arc-20160816; b=cco6/VqqJ1HK7WYw7JgqvlNB4036mCzg1aVN/P3VIJ6oVNF/93xtmB70aTvH4QDgcd 8wWv2jKv7dOEtt0iWd4o317l7FyvrVYOPVOGXGrVmzuvM6dzFmcNzMm37w5+qrHzGtJP 9FiLAIjuKii1kqLchtX/fIm5lAwo/XDj1GaOr4X2ynGRBQ1ynWFD52AZeISBsbvvj1cZ ylRe1VvO+IZ9n0wvgDyZ/d4Wxp+00+utjq8ltXC8NEpRZzGWhI1Q4gXisn6UXRhEUemP gK0hp7QcnfwtSmRbkh8vmQ5s6ZPgEH7KsaWfCDZozRUk7qsw/Ih0BgyRgmV8kMcK3rdj leEA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=zQHYhh0WzKU49nQz4Br1ft1rcbjv3n4NvqNNecd1uvU=; fh=3AxyFqin56CXUd0FY07+usupXY459FffwzxDgxCFiNU=; b=LUxTydGgOu2iiJk72xe74apsa/MyfhvPkDp/Z5E/VJl4b3wSeL4iyZa5c3RsZiKxS9 HqTX7q6G35NMcvGzRE3DnHYWpEzUp+fN7ZSl/EhnUhh62L3Xbaa6zsGRv28xpy9L3BAF W2obqyOUz65IXRmer87h7/7092BpKfAHSZB925wEAhVm41OsYwYU2gkw+083I+QRzoVe /hOmEs/lPi+iXiZtg8GOS8zLVuje4+rWnyvN1vrF1K05vaBf4Cj9OEY/81FJpYesTo7u 611qzdCi46cJ/QH8AHG5IIMz7u6wtu4rMd8uFs84hHt9n13pHNubAqGC6prdaZJmIZLZ KS6A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=DZGH87cD; 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-118199-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-118199-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id i14-20020a6561ae000000b005e47d608cbesi8183641pgv.134.2024.03.25.16.59.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 16:59:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-118199-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=DZGH87cD; 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-118199-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-118199-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 675792E862E for ; Mon, 25 Mar 2024 23:59:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 01B3586634; Mon, 25 Mar 2024 23:59:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="DZGH87cD" 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 9AF2D339BF; Mon, 25 Mar 2024 23:59:19 +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=1711411161; cv=none; b=jFjB7cvY7MH45xdRjY2f0ejdiTNqFuw2BJ7sZkyV2ccRHW482SjbUAA6vbmPPuxrkp6aMiFpEL9j+d5YFhcZIqWqA2yVF/JqbQSHNxUow70fRAWKHstEhZkDs0hOR3nCKh5GMuN7P+GKwqnb41I7XIAJE+wVznJKIChYsT7Ogz0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711411161; c=relaxed/simple; bh=weMSH2HY5gtyciUxIFxfYnwP9q0mVKBCRDJIjHcLgeE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=UaOrlEg96dlGilwzcqlEC3RKVZoZ7HQQ/4RC664teNUW25XOE2Ti9vPJYF968GwT8FiyCS/NsQLcROi9zfBu8mtEoYsszgshrJnoKzmZUUWCng2zhsPNrrWQYIRR67HUIl51xXLILbABr7TPaJq+Y9k9tVF/gUr03T9YKvkgnhc= 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=DZGH87cD; 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=1711411159; x=1742947159; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=weMSH2HY5gtyciUxIFxfYnwP9q0mVKBCRDJIjHcLgeE=; b=DZGH87cD1zkE+Xotd1TyPxAiL2lgkjFaGGP0wkJF8kQtHcJcqyM2QCmB zI6ZwhBrwXKc7RilBBgXJp9rEUSB9LG1R9wVPoWQoOZPYFteMWILwJLYb UD6FgY843NWPdebNtQW8nHPV6lNYayk10rPkCwUL8iW5UjAte2bb+7ILx Gw52LmLA09V8MEnEqcr36KAisTYgnp82gPIQdPDpm6EBsrAV/1N/QQoQH hqWXW/R8Baf/L/Rsl8W1wkzb7/Os3j3J1ne1liOtQUp1qnLYmC2mQ/vW1 2pdZQWs95qoZjtw2unIfNciEwFu/HYP614ebNUov2zxkkDwFXnzzVqg4E A==; X-IronPort-AV: E=McAfee;i="6600,9927,11024"; a="31880425" X-IronPort-AV: E=Sophos;i="6.07,154,1708416000"; d="scan'208";a="31880425" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Mar 2024 16:59:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,154,1708416000"; d="scan'208";a="46938419" Received: from ls.sc.intel.com (HELO localhost) ([172.25.112.31]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Mar 2024 16:59:18 -0700 Date: Mon, 25 Mar 2024 16:59:18 -0700 From: Isaku Yamahata To: Paolo Bonzini Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, michael.roth@amd.com, isaku.yamahata@intel.com, seanjc@google.com, isaku.yamahata@linux.intel.com, rick.p.edgecombe@intel.com, xiaoyao.li@intel.com, kai.huang@intel.com Subject: Re: [PATCH v4 05/15] KVM: SEV: publish supported VMSA features Message-ID: <20240325235918.GR2357401@ls.amr.corp.intel.com> References: <20240318233352.2728327-1-pbonzini@redhat.com> <20240318233352.2728327-6-pbonzini@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20240318233352.2728327-6-pbonzini@redhat.com> On Mon, Mar 18, 2024 at 07:33:42PM -0400, Paolo Bonzini wrote: > Compute the set of features to be stored in the VMSA when KVM is > initialized; move it from there into kvm_sev_info when SEV is initialized, > and then into the initial VMSA. > > The new variable can then be used to return the set of supported features > to userspace, via the KVM_GET_DEVICE_ATTR ioctl. Hi. The current TDX KVM introduces KVM_TDX_CAPABILITIES and struct kvm_tdx_capabilities for feature enumeration. I'm wondering if TDX should also use/switch to KVM_GET_DEVICE_ATTR with its own group. What do you think? Something like #define KVM_DEVICE_ATTR_GROUP_SEV 1 #define KVM_X86_SEV_VMSA_FEATURES 1 #define KVM_X86_SEV_xxx ... #define KVM_DEVICE_ATTR_GROUP_TDX 2 #define KVM_X86_TDX_xxx ... Thanks, -- Isaku Yamahata