From patchwork Sun Apr 21 18:01:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 13637421 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 7D4AAC4345F for ; Sun, 21 Apr 2024 18:05:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1752B6B009E; Sun, 21 Apr 2024 14:05:58 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 14DB16B009F; Sun, 21 Apr 2024 14:05:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F0ABA6B00A0; Sun, 21 Apr 2024 14:05:57 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id D68CF6B009E for ; Sun, 21 Apr 2024 14:05:57 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 9252E803BD for ; Sun, 21 Apr 2024 18:05:57 +0000 (UTC) X-FDA: 82034317554.23.9DBA388 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2079.outbound.protection.outlook.com [40.107.93.79]) by imf19.hostedemail.com (Postfix) with ESMTP id 9C9891A000C for ; Sun, 21 Apr 2024 18:05:54 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=amd.com header.s=selector1 header.b=m49fIUlX; dmarc=pass (policy=quarantine) header.from=amd.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf19.hostedemail.com: domain of Michael.Roth@amd.com designates 40.107.93.79 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=1713722754; 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=1IAnBuGrHv5XET7nTC2pQ71BloNuV9/+sLv+g+toff4=; b=nQY3b2zxKyx3rMI8ZEFbXUXhf0sdyB5sLjF84hjFPiMum/JAO9isu2Z2w28cVBhiiNKoUN UXl6cOfIungKF7z+24nskWkzSkIFg14lIagaJYceg048ztQplRYr75a2mEXnrnS7S77VdK LP43l1FfaLt+Oc1tSkHqZFa9+Lkt3yc= ARC-Authentication-Results: i=2; imf19.hostedemail.com; dkim=pass header.d=amd.com header.s=selector1 header.b=m49fIUlX; dmarc=pass (policy=quarantine) header.from=amd.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf19.hostedemail.com: domain of Michael.Roth@amd.com designates 40.107.93.79 as permitted sender) smtp.mailfrom=Michael.Roth@amd.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1713722754; a=rsa-sha256; cv=pass; b=AloQdS/pBndVnwKDUE6FtIDXL4D9a3Nx374Qev7EskYrJYqWmkHY2JlllP9E1I+S5DyajK DewgNzoo6tXiQ763KwHDz6vRu0Ffafw/EZyoKsPwd1Q3uOWNR4XPkxeGZU8YyTPshRJPTT Qs6Kf2o3bA/lvzXbS/moS5GX9pEWdSY= ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=b8aEe7jkrfF4E5uYNpP5AEa3h/LG+nZk/FT3s0nYhOg48IDvRxKAq7J7UK/3OOCwue3OqunuL4rjSh2cQR9Pn/FOpflPFNTBqj4wYZMfRfXV8RqasmCcEyYxGe4JKgdhwnm92z2S5GLuG/fdP14+lWFoi04Qdu59AOVQ5CH+/Diy1gJ7PR4CQYKSDtBhT7/i79bfDuDxqDXlN4rpNtOP/8jiiitfsXMRYzYV4Av0aV+OeeA3RhPR96l7tY7WBBXfFi3oqIECBzK2lpVFHPFmanrydT++BZcFH7id5NajxvSp7sB7IM//3PYtrYz86NL7CZaT6xXbJ74O9nOkkUgvpg== 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=1IAnBuGrHv5XET7nTC2pQ71BloNuV9/+sLv+g+toff4=; b=GCp8x4UI2NXk9KAqf5X+BQ9g6XnNM0l3mRPsBLKuDAGypvJmNwWbM4y07n0U9aiJgmMqF10TKfAFEzezcnFa1Vh2NdeuqyuOaVWF39FW3PZgkaVgcvhrrZj5mt7XAu+WOmS0Q2SAXx7Mu5yW8Y0uaeHYCCHodVnhUyvtOq23X5KkmBfLV66hmIM11UAIX3oowgaxLGEDSfl0UgiSW2uwoXhEwoaeT9O43gkvasaax4D1ZvQqvWzwb9zjbFs9QrRZHjNjqg+BYUyCf7zhpD0V5BoFv3fi/GBzwQvCYlCO4l4J4crCZ1ZR2zP7Yl/vfPnwzJK0HjeUmSz8xiZGNZYnbg== 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=1IAnBuGrHv5XET7nTC2pQ71BloNuV9/+sLv+g+toff4=; b=m49fIUlXggrPhi6tGTUv2fEshDCT2nEDqc0HYyI01PiZ36PKIHSkTrbtqiJ1ojTOs3bUkJ91lRJE8hHsJXf+ABdJHCNQNRPJt83oyMP/i2ZIGFpXPrAKuPFE8rqy4QWUWs3XhTKYY99ms5/F+EkC+8jVWhnMIBjkVHlsofarIjI= Received: from MN2PR17CA0027.namprd17.prod.outlook.com (2603:10b6:208:15e::40) by BL1PR12MB5897.namprd12.prod.outlook.com (2603:10b6:208:395::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.44; Sun, 21 Apr 2024 18:05:51 +0000 Received: from MN1PEPF0000ECD7.namprd02.prod.outlook.com (2603:10b6:208:15e:cafe::3e) by MN2PR17CA0027.outlook.office365.com (2603:10b6:208:15e::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.30 via Frontend Transport; Sun, 21 Apr 2024 18:05:51 +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 MN1PEPF0000ECD7.mail.protection.outlook.com (10.167.242.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7519.19 via Frontend Transport; Sun, 21 Apr 2024 18:05:51 +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; Sun, 21 Apr 2024 13:05:50 -0500 From: Michael Roth To: CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v14 15/22] KVM: SEV: Implement gmem hook for invalidating private pages Date: Sun, 21 Apr 2024 13:01:15 -0500 Message-ID: <20240421180122.1650812-16-michael.roth@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240421180122.1650812-1-michael.roth@amd.com> References: <20240421180122.1650812-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: MN1PEPF0000ECD7:EE_|BL1PR12MB5897:EE_ X-MS-Office365-Filtering-Correlation-Id: e741124e-f421-4beb-6fe7-08dc622dae20 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: csPeDVrNlJZJG62QCgZn+G0FTJFPpnXRTl1PONOpbPaTNrQCXFJ8tvCai2FE2PSjTt4v8BpEoUP7/VYtvI4gyS2GqQMtBF2ylDaHT3mfaNUj94e/mJ7LlUqYiGRX3QCZixZAGPVCMwGioNWnfi2SxDsdZvsKxC9lHadrdPXoRbpIXUUD/hO+QERzYOBzw9fmi0bBrJC2TBZUN3NPXHtG3+DeSluTnAC+IH0Y0Litu3QdES4WrFc7+K1M0dB95gIGB9iF8eHpOdaY0frWt/VU7aYkaMs06+GjXgkMVNbh3Ey5y5bU6G+t9l6YdRpXk2u6Q3ohMmrgkDNo2p9dy+H+HmENil73z0Pt1RqPycZHbEFpKC2dmUzIL74n+D9c09Dtq/u0DxuXiw1WG0UCo8t00rgPZdpZoRUgFjdRFCCYtc/2atEvP5PLpi3u3eEEmp3nvktAoRhkqndwtZeKIM59kfecJkjUFTK8MlkZIMMtnywqcqD4Te6lV48dxxjZr7DYKfr6XRR9YDPxd1gX0zgjEBmzsVYKYFt8C4U/IC0IgQZcWixS38yOTkxUrtAitaVcaALtMR5ul1L2Bnv1JajlPVatwzEG40rBxDvdAlZLKdfMjU2+y0DUDlvbxvffgG3OVGHtHOgIaGsTeBuaUN0qmVagiBnHoKZiMM8O2NF0AxXxcqWQw3thhjwAUpWsFVwvtHgkzk2lqcV5VjcB7hU7AhaqbPmIeuqiu7DgfaM/Etce1oJulVl0HaXdrHPsdeNiUMIWlQ1OT6NsQyxJsqjc1XBIr8vKk1PcyKYrBLyPb5ZNUdStQbXh5L/xLknu9vP2GpL/53VC2bKzY/KZk7IGf1Nr1/b+WxY5kxmqC0FTwxPAsawRWTI+j14UhQ+rBf49v9TqbhxFPCG+B/oHCjuRyZuHU61N+j7uXW3VOkUyOsTl3qRNog4wo8xMY2FCXqnsTTWYNtybcMytSwqgKmDJKjaJX+yy7eNzJMZOts/OIJYNftGAHiTAH5ZJISrKkZA0dKENCJWQjc091XexWW/8PwMEAwTILEuoQ4b7btYY5KuG9C1fJIpLib8wL98ehi3XuHc4RMmhxM+OffGN+2vPjWTqkTR9geX2o3vCjfnx3Z4qT5IQjInGh+ZLMYKVB+Af8LZSdVNZQDirhzNZ+BUsHmAlk1FgLDYYkwsybBRRYtPR1X0I1C1PZPvUQaS+qbjcxtee5I5zLrZBtTBIFdeDvfNfZX8FTFG6tj5n8+okTa+JRxhJy+PMR+FbXxSXYLeVNQYpHT1tGQqFntCjKNIawXjGsMs3miqPyDErn0M9d/v+H9l4+mmMOE8yrIg7OiJI9RWH6YgMcAWV4GHkfoeikYRsa3YsQN5WAnyn3TsoVac= 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)(376005)(1800799015)(36860700004)(7416005)(82310400014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Apr 2024 18:05:51.3554 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e741124e-f421-4beb-6fe7-08dc622dae20 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: MN1PEPF0000ECD7.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5897 X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 9C9891A000C X-Rspam-User: X-Stat-Signature: p6queyxkt38kgty3h8hestuw6jreaat6 X-HE-Tag: 1713722754-50417 X-HE-Meta: U2FsdGVkX1+isCCaxLo8QOAc7QUJ/jG4st2O/L5QRwLerQR46mMucB7jyRJ97P9za69Ka7kjyRXB1YR+rkxEn9OGZR0wctI91iewThmQF216kaxOd+HvAQCmkT4xjl+xYgoLgWJSAabVChyd0MBHlzF3gcsKMn3OeK9FtGyuaCgiKajhJildUU2WuO1dz/eOjDvw/BfvfZCgdgWRYaKsc/f3VwTJRIbXp6Tbh3u2UzDIDBXWaThHJiBjfcGGJI9JgoaHDOZHOtycqSt0ZTXBP95lIQ6ImFPji7E3Hhs3fadviuwP9Ab+rUNOqsYL9ko0E9EaF7gSDfa3VsOQxioNgAwhdFtyCJz/ujeE1kELFuW7GCTvPYigczR7b/nHiX1Rhqks5b3v3KrqAy8J0r9EkyZIHGs8Qo821qIm0RtwbbITQBVO49S5WmEBMiPvDtX4zFFKkszEQoKyZfu2HRvM6+rh1bYo8CQXYaq7bla+1YbIwQiIxjcRpUK19angsZ5WMNhiFpoP0+kvNeblhdg6EvEsHA+51YZ3qbyIjxjTtl2cImsCqanXekW6OT4oSKcpICXrAnYq6HJClLd83xNUKaW22UuIKcKSaAL3lp/n+l5DGHqxaZ0/RTMghhU+0dHxa+BjAHDuhTadVp6SIM51FHtgOJS+552an/Rb4oIEfG1tVAyoi52RzJ20a+qsQYHe0wTnzNJ0yOVwPyK7rLtDc1bKZT8Ly3/tTh2G93GrDIYgpcrA9EzVNAMPq8imDb/aACaQG5Oapuzxqkt6atk+4PZRE/ksv0/v7HTi+XeRl1N4A7b8oPJvQlEoAV6ZAYzk5ReCktBlSX36ayic7YOJdtHtoolCiL7JPTpYPMmstg8Wz/NsR7Ei/v6zMU1DjKSbohQoJ/h2HtQzxR6jfCNu2RMs3AroquuCeklQN/jEnLUXQrjcCGbXZXPnW7p5vrE5YOXbJTKfI9fMTqtltsy QiWrJv0A x5cjBfFm8Iz0vENKLyDmuU1tun8nTy7YSVQ51IpI9QAJ5h8+aFzAQ9zVKqQzH9zHJz+TmLUp0rgDQkZLZn3FH9taNwgug3hQB6iduZgVhzotXkHSmj9e0cOrsB7Oemkxo09TxjNb/WtLc4do93J+l49NWE3VAUybn9vN2mTSW93fC+ZsJQqdcdg9g4WPtzCRGOEjozI2xvhWg/A3n3OL0hNO+kC2OI+RmOqHYt65zoj33PwoJcvCYCrQJzpB0PCJEtDzNEQOeVKGY4dRnUgC3v/05l7PJkF78Hy966/d8reLF2e/vEH4czPJfgYe/xlj7dHObcrdR2gxPbXU= 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: Implement a platform hook to do the work of restoring the direct map entries of gmem-managed pages and transitioning the corresponding RMP table entries back to the default shared/hypervisor-owned state. Signed-off-by: Michael Roth --- arch/x86/kvm/Kconfig | 1 + arch/x86/kvm/svm/sev.c | 64 ++++++++++++++++++++++++++++++++++++++++++ arch/x86/kvm/svm/svm.c | 1 + arch/x86/kvm/svm/svm.h | 2 ++ 4 files changed, 68 insertions(+) diff --git a/arch/x86/kvm/Kconfig b/arch/x86/kvm/Kconfig index 10768f13b240..2a7f69abcac3 100644 --- a/arch/x86/kvm/Kconfig +++ b/arch/x86/kvm/Kconfig @@ -138,6 +138,7 @@ config KVM_AMD_SEV select ARCH_HAS_CC_PLATFORM select KVM_GENERIC_PRIVATE_MEM select HAVE_KVM_GMEM_PREPARE + select HAVE_KVM_GMEM_INVALIDATE help Provides support for launching Encrypted VMs (SEV) and Encrypted VMs with Encrypted State (SEV-ES) on AMD processors. diff --git a/arch/x86/kvm/svm/sev.c b/arch/x86/kvm/svm/sev.c index 2906fee3187d..ff9b8c68ae56 100644 --- a/arch/x86/kvm/svm/sev.c +++ b/arch/x86/kvm/svm/sev.c @@ -4464,3 +4464,67 @@ int sev_gmem_prepare(struct kvm *kvm, kvm_pfn_t pfn, gfn_t gfn, int max_order) return 0; } + +void sev_gmem_invalidate(kvm_pfn_t start, kvm_pfn_t end) +{ + kvm_pfn_t pfn; + + pr_debug("%s: PFN start 0x%llx PFN end 0x%llx\n", __func__, start, end); + + for (pfn = start; pfn < end;) { + bool use_2m_update = false; + int rc, rmp_level; + bool assigned; + + rc = snp_lookup_rmpentry(pfn, &assigned, &rmp_level); + if (WARN_ONCE(rc, "SEV: Failed to retrieve RMP entry for PFN 0x%llx error %d\n", + pfn, rc)) + goto next_pfn; + + if (!assigned) + goto next_pfn; + + use_2m_update = IS_ALIGNED(pfn, PTRS_PER_PMD) && + end >= (pfn + PTRS_PER_PMD) && + rmp_level > PG_LEVEL_4K; + + /* + * If an unaligned PFN corresponds to a 2M region assigned as a + * large page in the RMP table, PSMASH the region into individual + * 4K RMP entries before attempting to convert a 4K sub-page. + */ + if (!use_2m_update && rmp_level > PG_LEVEL_4K) { + /* + * This shouldn't fail, but if it does, report it, but + * still try to update RMP entry to shared and pray this + * was a spurious error that can be addressed later. + */ + rc = snp_rmptable_psmash(pfn); + WARN_ONCE(rc, "SEV: Failed to PSMASH RMP entry for PFN 0x%llx error %d\n", + pfn, rc); + } + + rc = rmp_make_shared(pfn, use_2m_update ? PG_LEVEL_2M : PG_LEVEL_4K); + if (WARN_ONCE(rc, "SEV: Failed to update RMP entry for PFN 0x%llx error %d\n", + pfn, rc)) + goto next_pfn; + + /* + * SEV-ES avoids host/guest cache coherency issues through + * WBINVD hooks issued via MMU notifiers during run-time, and + * KVM's VM destroy path at shutdown. Those MMU notifier events + * don't cover gmem since there is no requirement to map pages + * to a HVA in order to use them for a running guest. While the + * shutdown path would still likely cover things for SNP guests, + * userspace may also free gmem pages during run-time via + * hole-punching operations on the guest_memfd, so flush the + * cache entries for these pages before free'ing them back to + * the host. + */ + clflush_cache_range(__va(pfn_to_hpa(pfn)), + use_2m_update ? PMD_SIZE : PAGE_SIZE); +next_pfn: + pfn += use_2m_update ? PTRS_PER_PMD : 1; + cond_resched(); + } +} diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c index 60783e9f2ae8..29dc5fa28d97 100644 --- a/arch/x86/kvm/svm/svm.c +++ b/arch/x86/kvm/svm/svm.c @@ -5087,6 +5087,7 @@ static struct kvm_x86_ops svm_x86_ops __initdata = { .alloc_apic_backing_page = svm_alloc_apic_backing_page, .gmem_prepare = sev_gmem_prepare, + .gmem_invalidate = sev_gmem_invalidate, }; /* diff --git a/arch/x86/kvm/svm/svm.h b/arch/x86/kvm/svm/svm.h index 7712ed90aae8..6721e5c6cf73 100644 --- a/arch/x86/kvm/svm/svm.h +++ b/arch/x86/kvm/svm/svm.h @@ -731,6 +731,7 @@ void sev_handle_rmp_fault(struct kvm_vcpu *vcpu, gpa_t gpa, u64 error_code); void sev_vcpu_unblocking(struct kvm_vcpu *vcpu); void sev_snp_init_protected_guest_state(struct kvm_vcpu *vcpu); int sev_gmem_prepare(struct kvm *kvm, kvm_pfn_t pfn, gfn_t gfn, int max_order); +void sev_gmem_invalidate(kvm_pfn_t start, kvm_pfn_t end); #else static inline struct page *snp_safe_alloc_page(struct kvm_vcpu *vcpu) { return alloc_page(GFP_KERNEL_ACCOUNT | __GFP_ZERO); @@ -751,6 +752,7 @@ static inline int sev_gmem_prepare(struct kvm *kvm, kvm_pfn_t pfn, gfn_t gfn, in { return 0; } +static inline void sev_gmem_invalidate(kvm_pfn_t start, kvm_pfn_t end) {} #endif