[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen master] x86: allow disabling the emulated RTC
commit c603463ddbf2728d4eb82ecd7f435b5f642e11f8 Author: Roger Pau Monné <roger.pau@xxxxxxxxxx> AuthorDate: Tue Nov 10 12:07:03 2015 +0100 Commit: Jan Beulich <jbeulich@xxxxxxxx> CommitDate: Tue Nov 10 12:07:03 2015 +0100 x86: allow disabling the emulated RTC Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx> Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> --- xen/arch/x86/hvm/rtc.c | 22 ++++++++++++++++++++++ 1 files changed, 22 insertions(+), 0 deletions(-) diff --git a/xen/arch/x86/hvm/rtc.c b/xen/arch/x86/hvm/rtc.c index a9efeaf..d391e38 100644 --- a/xen/arch/x86/hvm/rtc.c +++ b/xen/arch/x86/hvm/rtc.c @@ -726,6 +726,9 @@ void rtc_migrate_timers(struct vcpu *v) { RTCState *s = vcpu_vrtc(v); + if ( !has_vrtc(v->domain) ) + return; + if ( v->vcpu_id == 0 ) { migrate_timer(&s->update_timer, v->processor);; @@ -739,6 +742,10 @@ static int rtc_save(struct domain *d, hvm_domain_context_t *h) { RTCState *s = domain_vrtc(d); int rc; + + if ( !has_vrtc(d) ) + return 0; + spin_lock(&s->lock); rc = hvm_save_entry(RTC, 0, h, &s->hw); spin_unlock(&s->lock); @@ -750,6 +757,9 @@ static int rtc_load(struct domain *d, hvm_domain_context_t *h) { RTCState *s = domain_vrtc(d); + if ( !has_vrtc(d) ) + return -ENODEV; + spin_lock(&s->lock); /* Restore the registers */ @@ -780,6 +790,9 @@ void rtc_reset(struct domain *d) { RTCState *s = domain_vrtc(d); + if ( !has_vrtc(d) ) + return; + TRACE_0D(TRC_HVM_EMUL_RTC_STOP_TIMER); destroy_periodic_time(&s->pt); s->period = 0; @@ -790,6 +803,9 @@ void rtc_init(struct domain *d) { RTCState *s = domain_vrtc(d); + if ( !has_vrtc(d) ) + return; + spin_lock_init(&s->lock); init_timer(&s->update_timer, rtc_update_timer, s, smp_processor_id()); @@ -820,6 +836,9 @@ void rtc_deinit(struct domain *d) { RTCState *s = domain_vrtc(d); + if ( !has_vrtc(d) ) + return; + spin_barrier(&s->lock); TRACE_0D(TRC_HVM_EMUL_RTC_STOP_TIMER); @@ -833,6 +852,9 @@ void rtc_update_clock(struct domain *d) { RTCState *s = domain_vrtc(d); + if ( !has_vrtc(d) ) + return; + spin_lock(&s->lock); s->current_tm = gmtime(get_localtime(d)); spin_unlock(&s->lock); -- generated by git-patchbot for /home/xen/git/xen.git#master _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |