From patchwork Mon Jun 3 11:05:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergiy Kibrik X-Patchwork-Id: 13683631 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 lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 96248C25B75 for ; Mon, 3 Jun 2024 11:06:17 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.734798.1140868 (Exim 4.92) (envelope-from ) id 1sE5Vb-0006kC-6p; Mon, 03 Jun 2024 11:05:47 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 734798.1140868; Mon, 03 Jun 2024 11:05:47 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sE5Vb-0006k5-2A; Mon, 03 Jun 2024 11:05:47 +0000 Received: by outflank-mailman (input) for mailman id 734798; Mon, 03 Jun 2024 11:05:46 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sE5Va-0006jz-KL for xen-devel@lists.xenproject.org; Mon, 03 Jun 2024 11:05:46 +0000 Received: from pb-smtp20.pobox.com (pb-smtp20.pobox.com [173.228.157.52]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 375ab25f-2199-11ef-90a1-e314d9c70b13; Mon, 03 Jun 2024 13:05:43 +0200 (CEST) Received: from pb-smtp20.pobox.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id A5527272C0; Mon, 3 Jun 2024 07:05:40 -0400 (EDT) (envelope-from sakib@darkstar.site) Received: from pb-smtp20.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id 9C69A272BF; Mon, 3 Jun 2024 07:05:40 -0400 (EDT) (envelope-from sakib@darkstar.site) Received: from localhost (unknown [185.130.54.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp20.pobox.com (Postfix) with ESMTPSA id 4CFD5272BE; Mon, 3 Jun 2024 07:05:32 -0400 (EDT) (envelope-from sakib@darkstar.site) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 375ab25f-2199-11ef-90a1-e314d9c70b13 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h=from:to:cc :subject:date:message-id:mime-version:content-transfer-encoding; s=sasl; bh=QaiSGXogYi2owIsVlMMKiyc+5dmbop+tdzhMcxRnQ+o=; b=D2oL eEzRqIEaJ7zNqTatP09PLPsJBgx0kSXGrYT8gRy6Gy+xSyLqP++ZMch2IEN/0/wl p8BhrWvjvGSpoEnJaRKFImGr8OpfKPUrUdQAypL8aKOcrLdZhpDxitnIQLYvIBOE u9VvvsjNmV61UCxrYFUi39UFf3kBYdpWNMa1Tno= From: Sergiy Kibrik To: xen-devel@lists.xenproject.org Cc: Sergiy Kibrik , Jan Beulich , Andrew Cooper , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , George Dunlap , Tamas K Lengyel , Stefano Stabellini , Paul Durrant , Julien Grall , Bertrand Marquis , Michal Orzel , Volodymyr Babchuk , Xenia Ragiadakou Subject: [XEN PATCH v3 00/16] x86: make cpu virtualization support configurable Date: Mon, 3 Jun 2024 14:05:28 +0300 Message-Id: X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Pobox-Relay-ID: 31F0C22E-2199-11EF-9A9D-ACC938F0AE34-90055647!pb-smtp20.pobox.com This is yet another attempt to provide a means to render the cpu virtualization technology support in Xen configurable. Currently, irrespectively of the target platform, both AMD-V and Intel VT-x drivers are built. The series adds three new Kconfig controls, ALT2PM, SVM and VMX, that can be used to switch to a finer-grained configuration for a given platform, and reduce dead code. The code separation is done using the new config guards. Major changes in this series, comparing to v2, are introduction and adoption of using_vmx & using_svm macros, and turning of arch_vcpu_ioreq_completion() into optional callback. The latter is more rfc-style change, kind of a perspective on how things might look. More specific changes are provided in per-patch changelog. v2 series here: https://lore.kernel.org/xen-devel/cover.1715761386.git.Sergiy_Kibrik@epam.com/ -Sergiy Sergiy Kibrik (9): x86/altp2m: check if altp2m active when giving away p2midx x86/p2m: guard altp2m routines x86: introduce CONFIG_ALTP2M Kconfig option x86: introduce using_{svm,vmx} macros x86/nestedhvm: switch to using_{svm,vmx} check x86/vmx: guard access to cpu_has_vmx_* in common code x86/vpmu: guard calls to vmx/svm functions ioreq: make arch_vcpu_ioreq_completion() an optional callback x86/vmx: replace CONFIG_HVM with CONFIG_VMX in vmx.h Xenia Ragiadakou (7): x86: introduce AMD-V and Intel VT-x Kconfig options x86/hvm: guard AMD-V and Intel VT-x hvm_function_table initializers x86/p2m: guard EPT functions with using_vmx macro x86/traps: guard vmx specific functions with usinc_vmx macro x86/domain: guard svm specific functions with usinc_svm macro x86/oprofile: guard svm specific symbols with CONFIG_SVM x86/hvm: make AMD-V and Intel VT-x support configurable xen/arch/arm/ioreq.c | 6 ----- xen/arch/x86/Kconfig | 31 +++++++++++++++++++++++++ xen/arch/x86/cpu/vpmu_amd.c | 9 +++---- xen/arch/x86/cpu/vpmu_intel.c | 16 +++++++------ xen/arch/x86/domain.c | 8 +++---- xen/arch/x86/hvm/Makefile | 4 ++-- xen/arch/x86/hvm/hvm.c | 6 ++--- xen/arch/x86/hvm/ioreq.c | 23 ------------------ xen/arch/x86/hvm/nestedhvm.c | 4 ++-- xen/arch/x86/hvm/viridian/viridian.c | 4 ++-- xen/arch/x86/hvm/vmx/vmx.c | 16 +++++++++++++ xen/arch/x86/include/asm/altp2m.h | 15 +++++++----- xen/arch/x86/include/asm/hvm/hvm.h | 5 +++- xen/arch/x86/include/asm/hvm/vmx/vmcs.h | 12 +++++----- xen/arch/x86/include/asm/hvm/vmx/vmx.h | 2 +- xen/arch/x86/include/asm/p2m.h | 17 +++++++++++++- xen/arch/x86/mm/Makefile | 5 ++-- xen/arch/x86/mm/hap/Makefile | 2 +- xen/arch/x86/mm/p2m-basic.c | 13 ++++++----- xen/arch/x86/mm/p2m-ept.c | 2 +- xen/arch/x86/oprofile/op_model_athlon.c | 2 +- xen/arch/x86/traps.c | 13 ++++------- xen/common/ioreq.c | 5 +++- xen/include/xen/ioreq.h | 2 +- 24 files changed, 132 insertions(+), 90 deletions(-)