From patchwork Fri Oct 4 09:31:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergiy Kibrik X-Patchwork-Id: 13821954 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 8E86ECFA753 for ; Fri, 4 Oct 2024 09:32:08 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.810225.1222906 (Exim 4.92) (envelope-from ) id 1swefF-0000RB-JJ; Fri, 04 Oct 2024 09:31:57 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 810225.1222906; Fri, 04 Oct 2024 09:31:57 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1swefF-0000R4-Gm; Fri, 04 Oct 2024 09:31:57 +0000 Received: by outflank-mailman (input) for mailman id 810225; Fri, 04 Oct 2024 09:31:56 +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 1swefE-0000Qy-Se for xen-devel@lists.xenproject.org; Fri, 04 Oct 2024 09:31:56 +0000 Received: from fforwardh-a2-smtp.messagingengine.com (fforwardh-a2-smtp.messagingengine.com [103.168.172.197]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 7dbcee43-8233-11ef-a0bb-8be0dac302b0; Fri, 04 Oct 2024 11:31:54 +0200 (CEST) Received: from phl-compute-08.internal (phl-compute-08.phl.internal [10.202.2.48]) by mailfforwardh.phl.internal (Postfix) with ESMTP id 726B22920276; Fri, 4 Oct 2024 05:31:53 -0400 (EDT) Received: from phl-frontend-01 ([10.202.2.160]) by phl-compute-08.internal (MEProxy); Fri, 04 Oct 2024 05:31:53 -0400 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 4 Oct 2024 05:31:52 -0400 (EDT) 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: 7dbcee43-8233-11ef-a0bb-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pobox.com; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm1; t=1728034313; x= 1728120713; bh=69IFtkBSucFIbcgkPReVQNcoJr3WfIfUZOzP2zT3FK0=; b=r Wwygg+PiXT0BdLR06kzwxJWejxCkqvupaSH5MeI0fyjSbxt8pzIEd8Isy0RQXw5c rNtdpmBwc/QHBOrgeXN+dIH52yld8sPxOXTMfnkuCf/Jr782o52+/1/JmtCmDfPr O7B5gCHNlVIIR7sP1TP01opENyW/cVy3Q72LE0kkS16PQSzKtGIoYPoSo76benL4 S3WFlY6jLrEEH+TTp+1/4CFVJ+4QcgXrm1oCAkFuEVUMGZpxTFXKD8tEGeHwiU2B ZNo+jdw7e9emtnEUT9Wlvt77KjvaFVTC3xVAuHXIVzoIrp3Ad4Lz4ocfbBfcnGA9 jZ+XcHl4aVG9KopMsS7ew== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1728034313; x= 1728120713; bh=69IFtkBSucFIbcgkPReVQNcoJr3WfIfUZOzP2zT3FK0=; b=U OpgQFoQgK/LsE/Y+AK0fe+HJ2MOx3Oy4Olrua5zwzndzrUeVygi4F7z9yAg9ujcE 8arS9w5GRrIvmZSq/jqWNwP6TvmocT+rwrkgijRulpqfLtD1SEo92x6rUX6le6pi WM1Kh4E4OijThCkMjs/pceRRRR5S9bfDPf/p5WIweYoVdbAbgk7UkM0QBmEiq4Et TXNxgrpjRP79LxALzsedAwbn1RcbH4X2RpNZGtVUX1+FGxkh2X/DKmif9ZtWuBIm 5kYp6ydcfLdih8AF9gXizWTrI+EqE4MFT/VqIACErsSxPc49m8fZZesyLvkVQrTO XPiLP84YayeUh/2/Nsa4w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvddvfedgudejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephffvvefufffkofgjfhgggfestdekredtredttden ucfhrhhomhepufgvrhhgihihucfmihgsrhhikhcuoefuvghrghhihigpmfhisghrihhkse gvphgrmhdrtghomheqnecuggftrfgrthhtvghrnheptdejgeegvdffkeekleefueevgfdu heevkedvhfdvkeeludehleegheeivedugfejnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepshgrkhhisgesuggrrhhkshhtrghrrdhsihhtvgdp nhgspghrtghpthhtohepiedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepgigvnh dquggvvhgvlheslhhishhtshdrgigvnhhprhhojhgvtghtrdhorhhgpdhrtghpthhtohep shgvrhhgihihpghkihgsrhhikhesvghprghmrdgtohhmpdhrtghpthhtoheprghnughrvg ifrdgtohhophgvrhefsegtihhtrhhigidrtghomhdprhgtphhtthhopehrohhgvghrrdhp rghusegtihhtrhhigidrtghomhdprhgtphhtthhopehsshhtrggsvghllhhinhhisehkvg hrnhgvlhdrohhrghdprhgtphhtthhopehjsggvuhhlihgthhesshhushgvrdgtohhm X-ME-Proxy: Feedback-ID: iddd9dc1e:Fastmail From: Sergiy Kibrik To: xen-devel@lists.xenproject.org Cc: Sergiy Kibrik , Andrew Cooper , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Stefano Stabellini , Jan Beulich Subject: [XEN PATCH v1 1/3] x86/hvm: introduce config option for ACPI PM timer Date: Fri, 4 Oct 2024 12:31:50 +0300 Message-Id: <3ef3724e21b196edd277c94598ebe6624813ede4.1728032664.git.Sergiy_Kibrik@epam.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Introduce config option X86_PMTIMER so that pmtimer emulation driver can later be made configurable and be disabled on systems that don't need it. As a first step the option is hidden from user, thus not making any functional changes here. Signed-off-by: Sergiy Kibrik CC: Jan Beulich --- xen/arch/x86/Kconfig | 3 +++ xen/arch/x86/hvm/Makefile | 2 +- xen/arch/x86/include/asm/acpi.h | 5 +++++ xen/arch/x86/include/asm/domain.h | 3 ++- xen/arch/x86/include/asm/hvm/vpt.h | 10 ++++++++++ 5 files changed, 21 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig index 9cdd04721a..95275dc17e 100644 --- a/xen/arch/x86/Kconfig +++ b/xen/arch/x86/Kconfig @@ -144,6 +144,9 @@ config INTEL_VMX If your system includes a processor with Intel VT-x support, say Y. If in doubt, say Y. +config X86_PMTIMER + def_bool HVM + config XEN_SHSTK bool "Supervisor Shadow Stacks" depends on HAS_AS_CET_SS diff --git a/xen/arch/x86/hvm/Makefile b/xen/arch/x86/hvm/Makefile index 4c1fa5c6c2..321241f0bf 100644 --- a/xen/arch/x86/hvm/Makefile +++ b/xen/arch/x86/hvm/Makefile @@ -18,7 +18,7 @@ obj-y += irq.o obj-y += monitor.o obj-y += mtrr.o obj-y += nestedhvm.o -obj-y += pmtimer.o +obj-$(CONFIG_X86_PMTIMER) += pmtimer.o obj-y += quirks.o obj-y += rtc.o obj-y += save.o diff --git a/xen/arch/x86/include/asm/acpi.h b/xen/arch/x86/include/asm/acpi.h index 217819dd61..8d92014ae9 100644 --- a/xen/arch/x86/include/asm/acpi.h +++ b/xen/arch/x86/include/asm/acpi.h @@ -150,8 +150,13 @@ void acpi_mmcfg_init(void); /* Incremented whenever we transition through S3. Value is 1 during boot. */ extern uint32_t system_reset_counter; +#ifdef CONFIG_X86_PMTIMER void hvm_acpi_power_button(struct domain *d); void hvm_acpi_sleep_button(struct domain *d); +#else +static inline void hvm_acpi_power_button(struct domain *d) {} +static inline void hvm_acpi_sleep_button(struct domain *d) {} +#endif /* suspend/resume */ void save_rest_processor_state(void); diff --git a/xen/arch/x86/include/asm/domain.h b/xen/arch/x86/include/asm/domain.h index bdcdb8de09..3f65bfd190 100644 --- a/xen/arch/x86/include/asm/domain.h +++ b/xen/arch/x86/include/asm/domain.h @@ -496,7 +496,8 @@ struct arch_domain #define has_vlapic(d) (!!((d)->arch.emulation_flags & X86_EMU_LAPIC)) #define has_vhpet(d) (!!((d)->arch.emulation_flags & X86_EMU_HPET)) -#define has_vpm(d) (!!((d)->arch.emulation_flags & X86_EMU_PM)) +#define has_vpm(d) (IS_ENABLED(CONFIG_X86_PMTIMER) && \ + !!((d)->arch.emulation_flags & X86_EMU_PM)) #define has_vrtc(d) (!!((d)->arch.emulation_flags & X86_EMU_RTC)) #define has_vioapic(d) (!!((d)->arch.emulation_flags & X86_EMU_IOAPIC)) #define has_vpic(d) (!!((d)->arch.emulation_flags & X86_EMU_PIC)) diff --git a/xen/arch/x86/include/asm/hvm/vpt.h b/xen/arch/x86/include/asm/hvm/vpt.h index 0b92b28625..333b346068 100644 --- a/xen/arch/x86/include/asm/hvm/vpt.h +++ b/xen/arch/x86/include/asm/hvm/vpt.h @@ -187,10 +187,20 @@ void rtc_deinit(struct domain *d); void rtc_reset(struct domain *d); void rtc_update_clock(struct domain *d); +#ifdef CONFIG_X86_PMTIMER void pmtimer_init(struct vcpu *v); void pmtimer_deinit(struct domain *d); void pmtimer_reset(struct domain *d); int pmtimer_change_ioport(struct domain *d, uint64_t version); +#else +static inline void pmtimer_init(struct vcpu *v) {} +static inline void pmtimer_deinit(struct domain *d) {} +static inline void pmtimer_reset(struct domain *d) {} +static inline int pmtimer_change_ioport(struct domain *d, uint64_t version) +{ + return -ENODEV; +} +#endif void hpet_init(struct domain *d); void hpet_deinit(struct domain *d); From patchwork Fri Oct 4 09:33:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergiy Kibrik X-Patchwork-Id: 13821955 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 25EC3CFA74C for ; Fri, 4 Oct 2024 09:34:11 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.810228.1222917 (Exim 4.92) (envelope-from ) id 1swehF-0000yN-UL; Fri, 04 Oct 2024 09:34:01 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 810228.1222917; Fri, 04 Oct 2024 09:34:01 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1swehF-0000yG-Ra; Fri, 04 Oct 2024 09:34:01 +0000 Received: by outflank-mailman (input) for mailman id 810228; Fri, 04 Oct 2024 09:34:00 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1swehE-0000y7-5D for xen-devel@lists.xenproject.org; Fri, 04 Oct 2024 09:34:00 +0000 Received: from fforwardh-a2-smtp.messagingengine.com (fforwardh-a2-smtp.messagingengine.com [103.168.172.197]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id c756b6c1-8233-11ef-99a2-01e77a169b0f; Fri, 04 Oct 2024 11:33:58 +0200 (CEST) Received: from phl-compute-10.internal (phl-compute-10.phl.internal [10.202.2.50]) by mailfforwardh.phl.internal (Postfix) with ESMTP id E23262920276; Fri, 4 Oct 2024 05:33:56 -0400 (EDT) Received: from phl-frontend-02 ([10.202.2.161]) by phl-compute-10.internal (MEProxy); Fri, 04 Oct 2024 05:33:56 -0400 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 4 Oct 2024 05:33:55 -0400 (EDT) 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: c756b6c1-8233-11ef-99a2-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pobox.com; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm1; t=1728034436; x= 1728120836; bh=iFp9K5MGCW7+gkI5DtCOpQKX7h2U+MWfWZWlhRdQB44=; b=n KEsaJTTjAU/zd9TokIbxzlxPPIJMSxKo0t0Q1YNkWr6pzL4kPlT8HiANDGm3WKC3 q8QwluM4Kgdxjg1pRUm3QbZQpM7d75I+TJuqQew7q+yXJfgaQB0+eFfKk5Lqm1m3 KV2npdLpqnGc9zqL5mK7hPBZksgddLjXsadzdnwvrLBx1TVJsaQssLMJoAHsXAA3 t3DIqc827DGM4Xi12zNm85oU73u9ChOgr/LplrmsyEcvd7gtsVubvPCuEntGlA9u fISZPWNEZPrEeJty/SQda043X5xjVZ8Cx0d13Ro2cNj9Dr3+GX+2tBOqvKd4LnvC VwxLnO1smGhWZW6y2WVwQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1728034436; x= 1728120836; bh=iFp9K5MGCW7+gkI5DtCOpQKX7h2U+MWfWZWlhRdQB44=; b=c dHQ3cgTaP3OLIQ7SEV6AwBQhdHQd5xNbqCUSrm7dW+tm9MYMo26Rc4N/i99vdwBz RKCpGijqKyqx+iHVhCpbcHJT+PuQIsuWc8L1LTUMYUxfopJA/cgoO2TsP52GoSTq C0N0dVKz/Pa1rSptUEfIhLD0yc00RU6LEIRE6C+/iEBHdcnW2j65OVB+bnlifYzd p7JervRypS0x0zzltbmKFHpzUEUcfMMKVfeKPDPowC6T9AKlpknemIlUYNtW2/6o IH73j0VVbjXZ+iwU87ztxiCorzLEG09aXBSsxLpwrNsHnGCfcECgL0ZEDkxk2dev oonfl46Sf9r8YHc1G+qtQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvddvfedgudejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephffvvefufffkofgjfhgggfestdekredtredttden ucfhrhhomhepufgvrhhgihihucfmihgsrhhikhcuoefuvghrghhihigpmfhisghrihhkse gvphgrmhdrtghomheqnecuggftrfgrthhtvghrnheptdejgeegvdffkeekleefueevgfdu heevkedvhfdvkeeludehleegheeivedugfejnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepshgrkhhisgesuggrrhhkshhtrghrrdhsihhtvgdp nhgspghrtghpthhtohepiedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepgigvnh dquggvvhgvlheslhhishhtshdrgigvnhhprhhojhgvtghtrdhorhhgpdhrtghpthhtohep shgvrhhgihihpghkihgsrhhikhesvghprghmrdgtohhmpdhrtghpthhtoheprghnughrvg ifrdgtohhophgvrhefsegtihhtrhhigidrtghomhdprhgtphhtthhopehrohhgvghrrdhp rghusegtihhtrhhigidrtghomhdprhgtphhtthhopehsshhtrggsvghllhhinhhisehkvg hrnhgvlhdrohhrghdprhgtphhtthhopehjsggvuhhlihgthhesshhushgvrdgtohhm X-ME-Proxy: Feedback-ID: i5d7f6ead:Fastmail From: Sergiy Kibrik To: xen-devel@lists.xenproject.org Cc: Sergiy Kibrik , Andrew Cooper , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Stefano Stabellini , Jan Beulich Subject: [XEN PATCH v1 2/3] x86/hvm: introduce config option for stdvga emulation Date: Fri, 4 Oct 2024 12:33:53 +0300 Message-Id: <05a027b7021ce6deb5b48078034e560a38ca8d23.1728032664.git.Sergiy_Kibrik@epam.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Introduce config option X86_STDVGA so that stdvga emulation driver can later be made configurable and be disabled on systems that don't need it. As a first step the option is hidden from user. No functional changes intended. Signed-off-by: Sergiy Kibrik CC: Jan Beulich --- xen/arch/x86/Kconfig | 3 +++ xen/arch/x86/hvm/Makefile | 2 +- xen/arch/x86/include/asm/domain.h | 3 ++- xen/arch/x86/include/asm/hvm/io.h | 4 ++++ 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig index 95275dc17e..89c42ff6da 100644 --- a/xen/arch/x86/Kconfig +++ b/xen/arch/x86/Kconfig @@ -147,6 +147,9 @@ config INTEL_VMX config X86_PMTIMER def_bool HVM +config X86_STDVGA + def_bool HVM + config XEN_SHSTK bool "Supervisor Shadow Stacks" depends on HAS_AS_CET_SS diff --git a/xen/arch/x86/hvm/Makefile b/xen/arch/x86/hvm/Makefile index 321241f0bf..b7741b0f60 100644 --- a/xen/arch/x86/hvm/Makefile +++ b/xen/arch/x86/hvm/Makefile @@ -22,7 +22,7 @@ obj-$(CONFIG_X86_PMTIMER) += pmtimer.o obj-y += quirks.o obj-y += rtc.o obj-y += save.o -obj-y += stdvga.o +obj-$(CONFIG_X86_STDVGA) += stdvga.o obj-y += vioapic.o obj-y += vlapic.o obj-y += vm_event.o diff --git a/xen/arch/x86/include/asm/domain.h b/xen/arch/x86/include/asm/domain.h index 3f65bfd190..675a13d917 100644 --- a/xen/arch/x86/include/asm/domain.h +++ b/xen/arch/x86/include/asm/domain.h @@ -501,7 +501,8 @@ struct arch_domain #define has_vrtc(d) (!!((d)->arch.emulation_flags & X86_EMU_RTC)) #define has_vioapic(d) (!!((d)->arch.emulation_flags & X86_EMU_IOAPIC)) #define has_vpic(d) (!!((d)->arch.emulation_flags & X86_EMU_PIC)) -#define has_vvga(d) (!!((d)->arch.emulation_flags & X86_EMU_VGA)) +#define has_vvga(d) (IS_ENABLED(CONFIG_X86_STDVGA) && \ + !!((d)->arch.emulation_flags & X86_EMU_VGA)) #define has_viommu(d) (!!((d)->arch.emulation_flags & X86_EMU_IOMMU)) #define has_vpit(d) (!!((d)->arch.emulation_flags & X86_EMU_PIT)) #define has_pirq(d) (!!((d)->arch.emulation_flags & X86_EMU_USE_PIRQ)) diff --git a/xen/arch/x86/include/asm/hvm/io.h b/xen/arch/x86/include/asm/hvm/io.h index f2b8431fac..32a2490fbc 100644 --- a/xen/arch/x86/include/asm/hvm/io.h +++ b/xen/arch/x86/include/asm/hvm/io.h @@ -108,7 +108,11 @@ struct vpci_arch_msix_entry { int pirq; }; +#ifdef CONFIG_X86_STDVGA void stdvga_init(struct domain *d); +#else +static inline void stdvga_init(struct domain *d) {} +#endif extern void hvm_dpci_msi_eoi(struct domain *d, int vector); From patchwork Fri Oct 4 09:35:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sergiy Kibrik X-Patchwork-Id: 13821958 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 58520CFA74C for ; Fri, 4 Oct 2024 09:36:16 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.810232.1222926 (Exim 4.92) (envelope-from ) id 1swejE-0001Xt-9E; Fri, 04 Oct 2024 09:36:04 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 810232.1222926; Fri, 04 Oct 2024 09:36:04 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1swejE-0001Xm-5n; Fri, 04 Oct 2024 09:36:04 +0000 Received: by outflank-mailman (input) for mailman id 810232; Fri, 04 Oct 2024 09:36:03 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1swejD-0001Xg-4K for xen-devel@lists.xenproject.org; Fri, 04 Oct 2024 09:36:03 +0000 Received: from fforwardh-a2-smtp.messagingengine.com (fforwardh-a2-smtp.messagingengine.com [103.168.172.197]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 10f01525-8234-11ef-99a2-01e77a169b0f; Fri, 04 Oct 2024 11:36:01 +0200 (CEST) Received: from phl-compute-12.internal (phl-compute-12.phl.internal [10.202.2.52]) by mailfforwardh.phl.internal (Postfix) with ESMTP id 26AE92920282; Fri, 4 Oct 2024 05:36:00 -0400 (EDT) Received: from phl-frontend-02 ([10.202.2.161]) by phl-compute-12.internal (MEProxy); Fri, 04 Oct 2024 05:36:00 -0400 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 4 Oct 2024 05:35:59 -0400 (EDT) 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: 10f01525-8234-11ef-99a2-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pobox.com; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1728034560; x=1728120960; bh=Zpz7DTxxwwyi4PDkAnWSolffL9IcWSA0k17jMTulmTw=; b= L5HiRpmbbsb6DEEzBMsOoBzzSBJZo5/3112OA+BdOY4CiwgAZ7Wv9rRvQRDU71jV EZSRGRZHAoVO7Te8zXsQJiorO6uxGLdJqCpLTEF2zkZODPYwakRpoRS72r8/EL+R x4nOe5B0W09L/ekMXrgd2k9lQmZUpRN8WVjYpLPaDjdSvG0IHCpz8sYQvViPmHpx jHqUaPBXxXWctj2lX79UWPd3sLIkxjOUrT1Aor5yNuUguRLjcYsG9GyOUMCx0mYW i+dOFW+G7tlnCCAOaOBwSvYAyfAxtKDA0/mE1KFCqvx4yvmYl6S636RzQn309Mxw 2+opq5roWkCiA9D0/vz92Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1728034560; x= 1728120960; bh=Zpz7DTxxwwyi4PDkAnWSolffL9IcWSA0k17jMTulmTw=; b=Y GBP+r6zQSpwJXHsJ7giAfMwPLPf3+INDt3kguJYl2EdGSdyfDAhPg0wrcw6TQJXY Ek5CNtpJbmFSviIVlu8wvNndOcuQ7NbckFIJZFsXXl/rkxoo/t50D38ytt5C4LZj rjgTDcX0i381xu8luhcOR08zwro7u8gMw/OZ+RCuIyOV7kXHKu3Kvu+NW3FogsPO yGaR3wcaTf9TETYsye7KWniESuRIwt1QlI1L8lL98sxA0iewrnUTm3JQ0jqkik3q isWdhZiokKsKEphCjzOTrsbvqz8yDZKu93vUCxU0f4lS7uJBeaSmbqUM/74Ct707 CC/VMvKcKa6RzRRBHvzdA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvddvfedgudekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephffvvefufffkofgjfhggtgfgsehtkeertdertdej necuhfhrohhmpefuvghrghhihicumfhisghrihhkuceoufgvrhhgihihpgfmihgsrhhikh esvghprghmrdgtohhmqeenucggtffrrghtthgvrhhnpeeigfdvjeduieefveefudegvdel gfehjedttdeifffhlefgudetudetheduleevueenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehsrghkihgssegurghrkhhsthgrrhdrshhithgv pdhnsggprhgtphhtthhopeeipdhmohguvgepshhmthhpohhuthdprhgtphhtthhopeigvg hnqdguvghvvghlsehlihhsthhsrdigvghnphhrohhjvggtthdrohhrghdprhgtphhtthho pehsvghrghhihigpkhhisghrihhksegvphgrmhdrtghomhdprhgtphhtthhopehjsggvuh hlihgthhesshhushgvrdgtohhmpdhrtghpthhtoheprghnughrvgifrdgtohhophgvrhef segtihhtrhhigidrtghomhdprhgtphhtthhopehrohhgvghrrdhprghusegtihhtrhhigi drtghomhdprhgtphhtthhopehsshhtrggsvghllhhinhhisehkvghrnhgvlhdrohhrgh X-ME-Proxy: Feedback-ID: iddf78192:Fastmail From: Sergiy Kibrik To: xen-devel@lists.xenproject.org Cc: Sergiy Kibrik , Jan Beulich , Andrew Cooper , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Stefano Stabellini Subject: [XEN PATCH v1 3/3] x86/hvm: make ACPI PM & stdvga emulation optional Date: Fri, 4 Oct 2024 12:35:57 +0300 Message-Id: <9b27c594b3a63b75826a864dea08d902fd8702c3.1728032664.git.Sergiy_Kibrik@epam.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Make it possible to build a configuration without code for PM timer or stdvga drivers. This may help to reduce code's footprint a bit for systems that don't run HVM guests and also don't need these devices emulated. Introduced additional check of domain's emulation flags, to cover the case when user explicitly states the requirement of emulated devices that are disabled in the build. HVM always require these devices to be present so domains of this type can't be created when stdvga or pmtimer are disabled. Options X86_STDVGA & X86_PMTIMER are dependant on HVM option, because these drivers are part of HVM support code. Suggested-by: Roger Pau Monné Signed-off-by: Sergiy Kibrik --- xen/arch/x86/Kconfig | 21 +++++++++++++++++++-- xen/arch/x86/domain.c | 6 ++++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig index 89c42ff6da..05551bd722 100644 --- a/xen/arch/x86/Kconfig +++ b/xen/arch/x86/Kconfig @@ -144,11 +144,28 @@ config INTEL_VMX If your system includes a processor with Intel VT-x support, say Y. If in doubt, say Y. +menu "Emulated devices support" + visible if EXPERT + depends on HVM + config X86_PMTIMER - def_bool HVM + bool "ACPI PM timer emulation support" + default y + help + Build pmtimer driver that emulates ACPI PM timer for HVM/PVH guests. + + If unsure, say Y. config X86_STDVGA - def_bool HVM + bool "Standard VGA card emulation support" + default y + help + Build stdvga driver that emulates standard VGA card with VESA BIOS + Extensions for HVM/PVH guests. + + If unsure, say Y. + +endmenu config XEN_SHSTK bool "Supervisor Shadow Stacks" diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index 89aad7e897..32dd3f84cd 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -742,11 +742,17 @@ int arch_sanitise_domain_config(struct xen_domctl_createdomain *config) static bool emulation_flags_ok(const struct domain *d, uint32_t emflags) { + const uint32_t disabled_emu_mask = + (IS_ENABLED(CONFIG_X86_PMTIMER) ? 0 : X86_EMU_PM) | + (IS_ENABLED(CONFIG_X86_STDVGA) ? 0 : X86_EMU_VGA); #ifdef CONFIG_HVM /* This doesn't catch !CONFIG_HVM case but it is better than nothing */ BUILD_BUG_ON(X86_EMU_ALL != XEN_X86_EMU_ALL); #endif + if ( emflags & disabled_emu_mask ) + return false; + if ( is_hvm_domain(d) ) { if ( is_hardware_domain(d) &&