qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2] xen: Emit RTC_CHANGE upon TIMEOFFSET ioreq
@ 2017-08-23 13:25 Ross Lagerwall
  2017-08-25 17:27 ` Stefano Stabellini
  2017-09-06 14:43 ` Anthony PERARD
  0 siblings, 2 replies; 4+ messages in thread
From: Ross Lagerwall @ 2017-08-23 13:25 UTC (permalink / raw)
  To: qemu-devel; +Cc: xen-devel, Stefano Stabellini, Anthony Perard, Ross Lagerwall

When the guest writes to the RTC, Xen emulates it and broadcasts a
TIMEOFFSET ioreq. Emit an RTC_CHANGE QMP event to all QMP monitors when
this happens rather than ignoring it so that something useful can be
done with the information. This is the same event that QEMU generates
when it emulates the RTC.

This patch by itself doesn't affect any of the toolstacks that I
checked; the libxl toolstack doesn't currently handle this event nor
does the XAPI toolstack. If nothing handles the event, it is simply
ignored. We plan on modifying XAPI to handle it.

Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
---

Changed in v2:
* Expanded commit message.

 hw/i386/xen/xen-hvm.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/hw/i386/xen/xen-hvm.c b/hw/i386/xen/xen-hvm.c
index d9ccd5d..ffd20dc 100644
--- a/hw/i386/xen/xen-hvm.c
+++ b/hw/i386/xen/xen-hvm.c
@@ -16,6 +16,7 @@
 #include "hw/i386/apic-msidef.h"
 #include "hw/xen/xen_common.h"
 #include "hw/xen/xen_backend.h"
+#include "qapi-event.h"
 #include "qmp-commands.h"
 
 #include "qemu/error-report.h"
@@ -967,6 +968,7 @@ static void handle_ioreq(XenIOState *state, ioreq_t *req)
             handle_vmport_ioreq(state, req);
             break;
         case IOREQ_TYPE_TIMEOFFSET:
+            qapi_event_send_rtc_change((int64_t)req->data, &error_abort);
             break;
         case IOREQ_TYPE_INVALIDATE:
             xen_invalidate_map_cache();
-- 
2.9.5

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH v2] xen: Emit RTC_CHANGE upon TIMEOFFSET ioreq
  2017-08-23 13:25 [Qemu-devel] [PATCH v2] xen: Emit RTC_CHANGE upon TIMEOFFSET ioreq Ross Lagerwall
@ 2017-08-25 17:27 ` Stefano Stabellini
  2017-09-06 14:43 ` Anthony PERARD
  1 sibling, 0 replies; 4+ messages in thread
From: Stefano Stabellini @ 2017-08-25 17:27 UTC (permalink / raw)
  To: Ross Lagerwall; +Cc: qemu-devel, xen-devel, Stefano Stabellini, Anthony Perard

On Wed, 23 Aug 2017, Ross Lagerwall wrote:
> When the guest writes to the RTC, Xen emulates it and broadcasts a
> TIMEOFFSET ioreq. Emit an RTC_CHANGE QMP event to all QMP monitors when
> this happens rather than ignoring it so that something useful can be
> done with the information. This is the same event that QEMU generates
> when it emulates the RTC.
> 
> This patch by itself doesn't affect any of the toolstacks that I
> checked; the libxl toolstack doesn't currently handle this event nor
> does the XAPI toolstack. If nothing handles the event, it is simply
> ignored. We plan on modifying XAPI to handle it.
> 
> Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

I queued it up.

> ---
> 
> Changed in v2:
> * Expanded commit message.
> 
>  hw/i386/xen/xen-hvm.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/hw/i386/xen/xen-hvm.c b/hw/i386/xen/xen-hvm.c
> index d9ccd5d..ffd20dc 100644
> --- a/hw/i386/xen/xen-hvm.c
> +++ b/hw/i386/xen/xen-hvm.c
> @@ -16,6 +16,7 @@
>  #include "hw/i386/apic-msidef.h"
>  #include "hw/xen/xen_common.h"
>  #include "hw/xen/xen_backend.h"
> +#include "qapi-event.h"
>  #include "qmp-commands.h"
>  
>  #include "qemu/error-report.h"
> @@ -967,6 +968,7 @@ static void handle_ioreq(XenIOState *state, ioreq_t *req)
>              handle_vmport_ioreq(state, req);
>              break;
>          case IOREQ_TYPE_TIMEOFFSET:
> +            qapi_event_send_rtc_change((int64_t)req->data, &error_abort);
>              break;
>          case IOREQ_TYPE_INVALIDATE:
>              xen_invalidate_map_cache();
> -- 
> 2.9.5
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH v2] xen: Emit RTC_CHANGE upon TIMEOFFSET ioreq
  2017-08-23 13:25 [Qemu-devel] [PATCH v2] xen: Emit RTC_CHANGE upon TIMEOFFSET ioreq Ross Lagerwall
  2017-08-25 17:27 ` Stefano Stabellini
@ 2017-09-06 14:43 ` Anthony PERARD
  2017-09-20 17:18   ` Stefano Stabellini
  1 sibling, 1 reply; 4+ messages in thread
From: Anthony PERARD @ 2017-09-06 14:43 UTC (permalink / raw)
  To: Ross Lagerwall; +Cc: qemu-devel, xen-devel, Stefano Stabellini

On Wed, Aug 23, 2017 at 02:25:05PM +0100, Ross Lagerwall wrote:
> When the guest writes to the RTC, Xen emulates it and broadcasts a
> TIMEOFFSET ioreq. Emit an RTC_CHANGE QMP event to all QMP monitors when
> this happens rather than ignoring it so that something useful can be
> done with the information. This is the same event that QEMU generates
> when it emulates the RTC.
> 
> This patch by itself doesn't affect any of the toolstacks that I
> checked; the libxl toolstack doesn't currently handle this event nor
> does the XAPI toolstack. If nothing handles the event, it is simply
> ignored. We plan on modifying XAPI to handle it.
> 
> Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
> ---
> 
> Changed in v2:
> * Expanded commit message.
> 
>  hw/i386/xen/xen-hvm.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/hw/i386/xen/xen-hvm.c b/hw/i386/xen/xen-hvm.c
> index d9ccd5d..ffd20dc 100644
> --- a/hw/i386/xen/xen-hvm.c
> +++ b/hw/i386/xen/xen-hvm.c
> @@ -16,6 +16,7 @@
>  #include "hw/i386/apic-msidef.h"
>  #include "hw/xen/xen_common.h"
>  #include "hw/xen/xen_backend.h"
> +#include "qapi-event.h"
>  #include "qmp-commands.h"
>  
>  #include "qemu/error-report.h"
> @@ -967,6 +968,7 @@ static void handle_ioreq(XenIOState *state, ioreq_t *req)
>              handle_vmport_ioreq(state, req);
>              break;
>          case IOREQ_TYPE_TIMEOFFSET:
> +            qapi_event_send_rtc_change((int64_t)req->data, &error_abort);

Is this the right value?

>From qapi-schema.json: "offset between base RTC clock (as specified by
-rtc base), and new RTC clock value". But with this patch, the offset
sent via QMP seems to be between the previous value of the guest rtc and
the new one. Other calls to qapi_event_send_rtc_change send the offset
between the new guest RTC and qemu_time().

-- 
Anthony PERARD

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH v2] xen: Emit RTC_CHANGE upon TIMEOFFSET ioreq
  2017-09-06 14:43 ` Anthony PERARD
@ 2017-09-20 17:18   ` Stefano Stabellini
  0 siblings, 0 replies; 4+ messages in thread
From: Stefano Stabellini @ 2017-09-20 17:18 UTC (permalink / raw)
  To: Anthony PERARD; +Cc: Ross Lagerwall, qemu-devel, xen-devel, Stefano Stabellini

Ping?

On Wed, 6 Sep 2017, Anthony PERARD wrote:
> On Wed, Aug 23, 2017 at 02:25:05PM +0100, Ross Lagerwall wrote:
> > When the guest writes to the RTC, Xen emulates it and broadcasts a
> > TIMEOFFSET ioreq. Emit an RTC_CHANGE QMP event to all QMP monitors when
> > this happens rather than ignoring it so that something useful can be
> > done with the information. This is the same event that QEMU generates
> > when it emulates the RTC.
> > 
> > This patch by itself doesn't affect any of the toolstacks that I
> > checked; the libxl toolstack doesn't currently handle this event nor
> > does the XAPI toolstack. If nothing handles the event, it is simply
> > ignored. We plan on modifying XAPI to handle it.
> > 
> > Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
> > ---
> > 
> > Changed in v2:
> > * Expanded commit message.
> > 
> >  hw/i386/xen/xen-hvm.c | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/hw/i386/xen/xen-hvm.c b/hw/i386/xen/xen-hvm.c
> > index d9ccd5d..ffd20dc 100644
> > --- a/hw/i386/xen/xen-hvm.c
> > +++ b/hw/i386/xen/xen-hvm.c
> > @@ -16,6 +16,7 @@
> >  #include "hw/i386/apic-msidef.h"
> >  #include "hw/xen/xen_common.h"
> >  #include "hw/xen/xen_backend.h"
> > +#include "qapi-event.h"
> >  #include "qmp-commands.h"
> >  
> >  #include "qemu/error-report.h"
> > @@ -967,6 +968,7 @@ static void handle_ioreq(XenIOState *state, ioreq_t *req)
> >              handle_vmport_ioreq(state, req);
> >              break;
> >          case IOREQ_TYPE_TIMEOFFSET:
> > +            qapi_event_send_rtc_change((int64_t)req->data, &error_abort);
> 
> Is this the right value?
> 
> >From qapi-schema.json: "offset between base RTC clock (as specified by
> -rtc base), and new RTC clock value". But with this patch, the offset
> sent via QMP seems to be between the previous value of the guest rtc and
> the new one. Other calls to qapi_event_send_rtc_change send the offset
> between the new guest RTC and qemu_time().
 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-09-20 17:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-23 13:25 [Qemu-devel] [PATCH v2] xen: Emit RTC_CHANGE upon TIMEOFFSET ioreq Ross Lagerwall
2017-08-25 17:27 ` Stefano Stabellini
2017-09-06 14:43 ` Anthony PERARD
2017-09-20 17:18   ` Stefano Stabellini

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).