[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [XEN PATCH] x86/hvm: make ACPI PM timer support optional


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Sergiy Kibrik <sergiy_kibrik@xxxxxxxx>
  • Date: Wed, 18 Sep 2024 16:35:21 +0300
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=2EOGQDSzYXk+kSXxAViXAZ0X7rG79VhW1xjTfHDgKog=; b=HKWAguM7IzFaXAF5K/riBmuuIYWySRh3OjjMpJdekG0Kl9P0IViz3aCHKUV61aA9s88uEl0A4HX7pmaIepNnsuxZH8epCjGjHga1tXOv0gRPDZIH2rkPIfzaZhY7SQgHBvj+wI7NJd7hNOuNbmcyFmvUajPFQpUAHIYv+vdNARMvMwly0qqQmzpQ9TGUmBMi+Iyz4+yWf88IwKn3o9AzrPIP7Ncn9P92Ee93qpTV8+TaSkgvSH5SMg021F45qJ3VMWf6120B/CiyK3/JvIk8aFLWOcYqBqfwnZ0gwg3t3EIUUY7Yh0lAOnNxWZPiG+jHV+ljZPHtck5YyEJ8/4/Gtg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=mOCEJOR7IxPoF5eKg396n3Y/NHAG28j4VmRqCBKRRIKKu5DKRJJjWApYfFCPX5ui2BFymymvAZIuvDvVC0m5mxybGTDe7bZBrGppmyjG3Rb1ftoB+1haEWRKwiJEWdOSxyDuz+DMRysVUWzqewPwWk8zfwPfHhsNqyHZWNkBRORPNAk8bXj5pZWqWvBOoov+22oh77BTU+sa7r+SEr+gYi10bOv5lADVcHUvqDgyaM9zLzKDxtqWwkcbkSDbmfCqrGzyiBvZjv5e9qHywh/jJcQikYf3YBRfvdMcUUzwONF55Chz0FWpdYNV2t4YuAXg+6O9VIF8C19SiGi6GBp8ow==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Delivery-date: Wed, 18 Sep 2024 13:35:39 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

18.09.24 12:41, Roger Pau Monné:
On Wed, Sep 18, 2024 at 12:29:39PM +0300, Sergiy Kibrik wrote:
16.09.24 22:57, Stefano Stabellini:
On Mon, 16 Sep 2024, Roger Pau Monné wrote:
On Mon, Sep 16, 2024 at 09:37:57AM +0300, Sergiy Kibrik wrote:
Introduce config option X86_PMTIMER so that pmtimer driver can be disabled on
systems that don't need it.

Same comment as in the VGA patch, you need to handle the user passing
X86_EMU_PM.  It's not OK to just ignore the flag if the hypervisor is
built without ACPI PM timer support.

I also think that the flag should not be ignored. I think that Xen
should return error if a user is passing a domain feature not supported
by a particular version of the Xen build. I don't think that libxl needs
to be changed as part of this patch necessarily.

It looks like toolstack always leaves X86_EMU_PM bit enabled, so that part
may also require changes.

I think you will be unable to create HVM guests, but that's kind of
expected if ACPI PM emulation is removed from the hypervisor (it won't
be an HVM guest anymore if it doesn't have ACPI PM).

PVH guest don't set X86_EMU_PM so you should be able to create those
fine.


would the check like this be enough?:

--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -758,6 +758,9 @@ static bool emulation_flags_ok(const struct domain *d, uint32_t emflags)
              (X86_EMU_ALL & ~(X86_EMU_VPCI | X86_EMU_USE_PIRQ)) &&
              emflags != X86_EMU_LAPIC )
             return false;
+        if ( !is_hardware_domain(d) &&
+             (emflags & X86_EMU_PM) && !IS_ENABLED(CONFIG_X86_PMTIMER))
+            return false;
     }
     else if ( emflags != 0 && emflags != X86_EMU_PIT )
     {


(probably with X86_PMTIMER option depending on PV)

  -Sergiy



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.