xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xen.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Keir Fraser <keir@xen.org>, Jan Beulich <JBeulich@suse.com>,
	Tim Deegan <tim@xen.org>
Subject: [PATCH 1/2] x86/vRTC: Make rtc_mode_{strict, no_ack} a per-domain option
Date: Tue, 26 Nov 2013 20:39:17 +0000	[thread overview]
Message-ID: <1385498358-10077-2-git-send-email-andrew.cooper3@citrix.com> (raw)
In-Reply-To: <1385498358-10077-1-git-send-email-andrew.cooper3@citrix.com>

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Keir Fraser <keir@xen.org>
CC: Jan Beulich <JBeulich@suse.com>
CC: Tim Deegan <tim@xen.org>
---
 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

  reply	other threads:[~2013-11-26 20:39 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-26 20:39 [PATCH RFC 0/2] Fix RTC noack issues Andrew Cooper
2013-11-26 20:39 ` Andrew Cooper [this message]
2013-11-27  9:55   ` [PATCH 1/2] x86/vRTC: Make rtc_mode_{strict, no_ack} a per-domain option Jan Beulich
2013-11-28 10:45     ` Tim Deegan
2013-11-26 20:39 ` [PATCH 2/2] hvmloader: Allow the toolstack to choose WAET optimisations Andrew Cooper
2013-11-27 10:03   ` Jan Beulich
2013-11-27 12:14     ` Andrew Cooper
2013-11-27 12:56       ` Jan Beulich
2013-11-27 12:58         ` Andrew Cooper
2013-11-29  9:53   ` Ian Campbell
2013-11-29  9:55   ` Ian Campbell
2013-11-29 10:57     ` Andrew Cooper
2013-11-29 11:01       ` Ian Campbell

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=1385498358-10077-2-git-send-email-andrew.cooper3@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=keir@xen.org \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xen.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).