From mboxrd@z Thu Jan 1 00:00:00 1970 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 5B3FBC4167E for ; Tue, 5 Apr 2022 21:37:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1380162AbiDEVgc (ORCPT ); Tue, 5 Apr 2022 17:36:32 -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-Google-Smtp-Source: ABdhPJxNzI5PD1sS5Vh0+bMeeZnomXZHkWuWTcu1XLTQ/uRuaUVRxMlYuIfdB8IaN0F1ErzpxtndZQ== 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 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