Message ID | 20231202093535.15874-1-yan.y.zhao@intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp1679193vqy; Sat, 2 Dec 2023 02:04:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IGX0Anl3GbMxgH6RFPV9xAy869l/J5beLI1a/KRajG9jpdPfjfSARbhaVs+2Pfd0EGku3lY X-Received: by 2002:a05:6808:13d1:b0:3b8:b063:6b91 with SMTP id d17-20020a05680813d100b003b8b0636b91mr1430193oiw.64.1701511483424; Sat, 02 Dec 2023 02:04:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701511483; cv=none; d=google.com; s=arc-20160816; b=wSLv0Si3qigtVnsEEIEhkMaoqtikewkc0fnKt+HZBiSP9G/qpoTYpS6n74dDBmobPG pe5GgkIPSpc/Do2VjCT6g5EeWMgdw/aEgP8l1HDc9cyzr9sxX9ivVeQzFK1l6zm5VPgb LqcItikQcCauj9vj0cwf7f5giaC8BtYWajdbYeq1Z/iQHGQcpNtUa9vzP6gj59ZChvmt sS2e0fWKd1VPJi2523eX4jPs/yOsLiTOgSCVTkYQNtPPeRli+fCygULaj54snOj5oakJ QAHiCATFi+8qtE4VZ6bz8L2HrnVzTSNWNhrrbl/MGmNiu0PI9r1F5OrUaVCckB8XQ3UQ QGyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=3XQPPuaqx4rJ64uBpzX8CiFDj9e6d5BonmL1qt/UNlA=; fh=+WI4m5k3dRLR+dR3neThuZkNBTzIm/a8HgtddERL9fA=; b=O6MhDeVRFqWYiwDQQJgagE/tbH58xp8MAQfV54fmFy7Fso2A9lE8HkJ/eGy/Pm68np DwdwONDie2+x+giiY9erpknaUQqJPtLl1L+i1c+yYw446b9o888QhH/PABule3iaEo99 2cotJDa1V6UMfGwj1MenzbaHMB2mW6uOVPaQf5/KVwGvEf1vNyqx4JhpeMjK9uv7OEKA L9IN/ZDqxR10T9c7obXld3zqbJJpAgXxfz0IoixavVsVVXbZWAI1v+av1aLi57TB4cnf e9G8RI7C7nBrr80aZQth5R+wgQsGYSOtleYC+lfVQfpwYN35sk2NZt8gGLabVozFRGa5 LdFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=kuuNYiyc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id p188-20020a6342c5000000b005be2508ce03si4760279pga.569.2023.12.02.02.04.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Dec 2023 02:04:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=kuuNYiyc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id B013D804B863; Sat, 2 Dec 2023 02:04:36 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232529AbjLBKE2 (ORCPT <rfc822;pwkd43@gmail.com> + 99 others); Sat, 2 Dec 2023 05:04:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229472AbjLBKE1 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sat, 2 Dec 2023 05:04:27 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AFE5E19F; Sat, 2 Dec 2023 02:04:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701511473; x=1733047473; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=aDYDeaOzsRKl3ev8dC58rNFjF38aQ9l/2QXjjp0gHNA=; b=kuuNYiyc/pDkoT46m+N9x8z6QqhoASjGdUluT1jJFXb85y1a90tJGoO9 U8ocQEdYuKY16rNuFoFZeK+gdEsxTDBzSuhg16enrqveXfWpzYG5bDSLL wEzvqI2VNJcxubuUqgXKWGI/AqpA3zos7jcZ1g6RAQ87udXb9efiIbgyj Jnn99j02n7MKDrN9QcKFhB5ROGxJg68Gi5pE9HqZwI27WnHzDgUDJgtOn qtMCbQz8x+fAAU0uaqXmxzJNXwUNcmcBp/u1L3lALUVku5axXKzh8NWyl t1IVCcTpr+A25kiSMCGz0wRTJadaooWBWDuvdz3siYO68dNSKlyGmLdqs Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10911"; a="392459638" X-IronPort-AV: E=Sophos;i="6.04,245,1695711600"; d="scan'208";a="392459638" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Dec 2023 02:04:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10911"; a="887939832" X-IronPort-AV: E=Sophos;i="6.04,245,1695711600"; d="scan'208";a="887939832" Received: from yzhao56-desk.sh.intel.com ([10.239.159.62]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Dec 2023 02:04:30 -0800 From: Yan Zhao <yan.y.zhao@intel.com> To: iommu@lists.linux.dev, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: alex.williamson@redhat.com, jgg@nvidia.com, pbonzini@redhat.com, seanjc@google.com, joro@8bytes.org, will@kernel.org, robin.murphy@arm.com, kevin.tian@intel.com, baolu.lu@linux.intel.com, dwmw2@infradead.org, yi.l.liu@intel.com, Yan Zhao <yan.y.zhao@intel.com> Subject: [RFC PATCH 39/42] KVM: VMX: add config KVM_INTEL_EXPORTED_EPT Date: Sat, 2 Dec 2023 17:35:35 +0800 Message-Id: <20231202093535.15874-1-yan.y.zhao@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231202091211.13376-1-yan.y.zhao@intel.com> References: <20231202091211.13376-1-yan.y.zhao@intel.com> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Sat, 02 Dec 2023 02:04:36 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784164104725658771 X-GMAIL-MSGID: 1784164104725658771 |
Series |
Sharing KVM TDP to IOMMU
|
|
Commit Message
Yan Zhao
Dec. 2, 2023, 9:35 a.m. UTC
Add config KVM_INTEL_EXPORTED_EPT to let kvm_intel.ko support exporting EPT
to KVM external components (e.g. Intel VT-d).
This config will turn on HAVE_KVM_EXPORTED_TDP and
HAVE_KVM_MMU_PRESENT_HIGH automatically.
HAVE_KVM_MMU_PRESENT_HIGH will make bit 11 reserved as 0.
Signed-off-by: Yan Zhao <yan.y.zhao@intel.com>
---
arch/x86/kvm/Kconfig | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/arch/x86/kvm/Kconfig b/arch/x86/kvm/Kconfig index 950c12868d304..7126344077ab5 100644 --- a/arch/x86/kvm/Kconfig +++ b/arch/x86/kvm/Kconfig @@ -99,6 +99,19 @@ config X86_SGX_KVM If unsure, say N. +config KVM_INTEL_EXPORTED_EPT + bool "export EPT to be used by other modules (e.g. iommufd)" + depends on KVM_INTEL + select HAVE_KVM_EXPORTED_TDP + select HAVE_KVM_MMU_PRESENT_HIGH if X86_64 + help + Intel EPT is architecturally guaranteed of compatible to stage 2 + page tables in Intel IOMMU. + + Enable this feature to allow Intel EPT to be exported and used + directly as stage 2 page tables in Intel IOMMU. + + config KVM_AMD tristate "KVM for AMD processors support" depends on KVM && (CPU_SUP_AMD || CPU_SUP_HYGON)