Received: by 2002:ab2:2441:0:b0:1f3:1f8c:d0c6 with SMTP id k1csp212612lqe; Thu, 4 Apr 2024 04:46:34 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU7cOWXVXAfOJpCprDQmYMd38pn40mTtfWY+64vxf6OQnxEHzgarniaV3/HHTkhd1cPGcwrYm0hKt531GL1WDuUTclc2iZCDtpJpnJIqg== X-Google-Smtp-Source: AGHT+IHHJI62BjeSzvtNBkUT2NBaz/PAvlcLkgq6mgjCnf0yWyMs8zQ9CjtJWYu20Ui+O2pDYrxv X-Received: by 2002:a05:6871:5ca:b0:22e:93a0:fcbb with SMTP id v10-20020a05687105ca00b0022e93a0fcbbmr2374162oan.34.1712231193811; Thu, 04 Apr 2024 04:46:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712231193; cv=pass; d=google.com; s=arc-20160816; b=JePWTbhW0IjUjDi77zee3QyF2DQ9AxLkvCBm+GP1XFjx01TICQYixZ02jF2Yof4tOW svfQy51G32PpoUS1kUr8KpIqVhCRSOxpFs4XjDqso9IAyHxYNmdpClVsE5P3eECdN0GU XwlivMqVtuOAKIQNP9HViUIt1IutzO8SbGKRG/jRimyHsDy0wtT9InSSry+fg3rChJCy I9mU2A8LS9zWNH2tTHHnZsoYRxS8xw2RdBvUdNm5shQstX97Xrb99KoOgvRWkkgQ7bnf E60qA+uf+FnXW4rM6bFDSTqUuWaFkvzo1DlFIyBuIlzUndwFgZnWg46YRdWEg3QVBJol Aswg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=os6s6yWf+KEySppA6UtqmMO50Okp6hSrMyagRzZf4EU=; fh=PvGaw4C6ibJpzVG4ZB2/6zDw5yS97QGFOte9tu4jUaM=; b=JBMUpOFK9xjJK4IqSZIOKiC04xk1ZAsRyJGb7WLY2OaO/zNM3CgLnQ335m88W1yzNg t0kP92BaM6Aw5i0dGXBdpUd8fMj7Wn4BE+tAUrhnUDlVzAsi2mVv5NuoHzN3puWz+J+j COnoHRNJGSRd1JBKINCmzBecp7RwjgOqBoJGAaGITN47XiHqaCMpfHtgCKkT/eEjv9sL qQMPsMk7Fnt0ZYJMSQW5xefb1hbpXN1TAY5XUGsiT7IEtpkOOgWIYuvTeszXjrSM/ueI fvq2/7Rwe3aVQ8yp/IDWXb9Pe60il6fqhAGUwPwEiVn8qu1VIGFQNTrcG+9haxP/KPcC HDQQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=imXQUNzc; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-131327-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-131327-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id n6-20020a635c46000000b005dc8280f3b1si15578272pgm.303.2024.04.04.04.46.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Apr 2024 04:46:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-131327-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=imXQUNzc; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-131327-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-131327-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.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 798A7288203 for ; Thu, 4 Apr 2024 11:46:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7B19F84D13; Thu, 4 Apr 2024 11:46:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="imXQUNzc" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 173F27F7C8 for ; Thu, 4 Apr 2024 11:46:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712231182; cv=none; b=HYaCmvYIivqF3E3Rf0/zyUUUh1+bv5T3bSbG096XsWh8Mu9qjQEsv1Ydd4hVJ0Yf9dvok7mhMmhdHWujYOik+FAVWmtQvj67YCfDMR7iBJF6BgGQbMN4ydjhlKeePQI+CETV8lmkFj2HUmau93CIIHBsUpiq2CyZrzCzI1zhgz0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712231182; c=relaxed/simple; bh=VnjSFH3iLfjXOB26l2DmGIorjHrUwNNABt8C5zuouVo=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=nFJZwd+zaoGzd4vmkT6gkT+nBBmkOpG3mZlYzVodMREGaPL50QDtnogQtzERh9nsl4g9ONpIAgMuPCIyTNRy2q1P5+yNva12vD8mDUXuU8KoyKxAMUUx3ej6zZE2fM4LIOiPLNK2FgF2b6x//SR5htLNfjXOH1+tSVTWpACwS3Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=imXQUNzc; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1712231180; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=os6s6yWf+KEySppA6UtqmMO50Okp6hSrMyagRzZf4EU=; b=imXQUNzcWUb0Nhh1PAPCYqStTV1hHsnngk0JKEJ0Pz+cy71DOaOyiOiOR2mSqIQ73wiRcJ 4rkAa0dnGJMQMMrymv7pMgSLJCmOkExefRIMN8fyWqSKO/09h0njQAOlTnrrqYFYCk1P+U 9naBG14CuClBiiXJL0jjKvIZTd/XhwY= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-499-CF5OnI8TMomglNjle7QUYw-1; Thu, 04 Apr 2024 07:46:18 -0400 X-MC-Unique: CF5OnI8TMomglNjle7QUYw-1 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-4154b265b93so4461585e9.0 for ; Thu, 04 Apr 2024 04:46:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712231177; x=1712835977; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=os6s6yWf+KEySppA6UtqmMO50Okp6hSrMyagRzZf4EU=; b=JUqfiHSBedIPj6QcAsJ+ZS16JOLfI1DkrWO4I87+pLG7TGFwG6/J8N4snthgLw6VYq UKxGgQwnTxw24WM1UKFEiZSJsHUK6M6fIFRT7UhoU1QBcpoZca8P/EYFxZf5dPmu74gt VQuPsE512r1fiVybz8dVK6mOvpoYlrSfPukfT216RxKtbCpoRkgGkxjY7KMADEccMg9D +hhyVFNeLdOEXrasASxxrZ20oL4XhL1ciJxy2kfgGaq1FetI+ksnbXl2rgMS2puRwk+C 3fAn6z+Ocsqo+N6+QavUrLuQ9/V9rAna7/N6llWgOnGIgraHESasD9+F3AWLwW6VjwlO 8Tog== X-Gm-Message-State: AOJu0YzRmHPtUv43kfp56SeMx+bL3FBybqJWCevgkeVxq52V8txGaczb IjEeOh33YqNWeVbBr0O+HzxBF9b2sSEWbns4QODMu9jWl/SOOEaiQdBhgSsTGjo2ZMvgk3JelkE LgA/FvtCH9lTs/h6auOfcJiOJtJQVV9IKU9z1axiGrp2K195GkGhsF7cPudSgTzavZ35eHSFeG9 VniTNMLvXaCen0rk5zYQYG3wWdT71cijwEOoeE X-Received: by 2002:a05:600c:3b18:b0:416:23d8:e88d with SMTP id m24-20020a05600c3b1800b0041623d8e88dmr1516449wms.26.1712231177625; Thu, 04 Apr 2024 04:46:17 -0700 (PDT) X-Received: by 2002:a05:600c:3b18:b0:416:23d8:e88d with SMTP id m24-20020a05600c3b1800b0041623d8e88dmr1516437wms.26.1712231177219; Thu, 04 Apr 2024 04:46:17 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240318233352.2728327-1-pbonzini@redhat.com> <20240318233352.2728327-6-pbonzini@redhat.com> <20240325235918.GR2357401@ls.amr.corp.intel.com> In-Reply-To: <20240325235918.GR2357401@ls.amr.corp.intel.com> From: Paolo Bonzini Date: Thu, 4 Apr 2024 13:46:05 +0200 Message-ID: Subject: Re: [PATCH v4 05/15] KVM: SEV: publish supported VMSA features To: Isaku Yamahata Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, michael.roth@amd.com, seanjc@google.com, isaku.yamahata@linux.intel.com, rick.p.edgecombe@intel.com, xiaoyao.li@intel.com, kai.huang@intel.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Mar 26, 2024 at 1:04=E2=80=AFAM Isaku Yamahata wrote: > > 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 initializ= ed, > > and then into the initial VMSA. > > > > The new variable can then be used to return the set of supported featur= es > > 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 shoul= d 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 ... Yes, that's a very good idea. I've added the group argument in v5. Paolo