From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=205.220.177.32 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796058425; b=VfFUG/sFW3sb/U5+cx1ThQCYM7wfjV44hnD3QT0fy57nEgKb6Jf29zE5TGIhWtYY59s2 cF2s59Jl0gdyI3ufwDF9uEIYes0z1YX/eLAZSPV1jqd13oVzU1uP6ikXOp+AoXZwsXBLW PC8LjREXBL8uolGDGGBZKPL3FxePGQIb+RwpMFh2OEWfGiA19pj7iT9NGZNPq4zyntKfQ fPiqdwLq+BwR+U73ZLQOISVaBVPpnyQo62Ky2XVWkBWRIlOxqJhwrZlwKB2pdrUjXKsGL +A8DdQeJw/cSazz94IP0/YUhOZ0suo+XWFAjg5Jtg1EJrlsyon7mRSlWXQ7FnHcUvMA== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796058425; h=DMARC-Filter:Received:DKIM-Signature:Received:Received:Received: DKIM-Signature:Received:Received:Message-ID:Date:User-Agent:Subject: To:Cc:References:Content-Language:From:In-Reply-To:Content-Type: Content-Transfer-Encoding:X-ClientProxiedBy:MIME-Version: X-MS-PublicTrafficType:X-MS-TrafficTypeDiagnostic: X-MS-Office365-Filtering-Correlation-Id:X-MS-Exchange-SenderADCheck: X-MS-Exchange-AntiSpam-Relay:X-Microsoft-Antispam: X-Microsoft-Antispam-Message-Info:X-Forefront-Antispam-Report: X-MS-Exchange-AntiSpam-MessageData-ChunkCount: X-MS-Exchange-AntiSpam-MessageData-0:X-Exchange-RoutingPolicyChecked: X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0:X-OriginatorOrg: X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-AuthSource:X-MS-Exchange-CrossTenant-AuthAs: X-MS-Exchange-CrossTenant-OriginalArrivalTime: X-MS-Exchange-CrossTenant-FromEntityHeader: X-MS-Exchange-CrossTenant-Id:X-MS-Exchange-CrossTenant-MailboxType: X-MS-Exchange-CrossTenant-UserPrincipalName: X-MS-Exchange-Transport-CrossTenantHeadersStamped: X-Proofpoint-Virus-Version:X-Proofpoint-Spam-Details: X-Proofpoint-Spam-Details-Enc:X-Proofpoint-ORIG-GUID: X-Proofpoint-Spam-Info:X-Authority-Analysis:X-Proofpoint-GUID; bh=Izkt+vx6JhBYPqO+17HY29lF3vBe9jhLTVljqJGOWbQ=; b=EWgJPZpLiXxn7eIiP7og3Gd+Kbl+pY8rX7e2rmT71j7ahRQrb2qsGpfwoI8kqjARQjPu Baa5pQ1GxfPw/9bQ1EWFpEme+bNYCqSiuJD1ueGsdy/D5/h/Zb9SQLB35LIGmlWVo6YNG m1TvYW2LhWA5y9lxKMeas6mFfsj04rQbU3VGJA7VqdKRwvNyhLkHuNOkekRa3ugvGA252 /x4lB2+r3+7QF8L1zYR1vx/Ss5Cg9/Gcu5y90dG0QSB/+nhzDSOGYMSup3U/hq1+t4B6a 49QJGenEa3iShDmH9tk0esxsGjDiwgBQt6dliPqOn9kCstwz0HdHBYhwuuZP6won1kg== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass header.d=oracle.com header.i=@oracle.com header.a=rsa-sha256 header.s=corp-2026-11-19 header.b=zowXpQ14; dkim=pass header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-oracle-onmicrosoft-com header.b=tj1alAat; arc=pass header.oldest-pass=0 smtp.remote-ip=205.220.177.32 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0CF22606A320; Mon, 30 Nov 2026 17:07:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 0CF22606A320 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.a=rsa-sha256 header.s=corp-2026-11-19 header.b=zowXpQ14; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-oracle-onmicrosoft-com header.b=tj1alAat Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6AUBjF6c2628136; Mon, 30 Nov 2026 17:06:19 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2026-11-19; bh=Izkt+vx6JhBYPqO+17HY29lF3vBe9jhLTVljqJGOWbQ=; b= zowXpQ14f2UTMJIrgvOHaq7kfd1av2CrFv9pZ3xl3GvSfAv1H3h2ukOKmFZBkVys uuwvA98IyFaLolE9XRDK9pvsKC5PPd3GUZ7ChJyLGHLVzBiZdFLb9FYPHpnLyTIF PHenk7Q1uL/j4zYqoqBQCpCo2IIlHXmdkAA3CYoyl0muzWWwOTJRczf24JpM9qHk hyCXpc3VfTD+JJ1OHSIvVRhEmdIFAzrFBJvI5IvJsNhW2+u/hQEBBHsQNviNZgof Rn+Wq1il2dg+mu3IHWE539mG2W6NbA1TbEzCxeAzEFLHyhwwaPJGWVYL8DJzM/tH SS3/lqeNuf74pQ9bvAVmyQ== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 4j7nr1j3sk-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=OK); Mon, 30 Nov 2026 17:06:19 +0000 (GMT) Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.18.1.11/8.18.1.11) with ESMTP id 6AUGWWPh3464666; Mon, 30 Nov 2026 17:06:17 GMT Received: from co1pr03cu002.outbound.protection.outlook.com (mail-westus2azon11010019.outbound.protection.outlook.com [52.101.46.19]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 4j9crhsd8s-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=FAIL); Mon, 30 Nov 2026 17:06:17 +0000 (GMT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=nBKf5G5XCL+hU+HNz0FlBgJ35rf5q8hl7221O4EryVZWkKZKb4cT5uGeLLp+77PWIi8f3itKcKfUa6KEvLQwIQbudkYO72HMWEelwxplLz+jacYzu/g+VR8QChXVUxc0ZREBub1CuuvfJwVnt8BvMo18SLQ6oD+yLuqgsTm12pZNC3yHANnb9HCYTVX7iic6gjg9S9PnpN4MVseiLHCtXexBwh3EmjR119GzgXgfCoCCaxVgtt84lKijsauEnGlWMj282z9YvrWYXMCTYZPGK8l7Jw/5HjF8lD9clMApZ5/mVc8bmievewqJ2UHM3lGDBsSYogV+x17dZqBxCgsD5w== 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=Izkt+vx6JhBYPqO+17HY29lF3vBe9jhLTVljqJGOWbQ=; b=D6eaTNkRFHAp/7Ka0EwTJu4/CD1bKlUPPvJCzxJOkEaLqQrsATVunOJyGgOmcfR0mJzXp4BrgDtUPY0ttnTsVf9BIA8JHFySmli7mt08De+IPoGZ4yEL1T7htiYYo8yMy1EdmdZQzzquWChXH9lr8onAB0e/u6G2hAkg40Rr39Dju1JnigqEqMYztZY+NtcE8lwgDuKX1eUvmCqHUkT0H5RuA7nBVJExNOP7YQ3ss1MJYmkln+uChMlwwhsvQtH944ANg81SsMa+8Hbu0TLIa06c8jyOiHjt6cmqvUBQsLq6TNqfnRrxp2qY+L14UC2FyQ+rsGxRxSANiR+oCg6wGA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Izkt+vx6JhBYPqO+17HY29lF3vBe9jhLTVljqJGOWbQ=; b=tj1alAat0KVEktVeEWZX1+OqCtXsdE9VCbp1AUpPrvj4/63psd6yvmT2Bsubx3ea6XgIGKXiIMpX8hKHNg3SL8Us4ksO5kHme6zGFG3JXGSm3WHiWrQMnjYkfEotDD2avUItsL4AXIlkJg2BrgZXCZhSk67SkHKqYmDeVXbhhVc= Authentication-Results: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oracle.com; Received: from CO1PR10MB5506.namprd10.prod.outlook.com (2603:10b6:303:161::7) by DS4PR10MB997597.namprd10.prod.outlook.com (2603:10b6:8:31e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.662.13; Mon, 30 Nov 2026 17:06:12 +0000 Received: from CO1PR10MB5506.namprd10.prod.outlook.com ([fe80::da72:a0a9:5f18:cda4]) by CO1PR10MB5506.namprd10.prod.outlook.com ([fe80::da72:a0a9:5f18:cda4%6]) with mapi id 15.21.0662.012; Mon, 30 Nov 2026 17:06:12 +0000 Message-ID: <7bbf2c5f-b938-4ab7-ac9b-2d2e8726488f@oracle.com> Date: Mon, 30 Nov 2026 09:06:10 -0800 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v8 04/18] iommupt: Implement preserve/unpreserve/restore callbacks To: Samiullah Khawaja Cc: David Woodhouse , Jason Gunthorpe , Lu Baolu , Will Deacon , Joerg Roedel , Ankit Soni , Robin Murphy , Kevin Tian , Alex Williamson , Shuah Khan , iommu@lists.linux.dev, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Pratyush Yadav , Pasha Tatashin , David Matlack , Andrew Morton , Pranjal Shrivastava , Vipin Sharma , Nicolin Chen , John Starks References: <20261123044949.3610702-1-skhawaja@google.com> <20261123044949.3610702-5-skhawaja@google.com> Content-Language: en-US From: Dongli Zhang In-Reply-To: <20261123044949.3610702-5-skhawaja@google.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: BY3PR04CA0025.namprd04.prod.outlook.com (2603:10b6:a03:217::30) To CO1PR10MB5506.namprd10.prod.outlook.com (2603:10b6:303:161::7) X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PR10MB5506:EE_|DS4PR10MB997597:EE_ X-MS-Office365-Filtering-Correlation-Id: 04ccc078-ac5e-4f8e-3603-08df4f043c9e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|7416014|1800799024|366016|23010399003|4143699003|6133799003|261009223027099003|22082099003|18002099003|3023799007|10067099003|56012099006|261028144727099003|261026121527099003|261026140227099003|261022105027099003|261102123227099003|261022075727099003|261021121427099003; X-Microsoft-Antispam-Message-Info: GuxpMdj/XEng+9RfTxgY1mFKqGeiFPRSm4UGMlwqULUOYFLEMgZHXSi6i2gUITbj1OwrZd6OMhVGwDoLKPjczL4MTfEbql2UmuxGi44zh5Xp2Ubz16BGLf4Ppm5y1fCBABN2mc2B5FErZ06+WsIWv83p8/k4ghCvQmY9V34e8QMiUBmxvbzu4tVLSiHR7RU9iEy7/u+BX+5WAA9KDpScISB/OoFhKl4XKp0yVfb60qoM5/VXxI0b7f83He61XFzlsmEBGwxSe8GFgQFU+bSmpKxQXQJqE89eYxwWils+xPGlKzOY8w4XK1b1T3ltBS+S43sA6y/eAiZ2jPObRhCoHwiK88HG5mXMcb0taHkQoRy0igC2Ef2zOqydfNXxTXxp29PxlxGUzv87cE5FONcqqOo5IVjq/eMF1QB1qivj7fWy++7VLo3Kb2J+6OCQrLpes+UyuAMvEa5Oxu+epg8buAksHbx+yG43/ItLH8BdXCQ9Kb+a9fkYJi32MhwA+dQl4zbwYn+C1t8MT93SXodkSjA20/q2YCjY1JbAFB4lV++Cg6BX9IwoBKKMajdtMARgE01OjgxS8L9ejpvCMT+qEiGWBlWOrLeFX/akRjiTtMU= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO1PR10MB5506.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(7416014)(1800799024)(366016)(23010399003)(4143699003)(6133799003)(261009223027099003)(22082099003)(18002099003)(3023799007)(10067099003)(56012099006)(261028144727099003)(261026121527099003)(261026140227099003)(261022105027099003)(261102123227099003)(261022075727099003)(261021121427099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?WXlxUXdxQjJrdU9uR1Q5cVRxNTNRYWs3VzhDUU1F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0: tQXs7SZbxIzNeqW8fSbSTqMhEXmKgrGlMWpCa0PYwEyP1bsUe4zRwwLxVCKz0vAufoX3xOWghvU5JchLxEHAfpczCY6pBFK9/lcanBKYtb8nk+l3MTowZreCmEYyX5v0l2vJ8pMrv4ILWYtPxsPom8EroXbvsLclbd3AEqlLzLyft9npoBUgU00VhmvAf0e0JkhD2h3cmYDayo7psznZR+QUSgmqkyBXCB5Q8bRoum12F20YN6BMw/Nzzo3UWVhrrkMxui1FrEALOpNKSij2qgV/HZLNMi6l6BzugNioSdWFdvRtm2IOzwre6J0UPW3BITMu20/WdTVw9sMWi7Zpty7MjLH7Ob8xB74ijcoxsiyTYcx4kQ5JsJVEp32KupRwyCxrkyksSOLJPtPzwW77goJ3swmuve6zplhyBZLgT6CH+MNrdKrLX/xUeARznVb/VeRBawgH00qBy3k8wxilZmIjuHPSZmbs6bllll1iNAYjDi6pWiqIA1V9/R/YJ+RTZB0uDT4BWA/SBQI2FtT7m7+j5aTK8IUZVAW4+mYHM75uZ0kW+1Mw3zFAmqdkF/rO+MHUptAa2iqz+dSRUCda22wSfQbbxe5pqgpufo65Om0= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 04ccc078-ac5e-4f8e-3603-08df4f043c9e X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB5506.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Nov 2026 17:06:12.6681 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: BVzBSf+cCCJf7UvvCOTdDa8/6kzeWxwYFBu1AUElpZ+7UvMSeFggOOaVxu0iVNjZs1N/bYVL4rk7Aj6s9i1NHA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS4PR10MB997597 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-11-30_04,2026-11-30_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 suspectscore=0 mlxlogscore=999 lowpriorityscore=0 malwarescore=0 spamscore=0 mlxscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2611300067 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMTMwMDA2OCBTYWx0ZWRfXyCs7afIl+7Ba 5On3SnoOA9CF7FCI7Y8CDzS6Saj6GZpZ7q+xLlTb79YByOMjPWde/J7W1CpsTGxEwmQ0RdjwpTp y+v4EmvEB/tTKCKfvl3LA3jjGmR272bEIvmSY/yVG98tOfh6nq+SoXycbxb9z7DF0BVWcjFoHbS ZNrtbDWaUwvq0/x6gi54JLIMTSUzuPCVQVEvOAFDKoJ7xefQjNcKHTXRzItE6DbxCFug2QB8+3K dmWGQqBtk3kCyRvgVATK/PoW7Wa6Tj2E6L9c2R5EYNSrJ7/O56DLQii032lxY1+Hl4chI+dmgDf Dxy9Qto7RAusVZJ+ZVZOnuN0RFa68YCuPfqoHRc9z653pZxxgihIzs12Et1IP85BnuvCEkHt9v/ 8HA7klrPU7VdA4tG7TrSCYtx+YN5xP3luLV7vgdpqjrEyl5PJhdBscw0geM04OP3sWDbKeciXfD hBq+8xdXkK9kFdX+Ing== X-Proofpoint-ORIG-GUID: 4OE61p0SxDBlQt0B9vXjQCWTthHsxqXC X-Proofpoint-Spam-Info: AW1haW4tMjYxMTMwMDA2OCBTYWx0ZWRfX3/KWnQwUixmI JU7QvpKp9W9hYGrSTIt/rbqOebMmMxn1zKyToForq3T0dAtFfV+b9ESKl0hX8WCcbiWritEqwEh 0x2ALhTCK86hhD3nJF1IjI/FFlAcmyS2L0cweFG/W+xnGONi+TVD X-Authority-Analysis: v=2.4 cv=SpcFe/O0 c=1 sm=1 tr=0 ts=6b0dad0b cx=c_pps a=OOZaFjgC48PWsiFpTAqLcw==:117 a=OOZaFjgC48PWsiFpTAqLcw==:17 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=z/mQ4Ysz8XfWz/Q5cLBRGdckG28=:19 a=lCpzRmAYbLLaTzLvsPZ7Mbvzbb8=:19 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10 a=zJRp6_cAMcgA:10 a=GoEa3M9JfhUA:10 a=VkNPw1HP01LnGYTKEx00:22 a=jiCTI4zE5U7BLdzWsZGv:22 a=o5oIOnhZENCTenyL_yNV:22 a=OGjWj8McAAAA:8 a=1XWaLZrsAAAA:8 a=QyXUC8HyAAAA:8 a=zd2uoN0lAAAA:8 a=cUbiATf75RtnC5AwiuwA:9 a=QEXdDO2ut3YA:10 a=UYjydHh6ynBBc6_pBLvz:22 X-Proofpoint-GUID: 4OE61p0SxDBlQt0B9vXjQCWTthHsxqXC On Sun, Nov 22, 2026 8:49:35PM -0800, Samiullah Khawaja wrote: > Add iommupt ops for preservation, unpreservation and restoration of iommu > page tables for liveupdate. Use the existing page walker to preserve the > ioptdesc of the top_table and the lower tables. > > Preserve top_level, VASZ and FEAT Sign Extended to restore the domain in > the next kernel. On restore, the domain has only the preserved features > enabled and all the other features are zeroed. This is ok since the > restored domain is made immutable and can only be freed. A kunit test is Can I ask a basic design question? Would you mind helping me confirm that the plan is not to reuse the preserved DMA tables long term after kexec? So the DMA tables are preserved and used during kexec and until the new DMA tables are available? Based on the LPC 2025 talk, can I assume the plan is not to reuse the old DMA tables long term, but to put more effort into replacing them quickly? https://lpc.events/event/19/contributions/2046/ Taking a VM as an example, that means the below? 1. Preserve the old tables. 2. Run kexec. 3. Use the old tables until the new VM is set up. 4. Build the new tables. 5. Quickly switch to the new tables. Thank you very much! Dongli Zhang > added to verify that the IOMMU domain free can be done with trimmed > features. > > Signed-off-by: Samiullah Khawaja > Reviewed-by: Lu Baolu > Reviewed-by: Ankit Soni > --- > drivers/iommu/generic_pt/iommu_pt.h | 155 ++++++++++++++++++++++ > drivers/iommu/generic_pt/kunit_iommu_pt.h | 33 +++++ > include/linux/generic_pt/iommu.h | 30 +++++ > 3 files changed, 218 insertions(+) > > diff --git a/drivers/iommu/generic_pt/iommu_pt.h b/drivers/iommu/generic_pt/iommu_pt.h > index 837d835e4fad..b50dc94231f8 100644 > --- a/drivers/iommu/generic_pt/iommu_pt.h > +++ b/drivers/iommu/generic_pt/iommu_pt.h > @@ -16,6 +16,7 @@ > #include "../iommu-pages.h" > #include > #include > +#include > > enum { > SW_BIT_CACHE_FLUSH_DONE = 0, > @@ -991,6 +992,155 @@ static int NS(map_range)(struct pt_iommu *iommu_table, dma_addr_t iova, > return ret; > } > > +#ifdef CONFIG_IOMMU_LIVEUPDATE > +static void NS(unpreserve)(struct pt_iommu *iommu_table, struct iommu_domain_ser *ser) > +{ > + struct pt_common *common = common_from_iommu(iommu_table); > + struct pt_range range = pt_all_range(common); > + struct pt_iommu_collect_args collect = { > + .pending.free_list = IOMMU_PAGES_LIST_INIT( > + collect.pending.free_list), > + }; > + > + iommu_pages_list_add(&collect.pending.free_list, range.top_table); > + > + /* > + * pt_walk_range() will never fail as check_mapped is not set in the > + * collect args. > + */ > + pt_walk_range(&range, __collect_tables, &collect); > + > + iommu_unpreserve_pages_list(&collect.pending.free_list); > +} > + > +static int NS(preserve)(struct pt_iommu *iommu_table, struct iommu_domain_ser *ser) > +{ > + struct pt_common *common = common_from_iommu(iommu_table); > + struct pt_range range = pt_all_range(common); > + struct pt_iommu_collect_args collect = { > + .pending.free_list = IOMMU_PAGES_LIST_INIT( > + collect.pending.free_list), > + }; > + int ret; > + > + iommu_pages_list_add(&collect.pending.free_list, range.top_table); > + > + /* > + * pt_walk_range() will never fail as check_mapped is not set in the > + * collect args. > + */ > + pt_walk_range(&range, __collect_tables, &collect); > + > + ret = iommu_preserve_pages_list(&collect.pending.free_list); > + if (ret) > + return ret; > + > + ser->top_table_phys = virt_to_phys(range.top_table); > + ser->top_level = range.top_level; > + > + /* > + * VASZ and SIGN_EXTEND will be needed in next kernel for collector page > + * table walk to restore and free pages. > + * > + * Use the max_vasz_lg2 from range, as that is the current one if > + * DYNAMIC_TOP is supported. > + */ > + ser->max_vasz_lg2 = range.max_vasz_lg2; > + ser->sign_extend = pt_feature(common, PT_FEAT_SIGN_EXTEND); > + > + return 0; > +} > + > +static int __restore_tables(struct pt_range *range, void *arg, > + unsigned int level, struct pt_table_p *table) > +{ > + struct pt_state pts = pt_init(range, level, table); > + int ret; > + > + if (!pt_can_have_table(&pts)) > + return 0; > + > + for_each_pt_level_entry(&pts) { > + if (pts.type == PT_ENTRY_TABLE) { > + iommu_restore_pages(virt_to_phys(pts.table_lower)); > + > + /* > + * pt_descend can only fail if pts.table_lower is not > + * init. So the if statement below is dead code. > + */ > + ret = pt_descend(&pts, arg, __restore_tables); > + if (ret) > + return ret; > + } > + } > + > + return 0; > +} > + > +static void NS(deinit)(struct pt_iommu *iommu_table); > +static const struct pt_iommu_ops NS(ops_immutable) = { > + .deinit = NS(deinit), > +}; > + > +static int NS(restore)(struct pt_iommu *iommu_table, struct iommu_domain_ser *ser) > +{ > + struct pt_common *common = common_from_iommu(iommu_table); > + struct pt_range range; > + > + if (ser->max_vasz_lg2 > common->max_vasz_lg2 || > + ser->top_level > PT_MAX_TOP_LEVEL) > + return -EINVAL; > + > + /* > + * Override the max_vasz_lg2 here to the one calculated using top_range > + * in previous kernel. This makes sure that any later page walks use the > + * clamped max_vasz_lg2 instead of using the full hardware maximum > + * max_vasz_lg2. > + */ > + common->max_vasz_lg2 = ser->max_vasz_lg2; > + > + /* > + * Restored page tables are strictly transient and only permitted to be > + * destroyed via deinit() op. Because we only preserve user-assigned > + * devices utilizing pass-through frameworks (VFIO / IOMMUFD), any > + * concurrent or subsequent map/unmap operations on a restored domain > + * are explicitly blocked at the subsystem boundary (e.g., via IOAS > + * immutability). > + */ > + iommu_table->ops = &NS(ops_immutable); > + > + /* > + * It is safe to override this here since this domain is immutable and > + * can only be freed. This also means that for non-coherent pages DMA > + * mappings will not be created using the DMA API. > + * > + * Note that the FMT specific bits are not cleared as they might be > + * set/preserved/restored by the driver to handle special cases that are > + * required for page walks. > + */ > + common->features &= ~GENMASK(PT_FEAT_FMT_START - 1, 0); > + if (ser->sign_extend) > + common->features |= BIT(PT_FEAT_SIGN_EXTEND); > + > + range = pt_all_range(common); > + iommu_restore_pages(ser->top_table_phys); > + > + /* > + * The old top_table can be freed here as it is not used for any IOMMU > + * mappings yet, because the restore happens during device probe. > + */ > + iommu_pages_free_incoherent(range.top_table, > + iommu_table->iommu_device); > + > + /* Set the restored top table */ > + pt_top_set(common, phys_to_virt(ser->top_table_phys), ser->top_level); > + > + /* Restore all pages*/ > + range = pt_all_range(common); > + return pt_walk_range(&range, __restore_tables, NULL); > +} > +#endif > + > struct pt_unmap_args { > struct iommupt_pending_gather pending; > pt_vaddr_t unmapped; > @@ -1174,6 +1324,11 @@ static const struct pt_iommu_ops NS(ops) = { > #endif > .get_info = NS(get_info), > .deinit = NS(deinit), > +#ifdef CONFIG_IOMMU_LIVEUPDATE > + .preserve = NS(preserve), > + .unpreserve = NS(unpreserve), > + .restore = NS(restore), > +#endif > }; > > static int pt_init_common(struct pt_common *common) > diff --git a/drivers/iommu/generic_pt/kunit_iommu_pt.h b/drivers/iommu/generic_pt/kunit_iommu_pt.h > index 9fc71db74234..d4a47ca3e5f4 100644 > --- a/drivers/iommu/generic_pt/kunit_iommu_pt.h > +++ b/drivers/iommu/generic_pt/kunit_iommu_pt.h > @@ -427,6 +427,38 @@ static void test_mixed(struct kunit *test) > check_iova(test, start, oa, len); > } > > +static void test_restore_free(struct kunit *test) > +{ > + struct kunit_iommu_priv *priv = test->priv; > + struct pt_range top_range = pt_top_range(priv->common); > + u64 start = 0x3fe400ULL << 12; > + u64 end = 0x4c0600ULL << 12; > + pt_vaddr_t len = end - start; > + > + if (top_range.last_va <= start || sizeof(unsigned long) == 4) > + kunit_skip(test, "range is too small"); > + if ((priv->safe_pgsize_bitmap & GENMASK(30, 21)) != (BIT(30) | BIT(21))) > + kunit_skip(test, "incompatible psize"); > + > + /* Map a large mixed range to populate multiple levels of page tables */ > + do_map(test, start, start, len); > + > + /* > + * Simulate a restored state by clearing all generic features except > + * SIGN_EXTEND and DMA_INCOHERENT, and keeping the format specific > + * features as restore() does. This verifies that the generic page table > + * free walker can correctly tear down a populated domain when other > + * features are zeroed. Also set max_vasz_lg2 as done by the actual > + * restore() function. > + */ > + priv->common->features &= ~GENMASK(PT_FEAT_FMT_START - 1, 0) | > + BIT(PT_FEAT_SIGN_EXTEND) | > + BIT(PT_FEAT_DMA_INCOHERENT); > + priv->common->max_vasz_lg2 = top_range.max_vasz_lg2; > + > + /* The domain will be freed when the test exits. */ > +} > + > static struct kunit_case iommu_test_cases[] = { > KUNIT_CASE_FMT(test_increase_level), > KUNIT_CASE_FMT(test_map_simple), > @@ -435,6 +467,7 @@ static struct kunit_case iommu_test_cases[] = { > KUNIT_CASE_FMT(test_random_map), > KUNIT_CASE_FMT(test_pgsize_boundary), > KUNIT_CASE_FMT(test_mixed), > + KUNIT_CASE_FMT(test_restore_free), > {}, > }; > > diff --git a/include/linux/generic_pt/iommu.h b/include/linux/generic_pt/iommu.h > index 13ebb72a67de..617fb9af6bef 100644 > --- a/include/linux/generic_pt/iommu.h > +++ b/include/linux/generic_pt/iommu.h > @@ -13,6 +13,7 @@ struct iommu_iotlb_gather; > struct pt_iommu_ops; > struct pt_iommu_driver_ops; > struct iommu_dirty_bitmap; > +struct iommu_domain_ser; > > /** > * DOC: IOMMU Radix Page Table > @@ -166,6 +167,35 @@ struct pt_iommu_ops { > * table from all HW access and all caches. > */ > void (*deinit)(struct pt_iommu *iommu_table); > + > + /** > + * @preserve: Preserve the iommu page table for liveupdate > + * @iommu_table: Table to preserve > + * @ser: Serialization struct to fill with preserved state > + * > + * Preserve iommu page table and the relevant state for liveupdate. The > + * caller must make sure that the page table is not updated during and > + * after preservation. > + */ > + int (*preserve)(struct pt_iommu *iommu_table, struct iommu_domain_ser *ser); > + > + /** > + * @unpreserve: Unpreserve the iommu page table > + * @iommu_table: Table to unpreserve > + * @ser: Serialization struct that contains preserved state > + */ > + void (*unpreserve)(struct pt_iommu *iommu_table, struct iommu_domain_ser *ser); > + > + /** > + * @restore: Restore the iommu page table after liveupdate > + * @iommu_table: Table to restore the state into > + * @ser: Serialization struct that contains preserved state > + * > + * The iommu_table is back filled with the restored state that was > + * preserved in the serialization struct. > + */ > + int (*restore)(struct pt_iommu *iommu_table, struct iommu_domain_ser *ser); > + > }; > > /**