From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=2 smtp.remote-ip=52.101.72.40 ARC-Seal: i=3; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796015102; b=QIVtOmiT3IiiLt2DbrdPEutKIA7o3CY+lc85o3Uqmr+EzGvsvcDgud6Wam17a9fJol9y y+D+IWhKkWj7e62fMeryV8o6kHa4U5PfUBCPedEimVcsl6FSZSPd8zEOw3pZCmCw+h1IC gvwdyFFPfjQLsxiGS5RQo1dfpu5WB6/VrOC3aWNjvyOy+Wf6a2yruCPUl2C7rWWsK5G3K T6Q969Q87DPKPpvs0nPPSXX30NS8b5LEPsoy9JLmVhgYu9srUav8ZmiZEWcN+Am4y8nU4 +OwcNAfv0lWKpGI+HbV8DA7X9POIY6oLm3T9AivQrKSrCMPGY88lYzBHVUFqRsBkJuA== ARC-Message-Signature: i=3; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796015102; h=DMARC-Filter:DKIM-Signature:Received:Received: X-MS-Exchange-Authentication-Results:Received-SPF:Received: DKIM-Signature:Received:Received:From:To:CC:Subject:Thread-Topic: Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language: Content-Language:X-MS-Has-Attach:X-MS-TNEF-Correlator: Authentication-Results-Original:x-ms-traffictypediagnostic: X-MS-Office365-Filtering-Correlation-Id:x-checkrecipientrouted: nodisclaimer:X-MS-Exchange-SenderADCheck:X-MS-Exchange-AntiSpam-Relay: X-Microsoft-Antispam-Untrusted: X-Microsoft-Antispam-Message-Info-Original: X-Forefront-Antispam-Report-Untrusted:Content-Type: Content-Transfer-Encoding:MIME-Version: X-Exchange-RoutingPolicyChecked: X-MS-Exchange-Transport-CrossTenantHeadersStamped: X-EOPAttributedMessage: X-MS-Exchange-Transport-CrossTenantHeadersStripped: X-MS-PublicTrafficType:X-MS-Office365-Filtering-Correlation-Id-Prvs: 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-OriginatorOrg: X-MS-Exchange-CrossTenant-OriginalArrivalTime: X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-Id: X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: X-MS-Exchange-CrossTenant-AuthSource:X-MS-Exchange-CrossTenant-AuthAs: X-MS-Exchange-CrossTenant-FromEntityHeader: X-MS-Exchange-Transport-CrossTenantHeadersStamped; bh=ksqZ2ZeQB40c0IRZINZrmtKwyKQ1ceTfmY38005s9wg=; b=XJnkzIYWlm89kkX6nmga65VRtBbzfiDtggpd8oK8JiQZkEbeLUcKH15CgcqvT7w3B9m0 jAnRDGeYwI8vNYUQx83BKvkFCt9UQIDPPki5sDN9rBIimcE4+2hYcpwaJ05TfvnZ6XDXV BscTm60K7uBQwA3QpRsYhwcZQkp2hN+vAhup6hjWre/1vEK4IvR7Z5lzrbFqtUDOtY54J qZz1b0Po+VRvj+iVPB8drLOVIZSXSHgudc9mBDgUQ7rERGFq4BqX3rd7juIRPIktgh2dF svK3ik8jp8Wn1yhCClCDudDrdCiIFCgtstWGZB+QouxKRbkpbtY44bYNJR7XAnBP/XA== ARC-Authentication-Results: i=3; smtp.subspace.kernel.org; dmarc=pass header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=O+ngVqvw; dkim=pass header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=O+ngVqvw; arc=pass header.oldest-pass=2 smtp.remote-ip=52.101.72.40 Received: from AM0PR02CU008.outbound.protection.outlook.com (mail-westeuropeazon11013040.outbound.protection.outlook.com [52.101.72.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (secp384r1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 369C2606A31C; Mon, 30 Nov 2026 05:05:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 369C2606A31C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=O+ngVqvw; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=O+ngVqvw ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=TB563LBAAREwBhiL2ZQ257My9pTWY2egUFIlq7uwixL/1+X/U/l3qX+LdPEEfKFJI6Dj4QAXKVQFHUOJrw8jamlh+rn6c8FddLgo7clMchvgzb6pzf7iDnZC2ujpMVODlLXRmH6w1mIG4In0FcHFUCgx5YhGOrZcFtZUj4DQd5UWgCFu0w6mv+J1O7OOWid+QwqSWtifwWub+IDWrudtoYGRojm88eoyvQaIPv1bx8N63Z9DOASDCo11FVYXKTxBqgH8/l6WaZk3w+qldbT1qhj7CE/40qSmLLy3xypo+MkBvGFF50We11av1TeMTtQdI6Jygjg6KsMgkjcM+qF1Qg== ARC-Message-Signature: i=2; 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=ksqZ2ZeQB40c0IRZINZrmtKwyKQ1ceTfmY38005s9wg=; b=sLpv+hOXhNTqK5YUW81pjuOjtLs8ZPifDRVJX4G1dn4/bPmMxcL2pY6uEEc7LjnKONUH3CarJ4FdMTGrmB0ppGBfEJb/DV70kH1lgkVva3/eHk6j5gozY3I0sYe10mo0yUdslzevgnvol+0C3jtrmARTe0O/+hpy07zbXx/whi0p/8Ln0QocNzmhDYWjt8b47aYLuvbLWcnB1LgbfbeRndyqRdwoItZjaFLeFSz2JM16wL5ZpMLsFKQiQIkmTIhfnI/p62OBLPCb/ezKA4XQBhm6Iw3TMXkuB3EP+Ia0nukUM9P5Ys647ffxusGiE7y9eMxl593Kbh33KeCmw+4LfQ== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 4.158.2.129) smtp.rcpttodomain=kernel.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ksqZ2ZeQB40c0IRZINZrmtKwyKQ1ceTfmY38005s9wg=; b=O+ngVqvwr3yJFElIuQ6SsTciDfOQQLfJwIc63jdn1C4ZF/aXr2XjhV8PcU+/201QzJ5/yIffRPPiFp23e2D5OoRTQrclFjVpJg1SB1VKgivV9Asc5CE/S17rQPK7SFnf2NIOzIPjJ8BRh5CqJl200p9F4CuW+5Id2yz8xH2WEVQ= Received: from PA7P264CA0420.FRAP264.PROD.OUTLOOK.COM (2603:10a6:102:39b::28) by AMDPR08MB11673.eurprd08.prod.outlook.com (2603:10a6:20b:73c::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.662.12; Mon, 30 Nov 2026 05:04:56 +0000 Received: from ZR1PEPF0000E6AD.eurprd05.prod.outlook.com (2603:10a6:102:39b:cafe::73) by PA7P264CA0420.outlook.office365.com (2603:10a6:102:39b::28) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.662.13 via Frontend Transport; Mon, 30 Nov 2026 05:04:56 +0000 X-MS-Exchange-Authentication-Results: mx.microsoft.com 1; spf=pass (sender IP is 4.158.2.129) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=arm.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 4.158.2.129 as permitted sender) receiver=protection.outlook.com; client-ip=4.158.2.129; helo=outbound-uk1.az.dlp.m.darktrace.com; pr=C Received: from outbound-uk1.az.dlp.m.darktrace.com (4.158.2.129) by ZR1PEPF0000E6AD.mail.protection.outlook.com (10.167.241.84) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.688.5 via Frontend Transport; Mon, 30 Nov 2026 05:04:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=avpEzho8CkL7exu3XkFrk+nJnaDjRFHN/mycApDMevyRjvEnpAn2nrX1sUf3aw70m4Y7Yozp4ZsfkPJvjBrpzsiySeRkkboyzdFU71WsUL3fXf1R+e1L2SyDZz26PPSxVBVvWM39HmAIkjcsmZHlJPd571TBPCe5sKJx8GidC/ZOK7FeHuHsEIeF+PsJFcfVWRHGiFfncafYXVwhLev1Oi66qncKkw/Y+ojA4OOrdzH/tHT4mqZra9hI1wk3c4QFl8QOywDhbMSKJ2HoFgw5GtPQyoKlYuSF4hVAyv3ee/k+YKf3jHdsSbZHlUm70UdZWJ31spEpCdoNs1hEaMuobQ== 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=ksqZ2ZeQB40c0IRZINZrmtKwyKQ1ceTfmY38005s9wg=; b=OijtgwbaQCDJ06h8OqluARJEMbtj8ms1FN8G873paLLIRUWBX4kAL87iYLWUUdmtXBWek/bQ8XiPTBnNA8hWb7kn8NqLwBAH9ghr/6qaPR+uzqR9kxg/GHk/PpliwMyABxMxfXQWeT7H5iPt6z/y7nWK+sKML4IhQUKNbeAHTiPGVkumAkpX0xTt5WHqIWlLdl7YBH1Z/Ggb+qBOHkQ2KwnQ8OO/XyJZI1EQABkXfrihYEqYv5YrPKtav8SZBJeAdwWr2Lm4KtB1q7EX1wjV3F7j8enC4lDBWBdXD8m69l7W/+qsBDEcOvzvwHqB7515QL5D/3qmlCcO4+Cd2IWQLQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ksqZ2ZeQB40c0IRZINZrmtKwyKQ1ceTfmY38005s9wg=; b=O+ngVqvwr3yJFElIuQ6SsTciDfOQQLfJwIc63jdn1C4ZF/aXr2XjhV8PcU+/201QzJ5/yIffRPPiFp23e2D5OoRTQrclFjVpJg1SB1VKgivV9Asc5CE/S17rQPK7SFnf2NIOzIPjJ8BRh5CqJl200p9F4CuW+5Id2yz8xH2WEVQ= Received: from AS2PR08MB9786.eurprd08.prod.outlook.com (2603:10a6:20b:605::22) by DBBPR08MB10554.eurprd08.prod.outlook.com (2603:10a6:10:52d::15) 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 05:04:16 +0000 Received: from AS2PR08MB9786.eurprd08.prod.outlook.com ([fe80::d721:dfdb:2f83:155]) by AS2PR08MB9786.eurprd08.prod.outlook.com ([fe80::d721:dfdb:2f83:155%6]) with mapi id 15.21.0662.007; Mon, 30 Nov 2026 05:04:16 +0000 From: Justin He To: Marc Zyngier CC: "oupton@kernel.org" , "fuad.tabba@linux.dev" , Joey Gouly , "seiden@linux.ibm.com" , Suzuki Poulose , "yuzenghui@huawei.com" , Catalin Marinas , "will@kernel.org" , Mark Rutland , "pbonzini@redhat.com" , "seanjc@google.com" , "shuah@kernel.org" , "linux-arm-kernel@lists.infradead.org" , "kvmarm@lists.linux.dev" , "kvm@vger.kernel.org" , "linux-kselftest@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Sashiko Subject: RE: [PATCH v3 1/4] KVM: arm64: nv: Locate the VNCR page in the host page from its PA Thread-Topic: [PATCH v3 1/4] KVM: arm64: nv: Locate the VNCR page in the host page from its PA Thread-Index: AQHdftX53f+M4X8FY0e9zu5tBxQ20LdE8oKAgAEaSBA= Date: Mon, 30 Nov 2026 05:04:15 +0000 Message-ID: References: <20261128011447.3588988-1-justin.he@arm.com> <20261128011447.3588988-2-justin.he@arm.com> <86mrqryhvu.wl-maz@kernel.org> In-Reply-To: <86mrqryhvu.wl-maz@kernel.org> Accept-Language: en-US, zh-CN Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: Authentication-Results-Original: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; x-ms-traffictypediagnostic: AS2PR08MB9786:EE_|DBBPR08MB10554:EE_|ZR1PEPF0000E6AD:EE_|AMDPR08MB11673:EE_ X-MS-Office365-Filtering-Correlation-Id: 0e5468dd-4175-4f75-fa2c-08df4e9f793a x-checkrecipientrouted: true nodisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0;ARA:13230040|366016|1800799024|23010399003|376014|7416014|38070700021|10067099003|56012099006|261028144727099003|261026140227099003|261026121527099003|261021123027099003|261021121427099003|261022105027099003|261022075727099003|261102123227099003|261009223027099003|18002099003|22082099003|5023799004|11063799006|4143699003; X-Microsoft-Antispam-Message-Info-Original: Ednv7mXdhiivM2iLQVRccF6NSZgBLq5LBHXDKwePm6ntOwSGWqtS6EntgC0vZlRbnh7sLQnpkBO/I5l0tLZT3Cto4DHgHv3TYHkN1Ykgb4FK6L+4vVrIFc3haEbWIzh5OfVNC+F9myx7Hq1Sc7PB64/lzgA1tS25T764ZoO6wv+9/aTeOUtpv0ChXpcJciAkczaynW8FqDH1oz4G94OLRJHdPCEE2gSs+oQtnFczgPLRHVfPlInNl5sECq/DoN2+l0ClwW5NF6uFW+R+0g3jTThNPJORLIfUIQaBcNV9oCwB+C4LIvPyMGXDHx7yS5j2LketGISmrqiVvaS/IPqD7rk66PmGSU5kHCnZU63MUrmO9NKOOkBwomnqjbmRqEjh71Qv4fLQOWSKzWwR6cuqQOIhA7J5KeFLSb8gPqqjBJ/K085G2brPkrXF0zvm2+/+E/vVtda+WJVsmtBRpwZGUbs0FjdciIsUAuE59/mV9CHNnyJyneASidIX7kguoZ4P/QJJ9CR8R4gQEAMlcYz4j8VVZZVHPNA0YW1hm16u1tfDTJdky3v/yNEsSbezR27s4iaEwIbK6qyOy3XChdraEyS2p7KfZ6zMHFUNvls73no+aSRp7hrdzNky5gI5bUIjkTDomGGmQhnqtuc9OAV2PqfoSwg2+qNq+wAPq6jf1LM= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS2PR08MB9786.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(23010399003)(376014)(7416014)(38070700021)(10067099003)(56012099006)(261028144727099003)(261026140227099003)(261026121527099003)(261021123027099003)(261021121427099003)(261022105027099003)(261022075727099003)(261102123227099003)(261009223027099003)(18002099003)(22082099003)(5023799004)(11063799006)(4143699003);DIR:OUT;SFP:1101; Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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-Exchange-RoutingPolicyChecked: Sz8cCutwC5el+9Sez4sph/znzt7Ip/GvFy+gp4/l2GqcAlwaB7w/ACBS7ykINDL4rWmOUEd3gFYU5E5b8ahJQm3QwkHsX7j8u9x2jiAFnvZCojUaXv1Rk8Ff7HJn/rhYyI9UF6MPdtuSAf1vg04NIFd8L/iVmWHN/e0J31ED4LCarpEqUd0ghiV3xIIUJMZqy8zMsy2E2OYK08KNwpTfBCdLwzeTONrPuYUAcELNX9EroKXrNLHoB/M5f0AzBopgCyk1CbtKnhPjpnnIDFilL1ShDNhTwEl75n11P8xGuwzJOPwSZhZ+3/0fMks8dAVNsxvE3fa18tXPb6v8xWgWUw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB10554 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: ZR1PEPF0000E6AD.eurprd05.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 75d88393-0dcd-401d-3abb-08df4e9f61eb X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|7416014|82310400026|36860700016|35042699022|14060799003|23010399003|1800799024|11063799006|5023799004|4143699003|261009223027099003|18002099003|22082099003|10067099003|56012099006|261102123227099003|261028144727099003|261026121527099003|261026140227099003|261022105027099003|261022075727099003|261021123027099003|261021121427099003; X-Microsoft-Antispam-Message-Info: j1f9ocPuLAxgzJe3sIJGoCfPvPkI8/Du9LN/Yr7JjK+DEo0jaidHj7R7Kmz3wTMFEnlGY3o4LWnx64sYjlLAkSxuf6hWkiiW0+OgfL/cXGrHZXrbFNVyJZZcwk2T9fZUwjaUTQFgzBzUu3lJnGYq2dx6BM8iXx8EvTECXNVBz+O4I93JV9th7yuP7KOeLgJn7NT+E7TqQtH60b4sd/fuq1iKF0wC1E1a95kQgxh7QuTrlpEoG4AMcKtCfd2sLoz4r5n5QWST5oGYkEBkdB6YtseWI6RAFaq0OhAjpWKwOqfR1P5JFCkQxEdkKLHqT0VB1kvrjzyo8qYt6iqRsMEN44JEDsX8LCqc+JkjfDBaz1pr3IdPzj31GfUBTIshcmg/gJQFX9dpe5/vfvUbcro8GUzD/2RWtmocF6MmPQjoy7GsgsanF54Pef3HGrE1tYum85wgy4wNfQ9S/H/F5ykbYpfq+V++fFtsOrcnHA4x/8jJJA8agc25d+zMss2IWeyBDE5ApSuSPpwmVR6lYjtgndEUMeyL5hojgmVD+Fndb/oaumVdYg6Ps+siU/6ZzEJWFnaRqSPQgovMOLGs9NyHXuJ0Me27WNQ471RPlBFOOWz3HciRTeDOxKIXxf0gnHf/mS/Mpyj46obPDymV+/vrSQ== X-Forefront-Antispam-Report: CIP:4.158.2.129;CTRY:GB;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:outbound-uk1.az.dlp.m.darktrace.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(7416014)(82310400026)(36860700016)(35042699022)(14060799003)(23010399003)(1800799024)(11063799006)(5023799004)(4143699003)(261009223027099003)(18002099003)(22082099003)(10067099003)(56012099006)(261102123227099003)(261028144727099003)(261026121527099003)(261026140227099003)(261022105027099003)(261022075727099003)(261021123027099003)(261021121427099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: nckz0whiOFORMDuqiDbFcQaz3GNyww1CoGBBmHVJBFfACQnouAexfxa3hNbi9LUGtEfqFx87/ezIX5StEk9ueuPuuwP4B1WKcBvY0tQ2fNoI6i920SjZ4EWn1yAm65B3B0LQtMtSoB/ThDeLMtlkEwBZgTNt1PJdhZo5axzm9Al3wH6iZDopGyz92mOVkcj9aR4LypSTBc9VZd6zanxnqfWLd47kntgICEJzJDrkdz+xpw0+xjxAUXXfCTxS4nXL+2DYJU1jnOgT7f1bBxBGv3wOlnIcXzMYOxWiYedKWO9GnQSUBBzJyXGYX5jp6MTgM/ongdI13M1IGPrEqx1NP5eBqgdMVznD5PErMg2FhLC6OawEYl6k35p6Z8/FoAQpnEHhmu4z0xWiEc7ptdyIYwgsPqssHTulevlILAVvAx0QS5wmhv/u9EGlMR/WKpOW X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Nov 2026 05:04:54.8904 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0e5468dd-4175-4f75-fa2c-08df4e9f793a X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[4.158.2.129];Helo=[outbound-uk1.az.dlp.m.darktrace.com] X-MS-Exchange-CrossTenant-AuthSource: ZR1PEPF0000E6AD.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AMDPR08MB11673 Hi Marc, > -----Original Message----- [...] > > > > VNCR_EL2 only needs to be 4K aligned. On a host with 16K or 64K pages, > > kvm_translate_vncr() records the host page that contains the guest > > hypervisor's VNCR page, and that host page is mapped at the VNCR fixmap= . > > __compute_hcr() then takes the offset of the VNCR page in the host page > > from bits [PAGE_SHIFT-1:12] of the guest's VNCR_EL2, which is a VA. > > > > If the guest hypervisor uses a stage-1 granule smaller than the host > > page, these bits of the VA and of the PA can differ. The nested context > > then accesses another 4K page of the guest instead of the VNCR page. > > >=20 > That's a pretty dubious setup, given that a guest hypervisor cannot > use a S2 that is smaller than the host page size, and therefore would > have to use a S1 size different from its S2. Possible, but unlikely. >=20 The selftest uses a 4K EL2 stage-1 with HCR_EL2.VM clear, so no nested stage-2 translation is involved. > > Take the offset from the PA that the walk returns, and keep it in > > vt->hpa. Use it only while the VNCR page is mapped. Otherwise the > > fixmap is clear, the access faults and KVM translates VNCR_EL2 again, > > so the offset does not matter. > > > > Tested on a Neoverse-N2 host running 16K and 64K page kernels, with the > > selftest added later in this series. The test maps the VNCR page at a V= A > > whose bits [15:12] differ from those of its PA. With the offset taken > > from the VA, the nested context reads 0 instead of the value in the VNC= R > > page. With this patch, it reads the expected value. >=20 > That's for the test commit message, not this. Sure, I'll move the test results to the selftest commit message in v4. >=20 > > > > Reported-by: Sashiko > > Closes: https://lore.kernel.org/all/sashiko-outbox-232440@kernel.org/ > > Fixes: 73e1b621b25d ("KVM: arm64: nv: Program host's VNCR_EL2 to the > fixmap address") > > Signed-off-by: Jia He > > --- > > arch/arm64/include/asm/kvm_nested.h | 1 + > > arch/arm64/kvm/hyp/vhe/switch.c | 9 +++++++-- > > arch/arm64/kvm/nested.c | 8 +++++++- > > 3 files changed, 15 insertions(+), 3 deletions(-) > > > > diff --git a/arch/arm64/include/asm/kvm_nested.h > b/arch/arm64/include/asm/kvm_nested.h > > index 0f899addafa8..bc54a4b2e863 100644 > > --- a/arch/arm64/include/asm/kvm_nested.h > > +++ b/arch/arm64/include/asm/kvm_nested.h > > @@ -432,6 +432,7 @@ int __kvm_find_s1_desc_level(struct kvm_vcpu > *vcpu, u64 va, u64 ipa, > > /* VNCR management */ > > int kvm_vcpu_allocate_vncr_tlb(struct kvm_vcpu *vcpu); > > int kvm_handle_vncr_abort(struct kvm_vcpu *vcpu); > > +unsigned long kvm_vncr_page_offset(struct kvm_vcpu *vcpu); > > void kvm_handle_s1e2_tlbi(struct kvm_vcpu *vcpu, u32 inst, u64 val); > > > > u16 get_asid_by_regime(struct kvm_vcpu *vcpu, enum trans_regime > regime); > > diff --git a/arch/arm64/kvm/hyp/vhe/switch.c > b/arch/arm64/kvm/hyp/vhe/switch.c > > index 3f2390a13173..0d15beea418c 100644 > > --- a/arch/arm64/kvm/hyp/vhe/switch.c > > +++ b/arch/arm64/kvm/hyp/vhe/switch.c > > @@ -94,8 +94,13 @@ static u64 __compute_hcr(struct kvm_vcpu *vcpu) > > if (guest_hcr & HCR_EL2_NV) { > > u64 va =3D > __fix_to_virt(vncr_fixmap(smp_processor_id())); > > > > - /* Inherit the low bits from the actual register */ > > - va |=3D __vcpu_sys_reg(vcpu, VNCR_EL2) & > GENMASK(PAGE_SHIFT - 1, 0); > > + /* > > + * The fixmap maps the host page that contains the > VNCR > > + * page. Locate the VNCR page in it from its PA: with a > > + * smaller guest granule, the VA may have another > offset. > > + */ > > + if (host_data_test_flag(L1_VNCR_MAPPED)) > > + va |=3D kvm_vncr_page_offset(vcpu); >=20 > This is a bit gross. If nothing is mapped in the fixmap, then the page > offset doesn't matter, does it? The comment is also pretty confusing. > It should read something like: Agreed. I'll drop the mapped check and use the offset directly from the cached HPA, along with your suggested comment. >=20 > /* > * Inherit the offset in the fixmap page from the PA bits > * obtained after translating the guest's VA. > */ > va |=3D offset_in_page(vcpu->arch.vncr_tlb->hpa); >=20 > > write_sysreg_s(va, SYS_VNCR_EL2); > > > > /* Force NV2 in case the guest is forgetful... */ > > diff --git a/arch/arm64/kvm/nested.c b/arch/arm64/kvm/nested.c > > index 4d83281a7a28..08582fbc09d5 100644 > > --- a/arch/arm64/kvm/nested.c > > +++ b/arch/arm64/kvm/nested.c > > @@ -1643,7 +1643,7 @@ static int kvm_translate_vncr(struct kvm_vcpu > *vcpu, bool *is_gmem) > > } > > > > vt->gva =3D va; > > - vt->hpa =3D pfn << PAGE_SHIFT; > > + vt->hpa =3D (pfn << PAGE_SHIFT) | offset_in_page(vt->wr.pa); >=20 > You should also make sure that when this is fed to set_fixmap(), the > sub-page bits are cleared. Yes, it currently does the right thing, but > I don't want to rely on this. Agreed, I'll explicitly page-align the HPA before passing it to set_fixmap(= ) >=20 > > vt->hpa_writable =3D writable; > > vt->valid =3D true; > > atomic_set(&vt->cpu, -1); > > @@ -1683,6 +1683,12 @@ static void handle_vncr_perm(struct kvm_vcpu > *vcpu) > > kvm_inject_nested_sync(vcpu, esr); > > } > > > > +/* Offset of the VNCR page in the host page mapped at the VNCR fixmap = */ > > +unsigned long kvm_vncr_page_offset(struct kvm_vcpu *vcpu) > > +{ > > + return offset_in_page(vcpu->arch.vncr_tlb->hpa); > > +} >=20 > And this helper can go. >=20 Sure, I'll drop the helper in v4. Thanks. ___=A0 Best Regards, Jia He (Justin)