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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2C825CFC5EC for ; Thu, 10 Oct 2024 18:28:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 73AEA6B0082; Thu, 10 Oct 2024 14:28:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6C3B96B0083; Thu, 10 Oct 2024 14:28:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4C7766B0085; Thu, 10 Oct 2024 14:28:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 2AD6C6B0082 for ; Thu, 10 Oct 2024 14:28:48 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id E9C791C6B85 for ; Thu, 10 Oct 2024 18:28:43 +0000 (UTC) X-FDA: 82658528694.09.7411488 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.10]) by imf15.hostedemail.com (Postfix) with ESMTP id 38D9FA002F for ; Thu, 10 Oct 2024 18:28:42 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=PdQQLMLI; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); spf=pass (imf15.hostedemail.com: domain of dan.j.williams@intel.com designates 192.198.163.10 as permitted sender) smtp.mailfrom=dan.j.williams@intel.com; dmarc=pass (policy=none) header.from=intel.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1728584786; h=from:from:sender: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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=ns9xgw4f9v8E0Kdc2OToc0wNUv/NZdiixVhH/JnHHSU=; b=0I4oYVbFu5WUGuIAyqcnYnI240wi8CdLmLx4rV5TWdUeT3+pNTfHz0pA0aV/Us7C7ClZjq +J36foBajgPAo7iS1cRHSIorvB7oVD2wYTEXBy8DCBHBFjAIYkJr7b+O3nAdU5GhnQlG59 bZSMW6qgC2xMAVHuiQSXh9eIuxQ8Zyw= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1728584786; a=rsa-sha256; cv=fail; b=PxQYfR+/81TlOd9fuv3tAZKqL7FCxNaYVv+azVAudUq8A+LVmXtr68MTdVwJk2zGYClH2+ 4QsiH2Io5GsOZpxSfraWUm4zBWG7gV0Muz5NK3C3/DllOQg3mT9pn1Z6rzhSSuzkUxRhBd t1vS5DsmyhgJlinAA0db9mkb69WYqew= ARC-Authentication-Results: i=2; imf15.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=PdQQLMLI; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); spf=pass (imf15.hostedemail.com: domain of dan.j.williams@intel.com designates 192.198.163.10 as permitted sender) smtp.mailfrom=dan.j.williams@intel.com; dmarc=pass (policy=none) header.from=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1728584924; x=1760120924; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=BKkjJRnrDjE5wI82iaCrKGMOboCx8fvc+NfHE4xCdjc=; b=PdQQLMLILVLD0QbZuShsSCnQfnxltmHA6QZ9Bj0ueE31gc7WY09tldY4 0CsUWfBHCQxnJMYmrFdfJ3BSgfnP5sbyUrRmXWmmeDy/MmO+/ilr/zD1o +WAgecv2D44tFnH77UhbF9QxSCSeY/T1bNrZskcHDneAV4l3WY9aoHFHb vNVRfuD0q4XnxDwnwXijPC66n3A7bmhUmWf24saf1iooSmMIGXEcPYT1w DJHZaUMhJ7/G1yNmEdUCbL3AUc1rtARHXUA+1L6gctmPesGmydH/coOev FdbgoWMv+E6YI1eGox8PvXJJiHRSsJ6HbS+P8PVecixZnp7AKkZUSRu7k g==; X-CSE-ConnectionGUID: JBmRjhWOSKG2uejWWAZyoA== X-CSE-MsgGUID: pDHCwJc9QO+6dv6WrQ+a+Q== X-IronPort-AV: E=McAfee;i="6700,10204,11221"; a="39335695" X-IronPort-AV: E=Sophos;i="6.11,193,1725346800"; d="scan'208";a="39335695" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Oct 2024 11:28:42 -0700 X-CSE-ConnectionGUID: qN7amqfSQaKPjKBQdIJg1g== X-CSE-MsgGUID: 0us3RiIZQxeU3CJUzwmVKg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,193,1725346800"; d="scan'208";a="76601968" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by orviesa009.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 10 Oct 2024 11:28:42 -0700 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.2507.39; Thu, 10 Oct 2024 11:28:40 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) 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.2507.39 via Frontend Transport; Thu, 10 Oct 2024 11:28:40 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.174) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Thu, 10 Oct 2024 11:28:40 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=xbMWwXKN7XH8I8CemUTBQv9KOyuTwrX4I+09b3GrDYqgIt5FqeIj/7Nm4At5xkKW9URMQjDOcjYQEON2Oq8l1fT/SpuOzxv8YMakcQqgQp0Y8uv136IYrhIC7bQTU86vj1fHiNgP8mWDpPdFV3ulOsJxArbGwa4kO+bPMovHTXHYB8XjAEqlOt+QgBpH6B3NCvq25J+DnzUZeK7vAP05t7HeiYmHvQioEX9j1u7f4Bc5jPxIBh9s+Cs8TpRLcDdrYTIP+QH/C3Z07cFo10bzCwmG4vNz6ZqoAl4MZZ3Vcw8uf9NpGJe12d5tp5xcBXz3HMBKlpVOaj7d0GjqohJxsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=ns9xgw4f9v8E0Kdc2OToc0wNUv/NZdiixVhH/JnHHSU=; b=NdaE6k1dNl0dCWxR86Jw7vhggnmFEqCRqp1+VyPlGvCoEmV1k5gpFbLYhIkbCwHcg6fPPR+n5JEqZUd6pAg/sHJaRKqY4bEkTHRd3ohOdeWSS7CfQYVXvorAq5pJ49UQacVPjpu3g19okeIghx6CakWqbJIScRzh+xL+6yN5YYKN+0/5CSzJgcEX/r/cek5L56mD8E6k62BjvFmkK1AvkpZJ5p9i3ZBg0v05dYaSnr0ApPtTj7OaQnVNWZ1ZpHTIPM80PHT5wAsfpCL1Y9KwulTHfuVnM+FeDM5jS1leqnH7+Gk0ezoCotdYXIT8YPZHFz9ZGyVkynKkFOWwyQud1A== 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 PH8PR11MB8107.namprd11.prod.outlook.com (2603:10b6:510:256::6) by SN7PR11MB7565.namprd11.prod.outlook.com (2603:10b6:806:344::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.23; Thu, 10 Oct 2024 18:28:33 +0000 Received: from PH8PR11MB8107.namprd11.prod.outlook.com ([fe80::6b05:74cf:a304:ecd8]) by PH8PR11MB8107.namprd11.prod.outlook.com ([fe80::6b05:74cf:a304:ecd8%5]) with mapi id 15.20.8048.017; Thu, 10 Oct 2024 18:28:32 +0000 Date: Thu, 10 Oct 2024 11:28:29 -0700 From: Dan Williams To: James Morse , Yang Shi , "Dan Williams" CC: "Huang, Ying" , David Hildenbrand , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "Kirill A . Shutemov" , , Andrew Morton , Oscar Salvador , , , , Kai Huang , "H. Peter Anvin" , Andy Lutomirski Subject: Re: [PATCH] tdx, memory hotplug: Check whole hot-adding memory range for TDX Message-ID: <67081ccd93dfe_964f22949d@dwillia2-xfh.jf.intel.com.notmuch> References: <20240930055112.344206-1-ying.huang@intel.com> <8734lgpuoi.fsf@yhuang6-desk2.ccr.corp.intel.com> <66ff297119b92_964f2294c6@dwillia2-xfh.jf.intel.com.notmuch> <66ff5dd3b9128_964fe294ca@dwillia2-xfh.jf.intel.com.notmuch> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: MW4P222CA0024.NAMP222.PROD.OUTLOOK.COM (2603:10b6:303:114::29) To PH8PR11MB8107.namprd11.prod.outlook.com (2603:10b6:510:256::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH8PR11MB8107:EE_|SN7PR11MB7565:EE_ X-MS-Office365-Filtering-Correlation-Id: 2bac24ac-5f30-44cc-b09b-08dce9595852 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|7416014|366016; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?uBLi2tOQqjeWZPDw0ThJDLxAFzW8jQJaAudiGcNg+seF59EuIOuUq0yGuItx?= =?us-ascii?Q?X6dLPiSEE8KBRrWs0mC42dpNmLmk93//yHU5vXMfD2IuYV+C5iwtPwLOKmTC?= =?us-ascii?Q?H3+QQA6ainXzJZntU4z2G3QBJv0PogGKLRMiOsXy0v/LCycY7jnPzfqV2nub?= =?us-ascii?Q?pN/XyyH9Ff745OTXON5TKIyA/emodoFScsRH6ja1ZllfXHvbxaYxrNjQqQLO?= =?us-ascii?Q?m78xU5KIGio2Vpy1N9iFqrYSfVV1dPxWrxe6QbKQr0rPnsa6OVHTZH3jsxjp?= =?us-ascii?Q?bn1NSj4z35V4P3UPPLkPy2hU5WeKNNPpHG1tY1vnszy17HLgJDFBS5aKZkKD?= =?us-ascii?Q?SN57G77c9TFI0jfvex/wlNkesNMcz39wAmkImO7x3q46QJTrgKB/Bz+YWs+5?= =?us-ascii?Q?1yjCSDsisdCI/gk6dKpO4wl57IvRw9j1bQSpEpBr62mUvnN6Bpvx1b50nonR?= =?us-ascii?Q?HO1fDgNWZdXqwUFIij/i2LRl30K9xvqDn4lPmg4+T0p+yxP5dCHca20cRGpa?= =?us-ascii?Q?K2mV1m+I5U1h6TOn7C7NEctZmvT0eqdQzwAEao1Vf49uiGs3J5WJw0GRPM7Z?= =?us-ascii?Q?n9W1AIPcxfhwSCfafo/PB+Y7FXqDhrRwtwCrAcfbwlUiFD3OWZ0RLOT5j/9L?= =?us-ascii?Q?r9Xu7KWK0+jn81qDJ6JU2ktOzgxpgCU/lNnBAqVcdqwoV9exy9GNGr1zKDIe?= =?us-ascii?Q?nA497rK+7DR1Qaay96fbhRkax8H2ppvY9VQzTAVQvHlrKQRsuvbwemiBnwyH?= =?us-ascii?Q?ICHacK7WofQIHsIVBCLJvzf6HuTFMwDIxMP4BEOg9ksyqN8KL0VQjpUNK3S5?= =?us-ascii?Q?bChNIr/32GLJPOKujqx8kwWHfLzkYjzJK791wfOXMA4lHHil23mtf2v9wmwd?= =?us-ascii?Q?aJkcB9B6wB8jMfCeHv5u1F/Otk1DelWAhdXcar1jDH5Th+JP/kozgcfwtXLD?= =?us-ascii?Q?i9RIafF/y4dzxCZ0g1OetS6nSfe0fa2aEqJe3as6ildVXIuh61ictma8Z/HS?= =?us-ascii?Q?yfz23gQlXt2SJpZ+sQmS8ylyQ2l/L9ki/37NHaRBQol5YRGG8yapprJoVQiW?= =?us-ascii?Q?OIQguQS/wj8uCgbh6TL2Nd4tO1KAFg9bV3uDOLWIOtzELi2mGUoNCW0YRrep?= =?us-ascii?Q?c8ju2yEBo1T8lAahh7sG8RyNnWj2bEORitt1ZCFV5faLtCi5LcY+7uAnZ5YY?= =?us-ascii?Q?yM9jXkPLUAQ+hoxrfgFCBINgVOdq5zrJ8qYsTmrY6E5ans3QHSC+mDpvGKA7?= =?us-ascii?Q?0EmKdG0cPEdepaAb3bYwhSKpbytAdnyXX/prPdo92g=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH8PR11MB8107.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(7416014)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?d2zCeiIvOKwBd6rX6RoODY6PFLWU2OV1RHRKw+NS3Sb4XAXb439o/qXDijmz?= =?us-ascii?Q?BItOlB0hX6AIqwNYlXXLJVK/9aKW3MC4kuFIa7lcSrFtjw2LqtwWSd6tCb01?= =?us-ascii?Q?7UgmD2U0nmQ8Mola6P2BHOqL/E6+xKBMHKn4dsXmNWejDIUoxniwnWxhsHtb?= =?us-ascii?Q?Y1aTHmdOuAsyT463OcJr54DPeeYvV4j1EYiDaYTNocuYDtjrusSVoRR5mOgG?= =?us-ascii?Q?+TdjLaaLmO2ieZh2/P8k19j9c+DG40RZbRBhNAY3p3oUPxH0t3j+/baIj15Y?= =?us-ascii?Q?gYwmnFUtQLB4qftcxV0n+YxQJYtisarreFo6OpLd9rY3AMOGSxvF8+ZzyuNU?= =?us-ascii?Q?2d+VIT94n1BtMqLEK+T5HE39ebQom0jdEoMWrHct+Mq6fg7z29kJ+gDDJP+V?= =?us-ascii?Q?1AcbKC6t1NUeNKJOACcEV5jm3JgepsOu3UNOW5JOk5MqWLNs9k4YMGjfsAkv?= =?us-ascii?Q?b5fyUh6GEVQLGXcStoa6tJsJUelfp/WEbAfVcrDSiGk+iJiERhJIPoU7xu3d?= =?us-ascii?Q?TVLFIB1BizraLW/HwPgvL12xXZLTY2/UEO+4XaxuvJwbGk2fCJSwEZ8w8AY5?= =?us-ascii?Q?jfqs6V+6a4G4fv5yNAusiPCq/utxWG4L1WoxCTln54V3ZCQnQOsbNzHMZxvz?= =?us-ascii?Q?7qZDHMM1Ie8gPz505cAv8dbU/Fy/cyiS2GkjbKwCFpuo7eviDDryb20g2iuF?= =?us-ascii?Q?6vkCfLSPaV4FWtnzcQ8Ai2DdpirWjCloRDOh2bXxCx6Z5qxMcUb/PiZF/jE+?= =?us-ascii?Q?qDS0swSMt0RwfTy361JhWj7d61SFSCWzt2QufQP1zRvN/JT9fcm5iFVcD1ai?= =?us-ascii?Q?MJu9RPtJzEYjBtet4ufWpJHf1GPaIZeBsT6rQ7D8nJS1Cgi4Mf5sqhUeHiH9?= =?us-ascii?Q?+P93lUo6+4QTDHU/likMX8juFl588YhJoEJ/eaAmHgjszG9WCuwnBo8ITlJm?= =?us-ascii?Q?zDecxmJkuxek82mPImuAd7z8QUmH5ACGZIH5g1YLWzEUNEBGwQk2OUiBlWuY?= =?us-ascii?Q?lXOSMW6+kdHSn8XYUACqpLSbjQOSSMvN0REp4YPLWVZqzu2MF44GR+uzF7gb?= =?us-ascii?Q?vWiELm0t10+aEwm7L7G+QhxNDg4QlZUaoQzYolnQW1XjF7LnlSxG5lPQYNey?= =?us-ascii?Q?OzllT0BH/jWef09/G1s5MNd6g+0toGwOvZBdvT8vPnc75U4bTjmb5NmxllaM?= =?us-ascii?Q?eUg3U6TyZa5LxudhHhTruiO+Emv1m+T7VHe03W8B6V0Yk0EyNIBnAmaNdqGB?= =?us-ascii?Q?/BqH+R4YBKf+JWPmI+q28Ow52KNdJNzH8k8PeaTdrcdHsVWU/8MaZKYOtnMJ?= =?us-ascii?Q?JgDpjcpOddwkJiLbhogaZrHlL1m9nh0fuQGoazb2Z26ZaoiU3aFeS9A+S7Gu?= =?us-ascii?Q?vvIC+KT/78FHZApv81m9i1UWvMPKA7TwSqu8YL8whrzsdW3v7425YQAPAWvH?= =?us-ascii?Q?P1eGnE5bWZcZc+oAFc4ErC35XXZ8orXo7UpQXhrQEtPKX3ettJHb/ZaU8Mw7?= =?us-ascii?Q?4H3PddQfaeLh8ZAgU1IkwSIM2n+nAMX/F0AFGy3y3jaCa+VFWyTEQCgSG8RR?= =?us-ascii?Q?sgvfLPBEMN5Bi5HU1S1DcJCuAPvxpqkCFscYE+npY2rFlflS26eaGBDsWSon?= =?us-ascii?Q?Rw=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 2bac24ac-5f30-44cc-b09b-08dce9595852 X-MS-Exchange-CrossTenant-AuthSource: PH8PR11MB8107.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Oct 2024 18:28:32.4330 (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: kn0xiAXsmviSxSZ3PmkrNjeYEDX+1UeyvzBdu8zPlaj5mGCY1mxMgi1pG9mAZn8x41vvKtctvJgVRz+hskve2vK4cQpcOKqZqOaBZsBEtyw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR11MB7565 X-OriginatorOrg: intel.com X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 38D9FA002F X-Stat-Signature: zowgn7p7fcoowzhrtmzu59pj7khyp8jo X-HE-Tag: 1728584922-232568 X-HE-Meta: U2FsdGVkX19Z1UdKdIy9uTQPMaxaeLFl765OmxdAucmGIqU2eTEE/1oMyhgz0qBmZ5IvtsnUFkc/AIjAuIsw+yEH8RGb8PciqfIo4f3lrmNaC0VIHczHAiOpSGGr5PiSRYEhjRrJ9tjYPH/+aGJVGWnLfU7hbpSLYdH3KOe6sG8I+lYJ82SDMnT8+XH6xzNI5gTDgsw3inqpDTtlcaUfGbqIAJjwcqFwLmOSsUziRbq0L/MIfIS7/6IYAh+gIpgzW1AM4UoeG7k6aFHYOganwJ6vmshOLbhrTGyizFEGWx9DgvdvOpQVR3kVxey6k/gWNr6tLtDN+PPx9zXbbNo2Q8T2EqS0ZYb9CLSQtQGktHojnZxlzq1edXVen914+TlKs+Cv8H9nyNsNsUJXdIzC0NRrbk30DF/8ipZV8cV9IBTzAFEAl5E3tkwnX8ANNkDP0sIMNOY11tkTrIaXTn4zpsOvj39Q1YWPu1uWtUs1T5+c75z4syjCZP/82RbZPPI+eLZZfjJ8lKfuZhfzbRu7CM2KUIsoHVtvA0ITiCsorMWcF6KujcsBJEFdOPqKYWScx8TDxcWS+XJB/9mjljMjaRJscwryJG29YQtP9+tnP0ZfCoMB53yCEullYIjNAQxq2Rq+0Sx7dZqpbsSPZmkt370IBKdwU1FPRHI1t6M6NRXCGNch3UrRhfpHItRJaGL5RMHW0XexunkFkEGfBoHt8sXvAONGJee3Qmlc3I2wFGyWKp4WYSyr7cBpuw4B6Y66N9pCxmDUFpXrB6dH8HitLItdILSbDzYL4VKOpnc5c68l6dBc0VIAWDqKsQuKWccBJDnxOfJ7Jl1IQEPUMmrwkpDh7NZUMrk0U29vP9XvEP4V37MZRb+6KZl3zRYDXvH/1ae/uVlsgIJRtNVPTyzOT70wrHETnEeEJ/81oIQ0Q8L4hlFyn36SKF57WHyBTgMZtNyJSKvp8ShEU7hNBtg SJG52SNx 3Rz3d2H98gUQi1if7j9DIKDBoGm1fUVH60MbR9gzsbkMJDyoQkT/4+6seyL1jVodWfTndAHGd19Tj4RLVn0gT/gmDv6GtlgxzVolACzUeQalL8iYri92DVthJux7UNGZFhRL6b6iQiqrQmX0/tW/0eJi2a1L8RO7cPoN8w6pGswkZhtzsw9mDdGqqCDZ4xT/rXDULg83Tijzq2zPQqznXVEN30B1L/5ZpcS/brq9NfnN1y/nfngEtKfd/c+mC4ZBAfw31oFwjUDQ2M0uQJVMJwzGL6jc3oIn+8f1U9scGn69nT5I1We3KJ45TFSuYs08zi6j4uS82D9Wp9RaBdsMA/AoCVqbWTIaTMNjf X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: James Morse wrote: [..] > > Yeah, it should be a good way to let the kernel know whether CXL > > supports memory tagging or not. > > On its own I don't think its enough - there would need to be some kind of capability in > both the CXL root-port and the device to say that MTE tags are sent in that metadata > field. If both support it, then the device memory supports MTE. > > (I'll poke the standards people to see if this is something they already have in the > works...) If it helps, the question I would ask is "will the ACPI CFMWS (CXL Fixed Memory Window Structure), grow a new 'Window Restrictions' bit indicating the presence of EMD support, or will it be left to an ARM specific enumeration outside of CFMWS?". > >>>> However, why would it be ok to access CXL memory without MTE via devdax, > >>>> but not as online page allocator memory? > > >>> CXL memory can be onlined as system ram as long as MTE is not enabled. > >>> It just can be used as devdax device if MTE is enabled. > > This makes sense to me. > > We can print a warning that 'arm64.nomte' should be passed on the command line if the CXL > memory is more important than MTE and the hardware can't support both. > > > >> Do you mean the kernel only manages MTE for kernel pages, but with user > >> mapped memory the application will need to implicitly know that > >> memory-tagging is not available? > > > > I think the current assumption is that all buddy memory (can be used > > by userspace) should be taggable. And memory tagging is only supported > > for anonymous mapping and tmpfs. I'm adding hugetlbfs support. But any > > memory backed by the real backing store doesn't have memory tagging > > support. > > Hopefully there are no assumptions here! - > Documentation/arch/arm64/memory-tagging-extension.rst says anonymous mappings can have > PROT_MTE set. > > The arch code requires all memory to support MTE if the CPUs support it. > > > >> I worry about applications that might not know that their heap is coming > >> from a userspace memory allocator backed by device-dax rather than the > >> kernel. > > > > IIUC, memory mapping from device-dax is a file mapping, right? If so, > > it is safe. If it is not, I think it is easy to handle. We can just > > reject any VM_MTE mapping from DAX. > > That should already be the case. (we should check!) > > Because devdax is already a file-mapping, user-space can't expect MTE to work. > While some library may not know the memory came from devdax - whoever wrote the > malloc()/free() implementation will have known they were using devdax - this is where the > decisions to use MTE and what tag to use is made. > > I don't think this adds a new broken case. Yeah, makes sense. > >>>> If the goal is to simply deny any and all non-MTE supported CXL region > >>>> from attaching then that could probably be handled as a modification to > >>>> the "cxl_acpi" driver to deny region creation unless it supports > >>>> everything the CPU expects from "memory". > >>> > >>> I'm not quite familiar with the details in CXL driver. What did you > >>> mean "deny region creation"? As long as the CXL memory still can be > >>> used as devdax device, it should be fine. > >> > >> Meaning that the CXL subsytem knows how to, for a given address range, figure > >> out the members and geometry of the CXL devices that contribute to that > >> range (CXL region). It would be straightforward to add EMD to that > >> enumeration and flag the CXL region as not online-capable if the CPU has > >> MTE enabled but no EMD capability. > > > > It sounds like a good way to me. > > From your earlier description, EMD may not be enough - and this would depend on the > root-port (or at least the host side decoders) to support this too. I'll poke the spec > people... About the best CXL could do is indicate that the CXL window supports EMD, but that is not sufficient for determining the arch capability for MTE, so something tells me this might end up being an ARM specific (ACPI or otherwise) enumeration to flag which if any CXL windows support MTE regardless of EMD support.