Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp941728pxb; Wed, 6 Apr 2022 04:57:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzG5hTE4AtfJAxku86wDUiJCjiLCBzkW6Km8VEpidf+7zFxuwnivwPdYihG36eTF+trRZ9C X-Received: by 2002:a17:90b:4c8e:b0:1c6:d1ed:f6b2 with SMTP id my14-20020a17090b4c8e00b001c6d1edf6b2mr9355250pjb.166.1649246235659; Wed, 06 Apr 2022 04:57:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649246235; cv=none; d=google.com; s=arc-20160816; b=rAX9XiOP8ub1KE0jMadcCmkD2x56d3mnrtLkHwGDujfhHbjb7503hg2rDrEvl3e5oF zTjcmS8wrF1E5o2DEoICDzEpXkgYY5/wYg4lwRCuWUneh7gfAJC1wmIG+mHMptiFcgt6 tjSZKP4FgbBMraN6Fz7Fe+iMtu0mURfjGvyd17Ic61ptHPAIKOEp78GIjf+Mf8hrcuLK LLkkSELcmBmvDGjHzBukG4au9pZ/Lg532f0Vcd9cFQNny2D5s0E9lE3X9ZJyVXpH6EQY 94731oTsnJu1soJy0ix54fNten5TnZWzGVwH7AuRhl+YpF/dNWFneorhpxBXLlc7mVeK vveg== 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=c1Lv+i1PBgFa+gfs5DRpbJ6m0eCPENa4LFWCMUe7Pgk=; b=eB2ar/EfDZPyb+7BNrr2RQafXzou9t5IMyBvs9bptyiZLMU/a1VzJKm99upKuORbXr jWKTNWHfSeKQVZwlM5+SKZSo3WVHdhFfwrwP/ZpwrEghWihh9T7RRNq0Ywxubx1frVCT 55frVIKNJw4yDK8i1krzPbCMDP8Xc4cZfUr9tOLjFkRCku9nAVkCLlcqiLQxVO7yD02Z HFx8v5wsEkgEZCELqzFL6zhgPfb8zYyxfqTra2goJmzVbaYUF2spImlC499Xh094xy6i B21YqscrkQhJUAimSdtnsBTMdS1ZBMkzxsvYmmxCDGvJO3F4A7bQ0OYiAKz6EvDHDlMp vdcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fxvIN8Ww; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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. [23.128.96.19]) by mx.google.com with ESMTPS id f15-20020a170902ce8f00b00153b2d16440si5953359plg.72.2022.04.06.04.57.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 04:57:15 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fxvIN8Ww; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 F0FB36537B7; Wed, 6 Apr 2022 03:19:32 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1380117AbiDEVgW (ORCPT + 99 others); Tue, 5 Apr 2022 17:36:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1381985AbiDEORL (ORCPT ); Tue, 5 Apr 2022 10:17:11 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id AC3521606B0 for ; Tue, 5 Apr 2022 06:01:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1649163681; 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=c1Lv+i1PBgFa+gfs5DRpbJ6m0eCPENa4LFWCMUe7Pgk=; b=fxvIN8WwOn87c6DahdYexpN8Ka3Hj0FlsXDrSfK/c34qYlYxSLBwFAeJrzZkQ5ZOaQIWWx efZDThHgyY571qHgLXf9qGU6ouN14q+NUsaojS3s8/ul/M2xM9JkDKsHGqGjtgwc3PvvYp qiD5ytBSPM2f6Bj5gXIKyefuwxdcfKs= 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.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-556--VAqhSEkMXCvVMot_Lv7lQ-1; Tue, 05 Apr 2022 09:01:17 -0400 X-MC-Unique: -VAqhSEkMXCvVMot_Lv7lQ-1 Received: by mail-wm1-f70.google.com with SMTP id m3-20020a05600c3b0300b0038e74402cb6so1217631wms.8 for ; Tue, 05 Apr 2022 06:01:12 -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=c1Lv+i1PBgFa+gfs5DRpbJ6m0eCPENa4LFWCMUe7Pgk=; b=V/fkrxMsh6dY8jrYWTQ4+TXSB2ZyzNAQIXjF6fA+U98gVYidO6oWtkGBb/wib5JrOj NWgwt9o5zeWymbVvmbIRSvlhgRxDVmgrWSMEBYadoDssnkzEfQaB1AkQAYvVW5pg5TuJ o9HRvU8dS9ctOmKKZ3YOg2mUGTTDUyY3wuw6NQs1CJqwMqY+7lNXJpNm9zDp4P0NKASN ew71FO3Crqvnyq/pgcSZ3L/vjV743l61wjPi0BzQFa5OAAolfWESBoSCg9cWvQxuaVOq jKls/Trmc2IhuFVJPomTG9Zbj+YJtL/qkJJPvRnxv5flD3oEP0AQXhBkXQ5GS/uJ6XBe 2lUA== X-Gm-Message-State: AOAM530zgmjsHxxgjsKlmZjgkNfr9fqweKxG5sP9WQDPGTrkneTYsDVa Y/AJvroGZbBUk25PXKN+t+5bosy4KHo6Q+kzD952tjweRmzftlJ+FSSrTmk1iiZEyyLND45xMo0 t21YUDDhmerwIfEovcLHVzz3O X-Received: by 2002:adf:ba8f:0:b0:1e9:4afb:179b with SMTP id p15-20020adfba8f000000b001e94afb179bmr2726493wrg.57.1649163671583; Tue, 05 Apr 2022 06:01:11 -0700 (PDT) X-Received: by 2002:adf:ba8f:0:b0:1e9:4afb:179b with SMTP id p15-20020adfba8f000000b001e94afb179bmr2726472wrg.57.1649163671377; Tue, 05 Apr 2022 06:01:11 -0700 (PDT) Received: from [10.32.181.87] (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.googlemail.com with ESMTPSA id n2-20020adfb742000000b00205eda3b3c1sm12716780wre.34.2022.04.05.06.01.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 05 Apr 2022 06:01:10 -0700 (PDT) Message-ID: <6e370d39-fcb6-c158-e5fb-690cd3802150@redhat.com> Date: Tue, 5 Apr 2022 15:01:09 +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: 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> From: Paolo Bonzini In-Reply-To: <509fb6fb5c581e6bf14149dff17d7426a6b061f2.camel@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 3/31/22 06:55, Kai Huang wrote: >> >> +struct kvm_tdx_init_vm { >> + __u32 max_vcpus; >> + __u32 tsc_khz; >> + __u64 attributes; >> + __u64 cpuid; > Is it better to append all CPUIDs directly into this structure, perhaps at end > of this structure, to make it more consistent with TD_PARAMS? > > Also, I think somewhere in commit message or comments we should explain why > CPUIDs are passed here (why existing KVM_SET_CUPID2 is not sufficient). > 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? Thanks, Paolo