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=52.101.52.49 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796079046; b=sJpGJcvFHH7Apw4eMS7L3iC4ejjwH9iS6mvBi9hB7qAsoP9x3Q/ReHyG7rjnGivdPJhx Vsgf5wIL0gIeA4N853lcXfGM32M3Ar/BjiXYTngWgaRAzie91HhRjfq/toc4rz9Bdozv+ NReKB4lvfejgd0+RDl06G0Eo1sLLB2ee7COtVmWJq0iVpYXA28nKiIm166Moh8N7/DySY dIw8lQAu53fuDpw4UADKSciU0T3ue3jsd3rNnn6GcfLnCQ0aCd99M0N4hj422wAV3rbKc Rysyc4dXrHbnvcdfKszkyTO4EsPg7g5OVIFNMgkH6j2kEac+WDXtXVxBAmldqns8Nmw== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796079046; h=DMARC-Filter:DKIM-Signature:Received:Received: X-MS-Exchange-Authentication-Results:Received-SPF:Received:Received: From:To:CC:Subject:Date:Message-ID:X-Mailer:MIME-Version: Content-Transfer-Encoding:Content-Type:X-Originating-IP: X-ClientProxiedBy:X-EOPAttributedMessage: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-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=0oZlweaOuXCdrrwrvOnn1LXXzcEItdfSOO2oWXGt3ik=; b=wGxpgJZqCybgID586KKbylJa3iYkyIb8fep5hc4C8fw3cCy2qOszbVeHcPr5fUGtBOuY JtlTCJ77B/C4lFrLpfCvLtB8xX6UHD8Q249YIdFG01aTt2bIcLipnIsWjRKFxtujkIhUm YHB1atd6A8Ogi0u+cN6cGYW279nZwz4nyG8RIlocNUV6Tukdy6cW8IDyFkT9dX0ovy1Nj rrrrCSFSaTarzJiyzxA2xP10kBQOFOKQOn0MCCE3bKSJiAr9Q9hSS/dOdy845N4LveryK h6fY7CsDGBJnZOvCDWL+J8A2uqHXqxMLWKOdtAHVJ/HZA2QuiyP+qqQSRX07Pow5HKg== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=EqE6ZBCx; arc=pass header.oldest-pass=0 smtp.remote-ip=52.101.52.49 Received: from BL2PR02CU003.outbound.protection.outlook.com (mail-eastusazon11011049.outbound.protection.outlook.com [52.101.52.49]) (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 332A5606A31A; Mon, 30 Nov 2026 22:50:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 332A5606A31A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=EqE6ZBCx ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=kTwD7srO3+fHkmHjNWQtULK0k7wL111GSv5e8Spf8qMQqOlaQvqftIDzdcXJ5rvGj1fuYzDg+Q6fT/MgM4V5Hr+Qujs8IYU2zZJvVV7WLorO4ijZ4xigqS4rUAJheDT1M3NDbMZgosuwgzvXdB+PNR5e0dwwkrqy7agUtJe4lf9KLD+jdOwizmGNiSWb/J6GRBnfVZKBI7DWM+LNDVCXtISzXScRImKFZ8F3gvToGE1c2YeaFAs6BChYIzSnCj69hJkBnJvDc1FG8i3CgvR7EeX6lAGLijMHBMcQ4AOKd2lbSGm2O4fLn9NzTDc1xI+mQfYWg3xjJIcY7HAimmF7Vg== 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=0oZlweaOuXCdrrwrvOnn1LXXzcEItdfSOO2oWXGt3ik=; b=TJtNQKoH67RZwn/2lJGEg5yk2qvUfIm6OMche8gjIG9joF2Mw/ewEGWQbGXYzuXNKn+J+3iyikLolX5KP0lR6LqFTcia19d/UvCY1L6ZdPY0TQzuMkFAMI6HBtCAJZAPBDAm7A62qns+nk0oKb071kj/W+SN/MSvHjaK6n5foyfOhKXHiA2DciSYs3RcQamCVZH+iFsQNaGKpK07D2yz0SHMBEoLccud4WqNwrx6CTyQFBOyH4k1mKOGIg6/saJ2+go+N8FOB5ZkMSAtrYJns7nOI6F8wiMXi1eJ3Jw+TkhddIRvtdK/QrGl4KMtKY/0qdMAprFmn1o/RppEflBRwg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0oZlweaOuXCdrrwrvOnn1LXXzcEItdfSOO2oWXGt3ik=; b=EqE6ZBCxotuZVgLzeh/uJUEXcpzeyB3utCyWZehieUw1MvFACqKyxuf9xbSurjXGnP8yD8ttGI1jqiASn2WvB2/WY3GHzGMeJug+j2rZ67BoUjocRquZpbuXf7trRtF7UsRhGiNbIIIoAN5A2a7UC/T0U/ceTTDX8FqUQP0f8Uc= Received: from SJ0P220CA0020.NAMP220.PROD.OUTLOOK.COM (2603:10b6:a03:41b::26) by CY5PR12MB6371.namprd12.prod.outlook.com (2603:10b6:930:f::14) 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 22:50:41 +0000 Received: from SJ5PEPF000001CE.namprd05.prod.outlook.com (2603:10b6:a03:41b:cafe::8f) by SJ0P220CA0020.outlook.office365.com (2603:10b6:a03:41b::26) 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 22:50:41 +0000 X-MS-Exchange-Authentication-Results: mx.microsoft.com 1; spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by SJ5PEPF000001CE.mail.protection.outlook.com (10.167.242.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.688.5 via Frontend Transport; Mon, 30 Nov 2026 22:50:40 +0000 Received: from nigeria-2635-os.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.57; Mon, 30 Nov 2026 16:50:39 -0600 From: Ashish Kalra To: , , , , , , , , , , , CC: , , , , , , , , , , , , , , Subject: [PATCH v2 0/2] x86/sev: Per-node RMPOPT windows for >2TB systems Date: Mon, 30 Nov 2026 22:50:24 +0000 Message-ID: X-Mailer: git-send-email 2.43.0 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 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ5PEPF000001CE:EE_|CY5PR12MB6371:EE_ X-MS-Office365-Filtering-Correlation-Id: 5ce28184-a2d6-4f5e-e7b4-08df4f345bee X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|376014|36860700016|1800799024|23010399003|82310400026|921020|10067099003|56012099006|11063799006|261022105027099003|261009223027099003|261102123227099003|261028144727099003|261026121527099003|261021121427099003|261021123027099003|261026140227099003|18002099003; X-Microsoft-Antispam-Message-Info: 5aPI2TfMyMzxpXSEPECfIJN2WRf6vkHu/TY44fucxvOacwX5zp5yI/PnZk/4ldHZzgnnXBZJuJv51leJdSOYLfdlpWKETtrSBXUIyc3CX/GGx8v0CYJR3YHKNGpjbKtwmJU3PFXCEoLFUs+YrHTfOzlcfOyA5KctcgxcwTML7bPI1LsrxrJtvhb70M77qkhvl0nhZyHmcWA+uMP/mWMTFIuNYVDIsdI/DTnZs1Nf7BBCSW4fmwhzTsnb6kht1PqHA73u5NsjX8wffbYqCD7xUUKZlgIKelW7kok2CqBbOowFVvtgytdHzvEjgWpLB7kJ1/T71i3NhVysxIZA8i7SNTwYg+sak7N/7i0BT/OPR2gHK5/4J/G+FQNbtJm4g1ajC8wtHw3VbqtlkVlSpzvY137iTFBlWuNB/722n568FE5nxHRlMyU0/LfCKQRSWWW7bWQsQrNHcBagKa9Nz+oGKjVyBkRSRTlmfaMP9Pfu4ud65A5Fm7jZMy/H9M01Nrhl0e79hYeyN8aIS7D8vepNDuaxpEku3pPLYsK90DiyUUBAhhqsEN/ITUYieufrUdwShiPgi+Tnc1vDvOsmwfcwmAHUKWINarI/ahb2XQblvOvSG/ujTlCF2SPTP+Wken0Ezls0cm0DPzMYbhCxMwY6b//E46JU3a4pB6GLKtVM85ahfTkr5rUVvjGtsu6x0r2CsEnjnoPqtmWEkFF5F7wYNczl7Hl1yu0VYDkT+CYJ+yngBT5ADCbKvWWjIj4mvaZC X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(7416014)(376014)(36860700016)(1800799024)(23010399003)(82310400026)(921020)(10067099003)(56012099006)(11063799006)(261022105027099003)(261009223027099003)(261102123227099003)(261028144727099003)(261026121527099003)(261021121427099003)(261021123027099003)(261026140227099003)(18002099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 3OzGldxJWltrEofkZPkL4hwkJNR/wcD1qBOpy5Ed1jHHAE8KdwJ7pWMFbkmIwfekqBeFSZ5QNNEZzTYzH580DCV5NE/k+XoNWltbxbT+XEAckSBcLnUA+vKOA53JsJAsMnVNxDjGwYiRgqVNAxoXKTyDt8Ay0htK0Pf3XxSeSDDbqXpilIIe7hnF9kAmao1OkY/lFv4+XfA0BmSR32EuEYnysa01Fy0yWKTl4Zi3qun8v7LQrfF4D46BaPM2Xbm1vcCrG8C4GgJJx5XSB13S0GpkDUnkYeDUBeQp5IbVWp11R59OjxBOSto9ISyt5kOtpbEWeYw5WSr9bFSnJkB6/UX6ajyG6LsG5l6qL5NDccl8JqqXPlQcZ7Dy0PczeUCpB5SauN9qfQ4Rn5J1AtbEG71ZoOHlXEehwf0JDKRVOj4DmMY5sBWTX5wLVRLqyhwG X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Nov 2026 22:50:40.7902 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5ce28184-a2d6-4f5e-e7b4-08df4f345bee X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SJ5PEPF000001CE.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6371 From: Ashish Kalra RMPOPT_BASE is a per-core MSR whose optimization window covers at most 2 TB of physical address space from its base. The merged RMPOPT series programs every core with the same base (start of RAM), so on a machine with more than 2 TB of RAM only the first 2 TB is ever RMP-check-skipped; everything above 2 TB pays full RMP checks for the life of the system. This series extends the optimization across all of physical memory on >2 TB systems by giving each NUMA node's cores a 2 TB window placed over that node's own local memory. A core overwhelmingly accesses its local node's RAM, so spending each node's 2 TB budget on that memory puts the optimization where the accesses land; whole-machine coverage is the union of the per-node windows. The <=2 TB case is unchanged: the window search returns start-of-RAM for every node, so all cores share one window. Patch 1 generalizes the optimization scan to read each core's own RMPOPT_BASE (base and window size straight from the MSR) and walk only that window. No behavioral change while every core shares one window. Patch 2 adds the per-node window selection and programming, and warms every window before the interrupts-disabled fan-out. HW-validated on a ~3 TB 2-socket NPS2 box: every node optimizes its own local memory and all populated memory is covered. v2: - Classify each 1 GB region by its overlap with a NUMA node's pfn range rather than by its start pfn, so node 0's first GB -- whose start pfn is reserved -- is covered instead of dropped. (Sashiko AI review) - Initialize the per-node warm-up work for all possible nodes rather than only the online ones. (Sashiko AI review) - Rebased onto current tip/master, converting to the new rdmsrq() calling convention. Ashish Kalra (2): x86/sev: Scan each core's own RMPOPT window x86/sev: Add per-node RMPOPT windows for >2TB systems arch/x86/include/asm/msr-index.h | 2 + arch/x86/virt/svm/sev.c | 167 +++++++++++++++++++++++++++---- 2 files changed, 149 insertions(+), 20 deletions(-) base-commit: 75b8262a97abcb972ef897dad5f94d425157b635 -- 2.43.0