Index: lib/libkse/arch/ia64/include/atomic_ops.h =========================================================================== --- lib/libkse/arch/ia64/include/atomic_ops.h 2008/08/21 23:20:01 #3 +++ lib/libkse/arch/ia64/include/atomic_ops.h 2008/08/21 23:20:01 @@ -32,13 +32,13 @@ static inline void atomic_swap_int(volatile int *dst, int val, int *res) { - __asm("xchg4 %0=[%2],%1" : "=r"(*res) : "r"(val), "r"(dst)); + __asm __volatile("xchg4 %0=[%2],%1" : "=r"(*res) : "r"(val), "r"(dst)); } static inline void atomic_swap_long(volatile long *dst, long val, long *res) { - __asm("xchg8 %0=[%2],%1" : "=r"(*res) : "r"(val), "r"(dst)); + __asm __volatile("xchg8 %0=[%2],%1" : "=r"(*res) : "r"(val), "r"(dst)); } #define atomic_swap_ptr(d,v,r) \ Index: lib/libpam/libpam/Makefile =========================================================================== --- lib/libpam/libpam/Makefile 2008/08/21 23:20:01 #37 +++ lib/libpam/libpam/Makefile 2008/08/21 23:20:01 Index: lib/libpam/libpam/pam_debug_log.c =========================================================================== --- lib/libpam/libpam/pam_debug_log.c 2008/08/21 23:20:01 #9 +++ lib/libpam/libpam/pam_debug_log.c 2008/08/21 23:20:01 Index: lib/libpam/libpam/pam_std_option.c =========================================================================== --- lib/libpam/libpam/pam_std_option.c 2008/08/21 23:20:01 #7 +++ lib/libpam/libpam/pam_std_option.c 2008/08/21 23:20:01 Index: lib/libpam/libpam/security/pam_mod_misc.h =========================================================================== --- lib/libpam/libpam/security/pam_mod_misc.h 2008/08/21 23:20:01 #7 +++ lib/libpam/libpam/security/pam_mod_misc.h 2008/08/21 23:20:01 Index: sbin/mca/records/corrected_memory_error =========================================================================== Files /dev/null and sbin/mca/records/corrected_memory_error differ Index: sbin/mca/records/fatal_multi_device_error =========================================================================== Files /dev/null and sbin/mca/records/fatal_multi_device_error differ Index: sbin/mca/records/fatal_processor_error =========================================================================== Files /dev/null and sbin/mca/records/fatal_processor_error differ Index: sys/boot/ia64/common/bootinfo.c =========================================================================== --- sys/boot/ia64/common/bootinfo.c 2008/08/21 23:20:01 #3 +++ sys/boot/ia64/common/bootinfo.c 2008/08/21 23:20:01 @@ -292,5 +292,10 @@ addr = (addr + PAGE_MASK) & ~PAGE_MASK; bi.bi_kernend = addr; + if (ia64_pgtbl != NULL && ia64_pgtblsz != 0) { + bi.bi_pgtbl = (uintptr_t)ia64_pgtbl; + bi.bi_pgtblsz = ia64_pgtblsz; + } + return (ldr_bootinfo(&bi, bi_addr)); } Index: sys/boot/ia64/common/copy.c =========================================================================== --- sys/boot/ia64/common/copy.c 2008/08/21 23:20:01 #4 +++ sys/boot/ia64/common/copy.c 2008/08/21 23:20:01 @@ -32,19 +32,57 @@ #include "libia64.h" +uint64_t *ia64_pgtbl; +uint32_t ia64_pgtblsz; + static void * va2pa(vm_offset_t va, size_t *len) { uint64_t pa; + uint32_t idx, ofs; + /* Backward compatibility. */ if (va >= IA64_RR_BASE(7)) { pa = IA64_RR_MASK(va); return ((void *)pa); } - printf("\n%s: va=%lx, *len=%lx\n", __func__, va, *len); - *len = 0; - return (NULL); + printf("\n%s: va=%lx, *len=%lx: pa=", __func__, va, *len); + + /* We can not copy more than a page at a time. */ + if (*len > IA64_LVM_PAGE_SIZE) + *len = IA64_LVM_PAGE_SIZE; + + if (va < IA64_LVM_BASE) { + printf("\n%s: %lx: invalid loader virtual address\n", + __func__, va); + *len = 0; + return (NULL); + } + + va -= IA64_LVM_BASE; + idx = va >> IA64_LVM_PAGE_SHIFT; + if (idx >= (ia64_pgtblsz >> 3)) { + /* XXX We can extend the loader page table. */ + printf("\n%s: %lx: loader virtual address out of bounds\n", + __func__, va); + *len = 0; + return (NULL); + } + + ofs = va & IA64_LVM_PAGE_MASK; + pa = ia64_pgtbl[idx]; + if (pa == 0) { + pa = ldr_alloc(va - ofs, IA64_LVM_PAGE_SIZE); + if (pa == 0) { + *len = 0; + return (NULL); + } + ia64_pgtbl[idx] = pa; + } + *len -= ofs; + printf("%lx\n", pa + ofs); + return ((void *)(pa + ofs)); } ssize_t Index: sys/boot/ia64/common/libia64.h =========================================================================== --- sys/boot/ia64/common/libia64.h 2008/08/21 23:20:01 #2 +++ sys/boot/ia64/common/libia64.h 2008/08/21 23:20:01 @@ -36,7 +36,7 @@ * Portability functions provided by the loader * implementation specific to the platform. */ -extern uint64_t ldr_alloc(vm_offset_t); +extern uint64_t ldr_alloc(vm_offset_t, vm_size_t); extern int ldr_bootinfo(struct bootinfo *, uint64_t *); extern int ldr_enter(const char *); @@ -45,6 +45,9 @@ * and shared by all loader implementations. */ +extern uint64_t *ia64_pgtbl; +extern uint32_t ia64_pgtblsz; + extern int ia64_autoload(void); extern ssize_t ia64_copyin(const void *, vm_offset_t, size_t); Index: sys/boot/ia64/efi/efimd.c =========================================================================== --- sys/boot/ia64/efi/efimd.c 2008/08/21 23:20:01 #3 +++ sys/boot/ia64/efi/efimd.c 2008/08/21 23:20:01 @@ -48,7 +48,7 @@ static UINTN mapkey; uint64_t -ldr_alloc(vm_offset_t va) +ldr_alloc(vm_offset_t va, vm_size_t sz) { return (0); Index: sys/boot/ia64/ski/skimd.c =========================================================================== --- sys/boot/ia64/ski/skimd.c 2008/08/21 23:20:01 #1 +++ sys/boot/ia64/ski/skimd.c 2008/08/21 23:20:01 @@ -41,7 +41,7 @@ extern void sal_stub_init(void); uint64_t -ldr_alloc(vm_offset_t va) +ldr_alloc(vm_offset_t va, vm_size_t sz __unused) { if (va >= PHYS_SIZE) Index: sys/bsm/audit.h =========================================================================== --- sys/bsm/audit.h 2008/08/21 23:20:01 #13 +++ sys/bsm/audit.h 2008/08/21 23:20:01 Index: sys/bsm/audit_kevents.h =========================================================================== --- sys/bsm/audit_kevents.h 2008/08/21 23:20:01 #15 +++ sys/bsm/audit_kevents.h 2008/08/21 23:20:01 Index: sys/conf/ldscript.ia64 =========================================================================== --- sys/conf/ldscript.ia64 2008/08/21 23:20:01 #11 +++ sys/conf/ldscript.ia64 2008/08/21 23:20:01 @@ -3,7 +3,7 @@ OUTPUT_ARCH(ia64) ENTRY(__start) SEARCH_DIR(/usr/lib); -kernel_text = 0xe000000004000000; +kernel_text = 0xbffc000000000000; SECTIONS { /* Read-only sections, merged into text segment: */ Index: sys/ia64/include/bootinfo.h =========================================================================== --- sys/ia64/include/bootinfo.h 2008/08/21 23:20:01 #7 +++ sys/ia64/include/bootinfo.h 2008/08/21 23:20:01 @@ -30,7 +30,8 @@ uint64_t bi_magic; /* BOOTINFO_MAGIC */ #define BOOTINFO_MAGIC 0xdeadbeeffeedface uint64_t bi_version; /* version 1 */ - uint64_t bi_spare[6]; /* was: name of booted kernel */ + uint64_t bi_spare[5]; /* was: name of kernel */ + uint64_t bi_pgtbl; /* Loader page table PA.*/ uint64_t bi_hcdp; /* DIG64 HCDP table */ uint64_t bi_fpswa; /* FPSWA interface */ uint64_t bi_boothowto; /* value for boothowto */ @@ -39,7 +40,7 @@ uint64_t bi_memmap_size; /* size of EFI memory map */ uint64_t bi_memdesc_size; /* sizeof EFI memory desc */ uint32_t bi_memdesc_version; /* EFI memory desc version */ - uint32_t bi_spare2; + uint32_t bi_pgtblsz; /* Loader page table size. */ uint64_t bi_symtab; /* start of kernel sym table */ uint64_t bi_esymtab; /* end of kernel sym table */ uint64_t bi_kernend; /* end of kernel space */ Index: sys/ia64/include/vmparam.h =========================================================================== --- sys/ia64/include/vmparam.h 2008/08/21 23:20:01 #18 +++ sys/ia64/include/vmparam.h 2008/08/21 23:20:01 @@ -149,6 +149,20 @@ #define IA64_BACKINGSTORE IA64_RR_BASE(4) /* + * Parameters for loader virtual memory (LVM). The kernel, its modules and + * metadata are loaded in the LVM by the loader. The kernel is given the PA + * and size of the page table that provides the mapping of the LVM. + * With EFI pages 4KB in size and pointers 8 bytes wide, we have at least + * 512 entries in the page table. With a 2MB page size this gives us 1GB of + * LVM. Enough to pre-load a 700MB CD image. More LVM can be created by + * using multiple EFI pages for the page table. + */ +#define IA64_LVM_BASE 0xbffc000000000000 +#define IA64_LVM_PAGE_SHIFT 20 /* 1MB */ +#define IA64_LVM_PAGE_SIZE (1U<