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

[Xen-devel] [PATCH 1/2] x86/vRTC: Make rtc_mode_{strict, no_ack} a per-domain option



Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CC: Keir Fraser <keir@xxxxxxx>
CC: Jan Beulich <JBeulich@xxxxxxxx>
CC: Tim Deegan <tim@xxxxxxx>
---
 xen/arch/x86/hvm/hvm.c          |    4 ++++
 xen/arch/x86/hvm/rtc.c          |   11 ++++++-----
 xen/include/public/hvm/params.h |    5 ++++-
 3 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index af249f7..e56ada5 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -4116,6 +4116,10 @@ long do_hvm_op(unsigned long op, 
XEN_GUEST_HANDLE_PARAM(void) arg)
                 if ( a.value > SHUTDOWN_MAX )
                     rc = -EINVAL;
                 break;
+            case HVM_PARAM_RTC_MODE:
+                if ( a.value > 1 )
+                    rc = -EINVAL;
+                break;
             }
 
             if ( rc == 0 ) 
diff --git a/xen/arch/x86/hvm/rtc.c b/xen/arch/x86/hvm/rtc.c
index cdedefe..4010d49 100644
--- a/xen/arch/x86/hvm/rtc.c
+++ b/xen/arch/x86/hvm/rtc.c
@@ -45,14 +45,15 @@
 #define epoch_year     1900
 #define get_year(x)    (x + epoch_year)
 
+/* This forms an ABI in HVM_PARAM_RTC_MODE */
 enum rtc_mode {
-   rtc_mode_no_ack,
-   rtc_mode_strict
+   rtc_mode_no_ack = 0,
+   rtc_mode_strict = 1
 };
 
-/* This must be in sync with how hvmloader sets the ACPI WAET flags. */
-#define mode_is(d, m) ((void)(d), rtc_mode_##m == rtc_mode_no_ack)
-#define rtc_mode_is(s, m) mode_is(vrtc_domain(s), m)
+#define rtc_mode_is(s, m) (                                        \
+        vrtc_domain(s)->arch.hvm_domain.params[HVM_PARAM_RTC_MODE] \
+                      == rtc_mode_##m)
 
 static void rtc_copy_date(RTCState *s);
 static void rtc_set_time(RTCState *s);
diff --git a/xen/include/public/hvm/params.h b/xen/include/public/hvm/params.h
index 517a184..2849dc3 100644
--- a/xen/include/public/hvm/params.h
+++ b/xen/include/public/hvm/params.h
@@ -145,6 +145,9 @@
 /* SHUTDOWN_* action in case of a triple fault */
 #define HVM_PARAM_TRIPLE_FAULT_REASON 31
 
-#define HVM_NR_PARAMS          32
+/* Set to 1 if domain is expected to use RTC no-ack optimisation */
+#define HVM_PARAM_RTC_MODE 32
+
+#define HVM_NR_PARAMS          33
 
 #endif /* __XEN_PUBLIC_HVM_PARAMS_H__ */
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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