Commit c9c9f146 authored by Andi Kleen's avatar Andi Kleen Committed by Linus Torvalds

[PATCH] Another x86-64 merge - make it boot again

This fixes a few x86-64 issues that have crept in and broke bootup.

 - Disable -funit-at-a-time. It breaks symbol exports with gcc 3.3.1-hammer.
 - Fix sched_clock to not access HPET.  The new scheduler uses it more
   extensively and it is not mapped early enough.  I opted to just
   disable the HPET access, because even a slightly non monotonous TSC
   should be accurate enough for scheduling purposes. 
 - Fixes for separate objdirs by Arnd Bergmann
 - Fix two warnings that have crept in
parent e9b22b65
......@@ -52,14 +52,14 @@ CFLAGS += -Wno-sign-compare
ifneq ($(CONFIG_X86_REMOTE_DEBUG),y)
CFLAGS += -fno-asynchronous-unwind-tables
endif
CFLAGS += $(call check_gcc,-funit-at-a-time,)
#CFLAGS += $(call check_gcc,-funit-at-a-time,)
head-y := arch/x86_64/kernel/head.o arch/x86_64/kernel/head64.o arch/x86_64/kernel/init_task.o
libs-y += arch/x86_64/lib/
core-y += arch/x86_64/kernel/ arch/x86_64/mm/
core-$(CONFIG_IA32_EMULATION) += arch/x86_64/ia32/
drivers-$(CONFIG_PCI) += arch/x86_64/pci/
drivers-$(CONFIG_PCI) += arch/i386/pci/
drivers-$(CONFIG_OPROFILE) += arch/x86_64/oprofile/
boot := arch/x86_64/boot
......
......@@ -98,4 +98,4 @@ zlilo: $(BOOTIMAGE)
if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi
install: $(BOOTIMAGE)
sh $(src)/install.sh $(KERNELRELEASE) $(BOOTIMAGE) System.map "$(INSTALL_PATH)"
sh $(srctree)/$(src)/install.sh $(KERNELRELEASE) $(BOOTIMAGE) System.map "$(INSTALL_PATH)"
......@@ -9,24 +9,19 @@ obj-y := process.o semaphore.o signal.o entry.o traps.o irq.o \
x8664_ksyms.o i387.o syscall.o vsyscall.o \
setup64.o bluesmoke.o bootflag.o e820.o reboot.o warmreboot.o
obj-$(CONFIG_MTRR) += mtrr/
obj-$(CONFIG_ACPI) += acpi/
obj-$(CONFIG_X86_MSR) += msr.o
obj-$(CONFIG_X86_CPUID) += cpuid.o
obj-$(CONFIG_SMP) += smp.o smpboot.o trampoline.o
obj-$(CONFIG_MTRR) += ../../i386/kernel/cpu/mtrr/
obj-$(CONFIG_ACPI) += acpi/
obj-$(CONFIG_X86_MSR) += msr.o
obj-$(CONFIG_X86_CPUID) += cpuid.o
obj-$(CONFIG_SMP) += smp.o smpboot.o trampoline.o
obj-$(CONFIG_X86_LOCAL_APIC) += apic.o nmi.o
obj-$(CONFIG_X86_IO_APIC) += io_apic.o mpparse.o
obj-$(CONFIG_SOFTWARE_SUSPEND) += suspend.o suspend_asm.o
obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
obj-$(CONFIG_GART_IOMMU) += pci-gart.o aperture.o
obj-$(CONFIG_DUMMY_IOMMU) += pci-nommu.o pci-dma.o
obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
obj-$(CONFIG_GART_IOMMU) += pci-gart.o aperture.o
obj-$(CONFIG_DUMMY_IOMMU) += pci-nommu.o pci-dma.o
obj-$(CONFIG_MODULES) += module.o
$(obj)/bootflag.c:
@ln -sf ../../i386/kernel/bootflag.c $(obj)/bootflag.c
$(obj)/cpuid.c:
@ln -sf ../../i386/kernel/cpuid.c $(obj)/cpuid.c
clean-files += bootflag.c cpuid.c
obj-$(CONFIG_MODULES) += module.o
bootflag-y += ../../i386/kernel/bootflag.o
cpuid-$(CONFIG_X86_CPUID) += ../../i386/kernel/cpuid.o
......@@ -374,10 +374,21 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
and could overflow, it may be better (but slower)to use an 64bit division. */
unsigned long long sched_clock(void)
{
unsigned long a;
unsigned long a = 0;
#if 0
/* Don't do a HPET read here. Using TSC always is much faster
and HPET may not be mapped yet when the scheduler first runs.
Disadvantage is a small drift between CPUs in some configurations,
but that should be tolerable. */
if (__vxtime.mode == VXTIME_HPET)
return (hpet_readl(HPET_COUNTER) * vxtime.quot) >> 32;
#endif
/* Could do CPU core sync here. Opteron can execute rdtsc speculatively,
which means it is not completely exact and may not be monotonous between
CPUs. But the errors should be too small to matter for scheduling
purposes. */
rdtscll(a);
return (a * vxtime.tsc_quot) >> 32;
......
......@@ -31,6 +31,7 @@
#include <asm/smp.h>
#include <asm/tlbflush.h>
#include <asm/proto.h>
#include <asm/kdebug.h>
void bust_spinlocks(int yes)
{
......
......@@ -57,7 +57,7 @@ static void flush_kernel_map(void *address)
/* is this worth it? */
int i;
for (i = 0; i < PAGE_SIZE; i += boot_cpu_data.x86_clflush_size)
asm volatile("clflush %0" :: "m" (address + i));
asm volatile("clflush (%0)" :: "r" (address + i));
} else
asm volatile("wbinvd":::"memory");
__flush_tlb_one(address);
......
......@@ -11,24 +11,9 @@ DRIVER_OBJS = $(addprefix ../../../drivers/oprofile/, \
event_buffer.o oprofile_files.o \
oprofilefs.o oprofile_stats.o \
timer_int.o )
oprofile-objs := $(DRIVER_OBJS) init.o
oprofile-$(CONFIG_X86_LOCAL_APIC) += nmi_int.o op_model_athlon.o
oprofile-$(CONFIG_X86_IO_APIC) += nmi_timer_int.o
INCL := $(obj)/op_counter.h $(obj)/op_x86_model.h
OPROFILE-y := init.o
OPROFILE-$(CONFIG_X86_LOCAL_APIC) += nmi_int.o op_model_athlon.o
OPROFILE-$(CONFIG_X86_IO_APIC) += nmi_timer_int.o
$(obj)/nmi_int.c: ${INCL}
@ln -sf ../../i386/oprofile/nmi_int.c $(obj)/nmi_int.c
$(obj)/op_model_athlon.c: ${INCL}
@ln -sf ../../i386/oprofile/op_model_athlon.c $(obj)/op_model_athlon.c
$(obj)/init.c: ${INCL}
@ln -sf ../../i386/oprofile/init.c $(obj)/init.c
$(obj)/nmi_timer_int.c: ${INCL}
@ln -sf ../../i386/oprofile/nmi_timer_int.c $(obj)/nmi_timer_int.c
$(obj)/op_counter.h:
@ln -sf ../../i386/oprofile/op_counter.h $(obj)/op_counter.h
$(obj)/op_x86_model.h:
@ln -sf ../../i386/oprofile/op_x86_model.h $(obj)/op_x86_model.h
clean-files += op_x86_model.h op_counter.h init.c \
op_model_athlon.c nmi_int.c nmi_timer_int.c
oprofile-y = $(DRIVER_OBJS) $(addprefix ../../i386/oprofile/, $(OPROFILE-y))
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment