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]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 41090D116F1 for ; Fri, 5 Dec 2025 03:56:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 78E5D6B00FA; Thu, 4 Dec 2025 22:56:37 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 765976B00FB; Thu, 4 Dec 2025 22:56:37 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 654526B00FD; Thu, 4 Dec 2025 22:56:37 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 52B966B00FA for ; Thu, 4 Dec 2025 22:56:37 -0500 (EST) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id C47E016041A for ; Fri, 5 Dec 2025 03:56:36 +0000 (UTC) X-FDA: 84184055592.29.6FE4A9D Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.18]) by imf11.hostedemail.com (Postfix) with ESMTP id 90FE040006 for ; Fri, 5 Dec 2025 03:56:32 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=bZRr4jZx; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); spf=pass (imf11.hostedemail.com: domain of yan.y.zhao@intel.com designates 192.198.163.18 as permitted sender) smtp.mailfrom=yan.y.zhao@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=1764906993; h=from:from:sender:reply-to: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=jfifJ+5rJ3lUzCjSN3E9VHK7Ui3sc/IrDBixCK7eWOk=; b=K8md0CS9Si59kVGYUb7DT3KwsXb7wTgVaNtvMQ8CWw0vnSZEb8FmufSPA8NOcd+CiTJLec /x6g9w5KHkScRXcYH8fqb4altAXrSynhH0ueNT+r+eZq3P8OXxdQBIYE4z4gDeR+97evQL zQ2jB+kNAUhqtNrpHwzSkubqL4/bUZA= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1764906993; a=rsa-sha256; cv=fail; b=T9x2UiW3Sb2foggoIveNaAN78e/7JdSLgO4PVjyIRE0ku/ybW19EikjsRxakJ5WV6Tixn9 Us4zE9ms4U2Nhxn6mt89C0HUZmgbL4TvycbCm0EgxsbtcjVEXLBcRJXp+3EJSJMDAdyIEZ h5vAw1KUb+AukLPDKwdn/sq0lYja4bA= ARC-Authentication-Results: i=2; imf11.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=bZRr4jZx; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); spf=pass (imf11.hostedemail.com: domain of yan.y.zhao@intel.com designates 192.198.163.18 as permitted sender) smtp.mailfrom=yan.y.zhao@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=1764906992; x=1796442992; h=date:from:to:cc:subject:message-id:reply-to:references: in-reply-to:mime-version; bh=HCdyT6D4nvagVf41fyYCEmIdFMO5HtfTFOLdc0IfaOY=; b=bZRr4jZxSPbp/Zh1Ud1gAZ+p+y26TIngxnncg+D8fPOazou1Tm7/rJXO ddxl8iBZN1ntEiIu+4x7C0eLnXVlKOre53LzZF6IGwlitSXXGcBTod6aN Jx3Vcg6nKXY8Afh9HEi5T8rVyZKliBuhhOZKH1NzH6dJTQgY33N87vAcN JUUCHsWqp06B8+fKGyoEF8hFRVkBqyjv7ardKH3U6DKo4FBL4PRYxJ1ej ZPLAAI3V7+UpcFqgDysBnYcDWJ6F0UsB66nZCO4PAJkb4p2uuQF8ceN2A pVhkyoep/vz6sCm6nYPwn88YokfD9FTfAwXk0tRHzowH8gs/AQW38iCrL g==; X-CSE-ConnectionGUID: GoOPzZdKSwm5nX+aCeUfhQ== X-CSE-MsgGUID: KmVRzc4UTj658cyg//FsTQ== X-IronPort-AV: E=McAfee;i="6800,10657,11632"; a="66128105" X-IronPort-AV: E=Sophos;i="6.20,251,1758610800"; d="scan'208";a="66128105" Received: from orviesa003.jf.intel.com ([10.64.159.143]) by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2025 19:56:31 -0800 X-CSE-ConnectionGUID: p3nVXuDWQZmMzws5S+rK9w== X-CSE-MsgGUID: 4igxOPVQQKSFpWdcQq5g/w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.20,251,1758610800"; d="scan'208";a="199366135" Received: from orsmsx902.amr.corp.intel.com ([10.22.229.24]) by orviesa003.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2025 19:56:31 -0800 Received: from ORSMSX902.amr.corp.intel.com (10.22.229.24) by ORSMSX902.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.29; Thu, 4 Dec 2025 19:56:30 -0800 Received: from ORSEDG901.ED.cps.intel.com (10.7.248.11) by ORSMSX902.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.29 via Frontend Transport; Thu, 4 Dec 2025 19:56:30 -0800 Received: from DM5PR21CU001.outbound.protection.outlook.com (52.101.62.45) by edgegateway.intel.com (134.134.137.111) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.29; Thu, 4 Dec 2025 19:56:30 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=VypOEhBqYt5W7nszST6VTslN2JJPthyFXAcZxxcRwKddmdYS+uqnXJrEELCqtpzYFMihtlPCEpnMZVsZKkLRmsTov/EDcRTcRgi19shilIPGoQqRskywlap2DBIWiMs1jGE+XBmsqgOseLQAggMr3gxIgFF3N2lfKYBrWQoobS+tWhU8CXwXaYlAmsWLChe/h4iUz5OcwpVKTYEE5skh1H9FKGPnxEgLKHxZKsPZG1Tmyjxv57V+BavlELcllIGYmV7fzMMUXHGJETPIBK/YKhSAJHdDcejtmWM3mnqNgvq2hYkM+IpzRhegPbgVRtjqaNUZDf/vi1uAH23+Xcrftg== 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=jfifJ+5rJ3lUzCjSN3E9VHK7Ui3sc/IrDBixCK7eWOk=; b=lD6b+Lt3wi+6y++zHC3t4YOlNnINfQHnQi9uFRv2U/pwpsaAeb/d7BOtyqA4B/I7sZ6dW2Uu2iRjUqelPk1r2yKbv4GYbtID3RGhQFcNRe9zMK5bVxCRAkYIbrWm7qGFx2QxYxDXJc9AHs5usdH01EVykCLd49pFC1CcgffHvjYsQ1w/UJtTmiigjhSNVre+/mm+I2vK1vSDtzHAtFjB0hJK+YSlBJDd6pb3z5ITwqa3ATbRvdmDPsG0AXF5WOqmfoVmrXP0zsVSxFkPdtUNfzl8cquzY9OeHjGGJMgK8L27E956nKLKuujYSAXzqRt6hyIGrMyLbfuu+XrTw6E8IA== 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 DS7PR11MB5966.namprd11.prod.outlook.com (2603:10b6:8:71::6) by DM4PR11MB5311.namprd11.prod.outlook.com (2603:10b6:5:392::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9388.9; Fri, 5 Dec 2025 03:56:22 +0000 Received: from DS7PR11MB5966.namprd11.prod.outlook.com ([fe80::e971:d8f4:66c4:12ca]) by DS7PR11MB5966.namprd11.prod.outlook.com ([fe80::e971:d8f4:66c4:12ca%6]) with mapi id 15.20.9388.009; Fri, 5 Dec 2025 03:56:22 +0000 Date: Fri, 5 Dec 2025 11:54:04 +0800 From: Yan Zhao To: Michael Roth CC: , , , , , , , , , , , , , , Subject: Re: [PATCH 1/3] KVM: guest_memfd: Remove preparation tracking Message-ID: Reply-To: Yan Zhao References: <20251113230759.1562024-1-michael.roth@amd.com> <20251113230759.1562024-2-michael.roth@amd.com> <20251121124314.36zlpzhwm5zglih2@amd.com> <20251201234447.5x62vhlg3d5mmtpw@amd.com> <20251203134717.475azsubs26pj2x4@amd.com> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20251203134717.475azsubs26pj2x4@amd.com> X-ClientProxiedBy: SG2P153CA0042.APCP153.PROD.OUTLOOK.COM (2603:1096:4:c6::11) To DS7PR11MB5966.namprd11.prod.outlook.com (2603:10b6:8:71::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS7PR11MB5966:EE_|DM4PR11MB5311:EE_ X-MS-Office365-Filtering-Correlation-Id: 34c97cb9-a038-4aa2-05e0-08de33b240e4 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;ARA:13230040|1800799024|366016|376014|7416014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?Q0GbJUgtEOwRcqGMGnA9s/AWPp/LIw+bvl+bLIjHMLIQvyzCl/p/9HkX4K7U?= =?us-ascii?Q?GLJ0MD0t02nWrzi6Y+ygnqWvnGOjIlVgB5qHi87nGd7Y1Ki4yxOqjYdSWm2T?= =?us-ascii?Q?iRAWntc3+y/9rlf71OziJ0CCCpiBbIMgrn2HLw1LYCZOqFRXuD+zAL26wR5h?= =?us-ascii?Q?lc8rBRyjuoveA+XWZDSOfVA+UQ5qCZQJud7R21QcB0udrpPk2mllk32FcWd+?= =?us-ascii?Q?9vTW3h3vjkF/iqOiR94cDNzS9zZ9svG9oaZqxAtKpo1hqWzRZsylP0fwVCsQ?= =?us-ascii?Q?pFAKtRh2Bs9nFphbBtimK8lIo4ymvEd3m2d+0KR3HAA9gPfmjqsqT9utX30a?= =?us-ascii?Q?7Pn7MZnqEXboqqNiOugTUyKzlCb7iEiLAD2eeTGAuwF/7HbqC1xIgBZBMj4w?= =?us-ascii?Q?Kfy7F387O9Mj74yyXMWTgVJiOonK2qTB6hkLSlhWPE6ZenGzFmUK4pmyZA+V?= =?us-ascii?Q?p1wfbT5e1GOx5WxcKoSDqZt9PBsjm5B8FarGsvpi3RhgI2GECZodTT+IiZOX?= =?us-ascii?Q?4yeaSf515HH4aOQe5ZdbMOFcpNTu1wJ9ctZND+mXCeP3XX8LMdPPuas2nCY3?= =?us-ascii?Q?/ck0eihOBbNmOx8PSvUArUPAUpMR+nXEtZxf5/D52P/ZBGadblhjyTUgwglo?= =?us-ascii?Q?GuGbJLfRHBDZHDedpZH+i+S7XKrUJJKeRn3v97agL16+bllx5P2N/XEydYeD?= =?us-ascii?Q?WEMsVx0t5FFyd6fkfuhdRqyUYXm1pMx2jon0HO9Pzhz5g8rIM3Hd+4QN3pIM?= =?us-ascii?Q?TulsyuIghJOTH4iihbAyyZqwMuPfx+rqzIBubqwYkFOg4l+hDUrDFzEuyh7X?= =?us-ascii?Q?6H+Sv+RgYrfYxS0dijIQOuil4jrzwKnhLJfCQ5SHqdLgEA3Il8U+QTFL/gjP?= =?us-ascii?Q?kPpLI3+1NglE+HluMN8ll9tzoRAsTvwbATLzbJPS6a6p28uqv5uVgrgtVaJp?= =?us-ascii?Q?BxSYwjbRocP1xCQXIG/hapI0ajzpEH0xYa0mQiqDgp3xH+3hYHrfe1TCn6iF?= =?us-ascii?Q?tsAn90CShKlpRQV72Bef3k1ysc3pbFPnrkGwhJJP+3Sp20lQbGVqCHgIfAOk?= =?us-ascii?Q?EpOI8u68y9uNgkxJAyDnYdjN3KfbOrazNkDVofKR4zL1MTqtRURq6dBpIOJd?= =?us-ascii?Q?JdhdUMTOz+QZFRlSSBH4c/StFsxZy3oJ9a4AXbF9pEU5GQndqST8Y3/8hbVe?= =?us-ascii?Q?zQvuzKvrdjcFL1cWrJ8e6AYBTq1YojdKU8vnz23sqZ6TXlCIrI64IpyoReA3?= =?us-ascii?Q?x/ZM9g3GTrq6mVKg0LJWnea1U857vlO3y2BC7kiTHV66JO9PE+OQvzqakw1w?= =?us-ascii?Q?mgyeVPN0IZBVTdltyL6N0Zm1LJCSoalMDtNer7RvCtP8hj2aA6pvcb9s7cIV?= =?us-ascii?Q?hTNBuAzD8rpl39v7gB4FBlXNX3HPKu35ZeCWltGbfF+kz2ztFw=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS7PR11MB5966.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014)(7416014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?OOf6WArgNBMIUm2qRZO+1iacSMCMvgHu6Nfw/hTxo6Xl14wpZCT4fi78gXFT?= =?us-ascii?Q?1GsQWahMHryYHzNy15byR/kRrEJnFZehq60gGgjSfYcQ1FqbhClhdY1eHr3u?= =?us-ascii?Q?9a05yucJ5otTeKiRNrqi1o99keWcEq6KnN6lQKlCiEu4jmCqeAiL5wSiFRAx?= =?us-ascii?Q?1PVl3+PFh6AtKy7AP8lRUovZ/tZZLG6vMo/jSztCZs93b+nzjsLnKuTjxcV7?= =?us-ascii?Q?FDTRVeeLIpWk9ISWk2RWAmwnBMPVEYcQrPz0n8Qpex5JkN9ew2VrtIMgz7VM?= =?us-ascii?Q?7PgutgzHUQQdw5REY8IsJVNjRtNbppyZtotDhTEMh6/oYfSyA+h93j6cVJxA?= =?us-ascii?Q?c8fsCAeFjIAyK5PpdqwRD0+G9HGfyW93kikSUy7j8HClIa7oserHlfiJ4mHZ?= =?us-ascii?Q?hXp/i5oiY/t9qkSjcbCLpYAonyEwun0wx3vQLDOvNaIFikuHMgMdzp/u373h?= =?us-ascii?Q?71tHvYpz0YVeIu7gNvhommX3LpWz/JEGcP8+ZX49jnXxSl9sQIQp26OiGlhX?= =?us-ascii?Q?zcBV4vTo7fVpF8I64R1RugOe8pQr3TKRDGO52I+Hh7pJy1vhLVsHaQK/6wOM?= =?us-ascii?Q?VH6jUNvpOEjRPGx+49yEw6lWRdvaefT/WR1lycn61FFHT9rqapHLUbFF3Ub6?= =?us-ascii?Q?EwRURYlU/Aq+543LYSttDt8jbrflzkh8dWKQWu0aDfFOZpqTVrh0vdAjCsA7?= =?us-ascii?Q?6nBJSgxOTUhtXrKZS11YruHfExjttMtTAF6AyiI4JJFxU7ilTzYcStTv5n64?= =?us-ascii?Q?H2MXs/gF7cFe3r89tIzKFdghGGfnfRQ35wLXULTtoLaHVDkgJ39vniNTnjZf?= =?us-ascii?Q?+jL2lxThpy2wJGGvYbOMbzwmtAvQoVRMpD64HpsA8xdYO9omHQiIDZBFLaLx?= =?us-ascii?Q?+8brH8M6EtDPQAB6Wsz80EKpAzPnROndvS36zoFU3VP3gYritx7jXliGVgWO?= =?us-ascii?Q?AOeSeotJKm6q4eXiHw1P65sV/z9v5yapW3QZR1ZpjIahdq/JxTAoAuG+T64L?= =?us-ascii?Q?aeOW8EU+r9lxQ102W27/Lve9BjMBdn8DJztXo5Qt6teTWjAVLkDL+WawrS0k?= =?us-ascii?Q?DmDBfLjVv948wWSOkKVQ3jhm1YiUTocVvlgLb9fDthehm4pSj4EzLeE27AGn?= =?us-ascii?Q?Bjm7y+TdqoocXrg4NQSjzpoYzpUz0ll5F5dlRQuR9I3m9buEgNGgBGB/S5ih?= =?us-ascii?Q?gFUDdYy5pG8T2WSKpg3af2Sud7rSSG4Lzo5uqBr6Y070kNtFGPlx92Q10MES?= =?us-ascii?Q?m4O88THR+qDi910ZguDqqkAdTlkSoaAQJQjXa0dNx7XU6LEP2Sl6sWQI1Dnk?= =?us-ascii?Q?/WDfvboPk4OiIwcHFHHQ709wHXCJCex05zlV7+sbgbcqcsZnbIQcrynz72aA?= =?us-ascii?Q?bzQv03mGi+tw/OXznPN7WPUlSGwo2abQRMnFGeo97RiWefwzNieO6FvdnAlI?= =?us-ascii?Q?GEqx3bjVdvLujqxvl5gdJ60+bBJV9ckRAhtBvR5bencElfTFY+se3ZOshn/N?= =?us-ascii?Q?AEfshqv6Mx1l6W/h24BvifEwFFjkVFFwWu+/TEUu7aoLRnQllNbDEfsVtJJQ?= =?us-ascii?Q?wACBy5cHCUlVXKg3SWvGtwR71A88cpuwpK09GK8y?= X-MS-Exchange-CrossTenant-Network-Message-Id: 34c97cb9-a038-4aa2-05e0-08de33b240e4 X-MS-Exchange-CrossTenant-AuthSource: DS7PR11MB5966.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Dec 2025 03:56:22.0405 (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: EaJxDjWQd0xah0/LZkmy6pKy4p0pmp+JaJOlJkzSJMoVmjGNCaXY5T+AcamUOQagoZSJ6McKkdpO9YH1KzXUBw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR11MB5311 X-OriginatorOrg: intel.com X-Rspam-User: X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 90FE040006 X-Stat-Signature: aiaapt56ngoesx1wmcyszpcxuzzupkqt X-HE-Tag: 1764906992-569685 X-HE-Meta: U2FsdGVkX1+i+u+nFz8FAySJGnpDQ9V8CkLTmMrRwllTfUWJfdt/eViCPAwDU4J8OpLTq4v/AOpqY76KPdoiHcH38ZpFTA/iOLmoLjWxHA4fusUvjUCpuWRX3WVfdRJtwBxJtaUDzKYZAj+VGdtZ9iRuIvy3ClxYaVAYwSD31F184bXfWBlQVnEBMYQ/Doja+l8/1sMXIYjUo23SEK2xaM3oknT9rnuXV90vntQ1Hly+OizPLMBbj6o0yuFurE8XD7Wzeg8Toz4PV7uEB1KBz51T4RvrDvrj4nc5ay/uE5tMc8P0kUZKBUhxlFr4M2/mfU8bqngqE1VNHhzXnwp1Wx2lt74U8EzvNitgO8bZv8u6PIKuBwOjwWRoLhHS0k7tKusCKd7BtiQ282J0vIuYp/f7GSdFuY8QFvl+8Oo2mIPkL7Fdaddal/nwVukPeJOiam8bSZhWb5fGO19ZGTy6bS8e9OZyF/XWiPuZN27VFiizU036hY7fD9kCekI2OSdgA49v2sZFH6wBqPQmAhscYvAUntuVS+SzC2JDvd56csDTywRlREWu95ppmcilVa835TfxBJ9ZJSrv+JlLVejGNjjbjq4BrndOwe1q/VywFEqvJeZIyeLiHgdx3iLibnk0LzkgwJ6E2A0wC3WZMDm9AkJ+4MYA3i4zDkQXQIwJqGj7r1OWkW8Fuf1Qqn30uYpjXzVQ3CzfNNqLHWEUIxNbzfyEEuFMn6s+zJHrSqj9TG4dCHb0T5kAWr8Dw5Jh2zWtgjcW3AhSPMqsMk3vk+Aq53FChUL4YRt2df/aQ2Dz5dcfu3PhnF6w6n4CHaaCjM46CuUTbdx5DY7A06mYscOfRXHS8sAZ8GJIpjvavXePEooaBspqc861pE675hPd2vwCl2mE3buNYC5wZKnuOV1PWTgA/JkUaWcQNETtmRI0JmwEoadWTZny6ezC22VEB2O6VzeIySbeDpGuJLXcuNO Z47zXdYB i8eQy1um1w0V10is0OINGtuSa1p4kfDBoJnQ3TUP5gP1nk0jAZ1QO6x0Se1BiSsTSmKbVxCLHV3/SzvdRWNTP0Hc1WQHhOQGDRXSDDaKrxtYk1SsffJTjpOnfAy3Aq7XztekhLK/A9D8/ylqeBT+xenA1yl0sys4ayI7lwA0p15j/2S52wnSp2kisatvXKsLI2wPmJHfhTqwrVJpT6ESINvRK6s0McpbCZuhCS60HoRH6SdRbRTRFbfGmQNVFM4I+nAATiXGkXF6kKKe3ftiCghuN58tNTSVZseCoepV9gXssggS5F65dgDpn/JQdx8EwqNr5yihIBAsko4tDATs4j/XVb3nlVagq/U6eK1xOPVBcxfpFcs80c36g0uEi85l/5MZlpPIMq5Zyr9bmcw5WZImBqoUHA8vnVZZIldmAfpfEhTR3B1sfC2r3Ru+Cuir6ejNJCykQG5Wy8imh3SvZ/zEgdsL6gOxPg463qivf5FaQElhgdbxLuab+uxsCP1dTq5n2XjaJ5ipxBceSLzX7lbli4GamCXgCl6lK+Ewi43aoMPyI+HFLNUpFvr3g4Guc8LF8ZYpza5e3C2t4clCEWivs+shGGwBspoOMMO76BG9W3vnPHOdz/3m5ZCCQ/sn2mcse51LQ4qf2B8o= 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: On Wed, Dec 03, 2025 at 07:47:17AM -0600, Michael Roth wrote: > On Tue, Dec 02, 2025 at 05:17:20PM +0800, Yan Zhao wrote: > > On Mon, Dec 01, 2025 at 05:44:47PM -0600, Michael Roth wrote: > > > On Tue, Nov 25, 2025 at 11:13:25AM +0800, Yan Zhao wrote: > > > > On Fri, Nov 21, 2025 at 06:43:14AM -0600, Michael Roth wrote: > > > > > On Thu, Nov 20, 2025 at 05:12:55PM +0800, Yan Zhao wrote: > > > > > > On Thu, Nov 13, 2025 at 05:07:57PM -0600, Michael Roth wrote: > > > > > > > @@ -797,19 +782,25 @@ int kvm_gmem_get_pfn(struct kvm *kvm, struct kvm_memory_slot *slot, > > > > > > > { > > > > > > > pgoff_t index = kvm_gmem_get_index(slot, gfn); > > > > > > > struct folio *folio; > > > > > > > - bool is_prepared = false; > > > > > > > int r = 0; > > > > > > > > > > > > > > CLASS(gmem_get_file, file)(slot); > > > > > > > if (!file) > > > > > > > return -EFAULT; > > > > > > > > > > > > > > - folio = __kvm_gmem_get_pfn(file, slot, index, pfn, &is_prepared, max_order); > > > > > > > + folio = __kvm_gmem_get_pfn(file, slot, index, pfn, max_order); > > > > > > > if (IS_ERR(folio)) > > > > > > > return PTR_ERR(folio); > > > > > > > > > > > > > > - if (!is_prepared) > > > > > > > - r = kvm_gmem_prepare_folio(kvm, slot, gfn, folio); > > > > > > > + if (!folio_test_uptodate(folio)) { > > > > > > > + unsigned long i, nr_pages = folio_nr_pages(folio); > > > > > > > + > > > > > > > + for (i = 0; i < nr_pages; i++) > > > > > > > + clear_highpage(folio_page(folio, i)); > > > > > > > + folio_mark_uptodate(folio); > > > > > > Here, the entire folio is cleared only when the folio is not marked uptodate. > > > > > > Then, please check my questions at the bottom > > > > > > > > > > Yes, in this patch at least where I tried to mirror the current logic. I > > > > > would not be surprised if we need to rework things for inplace/hugepage > > > > > support though, but decoupling 'preparation' from the uptodate flag is > > > > > the main goal here. > > > > Could you elaborate a little why the decoupling is needed if it's not for > > > > hugepage? > > > > > > For instance, for in-place conversion: > > > > > > 1. initial allocation: clear, set uptodate, fault in as private > > > 2. private->shared: call invalidate hook, fault in as shared > > > 3. shared->private: call prep hook, fault in as private > > > > > > Here, 2/3 need to track where the current state is shared/private in > > > order to make appropriate architecture-specific changes (e.g. RMP table > > > updates). But we want to allow for non-destructive in-place conversion, > > > where a page is 'uptodate', but not in the desired shared/private state. > > > So 'uptodate' becomes a separate piece of state, which is still > > > reasonable for gmem to track in the current 4K-only implementation, and > > > provides for a reasonable approach to upstreaming in-place conversion, > > > which isn't far off for either SNP or TDX. > > To me, "1. initial allocation: clear, set uptodate" is more appropriate to > > be done in kvm_gmem_get_folio(), instead of in kvm_gmem_get_pfn(). > > The downside is that preallocating originally involved just > preallocating, and zero'ing would happen lazily during fault time. (or > upfront via KVM_PRE_FAULT_MEMORY). > > But in the context of the hugetlb RFC, it certainly looks cleaner to do > it there, since it could be done before any potential splitting activity, > so then all the tail pages can inherit that initial uptodate flag. > > We'd probably want to weigh that these trade-offs based on how it will > affect hugepages, but that would be clearer in the context of a new > posting of hugepage support on top of these changes. So I think it's > better to address that change as a follow-up so we can consider it with > more context. > > > > > With it, below looks reasonable to me. > > > For hugepages, we'll have other things to consider, but those things are > > > probably still somewhat far off, and so we shouldn't block steps toward > > > in-place conversion based on uncertainty around hugepages. I think it's > > > gotten enough attention at least that we know it *can* work, e.g. even > > > if we take the inefficient/easy route of zero'ing the whole folio on > > > initial access, setting it uptodate, and never doing anything with > > > uptodate again, it's still a usable implementation. > > To me as well. But in the context of this series, against kvm/next, it > creates userspace-visible changes to pre-allocation behavior that we > can't justify in the context of this series alone, so as above I think > that's something to save for hugepage follow-up. > > FWIW though, I ended up taking this approach for the hugetlb-based test > branch, to address the fact (after you reminded me) that I wasn't fully > zero'ing folio's in the kvm_gmem_populate() path: > > https://github.com/AMDESE/linux/commit/253fb30b076d81232deba0b02db070d5bc2b90b5 > > So maybe for your testing you could do similar. For newer hugepage > support I'll likely do similar, but I don't think any of this reasoning > or changes makes sense to people reviewing this series without already > being aware of hugepage plans/development, so that's why I'm trying to > keep this series more focused on in-place conversion enablement, because > hugepage plans might be massively reworked for next posting based on LPC > talks and changes in direction mentioned in recent guest_memfd calls and > we are basically just hand-waving about what it will look like at this > point while blocking other efforts. > Got it. Thanks for the explanation!