From patchwork Sat Dec 30 17:23:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 13507022 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 7A4A8C46CD2 for ; Sat, 30 Dec 2023 17:33:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1A1336B016E; Sat, 30 Dec 2023 12:33:31 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 150BF6B016F; Sat, 30 Dec 2023 12:33:31 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F0B876B0171; Sat, 30 Dec 2023 12:33:30 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id DD4F16B016E for ; Sat, 30 Dec 2023 12:33:30 -0500 (EST) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id BDAA21409CD for ; Sat, 30 Dec 2023 17:33:30 +0000 (UTC) X-FDA: 81624181380.19.6300AC2 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2072.outbound.protection.outlook.com [40.107.92.72]) by imf09.hostedemail.com (Postfix) with ESMTP id BA1AD140017 for ; Sat, 30 Dec 2023 17:33:27 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=amd.com header.s=selector1 header.b=XsMawTG0; spf=pass (imf09.hostedemail.com: domain of Michael.Roth@amd.com designates 40.107.92.72 as permitted sender) smtp.mailfrom=Michael.Roth@amd.com; dmarc=pass (policy=quarantine) header.from=amd.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1703957607; 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=TIwk6SdQbKgnArTaU2+dt5LmQsuI63XFRKexbmVvLvg=; b=uILrPghATL6QBmCKiCDSg2wsf7lk+mYTm2d+GQgkln/mREiXMqln22ZYOTkhnEjzYpw3H5 3D1ruH4LGh5Kl6uZSF4V+Li1PRDvDkND730ibNtQW4+yWCPnR+At5hHUHOcUvQQIJ/swBc D/cYSs0cGDdrKpByMw0mwqXlJSY/1zY= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1703957607; a=rsa-sha256; cv=pass; b=bNXs3LELTTMWQDHpcouHe9LomnWNfWP72s2hHD31W1J5pkZd53nalvB8JECW2vPKPWA0Hj q/Ud26/X/152tOs7x1WSRQX3+T+R4dYZS6qX3IGmYYeAeg64atYnRQPAt0h66Ldj6wXq87 rPtEXpFtD28ms8XsdE34WWgYhQ1bytI= ARC-Authentication-Results: i=2; imf09.hostedemail.com; dkim=pass header.d=amd.com header.s=selector1 header.b=XsMawTG0; spf=pass (imf09.hostedemail.com: domain of Michael.Roth@amd.com designates 40.107.92.72 as permitted sender) smtp.mailfrom=Michael.Roth@amd.com; dmarc=pass (policy=quarantine) header.from=amd.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RgilluhkTl+SNUjd2PdZGmqWIv5YMuTzpyB+ElKPiXtPITYMFTQEm2zzBDbCQhBVHDEEmf+E9NPnHflLKkQJ7+wXWJMv0oyfOnSNAPIomNeq/loyZFOt8mssuGNLaBuGC5lSrXYTehYGi1/2Lgq0T8MqRvQSFEmcVqXorAdJoAiduNlhQCKH+t12m5FOD0bxHaZbnlxYXPuez1vXo38k81XJKHPH6YizVzuWNW2YaILVVsPq5lCb7ViyKaRORHsZVgBjgC/K7pwirKWrIwfMjsasnzS0q7KyVmdeZnnips20UXM0FNjoSFuqh2E+izoSLlWnu4HRZqkigXmOFEIn3w== 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=TIwk6SdQbKgnArTaU2+dt5LmQsuI63XFRKexbmVvLvg=; b=cw6/MTaolaHUR5LJ8gLiB269bW9Y+/hXwph1bBeSr01mAoowbQaEOeCyf4AIE5rSDB36d6+4Vl6ZR6YgWY0YdKDLGs8fKf50jm2AH4+5gjvLesDzz3/aLGsC0P5qQhxWZM6uZH1+zL9q9Jsh5968TpZbIf79GFxrGAZAkKTe2XWq/gL23zqEO2+yA4z9RXo8heq5pZhCtZgqdZi6c3fNOgDoxxQWas01LJbkgVMzn3pYsdQ0CQUsvggLgTFD+kYycRD0YSvmgELwCVC2iZGkkPyWv5g+M2UqOT0EbN9cFJOyc0dOkCCEqsPhLcNmg+cGCGaOtlky+6jScr15K8ZY/g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.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=TIwk6SdQbKgnArTaU2+dt5LmQsuI63XFRKexbmVvLvg=; b=XsMawTG0zOSqaYG+2PbG7pJwiTNuyRRCkLUbCm0iD3QThDBMwyqO0mdnzI25yQclNHtoFeB4jEOj27Y7BfD+edvTan8Oj5hqX9e5Ik+b6PYot2P7tgq1Te+R0c9zI0ACGYwfMEb+jhuOqXULzK5o2TRTPp9JgPGZnSDXTVURii0= Received: from MW4PR04CA0082.namprd04.prod.outlook.com (2603:10b6:303:6b::27) by BY5PR12MB4115.namprd12.prod.outlook.com (2603:10b6:a03:20f::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7135.22; Sat, 30 Dec 2023 17:33:23 +0000 Received: from CO1PEPF000044F0.namprd05.prod.outlook.com (2603:10b6:303:6b:cafe::6d) by MW4PR04CA0082.outlook.office365.com (2603:10b6:303:6b::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7135.20 via Frontend Transport; Sat, 30 Dec 2023 17:33:23 +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 CO1PEPF000044F0.mail.protection.outlook.com (10.167.241.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7159.9 via Frontend Transport; Sat, 30 Dec 2023 17:33:23 +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; Sat, 30 Dec 2023 11:33:22 -0600 From: Michael Roth To: CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Brijesh Singh Subject: [PATCH v11 32/35] KVM: SVM: Add module parameter to enable the SEV-SNP Date: Sat, 30 Dec 2023 11:23:48 -0600 Message-ID: <20231230172351.574091-33-michael.roth@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231230172351.574091-1-michael.roth@amd.com> References: <20231230172351.574091-1-michael.roth@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000044F0:EE_|BY5PR12MB4115:EE_ X-MS-Office365-Filtering-Correlation-Id: 9bad581c-e564-4175-fb96-08dc095d6c54 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KIeBUdZ0KOvrak0cKD9a4XtMhj+BtADQ1IwcUqSHVnomKptonprDZzut+aox9kbNgAoe+pAq/BqGvakCynD6xTFyPAVY3wBGGdJgYEWXcZOiCFGB1Unk3ZZNiWkGVoRom4ikazUem8lg3nbaRXJRfT8HBvD93hg7+7BYkcNb8kcik3ZXFXyy1ryDp7xDND+QOJn7OfUOOw0/ld8NlPXGQSED83Sqdu3OhwqutNp7ZX31j+ri0mPI1Vl/tnt0FXl/8X5UiNP+UUd2IIPHxr6d/ugLHMc8nmdUo150sfJbXequ8RTIUMRbcdoB4YJF8PSOrHwdj9/LUdhHyUVns7/1FufivA89H7sQAoYi4LmE1XFBDbqjECBSXJ4qL3hN7NGKMPDcibunI0cIuKVgyhHfMXkE8lEQ1X624uqaF0fDRE65jltcn0v5gS7C4XdffVYnoBjnAlVdaJrlxCUBaBJ3RMGfwhA/juYjGS4dCxysprOG2O/BgU5+YdC0JygSS+T5iqNWgPnKScaorEa3pZxaPfNIU8tKXHmO51HjKQ9FWoZ+qiqKt8nLQZWJmHgG0eVs3h4/lzKc86nDlg/s3rgq3dLl8oU0ON9pMkRU2p9cabse37YBLp+HhNtUWKwIaG/X1UNZlzEuAT+AF7dwBDH0f+cO93yjAXqfbF/HOlhAkFWD4OyNAoHsZSnnxUd7VoQcNfPblCaYiOhCvPA4TXk5yTFPJisP/wQdK04fgsqH1zqtpX6r+oEsVgSZyo5iqidosWkmU2rh+3h5FH9qlEkWew== 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)(346002)(136003)(376002)(39850400004)(230922051799003)(451199024)(1800799012)(64100799003)(82310400011)(186009)(40470700004)(46966006)(36840700001)(40480700001)(426003)(83380400001)(16526019)(1076003)(26005)(2616005)(40460700003)(336012)(478600001)(6666004)(47076005)(41300700001)(316002)(54906003)(70206006)(70586007)(6916009)(36756003)(44832011)(4326008)(8936002)(8676002)(36860700001)(356005)(81166007)(86362001)(82740400003)(2906002)(5660300002)(7416002)(7406005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Dec 2023 17:33:23.2166 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9bad581c-e564-4175-fb96-08dc095d6c54 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: CO1PEPF000044F0.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4115 X-Rspamd-Queue-Id: BA1AD140017 X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: ifu1az4b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6PTAwgtjSdO/z+Fd0GzZ5svaogdTpP0vRshdjjEz3euHiRTOhhriHh8nTa/kxJE6D7hnScoy5KqW9f3zEnQhJ5s4L7XdKKtA98g1ZSc6BlxM8iHfTAXEqS5P4nA06xdI51e+uv+G/atZRjpqJ+2bxz9GbNtPofw1qUrej0Q7WGZfQ2rzxSvcizsJWI6x6x5eo6kpKH87m4+FGYLVNqM00jBaHM99BN2G13nsFQRqRdc9oA17Aqc5bokZ5dcolLT/N9fesrdHk+0/5W/QncUpAQ64PYyEUXq4Nl7pd0pXU7U7dGbHq+mNiw9LPouXb4g0ZkT80OaKnPoda/+tq8aSOsKQ/jjaj8lY0QV5gRjQ== 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: From: Brijesh Singh Add a module parameter than can be used to enable or disable the SEV-SNP feature. Now that KVM contains the support for the SNP set the GHCB hypervisor feature flag to indicate that SNP is supported. Signed-off-by: Brijesh Singh Signed-off-by: Ashish Kalra Signed-off-by: Michael Roth --- arch/x86/kvm/svm/sev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/kvm/svm/sev.c b/arch/x86/kvm/svm/sev.c index 2cc909cc18c1..30a2e75fd94f 100644 --- a/arch/x86/kvm/svm/sev.c +++ b/arch/x86/kvm/svm/sev.c @@ -61,7 +61,8 @@ module_param_named(sev_es, sev_es_enabled, bool, 0444); static bool sev_es_debug_swap_enabled = true; module_param_named(debug_swap, sev_es_debug_swap_enabled, bool, 0444); -static bool sev_snp_enabled; +static bool sev_snp_enabled = true; +module_param_named(sev_snp, sev_snp_enabled, bool, 0444); #else #define sev_enabled false #define sev_es_enabled false