[haiku-development] [patch] x86: AMD C1E with no ARAT(Always Running APIC Timer) idle support

  • From: Yongcong Du <ycdu.vmcore@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Sat, 7 Apr 2012 16:21:08 +0800

Dear list,

In my gsoc proposal, I mentioned the local APIC timer issue--APIC timers
may be shutdown when entering deeper C-States. For intel CPUs, this issue
will only happen after we adds the so called cpuidle support. But for AMD
CPUs, I think we already have this problem. Please refer to
http://dev.haiku-os.org/ticket/8111 for details. But I'm not sure whether
the root cause of #8111 is the APIC issue.

Hi Luposian,
Would you please help to try the patch?

Thanks in advance,
Yongcong

The patch is attached. Here is the copied commit msg.

commit 694ea35b57f0e2d11b5b567e46baff10e488ae30
Author: Yongcong Du <ycdu.vmcore@xxxxxxxxx>
Date:   Sat Apr 7 16:07:29 2012 +0800

    x86: AMD C1E with no ARAT(Always Running APIC Timer) idle support

    AMD C1E is a BIOS controlled C3 state. Certain processors families
    may cut off TSC and the lapic timer when it is in a deep C state,
    including C1E state, thus the cpu can't be waken up and system will
hang.

    This patch firstly adds the support of idle selection during boot. Then
    it implemnts amdc1e_noarat_idle() routine which checks the MSR which
    contains the C1eOnCmpHalt (bit 28) and SmiOnCmpHalt (bit 27)  before
    executing the halt instruction, then clear them once set.

    This patch may fix http://dev.haiku-os.org/ticket/8111

    References:
    BIOS and Kernel Developer's Guide for AMD NPT Family 0Fh Processors

Other related posts: