From: Tim Deegan <tim@xen.org>
To: Jan Beulich <JBeulich@suse.com>
Cc: suravee.suthikulpanit@amd.com, xen-devel@lists.xen.org
Subject: Re: [PATCH 1/4] x86/hvm: Centralize and simplify the RTC IRQ logic.
Date: Thu, 28 Mar 2013 14:08:48 +0000 [thread overview]
Message-ID: <20130328140848.GI23950@ocelot.phlegethon.org> (raw)
In-Reply-To: <5154588502000078000C94BC@nat28.tlf.novell.com>
At 13:49 +0000 on 28 Mar (1364478581), Jan Beulich wrote:
> >>> On 28.03.13 at 14:22, Tim Deegan <tim@xen.org> wrote:
> > Signed-off-by: Tim Deegan <tim@xen.org>
> > ---
> > xen/arch/x86/hvm/rtc.c | 43 ++++++++++++++++++++++---------------------
> > 1 file changed, 22 insertions(+), 21 deletions(-)
> >
> > diff --git a/xen/arch/x86/hvm/rtc.c b/xen/arch/x86/hvm/rtc.c
> > index c1e09d8..368d3c8 100644
> > --- a/xen/arch/x86/hvm/rtc.c
> > +++ b/xen/arch/x86/hvm/rtc.c
> > @@ -50,14 +50,26 @@ static void rtc_set_time(RTCState *s);
> > static inline int from_bcd(RTCState *s, int a);
> > static inline int convert_hour(RTCState *s, int hour);
> >
> > -static void rtc_toggle_irq(RTCState *s)
> > +static void rtc_update_irq(RTCState *s)
> > {
> > struct domain *d = vrtc_domain(s);
> > + uint8_t irqf;
> >
> > ASSERT(spin_is_locked(&s->lock));
> > - s->hw.cmos_data[RTC_REG_C] |= RTC_IRQF;
> > - hvm_isa_irq_deassert(d, RTC_IRQ);
> > - hvm_isa_irq_assert(d, RTC_IRQ);
> > +
> > + /* IRQ is raised if any of the sources is raised & enabled */
> > + irqf = (s->hw.cmos_data[RTC_REG_B]
> > + & s->hw.cmos_data[RTC_REG_C]
> > + & (RTC_PF|RTC_AF|RTC_UF))
> > + ? RTC_IRQF : 0;
> > +
> > + s->hw.cmos_data[RTC_REG_C] &= ~RTC_IRQF;
> > + s->hw.cmos_data[RTC_REG_C] |= irqf;
> > +
> > + if ( irqf )
> > + hvm_isa_irq_assert(d, RTC_IRQ);
> > + else
> > + hvm_isa_irq_deassert(d, RTC_IRQ);
>
> One fundamental question here is - do you or does anyone else
> know why originally the code did this odd looking assert-deassert
> sequence. I'm a little afraid that this change may cause observably
> different behavior. In particular, our ACPI MADT doesn't (and
> shouldn't) declare IRQ8 as level triggered, yet the way you change
> the code would seem to make the interrupt behave as if it was.
Hmm. I was following the spec for the MC146818A RTC chip, which is
pretty clearly level-triggered. Looking at the piix4 spec:
IRQ 8#. IRQ8# is always an active low edge triggered interrupt and can
not be modified by software.
I'm not sure why the original code always strobes the line.
Tim.
next prev parent reply other threads:[~2013-03-28 14:08 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-28 13:22 [PATCH 0/4] x86/hvm: RTC periodic timer adjustments Tim Deegan
2013-03-28 13:22 ` [PATCH 1/4] x86/hvm: Centralize and simplify the RTC IRQ logic Tim Deegan
2013-03-28 13:33 ` Andrew Cooper
2013-03-28 13:42 ` Tim Deegan
2013-03-28 13:49 ` Jan Beulich
2013-03-28 14:08 ` Tim Deegan [this message]
2013-03-28 14:22 ` Jan Beulich
2013-03-28 14:38 ` Tim Deegan
2013-03-28 15:19 ` Jan Beulich
2013-03-28 15:30 ` Tim Deegan
2013-03-28 15:41 ` Jan Beulich
2013-03-28 19:57 ` Keir Fraser
2013-03-28 13:22 ` [PATCH 2/4] x86/hvm: Run the RTC periodic timer on a consistent time series Tim Deegan
2013-03-28 13:27 ` Keir Fraser
2013-03-28 13:22 ` [PATCH 3/4] x86/hvm: Avoid needlessly resetting the periodic timer Tim Deegan
2013-03-28 13:41 ` Jan Beulich
2013-03-28 13:58 ` Tim Deegan
2013-03-28 13:22 ` [PATCH 4/4] x86/hvm: Let the guest miss a few ticks before resetting the timer Tim Deegan
2013-03-28 13:53 ` Jan Beulich
2013-03-28 14:42 ` Tim Deegan
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=20130328140848.GI23950@ocelot.phlegethon.org \
--to=tim@xen.org \
--cc=JBeulich@suse.com \
--cc=suravee.suthikulpanit@amd.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.