Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp193491iob; Mon, 2 May 2022 16:50:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJymd2wUN3F8unbim/zrAu7PsC/8/ww+4s5WK3I6HpBo8CXd997DV3zJSKCu4xTQAMBdBr9Q X-Received: by 2002:a17:90b:3908:b0:1dc:710e:643 with SMTP id ob8-20020a17090b390800b001dc710e0643mr1763908pjb.210.1651535443335; Mon, 02 May 2022 16:50:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651535443; cv=none; d=google.com; s=arc-20160816; b=PDZjckUj+/HDhH2nvfdQ6yjzTE4KLnoI3UQP9z4VbHP3g5OOPXdIIzQg4Jo0HYWCef rEYFn1Uidi0jN2ihxBzT1aqO5PA4G6uoiUV83uQVpTdug5T//LwC7Twr9igJl/jytF6L 1Me9vj1ELshwvIO+C2MyiUobVvz/pyuoBTkD+YZeiCqMbUM5jT0y8FCC4hDWEsnIns0M 8r8oY8d2VT5AfkvbCas28WxeEvdEdPvgBG4HpNqhOM5iKewifbi3WYdyNm9bikJl731y /xy1lswPfycI3WNMB2gg4PlxU2AdicoA7gIL86/LEh4GIUk4WqabePOw9GgLYSH3lhTs 1VNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=9uQFoBa1PmRu4xrfc/w8Z84KD9lEVX8qHgwOu09/S5U=; b=j8VhsWymZ+tcjsiVs7CtZ8hIgC9toWPoB2RL8ddD3DyqmKszyq+dQusKfd9ISIjGmF AIdJhZNH9RvPQN+Ywb8Wfrx96Qj2a1snKvDgjgvn7xCkDsUrrBR35D637fYQ65K1ze0l k3JX01f6NSxMSdJvW2r6wil/YZJWYS9HC7mXM/Gppr0GUUqbmrf4ZoTZak9b61kX5KaN KsqWh/0iIylE6NuCvhMnbcL6+6Ay1/y4UNAOQuafnwLLI575LUzK7M97OVD+Mf0znifp EIaefC5M+ZLUWlWRlFSBX5NfA6oQcvIo37iHBE2y7yS9D+uzzu89Fo3YYajXb0YE17qH YSvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=gVJwl2PM; 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=intel.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id u11-20020a170903124b00b0015d1f275e43si11179292plh.368.2022.05.02.16.50.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 May 2022 16:50:43 -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=@intel.com header.s=Intel header.b=gVJwl2PM; 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=intel.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 600A7B80; Mon, 2 May 2022 16:50:14 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1383304AbiEBFHg (ORCPT + 99 others); Mon, 2 May 2022 01:07:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346303AbiEBFHe (ORCPT ); Mon, 2 May 2022 01:07:34 -0400 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99B5E18B2F; Sun, 1 May 2022 22:04:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1651467847; x=1683003847; h=message-id:subject:from:to:cc:date:in-reply-to: references:mime-version:content-transfer-encoding; bh=V1kJORjn9br3AwkVpZzF5nhWVGElfcC89uM3ZN5Q7cY=; b=gVJwl2PMfLj6VpOQNkWMvxOuwhnAbKplGGK7G3Jx+6gZ4rezkXjKajpA c8RWIIhQeXMK2jjKjrvEnTdT7yRsIvV0cWSjmSNvtc/LPAnI/EfUubqxm cAyhG6BHvQBQB93ydUfndyLy4+X+09MAiv2wfvVS1vIq0dNbeZDgm2Aik aNc8vmIyLluBVXhokmeBTynPPmZCzZybP7v81IY8Nati2m6bn56Iy/Aky 64jmCvA/Jfwhud+rjagttrRqwGwN1H5iRuBw8oxYBVfmPUMlQ81dUIAq2 Hm5O2c0unCMlzpAyd7sFP4NRpdsYvxCAuWlwC8+Uv7FO8mFjn5l67cowd w==; X-IronPort-AV: E=McAfee;i="6400,9594,10334"; a="247674779" X-IronPort-AV: E=Sophos;i="5.91,190,1647327600"; d="scan'208";a="247674779" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 May 2022 22:04:07 -0700 X-IronPort-AV: E=Sophos;i="5.91,190,1647327600"; d="scan'208";a="886061235" Received: from bwu50-mobl.amr.corp.intel.com (HELO khuang2-desk.gar.corp.intel.com) ([10.254.2.219]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 May 2022 22:04:04 -0700 Message-ID: <33e3c91973dd22cada87d9c78e3e4b9eb4da9778.camel@intel.com> Subject: Re: [PATCH v3 09/21] x86/virt/tdx: Get information about TDX module and convertible memory From: Kai Huang To: Dave Hansen , linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: seanjc@google.com, pbonzini@redhat.com, len.brown@intel.com, tony.luck@intel.com, rafael.j.wysocki@intel.com, reinette.chatre@intel.com, dan.j.williams@intel.com, peterz@infradead.org, ak@linux.intel.com, kirill.shutemov@linux.intel.com, sathyanarayanan.kuppuswamy@linux.intel.com, isaku.yamahata@intel.com Date: Mon, 02 May 2022 17:04:02 +1200 In-Reply-To: <4aea41ea-211f-fbde-34e9-4c4467ebc848@intel.com> References: <145620795852bf24ba2124a3f8234fd4aaac19d4.1649219184.git.kai.huang@intel.com> <0bab7221179229317a11311386c968bd0d40e344.camel@intel.com> <98f81eed-e532-75bc-d2d8-4e020517b634@intel.com> <4aea41ea-211f-fbde-34e9-4c4467ebc848@intel.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.4 (3.42.4-1.fc35) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,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 Fri, 2022-04-29 at 10:47 -0700, Dave Hansen wrote: > On 4/28/22 16:14, Kai Huang wrote: > > On Thu, 2022-04-28 at 07:06 -0700, Dave Hansen wrote: > > > On 4/27/22 17:15, Kai Huang wrote: > > > > > Couldn't we get rid of that comment if you did something like: > > > > > > > > > > ret = tdx_get_sysinfo(&tdx_cmr_array, &tdx_sysinfo); > > > > > > > > Yes will do. > > > > > > > > > and preferably make the variables function-local. > > > > > > > > 'tdx_sysinfo' will be used by KVM too. > > > > > > In other words, it's not a part of this series so I can't review whether > > > this statement is correct or whether there's a better way to hand this > > > information over to KVM. > > > > > > This (minor) nugget influencing the design also isn't even commented or > > > addressed in the changelog. > > > > TDSYSINFO_STRUCT is 1024B and CMR array is 512B, so I don't think it should be > > in the stack. I can change to use dynamic allocation at the beginning and free > > it at the end of the function. KVM support patches can change it to static > > variable in the file. > > 2k of stack is big, but it isn't a deal breaker for something that's not > nested anywhere and that's only called once in a pretty controlled > setting and not in interrupt context. I wouldn't cry about it. OK. I'll change to use function local variables for both of them. -- Thanks, -Kai