Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758065AbYAKCVZ (ORCPT ); Thu, 10 Jan 2008 21:21:25 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754329AbYAKCVS (ORCPT ); Thu, 10 Jan 2008 21:21:18 -0500 Received: from smtp-out.google.com ([216.239.45.13]:23723 "EHLO smtp-out.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754304AbYAKCVQ (ORCPT ); Thu, 10 Jan 2008 21:21:16 -0500 DomainKey-Signature: a=rsa-sha1; s=beta; d=google.com; c=nofws; q=dns; h=received:message-id:date:from:to:subject:in-reply-to: mime-version:content-type:references; b=k85pFtfnVra+7RebI6dzYw2eeok1chMm7xCd+eSuUTUg+NhqP91R0fiMJCRkN87qL RjsxvgGBOXJ+7Xb1QgMYw== Message-ID: <3f1a065b0801101821k71ea7523l5024f12abb50357f@mail.gmail.com> Date: Thu, 10 Jan 2008 18:21:09 -0800 From: "Russell Leidich" To: "Andi Kleen" , "Torsten Kaiser" , "Andrew Morton" , linux-kernel@vger.kernel.org, "Thomas Gleixner" , "Ingo Molnar" , valdis.kletnieks@vt.edu, "Tim Hockin" Subject: Re: [PATCH] AMD Thermal Interrupt Support In-Reply-To: <20080109023714.GK2117@one.firstfloor.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_31211_8830148.1200018069453" References: <3f1a065b0801021350x7fd065fbj9680ce1a4f3c6538@mail.gmail.com> <3f1a065b0801041333x579d0a8fs9c5535f95dd56015@mail.gmail.com> <20080104222637.GA19248@one.firstfloor.org> <3f1a065b0801041653y77c27a8cvce703cb7d13e10a0@mail.gmail.com> <20080105132402.GA705@one.firstfloor.org> <3f1a065b0801051208y7e832e8ctda61f28e6328dec3@mail.gmail.com> <3f1a065b0801081542p6cca6249g35e83f7e1f450fbd@mail.gmail.com> <20080108235212.GE2117@one.firstfloor.org> <3f1a065b0801081828y4b084a52g1db9bcb8821cb3da@mail.gmail.com> <20080109023714.GK2117@one.firstfloor.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 19203 Lines: 276 ------=_Part_31211_8830148.1200018069453 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline All, Here's the hopefully-final version of the patch, which I have just tested on Intel and AMD. In my AMD test, I happened to discover that although MCEs were being logged, the MCE counter at /sys/devices/system/cpu/cpu(whatever)/thermal_throttle/count was not being updated. I fixed this by (1) moving smp_thermal_init from late_initcall to device_initcall in mce_amd_64.c (2) moving thermal_throttle_init_device from device_initcall to late_initcall in therm_throt.c. Thanks to Andi for his notes on how to hack up an indirect call in AT&T-style X86-64. To reiterate my earlier general description of the patch: This patch adds thermal machine check event (MCE) support to AMD Barcelona (and probably later, if new PCI IDs are added to k8_northbridges[]), styled after the same in the Intel code. The initialization consists of 3 parts: (1) northbridge, which enables the delivery of the interrupt to the local APIC, (2) APIC, which enables delivery to X86, and (3) hotplug support in threshold_cpu_callback(), which accomplishes #2 for CPUs which (re)enter the OS later. Whenever the temperature reaches the throttling threshold programmed into a northbridge register (by the BIOS -- my code doesn't change this value), a thermal interrupt is delivered. The interrupt is delivered to the vector specified in the thermal APIC register at (APIC_BASE + 0x330), which is identical to Intel. Because the vector register is the same between both architectures, and because I don't know which brand of CPU is present until runtime (if either), thermal_interrupt in entry_64.S will branch to smp_thermal_interrupt in mce_thermal.c. In turn, smp_thermal_interrupt will branch to the CPU-specific code for handling the interrupt. (Apart from the common vector location, AMD and Intel use radically different architectures for the purpose of reporting throttling events.) At that point, an MCE is logged if and only if the temperature has made a low-to-high transition. Rate limiting is employed so as not to spam the log. -- Russell Leidich ------=_Part_31211_8830148.1200018069453 Content-Type: text/plain; name=patch.txt Content-Transfer-Encoding: base64 X-Attachment-Id: f_fba3grlg0 Content-Disposition: attachment; filename=patch.txt U2lnbmVkLW9mZi1ieTogUnVzc2VsbCBMZWlkaWNoIDxybW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aG9sZF9pbnRlcnJ1cHQpCg== ------=_Part_31211_8830148.1200018069453-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/