From patchwork Fri Jan 26 04:11:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 13532060 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 D0535C48260 for ; Fri, 26 Jan 2024 04:45:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5970C6B00A4; Thu, 25 Jan 2024 23:45:50 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 51FB96B00AE; Thu, 25 Jan 2024 23:45:50 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 371146B00AF; Thu, 25 Jan 2024 23:45:50 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 1D3656B00A4 for ; Thu, 25 Jan 2024 23:45:50 -0500 (EST) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id E6603C0236 for ; Fri, 26 Jan 2024 04:45:49 +0000 (UTC) X-FDA: 81720224418.25.8A47485 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2074.outbound.protection.outlook.com [40.107.92.74]) by imf20.hostedemail.com (Postfix) with ESMTP id 142C51C001F for ; Fri, 26 Jan 2024 04:45:46 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=amd.com header.s=selector1 header.b=VRpfg1eR; dmarc=pass (policy=quarantine) header.from=amd.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf20.hostedemail.com: domain of Michael.Roth@amd.com designates 40.107.92.74 as permitted sender) smtp.mailfrom=Michael.Roth@amd.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1706244347; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=9AMGVMMWRfpMi4iyhUnQz528Hz/O4DZ5uaxI+sp5psM=; b=tgA+gnaHqUX9Y92AXfSwNaIdJfYG4twAYDnjhjwpwUzGwk81pTLUFIsgbZHU0qh9rBFSFb MZ55iO7zpriQSggk1aIipDYY//62lJRe4/LcvT0lzOO1jeQEIA6apEOTsZJCbP5lVgpTfx x/pM10Y2YxmifdOHswTuV+nQghptpi8= ARC-Authentication-Results: i=2; imf20.hostedemail.com; dkim=pass header.d=amd.com header.s=selector1 header.b=VRpfg1eR; dmarc=pass (policy=quarantine) header.from=amd.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf20.hostedemail.com: domain of Michael.Roth@amd.com designates 40.107.92.74 as permitted sender) smtp.mailfrom=Michael.Roth@amd.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1706244347; a=rsa-sha256; cv=pass; b=JW18Tg4liQZLVDnse0+ykqkFoEnNAMbzd8gSfwDVozxrMNRmGz8frSBYcrDYoPCh2FWXE3 pgvLsMwEBGdWTz9uqK9+uvGGl2k1nR4x1wQslQVBRWH8BUP2WNItHkxwdyoEpGj3P2N6lY UO1N77UQ6ylUlTW+hU5AqKv85cRFpIg= ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=J6wjTveJHPX6U+uUvmKwgGtIa8NA12O44etpuwPmlmOPIHinAZ3BP3+PK/SF7N5pXWzz2EHx8HwsGguJWrOpg7V5+o0CTVTBiI2YH8mX1KKG2VIfN4WmQN7RTknrY8f8YimYopZaRHx/JTfjDSju4lSKG29GSPoSjAx+m/+uqBVRx188JYaBKVWERrZN88ap8lKe2OT+5iM9/rQlSN7LfD57Hfn9Ia4Cgse56CBQ7kts34FAZVBOillzS0l/DfVuGozqQKXVJOtcsNIaW8chQkb9O1tAHqNcDKw+hICra6+AQrMZ+hVEHEXdE9Sa4AXBlRaWxOGi+DE5W9l39pAKqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=9AMGVMMWRfpMi4iyhUnQz528Hz/O4DZ5uaxI+sp5psM=; b=oPkgfGwNW1mjAOS64BqG8Lro1NE76vwvXzlIz6HTtyhtMmDzLe4L+ktAdcY1TFKTi068upOlsV4evEDTLIu8/xoNx43fe1GUQ4ASVQ8I9KzN64R9Zo4cffJnBZb8W3eS5G9Z7/pRz7Io9msWgce0rNCAQN0bxbEA58EHykYQT7yZImlWd2GKq0IIZPA7K1Ub+N+7aUDsjDvk2DdziF0uhnFETvpdqrmclpnDA2zUho4tunYsKB8mvJsBPXBg3s4/j1qUq5itNk56wIK040teyXgIFPZOXOvUEw4ShwAJP0PK7k8F0OY5esQqDOyolP6tBUqX+X+2FjOkFwBNR1kq5g== 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=9AMGVMMWRfpMi4iyhUnQz528Hz/O4DZ5uaxI+sp5psM=; b=VRpfg1eRJBgaFp0qlb4QLS86yagyUuSMiUh32zHu8+WMev2gdIuma23xhcZ5cj1jf/CNZ1E8RFefCyRxhTmiINmzIkICwuOP0FeNaUvDqRH/jgP01QhxHJk+utzUOM9J9sMh3Be059ZhIIYR+lvZR3z6/Atk8gm0zA+xm1NOVik= Received: from DM6PR08CA0011.namprd08.prod.outlook.com (2603:10b6:5:80::24) by BL0PR12MB4915.namprd12.prod.outlook.com (2603:10b6:208:1c9::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.27; Fri, 26 Jan 2024 04:45:44 +0000 Received: from DS2PEPF00003439.namprd02.prod.outlook.com (2603:10b6:5:80:cafe::69) by DM6PR08CA0011.outlook.office365.com (2603:10b6:5:80::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7202.38 via Frontend Transport; Fri, 26 Jan 2024 04:45:44 +0000 X-MS-Exchange-Authentication-Results: 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=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DS2PEPF00003439.mail.protection.outlook.com (10.167.18.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7228.16 via Frontend Transport; Fri, 26 Jan 2024 04:45:44 +0000 Received: from localhost (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Thu, 25 Jan 2024 22:45:41 -0600 From: Michael Roth To: CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v2 22/25] x86/cpufeatures: Enable/unmask SEV-SNP CPU feature Date: Thu, 25 Jan 2024 22:11:22 -0600 Message-ID: <20240126041126.1927228-23-michael.roth@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240126041126.1927228-1-michael.roth@amd.com> References: <20240126041126.1927228-1-michael.roth@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS2PEPF00003439:EE_|BL0PR12MB4915:EE_ X-MS-Office365-Filtering-Correlation-Id: 100c4706-a2ee-4b33-17f6-08dc1e29a814 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rHP180opXMHn+HCrZQ0/PpXNBbJB3JxvKE7k+OpmZnHQ+LzBKxp7gRHVQQlmPosLwWL++N8oxZ0cEbPepgnvyeoN65rhJD3kV+P+3McVQ4Yy8lKrgyy+pUKyCyqayu91rZ0/pmwN2PsWSDg06ZeGVpMPKNYA0fi2RGHDGJJhP4WL/CqictxAXG2PVWqTsE78+i7Uv8SUzxm4VM7v+X4Yg43X5nckjA2+mlYNa1w0jY892ofL/LsvoLMNfKsvBXVePYzbjoNKUGWLYmhxoJAjbqA8pxrYNIDpnE8GQN6h9/IFecUHkDdOu5efRSN/dbWIgaEnQNrF/QPl5nY/O94f5qXiuBBPtA4tdSZxcS6/PLIg/1fAoWt3YrofpWrZtIyV6CtgQOOjiYD1Yj5Cn9QMrtcgVk8hB7fiRHZ++yQI4ivVp9GckmuMjiE8L0eAFk87Md0MBkJHcvxE/NrI6Rx4LM60WOSoWVO5MHTZycc/9+BiMSPOGX2SCt1CvBzp9GgpcPr92XiJGCOwj/ntiYOy2LbAq5qYWGEiW3iaNuBYggEgcD2/bF9CZrBzsKssQFq85WuPGcZJeEiMZPMYtpjwyojzaa7w36Cop09OA/LK05/h5toLF24mK3gCUSH9K3ZB19nu6qb8m2Aqa40AVgkHI1lx/9Qz/Sqpv2h4xj5NouAHa96PCFhvZ746MtgSIOa/oz69mjxpYVH1ArG9kb6JniBLxmVEd1G/KzKBQkwK0VRoSKJWda3bpMNZOEFHg4KxmrolhMZUlsEJvVbzpQ/PuA== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(4636009)(396003)(136003)(376002)(39860400002)(346002)(230922051799003)(64100799003)(186009)(82310400011)(451199024)(1800799012)(36840700001)(40470700004)(46966006)(40480700001)(40460700003)(83380400001)(47076005)(36756003)(356005)(81166007)(86362001)(36860700001)(44832011)(8936002)(8676002)(4326008)(5660300002)(426003)(336012)(26005)(16526019)(2616005)(1076003)(82740400003)(70206006)(316002)(54906003)(6916009)(70586007)(7416002)(7406005)(4744005)(2906002)(41300700001)(6666004)(478600001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jan 2024 04:45:44.1211 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 100c4706-a2ee-4b33-17f6-08dc1e29a814 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=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DS2PEPF00003439.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR12MB4915 X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 142C51C001F X-Stat-Signature: k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A9eAYMAt4r9rJAZhicos1sueciF50Oaw7fB5kv84aOaHuEIYjHgl9gKpyfAzcXB4tjXwJVjPWouoEzOTVnU79PEmSC6vLp3pf1xTbqj1wNdK6LVmJvKwu7EYfxq6tPBakDnJv8kWO3UYjZS3Ewn21tflvaW5eMnKWdSBlFQrczHFYYVL4mESFRyO2rYFNJkwyybH9c9rt0W7T+eG60kKma6s0rRUzlFNUpJDf03opw7yw8R1TlFmsWvhXJlG9MnKrFqHVRfbqYwKm2XCI8hzqShrIvuxpdXRHDsQ= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000027, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: With all the required host changes in place, it should now be possible to initialize SNP-related MSR bits, set up RMP table enforcement, and initialize SNP support in firmware while maintaining legacy support for SEV/SEV-ES guests. Go ahead and enable the SNP feature now. Signed-off-by: Michael Roth --- arch/x86/include/asm/disabled-features.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/x86/include/asm/disabled-features.h b/arch/x86/include/asm/disabled-features.h index 1ea64d4e7021..85a7b5ce96c9 100644 --- a/arch/x86/include/asm/disabled-features.h +++ b/arch/x86/include/asm/disabled-features.h @@ -117,7 +117,11 @@ #define DISABLE_IBT (1 << (X86_FEATURE_IBT & 31)) #endif +#ifdef CONFIG_KVM_AMD_SEV +#define DISABLE_SEV_SNP 0 +#else #define DISABLE_SEV_SNP (1 << (X86_FEATURE_SEV_SNP & 31)) +#endif /* * Make sure to add features to the correct mask