Message ID | 20240329225835.400662-17-michael.roth@amd.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 20106C6FD1F for <linux-mm@archiver.kernel.org>; Fri, 29 Mar 2024 23:01:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B03426B009C; Fri, 29 Mar 2024 19:01:58 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A8C486B009D; Fri, 29 Mar 2024 19:01:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 92D216B009E; Fri, 29 Mar 2024 19:01:58 -0400 (EDT) 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 735666B009C for <linux-mm@kvack.org>; Fri, 29 Mar 2024 19:01:58 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 419948048A for <linux-mm@kvack.org>; Fri, 29 Mar 2024 23:01:58 +0000 (UTC) X-FDA: 81951601116.19.13852D7 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2047.outbound.protection.outlook.com [40.107.94.47]) by imf03.hostedemail.com (Postfix) with ESMTP id 365342000C for <linux-mm@kvack.org>; Fri, 29 Mar 2024 23:01:53 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=amd.com header.s=selector1 header.b=JPIXhziK; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=quarantine) header.from=amd.com; spf=pass (imf03.hostedemail.com: domain of Michael.Roth@amd.com designates 40.107.94.47 as permitted sender) smtp.mailfrom=Michael.Roth@amd.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1711753315; a=rsa-sha256; cv=pass; b=VTZ8KpfXXNYvK+bUVuFtJZcWQaEHfO8qJWJeJvt+Aqi2FUcLyLpIzxrgVdwYtMib8SbMmc Mhum03LJ5ZZe5e1USVGzUA34aR7JxyYdPazVK7vnoOYaQ3ipbMWHWBq7Y4x1dG4xsAXUid 5SooltygCkC7FkcraS6Ato0Aa9vgdmI= ARC-Authentication-Results: i=2; imf03.hostedemail.com; dkim=pass header.d=amd.com header.s=selector1 header.b=JPIXhziK; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=quarantine) header.from=amd.com; spf=pass (imf03.hostedemail.com: domain of Michael.Roth@amd.com designates 40.107.94.47 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=1711753315; 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=N9Lx9TYwv7hSTBNIzxDlO2i4fLCh7C2Jf3GSDM7iz04=; b=2JzR19T2e+HjFYihOdBNJhn5XD3M1LdYVwIQz91xXOulO6b+rDvjLlKZcu9Sh0JnOT5kcJ zH2pep6gRJWzcbcTN3zh5YI9sM6/7Oxm+pPmx6fAnIJpy7ZP7nqHj0fu8kC6GpXLaKl7SC yNy9izz5p5jN5gcsp7k2EzTHXxhRY1U= ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TRWOhZNhABJ/YKRS3BVDp/bMinsSHrbR2hX/jw4SfInhr0rFOxRsXzJrDLnMuIfKp1CihafDNRYi2LoltyF6ABan/xHubEFGj6MoFI0ihMWEK8fHpJ+KHVi7IGEAkl+2GUTRKgXO8Gph0xxYzIW1UFRlarpejMpMBrQly9Ve01u5XGlN1fQQHJDv9wuDaazzA4//1bG6NnBJeSdVX9riJCN1lVkmbAAG0TGn5aY7t1r1fJszBWQwRBl73GjbxlssaQmcHTEcvwdxNzXMbLrCk4E0tFsxc1LBkMsSrovXToev1s3KPwxMnVa4odg6zpGPOzNhtjSsuFgIh+Y/K0k3wQ== 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=N9Lx9TYwv7hSTBNIzxDlO2i4fLCh7C2Jf3GSDM7iz04=; b=jHVAcTB2AdJt23egZTJN2P4JFvpaGQ2m+JGo8Ia2JP3zWHfXoSyvyKNOIZ53DE6iI8AImHdfGrwQMfromZDaj3Fctt951dKojGQFJcg8Lf0FeKnwj3rbRqe7ZJwyvNanlP2jZpzsOjLGFZUWpa1hMwsn9l9e/CC1717g4epMhWc5nD7Dpoemw5HkXCUXHY1FrVr1MNvznYat0k3BPN5VIZWzCGZ7hYuUJrFUY46y8OZ+ARWaDr2zMNHMM6kKXVk/6xxcJgqDJXOKbNj879VR0v5jlVWotETr5gLlEe1o5rYeHJduV3C8F3GATX4o8Z0y5SjCRRnOqtpKf5PZu4XQaA== 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=N9Lx9TYwv7hSTBNIzxDlO2i4fLCh7C2Jf3GSDM7iz04=; b=JPIXhziKk90/SBn+XVrA9jNGZR5kO9mlu33MH7gud6UBn90dH1KmgxUoBCRQ8SyLdDSdYvuuIpsiUEBU9BrDdmkIIx9rFJNdvbFAi7bYjx4vqTyqLmQsNCpc1haajFInd99F2rqVoE9EcrQCSyO0wQS757HBfhILf6VvVs2Onoc= Received: from SJ0PR03CA0282.namprd03.prod.outlook.com (2603:10b6:a03:39e::17) by MN0PR12MB6056.namprd12.prod.outlook.com (2603:10b6:208:3cc::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.41; Fri, 29 Mar 2024 23:01:49 +0000 Received: from SJ1PEPF00001CE0.namprd05.prod.outlook.com (2603:10b6:a03:39e:cafe::9a) by SJ0PR03CA0282.outlook.office365.com (2603:10b6:a03:39e::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.40 via Frontend Transport; Fri, 29 Mar 2024 23:01:49 +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 SJ1PEPF00001CE0.mail.protection.outlook.com (10.167.242.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7409.10 via Frontend Transport; Fri, 29 Mar 2024 23:01:49 +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.35; Fri, 29 Mar 2024 18:01:48 -0500 From: Michael Roth <michael.roth@amd.com> To: <kvm@vger.kernel.org> CC: <linux-coco@lists.linux.dev>, <linux-mm@kvack.org>, <linux-crypto@vger.kernel.org>, <x86@kernel.org>, <linux-kernel@vger.kernel.org>, <tglx@linutronix.de>, <mingo@redhat.com>, <jroedel@suse.de>, <thomas.lendacky@amd.com>, <hpa@zytor.com>, <ardb@kernel.org>, <pbonzini@redhat.com>, <seanjc@google.com>, <vkuznets@redhat.com>, <jmattson@google.com>, <luto@kernel.org>, <dave.hansen@linux.intel.com>, <slp@redhat.com>, <pgonda@google.com>, <peterz@infradead.org>, <srinivas.pandruvada@linux.intel.com>, <rientjes@google.com>, <dovmurik@linux.ibm.com>, <tobin@ibm.com>, <bp@alien8.de>, <vbabka@suse.cz>, <kirill@shutemov.name>, <ak@linux.intel.com>, <tony.luck@intel.com>, <sathyanarayanan.kuppuswamy@linux.intel.com>, <alpergun@google.com>, <jarkko@kernel.org>, <ashish.kalra@amd.com>, <nikunj.dadhania@amd.com>, <pankaj.gupta@amd.com>, <liam.merwick@oracle.com>, Brijesh Singh <brijesh.singh@amd.com> Subject: [PATCH v12 16/29] KVM: x86: Export the kvm_zap_gfn_range() for the SNP use Date: Fri, 29 Mar 2024 17:58:22 -0500 Message-ID: <20240329225835.400662-17-michael.roth@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240329225835.400662-1-michael.roth@amd.com> References: <20240329225835.400662-1-michael.roth@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain 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: SJ1PEPF00001CE0:EE_|MN0PR12MB6056:EE_ X-MS-Office365-Filtering-Correlation-Id: 0be1ae25-3851-4dc2-3e2d-08dc50443732 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hsRQuXwijR9JtUHtibIgbnGxjeGZd/eENPi0IRKgKA13fq2bDiBFIxchmmBCwuYgyckJlsWcy8vcrw/4dHlgJ+1foO2oUAPKl65AwHE5zLM62FL+Ol9cz6C9f3RJWPcbXTbGywonF5/PnzdOHHueJtRGv/FDhCYhM79JOjBXl+Wd0I0vOUw0VAvgf772qp5LlTmTmeJ6agFJibdk35cZntGL0nWfHXRZpqbWhubCBqp0SL7EoIXl31aLnOZMxuRe1ub9NAmTv1T31VXpJv0BmZaCrSPbasTFgDEELopSJbKhtzG2kjOznmTvuy6x8/SmGbGgasiD67mRMOyL7qOrnWFYMpHqMZhpoJCGBSLCIFrM/8FXbX8bVC/MI3k2uBS6HvzG+UCiW6aYBkJTt1eTo3OUg+q7HENiKMdnSanzgi8WU7n0zeXaxsmmsGuy4q6E+Vvtmvfzeo8YRs6AR1wq0aJha3QiWCk2GIl9Pc2AteK8tjjTaobbyoR9lXDLgHmYoOdJu6P9nsbw5nZhRemtZARFOCUk62PEHcOK15C8pwQVs4mABACTLTxqpgFGtb4rzZ+R3GpgSypXdvZtgQLxwhjCix26yeFq8gdvOaHFv7pI2cu/L8mJUlRclzSlYzL//55YOENWNt0uDay9hQkwDsUQUYGAo/KGQRatu2z+XRjC/+n2IeKo9qHIM+ownha6X4nQiGYOfoIYoLJiDMM1EbkA+OBHy5q2t7wpTkbqwwW8S7VnJGBytl0kxVBg32V+ 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)(36860700004)(376005)(7416005)(1800799015)(82310400014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Mar 2024 23:01:49.2555 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0be1ae25-3851-4dc2-3e2d-08dc50443732 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: SJ1PEPF00001CE0.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB6056 X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 365342000C X-Stat-Signature: muodzj34tihonwi8an8mgpttszujeueq X-HE-Tag: 1711753313-325629 X-HE-Meta: U2FsdGVkX1/bNYPaV3cOV6Q2r2oVjMvdyogTAfwrWaZGuZvKz7ZrgrgEbANJk9YBoi6Hm2kBECgFgFTfzpWV9Pe0POFMXIVzqMcBnMZa1hRjMneN4JYtz+mcFoCeQ4UVCtMrhB9BAZJBMnXPs5dXwO1qty4Bb7H3owaP6M+TZ/jLOFnsVnwXTsOLrngQ7OHCNFGJLZebQROrI0hq9sopbelv/yswDBJ9Q6kL4bvpoGfmWvHS6FZO10s4P7uVX4lZ0hAADny4vP3RDpBuXjyZgCeRB2IvKkqSMK7E8vI0xk4airruEZ0Ejh8GCwu5nNdIWJ73Rj165IJov1fquwsVqfdF+UOe1za9fVtujmSGCNYzmKoKvkeHbv34mjJqg4fttSX6RcY25tjmCt3ac0WMELNK/qHTtR3mrsFUdhy/SnbxD5cfrfnE0bJIZuwgmSgyJAlEIYuIVYP95fgWkf/Q+qrOBA/zWJN7FDccD1ngePO155/a+5JtuUsyJcGOOEIpEQBdxgsGqWfi2xI5JKc4ZTdUe4+/r52nWCWQxBGPApavgaKKwnlCqsINUFANJwiJVPI5smIx0XbEM5gJCnjFGarvgw9Z56ByyP1AtYglSyiwUJXazOd6grXdcPZpT/pfZ9s7aFJxFe1lAhS5DEjieEQyRLehck3NmjDJui2rICaXuvW1danRtwjvvEwF2NXERRAucGlUB2XsTED9ZBoOBhELh/pk78BJnEbAigXWSJL3E5QAaYCWX/WrLPKe6C4PKflQbVyhm8dZ08KKTGOaXRxo9I3VhMklj9DiDsJlmFojO003V17t6qptdnV3+ho7B6faXUr4YMvfiJ3Bh0eWCzeuPsEUsyJXF40Rw2c1f9yhJUE4ifUJTGHAZVdW0GFdzUCYlCbdMDe7CKqY+1t5PEd6n8gcJ2S9cC1nrwzb+eeH/JxVnxbGOtgM7M8SgGE0cJaprZX6oT29KGDXRDk KJtswGfS vXnz8rLK1mDSgbSplNwNfRt5wxjdDYdnswHL9hcORA6RlvSqAfnyjE/k64OMkLupYgmLRPDAgu0AsdVijy3JNwcxP87rNEhsxcPU1fsrSxv6V1l/i0E8ibFPSNpt9FGO4VCd80bzLhk6cGRFcpnPyhY7vfpoO24uohtXrs2gnS30TldBaIByBg2ER8Z24lr5GLr9u4L05B/rizORuiesAu5xFx6SIpOovdtRQlhHk74wHzvPtqY/464MkGtkbYCfl4VU2zEqH4E6zJtETuqIdc613U2jiKWXwTQeX0QDaUsRlSf84eYoSPN5Xqj0KNUKsdM9LAcz+24qc7b5XSJuy+eCXIbDzeCvFmJ9+Jr7V7iBDLepc0alAsVNN+V5koFBBWqCJ40yepenSiE5Xnv14rXCyteasPJooRZNJQsBgqcR1aEI= 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: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
Add AMD Secure Nested Paging (SEV-SNP) Hypervisor Support
|
expand
|
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index a3f8eba8d8b6..49b294a8d917 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h @@ -1950,6 +1950,7 @@ void kvm_mmu_slot_leaf_clear_dirty(struct kvm *kvm, const struct kvm_memory_slot *memslot); void kvm_mmu_invalidate_mmio_sptes(struct kvm *kvm, u64 gen); void kvm_mmu_change_mmu_pages(struct kvm *kvm, unsigned long kvm_nr_mmu_pages); +void kvm_zap_gfn_range(struct kvm *kvm, gfn_t gfn_start, gfn_t gfn_end); int load_pdptrs(struct kvm_vcpu *vcpu, unsigned long cr3); diff --git a/arch/x86/kvm/mmu.h b/arch/x86/kvm/mmu.h index 2c54ba5b0a28..89da37be241a 100644 --- a/arch/x86/kvm/mmu.h +++ b/arch/x86/kvm/mmu.h @@ -253,8 +253,6 @@ static inline bool kvm_mmu_honors_guest_mtrrs(struct kvm *kvm) return __kvm_mmu_honors_guest_mtrrs(kvm_arch_has_noncoherent_dma(kvm)); } -void kvm_zap_gfn_range(struct kvm *kvm, gfn_t gfn_start, gfn_t gfn_end); - int kvm_arch_write_log_dirty(struct kvm_vcpu *vcpu); int kvm_mmu_post_init_vm(struct kvm *kvm); diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c index 0049d49aa913..c5af52e3f0c5 100644 --- a/arch/x86/kvm/mmu/mmu.c +++ b/arch/x86/kvm/mmu/mmu.c @@ -6772,6 +6772,7 @@ static bool kvm_mmu_zap_collapsible_spte(struct kvm *kvm, return need_tlb_flush; } +EXPORT_SYMBOL_GPL(kvm_zap_gfn_range); static void kvm_rmap_zap_collapsible_sptes(struct kvm *kvm, const struct kvm_memory_slot *slot)