From: "Jan Beulich" Subject: Re: [PATCH v3 05/11] hvm/hpet: In hpet_save, correctly compute mc64. Date: Wed, 23 Apr 2014 16:12:45 +0100 Message-ID: <5357F48D020000780000BA3C@nat28.tlf.novell.com> References: <1397756585-27091-1-git-send-email-dslutz@verizon.com> <1397756585-27091-6-git-send-email-dslutz@verizon.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1397756585-27091-6-git-send-email-dslutz@verizon.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Don Slutz Cc: Keir Fraser , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org >>> On 17.04.14 at 19:42, wrote: > When the master clock is not enabled, mc64 has the right value. > > Basicly do the same thing as hpet_read_maincounter(). > > Signed-off-by: Don Slutz Reviewed-by: Jan Beulich > xen/arch/x86/hvm/hpet.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/xen/arch/x86/hvm/hpet.c b/xen/arch/x86/hvm/hpet.c > index c64c547..0789947 100644 > --- a/xen/arch/x86/hvm/hpet.c > +++ b/xen/arch/x86/hvm/hpet.c > @@ -499,7 +499,8 @@ static int hpet_save(struct domain *d, > hvm_domain_context_t *h) > spin_lock(&hp->lock); > > /* Write the proper value into the main counter */ > - hp->hpet.mc64 = hp->mc_offset + guest_time_hpet(hp); > + if ( hpet_enabled(hp) ) > + hp->hpet.mc64 = hp->mc_offset + guest_time_hpet(hp); > > /* Save the HPET registers */ > rc = _hvm_init_entry(h, HVM_SAVE_CODE(HPET), 0, HVM_SAVE_LENGTH(HPET)); > -- > 1.8.4