From nobody Tue Feb 10 06:27:58 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=quarantine dis=quarantine) header.from=epam.com ARC-Seal: i=1; a=rsa-sha256; t=1730888242; cv=none; d=zohomail.com; s=zohoarc; b=Z06FyThvn99oEBAdh8uLYkIJnU1/GXev6b2H/m2Vczj3KeiYlUnvcjBlD/5lm/YShrnpY3xZzN5L59tUmeUL0DwYojKlUVgmA7rdxxpCzRrSpku10h2x0HuiKiF9+RydGHinrN6O0QcFNXpvFUN2qGQgj8EjSKPj8bNwheJ5f5o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1730888242; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=p2u5ACnZhknNqMHNI6CsAH2zzZ1pewvirnqiawXzLcQ=; b=l+9mLLktqPGBO6bwVlC+6RqhhU+SMmWNL4pR5nNI9rker/pVtg3O+RG/Ka3D2fu46yU9MYo/U9X+ytYYSEpYa1HD1oKx/fsx0x9GGGLNy9EBL+bONdPIggfQQOnOASm1/m9mQJGpnvd4XlAyLLW7RQk/RQnPnYhO15oP3gbvF1Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=quarantine dis=quarantine) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 173088824259025.013033381981472; Wed, 6 Nov 2024 02:17:22 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.830672.1245742 (Exim 4.92) (envelope-from ) id 1t8d5y-0007LO-3z; Wed, 06 Nov 2024 10:17:02 +0000 Received: by outflank-mailman (output) from mailman id 830672.1245742; Wed, 06 Nov 2024 10:17:02 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1t8d5y-0007LH-1J; Wed, 06 Nov 2024 10:17:02 +0000 Received: by outflank-mailman (input) for mailman id 830672; Wed, 06 Nov 2024 10:17: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 1t8d5w-0007L5-TB for xen-devel@lists.xenproject.org; Wed, 06 Nov 2024 10:17:00 +0000 Received: from fforwardh-a1-smtp.messagingengine.com (fforwardh-a1-smtp.messagingengine.com [103.168.172.196]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 40612a64-9c28-11ef-99a3-01e77a169b0f; Wed, 06 Nov 2024 11:16:57 +0100 (CET) Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfforwardh.phl.internal (Postfix) with ESMTP id 49CEF292037B; Wed, 6 Nov 2024 05:16:56 -0500 (EST) Received: from phl-frontend-01 ([10.202.2.160]) by phl-compute-01.internal (MEProxy); Wed, 06 Nov 2024 05:16:56 -0500 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 6 Nov 2024 05:16:55 -0500 (EST) X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 40612a64-9c28-11ef-99a3-01e77a169b0f X-Custom-Connection: eyJyZW1vdGVpcCI6IjEwMy4xNjguMTcyLjE5NiIsImhlbG8iOiJmZm9yd2FyZGgtYTEtc210cC5tZXNzYWdpbmdlbmdpbmUuY29tIn0= X-Custom-Transaction: eyJpZCI6IjQwNjEyYTY0LTljMjgtMTFlZi05OWEzLTAxZTc3YTE2OWIwZiIsInRzIjoxNzMwODg4MjE3LjMzNDA2Mywic2VuZGVyIjoic2FraWJAZGFya3N0YXIuc2l0ZSIsInJlY2lwaWVudCI6Inhlbi1kZXZlbEBsaXN0cy54ZW5wcm9qZWN0Lm9yZyJ9 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=fm2; t=1730888216; x=1730974616; bh=p2u5ACnZhknNqMHNI6CsAH2zzZ1pewvirnqiawXzLcQ=; b= Lxe4JJT3FL7R3h43Gm6KzKdNS4LCKiYfug73eK4RYTfP8a1kAxTYOaXECApQZCvF i14a/UCokJftNZGEGTKXB1WGqO9dF/G6ZvITCKixL5hoYYPAlI/80PA8G6m/k3Xt KDHW+TNjIqg+n8JeVQa53e5Sa4L988hLsWuW2wv5Y42MdMRm68zIem37km94ip0G FTBfm3xMwm/1xa04IaohO2O4W/a1Euo0ObUOqXP+Qdf/kZYOXXUMmfEzLbCH6L/d 4WUpujbav5yVcWvaHCgsw3KyKkTdmjyqnpyrRthjrqRYAJoDHDnna5Ql/cnwFubC 1g4HcNcuXT76Wq72v/6L/A== 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-sender:x-me-sender:x-sasl-enc; s=fm3; t=1730888216; x= 1730974616; bh=p2u5ACnZhknNqMHNI6CsAH2zzZ1pewvirnqiawXzLcQ=; b=S lILH3+1l8k+WGC94l5C1jbxg6/OwxZb16rvaP9ucY83M1TTFv9XFP0/ZaKF+ANcq Y6FAluJDxv/oh9w0l+MHQaz5N2ocxv7IH70AJUdR6+GJVSkt4PM+xoiYfxuVwz3W FJbhhRVHYYoTqetK5DGtLuKP1T4haEv+jYMxi+GFggj9E4pcrSYRLHV0C26HNOMV vX6V89HhuNTmndaK5GT4Q2k5VDpiPtVNE/TDZr+uEiOlGrcRUZtWmvXOZMvMyWU2 +DvBj3jI7KfSwmvxWEP7lkR5QskeuSjSW3xhaiWSUE1cgGm1zBSxUX8Q8W65B1xx FB3Xjq/yjZFcNU/0baLMw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrtddvgdduvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth hsucdlqddutddtmdenucfjughrpefhvfevufffkffojghfgggtgfesthekredtredtjeen ucfhrhhomhepufgvrhhgihihucfmihgsrhhikhcuoefuvghrghhihigpmfhisghrihhkse gvphgrmhdrtghomheqnecuggftrfgrthhtvghrnhepiefgvdejudeifeevfedugedvlefg heejtddtieffhfelgfduteduteehudelveeunecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepshgrkhhisgesuggrrhhkshhtrghrrdhsihhtvgdp nhgspghrtghpthhtohepiedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepgigvnh dquggvvhgvlheslhhishhtshdrgigvnhhprhhojhgvtghtrdhorhhgpdhrtghpthhtohep shgvrhhgihihpghkihgsrhhikhesvghprghmrdgtohhmpdhrtghpthhtoheprghnughrvg ifrdgtohhophgvrhefsegtihhtrhhigidrtghomhdprhgtphhtthhopehrohhgvghrrdhp rghusegtihhtrhhigidrtghomhdprhgtphhtthhopehsshhtrggsvghllhhinhhisehkvg hrnhgvlhdrohhrghdprhgtphhtthhopehjsggvuhhlihgthhesshhushgvrdgtohhm X-ME-Proxy: Feedback-ID: i5db7bdcf:Fastmail From: Sergiy Kibrik To: xen-devel@lists.xenproject.org Cc: Sergiy Kibrik , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Stefano Stabellini , Jan Beulich Subject: [XEN PATCH v2 2/2] x86/hvm: introduce config option for stdvga emulation Date: Wed, 6 Nov 2024 12:16:53 +0200 Message-Id: <53b0d5552c128630e476c77b54b8983fe02e0e1c.1730887415.git.Sergiy_Kibrik@epam.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @pobox.com) X-ZM-MESSAGEID: 1730888245191116600 Introduce config option X86_HVM_STDVGA and make stdvga emulation driver configurable so it can be disabled on systems that don't need it. Suggested-by: Roger Pau Monn=C3=A9 Signed-off-by: Sergiy Kibrik CC: Jan Beulich Reviewed-by: Stefano Stabellini --- changes in v2: - updated description - renamed config option X86_STDVGA -> X86_HVM_STDVGA & moved related Kconfig changes to this patch - reverted changes to has_vvga() macro - moved emulation_flags_ok() checks to this patch --- xen/arch/x86/Kconfig | 10 ++++++++++ xen/arch/x86/domain.c | 4 ++-- xen/arch/x86/hvm/Makefile | 2 +- xen/arch/x86/include/asm/domain.h | 8 ++++++-- xen/arch/x86/include/asm/hvm/io.h | 4 ++++ 5 files changed, 23 insertions(+), 5 deletions(-) diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig index ed0ece85c7..35c8ace8ef 100644 --- a/xen/arch/x86/Kconfig +++ b/xen/arch/x86/Kconfig @@ -155,6 +155,16 @@ config X86_HVM_PMTIMER Build pmtimer driver that emulates ACPI PM timer for HVM/PVH guests. =20 If unsure, say Y. + +config X86_HVM_STDVGA + 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 =20 config XEN_SHSTK diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index b340818ee2..aefa1fc136 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -742,9 +742,9 @@ int arch_sanitise_domain_config(struct xen_domctl_creat= edomain *config) =20 static bool emulation_flags_ok(const struct domain *d, uint32_t emflags) { - const uint32_t disabled_emu_mask =3D X86_EMU_PM; + const uint32_t disabled_emu_mask =3D X86_EMU_PM | X86_EMU_VGA; =20 -#if defined(CONFIG_X86_HVM_PMTIMER) +#if defined(CONFIG_X86_HVM_PMTIMER) && defined(CONFIG_X86_HVM_STDVGA) /* This doesn't catch !CONFIG_HVM case but it is better than nothing */ BUILD_BUG_ON(X86_EMU_ALL !=3D XEN_X86_EMU_ALL); #endif diff --git a/xen/arch/x86/hvm/Makefile b/xen/arch/x86/hvm/Makefile index 3af8963218..80ec425aa8 100644 --- a/xen/arch/x86/hvm/Makefile +++ b/xen/arch/x86/hvm/Makefile @@ -22,7 +22,7 @@ obj-$(CONFIG_X86_HVM_PMTIMER) +=3D pmtimer.o obj-y +=3D quirks.o obj-y +=3D rtc.o obj-y +=3D save.o -obj-y +=3D stdvga.o +obj-$(CONFIG_X86_HVM_STDVGA) +=3D stdvga.o obj-y +=3D vioapic.o obj-y +=3D vlapic.o obj-y +=3D vm_event.o diff --git a/xen/arch/x86/include/asm/domain.h b/xen/arch/x86/include/asm/d= omain.h index 8550473997..106b438779 100644 --- a/xen/arch/x86/include/asm/domain.h +++ b/xen/arch/x86/include/asm/domain.h @@ -466,7 +466,6 @@ struct arch_domain #define X86_EMU_RTC XEN_X86_EMU_RTC #define X86_EMU_IOAPIC XEN_X86_EMU_IOAPIC #define X86_EMU_PIC XEN_X86_EMU_PIC -#define X86_EMU_VGA XEN_X86_EMU_VGA #define X86_EMU_IOMMU XEN_X86_EMU_IOMMU #define X86_EMU_USE_PIRQ XEN_X86_EMU_USE_PIRQ #define X86_EMU_VPCI XEN_X86_EMU_VPCI @@ -476,7 +475,6 @@ struct arch_domain #define X86_EMU_RTC 0 #define X86_EMU_IOAPIC 0 #define X86_EMU_PIC 0 -#define X86_EMU_VGA 0 #define X86_EMU_IOMMU 0 #define X86_EMU_USE_PIRQ 0 #define X86_EMU_VPCI 0 @@ -488,6 +486,12 @@ struct arch_domain #define X86_EMU_PM 0 #endif =20 +#ifdef CONFIG_X86_HVM_STDVGA +#define X86_EMU_VGA XEN_X86_EMU_VGA +#else +#define X86_EMU_VGA 0 +#endif + #define X86_EMU_PIT XEN_X86_EMU_PIT =20 /* This must match XEN_X86_EMU_ALL in xen.h */ diff --git a/xen/arch/x86/include/asm/hvm/io.h b/xen/arch/x86/include/asm/h= vm/io.h index f2b8431fac..c02fad876c 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; }; =20 +#ifdef CONFIG_X86_HVM_STDVGA void stdvga_init(struct domain *d); +#else +static inline void stdvga_init(struct domain *d) {} +#endif =20 extern void hvm_dpci_msi_eoi(struct domain *d, int vector); =20 --=20 2.25.1