Date: Wed, 5 Dec 2007 06:50:35 GMT From: Kip Macy <kmacy@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 130248 for review Message-ID: <200712050650.lB56oZEh041298@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=130248 Change 130248 by kmacy@entropy_kmacy_xen31 on 2007/12/05 06:49:52 import missing header files for xen_machdep.c make neccessary changes to get xen_machdep.c to build Affected files ... .. //depot/projects/xen31/sys/i386/include/cpufunc.h#2 edit .. //depot/projects/xen31/sys/i386/include/pmap.h#4 edit .. //depot/projects/xen31/sys/i386/include/xen/evtchn.h#1 add .. //depot/projects/xen31/sys/i386/include/xen/synch_bitops.h#1 add .. //depot/projects/xen31/sys/i386/include/xen/xen-os.h#2 edit .. //depot/projects/xen31/sys/i386/include/xen/xen-public/grant_table.h#2 edit .. //depot/projects/xen31/sys/i386/include/xen/xen-public/xen.h#2 edit .. //depot/projects/xen31/sys/i386/xen/xen_machdep.c#2 edit Differences ... ==== //depot/projects/xen31/sys/i386/include/cpufunc.h#2 (text+ko) ==== @@ -42,6 +42,18 @@ #error this file needs sys/cdefs.h as a prerequisite #endif +#ifdef XEN +#include <machine/psl.h> +#define NO_EXCHANGE +#include <machine/xen/xen-os.h> +#include <machine/xen/evtchn.h> +#include <vm/vm.h> +#include <vm/vm_page.h> +#include <machine/xen/xenpmap.h> +#include <machine/xen/xenvar.h> +struct thread; +#endif + struct region_descriptor; #define readb(va) (*(volatile u_int8_t *) (va)) ==== //depot/projects/xen31/sys/i386/include/pmap.h#4 (text+ko) ==== @@ -192,6 +192,7 @@ #ifdef XEN +#include <machine/xen/hypervisor-ifs.h> #include <machine/xen/xen-os.h> #include <machine/xen/xenvar.h> #include <machine/xen/xenpmap.h> @@ -202,6 +203,8 @@ #define FALSE 0 #endif +#define PG_KERNEL (PG_V | PG_A | PG_RW | PG_M) + static __inline vm_paddr_t pmap_kextract_ma(vm_offset_t va) { @@ -227,6 +230,26 @@ void pmap_map_readonly(struct pmap *pmap, vm_offset_t va, int len); void pmap_map_readwrite(struct pmap *pmap, vm_offset_t va, int len); +static __inline pt_entry_t +pte_load_clear(pt_entry_t *ptep) +{ + pt_entry_t r; + + r = PT_GET(ptep); + PT_CLEAR_VA(ptep, TRUE); + return (r); +} +static __inline pt_entry_t +pte_load_store(pt_entry_t *ptep, pt_entry_t v) +{ + pt_entry_t r; + r = PT_GET(ptep); + PT_SET_VA(ptep, v, TRUE); + return (r); +} + +#define pte_store(ptep, pte) pte_load_store((ptep), (pt_entry_t)pte) + #else /* * Routine: pmap_kextract @@ -338,7 +361,7 @@ *ptep = pte; } -#endif /* PAE */ +#endif /* !PAE */ #define pte_clear(ptep) pte_store((ptep), (pt_entry_t)0ULL) ==== //depot/projects/xen31/sys/i386/include/xen/xen-os.h#2 (text+ko) ==== @@ -12,7 +12,9 @@ #define NULL (void *)0 #endif +#ifndef PANIC_IF #define PANIC_IF(exp) if (unlikely(exp)) {printk("panic - %s: %s:%d\n",#exp, __FILE__, __LINE__); panic("%s: %s:%d", #exp, __FILE__, __LINE__);} +#endif /* Somewhere in the middle of the GCC 2.96 development cycle, we implemented a mechanism by which the user can annotate likely branch directions and @@ -146,9 +148,15 @@ #define spin_unlock_irqrestore mtx_unlock_irqrestore +#ifndef mb #define mb() __asm__ __volatile__("lock; addl $0, 0(%%esp)": : :"memory") +#endif +#ifndef rmb #define rmb() mb() +#endif +#ifndef wmb #define wmb() barrier() +#endif #ifdef SMP #define smp_mb() mb() #define smp_rmb() rmb() @@ -217,7 +225,7 @@ * This operation is atomic and cannot be reordered. * It also implies a memory barrier. */ -static __inline__ int test_and_clear_bit(int nr, volatile void * addr) +static __inline int test_and_clear_bit(int nr, volatile void * addr) { int oldbit; @@ -228,12 +236,12 @@ return oldbit; } -static __inline__ int constant_test_bit(int nr, const volatile void * addr) +static __inline int constant_test_bit(int nr, const volatile void * addr) { return ((1UL << (nr & 31)) & (((const volatile unsigned int *) addr)[nr >> 5])) != 0; } -static __inline__ int variable_test_bit(int nr, volatile void * addr) +static __inline int variable_test_bit(int nr, volatile void * addr) { int oldbit; ==== //depot/projects/xen31/sys/i386/include/xen/xen-public/grant_table.h#2 (text+ko) ==== @@ -235,11 +235,11 @@ #define GNTTABOP_transfer 4 typedef struct gnttab_transfer { /* IN parameters. */ - unsigned long mfn; - domid_t domid; - grant_ref_t ref; + xen_pfn_t mfn; + domid_t domid; + grant_ref_t ref; /* OUT parameters. */ - int16_t status; + int16_t status; } gnttab_transfer_t; DEFINE_GUEST_HANDLE(gnttab_transfer_t); ==== //depot/projects/xen31/sys/i386/include/xen/xen-public/xen.h#2 (text+ko) ==== @@ -19,6 +19,8 @@ #error "Unsupported architecture" #endif +typedef unsigned long xen_pfn_t; + /* * XEN "SYSTEM CALLS" (a.k.a. HYPERCALLS). */ @@ -406,8 +408,16 @@ uint32_t flags; /* SIF_xxx flags. */ unsigned long store_mfn; /* MACHINE page number of shared page. */ uint32_t store_evtchn; /* Event channel for store communication. */ - unsigned long console_mfn; /* MACHINE address of console page. */ - uint32_t console_evtchn; /* Event channel for console messages. */ + union { + struct { + xen_pfn_t mfn; /* MACHINE page number of console page. */ + uint32_t evtchn; /* Event channel for console page. */ + } domU; + struct { + uint32_t info_off; /* Offset of console_info struct. */ + uint32_t info_size; /* Size of console_info struct from start.*/ + } dom0; + } console; /* THE FOLLOWING ARE ONLY FILLED IN ON INITIAL BOOT (NOT RESUME). */ unsigned long pt_base; /* VIRTUAL address of page directory. */ unsigned long nr_pt_frames; /* Number of bootstrap p.t. frames. */ ==== //depot/projects/xen31/sys/i386/xen/xen_machdep.c#2 (text+ko) ==== @@ -59,6 +59,10 @@ #include <machine/xen/xenfunc.h> #include <machine/xen/xen-public/memory.h> +#ifdef SMP +#include <machine/privatespace.h> +#endif + #define IDTVEC(name) __CONCAT(X,name) extern inthand_t @@ -787,18 +791,19 @@ cur_space += PAGE_SIZE; console_page = (char *)cur_space; PT_SET_MA(console_page, - (xen_start_info->console_mfn << PAGE_SHIFT)| PG_KERNEL); + (xen_start_info->console.domU.mfn << PAGE_SHIFT)| PG_KERNEL); cur_space += PAGE_SIZE; printk("#5\n"); HYPERVISOR_shared_info->arch.pfn_to_mfn_frame_list_list = (unsigned long)xen_phys_machine; -#ifdef SMP +#if 0 && defined(SMP) for (i = 0; i < ncpus; i++) { - int npages = (sizeof(struct privatespace) + 1)/PAGE_SIZE; + int j, npages = (sizeof(struct privatespace) + 1)/PAGE_SIZE; + for (j = 0; j < npages; j++) { - vm_paddr_t ma = xpmap_ptom(tmpindex << PAGE_SHIFT); - tmpindex++; + vm_paddr_t ma = xpmap_ptom(cur_space); + cur_space += PAGE_SIZE; PT_SET_VA_MA(SMPpt + i*npages + j, ma | PG_KERNEL, FALSE); } } @@ -1007,7 +1012,7 @@ pmap_kremove(HYPERVISOR_shared_info); xen_start_info->store_mfn = mfn_to_pfn(xen_start_info->store_mfn); - xen_start_info->console_mfn = mfn_to_pfn(xen_start_info->console_mfn); + xen_start_info->console.domU.mfn = mfn_to_pfn(xen_start_info->console.domU.mfn); /* * We'll stop somewhere inside this hypercall. When it returns,
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200712050650.lB56oZEh041298>