xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel List <xen-devel@lists.xen.org>,
	Jan Beulich <JBeulich@suse.com>
Subject: System Secondary HPETs
Date: Mon, 2 Jun 2014 18:08:30 +0100	[thread overview]
Message-ID: <538CAF8E.7070400@citrix.com> (raw)

Recently, I debugged an issue with a failure to kexec because the kdump
kernel could not connect up the timer interrupt through the IOAPIC.

In reality, the problem was not the interrupt routing, but that the
timer itself was not generating interrupts. , yet advertising it in the
DSDT as an HPET device.

The root problem is that the system is not advertising the primary HPET
in an HPET ACPI table...

[root@bear ~]# xl dmesg | grep -i hpet
(XEN) [    2.662941] CPUIDLE: disabled due to no HPET. Force enable with
'cpuidle'.

yet advertising it in the DSDT to dom0:

[root@bear ~]# dmesg | grep -i hpet
[    0.038884] pci 0000:00:1f.0: Force enabled HPET at 0xfed00000
[    0.053055] hpet clockevent registered
[    0.053055] HPET: 3 timers in total, 0 timers will be used for
per-cpu timer
[    0.053055] hpet0: at MMIO 0xfed00000, IRQs 2, 8, 0
[    0.053055] hpet0: 3 comparators, 64-bit 14.318180 MHz counter
[    0.155730] rtc_cmos 00:03: alarms up to one month, y3k, 114 bytes
nvram, hpet irqs

Device 00:1f.0 is "ISA bridge: Intel Corporation 631xESB/632xESB/3100
Chipset LPC Interface Controller (rev 09)"

Dom0 then configures the HPET for its own use, and disables legacy
broadcast mode.  When crashing, the kdump kernel no longer gets legacy
interrupts, as the HPET is still configured in oneshot mode for dom0. 
Booting dom0 with "hpet=disable" causes it to never reprogram the HPET
out of legacy broadcast mode, and allows the kdump kernel to function
correctly.

Clearly, one problem here is the firmware not writing a primary HPET
ACPI table, but this does highlight another problem.

There is no possible way dom0 could use any HPETs it finds; dom0 does
not control the IDTs or interrupt remapping tables.  Allowing dom0 to
program any of the HPETs can, at best, only result in spurious
interrupts from Xens point of view, and at worst, interrupt remapping
faults.

I believe that dom0 should never attempt to use any HPET it can find. 
It is less clear whether forwarding the details to Xen would be useful
or not.  The range itself cannot be protected as it is only 1K long, but
Xen might be able to retroactively enable cpuidle.  Having said that,
Xen's ability to use this particular HPET appears to be stunted
somewhat, given an AML enable bit which starts disabled.

~Andrew

             reply	other threads:[~2014-06-02 17:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-02 17:08 Andrew Cooper [this message]
2014-06-03  7:08 ` System Secondary HPETs Jan Beulich

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=538CAF8E.7070400@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.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 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).