Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp5719810rwb; Tue, 22 Nov 2022 04:08:52 -0800 (PST) X-Google-Smtp-Source: AA0mqf5m6X4LR1mOhnH3DzUHXkqBnIWAqyIIuBmyCSaTymmIW1HZ+haASswfTrHZrqNxp57fxY9m X-Received: by 2002:aa7:d0d3:0:b0:468:ebf7:4b with SMTP id u19-20020aa7d0d3000000b00468ebf7004bmr19941234edo.231.1669118932460; Tue, 22 Nov 2022 04:08:52 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1669118932; cv=pass; d=google.com; s=arc-20160816; b=BfvM/a6pm4Eb59t3sUxtlbEVMR1jOcCuI1z/AO9G/YOAiiu3JwvbOLQLqMbF0ryacd cZNlUTZ8QaFeETRL31sUqnauqu/sJ1s6VylEvnhabO7cI1flFSdeuo43fWSzkVoM3dp3 nkx/FaZKeR6vqA09mmaZ+CHm9iAUf8WLR9plOpOWNIPok5x9VaU5/rLTXT5t3EgwKJLE Vb5DOFhDLydISaYWMfJsbpxgXR2s7QDL5fC6tcTWelZhUYtTMdW+q8geG/IC9Wg3U4in 6vX7iQXWgsQj7A9B1H3IIwnJ8QcKBGTajU3HGjqYiPkrfmAheAU2DeoPNKNl+MkaAqEk /92A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-id:user-agent:content-language:accept-language:in-reply-to :references:message-id:date:thread-index:thread-topic:subject:cc:to :from:dkim-signature; bh=M4VaQkgMqvDRKFf/ha7aYwUMBnVyo7+Y1dj5bwfzV1c=; b=MizZBP+J5eZmcM9C/h85Lf/L+KRm11PmN80D2JGO2DYjk4S9J1B2A8VFYdCUeRbjto n7+z91sLw3BqX6Iv/i2dkU7DhJtpAfi2yX07KoAeb9hoQ8uI7bGaBA9syPu7Bjq5IdwP IWjFKSkRq9xgkLnnoKB1v/07/HvEdt3Twp1lQ1tQBF2HzRnZPrAkaCiTZFI6ddJQdst4 L1PjVSrtuklWvrKEWx+ym4YKBNcpoIp5IcYk+cFR2ACn2KneyzTVjTBjJHRy2OWEkghU ELvl+7RabneCX9ykV5Ud5J3fGIqgK1i+rApQPHQQiyxArh38i0Le2yLXDi2JmuFzwOek wLhg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="Vlf9/4mk"; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); 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 m18-20020a056402431200b00450c1de6234si2317598edc.587.2022.11.22.04.08.30; Tue, 22 Nov 2022 04:08:52 -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="Vlf9/4mk"; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); 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 S233502AbiKVLns (ORCPT + 90 others); Tue, 22 Nov 2022 06:43:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233445AbiKVLnD (ORCPT ); Tue, 22 Nov 2022 06:43:03 -0500 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E85E065ED; Tue, 22 Nov 2022 03:41:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669117296; x=1700653296; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=M4VaQkgMqvDRKFf/ha7aYwUMBnVyo7+Y1dj5bwfzV1c=; b=Vlf9/4mklSWOtSW2lbCfHH8iK31I2RB2C6Xqq4qNlzTi9DZ+djWneyL1 HHepkmR/In0vffSVLg4Y6OIqBLvwn8wWMfp+Ov9PCpjVpWHjOCZtVXQEd VVnJj154qmP9KZGnhkV1Lp4Rt3087WnPyIYt+55o0w2nXkt1rY0ts4783 HBplJZb8RxWAYjMKVk/CxIywI8YgPV9ZAsc+Zr8glNjOTCyIzJBQ+aqj4 L/pE5rpHnIaQfdALZBzZI3hIz43xCFzolOqA266VAIE/yF+urEMbPcJLI lbtg+4JpjzSPY5k3qUM8cekOfpOW5k/eNElzSBK3DnH0nbGTBh12Wp8Ys g==; X-IronPort-AV: E=McAfee;i="6500,9779,10538"; a="311424055" X-IronPort-AV: E=Sophos;i="5.96,183,1665471600"; d="scan'208";a="311424055" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2022 03:41:36 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10538"; a="619184163" X-IronPort-AV: E=Sophos;i="5.96,183,1665471600"; d="scan'208";a="619184163" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by orsmga006.jf.intel.com with ESMTP; 22 Nov 2022 03:41:33 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 22 Nov 2022 03:40:48 -0800 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31 via Frontend Transport; Tue, 22 Nov 2022 03:40:48 -0800 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (104.47.56.49) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.31; Tue, 22 Nov 2022 03:40:48 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hhRD4hxcztwS3of1VZm4S+4PuoaT40vcLmRskMglkmZQGj1q6y0Gidf+MB6u7ROWsPpo0x1ewzO6/czpQ4GvryfUhkRZlCkCLokt7yD4SatvF4zTra/KaBB2HTRM8Kt6iCT/Of2SistqJP89hR/Z2Thr9mEImM56+yvGz0YqH8NacXdSEsP+lh1DErom5WWrO8EBLivXbhUBVVp6ojRVVaJT9BWEOLtsk9QIluR0qjj8+UNyGIPgMuDs6GmRDVily3/3b1r+thQxUsDk68pdidXJiPh3ZSjz6UdIaW/7g5dZAw/Y+PvqjcVdszjDiUmeajxs+JHOece+LHh5ETi1VA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=M4VaQkgMqvDRKFf/ha7aYwUMBnVyo7+Y1dj5bwfzV1c=; b=kxcRnGP4HsCslpbM9+PCDHkiScgYQbHmkw9sb3rMfxW1ON/Lc5Fs+HIJJ4hFa+hym0TIPpIK1z/5z+d9E9qnZrZ2udE8yyZbLf7M3DV0fdx7nKH/qedzGeVyOnOeCGP9j+xWJV0XWt54sHoc4ge8J/O98CZ2Nnc2zsQcowweKvuM9NsXJboQfOpXZLahYW/WPQAn5OitP5Jrx+H8UKaojxJZU/MGCsDsQLFGZzEx0MoyDkv+0lz5/DaEk63izXrN3/Nv0sZV6IlSKVrpgqI+aDtXzspPsemJMEVRN/oVYX0ZDdpgx+4MJsA4rKzrAnEY+W5twPfNqy0NqMGih9pQKA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from BL1PR11MB5978.namprd11.prod.outlook.com (2603:10b6:208:385::18) by BL1PR11MB5384.namprd11.prod.outlook.com (2603:10b6:208:311::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5834.9; Tue, 22 Nov 2022 11:40:45 +0000 Received: from BL1PR11MB5978.namprd11.prod.outlook.com ([fe80::2fb7:be18:a20d:9b6e]) by BL1PR11MB5978.namprd11.prod.outlook.com ([fe80::2fb7:be18:a20d:9b6e%8]) with mapi id 15.20.5834.015; Tue, 22 Nov 2022 11:40:45 +0000 From: "Huang, Kai" To: "peterz@infradead.org" CC: "kvm@vger.kernel.org" , "Hansen, Dave" , "Luck, Tony" , "bagasdotme@gmail.com" , "ak@linux.intel.com" , "Wysocki, Rafael J" , "linux-kernel@vger.kernel.org" , "Christopherson,, Sean" , "Chatre, Reinette" , "pbonzini@redhat.com" , "linux-mm@kvack.org" , "Yamahata, Isaku" , "kirill.shutemov@linux.intel.com" , "Shahar, Sagi" , "imammedo@redhat.com" , "Gao, Chao" , "Brown, Len" , "sathyanarayanan.kuppuswamy@linux.intel.com" , "Huang, Ying" , "Williams, Dan J" Subject: Re: [PATCH v7 10/20] x86/virt/tdx: Use all system memory when initializing TDX module as TDX memory Thread-Topic: [PATCH v7 10/20] x86/virt/tdx: Use all system memory when initializing TDX module as TDX memory Thread-Index: AQHY/T3KCI/2IUKL7kSgXbHXnV3Az65KuuYAgAAZIQA= Date: Tue, 22 Nov 2022 11:40:45 +0000 Message-ID: <8181ea2e5f59a69496ec24282173b27a90330e47.camel@intel.com> References: <9b545148275b14a8c7edef1157f8ec44dc8116ee.1668988357.git.kai.huang@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Evolution 3.44.4 (3.44.4-2.fc36) authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: BL1PR11MB5978:EE_|BL1PR11MB5384:EE_ x-ms-office365-filtering-correlation-id: c0429103-ac90-409d-c305-08dacc7e64b7 x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 5C11V0KilzaQk+WnZRRSwH5somSbGC8WSH4tgaJN5bvZ9VoGOQ9xb1ZG9XrhKSzx16TxHiLfh1OCpo93vWEQ2849zredihQ+1sAAtrTqxRW0Ekopzinzv/IlfUjwLH4qUovbft3iauF1Okg9niodueXZ+dmAv0xMEJsUlO4ZXfqiglPtx3T8GeTvy1ZhfVgmXrW2UVHJVq+dj+6589CRAQwGtOFjV1CVfWB12MJYb/0hdpCE22yEJxNtAEAUPXij4VStKt2E0JiC9seyD0XVC5BGZTUTJn2WGa+jbZvdeNgB6h3DgZrAa+sGeGq2/qzg9MAPOA/5Yk82r1kp5rltgzC3Pohxv10rKV/cfmtg9wTpKjPne3kpIvZNQVZ3HGJRreleL4EJz4JBSKXayLPJ03bZPdJfILW9i47EDYAQt02D6bfabYo0AaaLoQQ9Kop0vA9X5RlACCkpRDB48ZnwxSySavCoXA+C0CBTPLDEVoFWgEmm4ijWuc5pr5LTlF78zMgmRnlrD10xFblLGyrLV+xVSYyNLfmQnh4d9mh9eVvG9MzHJAl3KW5pgJnnZ1UKKP3hv5Yn+DFKIa0u6S6RAX+mLAFizoZtWHN59vp7cFEiaxu/VIzLf837A5pwkmmF5x/TE7pApNRX8k7xX1P2RlVwzjKoo1/yhXd/cad0DgFG3mrKoZfe4r65siv9t+ObYwIPt1gvjkx3FRUmZcleaw== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BL1PR11MB5978.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(136003)(376002)(366004)(396003)(39860400002)(346002)(451199015)(38100700002)(6506007)(478600001)(6486002)(86362001)(71200400001)(122000001)(83380400001)(82960400001)(316002)(186003)(4001150100001)(36756003)(8936002)(6916009)(2906002)(54906003)(2616005)(76116006)(26005)(91956017)(41300700001)(7416002)(66556008)(38070700005)(64756008)(4326008)(5660300002)(66476007)(6512007)(66446008)(8676002)(66946007);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?B?eGh5cDRxRmRVbkdnTzlLaGpISW8rb2o5emNSUGZnZGl4T0tjLzRGOUlMVHB2?= =?utf-8?B?OU1JZmVCVGdWemt6VXRVVkRyaUlxSlIyUG1ibk03VTBXd2xPb0YxTVp1eENT?= =?utf-8?B?TzZyL1cwWGNQYVBwckpVb2E4YWlldVhHc2o3TkNzWllBVCtsOElJdmVsdmQ4?= =?utf-8?B?U3ljRlpmMm9KWkhuQStZeHUveW8yR20raktBdE4yVm1YQVZLTnJUKzNiUXp1?= =?utf-8?B?ZGtPODRkbmkrYy96dEtQRzZkMGN6QWpOMXJpL3liWHRrR0x1aUhxam9wYXFG?= =?utf-8?B?M3lsNkN1MitNQXFuUnc3UlZMek5EYURtd05tQkp4RERFS3NTZ002K0RwaUJS?= =?utf-8?B?M3gvelkvcU4ycVZaOXdkbjVBSjIyWXIy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PSTZKb29X?= =?utf-8?B?MGc9PQ==?= Content-Type: text/plain; charset="utf-8" Content-ID: <310A0F5080923C40B5C50AA8CD68907E@namprd11.prod.outlook.com> Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BL1PR11MB5978.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: c0429103-ac90-409d-c305-08dacc7e64b7 X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Nov 2022 11:40:45.3588 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 0fPI8hq/oxoF5aMCeW7Qtr3tL5K7LBtGOkLRwtPi8KH7aIJyHwJpberNV33epeyDOTVs6cbi/Ri9BDFMagiNsw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR11MB5384 X-OriginatorOrg: intel.com X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 T24gVHVlLCAyMDIyLTExLTIyIGF0IDExOjEwICswMTAwLCBQZXRlciBaaWpsc3RyYSB3cm90ZToN Cj4gT24gTW9uLCBOb3YgMjEsIDIwMjIgYXQgMDE6MjY6MzJQTSArMTMwMCwgS2FpIEh1YW5nIHdy b3RlOg0KPiANCj4gPiArc3RhdGljIGludCBidWlsZF90ZHhfbWVtb3J5KHZvaWQpDQo+ID4gK3sN Cj4gPiArCXVuc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