Message ID | 20231230172351.574091-24-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 1965EC46CD2 for <linux-mm@archiver.kernel.org>; Sat, 30 Dec 2023 17:30:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A77416B0165; Sat, 30 Dec 2023 12:30:07 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A26156B0166; Sat, 30 Dec 2023 12:30:07 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8A94A6B0168; Sat, 30 Dec 2023 12:30:07 -0500 (EST) 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 7958F6B0165 for <linux-mm@kvack.org>; Sat, 30 Dec 2023 12:30:07 -0500 (EST) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 54A3A1A0438 for <linux-mm@kvack.org>; Sat, 30 Dec 2023 17:30:07 +0000 (UTC) X-FDA: 81624172854.02.C9776DD Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on2076.outbound.protection.outlook.com [40.107.96.76]) by imf16.hostedemail.com (Postfix) with ESMTP id 5027618001A for <linux-mm@kvack.org>; Sat, 30 Dec 2023 17:30:04 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=amd.com header.s=selector1 header.b=BeB4lGRK; dmarc=pass (policy=quarantine) header.from=amd.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf16.hostedemail.com: domain of Michael.Roth@amd.com designates 40.107.96.76 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=1703957404; 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=wTyI3sNoMDHNrgGrZG7JKocHTvFM31hLve+xo3xbn24=; b=Y0bGn4XdZuqOG9FWlJAQX6HMJ25zW977wxMtEQJEG1K9tWSNoANm2g2ZZxKGhFC1kbxvqX SQZbLxgVTksbzLLyHrDITimq7Um/0eLKb57mLNg5P4ynB0G3jyq5Ts96EWoRZKPPE3UNRO yhC+NZsR+3bu1J2CH9xjNoO+h+A1Osw= ARC-Authentication-Results: i=2; imf16.hostedemail.com; dkim=pass header.d=amd.com header.s=selector1 header.b=BeB4lGRK; dmarc=pass (policy=quarantine) header.from=amd.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf16.hostedemail.com: domain of Michael.Roth@amd.com designates 40.107.96.76 as permitted sender) smtp.mailfrom=Michael.Roth@amd.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1703957404; a=rsa-sha256; cv=pass; b=2S4EGv8JLBvrMRqSDNUXGhHA6xE7iKlhOt/pj2XStWliGv24acN9xHiEHfSJWtcxsSFxAb /hI4uYVYc1NYTsMTTEk97v9SiiYsMoZ0zBtU1VzbHKHYFIvfcQPZB7ittO/dUFd3O6XJ6r Tbkd4w7WmYA2q4g/ueIm1DCrUTIQzE4= ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TebiAlwJsVDdqbKTktBOCYYfWFL5uo/W3TjUVbi1IH/FekrTupKkhInBcYLbAcG2JVRrRxekOflFlLNKmJxygAbzWPTS+CPqTTGs2hqUdjNrCGGPwU58ukBB44da8V98B1UqYXByszBxELMa9H0CHfWs4Iq77m8jkjM7ugNMpG7TBDdFrDrmlwJo9oN5NHVHyuZWX4QuoruZHpUG8BhqwpOKj1u0/qPw225XGK5HX+KgaFfPG2uKneB9deHf+x7AmwIsdPBJmwA2NE1rVp6IB5tyFc6Zm3zpoHFW8DX7pvBU0hZnEI5SLZ//B16jJr8wMWm9qh2DRxRnpl/HqQrVVA== 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=wTyI3sNoMDHNrgGrZG7JKocHTvFM31hLve+xo3xbn24=; b=HL0vt2SWayR8n1hppMXWWnXCljnx5ognMJhRPbSqW6/4cPMF9oPDOtnXYrSVUixOkwi0vygXPNkF00lJt/K0PT1GWlRlGFfgWAlGeFF6MT69vaRQYhwsbeCyDLfTo3lP5iIDqYXd/9CQzItYzw3W1PpcZGcg1eEZrteLK9oSmUlXT6/RIroraqrl23xdME0tY90G285GKhuwdnqbktBxN0iXZ8d65lpIRYMMXFwVflhvEGk3KrqRmf3rAMv2gIUG+oIfaScR4DsaGdietEf2MKevP8XwsP6d/K5ZdOUyMfJe1+KdN82uooAUprEY3Ca2zsAcDKORZsF+uzeJoI70xA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=temperror (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=temperror 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=wTyI3sNoMDHNrgGrZG7JKocHTvFM31hLve+xo3xbn24=; b=BeB4lGRKEY4q6gCrDLk7pHGXLKkR57cRhjfBfe3Y2OJej8b4cU6kw10W4lc5+cE5lxgu+y3MKHdftk0dkl4Z7am4V0Dmo3DM6pfzx8h1IPWhiDyujT9pMzydhgu8Tya/iGYLMPa8uStDo7pP/wGAkcuU5j5GPxSkUUMmQ+26780= Received: from SJ0PR13CA0129.namprd13.prod.outlook.com (2603:10b6:a03:2c6::14) by PH7PR12MB7185.namprd12.prod.outlook.com (2603:10b6:510:201::14) 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:29:57 +0000 Received: from CO1PEPF000044F2.namprd05.prod.outlook.com (2603:10b6:a03:2c6:cafe::9e) by SJ0PR13CA0129.outlook.office365.com (2603:10b6:a03:2c6::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.7 via Frontend Transport; Sat, 30 Dec 2023 17:29:56 +0000 X-MS-Exchange-Authentication-Results: spf=temperror (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=temperror action=none header.from=amd.com; Received-SPF: TempError (protection.outlook.com: error in processing during lookup of amd.com: DNS Timeout) Received: from SATLEXMB04.amd.com (165.204.84.17) by CO1PEPF000044F2.mail.protection.outlook.com (10.167.241.72) 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:29:55 +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:29:54 -0600 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>, <zhi.a.wang@intel.com>, Brijesh Singh <brijesh.singh@amd.com> Subject: [PATCH v11 23/35] KVM: x86: Export the kvm_zap_gfn_range() for the SNP use Date: Sat, 30 Dec 2023 11:23:39 -0600 Message-ID: <20231230172351.574091-24-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 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: CO1PEPF000044F2:EE_|PH7PR12MB7185:EE_ X-MS-Office365-Filtering-Correlation-Id: e1897acd-5567-4597-7990-08dc095cf064 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: n/J6/O3prvEtA8BdqoU7sruh3+mKNS32jNtrIMxxmDrBmi6iPm3mHoKvFO1PaJTF+lRLcWnuKDCw3IaQ0a4SyPXr456R36SqbUYyRxWfpo3Xs8N39gTeF0TCubLZ0GVwUMIpOiNX7/4WKL07w+PKCuiXUk1pxCsaO70K5JfkzMakdrafii9E47aeW0y5kAMK5Y4IiPl5FT3i8OzG3qg4rNDFA5YEQxCpSctVVlQiQLnwEAb7cgN0gpdF3STXd7nJv1hkgaXXXBlWlUpwMxYAaXPCiUMPp2Ax/50S7mw/GLPTEXcc3Mf2crSCdahCJKTgDsrBv19mlLD1nTUx3peu/O5rQ+/CqarllVaHJ5ySMcRG9ae5MSwaP5uXOnWOwP57rwpHIXfz6BZNZa4/59s4b+a8l2LQnIDYQgoL++W600S8YWlox6opUxkHQPzp9Q7cGU10rmSS3etbSdfwD8JcMio6XdXerMsN8aiH4A4U10VmNPuecb1GOcnc8bgLyTmJv6TS9O3ixUTh3j+mKuFI/yb0VCT5i1oFyYoT+rKddLjmulL9nknu8gRbNFSo9jR+DXjqiXRo+rfF4KOeFGT/bFT+WBFU85EY3h+H0NU0NHAX0sgXoaltU8p1uE8LrAU4SBasp6K0xMqGQjP8div2XDsfALRYT/JyKPHNgntiZtaQ3t7x40z2psgcRFhdkLi5C/ig9M0CXQ8xg5IaYa/O0c5JSLTRqzgsjLtHKUjp4oYNEm7xp0mtPrYYfNU3+scNuQhJzljDCxnP0UKpdxJH3w== 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)(136003)(346002)(396003)(39860400002)(376002)(230922051799003)(64100799003)(186009)(82310400011)(451199024)(1800799012)(40470700004)(46966006)(36840700001)(40480700001)(40460700003)(336012)(63370400001)(2616005)(63350400001)(16526019)(83380400001)(1076003)(26005)(426003)(86362001)(81166007)(36756003)(82740400003)(356005)(47076005)(4326008)(44832011)(7406005)(5660300002)(7416002)(6666004)(36860700001)(54906003)(8936002)(8676002)(70206006)(70586007)(316002)(6916009)(2906002)(41300700001)(478600001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Dec 2023 17:29:55.3119 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e1897acd-5567-4597-7990-08dc095cf064 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: CO1PEPF000044F2.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB7185 X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 5027618001A X-Stat-Signature: 6kxjzzghxoxgz3iyhrk6chowp45jc63f X-Rspam-User: X-HE-Tag: 1703957404-684256 X-HE-Meta: U2FsdGVkX19kuHXqtPPA1p6UVauxEZMkX3GbbQeQb5E/MvvbFjbh7OXZMX1/mCWCDeisMt0l+lijnheDgtI1Rolwz6ZIOf6gzkMcCxvhxoVOKG2+kppfmTEIB+5nmOTXD55EtkLrwFHyUXeWYDQLPQrnU41kdQd+cIWCYQ7WHRQXQd+ELEVBOPqxEZAQsRuo5eJcHqSMUvGEWEJ6Ev35ISC+PrLfLLsOZ8Hys0lfFbw1xoT27Tu5GEE1PfcsIdOSfFCBaLVlfpx4t4LwLQFwp5xtGoN+XQ9BErOT+7m4hv/YESlEKQ7oQAbUaQW2LgzinVMqzPj1hYdb4pR7KgpmHH0MNF2Mz2VHPosy/zONOH65HDBRLH1Xvxr1GVMkNCJeJIXbHS06K57BmuOMSQN6iR+pd1v6FMALcQmBzXIXVYCwB7+louf/YZpCb/aGBqBGj4ZHtT0EjNzFihJEzxdpwCGoClR2FeGwj2BbbtM9et855mTwzx9FG5SGIf0d8V7LGDmLVe81l8fTQDa3NZGT7IGu+Cm9yOu7fTo3cDzBHzO07xJFmsCdvoEQrB0B6+l4yATjoXsCj1ierV5rW+YWyqLrA9871b2wtTnHUvy5tQDFaKbVAtgECWDHNu5VUHwUP4LmHxnbwkc9JiuiQcHHUgT/4xYZbJJz71Cx9dxpVnMcTabq5DQD/Bv/CRkVal2989L8tWmn4t69JegMBZUfR9T99PZm0/vW6+iiCoRHfuYNfDpAOSM4soKUVHEm+DGnPmuE010iuJNxc7jo4dL4zJEfPEoSzuZKcymPbSoiw6uLMLnxHd+jb5NhDSwiBWTYH3OiiQfWp3A8tXRhjjDvJ9nyUr4248mg98umaYvB3Rfz3nxNO4Bnbk2eRqy1WSkg10N8xWm/gonH5FaivWWnmhu+SMeeY+TDuIGkmqcQHOo8Kt0lGFbhIhxxJqdyd3xTkiOcE1sC/PH39NxDQfH WGYlP8th W+9LsOdQYCAvfNjdtuGtLNbWDqRqcLM/j5z0Nrvmygo7WsMtfFGOZrDE5a9/8U5/a9sUgnVPFZBwl96xM1lBpSmR9wyCzAub+TURjQCnU6+ia7TnFwmJyzU0LbEevkFuFDn9vIzaONQ8MIY0Ed3GbmrRdG/MFkrhBtUxlhRgomrxUFRtI067ULWEGIWzX2cALM8lCHQVs1YOgcu1QCONGv+sfGrWgmePP2eyxIWM3ePiqE7c1OakoQwbAfhxFF5ANoxGlPIpoh8Hga364AhXy7L5XGVK0pV+1wy8Mme36IrG+VJPBvkLdPm+zSlvqGHJc42+cXnj5Vgzd8JRHsb39ZHQUbuemZxcABNuFWFxYncqvtv++zM4bXemtomVF9pZL14oiatTYfz+qrGpIA3wla/P/oWvJA2RDdwm0br/A1E3VVb4= 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 843695217b4b..3fdcbb1da856 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h @@ -1923,6 +1923,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 60f21bb4c27b..df4d2c137a67 100644 --- a/arch/x86/kvm/mmu.h +++ b/arch/x86/kvm/mmu.h @@ -252,8 +252,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 61213f6648a1..1882096fba3e 100644 --- a/arch/x86/kvm/mmu/mmu.c +++ b/arch/x86/kvm/mmu/mmu.c @@ -6702,6 +6702,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)