Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp2842425iob; Sat, 30 Apr 2022 22:22:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwLtbanqA2GJRO/FYvYcR58YmK/OugaxmFhfqCv0mIcjc1Mv0SZxpmUyrS4z05X7EwebRiF X-Received: by 2002:a17:902:d4c2:b0:15e:69c4:bce with SMTP id o2-20020a170902d4c200b0015e69c40bcemr6197510plg.122.1651382527622; Sat, 30 Apr 2022 22:22:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651382527; cv=none; d=google.com; s=arc-20160816; b=q0Njwz4gmESa3pwAQtF9T0xTUoWpzlHfTLnxXHBsY2wI6JITOWS0jsD0c9M//KfRh4 dqhgd/ifVoGXe18gMF1Im7a5gkTtlnJY0BvKNTPENICaSSKW1z/K66bTN2GVFgXV9MPH qP2O4ymytDXTttbPi0WiW0VZNc2NREJYtjy1uEt/iQu8U1y2kHrqUyBFviZueaIHKx9B 4JYo8YPdLPFAhIMKFG283cJoyHNuxpsH71lvlVR/pvZ9a6See4G2qFagdEZouYai6moJ kIMj8N6YVhX3oOP/r5psawVA6UVSRU0bCGjIPcd5ze0P4Qdi1FdII8R5Go7N9QR9jnKf 18zg== 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=Umgz/v9dWoeEsv5OT8dZDWJJieP3jYNbjUlLtE3cahA=; b=emWZXeM4lfTzLRcgRLOqclO4bAqr6XLC/4qSMHpklU69Gjf4xq5t/k/KooPspLx2j6 9LWhDaCICcXauYLaTJNi4LhuaE2wJXXNoLeLq6e0XzgzFl3yTtVRF9Ii3Y4MJBb9dvdU hZiWSbV2z2er1CcCc3FuDjsGgcd40dtMbld5t7DsCiCjP+iZJWNP76yBQ8N1dMfGZ4zz 1j1WYLLXywL9RJ60/VDz+ZBTrU7I49zNpFAy8pmg1/p3qpDEzsWwoC4vckFRpibI/3Wn OZbt15KYImp/6ezVbVJD3seT7sm8JWCFoDEG8az7EdpwK6sUCPOZ4c6GLL3d1JJX4qoG +GSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Im816ewb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l184-20020a6391c1000000b003c186aa720asi2585016pge.645.2022.04.30.22.21.52; Sat, 30 Apr 2022 22:22:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Im816ewb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379400AbiD2RxH (ORCPT + 99 others); Fri, 29 Apr 2022 13:53:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345635AbiD2RxE (ORCPT ); Fri, 29 Apr 2022 13:53:04 -0400 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7AF74D3993; Fri, 29 Apr 2022 10:49:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1651254586; x=1682790586; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=6PO7TJrMwheafNd4JcSQG/q9LVcYu2jJZi/WoopzbnQ=; b=Im816ewbzH10ZU11K4ur7lk5QA+ptUQHg17nidAMQyB83xYvWsxSUzb9 Q5c99g1ykPzyIkCePzUpiNRv9/ymjwLC7aFjGTBHjFe91oaDFyMvzKpDb kJkn3z1QsPgGN+2y0J8bP/4defRfgPi4zEhti0Xde3BucPUjHVzPhs8rL rGC/8CQ7Fqil1ULmYrfuWUEx5ya840wgis4S5+8ddk36zRqDujEtf9Oum kweSxv39zZoF3clC/oY3d+ItWfrnzLe8u8Kn+6JndTHbdAXNLWQI/t+9t FxQE0PRgj+is6JtZIWQei4fF5Jml18zOij8dy5/y7DyH7i2/PbTUrkTme Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10332"; a="291898825" X-IronPort-AV: E=Sophos;i="5.91,185,1647327600"; d="scan'208";a="291898825" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2022 10:47:36 -0700 X-IronPort-AV: E=Sophos;i="5.91,185,1647327600"; d="scan'208";a="582297691" Received: from jinggu-mobl1.amr.corp.intel.com (HELO [10.212.30.227]) ([10.212.30.227]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2022 10:47:35 -0700 Message-ID: <4aea41ea-211f-fbde-34e9-4c4467ebc848@intel.com> Date: Fri, 29 Apr 2022 10:47:52 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH v3 09/21] x86/virt/tdx: Get information about TDX module and convertible memory Content-Language: en-US To: Kai Huang , 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 References: <145620795852bf24ba2124a3f8234fd4aaac19d4.1649219184.git.kai.huang@intel.com> <0bab7221179229317a11311386c968bd0d40e344.camel@intel.com> <98f81eed-e532-75bc-d2d8-4e020517b634@intel.com> From: Dave Hansen In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-10.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_HI,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_NONE autolearn=ham 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/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.