From: BitKeeper B. <ri...@su...> - 2005-02-14 13:01:09
|
ChangeSet 1.1202, 2005/02/14 12:25:30+00:00, ia...@fr... Major ia64 update -- now boots dom0. Signed-off-by: dan...@hp... Signed-off-by: ian...@cl... Makefile | 4 arch/ia64/Makefile | 55 + arch/ia64/Rules.mk | 33 arch/ia64/acpi.c | 685 +++++++++++++ arch/ia64/asm-offsets.c | 224 ++++ arch/ia64/dom0_ops.c | 57 + arch/ia64/dom_fw.c | 511 ++++++++++ arch/ia64/domain.c | 689 ++++++++++++++ arch/ia64/idle0_task.c | 58 + arch/ia64/irq.c | 1517 +++++++++++++++++++++++++++++++ arch/ia64/lib/Makefile | 44 arch/ia64/mm_init.c | 724 ++++++++++++++ arch/ia64/patch/linux-2.6.7/bootmem.h | 9 arch/ia64/patch/linux-2.6.7/current.h | 8 arch/ia64/patch/linux-2.6.7/efi.c | 47 arch/ia64/patch/linux-2.6.7/efi.h | 10 arch/ia64/patch/linux-2.6.7/entry.S | 111 ++ arch/ia64/patch/linux-2.6.7/gcc_intrin.h | 15 arch/ia64/patch/linux-2.6.7/hardirq.h | 12 arch/ia64/patch/linux-2.6.7/head.S | 53 + arch/ia64/patch/linux-2.6.7/hpsim_irq.c | 20 arch/ia64/patch/linux-2.6.7/hpsim_ssc.h | 6 arch/ia64/patch/linux-2.6.7/hw_irq.h | 17 arch/ia64/patch/linux-2.6.7/ide.h | 8 arch/ia64/patch/linux-2.6.7/init_task.c | 26 arch/ia64/patch/linux-2.6.7/init_task.h | 29 arch/ia64/patch/linux-2.6.7/interrupt.h | 15 arch/ia64/patch/linux-2.6.7/io.h | 9 arch/ia64/patch/linux-2.6.7/irq.h | 8 arch/ia64/patch/linux-2.6.7/irq_ia64.c | 34 arch/ia64/patch/linux-2.6.7/ivt.S | 273 +++++ arch/ia64/patch/linux-2.6.7/kregs.h | 8 arch/ia64/patch/linux-2.6.7/lds.S | 14 arch/ia64/patch/linux-2.6.7/linuxtime.h | 24 arch/ia64/patch/linux-2.6.7/minstate.h | 8 arch/ia64/patch/linux-2.6.7/mm_bootmem.c | 65 + arch/ia64/patch/linux-2.6.7/mm_contig.c | 56 + arch/ia64/patch/linux-2.6.7/mmzone.h | 9 arch/ia64/patch/linux-2.6.7/page.h | 30 arch/ia64/patch/linux-2.6.7/page_alloc.c | 236 ++++ arch/ia64/patch/linux-2.6.7/processor.h | 14 arch/ia64/patch/linux-2.6.7/sal.h | 9 arch/ia64/patch/linux-2.6.7/setup.c | 74 + arch/ia64/patch/linux-2.6.7/slab.c | 105 ++ arch/ia64/patch/linux-2.6.7/slab.h | 9 arch/ia64/patch/linux-2.6.7/system.h | 27 arch/ia64/patch/linux-2.6.7/time.c | 176 +++ arch/ia64/patch/linux-2.6.7/tlb.c | 37 arch/ia64/patch/linux-2.6.7/types.h | 7 arch/ia64/patch/linux-2.6.7/unaligned.c | 69 + arch/ia64/patch/linux-2.6.7/wait.h | 19 arch/ia64/pdb-stub.c | 61 + arch/ia64/privop.c | 7 arch/ia64/process.c | 149 +-- arch/ia64/regionreg.c | 59 - arch/ia64/smp.c | 42 arch/ia64/smpboot.c | 2 arch/ia64/tools/README.xenia64 | 27 arch/ia64/tools/mkbuildtree | 290 +++++ arch/ia64/vcpu.c | 328 +++--- arch/ia64/vhpt.c | 70 + arch/ia64/xenasm.S | 20 arch/ia64/xenmisc.c | 239 ++++ arch/ia64/xensetup.c | 415 ++++++++ common/keyhandler.c | 2 include/acpi/acdispat.h | 10 include/acpi/acinterp.h | 4 include/acpi/aclocal.h | 2 include/acpi/acstruct.h | 2 include/asm-ia64/config.h | 267 +++++ include/asm-ia64/debugger.h | 40 include/asm-ia64/dom_fw.h | 119 ++ include/asm-ia64/domain.h | 101 ++ include/asm-ia64/ia64_int.h | 52 + include/asm-ia64/init.h | 29 include/asm-ia64/mm.h | 363 +++++++ include/asm-ia64/mmu_context.h | 19 include/asm-ia64/multicall.h | 5 include/asm-ia64/offsets.h | 2 include/asm-ia64/privop.h | 163 +++ include/asm-ia64/regionreg.h | 33 include/asm-ia64/regs.h | 2 include/asm-ia64/shadow.h | 3 include/asm-ia64/time.h | 1 include/asm-ia64/tlb.h | 37 include/asm-ia64/vcpu.h | 137 ++ include/asm-ia64/vhpt.h | 493 ++++++++++ include/asm-ia64/xenserial.h | 17 include/public/arch-ia64.h | 98 ++ include/xen/keyhandler.h | 2 90 files changed, 9731 insertions(+), 288 deletions(-) diff -Nru a/xen/Makefile b/xen/Makefile --- a/xen/Makefile 2005-02-14 08:00:56 -05:00 +++ b/xen/Makefile 2005-02-14 08:00:56 -05:00 @@ -77,9 +77,9 @@ @mv -f $@.new $@ tools/figlet/figlet: tools/figlet/figlet.o - $(CC) -o $@ $< + $(HOSTCC) -o $@ $< tools/figlet/figlet.o: tools/figlet/figlet.c - $(CC) -o $@ -c $< + $(HOSTCC) -o $@ -c $< include/xen/banner.h: tools/figlet/figlet tools/figlet/xen.flf tools/figlet/figlet -d tools/figlet Xen $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION) > $@.new diff -Nru a/xen/arch/ia64/Makefile b/xen/arch/ia64/Makefile --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/xen/arch/ia64/Makefile 2005-02-14 08:00:56 -05:00 @@ -0,0 +1,55 @@ +include $(BASEDIR)/Rules.mk + +# libs-y += arch/ia64/lib/lib.a + +OBJS = xensetup.o setup.o time.o irq.o ia64_ksyms.o process.o smp.o \ + xenmisc.o pdb-stub.o acpi.o \ + machvec.o dom0_ops.o domain.o \ + idle0_task.o pal.o hpsim.o efi.o efi_stub.o ivt.o mm_contig.o \ + mm_bootmem.o sal.o cmdline.o mm_init.o tlb.o page_alloc.o slab.o \ + regionreg.o entry.o unaligned.o privop.o vcpu.o \ + irq_ia64.o irq_lsapic.o hpsim_irq.o vhpt.o xenasm.o dom_fw.o +# perfmon.o +# unwind.o needed for kernel unwinding (rare) + +OBJS := $(subst $(TARGET_ARCH)/asm-offsets.o,,$(OBJS)) + +# remove following line if not privifying in memory +# OBJS += privify.o + +# What happens here? We link monitor object files together, starting +# at MONITOR_BASE (a very high address). But bootloader cannot put +# things there, so we initially load at LOAD_BASE. A hacky little +# tool called `elf-reloc' is used to modify segment offsets from +# MONITOR_BASE-relative to LOAD_BASE-relative. +# (NB. Linux gets round this by turning its image into raw binary, then +# wrapping that with a low-memory bootstrapper.) +default: $(OBJS) head.o ia64lib.o xen.lds.s + $(LD) -r -o arch.o $(OBJS) ia64lib.o + $(LD) $(LDFLAGS) -T $(BASEDIR)/arch/$(TARGET_ARCH)/xen.lds.s -N \ + -Map map.out head.o $(ALL_OBJS) -o $(TARGET)-syms + $(OBJCOPY) -R .note -R .comment -S $(TARGET)-syms $(TARGET) +# $(BASEDIR)/tools/elf-reloc $(MONITOR_BASE) $(LOAD_BASE) $(TARGET) + +asm-offsets.s: asm-offsets.c + $(CC) $(CFLAGS) -S -o $@ $< + +# I'm sure a Makefile wizard would know a better way to do this +xen.lds.s: xen.lds.S + $(CC) -E $(CPPFLAGS) -P -DXEN -D__ASSEMBLY__ \ + -o xen.lds.s xen.lds.S + +ia64lib.o: + $(MAKE) -C lib && cp lib/ia64lib.o . + +clean: + rm -f *.o *~ core xen.lds.s + $(MAKE) -C lib clean + +# setup.o contains bits of compile.h so it must be blown away +delete-unfresh-files: + echo any unfresh-files to delete for ia64\? +# rm -f setup.o + +.PHONY: default clean delete-unfresh-files + diff -Nru a/xen/arch/ia64/Rules.mk b/xen/arch/ia64/Rules.mk --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/xen/arch/ia64/Rules.mk 2005-02-14 08:00:56 -05:00 @@ -0,0 +1,33 @@ +######################################## +# x86-specific definitions + +ifeq ($(COMPILE_ARCH),$(TARGET_ARCH)) +OBJCOPY = objcopy +endif +ifneq ($(COMPILE_ARCH),$(TARGET_ARCH)) +CC = /usr/local/sp_env/v2.2/i686/bin/ia64-unknown-linux-gcc +LD = /usr/local/sp_env/v2.2/i686/bin/ia64-unknown-linux-ld +OBJCOPY = /usr/local/sp_env/v2.2/i686/bin/ia64-unknown-linux-objcopy +endif +HOSTCC := gcc +#LD := ld +# Linker should relocate monitor to this address +MONITOR_BASE := 0xFC500000 +# Bootloader should load monitor to this real address +LOAD_BASE := 0x00100000 +AFLAGS += -D__ASSEMBLY__ +CPPFLAGS += -I$(BASEDIR)/include -I$(BASEDIR)/include/asm-ia64 +CFLAGS := -nostdinc -fno-builtin -fno-common -fno-strict-aliasing +#CFLAGS += -O3 # -O3 over-inlines making debugging tough! +CFLAGS += -O2 # but no optimization causes compile errors! +CFLAGS += -iwithprefix include -Wall -DMONITOR_BASE=$(MONITOR_BASE) +CFLAGS += -fomit-frame-pointer -I$(BASEDIR)/include -D__KERNEL__ +CFLAGS += -I$(BASEDIR)/include/asm-ia64 +CFLAGS += -Wno-pointer-arith -Wredundant-decls +CFLAGS += -DIA64 -DXEN -DLINUX_2_6 +CFLAGS += -ffixed-r13 -mfixed-range=f12-f15,f32-f127 +CFLAGS += -w -g +#TARGET_CPU := i686 +#CFLAGS += -march=$(TARGET_CPU) +#LDARCHFLAGS := --oformat elf32-i386 +LDFLAGS := -g diff -Nru a/xen/arch/ia64/acpi.c b/xen/arch/ia64/acpi.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/xen/arch/ia64/acpi.c 2005-02-14 08:00:57 -05:00 @@ -0,0 +1,685 @@ +/* + * acpi.c - Architecture-Specific Low-Level ACPI Support + * + * Copyright (C) 2001, 2002 Paul Diefenbaugh <pau...@in...> + * Copyright (C) 2001 Jun Nakajima <jun...@in...> + * Copyright (C) 2001 Patrick Mochel <mo...@os...> + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + */ + +#include <xen/config.h> +#include <xen/kernel.h> +#include <xen/init.h> +#include <xen/types.h> +/*#include <xen/stddef.h>*/ +#include <xen/slab.h> +#include <xen/pci.h> +/*#include <xen/bootmem.h>*/ +#include <xen/irq.h> +#include <xen/acpi.h> +//#include <asm/mpspec.h> +#include <asm/io.h> +//#include <asm/apic.h> +//#include <asm/apicdef.h> +#include <asm/page.h> +/*#include <asm/pgtable.h>*/ +#include <asm/pgalloc.h> +//#include <asm/io_apic.h> +#include <asm/acpi.h> +/*#include <asm/save_state.h>*/ +//#include <asm/smpboot.h> + + +#define PREFIX "ACPI: " + +int acpi_lapic = 0; +int acpi_ioapic = 0; + +/* -------------------------------------------------------------------------- + Boot-time Configuration + -------------------------------------------------------------------------- */ + +#ifdef CONFIG_ACPI_BOOT +int acpi_noirq __initdata = 0; /* skip ACPI IRQ initialization */ +int acpi_ht __initdata = 1; /* enable HT */ + +enum acpi_irq_model_id acpi_irq_model; + + +/* + * Temporarily use the virtual area starting from FIX_IO_APIC_BASE_END, + * to map the target physical address. The problem is that set_fixmap() + * provides a single page, and it is possible that the page is not + * sufficient. + * By using this area, we can map up to MAX_IO_APICS pages temporarily, + * i.e. until the next __va_range() call. + * + * Important Safety Note: The fixed I/O APIC page numbers are *subtracted* + * from the fixed base. That's why we start at FIX_IO_APIC_BASE_END and + * count idx down while incrementing the phys address. + */ +char *__acpi_map_table(unsigned long phys, unsigned long size) +{ + unsigned long base, offset, mapped_size; + int idx; + + if (phys + size < 8*1024*1024) + return __va(phys); + + offset = phys & (PAGE_SIZE - 1); + mapped_size = PAGE_SIZE - offset; +#ifndef XEN +// where is FIX_ACPI_*? hack for now, FIXME later + set_fixmap(FIX_ACPI_END, phys); + base = fix_to_virt(FIX_ACPI_END); + + /* + * Most cases can be covered by the below. + */ + idx = FIX_ACPI_END; + while (mapped_size < size) { + if (--idx < FIX_ACPI_BEGIN) + return 0; /* cannot handle this */ + phys += PAGE_SIZE; + set_fixmap(idx, phys); + mapped_size += PAGE_SIZE; + } +#endif + + return ((unsigned char *) base + offset); +} + + +#ifdef CONFIG_X86_LOCAL_APIC + +static u64 acpi_lapic_addr __initdata = APIC_DEFAULT_PHYS_BASE; + + +static int __init +acpi_parse_madt ( + unsigned long phys_addr, + unsigned long size) +{ + struct acpi_table_madt *madt = NULL; + + if (!phys_addr || !size) + return -EINVAL; + + madt = (struct acpi_table_madt *) __acpi_map_table(phys_addr, size); + if (!madt) { + printk(KERN_WARNING PREFIX "Unable to map MADT\n"); + return -ENODEV; + } + + if (madt->lapic_address) + acpi_lapic_addr = (u64) madt->lapic_address; + + printk(KERN_INFO PREFIX "Local APIC address 0x%08x\n", + madt->lapic_address); |