Skip to contentSkip to conversation

new hvm platform vhpet enable parameter

PATCH In review Dan Magenheimer 4 participants 13 messages Feb 7, 2008 – Feb 14, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 new hvm platform vhpet enable parameter

HVM domains currently always have a virtual hpet (high-precision event timer) enabled. This patch adds an hvm platform variable "vhpet" to enable/disable virtualization of the hpet for a guest.

Default is off (no vhpet) because vhpet is currently less accurate in keeping time than PIT (because no timer_mode adjustments), and because AFAICT VMware still doesn't implement virtual hpet.

A similar patch to enable/disable pmtimer is also needed but I thought I'd post this one for discussion first.

This patch applies against and was tested with xen-3.1-testing.

===================================
If Xen could save time in a bottle / then clocks wouldn't virtually skew / It would save every tick / for VMs that aren't quick /
and Xen then would send them anew
(with apologies to the late great Jim Croce)

tools/python/xen/xend/XendConfig.py +1 -1
diff -r 6741bbc08b25 tools/python/xen/xend/XendConfig.py
@@ -124,7 +124,7 @@ XENAPI_PLATFORM_CFG = [ 'acpi', 'apic', 
 XENAPI_PLATFORM_CFG = [ 'acpi', 'apic', 'boot', 'device_model', 'display', 
                         'fda', 'fdb', 'keymap', 'isa', 'localtime', 'monitor', 
                         'nographic', 'pae', 'rtc_timeoffset', 'serial', 'sdl',
-                        'soundhw','stdvga', 'usb', 'usbdevice', 'vnc',
+                        'soundhw','stdvga', 'usb', 'usbdevice', 'vhpet', 'vnc',
                         'vncconsole', 'vncdisplay', 'vnclisten', 'timer_mode',
                         'vncpasswd', 'vncunused', 'xauthority']
 
tools/python/xen/xend/XendConstants.py +1 -0
diff -r 6741bbc08b25 tools/python/xen/xend/XendConstants.py
@@ -44,6 +44,7 @@ HVM_PARAM_IOREQ_PFN    = 5
 HVM_PARAM_IOREQ_PFN    = 5
 HVM_PARAM_BUFIOREQ_PFN = 6
 HVM_PARAM_TIMER_MODE   = 10
+HVM_PARAM_VHPET        = 11
 
 restart_modes = [
     "restart",
tools/python/xen/xend/XendDomainInfo.py +6 -0
diff -r 6741bbc08b25 tools/python/xen/xend/XendDomainInfo.py
@@ -1547,6 +1547,12 @@ class XendDomainInfo:
         if hvm and timer_mode is not None:
             xc.hvm_set_param(self.domid, HVM_PARAM_TIMER_MODE,
                              long(timer_mode))
+
+        # Optionally enable virtual HPET
+        vhpet = self.info["platform"].get("vhpet")
+        if hvm and vhpet is not None:
+            xc.hvm_set_param(self.domid, HVM_PARAM_VHPET,
+                             long(vhpet))
 
         # Set maximum number of vcpus in domain
         xc.domain_max_vcpus(self.domid, int(self.info['VCPUs_max']))
tools/python/xen/xm/create.py +5 -1
diff -r 6741bbc08b25 tools/python/xen/xm/create.py
@@ -193,6 +193,10 @@ gopts.var('pae', val='PAE',
 gopts.var('pae', val='PAE',
           fn=set_int, default=1,
           use="Disable or enable PAE of HVM domain.")
+
+gopts.var('vhpet', val='VHPET',
+          fn=set_int, default=0,
+          use="Enable virtual high-precision event timer.")
 
 gopts.var('timer_mode', val='TIMER_MODE',
           fn=set_int, default=0,
@@ -731,7 +735,7 @@ def configure_hvm(config_image, vals):
              'localtime', 'serial', 'stdvga', 'isa', 'nographic', 'soundhw',
              'vnc', 'vncdisplay', 'vncunused', 'vncconsole', 'vnclisten',
              'sdl', 'display', 'xauthority', 'rtc_timeoffset', 'monitor',
-             'acpi', 'apic', 'usb', 'usbdevice', 'keymap' ]
+             'vhpet', 'acpi', 'apic', 'usb', 'usbdevice', 'keymap' ]
     for a in args:
         if a in vals.__dict__ and vals.__dict__[a] is not None:
             config_image.append([a, vals.__dict__[a]])
tools/python/xen/xm/xenapi_create.py +1 -1
diff -r 6741bbc08b25 tools/python/xen/xm/xenapi_create.py
@@ -755,7 +755,7 @@ class sxp2xml:
 
 
     def extract_platform(self, image, document):
-        platform_keys = ['acpi', 'apic', 'pae', 'timer_mode']
+        platform_keys = ['acpi', 'apic', 'pae', 'timer_mode', 'vhpet']
 
         def extract_platform_key(key):
             platform = document.createElement("platform")
xen/arch/x86/hvm/hpet.c +2 -0
diff -r 6741bbc08b25 xen/arch/x86/hvm/hpet.c
@@ -328,6 +328,8 @@ static void hpet_write(
 
 static int hpet_range(struct vcpu *v, unsigned long addr)
 {
+    if (!(v->domain->arch.hvm_domain.params[HVM_PARAM_VHPET]))
+        return 0;
     return ((addr >= HPET_BASE_ADDRESS) &&
             (addr < (HPET_BASE_ADDRESS + HPET_MMAP_SIZE)));
 }
xen/include/public/hvm/params.h +7 -1
diff -r 6741bbc08b25 xen/include/public/hvm/params.h
@@ -79,6 +79,12 @@
 #define HVMPTM_no_missed_ticks_pending   2
 #define HVMPTM_one_missed_tick_pending   3
 
-#define HVM_NR_PARAMS          11
+/*
+ * Enable virtual HPET (high-precision event timer) (x86-only)
+ *  0=disabled, 1-enabled
+ */
+#define HVM_PARAM_VHPET 11
+
+#define HVM_NR_PARAMS          12
 
 #endif /* __XEN_PUBLIC_HVM_PARAMS_H__ */

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw
Quoted 3 lines · Dan Magenheimer, le Thu 07 Feb 2008 10:46:33 -0700, a écrit :

HVM domains currently always have a virtual hpet (high-precision event timer) enabled. This patch adds an hvm platform variable "vhpet" to enable/disable virtualization of the hpet for a guest.

Mmm, why a v in vhpet? There is no v in the acpi and apic options for instance.

Quoted 1 line

This patch applies against and was tested with xen-3.1-testing.

Mmm, that's a bit old, maybe you should check it against 3.2

Samuel

#2 lore raw
In reply to Dan Magenheimer

HPET is also advertised in the ACPI tables which would need to be gated. Should be called vhpet not hpet as the 'v' is rather redundant.

Why would we want to do the same for pmtimer? Is it inaccurate?

-- Keir

Quoted 24 lines · Dan Magenheimer

HVM domains currently always have a virtual hpet (high-precision event timer) enabled. This patch adds an hvm platform variable "vhpet" to enable/disable virtualization of the hpet for a guest.

Default is off (no vhpet) because vhpet is currently less accurate in keeping time than PIT (because no timer_mode adjustments), and because AFAICT VMware still doesn't implement virtual hpet.

A similar patch to enable/disable pmtimer is also needed but I thought I'd post this one for discussion first.

This patch applies against and was tested with xen-3.1-testing.

===================================
If Xen could save time in a bottle / then clocks wouldn't virtually skew / It would save every tick / for VMs that aren't quick /
and Xen then would send them anew
(with apologies to the late great Jim Croce)
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#3 lore raw
Quoted 2 lines

HPET is also advertised in the ACPI tables which would need to be gated.

Could you point me in the right direction? I see that a Linux hvm kernel still prints a line indicating it has discovered an HPET in the ACPI tables, but I couldn't find anything in hvm code that would turn that off, and I just want to turn off HPET per guest, not for Xen and all guests.

Quoted 1 line

Should be called vhpet not hpet as the 'v' is rather redundant.

OK, will fix

Quoted 1 line

Why would we want to do the same for pmtimer? Is it inaccurate?

If Linux were using it as a timekeeping source, I think it would be (per earlier post by Dave Winchell), but on second look once HPET is disabled, Linux discovers pmtimer but still uses PIT/TSC based timekeeping. So an equivalent pmtimer patch might be needed for some future version of Linux but I guess we won't worry about that now.

Quoted 4 lines

From: Samuel Thibault [mailto:[email protected]]

Quoted 1 line

This patch applies against and was tested with xen-3.1-testing.

Mmm, that's a bit old, maybe you should check it against 3.2

Will do. 3.1 is my daily test/dev environment so I started there.

Dan

#4 lore raw
Quoted 8 lines · Dan Magenheimer
Quoted 2 lines

HPET is also advertised in the ACPI tables which would need to be gated.

Could you point me in the right direction? I see that a Linux hvm kernel still prints a line indicating it has discovered an HPET in the ACPI tables, but I couldn't find anything in hvm code that would turn that off, and I just want to turn off HPET per guest, not for Xen and all guests.

Yes, tools/firmware/hvmloader/acpi/dsdt.asl. The right way to do this will be to gate it on a flag set up in memory by hvmloader (we already do this e.g., for com1 and com2 -- see construct_bios_info_table() in build.c in the same directory). That might be a bit tricky as it probably needs a bit of ASL hacking, which has a little learning curve. I can take a look maybe next week.

-- Keir

#5 lore raw
Quoted 11 lines

Yes, tools/firmware/hvmloader/acpi/dsdt.asl. The right way to do this will
be to gate it on a flag set up in memory by hvmloader (we already do this
e.g., for com1 and com2 -- see construct_bios_info_table() in build.c in the
same directory). That might be a bit tricky as it probably needs a bit of
ASL hacking, which has a little learning curve. I can take a look maybe next
week.

OK, here's the updated patch:
1) hpet instead of vhpet
2) against 3.2-testing tip

This will work without the acpi changes so could be checked in independently. Though it may be a bit misleading for the guest to print out that it found an hpet in acpi and then be unable to use it, the acpi part is largely cosmetic and (as you point out) a bit tricky so better left for your capable hands.

Thanks,
Dan

tools/python/xen/xend/XendConfig.py +1 -1
diff -r d26b1b777fde tools/python/xen/xend/XendConfig.py
@@ -127,7 +127,7 @@ XENAPI_PLATFORM_CFG = [ 'acpi', 'apic', 
 XENAPI_PLATFORM_CFG = [ 'acpi', 'apic', 'boot', 'device_model', 'display', 
                         'fda', 'fdb', 'keymap', 'isa', 'localtime', 'monitor', 
                         'nographic', 'pae', 'rtc_timeoffset', 'serial', 'sdl',
-                        'soundhw','stdvga', 'usb', 'usbdevice', 'vnc',
+                        'soundhw','stdvga', 'usb', 'usbdevice', 'hpet', 'vnc',
                         'vncconsole', 'vncdisplay', 'vnclisten', 'timer_mode',
                         'vncpasswd', 'vncunused', 'xauthority', 'pci', 'vhpt',
                         'guest_os_type' ]
tools/python/xen/xend/XendConstants.py +1 -0
diff -r d26b1b777fde tools/python/xen/xend/XendConstants.py
@@ -47,6 +47,7 @@ HVM_PARAM_VHPT_SIZE    = 8
 HVM_PARAM_VHPT_SIZE    = 8
 HVM_PARAM_BUFPIOREQ_PFN = 9
 HVM_PARAM_TIMER_MODE   = 10
+HVM_PARAM_HPET         = 11
 
 restart_modes = [
     "restart",
tools/python/xen/xend/XendDomainInfo.py +6 -0
diff -r d26b1b777fde tools/python/xen/xend/XendDomainInfo.py
@@ -1659,6 +1659,12 @@ class XendDomainInfo:
         if hvm and timer_mode is not None:
             xc.hvm_set_param(self.domid, HVM_PARAM_TIMER_MODE,
                              long(timer_mode))
+
+        # Optionally enable virtual HPET
+        hpet = self.info["platform"].get("hpet")
+        if hvm and hpet is not None:
+            xc.hvm_set_param(self.domid, HVM_PARAM_HPET,
+                             long(hpet))
 
         # Set maximum number of vcpus in domain
         xc.domain_max_vcpus(self.domid, int(self.info['VCPUs_max']))
tools/python/xen/xm/create.py +5 -1
diff -r d26b1b777fde tools/python/xen/xm/create.py
@@ -193,6 +193,10 @@ gopts.var('pae', val='PAE',
 gopts.var('pae', val='PAE',
           fn=set_int, default=1,
           use="Disable or enable PAE of HVM domain.")
+
+gopts.var('hpet', val='HPET',
+          fn=set_int, default=0,
+          use="Enable virtual high-precision event timer.")
 
 gopts.var('timer_mode', val='TIMER_MODE',
           fn=set_int, default=0,
@@ -723,7 +727,7 @@ def configure_hvm(config_image, vals):
              'localtime', 'serial', 'stdvga', 'isa', 'nographic', 'soundhw',
              'vnc', 'vncdisplay', 'vncunused', 'vncconsole', 'vnclisten',
              'sdl', 'display', 'xauthority', 'rtc_timeoffset', 'monitor',
-             'acpi', 'apic', 'usb', 'usbdevice', 'keymap', 'pci',
+             'acpi', 'apic', 'usb', 'usbdevice', 'keymap', 'pci', 'hpet',
              'guest_os_type']
 
     for a in args:
tools/python/xen/xm/xenapi_create.py +1 -1
diff -r d26b1b777fde tools/python/xen/xm/xenapi_create.py
@@ -818,7 +818,7 @@ class sxp2xml:
 
 
     def extract_platform(self, image, document):
-        platform_keys = ['acpi', 'apic', 'pae', 'vhpt', 'timer_mode']
+        platform_keys = ['acpi', 'apic', 'pae', 'vhpt', 'timer_mode', 'hpet']
 
         def extract_platform_key(key):
             platform = document.createElement("platform")
xen/arch/x86/hvm/hpet.c +2 -0
diff -r d26b1b777fde xen/arch/x86/hvm/hpet.c
@@ -353,6 +353,8 @@ static void hpet_write(
 
 static int hpet_range(struct vcpu *v, unsigned long addr)
 {
+    if (!(v->domain->arch.hvm_domain.params[HVM_PARAM_HPET]))
+        return 0;
     return ((addr >= HPET_BASE_ADDRESS) &&
             (addr < (HPET_BASE_ADDRESS + HPET_MMAP_SIZE)));
 }
xen/include/public/hvm/params.h +7 -1
diff -r d26b1b777fde xen/include/public/hvm/params.h
@@ -81,6 +81,12 @@
 #define HVMPTM_no_missed_ticks_pending   2
 #define HVMPTM_one_missed_tick_pending   3
 
-#define HVM_NR_PARAMS          11
+/*
+ * Enable virtual HPET (high-precision event timer) (x86-only)
+ *  0=disabled, 1-enabled
+ */
+#define HVM_PARAM_HPET 11
+
+#define HVM_NR_PARAMS          12
 
 #endif /* __XEN_PUBLIC_HVM_PARAMS_H__ */

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#6 lore raw

I see this patch hasn't been taken yet. Is there something else I need to do or are you not in agreement that the acpi part is cosmetic?

Thanks,
Dan

Quoted 34 lines

-----Original Message-----
From: Dan Magenheimer [mailto:[email protected]]
Sent: Thursday, February 07, 2008 1:54 PM
To: 'Keir Fraser'; '[email protected]'
Subject: RE: [Xen-devel] [PATCH] new hvm platform vhpet enable parameter

Quoted 11 lines

Yes, tools/firmware/hvmloader/acpi/dsdt.asl. The right way to do this will
be to gate it on a flag set up in memory by hvmloader (we already do this
e.g., for com1 and com2 -- see construct_bios_info_table() in build.c in the
same directory). That might be a bit tricky as it probably needs a bit of
ASL hacking, which has a little learning curve. I can take a look maybe next
week.

OK, here's the updated patch:
1) hpet instead of vhpet
2) against 3.2-testing tip

This will work without the acpi changes so could be checked in independently. Though it may be a bit misleading for the guest to print out that it found an hpet in acpi and then be unable to use it, the acpi part is largely cosmetic and (as you point out) a bit tricky so better left for your capable hands.

Thanks,
Dan

#7 lore raw

It has been taken. Xen-unstable:17017.

-- Keir

Quoted 42 lines · Dan Magenheimer

I see this patch hasn't been taken yet. Is there something else I need to do or are you not in agreement that the acpi part is cosmetic?

Thanks,
Dan

Quoted 34 lines

-----Original Message-----
From: Dan Magenheimer [mailto:[email protected]]
Sent: Thursday, February 07, 2008 1:54 PM
To: 'Keir Fraser'; '[email protected]'
Subject: RE: [Xen-devel] [PATCH] new hvm platform vhpet enable parameter

Quoted 11 lines

Yes, tools/firmware/hvmloader/acpi/dsdt.asl. The right way to do this will
be to gate it on a flag set up in memory by hvmloader (we already do this
e.g., for com1 and com2 -- see construct_bios_info_table() in build.c in the
same directory). That might be a bit tricky as it probably needs a bit of
ASL hacking, which has a little learning curve. I can take a look maybe next
week.

OK, here's the updated patch:
1) hpet instead of vhpet
2) against 3.2-testing tip

This will work without the acpi changes so could be checked in independently. Though it may be a bit misleading for the guest to print out that it found an hpet in acpi and then be unable to use it, the acpi part is largely cosmetic and (as you point out) a bit tricky so better left for your capable hands.

Thanks,
Dan

#8 lore raw

Thanks, sorry I missed it.

Glad I didn't have to deal with that ACPI asl stuff! What a mess!

A question: You added a snippet in arch/x86/hvm/hvm.c that sets the HPET_ENABLED parameter on. I don't have a machine running xen-unstable at the moment so I can't verify, but this appears to be turning the virtual hpet on by default. Was this intended?

Quoted 61 lines

-----Original Message-----
From: Keir Fraser [mailto:[email protected]]
Sent: Thursday, February 14, 2008 10:52 AM
To: [email protected]; [email protected]
Subject: Re: [Xen-devel] [PATCH] new hvm platform vhpet enable parameter

It has been taken. Xen-unstable:17017.

-- Keir

Quoted 42 lines · Dan Magenheimer

I see this patch hasn't been taken yet. Is there something else I need to do or are you not in agreement that the acpi part is cosmetic?

Thanks,
Dan

Quoted 34 lines

-----Original Message-----
From: Dan Magenheimer [mailto:[email protected]]
Sent: Thursday, February 07, 2008 1:54 PM
To: 'Keir Fraser'; '[email protected]'
Subject: RE: [Xen-devel] [PATCH] new hvm platform vhpet enable parameter

Quoted 11 lines

Yes, tools/firmware/hvmloader/acpi/dsdt.asl. The right way to do this will
be to gate it on a flag set up in memory by hvmloader (we already do this
e.g., for com1 and com2 -- see construct_bios_info_table() in build.c in the
same directory). That might be a bit tricky as it probably needs a bit of
ASL hacking, which has a little learning curve. I can take a look maybe next
week.

OK, here's the updated patch:
1) hpet instead of vhpet
2) against 3.2-testing tip

This will work without the acpi changes so could be checked in independently. Though it may be a bit misleading for the guest to print out that it found an hpet in acpi and then be unable to use it, the acpi part is largely cosmetic and (as you point out) a bit tricky so better left for your capable hands.

Thanks,
Dan

#9 lore raw

It enables it by default if the tools do not explicitly instruct either way. In practice the tools will always explicitly instruct Xen for any new guest, since xm picks default == 0. But it is important for old saved guest images which will have no value for 'hpet': in this case we *must* enable the hpet by default as the guest has probably already probed it.

I'm a bit undecided whether the tools should pick default of on or off. I guess the default doesn't matter all that much, and it's better off by default if it's not working that well.

I can easily add a similar switch for pmtimer.

-- Keir

Quoted 72 lines · Dan Magenheimer

Thanks, sorry I missed it.

Glad I didn't have to deal with that ACPI asl stuff! What a mess!

A question: You added a snippet in arch/x86/hvm/hvm.c that sets the HPET_ENABLED parameter on. I don't have a machine running xen-unstable at the moment so I can't verify, but this appears to be turning the virtual hpet on by default. Was this intended?

Quoted 61 lines

-----Original Message-----
From: Keir Fraser [mailto:[email protected]]
Sent: Thursday, February 14, 2008 10:52 AM
To: [email protected]; [email protected]
Subject: Re: [Xen-devel] [PATCH] new hvm platform vhpet enable parameter

It has been taken. Xen-unstable:17017.

-- Keir

Quoted 42 lines · Dan Magenheimer

I see this patch hasn't been taken yet. Is there something else I need to do or are you not in agreement that the acpi part is cosmetic?

Thanks,
Dan

Quoted 34 lines

-----Original Message-----
From: Dan Magenheimer [mailto:[email protected]]
Sent: Thursday, February 07, 2008 1:54 PM
To: 'Keir Fraser'; '[email protected]'
Subject: RE: [Xen-devel] [PATCH] new hvm platform vhpet enable parameter

Quoted 11 lines

Yes, tools/firmware/hvmloader/acpi/dsdt.asl. The right way to do this will
be to gate it on a flag set up in memory by hvmloader (we already do this
e.g., for com1 and com2 -- see construct_bios_info_table() in build.c in the
same directory). That might be a bit tricky as it probably needs a bit of
ASL hacking, which has a little learning curve. I can take a look maybe next
week.

OK, here's the updated patch:
1) hpet instead of vhpet
2) against 3.2-testing tip

This will work without the acpi changes so could be checked in independently. Though it may be a bit misleading for the guest to print out that it found an hpet in acpi and then be unable to use it, the acpi part is largely cosmetic and (as you point out) a bit tricky so better left for your capable hands.

Thanks,
Dan

#10 lore raw
Quoted 2 lines

It enables it by default if the tools do not explicitly instruct either way.... for old saved guest images...

OK, I see. I'm glad you caught that.

But does that mean if a guest config file does not explicitly have a "hpet = 0" line, the default will be on? If so, that's different from how I intended. Perhaps the code in XendDomainInfo _constructDomain should be modified to set it to zero if "hpet is None"? Else, I'll bet guests created by virt-install will end up with hpet on.

Also it occurs to me it might be a good idea to add a gdprintk in hvm.c so that whether the hpet is on or not is visibly logged.

Quoted 1 line

I can easily add a similar switch for pmtimer.

Yes, from Dave Winchell's post today on another thread, it appears that there are definitely some Linux versions that will default to the pmtimer, which currently is not working well either.

I'm happy to submit a patch for pmtimer, but since you are probably going to have to do the heavy lifting on the acpi asl stuff anyway, you may as well. But if you'd rather I give it a try, let me know.

Thanks,
Dan

Quoted 105 lines

-----Original Message-----
From: Keir Fraser [mailto:[email protected]]
Sent: Thursday, February 14, 2008 12:26 PM
To: [email protected]; [email protected]
Subject: Re: [Xen-devel] [PATCH] new hvm platform vhpet enable parameter

It enables it by default if the tools do not explicitly instruct either way.
In practice the tools will always explicitly instruct Xen for any new guest,
since xm picks default == 0. But it is important for old saved guest images
which will have no value for 'hpet': in this case we *must* enable the hpet
by default as the guest has probably already probed it.

I'm a bit undecided whether the tools should pick default of on or off. I
guess the default doesn't matter all that much, and it's better off by default if it's not working that well.

I can easily add a similar switch for pmtimer.

-- Keir

Quoted 72 lines · Dan Magenheimer

Thanks, sorry I missed it.

Glad I didn't have to deal with that ACPI asl stuff! What a mess!

A question: You added a snippet in arch/x86/hvm/hvm.c that sets the HPET_ENABLED parameter on. I don't have a machine running xen-unstable at the moment so I can't verify, but this appears to be turning the virtual hpet on by default. Was this intended?

Quoted 61 lines

-----Original Message-----
From: Keir Fraser [mailto:[email protected]]
Sent: Thursday, February 14, 2008 10:52 AM
To: [email protected]; [email protected]
Subject: Re: [Xen-devel] [PATCH] new hvm platform vhpet enable parameter

It has been taken. Xen-unstable:17017.

-- Keir

Quoted 42 lines · Dan Magenheimer

I see this patch hasn't been taken yet. Is there something else I need to do or are you not in agreement that the acpi part is cosmetic?

Thanks,
Dan

Quoted 34 lines

-----Original Message-----
From: Dan Magenheimer [mailto:[email protected]]
Sent: Thursday, February 07, 2008 1:54 PM
To: 'Keir Fraser'; '[email protected]'
Subject: RE: [Xen-devel] [PATCH] new hvm platform vhpet enable parameter

Quoted 11 lines

Yes, tools/firmware/hvmloader/acpi/dsdt.asl. The right way to do this will
be to gate it on a flag set up in memory by hvmloader (we already do this
e.g., for com1 and com2 -- see construct_bios_info_table() in build.c in the
same directory). That might be a bit tricky as it probably needs a bit of
ASL hacking, which has a little learning curve. I can take a look maybe next
week.

OK, here's the updated patch:
1) hpet instead of vhpet
2) against 3.2-testing tip

This will work without the acpi changes so could be checked in independently. Though it may be a bit misleading for the guest to print out that it found an hpet in acpi and then be unable to use it, the acpi part is largely cosmetic and (as you point out) a bit tricky so better left for your capable hands.

Thanks,
Dan

#11 lore raw
Quoted 11 lines · Dan Magenheimer
Quoted 2 lines

It enables it by default if the tools do not explicitly instruct either way.... for old saved guest images...

OK, I see. I'm glad you caught that.

But does that mean if a guest config file does not explicitly have a "hpet = 0" line, the default will be on? If so, that's different from how I intended. Perhaps the code in XendDomainInfo _constructDomain should be modified to set it to zero if "hpet is None"? Else, I'll bet guests created by virt-install will end up with hpet on.

Yes, that's possible. Possibly XendConfig.py should set a default. Or virt-install itself should do so.

Quoted 3 lines

Also it occurs to me it might be a good idea to add a gdprintk in hvm.c so that whether the hpet is on or not is visibly logged.

There are many config options for an HVM guest, none of which are logged by Xen. It would be inconsistent to log just this one.

-- Keir

#12 lore raw
In reply to Dan Magenheimer

Hi,

Quoted 4 lines · Dan Magenheimer

If Linux were using it as a timekeeping source, I think it would be (per earlier post by Dave Winchell), but on second look once HPET is disabled, Linux discovers pmtimer but still uses PIT/TSC based timekeeping.

Just one word of warning --- the Linux handling of PIT vs HPET vs pmtimer has changed a lot over the years, and you might well find older kernels handling these cases differently. (I can't recall exact details but I do remember seeing long discussions about the merits of the different timers in different cases.)

--Stephen