Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp15172591rwb; Mon, 28 Nov 2022 08:40:41 -0800 (PST) X-Google-Smtp-Source: AA0mqf5jZDzOC68MSCMQ4dsbHrCBCuR4TiquRNxLMqDPvY2JdOFyfG87f7gzF5xVN9gf/E6JWbUL X-Received: by 2002:a17:906:43d8:b0:7bd:7455:a196 with SMTP id j24-20020a17090643d800b007bd7455a196mr11802235ejn.71.1669653641598; Mon, 28 Nov 2022 08:40:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669653641; cv=none; d=google.com; s=arc-20160816; b=s5DjpHBjmXlOwXQJPA/n/KkhHp4B8g66K9SQXN6QO35sTErV6s3u2nkbDMo2XaKAic iVlLKp7MjpNJMsjdrDLuwikErIy0qzr61+2MuTisK9OM1aCt7HN7PvEaKE4kJ2mubAYD jl+x5G7ZfIQsoXY/Wy1aqtSjDUXrdd04zrLg1fBtwqCON8CDn5hHgvshapvhAkOFBY4X IIoxHi4ezEYkD9+zAsdIXNWtty9HE5O6xBTUW+Mj1620z1SPrAzdtaSA1U6hqJLoGfc5 6jmcTIFRNg6hIHniIBBY4r9QJINXsdWo9vyHWLu9OAf6qdMchrbTcO7iqkIBOIdkKpNV Wn1A== 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=PaQlo6kF1FJ/vES2B3DtmeB4QuaBrthgLkssGsqVCwE=; b=TD/WCaueZWGQg6aLFJjeAowyTG+tf3XFAzDvDUT2kSZlOgs/jfFUYYjzJ9Xe8DMv7V 6LSDy8H8+WQfc1BTJRSh+YqY/7FS6qgLh3WYyFikqnNCEUIu/QJ+V5dxpKVV0d/AQUew mSbER6edrbuJgK+WJcgx4x0yZCqyae2pip8yLbL8NPGLPCeMc7Kojp4+esUVRktIKIxI xuqow9o2CNUOWZr1M0uhX/y6APfC7BzDpBguz9Lqbi1c+DlFXSbc2CMrrwTzYYeYYX1S nrQVa00FG7s4tgqXkrpauGD5/eBiRtasL2yPpZ7YsOQK1suhhlWjqtcgb9vvOiL9rniv iWqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=gzQzd5E9; 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 q12-20020a056402518c00b0043dfc949d31si12249867edd.25.2022.11.28.08.40.20; Mon, 28 Nov 2022 08:40:41 -0800 (PST) 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=gzQzd5E9; 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 S232481AbiK1P7H (ORCPT + 84 others); Mon, 28 Nov 2022 10:59:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231295AbiK1P7F (ORCPT ); Mon, 28 Nov 2022 10:59:05 -0500 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A22FBD4; Mon, 28 Nov 2022 07:59:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669651145; x=1701187145; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=3tU9/Uz/QDW6gglhWujOCtVfQoXZYicKEy0KruTmQC4=; b=gzQzd5E9Jw0ljae6qw2RYqT3OSS2EjDq+3is2gcTs3wMQ+rPAoPWCWi8 l2r1aUdJpRuX74ybJLGQ38tVN+h/wnoEbIBsJn1ewLFHEGzUcy3RFid3v G3z8i803bqOcGrlBCeNM2HioIe5g9DkYkO2HUWhcTEkaCngZnS3jBBkoC cQEv3p+IP9hAmnM3SgX0ESrAhETBLBcCLImn7GOoOb393llAOOCn5fO5x rI+Nrl/VV4U6ObRj6Q9/s1Wxf9KKmhnNJqOIVeMnkYuIXDfGcWZnfEYNJ 1FUPkPYTb5h+2sPJYNGJxyMTlcgoFnJsff9Uh6pTrz9PypnaEo5P43KHC A==; X-IronPort-AV: E=McAfee;i="6500,9779,10545"; a="401159356" X-IronPort-AV: E=Sophos;i="5.96,200,1665471600"; d="scan'208";a="401159356" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Nov 2022 07:59:05 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10545"; a="676088566" X-IronPort-AV: E=Sophos;i="5.96,200,1665471600"; d="scan'208";a="676088566" Received: from nroy-mobl1.amr.corp.intel.com (HELO [10.212.209.4]) ([10.212.209.4]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Nov 2022 07:59:03 -0800 Message-ID: <9a653cd2-70df-8c55-ac7d-5ddcb3b18b0c@intel.com> Date: Mon, 28 Nov 2022 07:59:03 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [PATCH v7 11/20] x86/virt/tdx: Add placeholder to construct TDMRs to cover all TDX memory regions Content-Language: en-US To: "Huang, Kai" , "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" Cc: "Luck, Tony" , "bagasdotme@gmail.com" , "ak@linux.intel.com" , "Wysocki, Rafael J" , "kirill.shutemov@linux.intel.com" , "Christopherson,, Sean" , "Chatre, Reinette" , "pbonzini@redhat.com" , "linux-mm@kvack.org" , "Yamahata, Isaku" , "peterz@infradead.org" , "Shahar, Sagi" , "imammedo@redhat.com" , "Gao, Chao" , "Brown, Len" , "sathyanarayanan.kuppuswamy@linux.intel.com" , "Huang, Ying" , "Williams, Dan J" References: <32c1968fe34c8cf3cb834e3a9966cd2a201efc5b.1668988357.git.kai.huang@intel.com> <6d4d429a-ade2-771d-0e4c-788bef45041a@intel.com> <35aee96c1bb56322191ae442f3928d7dff064a92.camel@intel.com> From: Dave Hansen In-Reply-To: <35aee96c1bb56322191ae442f3928d7dff064a92.camel@intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.7 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_MED,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 11/24/22 04:02, Huang, Kai wrote: > On Wed, 2022-11-23 at 14:17 -0800, Dave Hansen wrote: >> First, I think 'tdx_sysinfo' should probably be a local variable in >> init_tdx_module() and have its address passed in here. Having global >> variables always makes it more opaque about who is initializing it. > Sorry I missed to respond this. > > Using local variable for 'tdx_sysinfo' will cause a build warning: > > https://lore.kernel.org/lkml/a6694c81b4e96a22557fd0af70a81bd2c2e4e3e7.camel@intel.com/ Having it be local scope is a lot more important than having it be on stack. Just declare it local to the function but keep it off the stack. No need to dynamically allocate it, even.