From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= Subject: Re: [PATCH 1/6] x86/HVM: fix processing of RTC REG_B writes Date: Thu, 2 May 2013 10:07:21 +0200 Message-ID: <51821EB9.4040603@citrix.com> References: <517E94E602000078000D1AE7@nat28.tlf.novell.com> <517E970D02000078000D1B00@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <517E970D02000078000D1B00@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: George Dunlap , "Tim (Xen.org)" , xen-devel List-Id: xen-devel@lists.xenproject.org On 29/04/13 15:51, Jan Beulich wrote: > We must store the new values before calling rtc_update_irq(), and we > need to call rtc_timer_update() when PIE transitions from 0 to 1 (as we > may have previously turned off the periodic timer due to the guest not > reading REG_C, and hence may have to re-enable it in order to start > IRQs getting delivered to the guest). > = > Signed-off-by: Jan Beulich Tested-by: Roger Pau Monn=E9 On FreeBSD > = > --- a/xen/arch/x86/hvm/rtc.c > +++ b/xen/arch/x86/hvm/rtc.c > @@ -468,12 +468,14 @@ static int rtc_ioport_write(void *opaque > if ( orig & RTC_SET ) > rtc_set_time(s); > } > + s->hw.cmos_data[RTC_REG_B] =3D data; > /* > * If the interrupt is already set when the interrupt becomes > * enabled, raise an interrupt immediately. > */ > rtc_update_irq(s); > - s->hw.cmos_data[RTC_REG_B] =3D data; > + if ( (data & RTC_PIE) && !(orig & RTC_PIE) ) > + rtc_timer_update(s); > if ( (data ^ orig) & RTC_SET ) > check_update_timer(s); > if ( (data ^ orig) & (RTC_24H | RTC_DM_BINARY | RTC_SET) ) > = > = > =