Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1112501pxb; Wed, 6 Apr 2022 09:01:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx6UTELCpznf/2KR+b1VXieA2ueXseQxRjwcDl6y8yS5nkMvtM25pCPoem2gSAl0JpQTIJM X-Received: by 2002:a92:ca47:0:b0:2ca:7478:a5b4 with SMTP id q7-20020a92ca47000000b002ca7478a5b4mr24842ilo.84.1649260903614; Wed, 06 Apr 2022 09:01:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649260903; cv=none; d=google.com; s=arc-20160816; b=sQpBZyAbBKTK2UkLVkWTu4nEAmesFIzsrrT5+espghRL6C2OJi7V3vfPXGFA9FmLy+ uRFHCsFAkdLKiN2nZYVg8sPJC0ThEWXIJQJpv20D1EoLbrZfdovGhex251QhMxKPOgFp 1kji7gtNJo2akmOJXmpDA/nroJ1Th/ghm/bmPWZg25XeOZUqjHlFcAacKIXxDdIjBNOu Akwy8N/bre1mgwO01ptQ19x82Uttc2GHu8rLEDQ2fzj8sl5t8M0RlNz3ILIrj2Of2Tyz AkQixqll5jBDn6VBXGFsQYGoznrQ+oK1v23C732e5e2URJxt+8i78qCN2WNit4BXp1qV qiNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=czYEG2s79Hy9lOqd5LLDvlb+7Wd1zq0rVYS2W8uDgNg=; b=RnaudQRvSnijr97JJ0McHqI1xb7Kgjn4No4ck3BeXHUEa6Uat0d8PugQaD3w3UinKT f+knljV155srQl0bjX6RWgWmCau4QFk0qZ3UUz1njRtYVwTgo8JlPB5txEA1RmvSdmNH Vk7ovV8wT6EfOFKy7xYO1ZM0NDmC43ik+j9ItFvbq2HW84t42giMsqPC5fsYz8FTfTWC 3TigKaiiLvk8B26dwF6WhYpfZyGgY8u6JsLvY7y3YUPe2ki64J++gBMMgGQlJt6be91Q 8ocjwayVvMEPlenUoklsVV+jf21tmZrvMiSgQQegjI/tVfn2O1prS4sGf9/0PJO8rL5O Krtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ChZBS4TJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id f7-20020a056602038700b006495808452asi8444805iov.71.2022.04.06.09.01.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 09:01:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ChZBS4TJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5168E1252B7; Wed, 6 Apr 2022 07:50:51 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235066AbiDFOwq (ORCPT + 99 others); Wed, 6 Apr 2022 10:52:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235086AbiDFOwE (ORCPT ); Wed, 6 Apr 2022 10:52:04 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id BE2DC4E1D32 for ; Wed, 6 Apr 2022 04:27:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1649244452; 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=czYEG2s79Hy9lOqd5LLDvlb+7Wd1zq0rVYS2W8uDgNg=; b=ChZBS4TJYROx3tC2sSHgWqZDnA/22Tk5WS6NDRJ9+pEft9s6mQ8BK53B8heRvOz7gumppA U3cdL72ueh0LXR6v+nHFDYzOVe+I52c/2McVZGCkcJ+8DOvJaYhNbbUEudBcNlRJ1t4V9p wb3MG08/2x8PQQ3gJKzJzOPgebMRh+0= Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-635-gcU8zlkrO1q_Jpu_Awuteg-1; Wed, 06 Apr 2022 07:27:31 -0400 X-MC-Unique: gcU8zlkrO1q_Jpu_Awuteg-1 Received: by mail-ed1-f70.google.com with SMTP id p14-20020a05640243ce00b0041cbccbe008so1046186edc.16 for ; Wed, 06 Apr 2022 04:27:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=czYEG2s79Hy9lOqd5LLDvlb+7Wd1zq0rVYS2W8uDgNg=; b=i4b/LkRE19EnapGifX7+xH5VvzAyyrRnzRC+EnSVlX9YfiVapWFCThLdcSFsl9ySYp C6R9VNXOlqYh3G6zGwZLNhL0OSq8zKojyYeXm6YUvWULZCdYMgGvAb97abxumEygh+up XfXHUXDzGsyxTxaZD5JItahW15BSs4IPMGuzsjFY0GmVLAPwZOlTB0CF5FftRRBtax++ W2SqpgYuK02jGjhZfCOYy1KBEcLdHCC6VwtHsNGAMe6zF6om66wYE+jzs5aRjpgFQ4Z9 ejFFSydo+zwyrXp7YP4bWSAd9xGZdNWKS1rI1pt9VZC5KTRXgkzS4XzfjQxVsCrI74cl phrA== X-Gm-Message-State: AOAM533Kbw+9kUC0TX4GdxYP387Wb+nJtJYysv1fUTCXzhmjzUpx86VB HAhBTxFLoef9F5JuopIBWN4pNsuAx8DCQVhvI4kW89KvwOJj+CYQlhxwOm88p4gDUuFA6C4H+gr QREgg4sEVaoqMafh7iKOGRQSg X-Received: by 2002:a17:907:9812:b0:6da:aaaf:7713 with SMTP id ji18-20020a170907981200b006daaaaf7713mr7711219ejc.163.1649244450531; Wed, 06 Apr 2022 04:27:30 -0700 (PDT) X-Received: by 2002:a17:907:9812:b0:6da:aaaf:7713 with SMTP id ji18-20020a170907981200b006daaaaf7713mr7711198ejc.163.1649244450308; Wed, 06 Apr 2022 04:27:30 -0700 (PDT) Received: from ?IPV6:2001:b07:6468:f312:c8dd:75d4:99ab:290a? ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.googlemail.com with ESMTPSA id s4-20020a170906a18400b006db0a78bde8sm6521509ejy.87.2022.04.06.04.27.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 06 Apr 2022 04:27:29 -0700 (PDT) Message-ID: <9cfd5d2f-55e4-f8fc-701b-5917941e0269@redhat.com> Date: Wed, 6 Apr 2022 13:27:27 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [RFC PATCH v5 027/104] KVM: TDX: initialize VM with TDX specific parameters Content-Language: en-US To: Xiaoyao Li , Kai Huang , isaku.yamahata@intel.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: isaku.yamahata@gmail.com, Jim Mattson , erdemaktas@google.com, Connor Kuehl , Sean Christopherson References: <509fb6fb5c581e6bf14149dff17d7426a6b061f2.camel@intel.com> <6e370d39-fcb6-c158-e5fb-690cd3802150@redhat.com> <36df723c-4794-69a8-8d12-ea371a7865df@intel.com> From: Paolo Bonzini In-Reply-To: <36df723c-4794-69a8-8d12-ea371a7865df@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/6/22 04:06, Xiaoyao Li wrote: >> >> Indeed, it would be easier to use the existing cpuid data in struct >> kvm_vcpu, because right now there is no way to ensure that they are >> consistent. >> >> Why is KVM_SET_CPUID2 not enough?  Are there any modifications done by >> KVM that affect the measurement? > > Then we get the situation that KVM_TDX_INIT_VM must be called after 1 > vcpu is created. It seems illogical that it has chance to fail the VM > scope initialization after 1 vcpu is successfully created. I see. Yeah, it makes sense to have the CPUID in KVM_TDX_INIT_VM then. Paolo