All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Dan Magenheimer" <dan.magenheimer@oracle.com>
To: Keir Fraser <Keir.Fraser@cl.cam.ac.uk>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: RE: [PATCH] new hvm platform vhpet enable parameter
Date: Thu, 7 Feb 2008 13:53:45 -0700	[thread overview]
Message-ID: <20080207135345296.00000003652@djm-pc> (raw)
In-Reply-To: <C3D1005B.1C1B7%Keir.Fraser@cl.cam.ac.uk>

[-- Attachment #1: Type: text/plain, Size: 841 bytes --]

> 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

[-- Attachment #2: hpet.patch --]
[-- Type: application/octet-stream, Size: 4630 bytes --]

diff -r d26b1b777fde tools/python/xen/xend/XendConfig.py
--- a/tools/python/xen/xend/XendConfig.py	Wed Feb 06 10:06:35 2008 +0000
+++ b/tools/python/xen/xend/XendConfig.py	Thu Feb 07 13:32:26 2008 -0700
@@ -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' ]
diff -r d26b1b777fde tools/python/xen/xend/XendConstants.py
--- a/tools/python/xen/xend/XendConstants.py	Wed Feb 06 10:06:35 2008 +0000
+++ b/tools/python/xen/xend/XendConstants.py	Thu Feb 07 13:32:26 2008 -0700
@@ -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",
diff -r d26b1b777fde tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py	Wed Feb 06 10:06:35 2008 +0000
+++ b/tools/python/xen/xend/XendDomainInfo.py	Thu Feb 07 13:32:26 2008 -0700
@@ -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']))
diff -r d26b1b777fde tools/python/xen/xm/create.py
--- a/tools/python/xen/xm/create.py	Wed Feb 06 10:06:35 2008 +0000
+++ b/tools/python/xen/xm/create.py	Thu Feb 07 13:32:26 2008 -0700
@@ -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:
diff -r d26b1b777fde tools/python/xen/xm/xenapi_create.py
--- a/tools/python/xen/xm/xenapi_create.py	Wed Feb 06 10:06:35 2008 +0000
+++ b/tools/python/xen/xm/xenapi_create.py	Thu Feb 07 13:32:26 2008 -0700
@@ -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")
diff -r d26b1b777fde xen/arch/x86/hvm/hpet.c
--- a/xen/arch/x86/hvm/hpet.c	Wed Feb 06 10:06:35 2008 +0000
+++ b/xen/arch/x86/hvm/hpet.c	Thu Feb 07 13:32:26 2008 -0700
@@ -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)));
 }
diff -r d26b1b777fde xen/include/public/hvm/params.h
--- a/xen/include/public/hvm/params.h	Wed Feb 06 10:06:35 2008 +0000
+++ b/xen/include/public/hvm/params.h	Thu Feb 07 13:32:26 2008 -0700
@@ -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__ */

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

  reply	other threads:[~2008-02-07 20:53 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-07 17:46 [PATCH] new hvm platform vhpet enable parameter Dan Magenheimer
2008-02-07 17:52 ` Samuel Thibault
2008-02-07 17:53 ` Keir Fraser
2008-02-07 18:29   ` Dan Magenheimer
2008-02-07 18:37     ` Keir Fraser
2008-02-07 20:53       ` Dan Magenheimer [this message]
2008-02-14 16:52         ` Dan Magenheimer
2008-02-14 17:52           ` Keir Fraser
2008-02-14 18:18             ` Dan Magenheimer
2008-02-14 19:25               ` Keir Fraser
2008-02-14 19:48                 ` Dan Magenheimer
2008-02-14 21:50                   ` Keir Fraser
2008-02-08 12:50     ` Stephen C. Tweedie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080207135345296.00000003652@djm-pc \
    --to=dan.magenheimer@oracle.com \
    --cc=Keir.Fraser@cl.cam.ac.uk \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.