linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [git pull] x86 arch fixes for v2.6.24
@ 2007-11-26 19:33 Ingo Molnar
  2007-11-26 21:42 ` [PATCH] x86: disable hpet legacy replacement for kexec OGAWA Hirofumi
  0 siblings, 1 reply; 6+ messages in thread
From: Ingo Molnar @ 2007-11-26 19:33 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel, Thomas Gleixner, H. Peter Anvin


Linus, please pull the latest x86 fixes for v2.6.24 tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86.git

small fixlets: regression fixes, build and boot fixes, an NTP API fix 
(acked by Ulrich), kernel version added to WARN_ON() for QA and an ACPI 
fix.

NOTE: this tree includes the following (unmodified) queue pushed out by 
Thomas:

   http://lkml.org/lkml/2007/11/17/84

if you already pulled Thomas's update then ignore this pull request and 
we'll send a new one once you have pushed out your latest tree.

	Ingo

------------------>
Alexey Starikovskiy (1):
      ACPI: Set max_cstate to 1 for early Opterons.

Andreas Herrmann (1):
      x86: correctly set UTS_MACHINE for "make ARCH=x86"

Andrew Morton (1):
      x86: fix kprobes_64.c inlining borkage

Arjan van de Ven (1):
      x86: printk kernel version in WARN_ON and other dump_stack users

Ingo Molnar (2):
      x86: turn off iommu merge by default
      x86: fix APIC related bootup crash on Athlon XP CPUs

John Stultz (1):
      time: add ADJ_OFFSET_SS_READ

Maciej W. Rozycki (1):
      x86: fix NMI watchdog & 'stopped time' problem

Michal Schmidt (1):
      pci: use pci=bfsort for HP DL385 G2, DL585 G2

Peter Zijlstra (1):
      lockdep: annotate do_debug() trap handler

Theodore Ts'o (1):
      x86: export the symbol empty_zero_page on the 32-bit x86 architecture

Thomas Gleixner (1):
      x86: fix ACPI compile for LOCAL_APIC=n

---
 arch/x86/Makefile               |    5 ++---
 arch/x86/kernel/apic_32.c       |    2 +-
 arch/x86/kernel/i386_ksyms_32.c |    2 ++
 arch/x86/kernel/io_apic_32.c    |   12 ++++++++++--
 arch/x86/kernel/kprobes_64.c    |    2 +-
 arch/x86/kernel/nmi_32.c        |    9 +++++++--
 arch/x86/kernel/pci-dma_64.c    |    2 +-
 arch/x86/kernel/traps_32.c      |    7 +++++++
 arch/x86/kernel/traps_64.c      |    9 +++++++++
 arch/x86/pci/common.c           |   16 ++++++++++++++++
 drivers/acpi/processor_idle.c   |    1 +
 include/asm-ia64/acpi.h         |    1 +
 include/asm-x86/acpi.h          |   27 +++++++++++++++++++++++++++
 include/asm-x86/apic_32.h       |    1 +
 include/linux/timex.h           |    1 +
 kernel/time/ntp.c               |    9 ++++++---
 16 files changed, 93 insertions(+), 13 deletions(-)

Index: linux-x86.q/arch/x86/Makefile
===================================================================
--- linux-x86.q.orig/arch/x86/Makefile
+++ linux-x86.q/arch/x86/Makefile
@@ -11,10 +11,9 @@ endif
 $(srctree)/arch/x86/Makefile%: ;
 
 ifeq ($(CONFIG_X86_32),y)
+        UTS_MACHINE := i386
         include $(srctree)/arch/x86/Makefile_32
 else
+        UTS_MACHINE := x86_64
         include $(srctree)/arch/x86/Makefile_64
 endif
-
-
-
Index: linux-x86.q/arch/x86/kernel/apic_32.c
===================================================================
--- linux-x86.q.orig/arch/x86/kernel/apic_32.c
+++ linux-x86.q/arch/x86/kernel/apic_32.c
@@ -789,7 +789,7 @@ void __init sync_Arb_IDs(void)
 	 * Unsupported on P4 - see Intel Dev. Manual Vol. 3, Ch. 8.6.1 And not
 	 * needed on AMD.
 	 */
-	if (modern_apic())
+	if (modern_apic() || boot_cpu_data.x86_vendor == X86_VENDOR_AMD)
 		return;
 	/*
 	 * Wait for idle.
Index: linux-x86.q/arch/x86/kernel/i386_ksyms_32.c
===================================================================
--- linux-x86.q.orig/arch/x86/kernel/i386_ksyms_32.c
+++ linux-x86.q/arch/x86/kernel/i386_ksyms_32.c
@@ -2,6 +2,7 @@
 #include <asm/semaphore.h>
 #include <asm/checksum.h>
 #include <asm/desc.h>
+#include <asm/pgtable.h>
 
 EXPORT_SYMBOL(__down_failed);
 EXPORT_SYMBOL(__down_failed_interruptible);
@@ -29,3 +30,4 @@ EXPORT_SYMBOL(__read_lock_failed);
 #endif
 
 EXPORT_SYMBOL(csum_partial);
+EXPORT_SYMBOL(empty_zero_page);
Index: linux-x86.q/arch/x86/kernel/io_apic_32.c
===================================================================
--- linux-x86.q.orig/arch/x86/kernel/io_apic_32.c
+++ linux-x86.q/arch/x86/kernel/io_apic_32.c
@@ -2166,6 +2166,10 @@ static inline void __init check_timer(vo
 {
 	int apic1, pin1, apic2, pin2;
 	int vector;
+	unsigned int ver;
+
+	ver = apic_read(APIC_LVR);
+	ver = GET_APIC_VERSION(ver);
 
 	/*
 	 * get/set the timer IRQ vector:
@@ -2179,11 +2183,15 @@ static inline void __init check_timer(vo
 	 * mode for the 8259A whenever interrupts are routed
 	 * through I/O APICs.  Also IRQ0 has to be enabled in
 	 * the 8259A which implies the virtual wire has to be
-	 * disabled in the local APIC.
+	 * disabled in the local APIC.  Finally timer interrupts
+	 * need to be acknowledged manually in the 8259A for
+	 * timer_interrupt() and for the i82489DX when using
+	 * the NMI watchdog.
 	 */
 	apic_write_around(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_EXTINT);
 	init_8259A(1);
-	timer_ack = 1;
+	timer_ack = !cpu_has_tsc;
+	timer_ack |= (nmi_watchdog == NMI_IO_APIC && !APIC_INTEGRATED(ver));
 	if (timer_over_8254 > 0)
 		enable_8259A_irq(0);
 
Index: linux-x86.q/arch/x86/kernel/kprobes_64.c
===================================================================
--- linux-x86.q.orig/arch/x86/kernel/kprobes_64.c
+++ linux-x86.q/arch/x86/kernel/kprobes_64.c
@@ -58,7 +58,7 @@ const int kretprobe_blacklist_size = ARR
 /*
  * returns non-zero if opcode modifies the interrupt flag.
  */
-static __always_inline int is_IF_modifier(kprobe_opcode_t *insn)
+static int __kprobes is_IF_modifier(kprobe_opcode_t *insn)
 {
 	switch (*insn) {
 	case 0xfa:		/* cli */
Index: linux-x86.q/arch/x86/kernel/nmi_32.c
===================================================================
--- linux-x86.q.orig/arch/x86/kernel/nmi_32.c
+++ linux-x86.q/arch/x86/kernel/nmi_32.c
@@ -25,6 +25,7 @@
 
 #include <asm/smp.h>
 #include <asm/nmi.h>
+#include <asm/timer.h>
 
 #include "mach_traps.h"
 
@@ -83,7 +84,7 @@ static int __init check_nmi_watchdog(voi
 
 	prev_nmi_count = kmalloc(NR_CPUS * sizeof(int), GFP_KERNEL);
 	if (!prev_nmi_count)
-		return -1;
+		goto error;
 
 	printk(KERN_INFO "Testing NMI watchdog ... ");
 
@@ -117,7 +118,7 @@ static int __init check_nmi_watchdog(voi
 	if (!atomic_read(&nmi_active)) {
 		kfree(prev_nmi_count);
 		atomic_set(&nmi_active, -1);
-		return -1;
+		goto error;
 	}
 	printk("OK.\n");
 
@@ -128,6 +129,10 @@ static int __init check_nmi_watchdog(voi
 
 	kfree(prev_nmi_count);
 	return 0;
+error:
+	timer_ack = !cpu_has_tsc;
+
+	return -1;
 }
 /* This needs to happen later in boot so counters are working */
 late_initcall(check_nmi_watchdog);
Index: linux-x86.q/arch/x86/kernel/pci-dma_64.c
===================================================================
--- linux-x86.q.orig/arch/x86/kernel/pci-dma_64.c
+++ linux-x86.q/arch/x86/kernel/pci-dma_64.c
@@ -12,7 +12,7 @@
 #include <asm/gart.h>
 #include <asm/calgary.h>
 
-int iommu_merge __read_mostly = 1;
+int iommu_merge __read_mostly = 0;
 EXPORT_SYMBOL(iommu_merge);
 
 dma_addr_t bad_dma_address __read_mostly;
Index: linux-x86.q/arch/x86/kernel/traps_32.c
===================================================================
--- linux-x86.q.orig/arch/x86/kernel/traps_32.c
+++ linux-x86.q/arch/x86/kernel/traps_32.c
@@ -283,6 +283,11 @@ void dump_stack(void)
 {
 	unsigned long stack;
 
+	printk("Pid: %d, comm: %.20s %s %s %.*s\n",
+		current->pid, current->comm, print_tainted(),
+		init_utsname()->release,
+		(int)strcspn(init_utsname()->version, " "),
+		init_utsname()->version);
 	show_trace(current, NULL, &stack);
 }
 
@@ -828,6 +833,8 @@ fastcall void __kprobes do_debug(struct 
 	unsigned int condition;
 	struct task_struct *tsk = current;
 
+	trace_hardirqs_fixup();
+
 	get_debugreg(condition, 6);
 
 	if (notify_die(DIE_DEBUG, "debug", regs, condition, error_code,
Index: linux-x86.q/arch/x86/kernel/traps_64.c
===================================================================
--- linux-x86.q.orig/arch/x86/kernel/traps_64.c
+++ linux-x86.q/arch/x86/kernel/traps_64.c
@@ -31,6 +31,7 @@
 #include <linux/uaccess.h>
 #include <linux/bug.h>
 #include <linux/kdebug.h>
+#include <linux/utsname.h>
 
 #if defined(CONFIG_EDAC)
 #include <linux/edac.h>
@@ -400,6 +401,12 @@ void show_stack(struct task_struct *tsk,
 void dump_stack(void)
 {
 	unsigned long dummy;
+
+	printk("Pid: %d, comm: %.20s %s %s %.*s\n",
+		current->pid, current->comm, print_tainted(),
+		init_utsname()->release,
+		(int)strcspn(init_utsname()->version, " "),
+		init_utsname()->version);
 	show_trace(NULL, NULL, &dummy);
 }
 
@@ -846,6 +853,8 @@ asmlinkage void __kprobes do_debug(struc
 	struct task_struct *tsk = current;
 	siginfo_t info;
 
+	trace_hardirqs_fixup();
+
 	get_debugreg(condition, 6);
 
 	if (notify_die(DIE_DEBUG, "debug", regs, condition, error_code,
Index: linux-x86.q/arch/x86/pci/common.c
===================================================================
--- linux-x86.q.orig/arch/x86/pci/common.c
+++ linux-x86.q/arch/x86/pci/common.c
@@ -315,6 +315,22 @@ static struct dmi_system_id __devinitdat
 		},
 	},
 #endif
+	{
+		.callback = set_bf_sort,
+		.ident = "HP ProLiant DL385 G2",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "HP"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant DL385 G2"),
+		},
+	},
+	{
+		.callback = set_bf_sort,
+		.ident = "HP ProLiant DL585 G2",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "HP"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant DL585 G2"),
+		},
+	},
 	{}
 };
 
Index: linux-x86.q/drivers/acpi/processor_idle.c
===================================================================
--- linux-x86.q.orig/drivers/acpi/processor_idle.c
+++ linux-x86.q/drivers/acpi/processor_idle.c
@@ -1658,6 +1658,7 @@ int __cpuinit acpi_processor_power_init(
 
 	if (!first_run) {
 		dmi_check_system(processor_power_dmi_table);
+		max_cstate = acpi_processor_cstate_check(max_cstate);
 		if (max_cstate < ACPI_C_STATES_MAX)
 			printk(KERN_NOTICE
 			       "ACPI: processor limited to max C-state %d\n",
Index: linux-x86.q/include/asm-ia64/acpi.h
===================================================================
--- linux-x86.q.orig/include/asm-ia64/acpi.h
+++ linux-x86.q/include/asm-ia64/acpi.h
@@ -94,6 +94,7 @@ ia64_acpi_release_global_lock (unsigned 
 #define acpi_noirq 0	/* ACPI always enabled on IA64 */
 #define acpi_pci_disabled 0 /* ACPI PCI always enabled on IA64 */
 #define acpi_strict 1	/* no ACPI spec workarounds on IA64 */
+#define acpi_processor_cstate_check(x) (x) /* no idle limits on IA64 :) */
 static inline void disable_acpi(void) { }
 
 const char *acpi_get_sysname (void);
Index: linux-x86.q/include/asm-x86/acpi.h
===================================================================
--- linux-x86.q.orig/include/asm-x86/acpi.h
+++ linux-x86.q/include/asm-x86/acpi.h
@@ -1,5 +1,32 @@
+#ifndef _ASM_X86_ACPI_H
+#define _ASM_X86_ACPI_H
+
 #ifdef CONFIG_X86_32
 # include "acpi_32.h"
 #else
 # include "acpi_64.h"
 #endif
+
+#include <asm/processor.h>
+
+/*
+ * Check if the CPU can handle C2 and deeper
+ */
+static inline unsigned int acpi_processor_cstate_check(unsigned int max_cstate)
+{
+	/*
+	 * Early models (<=5) of AMD Opterons are not supposed to go into
+	 * C2 state.
+	 *
+	 * Steppings 0x0A and later are good
+	 */
+	if (boot_cpu_data.x86 == 0x0F &&
+	    boot_cpu_data.x86_vendor == X86_VENDOR_AMD &&
+	    boot_cpu_data.x86_model <= 0x05 &&
+	    boot_cpu_data.x86_mask < 0x0A)
+		return 1;
+	else
+		return max_cstate;
+}
+
+#endif
Index: linux-x86.q/include/asm-x86/apic_32.h
===================================================================
--- linux-x86.q.orig/include/asm-x86/apic_32.h
+++ linux-x86.q/include/asm-x86/apic_32.h
@@ -120,6 +120,7 @@ extern int local_apic_timer_disabled;
 
 #else /* !CONFIG_X86_LOCAL_APIC */
 static inline void lapic_shutdown(void) { }
+#define local_apic_timer_c2_ok		1
 
 #endif /* !CONFIG_X86_LOCAL_APIC */
 
Index: linux-x86.q/include/linux/timex.h
===================================================================
--- linux-x86.q.orig/include/linux/timex.h
+++ linux-x86.q/include/linux/timex.h
@@ -137,6 +137,7 @@ struct timex {
 #define ADJ_TIMECONST		0x0020	/* pll time constant */
 #define ADJ_TICK		0x4000	/* tick value */
 #define ADJ_OFFSET_SINGLESHOT	0x8001	/* old-fashioned adjtime */
+#define ADJ_OFFSET_SS_READ	0xa001  /* read-only adjtime */
 
 /* xntp 3.4 compatibility names */
 #define MOD_OFFSET	ADJ_OFFSET
Index: linux-x86.q/kernel/time/ntp.c
===================================================================
--- linux-x86.q.orig/kernel/time/ntp.c
+++ linux-x86.q/kernel/time/ntp.c
@@ -249,10 +249,12 @@ int do_adjtimex(struct timex *txc)
 
 	/* Now we validate the data before disabling interrupts */
 
-	if ((txc->modes & ADJ_OFFSET_SINGLESHOT) == ADJ_OFFSET_SINGLESHOT)
+	if ((txc->modes & ADJ_OFFSET_SINGLESHOT) == ADJ_OFFSET_SINGLESHOT) {
 	  /* singleshot must not be used with any other mode bits */
-		if (txc->modes != ADJ_OFFSET_SINGLESHOT)
+		if (txc->modes != ADJ_OFFSET_SINGLESHOT &&
+					txc->modes != ADJ_OFFSET_SS_READ)
 			return -EINVAL;
+	}
 
 	if (txc->modes != ADJ_OFFSET_SINGLESHOT && (txc->modes & ADJ_OFFSET))
 	  /* adjustment Offset limited to +- .512 seconds */
@@ -372,7 +374,8 @@ int do_adjtimex(struct timex *txc)
 leave:	if ((time_status & (STA_UNSYNC|STA_CLOCKERR)) != 0)
 		result = TIME_ERROR;
 
-	if ((txc->modes & ADJ_OFFSET_SINGLESHOT) == ADJ_OFFSET_SINGLESHOT)
+	if ((txc->modes == ADJ_OFFSET_SINGLESHOT) ||
+			(txc->modes == ADJ_OFFSET_SS_READ))
 		txc->offset = save_adjust;
 	else
 		txc->offset = ((long)shift_right(time_offset, SHIFT_UPDATE)) *

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] x86: disable hpet legacy replacement for kexec
  2007-11-26 19:33 [git pull] x86 arch fixes for v2.6.24 Ingo Molnar
@ 2007-11-26 21:42 ` OGAWA Hirofumi
  2007-11-26 23:03   ` Ingo Molnar
                     ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: OGAWA Hirofumi @ 2007-11-26 21:42 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Linus Torvalds, linux-kernel, Thomas Gleixner, H. Peter Anvin

Hi,

This seems to introduced after 2.6.23, so if possible, I'd like to fix
before 2.6.24. What do you think the following?

Thanks.
-- 
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>


If HPET was enabled by pci quirks, we use i8253 as initial clockevent
because pci quirks doesn't run until pci is initialized.

The above means the kernel (or something) is assuming HPET legacy
replacement is disabled and can use i8253 at boot.

If we used kexec, it isn't true. So, this patch disables HPET legacy
replacement for kexec in machine_shutdown().

Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
---

 arch/x86/kernel/hpet.c      |   14 ++++++++++++++
 arch/x86/kernel/reboot_32.c |    4 ++++
 arch/x86/kernel/reboot_64.c |    4 ++++
 include/asm-x86/hpet.h      |    1 +
 4 files changed, 23 insertions(+)

diff -puN arch/x86/kernel/hpet.c~kexec-need-to-disable-hpet arch/x86/kernel/hpet.c
--- linux-2.6/arch/x86/kernel/hpet.c~kexec-need-to-disable-hpet	2007-11-24 09:38:23.000000000 +0900
+++ linux-2.6-hirofumi/arch/x86/kernel/hpet.c	2007-11-27 04:57:00.000000000 +0900
@@ -446,6 +446,20 @@ static __init int hpet_late_init(void)
 }
 fs_initcall(hpet_late_init);
 
+void hpet_disable(void)
+{
+	if (is_hpet_capable()) {
+		unsigned long cfg = hpet_readl(HPET_CFG);
+
+		if (hpet_legacy_int_enabled) {
+			cfg &= ~HPET_CFG_LEGACY;
+			hpet_legacy_int_enabled = 0;
+		}
+		cfg &= ~HPET_CFG_ENABLE;
+		hpet_writel(cfg, HPET_CFG);
+	}
+}
+
 #ifdef CONFIG_HPET_EMULATE_RTC
 
 /* HPET in LegacyReplacement Mode eats up RTC interrupt line. When, HPET
diff -puN arch/x86/kernel/reboot_32.c~kexec-need-to-disable-hpet arch/x86/kernel/reboot_32.c
--- linux-2.6/arch/x86/kernel/reboot_32.c~kexec-need-to-disable-hpet	2007-11-24 09:38:23.000000000 +0900
+++ linux-2.6-hirofumi/arch/x86/kernel/reboot_32.c	2007-11-27 04:57:50.000000000 +0900
@@ -11,6 +11,7 @@
 #include <linux/reboot.h>
 #include <asm/uaccess.h>
 #include <asm/apic.h>
+#include <asm/hpet.h>
 #include <asm/desc.h>
 #include "mach_reboot.h"
 #include <asm/reboot_fixups.h>
@@ -326,6 +327,9 @@ static void native_machine_shutdown(void
 #ifdef CONFIG_X86_IO_APIC
 	disable_IO_APIC();
 #endif
+#ifdef CONFIG_HPET_TIMER
+	hpet_disable();
+#endif
 }
 
 void __attribute__((weak)) mach_reboot_fixups(void)
diff -puN arch/x86/kernel/reboot_64.c~kexec-need-to-disable-hpet arch/x86/kernel/reboot_64.c
--- linux-2.6/arch/x86/kernel/reboot_64.c~kexec-need-to-disable-hpet	2007-11-24 09:38:23.000000000 +0900
+++ linux-2.6-hirofumi/arch/x86/kernel/reboot_64.c	2007-11-27 04:57:56.000000000 +0900
@@ -17,6 +17,7 @@
 #include <asm/pgtable.h>
 #include <asm/tlbflush.h>
 #include <asm/apic.h>
+#include <asm/hpet.h>
 #include <asm/gart.h>
 
 /*
@@ -113,6 +114,9 @@ void machine_shutdown(void)
 
 	disable_IO_APIC();
 
+#ifdef CONFIG_HPET_TIMER
+	hpet_disable();
+#endif
 	local_irq_restore(flags);
 
 	pci_iommu_shutdown();
diff -puN include/asm-x86/hpet.h~kexec-need-to-disable-hpet include/asm-x86/hpet.h
--- linux-2.6/include/asm-x86/hpet.h~kexec-need-to-disable-hpet	2007-11-24 09:38:23.000000000 +0900
+++ linux-2.6-hirofumi/include/asm-x86/hpet.h	2007-11-27 04:54:32.000000000 +0900
@@ -61,6 +61,7 @@ extern unsigned long force_hpet_address;
 extern int hpet_force_user;
 extern int is_hpet_enabled(void);
 extern int hpet_enable(void);
+extern void hpet_disable(void);
 extern unsigned long hpet_readl(unsigned long a);
 extern void force_hpet_resume(void);
 
_

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] x86: disable hpet legacy replacement for kexec
  2007-11-26 21:42 ` [PATCH] x86: disable hpet legacy replacement for kexec OGAWA Hirofumi
@ 2007-11-26 23:03   ` Ingo Molnar
  2007-11-27 18:17   ` Pallipadi, Venkatesh
  2007-12-02 16:40   ` [PATCH] x86: disable hpet legacy replacement for kdump OGAWA Hirofumi
  2 siblings, 0 replies; 6+ messages in thread
From: Ingo Molnar @ 2007-11-26 23:03 UTC (permalink / raw)
  To: OGAWA Hirofumi
  Cc: Linus Torvalds, linux-kernel, Thomas Gleixner, H. Peter Anvin


* OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> wrote:

> This seems to introduced after 2.6.23, so if possible, I'd like to fix 
> before 2.6.24. What do you think the following?

looks good to me - i've queued it up.

	Ingo

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [PATCH] x86: disable hpet legacy replacement for kexec
  2007-11-26 21:42 ` [PATCH] x86: disable hpet legacy replacement for kexec OGAWA Hirofumi
  2007-11-26 23:03   ` Ingo Molnar
@ 2007-11-27 18:17   ` Pallipadi, Venkatesh
  2007-12-02 16:40   ` [PATCH] x86: disable hpet legacy replacement for kdump OGAWA Hirofumi
  2 siblings, 0 replies; 6+ messages in thread
From: Pallipadi, Venkatesh @ 2007-11-27 18:17 UTC (permalink / raw)
  To: OGAWA Hirofumi, Ingo Molnar
  Cc: Linus Torvalds, linux-kernel, Thomas Gleixner, H. Peter Anvin


Ack.

Thanks,
Venki 

>-----Original Message-----
>From: linux-kernel-owner@vger.kernel.org 
>[mailto:linux-kernel-owner@vger.kernel.org] On Behalf Of OGAWA Hirofumi
>Sent: Monday, November 26, 2007 1:43 PM
>To: Ingo Molnar
>Cc: Linus Torvalds; linux-kernel@vger.kernel.org; Thomas 
>Gleixner; H. Peter Anvin
>Subject: [PATCH] x86: disable hpet legacy replacement for kexec
>
>Hi,
>
>This seems to introduced after 2.6.23, so if possible, I'd like to fix
>before 2.6.24. What do you think the following?
>
>Thanks.
>-- 
>OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
>
>
>If HPET was enabled by pci quirks, we use i8253 as initial clockevent
>because pci quirks doesn't run until pci is initialized.
>
>The above means the kernel (or something) is assuming HPET legacy
>replacement is disabled and can use i8253 at boot.
>
>If we used kexec, it isn't true. So, this patch disables HPET legacy
>replacement for kexec in machine_shutdown().
>
>Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
>---
>
> arch/x86/kernel/hpet.c      |   14 ++++++++++++++
> arch/x86/kernel/reboot_32.c |    4 ++++
> arch/x86/kernel/reboot_64.c |    4 ++++
> include/asm-x86/hpet.h      |    1 +
> 4 files changed, 23 insertions(+)
>
>diff -puN arch/x86/kernel/hpet.c~kexec-need-to-disable-hpet 
>arch/x86/kernel/hpet.c
>--- 
>linux-2.6/arch/x86/kernel/hpet.c~kexec-need-to-disable-hpet	
>2007-11-24 09:38:23.000000000 +0900
>+++ linux-2.6-hirofumi/arch/x86/kernel/hpet.c	2007-11-27 
>04:57:00.000000000 +0900
>@@ -446,6 +446,20 @@ static __init int hpet_late_init(void)
> }
> fs_initcall(hpet_late_init);
> 
>+void hpet_disable(void)
>+{
>+	if (is_hpet_capable()) {
>+		unsigned long cfg = hpet_readl(HPET_CFG);
>+
>+		if (hpet_legacy_int_enabled) {
>+			cfg &= ~HPET_CFG_LEGACY;
>+			hpet_legacy_int_enabled = 0;
>+		}
>+		cfg &= ~HPET_CFG_ENABLE;
>+		hpet_writel(cfg, HPET_CFG);
>+	}
>+}
>+
> #ifdef CONFIG_HPET_EMULATE_RTC
> 
> /* HPET in LegacyReplacement Mode eats up RTC interrupt line. 
>When, HPET
>diff -puN 
>arch/x86/kernel/reboot_32.c~kexec-need-to-disable-hpet 
>arch/x86/kernel/reboot_32.c
>--- 
>linux-2.6/arch/x86/kernel/reboot_32.c~kexec-need-to-disab
>le-hpet	2007-11-24 09:38:23.000000000 +0900
>+++ linux-2.6-hirofumi/arch/x86/kernel/reboot_32.c	
>2007-11-27 04:57:50.000000000 +0900
>@@ -11,6 +11,7 @@
> #include <linux/reboot.h>
> #include <asm/uaccess.h>
> #include <asm/apic.h>
>+#include <asm/hpet.h>
> #include <asm/desc.h>
> #include "mach_reboot.h"
> #include <asm/reboot_fixups.h>
>@@ -326,6 +327,9 @@ static void native_machine_shutdown(void
> #ifdef CONFIG_X86_IO_APIC
> 	disable_IO_APIC();
> #endif
>+#ifdef CONFIG_HPET_TIMER
>+	hpet_disable();
>+#endif
> }
> 
> void __attribute__((weak)) mach_reboot_fixups(void)
>diff -puN 
>arch/x86/kernel/reboot_64.c~kexec-need-to-disable-hpet 
>arch/x86/kernel/reboot_64.c
>--- 
>linux-2.6/arch/x86/kernel/reboot_64.c~kexec-need-to-disab
>le-hpet	2007-11-24 09:38:23.000000000 +0900
>+++ linux-2.6-hirofumi/arch/x86/kernel/reboot_64.c	
>2007-11-27 04:57:56.000000000 +0900
>@@ -17,6 +17,7 @@
> #include <asm/pgtable.h>
> #include <asm/tlbflush.h>
> #include <asm/apic.h>
>+#include <asm/hpet.h>
> #include <asm/gart.h>
> 
> /*
>@@ -113,6 +114,9 @@ void machine_shutdown(void)
> 
> 	disable_IO_APIC();
> 
>+#ifdef CONFIG_HPET_TIMER
>+	hpet_disable();
>+#endif
> 	local_irq_restore(flags);
> 
> 	pci_iommu_shutdown();
>diff -puN include/asm-x86/hpet.h~kexec-need-to-disable-hpet 
>include/asm-x86/hpet.h
>--- 
>linux-2.6/include/asm-x86/hpet.h~kexec-need-to-disable-hpet	
>2007-11-24 09:38:23.000000000 +0900
>+++ linux-2.6-hirofumi/include/asm-x86/hpet.h	2007-11-27 
>04:54:32.000000000 +0900
>@@ -61,6 +61,7 @@ extern unsigned long force_hpet_address;
> extern int hpet_force_user;
> extern int is_hpet_enabled(void);
> extern int hpet_enable(void);
>+extern void hpet_disable(void);
> extern unsigned long hpet_readl(unsigned long a);
> extern void force_hpet_resume(void);
> 
>_
>-
>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/
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] x86: disable hpet legacy replacement for kdump
  2007-11-26 21:42 ` [PATCH] x86: disable hpet legacy replacement for kexec OGAWA Hirofumi
  2007-11-26 23:03   ` Ingo Molnar
  2007-11-27 18:17   ` Pallipadi, Venkatesh
@ 2007-12-02 16:40   ` OGAWA Hirofumi
  2007-12-02 16:42     ` Ingo Molnar
  2 siblings, 1 reply; 6+ messages in thread
From: OGAWA Hirofumi @ 2007-12-02 16:40 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Linus Torvalds, linux-kernel, Thomas Gleixner, H. Peter Anvin

OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> writes:

> This seems to introduced after 2.6.23, so if possible, I'd like to fix
> before 2.6.24. What do you think the following?

The following patch fixes the kdump path. Please apply.
-- 
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>


    [PATCH] x86: disable hpet legacy replacement for kexec

Like the above patch, we should also add hpet_disable() for kdump.

Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
---

 arch/x86/kernel/crash.c |    4 ++++
 1 file changed, 4 insertions(+)

diff -puN arch/x86/kernel/crash.c~kdump-need-to-disable-hpet arch/x86/kernel/crash.c
--- linux-2.6/arch/x86/kernel/crash.c~kdump-need-to-disable-hpet	2007-11-29 12:21:55.000000000 +0900
+++ linux-2.6-hirofumi/arch/x86/kernel/crash.c	2007-11-29 12:34:21.000000000 +0900
@@ -22,6 +22,7 @@
 #include <asm/nmi.h>
 #include <asm/hw_irq.h>
 #include <asm/apic.h>
+#include <asm/hpet.h>
 #include <linux/kdebug.h>
 #include <asm/smp.h>
 
@@ -140,5 +141,8 @@ void machine_crash_shutdown(struct pt_re
 #if defined(CONFIG_X86_IO_APIC)
 	disable_IO_APIC();
 #endif
+#ifdef CONFIG_HPET_TIMER
+	hpet_disable();
+#endif
 	crash_save_cpu(regs, safe_smp_processor_id());
 }
_

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] x86: disable hpet legacy replacement for kdump
  2007-12-02 16:40   ` [PATCH] x86: disable hpet legacy replacement for kdump OGAWA Hirofumi
@ 2007-12-02 16:42     ` Ingo Molnar
  0 siblings, 0 replies; 6+ messages in thread
From: Ingo Molnar @ 2007-12-02 16:42 UTC (permalink / raw)
  To: OGAWA Hirofumi
  Cc: Linus Torvalds, linux-kernel, Thomas Gleixner, H. Peter Anvin


* OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> wrote:

> OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> writes:
> 
> > This seems to introduced after 2.6.23, so if possible, I'd like to fix
> > before 2.6.24. What do you think the following?
> 
> The following patch fixes the kdump path. Please apply.

thanks, added.

	Ingo

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-12-02 16:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-26 19:33 [git pull] x86 arch fixes for v2.6.24 Ingo Molnar
2007-11-26 21:42 ` [PATCH] x86: disable hpet legacy replacement for kexec OGAWA Hirofumi
2007-11-26 23:03   ` Ingo Molnar
2007-11-27 18:17   ` Pallipadi, Venkatesh
2007-12-02 16:40   ` [PATCH] x86: disable hpet legacy replacement for kdump OGAWA Hirofumi
2007-12-02 16:42     ` Ingo Molnar

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).