Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 66592C64ED9 for ; Mon, 27 Feb 2023 21:28:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230005AbjB0V2l (ORCPT ); Mon, 27 Feb 2023 16:28:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229589AbjB0V2j (ORCPT ); Mon, 27 Feb 2023 16:28:39 -0500 Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7419D1D932; Mon, 27 Feb 2023 13:28:38 -0800 (PST) Received: by mail-pl1-x62c.google.com with SMTP id p20so7026815plw.13; Mon, 27 Feb 2023 13:28:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=slLNr0NsMjriSSsni08kykPIRKfCMvPjbEMyeTQjtz4=; b=ciuVNWCc4LBkN1dXsxMRgZuSJP6Tn2yb576/zRvm+Ie1bFDljvvkgWH5FtSch18HWs 4KdSo8A98AMGVAHPuo1hDAkG6t4EkybpMw89ClGO4KV5Xt4pQKa0Alfv/K99VZOhcUvt VBfCO3IHUlGke2q1sEjBUERqNhv4mdxpS2of4VO1rpYq9rTelJSwYP5WFUeOsaKCg6Ak vht/Hn2ww7rqsNeaZxCi2UAqpPRmwFVBuaijk62u9nOyn9sYbC3r8p8Y3nyLnPNyXnXe YiySTke7+yTCWvAqKJL+nTw+IcVB/Go9A71u08iMXdYB4Lvad7jo3V1jLbV1ctRKSSQw o4SA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=slLNr0NsMjriSSsni08kykPIRKfCMvPjbEMyeTQjtz4=; b=dDS1pjE6BGHJ8AjDoxIRRrA8+u25f6QDk6NkzH0AVPlVHq1ku4DxonXzDgXrE6f/+K 3qCXmp+/8LAfETpfy39eZfqVy5BJ2oE1uUjlRSKfws1EL6mUs8nPzFBujoddXwt+mvmD kR8viQtPMjMl/rqcbotBjL38Z9qPTnz2ExD072MzuD7rjQekFpWTIHCx+3rgdpPkqw/B abGW7/MWnF7fZYM1jAVf0o4QYrpsJd08U4A7uJOwUtaFW7xT6nwSyX4t/RPl14d+8Wea 1ck1AVgmANG0jiZAa1n2yy++HgQZvcxsYPfNxV3aERg45uvM+9oYU/Fa84mXmjjXXSam pMow== X-Gm-Message-State: AO0yUKVXAf2kNJj3EwiXA0y14jVwGRNr9LZLudHdxSTi985i2lzHxvoI IZt1bYtpaLziYyU3P4ZktLDt19FZq6g= X-Google-Smtp-Source: AK7set8J6y0a5InH1v6RPIeTqs39FOmPTUAxnkRfo2h7jDT1hIjec2MnnsR/3gA1qQ4QkK+oFWwOmg== X-Received: by 2002:a17:90b:1a8a:b0:237:35f9:655c with SMTP id ng10-20020a17090b1a8a00b0023735f9655cmr592150pjb.36.1677533317877; Mon, 27 Feb 2023 13:28:37 -0800 (PST) Received: from localhost ([192.55.54.55]) by smtp.gmail.com with ESMTPSA id o4-20020a17090ab88400b0023086d280c5sm4792885pjr.3.2023.02.27.13.28.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Feb 2023 13:28:37 -0800 (PST) Date: Mon, 27 Feb 2023 13:28:35 -0800 From: Isaku Yamahata To: Zhi Wang Cc: isaku.yamahata@intel.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, isaku.yamahata@gmail.com, Paolo Bonzini , erdemaktas@google.com, Sean Christopherson , Sagi Shahar , David Matlack Subject: Re: [PATCH v11 017/113] KVM: Support KVM_CAP_MAX_VCPUS for KVM_ENABLE_CAP Message-ID: <20230227212835.GG4175971@ls.amr.corp.intel.com> References: <01e061779b88ce4d32bbe483ed2bd3224cd8e330.1673539699.git.isaku.yamahata@intel.com> <20230113145507.0000115c@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230113145507.0000115c@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 13, 2023 at 02:55:07PM +0200, Zhi Wang wrote: > On Thu, 12 Jan 2023 08:31:25 -0800 > isaku.yamahata@intel.com wrote: > > > From: Isaku Yamahata > > > > TDX attestation includes the maximum number of vcpu that the guest can > > accommodate. For that, the maximum number of vcpu needs to be specified > > instead of constant, KVM_MAX_VCPUS. Make KVM_ENABLE_CAP support > > KVM_CAP_MAX_VCPUS. > > > > Suggested-by: Sagi Shahar > > Signed-off-by: Isaku Yamahata > > --- > > virt/kvm/kvm_main.c | 20 ++++++++++++++++++++ > > 1 file changed, 20 insertions(+) > > > > diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c > > index a235b628b32f..1cfa7da92ad0 100644 > > --- a/virt/kvm/kvm_main.c > > +++ b/virt/kvm/kvm_main.c > > @@ -4945,7 +4945,27 @@ static int kvm_vm_ioctl_enable_cap_generic(struct > > kvm *kvm, } > > > > mutex_unlock(&kvm->slots_lock); > > + return r; > > + } > > + case KVM_CAP_MAX_VCPUS: { > > Better mention the KVM_CAP_MAX_VCPUS defined in XXX patch in the comments. This already exists as KVM api and documented in Documentation/virt/kvm/api.rst to get the possible maximum number of vcpus. This patch make it settable. -- Isaku Yamahata