ia64/xen-unstable
changeset 9005:0b0be946cf9c
[IA64] cleanup warning in xen/ia64 (arch/ia64/xen)
These patches fix many issue (ex. panic dom0, oops domU/dom0...).
we will fix compile warnnings one step at a time.
Signed-off-by: Tsunehisa Doi <doi.tsunehisa@jp.fujitsu.com>
Signed-off-by: Kouya SHIMURA <kouya@jp.fujitsu.com>
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
These patches fix many issue (ex. panic dom0, oops domU/dom0...).
we will fix compile warnnings one step at a time.
Signed-off-by: Tsunehisa Doi <doi.tsunehisa@jp.fujitsu.com>
Signed-off-by: Kouya SHIMURA <kouya@jp.fujitsu.com>
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
line diff
1.1 --- a/xen/arch/ia64/xen/acpi.c Tue Feb 28 10:26:43 2006 -0700 1.2 +++ b/xen/arch/ia64/xen/acpi.c Tue Feb 28 10:29:30 2006 -0700 1.3 @@ -178,7 +178,7 @@ acpi_parse_lapic_addr_ovr ( 1.4 1.5 if (lapic->address) { 1.6 iounmap((void *) ipi_base_addr); 1.7 - ipi_base_addr = (unsigned long) ioremap(lapic->address, 0); 1.8 + ipi_base_addr = (void __iomem *) ioremap(lapic->address, 0); 1.9 } 1.10 return 0; 1.11 } 1.12 @@ -265,7 +265,9 @@ acpi_parse_plat_int_src ( 1.13 acpi_table_entry_header *header, const unsigned long end) 1.14 { 1.15 struct acpi_table_plat_int_src *plintsrc; 1.16 +#if 0 1.17 int vector; 1.18 +#endif 1.19 1.20 plintsrc = (struct acpi_table_plat_int_src *) header; 1.21 1.22 @@ -369,9 +371,9 @@ acpi_parse_madt (unsigned long phys_addr 1.23 /* Get base address of IPI Message Block */ 1.24 1.25 if (acpi_madt->lapic_address) 1.26 - ipi_base_addr = (unsigned long) ioremap(acpi_madt->lapic_address, 0); 1.27 + ipi_base_addr = (void __iomem *) ioremap(acpi_madt->lapic_address, 0); 1.28 1.29 - printk(KERN_INFO PREFIX "Local APIC address 0x%lx\n", ipi_base_addr); 1.30 + printk(KERN_INFO PREFIX "Local APIC address %p\n", ipi_base_addr); 1.31 1.32 acpi_madt_oem_check(acpi_madt->header.oem_id, 1.33 acpi_madt->header.oem_table_id);
2.1 --- a/xen/arch/ia64/xen/dom0_ops.c Tue Feb 28 10:26:43 2006 -0700 2.2 +++ b/xen/arch/ia64/xen/dom0_ops.c Tue Feb 28 10:29:30 2006 -0700 2.3 @@ -17,6 +17,7 @@ 2.4 #include <xen/trace.h> 2.5 #include <xen/console.h> 2.6 #include <public/sched_ctl.h> 2.7 +#include <asm/vmx.h> 2.8 2.9 long arch_do_dom0_op(dom0_op_t *op, dom0_op_t *u_dom0_op) 2.10 { 2.11 @@ -143,7 +144,7 @@ long arch_do_dom0_op(dom0_op_t *op, dom0 2.12 n += j; 2.13 } 2.14 2.15 - free_xenheap_page((unsigned long)l_arr); 2.16 + free_xenheap_page((void *) l_arr); 2.17 2.18 put_domain(d); 2.19 } 2.20 @@ -160,7 +161,6 @@ long arch_do_dom0_op(dom0_op_t *op, dom0 2.21 unsigned long nr_pages = op->u.getmemlist.max_pfns & 0xffffffff; 2.22 unsigned long mfn; 2.23 unsigned long *buffer = op->u.getmemlist.buffer; 2.24 - struct page *page; 2.25 2.26 ret = -EINVAL; 2.27 if ( d != NULL )
3.1 --- a/xen/arch/ia64/xen/dom_fw.c Tue Feb 28 10:26:43 2006 -0700 3.2 +++ b/xen/arch/ia64/xen/dom_fw.c Tue Feb 28 10:29:30 2006 -0700 3.3 @@ -39,7 +39,8 @@ unsigned long dom_pa(unsigned long imva) 3.4 while(1); 3.5 } 3.6 if (imva - imva_fw_base > PAGE_SIZE) { 3.7 - printf("dom_pa: bad offset! imva=%p, imva_fw_base=%p (spinning...)\n",imva,imva_fw_base); 3.8 + printf("dom_pa: bad offset! imva=0x%lx, imva_fw_base=0x%lx (spinning...)\n", 3.9 + imva, imva_fw_base); 3.10 while(1); 3.11 } 3.12 return dom_fw_base_mpa + (imva - imva_fw_base); 3.13 @@ -48,31 +49,29 @@ unsigned long dom_pa(unsigned long imva) 3.14 // builds a hypercall bundle at domain physical address 3.15 void dom_efi_hypercall_patch(struct domain *d, unsigned long paddr, unsigned long hypercall) 3.16 { 3.17 - unsigned long imva; 3.18 + unsigned long *imva; 3.19 3.20 if (d == dom0) paddr += dom0_start; 3.21 - imva = domain_mpa_to_imva(d,paddr); 3.22 - build_hypercall_bundle(imva,d->arch.breakimm,hypercall,1); 3.23 + imva = (unsigned long *) domain_mpa_to_imva(d, paddr); 3.24 + build_hypercall_bundle(imva, d->arch.breakimm, hypercall, 1); 3.25 } 3.26 3.27 3.28 // builds a hypercall bundle at domain physical address 3.29 static void dom_fw_hypercall_patch(struct domain *d, unsigned long paddr, unsigned long hypercall,unsigned long ret) 3.30 { 3.31 - unsigned long imva; 3.32 + unsigned long *imva; 3.33 3.34 - imva = domain_mpa_to_imva(d,paddr); 3.35 - build_hypercall_bundle(imva,d->arch.breakimm,hypercall,ret); 3.36 + imva = (unsigned long *) domain_mpa_to_imva(d, paddr); 3.37 + build_hypercall_bundle(imva, d->arch.breakimm, hypercall, ret); 3.38 } 3.39 3.40 static void dom_fw_pal_hypercall_patch(struct domain *d, unsigned long paddr) 3.41 { 3.42 unsigned long *imva; 3.43 3.44 - imva = (unsigned long *)domain_mpa_to_imva(d,paddr); 3.45 - 3.46 - build_pal_hypercall_bundles (imva, d->arch.breakimm, 3.47 - FW_HYPERCALL_PAL_CALL); 3.48 + imva = (unsigned long *) domain_mpa_to_imva(d, paddr); 3.49 + build_pal_hypercall_bundles(imva, d->arch.breakimm, FW_HYPERCALL_PAL_CALL); 3.50 } 3.51 3.52 3.53 @@ -85,16 +84,14 @@ unsigned long dom_fw_setup(struct domain 3.54 3.55 dom_fw_base_mpa = 0; 3.56 if (d == dom0) dom_fw_base_mpa += dom0_start; 3.57 - imva_fw_base = domain_mpa_to_imva(d,dom_fw_base_mpa); 3.58 - bp = dom_fw_init(d,args,arglen,imva_fw_base,PAGE_SIZE); 3.59 - return dom_pa((unsigned long)bp); 3.60 + imva_fw_base = domain_mpa_to_imva(d, dom_fw_base_mpa); 3.61 + bp = dom_fw_init(d, args, arglen, (char *) imva_fw_base, PAGE_SIZE); 3.62 + return dom_pa((unsigned long) bp); 3.63 } 3.64 3.65 3.66 /* the following heavily leveraged from linux/arch/ia64/hp/sim/fw-emu.c */ 3.67 3.68 -#define MB (1024*1024UL) 3.69 - 3.70 #define NUM_EFI_SYS_TABLES 6 3.71 # define NUM_MEM_DESCS 5 3.72 3.73 @@ -256,7 +253,8 @@ sal_emulator (long index, unsigned long 3.74 if (((in1 & ~0xffffffffUL) && (in4 == 0)) || 3.75 (in4 > 1) || 3.76 (in2 > 8) || (in2 & (in2-1))) 3.77 - printf("*** SAL_PCI_CONF_WRITE?!?(adr=%p,typ=%p,sz=%p,val=%p)\n",in1,in4,in2,in3); 3.78 + printf("*** SAL_PCI_CONF_WRITE?!?(adr=0x%lx,typ=0x%lx,sz=0x%lx,val=0x%lx)\n", 3.79 + in1,in4,in2,in3); 3.80 // note that args are in a different order!! 3.81 status = ia64_sal_pci_config_write(in1,in4,in2,in3); 3.82 } 3.83 @@ -296,7 +294,7 @@ xen_pal_emulator(unsigned long index, un 3.84 long status = -1; 3.85 3.86 if (running_on_sim) return pal_emulator_static(index); 3.87 - printk("xen_pal_emulator: index=%d\n",index); 3.88 + printk("xen_pal_emulator: index=%lu\n", index); 3.89 // pal code must be mapped by a TR when pal is called, however 3.90 // calls are rare enough that we will map it lazily rather than 3.91 // at every context switch 3.92 @@ -312,10 +310,16 @@ xen_pal_emulator(unsigned long index, un 3.93 status = ia64_pal_proc_get_features(&r9,&r10,&r11); 3.94 break; 3.95 case PAL_BUS_GET_FEATURES: 3.96 - status = ia64_pal_bus_get_features(&r9,&r10,&r11); 3.97 + status = ia64_pal_bus_get_features( 3.98 + (pal_bus_features_u_t *) &r9, 3.99 + (pal_bus_features_u_t *) &r10, 3.100 + (pal_bus_features_u_t *) &r11); 3.101 break; 3.102 case PAL_FREQ_RATIOS: 3.103 - status = ia64_pal_freq_ratios(&r9,&r10,&r11); 3.104 + status = ia64_pal_freq_ratios( 3.105 + (struct pal_freq_ratio *) &r9, 3.106 + (struct pal_freq_ratio *) &r10, 3.107 + (struct pal_freq_ratio *) &r11); 3.108 break; 3.109 case PAL_PTCE_INFO: 3.110 { 3.111 @@ -326,7 +330,9 @@ xen_pal_emulator(unsigned long index, un 3.112 } 3.113 break; 3.114 case PAL_VERSION: 3.115 - status = ia64_pal_version(&r9,&r10); 3.116 + status = ia64_pal_version( 3.117 + (pal_version_u_t *) &r9, 3.118 + (pal_version_u_t *) &r10); 3.119 break; 3.120 case PAL_VM_PAGE_SIZE: 3.121 status = ia64_pal_vm_page_size(&r9,&r10); 3.122 @@ -341,13 +347,21 @@ xen_pal_emulator(unsigned long index, un 3.123 // FIXME: what should xen return for these, figure out later 3.124 // For now, linux does the right thing if pal call fails 3.125 // In particular, rid_size must be set properly! 3.126 - //status = ia64_pal_vm_summary(&r9,&r10); 3.127 + //status = ia64_pal_vm_summary( 3.128 + // (pal_vm_info_1_u_t *) &r9, 3.129 + // (pal_vm_info_2_u_t *) &r10); 3.130 break; 3.131 case PAL_RSE_INFO: 3.132 - status = ia64_pal_rse_info(&r9,&r10); 3.133 + status = ia64_pal_rse_info( 3.134 + &r9, 3.135 + (pal_hints_u_t *) &r10); 3.136 break; 3.137 case PAL_VM_INFO: 3.138 - status = ia64_pal_vm_info(in1,in2,&r9,&r10); 3.139 + status = ia64_pal_vm_info( 3.140 + in1, 3.141 + in2, 3.142 + (pal_tc_info_u_t *) &r9, 3.143 + &r10); 3.144 break; 3.145 case PAL_REGISTER_INFO: 3.146 status = ia64_pal_register_info(in1,&r9,&r10); 3.147 @@ -360,11 +374,12 @@ xen_pal_emulator(unsigned long index, un 3.148 case PAL_PERF_MON_INFO: 3.149 { 3.150 unsigned long pm_buffer[16]; 3.151 - int i; 3.152 - status = ia64_pal_perf_mon_info(pm_buffer,&r9); 3.153 + status = ia64_pal_perf_mon_info( 3.154 + pm_buffer, 3.155 + (pal_perf_mon_info_u_t *) &r9); 3.156 if (status != 0) { 3.157 while(1) 3.158 - printk("PAL_PERF_MON_INFO fails ret=%d\n",status); 3.159 + printk("PAL_PERF_MON_INFO fails ret=%ld\n", status); 3.160 break; 3.161 } 3.162 if (copy_to_user((void __user *)in1,pm_buffer,128)) { 3.163 @@ -409,7 +424,7 @@ xen_pal_emulator(unsigned long index, un 3.164 domain_shutdown (current->domain, 0); 3.165 break; 3.166 default: 3.167 - printk("xen_pal_emulator: UNIMPLEMENTED PAL CALL %d!!!!\n", 3.168 + printk("xen_pal_emulator: UNIMPLEMENTED PAL CALL %lu!!!!\n", 3.169 index); 3.170 break; 3.171 } 3.172 @@ -434,7 +449,7 @@ static u32 lsapic_flag=1; 3.173 3.174 /* Provide only one LP to guest */ 3.175 static int 3.176 -acpi_update_lsapic (acpi_table_entry_header *header) 3.177 +acpi_update_lsapic (acpi_table_entry_header *header, const unsigned long end) 3.178 { 3.179 struct acpi_table_lsapic *lsapic; 3.180 3.181 @@ -529,8 +544,8 @@ dom_fw_fake_acpi(struct fake_acpi_tables 3.182 strcpy(xsdt->asl_compiler_id, "XEN"); 3.183 xsdt->asl_compiler_revision = (XEN_VERSION<<16)|(XEN_SUBVERSION); 3.184 3.185 - xsdt->table_offset_entry[0] = dom_pa(fadt); 3.186 - tables->madt_ptr = dom_pa(madt); 3.187 + xsdt->table_offset_entry[0] = dom_pa((unsigned long) fadt); 3.188 + tables->madt_ptr = dom_pa((unsigned long) madt); 3.189 3.190 xsdt->checksum = generate_acpi_checksum(xsdt, xsdt->length); 3.191 3.192 @@ -547,8 +562,8 @@ dom_fw_fake_acpi(struct fake_acpi_tables 3.193 facs->version = 1; 3.194 facs->length = sizeof(struct facs_descriptor_rev2); 3.195 3.196 - fadt->xfirmware_ctrl = dom_pa(facs); 3.197 - fadt->Xdsdt = dom_pa(dsdt); 3.198 + fadt->xfirmware_ctrl = dom_pa((unsigned long) facs); 3.199 + fadt->Xdsdt = dom_pa((unsigned long) dsdt); 3.200 3.201 /* 3.202 * All of the below FADT entries are filled it to prevent warnings 3.203 @@ -558,15 +573,15 @@ dom_fw_fake_acpi(struct fake_acpi_tables 3.204 fadt->pm1_evt_len = 4; 3.205 fadt->xpm1a_evt_blk.address_space_id = ACPI_ADR_SPACE_SYSTEM_MEMORY; 3.206 fadt->xpm1a_evt_blk.register_bit_width = 8; 3.207 - fadt->xpm1a_evt_blk.address = dom_pa(&tables->pm1a_evt_blk); 3.208 + fadt->xpm1a_evt_blk.address = dom_pa((unsigned long) &tables->pm1a_evt_blk); 3.209 fadt->pm1_cnt_len = 1; 3.210 fadt->xpm1a_cnt_blk.address_space_id = ACPI_ADR_SPACE_SYSTEM_MEMORY; 3.211 fadt->xpm1a_cnt_blk.register_bit_width = 8; 3.212 - fadt->xpm1a_cnt_blk.address = dom_pa(&tables->pm1a_cnt_blk); 3.213 + fadt->xpm1a_cnt_blk.address = dom_pa((unsigned long) &tables->pm1a_cnt_blk); 3.214 fadt->pm_tm_len = 4; 3.215 fadt->xpm_tmr_blk.address_space_id = ACPI_ADR_SPACE_SYSTEM_MEMORY; 3.216 fadt->xpm_tmr_blk.register_bit_width = 8; 3.217 - fadt->xpm_tmr_blk.address = dom_pa(&tables->pm_tmr_blk); 3.218 + fadt->xpm_tmr_blk.address = dom_pa((unsigned long) &tables->pm_tmr_blk); 3.219 3.220 fadt->checksum = generate_acpi_checksum(fadt, fadt->length); 3.221 3.222 @@ -575,7 +590,7 @@ dom_fw_fake_acpi(struct fake_acpi_tables 3.223 strcpy(rsdp->oem_id, "XEN"); 3.224 rsdp->revision = 2; /* ACPI 2.0 includes XSDT */ 3.225 rsdp->length = sizeof(struct acpi20_table_rsdp); 3.226 - rsdp->xsdt_address = dom_pa(xsdt); 3.227 + rsdp->xsdt_address = dom_pa((unsigned long) xsdt); 3.228 3.229 rsdp->checksum = generate_acpi_checksum(rsdp, 3.230 ACPI_RSDP_CHECKSUM_LENGTH); 3.231 @@ -640,7 +655,7 @@ dom_fw_init (struct domain *d, char *arg 3.232 unsigned long maxmem = (d->max_pages - d->arch.sys_pgnr) * PAGE_SIZE; 3.233 const unsigned long start_mpaddr = ((d==dom0)?dom0_start:0); 3.234 3.235 -# define MAKE_MD(typ, attr, start, end, abs) \ 3.236 +# define MAKE_MD(typ, attr, start, end, abs) \ 3.237 do { \ 3.238 md = efi_memmap + i++; \ 3.239 md->type = typ; \ 3.240 @@ -669,7 +684,7 @@ dom_fw_init (struct domain *d, char *arg 3.241 sal_ed = (void *) cp; cp += sizeof(*sal_ed); 3.242 efi_memmap = (void *) cp; cp += NUM_MEM_DESCS*sizeof(*efi_memmap); 3.243 bp = (void *) cp; cp += sizeof(*bp); 3.244 - pfn = (void *) cp; cp += NFUNCPTRS * 2 * sizeof(pfn); 3.245 + pfn = (void *) cp; cp += NFUNCPTRS * 2 * sizeof(pfn); 3.246 cmd_line = (void *) cp; 3.247 3.248 if (args) { 3.249 @@ -690,19 +705,19 @@ dom_fw_init (struct domain *d, char *arg 3.250 cp += sizeof(FW_VENDOR) + (8-((unsigned long)cp & 7)); // round to 64-bit boundary 3.251 3.252 memcpy(fw_vendor,FW_VENDOR,sizeof(FW_VENDOR)); 3.253 - efi_systab->fw_vendor = dom_pa(fw_vendor); 3.254 + efi_systab->fw_vendor = dom_pa((unsigned long) fw_vendor); 3.255 3.256 efi_systab->fw_revision = 1; 3.257 - efi_systab->runtime = (void *) dom_pa(efi_runtime); 3.258 + efi_systab->runtime = (void *) dom_pa((unsigned long) efi_runtime); 3.259 efi_systab->nr_tables = NUM_EFI_SYS_TABLES; 3.260 - efi_systab->tables = dom_pa(efi_tables); 3.261 + efi_systab->tables = dom_pa((unsigned long) efi_tables); 3.262 3.263 efi_runtime->hdr.signature = EFI_RUNTIME_SERVICES_SIGNATURE; 3.264 efi_runtime->hdr.revision = EFI_RUNTIME_SERVICES_REVISION; 3.265 efi_runtime->hdr.headersize = sizeof(efi_runtime->hdr); 3.266 #define EFI_HYPERCALL_PATCH(tgt,call) do { \ 3.267 dom_efi_hypercall_patch(d,FW_HYPERCALL_##call##_PADDR,FW_HYPERCALL_##call); \ 3.268 - tgt = dom_pa(pfn); \ 3.269 + tgt = dom_pa((unsigned long) pfn); \ 3.270 *pfn++ = FW_HYPERCALL_##call##_PADDR + start_mpaddr; \ 3.271 *pfn++ = 0; \ 3.272 } while (0) 3.273 @@ -719,7 +734,7 @@ dom_fw_init (struct domain *d, char *arg 3.274 EFI_HYPERCALL_PATCH(efi_runtime->reset_system,EFI_RESET_SYSTEM); 3.275 3.276 efi_tables[0].guid = SAL_SYSTEM_TABLE_GUID; 3.277 - efi_tables[0].table = dom_pa(sal_systab); 3.278 + efi_tables[0].table = dom_pa((unsigned long) sal_systab); 3.279 for (i = 1; i < NUM_EFI_SYS_TABLES; i++) { 3.280 efi_tables[i].guid = NULL_GUID; 3.281 efi_tables[i].table = 0; 3.282 @@ -773,7 +788,7 @@ dom_fw_init (struct domain *d, char *arg 3.283 dom_fw_fake_acpi(acpi_tables); 3.284 3.285 efi_tables[i].guid = ACPI_20_TABLE_GUID; 3.286 - efi_tables[i].table = dom_pa(acpi_tables); 3.287 + efi_tables[i].table = dom_pa((unsigned long) acpi_tables); 3.288 printf(" ACPI 2.0=0x%lx",efi_tables[i].table); 3.289 i++; 3.290 } 3.291 @@ -850,12 +865,12 @@ dom_fw_init (struct domain *d, char *arg 3.292 MAKE_MD(EFI_RESERVED_TYPE,0,0,0,0); 3.293 } 3.294 3.295 - bp->efi_systab = dom_pa(fw_mem); 3.296 - bp->efi_memmap = dom_pa(efi_memmap); 3.297 + bp->efi_systab = dom_pa((unsigned long) fw_mem); 3.298 + bp->efi_memmap = dom_pa((unsigned long) efi_memmap); 3.299 bp->efi_memmap_size = NUM_MEM_DESCS*sizeof(efi_memory_desc_t); 3.300 bp->efi_memdesc_size = sizeof(efi_memory_desc_t); 3.301 bp->efi_memdesc_version = 1; 3.302 - bp->command_line = dom_pa(cmd_line); 3.303 + bp->command_line = dom_pa((unsigned long) cmd_line); 3.304 bp->console_info.num_cols = 80; 3.305 bp->console_info.num_rows = 25; 3.306 bp->console_info.orig_x = 0;
4.1 --- a/xen/arch/ia64/xen/domain.c Tue Feb 28 10:26:43 2006 -0700 4.2 +++ b/xen/arch/ia64/xen/domain.c Tue Feb 28 10:29:30 2006 -0700 4.3 @@ -45,6 +45,7 @@ 4.4 #include <asm/vmx.h> 4.5 #include <asm/vmx_vcpu.h> 4.6 #include <asm/vmx_vpd.h> 4.7 +#include <asm/vmx_phy_mode.h> 4.8 #include <asm/pal.h> 4.9 #include <asm/vhpt.h> 4.10 #include <public/hvm/ioreq.h> 4.11 @@ -65,6 +66,15 @@ extern int readelfimage_base_and_size(ch 4.12 unsigned long *, unsigned long *, unsigned long *); 4.13 4.14 extern unsigned long dom_fw_setup(struct domain *, char *, int); 4.15 +/* FIXME: where these declarations should be there ? */ 4.16 +extern void domain_pend_keyboard_interrupt(int); 4.17 +extern long platform_is_hp_ski(void); 4.18 +extern unsigned long allocate_metaphysical_rr(void); 4.19 +extern int allocate_rid_range(struct domain *, unsigned long); 4.20 +extern void sync_split_caches(void); 4.21 +extern void init_all_rr(struct vcpu *); 4.22 +extern void serial_input_init(void); 4.23 + 4.24 static void init_switch_stack(struct vcpu *v); 4.25 4.26 /* this belongs in include/asm, but there doesn't seem to be a suitable place */ 4.27 @@ -275,8 +285,6 @@ int arch_set_info_guest(struct vcpu *v, 4.28 { 4.29 struct pt_regs *regs = vcpu_regs (v); 4.30 struct domain *d = v->domain; 4.31 - int i, rc, ret; 4.32 - unsigned long progress = 0; 4.33 4.34 printf("arch_set_info_guest\n"); 4.35 if ( test_bit(_VCPUF_initialised, &v->vcpu_flags) ) 4.36 @@ -304,7 +312,7 @@ int arch_set_info_guest(struct vcpu *v, 4.37 v->vcpu_info->arch.evtchn_vector = c->vcpu.evtchn_vector; 4.38 if ( c->vcpu.privregs && copy_from_user(v->arch.privregs, 4.39 c->vcpu.privregs, sizeof(mapped_regs_t))) { 4.40 - printk("Bad ctxt address in arch_set_info_guest: 0x%lx\n", c->vcpu.privregs); 4.41 + printk("Bad ctxt address in arch_set_info_guest: %p\n", c->vcpu.privregs); 4.42 return -EFAULT; 4.43 } 4.44 4.45 @@ -331,10 +339,8 @@ void new_thread(struct vcpu *v, 4.46 { 4.47 struct domain *d = v->domain; 4.48 struct pt_regs *regs; 4.49 - struct ia64_boot_param *bp; 4.50 extern char saved_command_line[]; 4.51 4.52 - 4.53 #ifdef CONFIG_DOMAIN0_CONTIGUOUS 4.54 if (d == dom0) start_pc += dom0_start; 4.55 #endif 4.56 @@ -384,8 +390,9 @@ void new_thread(struct vcpu *v, 4.57 static struct page * assign_new_domain0_page(unsigned long mpaddr) 4.58 { 4.59 if (mpaddr < dom0_start || mpaddr >= dom0_start + dom0_size) { 4.60 - printk("assign_new_domain0_page: bad domain0 mpaddr %p!\n",mpaddr); 4.61 -printk("assign_new_domain0_page: start=%p,end=%p!\n",dom0_start,dom0_start+dom0_size); 4.62 + printk("assign_new_domain0_page: bad domain0 mpaddr 0x%lx!\n",mpaddr); 4.63 + printk("assign_new_domain0_page: start=0x%lx,end=0x%lx!\n", 4.64 + dom0_start, dom0_start+dom0_size); 4.65 while(1); 4.66 } 4.67 return mfn_to_page((mpaddr >> PAGE_SHIFT)); 4.68 @@ -430,13 +437,13 @@ struct page * assign_new_domain_page(str 4.69 if (p) memset(__va(page_to_maddr(p)),0,PAGE_SIZE); 4.70 } 4.71 if (unlikely(!p)) { 4.72 -printf("assign_new_domain_page: Can't alloc!!!! Aaaargh!\n"); 4.73 + printf("assign_new_domain_page: Can't alloc!!!! Aaaargh!\n"); 4.74 return(p); 4.75 } 4.76 if (unlikely(page_to_maddr(p) > __get_cpu_var(vhpt_paddr) 4.77 && page_to_maddr(p) < __get_cpu_var(vhpt_pend))) { 4.78 - printf("assign_new_domain_page: reassigned vhpt page %p!!\n", 4.79 - page_to_maddr(p)); 4.80 + printf("assign_new_domain_page: reassigned vhpt page %lx!!\n", 4.81 + page_to_maddr(p)); 4.82 } 4.83 set_pte(pte, pfn_pte(page_to_maddr(p) >> PAGE_SHIFT, 4.84 __pgprot(__DIRTY_BITS | _PAGE_PL_2 | _PAGE_AR_RWX))); 4.85 @@ -534,8 +541,8 @@ unsigned long lookup_domain_mpa(struct d 4.86 #ifdef CONFIG_DOMAIN0_CONTIGUOUS 4.87 if (d == dom0) { 4.88 if (mpaddr < dom0_start || mpaddr >= dom0_start + dom0_size) { 4.89 - //printk("lookup_domain_mpa: bad dom0 mpaddr %p!\n",mpaddr); 4.90 -//printk("lookup_domain_mpa: start=%p,end=%p!\n",dom0_start,dom0_start+dom0_size); 4.91 + //printk("lookup_domain_mpa: bad dom0 mpaddr 0x%lx!\n",mpaddr); 4.92 + //printk("lookup_domain_mpa: start=0x%lx,end=0x%lx!\n",dom0_start,dom0_start+dom0_size); 4.93 mpafoo(mpaddr); 4.94 } 4.95 pte_t pteval = pfn_pte(mpaddr >> PAGE_SHIFT, 4.96 @@ -563,8 +570,8 @@ tryagain: 4.97 if ((mpaddr >> PAGE_SHIFT) < d->max_pages) { 4.98 if (assign_new_domain_page(d,mpaddr)) goto tryagain; 4.99 } 4.100 - printk("lookup_domain_mpa: bad mpa %p (> %p\n", 4.101 - mpaddr,d->max_pages<<PAGE_SHIFT); 4.102 + printk("lookup_domain_mpa: bad mpa 0x%lx (> 0x%lx)\n", 4.103 + mpaddr, (unsigned long) d->max_pages<<PAGE_SHIFT); 4.104 mpafoo(mpaddr); 4.105 return 0; 4.106 } 4.107 @@ -577,7 +584,7 @@ unsigned long domain_mpa_to_imva(struct 4.108 unsigned long imva; 4.109 4.110 pte &= _PAGE_PPN_MASK; 4.111 - imva = __va(pte); 4.112 + imva = (unsigned long) __va(pte); 4.113 imva |= mpaddr & ~PAGE_MASK; 4.114 return(imva); 4.115 } 4.116 @@ -606,13 +613,13 @@ static void copy_memory(void *dst, void 4.117 { 4.118 int remain; 4.119 4.120 - if (IS_XEN_ADDRESS(dom0,src)) { 4.121 + if (IS_XEN_ADDRESS(dom0,(unsigned long) src)) { 4.122 memcpy(dst,src,size); 4.123 } 4.124 else { 4.125 printf("About to call __copy_from_user(%p,%p,%d)\n", 4.126 dst,src,size); 4.127 - while (remain = __copy_from_user(dst,src,size)) { 4.128 + while ((remain = __copy_from_user(dst,src,size)) != 0) { 4.129 printf("incomplete user copy, %d remain of %d\n", 4.130 remain,size); 4.131 dst += size - remain; src += size - remain; 4.132 @@ -623,16 +630,15 @@ static void copy_memory(void *dst, void 4.133 4.134 void loaddomainelfimage(struct domain *d, unsigned long image_start) 4.135 { 4.136 - char *elfbase = image_start; 4.137 + char *elfbase = (char *) image_start; 4.138 //Elf_Ehdr *ehdr = (Elf_Ehdr *)image_start; 4.139 Elf_Ehdr ehdr; 4.140 Elf_Phdr phdr; 4.141 - int h, filesz, memsz, paddr; 4.142 + int h, filesz, memsz; 4.143 unsigned long elfaddr, dom_mpaddr, dom_imva; 4.144 struct page *p; 4.145 - unsigned long pteval; 4.146 4.147 - copy_memory(&ehdr,image_start,sizeof(Elf_Ehdr)); 4.148 + copy_memory(&ehdr, (void *) image_start, sizeof(Elf_Ehdr)); 4.149 for ( h = 0; h < ehdr.e_phnum; h++ ) { 4.150 copy_memory(&phdr,elfbase + ehdr.e_phoff + (h*ehdr.e_phentsize), 4.151 sizeof(Elf_Phdr)); 4.152 @@ -641,7 +647,7 @@ void loaddomainelfimage(struct domain *d 4.153 continue; 4.154 } 4.155 filesz = phdr.p_filesz; memsz = phdr.p_memsz; 4.156 - elfaddr = elfbase + phdr.p_offset; 4.157 + elfaddr = (unsigned long) elfbase + phdr.p_offset; 4.158 dom_mpaddr = phdr.p_paddr; 4.159 //printf("p_offset: %x, size=%x\n",elfaddr,filesz); 4.160 #ifdef CONFIG_DOMAIN0_CONTIGUOUS 4.161 @@ -650,9 +656,9 @@ void loaddomainelfimage(struct domain *d 4.162 printf("Domain0 doesn't fit in allocated space!\n"); 4.163 while(1); 4.164 } 4.165 - dom_imva = __va(dom_mpaddr + dom0_start); 4.166 - copy_memory(dom_imva,elfaddr,filesz); 4.167 - if (memsz > filesz) memset(dom_imva+filesz,0,memsz-filesz); 4.168 + dom_imva = (unsigned long) __va(dom_mpaddr + dom0_start); 4.169 + copy_memory((void *) dom_imva, (void *) elfaddr, filesz); 4.170 + if (memsz > filesz) memset((void *) dom_imva+filesz, 0, memsz-filesz); 4.171 //FIXME: This test for code seems to find a lot more than objdump -x does 4.172 if (phdr.p_flags & PF_X) privify_memory(dom_imva,filesz); 4.173 } 4.174 @@ -661,20 +667,20 @@ void loaddomainelfimage(struct domain *d 4.175 while (memsz > 0) { 4.176 p = assign_new_domain_page(d,dom_mpaddr); 4.177 if (unlikely(!p)) BUG(); 4.178 - dom_imva = __va(page_to_maddr(p)); 4.179 + dom_imva = (unsigned long) __va(page_to_maddr(p)); 4.180 if (filesz > 0) { 4.181 if (filesz >= PAGE_SIZE) 4.182 - copy_memory(dom_imva,elfaddr,PAGE_SIZE); 4.183 + copy_memory((void *) dom_imva, (void *) elfaddr, PAGE_SIZE); 4.184 else { // copy partial page, zero the rest of page 4.185 - copy_memory(dom_imva,elfaddr,filesz); 4.186 - memset(dom_imva+filesz,0,PAGE_SIZE-filesz); 4.187 + copy_memory((void *) dom_imva, (void *) elfaddr, filesz); 4.188 + memset((void *) dom_imva+filesz, 0, PAGE_SIZE-filesz); 4.189 } 4.190 //FIXME: This test for code seems to find a lot more than objdump -x does 4.191 if (phdr.p_flags & PF_X) 4.192 privify_memory(dom_imva,PAGE_SIZE); 4.193 } 4.194 else if (memsz > 0) // always zero out entire page 4.195 - memset(dom_imva,0,PAGE_SIZE); 4.196 + memset((void *) dom_imva, 0, PAGE_SIZE); 4.197 memsz -= PAGE_SIZE; filesz -= PAGE_SIZE; 4.198 elfaddr += PAGE_SIZE; dom_mpaddr += PAGE_SIZE; 4.199 } 4.200 @@ -689,33 +695,33 @@ parsedomainelfimage(char *elfbase, unsig 4.201 copy_memory(&ehdr,elfbase,sizeof(Elf_Ehdr)); 4.202 4.203 if ( !elf_sanity_check(&ehdr) ) { 4.204 - printk("ELF sanity check failed.\n"); 4.205 - return -EINVAL; 4.206 + printk("ELF sanity check failed.\n"); 4.207 + return -EINVAL; 4.208 } 4.209 4.210 if ( (ehdr.e_phoff + (ehdr.e_phnum * ehdr.e_phentsize)) > elfsize ) 4.211 { 4.212 - printk("ELF program headers extend beyond end of image.\n"); 4.213 - return -EINVAL; 4.214 + printk("ELF program headers extend beyond end of image.\n"); 4.215 + return -EINVAL; 4.216 } 4.217 4.218 if ( (ehdr.e_shoff + (ehdr.e_shnum * ehdr.e_shentsize)) > elfsize ) 4.219 { 4.220 - printk("ELF section headers extend beyond end of image.\n"); 4.221 - return -EINVAL; 4.222 + printk("ELF section headers extend beyond end of image.\n"); 4.223 + return -EINVAL; 4.224 } 4.225 4.226 #if 0 4.227 /* Find the section-header strings table. */ 4.228 if ( ehdr.e_shstrndx == SHN_UNDEF ) 4.229 { 4.230 - printk("ELF image has no section-header strings table (shstrtab).\n"); 4.231 - return -EINVAL; 4.232 + printk("ELF image has no section-header strings table (shstrtab).\n"); 4.233 + return -EINVAL; 4.234 } 4.235 #endif 4.236 4.237 *entry = ehdr.e_entry; 4.238 -printf("parsedomainelfimage: entry point = %p\n",*entry); 4.239 + printf("parsedomainelfimage: entry point = 0x%lx\n", *entry); 4.240 4.241 return 0; 4.242 } 4.243 @@ -727,22 +733,21 @@ void alloc_dom0(void) 4.244 if (platform_is_hp_ski()) { 4.245 dom0_size = 128*1024*1024; //FIXME: Should be configurable 4.246 } 4.247 - printf("alloc_dom0: starting (initializing %d MB...)\n",dom0_size/(1024*1024)); 4.248 + printf("alloc_dom0: starting (initializing %lu MB...)\n",dom0_size/(1024*1024)); 4.249 4.250 - /* FIXME: The first trunk (say 256M) should always be assigned to 4.251 - * Dom0, since Dom0's physical == machine address for DMA purpose. 4.252 - * Some old version linux, like 2.4, assumes physical memory existing 4.253 - * in 2nd 64M space. 4.254 - */ 4.255 - dom0_start = alloc_boot_pages( 4.256 - dom0_size >> PAGE_SHIFT, dom0_align >> PAGE_SHIFT); 4.257 - dom0_start <<= PAGE_SHIFT; 4.258 + /* FIXME: The first trunk (say 256M) should always be assigned to 4.259 + * Dom0, since Dom0's physical == machine address for DMA purpose. 4.260 + * Some old version linux, like 2.4, assumes physical memory existing 4.261 + * in 2nd 64M space. 4.262 + */ 4.263 + dom0_start = alloc_boot_pages(dom0_size >> PAGE_SHIFT, dom0_align >> PAGE_SHIFT); 4.264 + dom0_start <<= PAGE_SHIFT; 4.265 if (!dom0_start) { 4.266 - printf("construct_dom0: can't allocate contiguous memory size=%p\n", 4.267 + printf("alloc_dom0: can't allocate contiguous memory size=%lu\n", 4.268 dom0_size); 4.269 while(1); 4.270 } 4.271 - printf("alloc_dom0: dom0_start=%p\n",dom0_start); 4.272 + printf("alloc_dom0: dom0_start=0x%lx\n", dom0_start); 4.273 #else 4.274 dom0_start = 0; 4.275 #endif 4.276 @@ -770,13 +775,8 @@ int construct_dom0(struct domain *d, 4.277 unsigned long initrd_start, unsigned long initrd_len, 4.278 char *cmdline) 4.279 { 4.280 - char *dst; 4.281 int i, rc; 4.282 - unsigned long pfn, mfn; 4.283 - unsigned long nr_pt_pages; 4.284 - unsigned long count; 4.285 unsigned long alloc_start, alloc_end; 4.286 - struct page_info *page = NULL; 4.287 start_info_t *si; 4.288 struct vcpu *v = d->vcpu[0]; 4.289 4.290 @@ -787,7 +787,15 @@ int construct_dom0(struct domain *d, 4.291 unsigned long pkern_end; 4.292 unsigned long pinitrd_start = 0; 4.293 unsigned long pstart_info; 4.294 - unsigned long ret, progress = 0; 4.295 +#if 0 4.296 + char *dst; 4.297 + unsigned long nr_pt_pages; 4.298 + unsigned long count; 4.299 +#endif 4.300 +#ifdef VALIDATE_VT 4.301 + unsigned long mfn; 4.302 + struct page_info *page = NULL; 4.303 +#endif 4.304 4.305 //printf("construct_dom0: starting\n"); 4.306 4.307 @@ -843,7 +851,7 @@ int construct_dom0(struct domain *d, 4.308 pinitrd_start=(dom0_start+dom0_size) - 4.309 (PAGE_ALIGN(initrd_len) + 4*1024*1024); 4.310 4.311 - memcpy(__va(pinitrd_start),initrd_start,initrd_len); 4.312 + memcpy(__va(pinitrd_start), (void *) initrd_start, initrd_len); 4.313 pstart_info = PAGE_ALIGN(pinitrd_start + initrd_len); 4.314 } else { 4.315 pstart_info = PAGE_ALIGN(pkern_end); 4.316 @@ -861,7 +869,8 @@ int construct_dom0(struct domain *d, 4.317 { 4.318 printk("Initial guest OS requires too much space\n" 4.319 "(%luMB is greater than %luMB limit)\n", 4.320 - (pkern_end-pkern_start)>>20, (d->max_pages<<PAGE_SHIFT)>>20); 4.321 + (pkern_end-pkern_start)>>20, 4.322 + (unsigned long) (d->max_pages<<PAGE_SHIFT)>>20); 4.323 return -ENOMEM; 4.324 } 4.325
5.1 --- a/xen/arch/ia64/xen/hypercall.c Tue Feb 28 10:26:43 2006 -0700 5.2 +++ b/xen/arch/ia64/xen/hypercall.c Tue Feb 28 10:29:30 2006 -0700 5.3 @@ -16,10 +16,15 @@ 5.4 5.5 #include <asm/vcpu.h> 5.6 #include <asm/dom_fw.h> 5.7 +#include <public/dom0_ops.h> 5.8 +#include <public/event_channel.h> 5.9 #include <public/memory.h> 5.10 #include <public/sched.h> 5.11 5.12 extern unsigned long translate_domain_mpaddr(unsigned long); 5.13 +/* FIXME: where these declarations should be there ? */ 5.14 +extern int dump_privop_counts_to_user(char *, int); 5.15 +extern int zero_privop_counts_to_user(char *, int); 5.16 5.17 unsigned long idle_when_pending = 0; 5.18 unsigned long pal_halt_light_count = 0; 5.19 @@ -135,12 +140,12 @@ ia64_hypercall (struct pt_regs *regs) 5.20 regs->r8 = EFI_UNSUPPORTED; 5.21 break; 5.22 case FW_HYPERCALL_EFI_GET_TIME: 5.23 - tv = vcpu_get_gr(v,32); 5.24 - tc = vcpu_get_gr(v,33); 5.25 + tv = (unsigned long *) vcpu_get_gr(v,32); 5.26 + tc = (unsigned long *) vcpu_get_gr(v,33); 5.27 //printf("efi_get_time(%p,%p) called...",tv,tc); 5.28 - tv = __va(translate_domain_mpaddr(tv)); 5.29 - if (tc) tc = __va(translate_domain_mpaddr(tc)); 5.30 - regs->r8 = (*efi.get_time)(tv,tc); 5.31 + tv = (unsigned long *) __va(translate_domain_mpaddr((unsigned long) tv)); 5.32 + if (tc) tc = (unsigned long *) __va(translate_domain_mpaddr((unsigned long) tc)); 5.33 + regs->r8 = (*efi.get_time)((efi_time_t *) tv, (efi_time_cap_t *) tc); 5.34 //printf("and returns %lx\n",regs->r8); 5.35 break; 5.36 case FW_HYPERCALL_EFI_SET_TIME: 5.37 @@ -161,23 +166,23 @@ ia64_hypercall (struct pt_regs *regs) 5.38 break; 5.39 case 0xffff: 5.40 regs->r8 = dump_privop_counts_to_user( 5.41 - vcpu_get_gr(v,32), 5.42 - vcpu_get_gr(v,33)); 5.43 + (char *) vcpu_get_gr(v,32), 5.44 + (int) vcpu_get_gr(v,33)); 5.45 break; 5.46 case 0xfffe: 5.47 regs->r8 = zero_privop_counts_to_user( 5.48 - vcpu_get_gr(v,32), 5.49 - vcpu_get_gr(v,33)); 5.50 + (char *) vcpu_get_gr(v,32), 5.51 + (int) vcpu_get_gr(v,33)); 5.52 break; 5.53 case __HYPERVISOR_dom0_op: 5.54 - regs->r8 = do_dom0_op(regs->r14); 5.55 + regs->r8 = do_dom0_op((struct dom0_op *) regs->r14); 5.56 break; 5.57 5.58 case __HYPERVISOR_memory_op: 5.59 /* we don't handle reservations; just return success */ 5.60 { 5.61 struct xen_memory_reservation reservation; 5.62 - void *arg = regs->r15; 5.63 + void *arg = (void *) regs->r15; 5.64 5.65 switch(regs->r14) { 5.66 case XENMEM_increase_reservation: 5.67 @@ -189,34 +194,34 @@ ia64_hypercall (struct pt_regs *regs) 5.68 regs->r8 = reservation.nr_extents; 5.69 break; 5.70 default: 5.71 - regs->r8 = do_memory_op(regs->r14, regs->r15); 5.72 + regs->r8 = do_memory_op((int) regs->r14, (void *)regs->r15); 5.73 break; 5.74 } 5.75 } 5.76 break; 5.77 5.78 case __HYPERVISOR_event_channel_op: 5.79 - regs->r8 = do_event_channel_op(regs->r14); 5.80 + regs->r8 = do_event_channel_op((struct evtchn_op *) regs->r14); 5.81 break; 5.82 5.83 case __HYPERVISOR_grant_table_op: 5.84 - regs->r8 = do_grant_table_op(regs->r14, regs->r15, regs->r16); 5.85 + regs->r8 = do_grant_table_op((unsigned int) regs->r14, (void *) regs->r15, (unsigned int) regs->r16); 5.86 break; 5.87 5.88 case __HYPERVISOR_console_io: 5.89 - regs->r8 = do_console_io(regs->r14, regs->r15, regs->r16); 5.90 + regs->r8 = do_console_io((int) regs->r14, (int) regs->r15, (char *) regs->r16); 5.91 break; 5.92 5.93 case __HYPERVISOR_xen_version: 5.94 - regs->r8 = do_xen_version(regs->r14, regs->r15); 5.95 + regs->r8 = do_xen_version((int) regs->r14, (void *) regs->r15); 5.96 break; 5.97 5.98 case __HYPERVISOR_multicall: 5.99 - regs->r8 = do_multicall(regs->r14, regs->r15); 5.100 + regs->r8 = do_multicall((struct multicall_entry *) regs->r14, (unsigned int) regs->r15); 5.101 break; 5.102 5.103 default: 5.104 - printf("unknown hypercall %x\n", regs->r2); 5.105 + printf("unknown hypercall %lx\n", regs->r2); 5.106 regs->r8 = do_ni_hypercall(); 5.107 } 5.108 return 1;
6.1 --- a/xen/arch/ia64/xen/irq.c Tue Feb 28 10:26:43 2006 -0700 6.2 +++ b/xen/arch/ia64/xen/irq.c Tue Feb 28 10:29:30 2006 -0700 6.3 @@ -286,7 +286,9 @@ EXPORT_SYMBOL(synchronize_irq); 6.4 int handle_IRQ_event(unsigned int irq, 6.5 struct pt_regs *regs, struct irqaction *action) 6.6 { 6.7 +#ifndef XEN 6.8 int status = 1; /* Force the "do bottom halves" bit */ 6.9 +#endif 6.10 int retval = 0; 6.11 6.12 #ifndef XEN 6.13 @@ -657,8 +659,10 @@ int request_irq(unsigned int irq, 6.14 if (!action) 6.15 return -ENOMEM; 6.16 6.17 +#ifdef XEN 6.18 + action->handler = (void *) handler; 6.19 +#else 6.20 action->handler = handler; 6.21 -#ifndef XEN 6.22 action->flags = irqflags; 6.23 action->mask = 0; 6.24 #endif 6.25 @@ -698,7 +702,9 @@ void free_irq(unsigned int irq, void *de 6.26 #endif 6.27 { 6.28 irq_desc_t *desc; 6.29 +#ifndef XEN 6.30 struct irqaction **p; 6.31 +#endif 6.32 unsigned long flags; 6.33 6.34 if (irq >= NR_IRQS) 6.35 @@ -755,7 +761,8 @@ EXPORT_SYMBOL(free_irq); 6.36 * disabled. 6.37 */ 6.38 6.39 -static DECLARE_MUTEX(probe_sem); 6.40 +#ifndef XEN 6.41 +static int DECLARE_MUTEX(probe_sem); 6.42 6.43 /** 6.44 * probe_irq_on - begin an interrupt autodetect 6.45 @@ -765,7 +772,6 @@ static DECLARE_MUTEX(probe_sem); 6.46 * 6.47 */ 6.48 6.49 -#ifndef XEN 6.50 unsigned long probe_irq_on(void) 6.51 { 6.52 unsigned int i; 6.53 @@ -936,7 +942,9 @@ EXPORT_SYMBOL(probe_irq_off); 6.54 6.55 int setup_irq(unsigned int irq, struct irqaction * new) 6.56 { 6.57 +#ifndef XEN 6.58 int shared = 0; 6.59 +#endif 6.60 unsigned long flags; 6.61 struct irqaction *old, **p; 6.62 irq_desc_t *desc = irq_descp(irq); 6.63 @@ -1371,7 +1379,7 @@ int pirq_guest_unmask(struct domain *d) 6.64 return 0; 6.65 } 6.66 6.67 -int pirq_guest_bind(struct vcpu *d, int irq, int will_share) 6.68 +int pirq_guest_bind(struct vcpu *v, int irq, int will_share) 6.69 { 6.70 irq_desc_t *desc = &irq_desc[irq]; 6.71 irq_guest_action_t *action; 6.72 @@ -1431,7 +1439,7 @@ int pirq_guest_bind(struct vcpu *d, int 6.73 goto out; 6.74 } 6.75 6.76 - action->guest[action->nr_guests++] = d; 6.77 + action->guest[action->nr_guests++] = v->domain; 6.78 6.79 out: 6.80 spin_unlock_irqrestore(&desc->lock, flags); 6.81 @@ -1480,6 +1488,7 @@ int pirq_guest_unbind(struct domain *d, 6.82 #ifdef XEN 6.83 #ifdef IA64 6.84 // this is a temporary hack until real console input is implemented 6.85 +extern void domain_pend_keyboard_interrupt(int irq); 6.86 irqreturn_t guest_forward_keyboard_input(int irq, void *nada, struct pt_regs *regs) 6.87 { 6.88 domain_pend_keyboard_interrupt(irq);
7.1 --- a/xen/arch/ia64/xen/mm_init.c Tue Feb 28 10:26:43 2006 -0700 7.2 +++ b/xen/arch/ia64/xen/mm_init.c Tue Feb 28 10:29:30 2006 -0700 7.3 @@ -47,6 +47,7 @@ 7.4 #include <asm/uaccess.h> 7.5 #include <asm/unistd.h> 7.6 #include <asm/mca.h> 7.7 +#include <asm/vhpt.h> 7.8 7.9 #ifndef XEN 7.10 DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); 7.11 @@ -63,7 +64,7 @@ struct page *vmem_map; 7.12 EXPORT_SYMBOL(vmem_map); 7.13 #endif 7.14 7.15 -static int pgt_cache_water[2] = { 25, 50 }; 7.16 +// static int pgt_cache_water[2] = { 25, 50 }; 7.17 7.18 struct page *zero_page_memmap_ptr; /* map entry for zero page */ 7.19 EXPORT_SYMBOL(zero_page_memmap_ptr); 7.20 @@ -222,7 +223,7 @@ inline void 7.21 ia64_set_rbs_bot (void) 7.22 { 7.23 #ifdef XEN 7.24 - unsigned stack_size = MAX_USER_STACK_SIZE; 7.25 + unsigned long stack_size = MAX_USER_STACK_SIZE; 7.26 #else 7.27 unsigned long stack_size = current->rlim[RLIMIT_STACK].rlim_max & -16; 7.28 #endif 7.29 @@ -279,7 +280,7 @@ printf("ia64_init_addr_space: called, no 7.30 #endif 7.31 } 7.32 7.33 -setup_gate (void) 7.34 +void setup_gate (void) 7.35 { 7.36 printk("setup_gate not-implemented.\n"); 7.37 } 7.38 @@ -287,7 +288,10 @@ setup_gate (void) 7.39 void __devinit 7.40 ia64_mmu_init (void *my_cpu_data) 7.41 { 7.42 - unsigned long psr, pta, impl_va_bits; 7.43 + unsigned long psr, impl_va_bits; 7.44 +#if 0 7.45 + unsigned long pta; 7.46 +#endif 7.47 extern void __devinit tlb_init (void); 7.48 int cpu; 7.49
8.1 --- a/xen/arch/ia64/xen/pcdp.c Tue Feb 28 10:26:43 2006 -0700 8.2 +++ b/xen/arch/ia64/xen/pcdp.c Tue Feb 28 10:29:30 2006 -0700 8.3 @@ -71,7 +71,9 @@ efi_setup_pcdp_console(char *cmdline) 8.4 { 8.5 struct pcdp *pcdp; 8.6 struct pcdp_uart *uart; 8.7 +#ifndef XEN 8.8 struct pcdp_device *dev, *end; 8.9 +#endif 8.10 int i, serial = 0; 8.11 8.12 pcdp = efi.hcdp;
9.1 --- a/xen/arch/ia64/xen/privop.c Tue Feb 28 10:26:43 2006 -0700 9.2 +++ b/xen/arch/ia64/xen/privop.c Tue Feb 28 10:29:30 2006 -0700 9.3 @@ -11,8 +11,13 @@ 9.4 #include <asm/processor.h> 9.5 #include <asm/delay.h> // Debug only 9.6 #include <asm/dom_fw.h> 9.7 +#include <asm/vhpt.h> 9.8 //#include <debug.h> 9.9 9.10 +/* FIXME: where these declarations should be there ? */ 9.11 +extern int dump_reflect_counts(char *); 9.12 +extern void zero_reflect_counts(void); 9.13 + 9.14 long priv_verbose=0; 9.15 9.16 /************************************************************************** 9.17 @@ -600,7 +605,7 @@ priv_handle_op(VCPU *vcpu, REGS *regs, i 9.18 if (__copy_from_user(&bundle,iip,sizeof(bundle))) 9.19 #endif 9.20 { 9.21 -//printf("*** priv_handle_op: privop bundle @%p not mapped, retrying\n",iip); 9.22 +//printf("*** priv_handle_op: privop bundle at 0x%lx not mapped, retrying\n",iip); 9.23 return vcpu_force_data_miss(vcpu,regs->cr_iip); 9.24 } 9.25 #if 0 9.26 @@ -613,8 +618,8 @@ priv_handle_op(VCPU *vcpu, REGS *regs, i 9.27 #endif 9.28 if (privop_trace) { 9.29 static long i = 400; 9.30 - //if (i > 0) printf("privop @%p\n",iip); 9.31 - if (i > 0) printf("priv_handle_op: @%p, itc=%lx, itm=%lx\n", 9.32 + //if (i > 0) printf("priv_handle_op: at 0x%lx\n",iip); 9.33 + if (i > 0) printf("priv_handle_op: privop trace at 0x%lx, itc=%lx, itm=%lx\n", 9.34 iip,ia64_get_itc(),ia64_get_itm()); 9.35 i--; 9.36 } 9.37 @@ -727,7 +732,7 @@ priv_handle_op(VCPU *vcpu, REGS *regs, i 9.38 break; 9.39 } 9.40 //printf("We who are about do die salute you\n"); 9.41 - printf("handle_op: can't handle privop at 0x%lx (op=0x%016lx) slot %d (type=%d), ipsr=%p\n", 9.42 + printf("priv_handle_op: can't handle privop at 0x%lx (op=0x%016lx) slot %d (type=%d), ipsr=0x%lx\n", 9.43 iip, (UINT64)inst.inst, slot, slot_type, ipsr); 9.44 //printf("vtop(0x%lx)==0x%lx\n", iip, tr_vtop(iip)); 9.45 //thread_mozambique("privop fault\n"); 9.46 @@ -768,7 +773,7 @@ priv_emulate(VCPU *vcpu, REGS *regs, UIN 9.47 (void)vcpu_increment_iip(vcpu); 9.48 } 9.49 if (fault == IA64_ILLOP_FAULT) 9.50 - printf("priv_emulate: priv_handle_op fails, isr=%p\n",isr); 9.51 + printf("priv_emulate: priv_handle_op fails, isr=0x%lx\n",isr); 9.52 return fault; 9.53 } 9.54 9.55 @@ -797,8 +802,7 @@ priv_emulate(VCPU *vcpu, REGS *regs, UIN 9.56 char *hyperpriv_str[HYPERPRIVOP_MAX+1] = { 9.57 0, "rfi", "rsm.dt", "ssm.dt", "cover", "itc.d", "itc.i", "ssm.i", 9.58 "=ivr", "=tpr", "tpr=", "eoi", "itm=", "thash", "ptc.ga", "itr.d", 9.59 - "=rr", "rr=", "kr=", 9.60 - 0 9.61 + "=rr", "rr=", "kr=" 9.62 }; 9.63 9.64 unsigned long slow_hyperpriv_cnt[HYPERPRIVOP_MAX+1] = { 0 }; 9.65 @@ -809,15 +813,14 @@ unsigned long fast_hyperpriv_cnt[HYPERPR 9.66 int 9.67 ia64_hyperprivop(unsigned long iim, REGS *regs) 9.68 { 9.69 - struct vcpu *v = (struct domain *) current; 9.70 - INST64 inst; 9.71 + struct vcpu *v = current; 9.72 UINT64 val; 9.73 UINT64 itir, ifa; 9.74 9.75 // FIXME: Handle faults appropriately for these 9.76 if (!iim || iim > HYPERPRIVOP_MAX) { 9.77 printf("bad hyperprivop; ignored\n"); 9.78 - printf("iim=%d, iip=%p\n",iim,regs->cr_iip); 9.79 + printf("iim=%lx, iip=0x%lx\n", iim, regs->cr_iip); 9.80 return 1; 9.81 } 9.82 slow_hyperpriv_cnt[iim]++; 9.83 @@ -946,48 +949,48 @@ int dump_privop_counts(char *buf) 9.84 for (i=0; i < 64; i++) sum += privcnt.Mpriv_cnt[i]; 9.85 s += sprintf(s,"Privop statistics: (Total privops: %ld)\n",sum); 9.86 if (privcnt.mov_to_ar_imm) 9.87 - s += sprintf(s,"%10d %s [%d%%]\n", privcnt.mov_to_ar_imm, 9.88 + s += sprintf(s,"%10ld %s [%ld%%]\n", privcnt.mov_to_ar_imm, 9.89 "mov_to_ar_imm", (privcnt.mov_to_ar_imm*100L)/sum); 9.90 if (privcnt.mov_to_ar_reg) 9.91 - s += sprintf(s,"%10d %s [%d%%]\n", privcnt.mov_to_ar_reg, 9.92 + s += sprintf(s,"%10ld %s [%ld%%]\n", privcnt.mov_to_ar_reg, 9.93 "mov_to_ar_reg", (privcnt.mov_to_ar_reg*100L)/sum); 9.94 if (privcnt.mov_from_ar) 9.95 - s += sprintf(s,"%10d %s [%d%%]\n", privcnt.mov_from_ar, 9.96 + s += sprintf(s,"%10ld %s [%ld%%]\n", privcnt.mov_from_ar, 9.97 "privified-mov_from_ar", (privcnt.mov_from_ar*100L)/sum); 9.98 if (privcnt.ssm) 9.99 - s += sprintf(s,"%10d %s [%d%%]\n", privcnt.ssm, 9.100 + s += sprintf(s,"%10ld %s [%ld%%]\n", privcnt.ssm, 9.101 "ssm", (privcnt.ssm*100L)/sum); 9.102 if (privcnt.rsm) 9.103 - s += sprintf(s,"%10d %s [%d%%]\n", privcnt.rsm, 9.104 + s += sprintf(s,"%10ld %s [%ld%%]\n", privcnt.rsm, 9.105 "rsm", (privcnt.rsm*100L)/sum); 9.106 if (privcnt.rfi) 9.107 - s += sprintf(s,"%10d %s [%d%%]\n", privcnt.rfi, 9.108 + s += sprintf(s,"%10ld %s [%ld%%]\n", privcnt.rfi, 9.109 "rfi", (privcnt.rfi*100L)/sum); 9.110 if (privcnt.bsw0) 9.111 - s += sprintf(s,"%10d %s [%d%%]\n", privcnt.bsw0, 9.112 + s += sprintf(s,"%10ld %s [%ld%%]\n", privcnt.bsw0, 9.113 "bsw0", (privcnt.bsw0*100L)/sum); 9.114 if (privcnt.bsw1) 9.115 - s += sprintf(s,"%10d %s [%d%%]\n", privcnt.bsw1, 9.116 + s += sprintf(s,"%10ld %s [%ld%%]\n", privcnt.bsw1, 9.117 "bsw1", (privcnt.bsw1*100L)/sum); 9.118 if (privcnt.cover) 9.119 - s += sprintf(s,"%10d %s [%d%%]\n", privcnt.cover, 9.120 + s += sprintf(s,"%10ld %s [%ld%%]\n", privcnt.cover, 9.121 "cover", (privcnt.cover*100L)/sum); 9.122 if (privcnt.fc) 9.123 - s += sprintf(s,"%10d %s [%d%%]\n", privcnt.fc, 9.124 + s += sprintf(s,"%10ld %s [%ld%%]\n", privcnt.fc, 9.125 "privified-fc", (privcnt.fc*100L)/sum); 9.126 if (privcnt.cpuid) 9.127 - s += sprintf(s,"%10d %s [%d%%]\n", privcnt.cpuid, 9.128 + s += sprintf(s,"%10ld %s [%ld%%]\n", privcnt.cpuid, 9.129 "privified-getcpuid", (privcnt.cpuid*100L)/sum); 9.130 for (i=0; i < 64; i++) if (privcnt.Mpriv_cnt[i]) { 9.131 if (!Mpriv_str[i]) s += sprintf(s,"PRIVSTRING NULL!!\n"); 9.132 - else s += sprintf(s,"%10d %s [%d%%]\n", privcnt.Mpriv_cnt[i], 9.133 + else s += sprintf(s,"%10ld %s [%ld%%]\n", privcnt.Mpriv_cnt[i], 9.134 Mpriv_str[i], (privcnt.Mpriv_cnt[i]*100L)/sum); 9.135 if (i == 0x24) { // mov from CR 9.136 s += sprintf(s," ["); 9.137 for (j=0; j < 128; j++) if (from_cr_cnt[j]) { 9.138 if (!cr_str[j]) 9.139 s += sprintf(s,"PRIVSTRING NULL!!\n"); 9.140 - s += sprintf(s,"%s(%d),",cr_str[j],from_cr_cnt[j]); 9.141 + s += sprintf(s,"%s(%ld),",cr_str[j],from_cr_cnt[j]); 9.142 } 9.143 s += sprintf(s,"]\n"); 9.144 } 9.145 @@ -996,7 +999,7 @@ int dump_privop_counts(char *buf) 9.146 for (j=0; j < 128; j++) if (to_cr_cnt[j]) { 9.147 if (!cr_str[j]) 9.148 s += sprintf(s,"PRIVSTRING NULL!!\n"); 9.149 - s += sprintf(s,"%s(%d),",cr_str[j],to_cr_cnt[j]); 9.150 + s += sprintf(s,"%s(%ld),",cr_str[j],to_cr_cnt[j]); 9.151 } 9.152 s += sprintf(s,"]\n"); 9.153 } 9.154 @@ -1050,7 +1053,7 @@ int dump_privop_addrs(char *buf) 9.155 s += sprintf(s,"%s:\n",v->instname); 9.156 for (j = 0; j < PRIVOP_COUNT_NADDRS; j++) { 9.157 if (!v->addr[j]) break; 9.158 - s += sprintf(s," @%p #%ld\n",v->addr[j],v->count[j]); 9.159 + s += sprintf(s," at 0x%lx #%ld\n",v->addr[j],v->count[j]); 9.160 } 9.161 if (v->overflow) 9.162 s += sprintf(s," other #%ld\n",v->overflow); 9.163 @@ -1085,17 +1088,17 @@ extern unsigned long context_switch_coun 9.164 int dump_misc_stats(char *buf) 9.165 { 9.166 char *s = buf; 9.167 - s += sprintf(s,"Virtual TR translations: %d\n",tr_translate_count); 9.168 - s += sprintf(s,"Virtual VHPT slow translations: %d\n",vhpt_translate_count); 9.169 - s += sprintf(s,"Virtual VHPT fast translations: %d\n",fast_vhpt_translate_count); 9.170 - s += sprintf(s,"Virtual DTLB translations: %d\n",dtlb_translate_count); 9.171 - s += sprintf(s,"Physical translations: %d\n",phys_translate_count); 9.172 - s += sprintf(s,"Recoveries to page fault: %d\n",recover_to_page_fault_count); 9.173 - s += sprintf(s,"Recoveries to break fault: %d\n",recover_to_break_fault_count); 9.174 - s += sprintf(s,"Idle when pending: %d\n",idle_when_pending); 9.175 - s += sprintf(s,"PAL_HALT_LIGHT (no pending): %d\n",pal_halt_light_count); 9.176 - s += sprintf(s,"context switches: %d\n",context_switch_count); 9.177 - s += sprintf(s,"Lazy covers: %d\n",lazy_cover_count); 9.178 + s += sprintf(s,"Virtual TR translations: %ld\n",tr_translate_count); 9.179 + s += sprintf(s,"Virtual VHPT slow translations: %ld\n",vhpt_translate_count); 9.180 + s += sprintf(s,"Virtual VHPT fast translations: %ld\n",fast_vhpt_translate_count); 9.181 + s += sprintf(s,"Virtual DTLB translations: %ld\n",dtlb_translate_count); 9.182 + s += sprintf(s,"Physical translations: %ld\n",phys_translate_count); 9.183 + s += sprintf(s,"Recoveries to page fault: %ld\n",recover_to_page_fault_count); 9.184 + s += sprintf(s,"Recoveries to break fault: %ld\n",recover_to_break_fault_count); 9.185 + s += sprintf(s,"Idle when pending: %ld\n",idle_when_pending); 9.186 + s += sprintf(s,"PAL_HALT_LIGHT (no pending): %ld\n",pal_halt_light_count); 9.187 + s += sprintf(s,"context switches: %ld\n",context_switch_count); 9.188 + s += sprintf(s,"Lazy covers: %ld\n",lazy_cover_count); 9.189 return s - buf; 9.190 } 9.191 9.192 @@ -1120,17 +1123,17 @@ int dump_hyperprivop_counts(char *buf) 9.193 char *s = buf; 9.194 unsigned long total = 0; 9.195 for (i = 1; i <= HYPERPRIVOP_MAX; i++) total += slow_hyperpriv_cnt[i]; 9.196 - s += sprintf(s,"Slow hyperprivops (total %d):\n",total); 9.197 + s += sprintf(s,"Slow hyperprivops (total %ld):\n",total); 9.198 for (i = 1; i <= HYPERPRIVOP_MAX; i++) 9.199 if (slow_hyperpriv_cnt[i]) 9.200 - s += sprintf(s,"%10d %s\n", 9.201 + s += sprintf(s,"%10ld %s\n", 9.202 slow_hyperpriv_cnt[i], hyperpriv_str[i]); 9.203 total = 0; 9.204 for (i = 1; i <= HYPERPRIVOP_MAX; i++) total += fast_hyperpriv_cnt[i]; 9.205 - s += sprintf(s,"Fast hyperprivops (total %d):\n",total); 9.206 + s += sprintf(s,"Fast hyperprivops (total %ld):\n",total); 9.207 for (i = 1; i <= HYPERPRIVOP_MAX; i++) 9.208 if (fast_hyperpriv_cnt[i]) 9.209 - s += sprintf(s,"%10d %s\n", 9.210 + s += sprintf(s,"%10ld %s\n", 9.211 fast_hyperpriv_cnt[i], hyperpriv_str[i]); 9.212 return s - buf; 9.213 }
10.1 --- a/xen/arch/ia64/xen/process.c Tue Feb 28 10:26:43 2006 -0700 10.2 +++ b/xen/arch/ia64/xen/process.c Tue Feb 28 10:29:30 2006 -0700 10.3 @@ -33,8 +33,14 @@ 10.4 #include <xen/multicall.h> 10.5 #include <asm/debugger.h> 10.6 10.7 -extern unsigned long vcpu_get_itir_on_fault(struct vcpu *, UINT64); 10.8 extern void die_if_kernel(char *str, struct pt_regs *regs, long err); 10.9 +/* FIXME: where these declarations shold be there ? */ 10.10 +extern void load_region_regs(struct vcpu *); 10.11 +extern void panic_domain(struct pt_regs *, const char *, ...); 10.12 +extern long platform_is_hp_ski(void); 10.13 +extern int ia64_hyperprivop(unsigned long, REGS *); 10.14 +extern int ia64_hypercall(struct pt_regs *regs); 10.15 +extern void vmx_do_launch(struct vcpu *); 10.16 10.17 extern unsigned long dom0_start, dom0_size; 10.18 10.19 @@ -98,14 +104,17 @@ unsigned long translate_domain_pte(unsig 10.20 mpaddr = ((pteval & _PAGE_PPN_MASK) & ~mask) | (address & mask); 10.21 if (d == dom0) { 10.22 if (mpaddr < dom0_start || mpaddr >= dom0_start + dom0_size) { 10.23 - //printk("translate_domain_pte: out-of-bounds dom0 mpaddr %p! itc=%lx...\n",mpaddr,ia64_get_itc()); 10.24 + /* 10.25 + printk("translate_domain_pte: out-of-bounds dom0 mpaddr 0x%lx! itc=%lx...\n", 10.26 + mpaddr, ia64_get_itc()); 10.27 + */ 10.28 tdpfoo(); 10.29 } 10.30 } 10.31 else if ((mpaddr >> PAGE_SHIFT) > d->max_pages) { 10.32 if ((mpaddr & ~0x1fffL ) != (1L << 40)) 10.33 - printf("translate_domain_pte: bad mpa=%p (> %p),vadr=%p,pteval=%p,itir=%p\n", 10.34 - mpaddr,d->max_pages<<PAGE_SHIFT,address,pteval,itir); 10.35 + printf("translate_domain_pte: bad mpa=0x%lx (> 0x%lx),vadr=0x%lx,pteval=0x%lx,itir=0x%lx\n", 10.36 + mpaddr, (unsigned long) d->max_pages<<PAGE_SHIFT, address, pteval, itir); 10.37 tdpfoo(); 10.38 } 10.39 pteval2 = lookup_domain_mpa(d,mpaddr); 10.40 @@ -123,7 +132,8 @@ unsigned long translate_domain_mpaddr(un 10.41 10.42 if (current->domain == dom0) { 10.43 if (mpaddr < dom0_start || mpaddr >= dom0_start + dom0_size) { 10.44 - printk("translate_domain_mpaddr: out-of-bounds dom0 mpaddr %p! continuing...\n",mpaddr); 10.45 + printk("translate_domain_mpaddr: out-of-bounds dom0 mpaddr 0x%lx! continuing...\n", 10.46 + mpaddr); 10.47 tdpfoo(); 10.48 } 10.49 } 10.50 @@ -150,7 +160,7 @@ int dump_reflect_counts(char *buf) 10.51 10.52 s += sprintf(s,"Slow reflections by vector:\n"); 10.53 for (i = 0, j = 0; i < 0x80; i++) { 10.54 - if (cnt = slow_reflect_count[i]) { 10.55 + if ( (cnt = slow_reflect_count[i]) != 0 ) { 10.56 s += sprintf(s,"0x%02x00:%10d, ",i,cnt); 10.57 if ((j++ & 3) == 3) s += sprintf(s,"\n"); 10.58 } 10.59 @@ -158,7 +168,7 @@ int dump_reflect_counts(char *buf) 10.60 if (j & 3) s += sprintf(s,"\n"); 10.61 s += sprintf(s,"Fast reflections by vector:\n"); 10.62 for (i = 0, j = 0; i < 0x80; i++) { 10.63 - if (cnt = fast_reflect_count[i]) { 10.64 + if ( (cnt = fast_reflect_count[i]) != 0 ) { 10.65 s += sprintf(s,"0x%02x00:%10d, ",i,cnt); 10.66 if ((j++ & 3) == 3) s += sprintf(s,"\n"); 10.67 } 10.68 @@ -186,7 +196,6 @@ panic_domain(regs,"psr.ic off, deliverin 10.69 10.70 void reflect_interruption(unsigned long isr, struct pt_regs *regs, unsigned long vector) 10.71 { 10.72 - unsigned long vcpu_get_ipsr_int_state(struct vcpu *,unsigned long); 10.73 struct vcpu *v = current; 10.74 10.75 if (!PSCB(v,interrupt_collection_enabled)) 10.76 @@ -205,7 +214,7 @@ void reflect_interruption(unsigned long 10.77 #ifdef CONFIG_SMP 10.78 #warning "SMP FIXME: sharedinfo doesn't handle smp yet, need page per vcpu" 10.79 #endif 10.80 - regs->r31 = &(((mapped_regs_t *)SHARED_ARCHINFO_ADDR)->ipsr); 10.81 + regs->r31 = (unsigned long) &(((mapped_regs_t *)SHARED_ARCHINFO_ADDR)->ipsr); 10.82 10.83 PSCB(v,interrupt_delivery_enabled) = 0; 10.84 PSCB(v,interrupt_collection_enabled) = 0; 10.85 @@ -219,13 +228,13 @@ unsigned long pending_false_positive = 0 10.86 10.87 void reflect_extint(struct pt_regs *regs) 10.88 { 10.89 - extern unsigned long vcpu_verbose, privop_trace; 10.90 +// extern unsigned long vcpu_verbose, privop_trace; 10.91 unsigned long isr = regs->cr_ipsr & IA64_PSR_RI; 10.92 struct vcpu *v = current; 10.93 - static first_extint = 1; 10.94 + static int first_extint = 1; 10.95 10.96 if (first_extint) { 10.97 - printf("Delivering first extint to domain: isr=%p, iip=%p\n",isr,regs->cr_iip); 10.98 + printf("Delivering first extint to domain: isr=0x%lx, iip=0x%lx\n", isr, regs->cr_iip); 10.99 //privop_trace = 1; vcpu_verbose = 1; 10.100 first_extint = 0; 10.101 } 10.102 @@ -297,11 +306,11 @@ void ia64_do_page_fault (unsigned long a 10.103 // should never happen. If it does, region 0 addr may 10.104 // indicate a bad xen pointer 10.105 printk("*** xen_handle_domain_access: exception table" 10.106 - " lookup failed, iip=%p, addr=%p, spinning...\n", 10.107 - iip,address); 10.108 + " lookup failed, iip=0x%lx, addr=0x%lx, spinning...\n", 10.109 + iip, address); 10.110 panic_domain(regs,"*** xen_handle_domain_access: exception table" 10.111 - " lookup failed, iip=%p, addr=%p, spinning...\n", 10.112 - iip,address); 10.113 + " lookup failed, iip=0x%lx, addr=0x%lx, spinning...\n", 10.114 + iip, address); 10.115 } 10.116 return; 10.117 } 10.118 @@ -329,9 +338,12 @@ ia64_fault (unsigned long vector, unsign 10.119 unsigned long arg6, unsigned long arg7, unsigned long stack) 10.120 { 10.121 struct pt_regs *regs = (struct pt_regs *) &stack; 10.122 - unsigned long code, error = isr; 10.123 + unsigned long code; 10.124 +#if 0 10.125 + unsigned long error = isr; 10.126 + int result, sig; 10.127 +#endif 10.128 char buf[128]; 10.129 - int result, sig; 10.130 static const char *reason[] = { 10.131 "IA-64 Illegal Operation fault", 10.132 "IA-64 Privileged Operation fault", 10.133 @@ -543,7 +555,6 @@ do_ssc(unsigned long ssc, struct pt_regs 10.134 /**/ static int last_fd, last_count; // FIXME FIXME FIXME 10.135 /**/ // BROKEN FOR MULTIPLE DOMAINS & SMP 10.136 /**/ struct ssc_disk_stat { int fd; unsigned count;} *stat, last_stat; 10.137 - extern unsigned long vcpu_verbose, privop_trace; 10.138 10.139 arg0 = vcpu_get_gr(current,32); 10.140 switch(ssc) { 10.141 @@ -588,11 +599,11 @@ if (!running_on_sim) { printf("SSC_OPEN, 10.142 arg3 = vcpu_get_gr(current,35); 10.143 if (arg2) { // metaphysical address of descriptor 10.144 struct ssc_disk_req *req; 10.145 - unsigned long mpaddr, paddr; 10.146 + unsigned long mpaddr; 10.147 long len; 10.148 10.149 arg2 = translate_domain_mpaddr(arg2); 10.150 - req = (struct disk_req *)__va(arg2); 10.151 + req = (struct ssc_disk_req *) __va(arg2); 10.152 req->len &= 0xffffffffL; // avoid strange bug 10.153 len = req->len; 10.154 /**/ last_fd = arg1; 10.155 @@ -640,7 +651,8 @@ if (!running_on_sim) { printf("SSC_OPEN, 10.156 vcpu_set_gr(current,8,-1L,0); 10.157 break; 10.158 default: 10.159 - printf("ia64_handle_break: bad ssc code %lx, iip=%p, b0=%p... spinning\n",ssc,regs->cr_iip,regs->b0); 10.160 + printf("ia64_handle_break: bad ssc code %lx, iip=0x%lx, b0=0x%lx... spinning\n", 10.161 + ssc, regs->cr_iip, regs->b0); 10.162 while(1); 10.163 break; 10.164 } 10.165 @@ -696,9 +708,9 @@ void 10.166 ia64_handle_privop (unsigned long ifa, struct pt_regs *regs, unsigned long isr, unsigned long itir) 10.167 { 10.168 IA64FAULT vector; 10.169 - struct domain *d = current->domain; 10.170 struct vcpu *v = current; 10.171 - vector = priv_emulate(current,regs,isr); 10.172 + 10.173 + vector = priv_emulate(v,regs,isr); 10.174 if (vector != IA64_NO_FAULT && vector != IA64_RFI_IN_PROGRESS) { 10.175 // Note: if a path results in a vector to reflect that requires 10.176 // iha/itir (e.g. vcpu_force_data_miss), they must be set there 10.177 @@ -712,8 +724,7 @@ UINT64 int_counts[INTR_TYPE_MAX]; 10.178 void 10.179 ia64_handle_reflection (unsigned long ifa, struct pt_regs *regs, unsigned long isr, unsigned long iim, unsigned long vector) 10.180 { 10.181 - struct domain *d = (struct domain *) current->domain; 10.182 - struct vcpu *v = (struct domain *) current; 10.183 + struct vcpu *v = current; 10.184 unsigned long check_lazy_cover = 0; 10.185 unsigned long psr = regs->cr_ipsr; 10.186 10.187 @@ -753,7 +764,7 @@ ia64_handle_reflection (unsigned long if 10.188 } 10.189 #endif 10.190 printf("*** NaT fault... attempting to handle as privop\n"); 10.191 -printf("isr=%p, ifa=%p,iip=%p,ipsr=%p\n",isr,ifa,regs->cr_iip,psr); 10.192 +printf("isr=0x%lx, ifa=0x%lx, iip=0x%lx, ipsr=0x%lx\n", isr, ifa, regs->cr_iip, psr); 10.193 //regs->eml_unat = 0; FIXME: DO WE NEED THIS??? 10.194 // certain NaT faults are higher priority than privop faults 10.195 vector = priv_emulate(v,regs,isr); 10.196 @@ -800,8 +811,7 @@ unsigned long __hypercall_create_continu 10.197 unsigned int op, unsigned int nr_args, ...) 10.198 { 10.199 struct mc_state *mcs = &mc_state[smp_processor_id()]; 10.200 - VCPU *vcpu = current; 10.201 - struct cpu_user_regs *regs = vcpu_regs(vcpu); 10.202 + struct vcpu *v = current; 10.203 unsigned int i; 10.204 va_list args; 10.205 10.206 @@ -809,25 +819,25 @@ unsigned long __hypercall_create_continu 10.207 if ( test_bit(_MCSF_in_multicall, &mcs->flags) ) { 10.208 panic("PREEMPT happen in multicall\n"); // Not support yet 10.209 } else { 10.210 - vcpu_set_gr(vcpu, 2, op, 0); 10.211 + vcpu_set_gr(v, 2, op, 0); 10.212 for ( i = 0; i < nr_args; i++) { 10.213 switch (i) { 10.214 - case 0: vcpu_set_gr(vcpu, 14, va_arg(args, unsigned long), 0); 10.215 + case 0: vcpu_set_gr(v, 14, va_arg(args, unsigned long), 0); 10.216 break; 10.217 - case 1: vcpu_set_gr(vcpu, 15, va_arg(args, unsigned long), 0); 10.218 + case 1: vcpu_set_gr(v, 15, va_arg(args, unsigned long), 0); 10.219 break; 10.220 - case 2: vcpu_set_gr(vcpu, 16, va_arg(args, unsigned long), 0); 10.221 + case 2: vcpu_set_gr(v, 16, va_arg(args, unsigned long), 0); 10.222 break; 10.223 - case 3: vcpu_set_gr(vcpu, 17, va_arg(args, unsigned long), 0); 10.224 + case 3: vcpu_set_gr(v, 17, va_arg(args, unsigned long), 0); 10.225 break; 10.226 - case 4: vcpu_set_gr(vcpu, 18, va_arg(args, unsigned long), 0); 10.227 + case 4: vcpu_set_gr(v, 18, va_arg(args, unsigned long), 0); 10.228 break; 10.229 default: panic("Too many args for hypercall continuation\n"); 10.230 break; 10.231 } 10.232 } 10.233 } 10.234 - vcpu->arch.hypercall_continuation = 1; 10.235 + v->arch.hypercall_continuation = 1; 10.236 va_end(args); 10.237 return op; 10.238 }
11.1 --- a/xen/arch/ia64/xen/regionreg.c Tue Feb 28 10:26:43 2006 -0700 11.2 +++ b/xen/arch/ia64/xen/regionreg.c Tue Feb 28 10:29:30 2006 -0700 11.3 @@ -18,6 +18,8 @@ 11.4 extern void ia64_new_rr7(unsigned long rid,void *shared_info, void *shared_arch_info, unsigned long p_vhpt, unsigned long v_pal); 11.5 extern void *pal_vaddr; 11.6 11.7 +/* FIXME: where these declarations should be there ? */ 11.8 +extern void panic_domain(struct pt_regs *, const char *, ...); 11.9 11.10 #define IA64_MIN_IMPL_RID_BITS (IA64_MIN_IMPL_RID_MSB+1) 11.11 #define IA64_MAX_IMPL_RID_BITS 24 11.12 @@ -142,7 +144,7 @@ int allocate_rid_range(struct domain *d, 11.13 // setup domain struct 11.14 d->arch.rid_bits = ridbits; 11.15 d->arch.starting_rid = i << IA64_MIN_IMPL_RID_BITS; d->arch.ending_rid = (i+n_rid_blocks) << IA64_MIN_IMPL_RID_BITS; 11.16 -printf("###allocating rid_range, domain %p: starting_rid=%lx, ending_rid=%lx\n", 11.17 +printf("###allocating rid_range, domain %p: starting_rid=%x, ending_rid=%x\n", 11.18 d,d->arch.starting_rid, d->arch.ending_rid); 11.19 11.20 return 1; 11.21 @@ -219,8 +221,8 @@ int set_one_rr(unsigned long rr, unsigne 11.22 newrid = v->arch.starting_rid + rrv.rid; 11.23 11.24 if (newrid > v->arch.ending_rid) { 11.25 - printk("can't set rr%d to %lx, starting_rid=%lx," 11.26 - "ending_rid=%lx, val=%lx\n", rreg, newrid, 11.27 + printk("can't set rr%d to %lx, starting_rid=%x," 11.28 + "ending_rid=%x, val=%lx\n", (int) rreg, newrid, 11.29 v->arch.starting_rid,v->arch.ending_rid,val); 11.30 return 0; 11.31 } 11.32 @@ -253,7 +255,7 @@ int set_one_rr(unsigned long rr, unsigne 11.33 else if (rreg == 7) 11.34 ia64_new_rr7(vmMangleRID(newrrv.rrval),v->vcpu_info, 11.35 v->arch.privregs, __get_cpu_var(vhpt_paddr), 11.36 - pal_vaddr); 11.37 + (unsigned long) pal_vaddr); 11.38 else set_rr(rr,newrrv.rrval); 11.39 #endif 11.40 return 1; 11.41 @@ -263,11 +265,12 @@ int set_one_rr(unsigned long rr, unsigne 11.42 int set_metaphysical_rr0(void) 11.43 { 11.44 struct vcpu *v = current; 11.45 - ia64_rr rrv; 11.46 +// ia64_rr rrv; 11.47 11.48 // rrv.ve = 1; FIXME: TURN ME BACK ON WHEN VHPT IS WORKING 11.49 ia64_set_rr(0,v->arch.metaphysical_rr0); 11.50 ia64_srlz_d(); 11.51 + return 1; 11.52 } 11.53 11.54 // validates/changes region registers 0-6 in the currently executing domain
12.1 --- a/xen/arch/ia64/xen/sn_console.c Tue Feb 28 10:26:43 2006 -0700 12.2 +++ b/xen/arch/ia64/xen/sn_console.c Tue Feb 28 10:29:30 2006 -0700 12.3 @@ -9,7 +9,13 @@ 12.4 #include <asm/sn/sn_sal.h> 12.5 #include <xen/serial.h> 12.6 12.7 -void sn_putc(struct serial_port *, char); 12.8 +/* 12.9 + * sn_putc - Send a character to the console, polled or interrupt mode 12.10 + */ 12.11 +static void sn_putc(struct serial_port *port, char c) 12.12 +{ 12.13 + ia64_sn_console_putc(c); 12.14 +} 12.15 12.16 static struct uart_driver sn_sal_console = { 12.17 .putc = sn_putc, 12.18 @@ -75,11 +81,3 @@ int __init sn_serial_console_early_setup 12.19 12.20 return 0; 12.21 } 12.22 - 12.23 -/* 12.24 - * sn_putc - Send a character to the console, polled or interrupt mode 12.25 - */ 12.26 -void sn_putc(struct serial_port *port, char c) 12.27 -{ 12.28 - return ia64_sn_console_putc(c); 12.29 -}
13.1 --- a/xen/arch/ia64/xen/vcpu.c Tue Feb 28 10:26:43 2006 -0700 13.2 +++ b/xen/arch/ia64/xen/vcpu.c Tue Feb 28 10:29:30 2006 -0700 13.3 @@ -21,8 +21,16 @@ int in_tpa = 0; 13.4 #include <asm/processor.h> 13.5 #include <asm/delay.h> 13.6 #include <asm/vmx_vcpu.h> 13.7 +#include <asm/vhpt.h> 13.8 +#include <asm/tlbflush.h> 13.9 #include <xen/event.h> 13.10 13.11 +/* FIXME: where these declarations should be there ? */ 13.12 +extern void getreg(unsigned long regnum, unsigned long *val, int *nat, struct pt_regs *regs); 13.13 +extern void setreg(unsigned long regnum, unsigned long val, int nat, struct pt_regs *regs); 13.14 +extern void panic_domain(struct pt_regs *, const char *, ...); 13.15 +extern int set_metaphysical_rr0(void); 13.16 + 13.17 typedef union { 13.18 struct ia64_psr ia64_psr; 13.19 unsigned long i64; 13.20 @@ -47,10 +55,10 @@ typedef union { 13.21 #define STATIC 13.22 13.23 #ifdef PRIVOP_ADDR_COUNT 13.24 -struct privop_addr_count privop_addr_counter[PRIVOP_COUNT_NINSTS] = { 13.25 - { "=ifa", { 0 }, { 0 }, 0 }, 13.26 +struct privop_addr_count privop_addr_counter[PRIVOP_COUNT_NINSTS+1] = { 13.27 + { "=ifa", { 0 }, { 0 }, 0 }, 13.28 { "thash", { 0 }, { 0 }, 0 }, 13.29 - 0 13.30 + { 0, { 0 }, { 0 }, 0 } 13.31 }; 13.32 extern void privop_count_addr(unsigned long addr, int inst); 13.33 #define PRIVOP_COUNT_ADDR(regs,inst) privop_count_addr(regs->cr_iip,inst) 13.34 @@ -375,7 +383,7 @@ BOOLEAN vcpu_get_psr_i(VCPU *vcpu) 13.35 UINT64 vcpu_get_ipsr_int_state(VCPU *vcpu,UINT64 prevpsr) 13.36 { 13.37 UINT64 dcr = PSCBX(vcpu,dcr); 13.38 - PSR psr = {0}; 13.39 + PSR psr; 13.40 13.41 //printf("*** vcpu_get_ipsr_int_state (0x%016lx)...",prevpsr); 13.42 psr.i64 = prevpsr; 13.43 @@ -397,7 +405,7 @@ UINT64 vcpu_get_ipsr_int_state(VCPU *vcp 13.44 13.45 IA64FAULT vcpu_get_dcr(VCPU *vcpu, UINT64 *pval) 13.46 { 13.47 -extern unsigned long privop_trace; 13.48 +//extern unsigned long privop_trace; 13.49 //privop_trace=0; 13.50 //verbose("vcpu_get_dcr: called @%p\n",PSCB(vcpu,iip)); 13.51 // Reads of cr.dcr on Xen always have the sign bit set, so 13.52 @@ -525,7 +533,7 @@ IA64FAULT vcpu_get_iha(VCPU *vcpu, UINT6 13.53 13.54 IA64FAULT vcpu_set_dcr(VCPU *vcpu, UINT64 val) 13.55 { 13.56 -extern unsigned long privop_trace; 13.57 +//extern unsigned long privop_trace; 13.58 //privop_trace=1; 13.59 // Reads of cr.dcr on SP always have the sign bit set, so 13.60 // a domain can differentiate whether it is running on SP or not 13.61 @@ -747,7 +755,7 @@ UINT64 vcpu_deliverable_timer(VCPU *vcpu 13.62 13.63 IA64FAULT vcpu_get_lid(VCPU *vcpu, UINT64 *pval) 13.64 { 13.65 -extern unsigned long privop_trace; 13.66 +//extern unsigned long privop_trace; 13.67 //privop_trace=1; 13.68 //TODO: Implement this 13.69 printf("vcpu_get_lid: WARNING: Getting cr.lid always returns zero\n"); 13.70 @@ -764,9 +772,10 @@ IA64FAULT vcpu_get_ivr(VCPU *vcpu, UINT6 13.71 #define HEARTBEAT_FREQ 16 // period in seconds 13.72 #ifdef HEARTBEAT_FREQ 13.73 #define N_DOMS 16 // period in seconds 13.74 +#if 0 13.75 static long count[N_DOMS] = { 0 }; 13.76 +#endif 13.77 static long nonclockcount[N_DOMS] = { 0 }; 13.78 - REGS *regs = vcpu_regs(vcpu); 13.79 unsigned domid = vcpu->domain->domain_id; 13.80 #endif 13.81 #ifdef IRQ_DEBUG 13.82 @@ -803,7 +812,7 @@ IA64FAULT vcpu_get_ivr(VCPU *vcpu, UINT6 13.83 // getting ivr has "side effects" 13.84 #ifdef IRQ_DEBUG 13.85 if (firsttime[vector]) { 13.86 - printf("*** First get_ivr on vector=%d,itc=%lx\n", 13.87 + printf("*** First get_ivr on vector=%lu,itc=%lx\n", 13.88 vector,ia64_get_itc()); 13.89 firsttime[vector]=0; 13.90 } 13.91 @@ -817,7 +826,7 @@ IA64FAULT vcpu_get_ivr(VCPU *vcpu, UINT6 13.92 13.93 i = vector >> 6; 13.94 mask = 1L << (vector & 0x3f); 13.95 -//printf("ZZZZZZ vcpu_get_ivr: setting insvc mask for vector %ld\n",vector); 13.96 +//printf("ZZZZZZ vcpu_get_ivr: setting insvc mask for vector %lu\n",vector); 13.97 PSCBX(vcpu,insvc[i]) |= mask; 13.98 PSCBX(vcpu,irr[i]) &= ~mask; 13.99 //PSCB(vcpu,pending_interruption)--; 13.100 @@ -983,19 +992,19 @@ void vcpu_enable_timer(VCPU *vcpu,UINT64 13.101 { 13.102 PSCBX(vcpu,xen_timer_interval) = cycles; 13.103 vcpu_set_next_timer(vcpu); 13.104 - printf("vcpu_enable_timer(%d): interval set to %d cycles\n", 13.105 + printf("vcpu_enable_timer: interval set to %lu cycles\n", 13.106 PSCBX(vcpu,xen_timer_interval)); 13.107 __set_bit(PSCB(vcpu,itv), PSCB(vcpu,delivery_mask)); 13.108 } 13.109 13.110 IA64FAULT vcpu_set_itv(VCPU *vcpu, UINT64 val) 13.111 { 13.112 -extern unsigned long privop_trace; 13.113 +//extern unsigned long privop_trace; 13.114 //privop_trace=1; 13.115 if (val & 0xef00) return (IA64_ILLOP_FAULT); 13.116 PSCB(vcpu,itv) = val; 13.117 if (val & 0x10000) { 13.118 -printf("**** vcpu_set_itv(%d): vitm=%lx, setting to 0\n",val,PSCBX(vcpu,domain_itm)); 13.119 +printf("**** vcpu_set_itv(%lu): vitm=%lx, setting to 0\n",val,PSCBX(vcpu,domain_itm)); 13.120 PSCBX(vcpu,domain_itm) = 0; 13.121 } 13.122 else vcpu_enable_timer(vcpu,1000000L); 13.123 @@ -1103,7 +1112,7 @@ void vcpu_set_next_timer(VCPU *vcpu) 13.124 13.125 IA64FAULT vcpu_set_itm(VCPU *vcpu, UINT64 val) 13.126 { 13.127 - UINT now = ia64_get_itc(); 13.128 + //UINT now = ia64_get_itc(); 13.129 13.130 //if (val < now) val = now + 1000; 13.131 //printf("*** vcpu_set_itm: called with %lx\n",val); 13.132 @@ -1114,7 +1123,10 @@ IA64FAULT vcpu_set_itm(VCPU *vcpu, UINT6 13.133 13.134 IA64FAULT vcpu_set_itc(VCPU *vcpu, UINT64 val) 13.135 { 13.136 - 13.137 +#define DISALLOW_SETTING_ITC_FOR_NOW 13.138 +#ifdef DISALLOW_SETTING_ITC_FOR_NOW 13.139 +printf("vcpu_set_itc: Setting ar.itc is currently disabled\n"); 13.140 +#else 13.141 UINT64 oldnow = ia64_get_itc(); 13.142 UINT64 olditm = PSCBX(vcpu,domain_itm); 13.143 unsigned long d = olditm - oldnow; 13.144 @@ -1122,10 +1134,6 @@ IA64FAULT vcpu_set_itc(VCPU *vcpu, UINT6 13.145 13.146 UINT64 newnow = val, min_delta; 13.147 13.148 -#define DISALLOW_SETTING_ITC_FOR_NOW 13.149 -#ifdef DISALLOW_SETTING_ITC_FOR_NOW 13.150 -printf("vcpu_set_itc: Setting ar.itc is currently disabled\n"); 13.151 -#else 13.152 local_irq_disable(); 13.153 if (olditm) { 13.154 printf("**** vcpu_set_itc(%lx): vitm changed to %lx\n",val,newnow+d); 13.155 @@ -1314,7 +1322,7 @@ IA64FAULT vcpu_translate(VCPU *vcpu, UIN 13.156 // this down, but since it has been apparently harmless, just flag it for now 13.157 // panic_domain(vcpu_regs(vcpu), 13.158 printk( 13.159 - "vcpu_translate: bad physical address: %p\n",address); 13.160 + "vcpu_translate: bad physical address: 0x%lx\n",address); 13.161 } 13.162 *pteval = (address & _PAGE_PPN_MASK) | __DIRTY_BITS | _PAGE_PL_2 | _PAGE_AR_RWX; 13.163 *itir = PAGE_SHIFT << 2; 13.164 @@ -1327,7 +1335,8 @@ IA64FAULT vcpu_translate(VCPU *vcpu, UIN 13.165 unsigned long vipsr = PSCB(vcpu,ipsr); 13.166 unsigned long iip = regs->cr_iip; 13.167 unsigned long ipsr = regs->cr_ipsr; 13.168 - printk("vcpu_translate: bad address %p, viip=%p, vipsr=%p, iip=%p, ipsr=%p continuing\n", address, viip, vipsr, iip, ipsr); 13.169 + printk("vcpu_translate: bad address 0x%lx, viip=0x%lx, vipsr=0x%lx, iip=0x%lx, ipsr=0x%lx continuing\n", 13.170 + address, viip, vipsr, iip, ipsr); 13.171 } 13.172 13.173 rr = PSCB(vcpu,rrs)[region]; 13.174 @@ -1888,7 +1897,7 @@ IA64FAULT vcpu_ptc_g(VCPU *vcpu, UINT64 13.175 13.176 IA64FAULT vcpu_ptc_ga(VCPU *vcpu,UINT64 vadr,UINT64 addr_range) 13.177 { 13.178 - extern ia64_global_tlb_purge(UINT64 start, UINT64 end, UINT64 nbits); 13.179 + extern void ia64_global_tlb_purge(UINT64 start, UINT64 end, UINT64 nbits); 13.180 // FIXME: validate not flushing Xen addresses 13.181 // if (Xen address) return(IA64_ILLOP_FAULT); 13.182 // FIXME: ??breaks if domain PAGE_SIZE < Xen PAGE_SIZE
14.1 --- a/xen/arch/ia64/xen/vhpt.c Tue Feb 28 10:26:43 2006 -0700 14.2 +++ b/xen/arch/ia64/xen/vhpt.c Tue Feb 28 10:29:30 2006 -0700 14.3 @@ -21,7 +21,7 @@ DEFINE_PER_CPU (unsigned long, vhpt_pend 14.4 void vhpt_flush(void) 14.5 { 14.6 struct vhpt_lf_entry *v = (void *)VHPT_ADDR; 14.7 - int i, cnt = 0; 14.8 + int i; 14.9 #if 0 14.10 static int firsttime = 2; 14.11 14.12 @@ -48,7 +48,6 @@ printf("vhpt_flush: ******************** 14.13 #ifdef VHPT_GLOBAL 14.14 void vhpt_flush_address(unsigned long vadr, unsigned long addr_range) 14.15 { 14.16 - unsigned long ps; 14.17 struct vhpt_lf_entry *vlfe; 14.18 14.19 if ((vadr >> 61) == 7) { 14.20 @@ -131,7 +130,8 @@ void vhpt_init(void) 14.21 // allocate a huge chunk of physical memory.... how??? 14.22 vhpt_total_size = 1 << VHPT_SIZE_LOG2; // 4MB, 16MB, 64MB, or 256MB 14.23 vhpt_alignment = 1 << VHPT_SIZE_LOG2; // 4MB, 16MB, 64MB, or 256MB 14.24 - printf("vhpt_init: vhpt size=%p, align=%p\n",vhpt_total_size,vhpt_alignment); 14.25 + printf("vhpt_init: vhpt size=0x%lx, align=0x%lx\n", 14.26 + vhpt_total_size, vhpt_alignment); 14.27 /* This allocation only holds true if vhpt table is unique for 14.28 * all domains. Or else later new vhpt table should be allocated 14.29 * from domain heap when each domain is created. Assume xen buddy 14.30 @@ -146,8 +146,8 @@ void vhpt_init(void) 14.31 paddr = page_to_maddr(page); 14.32 __get_cpu_var(vhpt_paddr) = paddr; 14.33 __get_cpu_var(vhpt_pend) = paddr + vhpt_total_size - 1; 14.34 - printf("vhpt_init: vhpt paddr=%p, end=%p\n", 14.35 - paddr, __get_cpu_var(vhpt_pend)); 14.36 + printf("vhpt_init: vhpt paddr=0x%lx, end=0x%lx\n", 14.37 + paddr, __get_cpu_var(vhpt_pend)); 14.38 pte = pte_val(pfn_pte(paddr >> PAGE_SHIFT, PAGE_KERNEL)); 14.39 vhpt_map(pte); 14.40 ia64_set_pta(VHPT_ADDR | (1 << 8) | (VHPT_SIZE_LOG2 << 2) | 14.41 @@ -173,6 +173,6 @@ int dump_vhpt_stats(char *buf) 14.42 if (v->CChain) vhpt_chains++; 14.43 } 14.44 s += sprintf(s,"VHPT usage: %ld/%ld (%ld collision chains)\n", 14.45 - vhpt_valid,VHPT_NUM_ENTRIES,vhpt_chains); 14.46 + vhpt_valid, (unsigned long) VHPT_NUM_ENTRIES, vhpt_chains); 14.47 return s - buf; 14.48 }
15.1 --- a/xen/arch/ia64/xen/xenirq.c Tue Feb 28 10:26:43 2006 -0700 15.2 +++ b/xen/arch/ia64/xen/xenirq.c Tue Feb 28 10:29:30 2006 -0700 15.3 @@ -24,7 +24,7 @@ xen_debug_irq(ia64_vector vector, struct 15.4 firstirq = 0; 15.5 } 15.6 if (firsttime[vector]) { 15.7 - printf("**** (entry) First received int on vector=%d,itc=%lx\n", 15.8 + printf("**** (entry) First received int on vector=%lu,itc=%lx\n", 15.9 (unsigned long) vector, ia64_get_itc()); 15.10 firsttime[vector] = 0; 15.11 } 15.12 @@ -38,13 +38,13 @@ xen_do_IRQ(ia64_vector vector) 15.13 extern void vcpu_pend_interrupt(void *, int); 15.14 #if 0 15.15 if (firsttime[vector]) { 15.16 - printf("**** (iterate) First received int on vector=%d,itc=%lx\n", 15.17 - (unsigned long) vector, ia64_get_itc()); 15.18 + printf("**** (iterate) First received int on vector=%lu,itc=%lx\n", 15.19 + (unsigned long) vector, ia64_get_itc()); 15.20 firsttime[vector] = 0; 15.21 } 15.22 if (firstpend[vector]) { 15.23 - printf("**** First pended int on vector=%d,itc=%lx\n", 15.24 - (unsigned long) vector,ia64_get_itc()); 15.25 + printf("**** First pended int on vector=%lu,itc=%lx\n", 15.26 + (unsigned long) vector, ia64_get_itc()); 15.27 firstpend[vector] = 0; 15.28 } 15.29 #endif
16.1 --- a/xen/arch/ia64/xen/xenmem.c Tue Feb 28 10:26:43 2006 -0700 16.2 +++ b/xen/arch/ia64/xen/xenmem.c Tue Feb 28 10:29:30 2006 -0700 16.3 @@ -34,7 +34,6 @@ unsigned long mpt_table_size; 16.4 void 16.5 paging_init (void) 16.6 { 16.7 - struct page_info *pg; 16.8 unsigned int mpt_order; 16.9 /* Create machine to physical mapping table 16.10 * NOTE: similar to frame table, later we may need virtually 16.11 @@ -61,7 +60,7 @@ paging_init (void) 16.12 #define FT_ALIGN_SIZE (16UL << 20) 16.13 void __init init_frametable(void) 16.14 { 16.15 - unsigned long i, pfn; 16.16 + unsigned long pfn; 16.17 frame_table_size = max_page * sizeof(struct page_info); 16.18 frame_table_size = (frame_table_size + PAGE_SIZE - 1) & PAGE_MASK; 16.19
17.1 --- a/xen/arch/ia64/xen/xenmisc.c Tue Feb 28 10:26:43 2006 -0700 17.2 +++ b/xen/arch/ia64/xen/xenmisc.c Tue Feb 28 10:29:30 2006 -0700 17.3 @@ -19,6 +19,8 @@ 17.4 #include <public/sched.h> 17.5 #include <asm/vhpt.h> 17.6 #include <asm/debugger.h> 17.7 +#include <asm/vmx.h> 17.8 +#include <asm/vmx_vcpu.h> 17.9 17.10 efi_memory_desc_t ia64_efi_io_md; 17.11 EXPORT_SYMBOL(ia64_efi_io_md); 17.12 @@ -26,6 +28,10 @@ unsigned long wait_init_idle; 17.13 int phys_proc_id[NR_CPUS]; 17.14 unsigned long loops_per_jiffy = (1<<12); // from linux/init/main.c 17.15 17.16 +/* FIXME: where these declarations should be there ? */ 17.17 +extern void load_region_regs(struct vcpu *); 17.18 +extern void show_registers(struct pt_regs *regs); 17.19 + 17.20 void ia64_mca_init(void) { printf("ia64_mca_init() skipped (Machine check abort handling)\n"); } 17.21 void ia64_mca_cpu_init(void *x) { } 17.22 void ia64_patch_mckinley_e9(unsigned long a, unsigned long b) { } 17.23 @@ -251,6 +257,7 @@ ia64_peek (struct task_struct *child, st 17.24 unsigned long user_rbs_end, unsigned long addr, long *val) 17.25 { 17.26 printk("ia64_peek: called, not implemented\n"); 17.27 + return 1; 17.28 } 17.29 17.30 long 17.31 @@ -258,6 +265,7 @@ ia64_poke (struct task_struct *child, st 17.32 unsigned long user_rbs_end, unsigned long addr, long val) 17.33 { 17.34 printk("ia64_poke: called, not implemented\n"); 17.35 + return 1; 17.36 } 17.37 17.38 void 17.39 @@ -314,7 +322,7 @@ static long cnt[16] = { 50,50,50,50,50,5 17.40 static int i = 100; 17.41 int id = ((struct vcpu *)current)->domain->domain_id & 0xf; 17.42 if (!cnt[id]--) { printk("%x",id); cnt[id] = 500000; } 17.43 -if (!i--) { printk("+",id); i = 1000000; } 17.44 +if (!i--) { printk("+"); i = 1000000; } 17.45 } 17.46 17.47 if (VMX_DOMAIN(current)){ 17.48 @@ -358,12 +366,12 @@ void panic_domain(struct pt_regs *regs, 17.49 va_list args; 17.50 char buf[128]; 17.51 struct vcpu *v = current; 17.52 - static volatile int test = 1; // so can continue easily in debug 17.53 - extern spinlock_t console_lock; 17.54 - unsigned long flags; 17.55 +// static volatile int test = 1; // so can continue easily in debug 17.56 +// extern spinlock_t console_lock; 17.57 +// unsigned long flags; 17.58 17.59 loop: 17.60 - printf("$$$$$ PANIC in domain %d (k6=%p): ", 17.61 + printf("$$$$$ PANIC in domain %d (k6=0x%lx): ", 17.62 v->domain->domain_id, 17.63 __get_cpu_var(cpu_kr)._kr[IA64_KR_CURRENT]); 17.64 va_start(args, fmt); 17.65 @@ -378,7 +386,7 @@ loop: 17.66 } 17.67 domain_pause_by_systemcontroller(current->domain); 17.68 v->domain->shutdown_code = SHUTDOWN_crash; 17.69 - set_bit(_DOMF_shutdown, v->domain->domain_flags); 17.70 + set_bit(_DOMF_shutdown, &v->domain->domain_flags); 17.71 if (v->domain->domain_id == 0) { 17.72 int i = 1000000000L; 17.73 // if domain0 crashes, just periodically print out panic
18.1 --- a/xen/arch/ia64/xen/xensetup.c Tue Feb 28 10:26:43 2006 -0700 18.2 +++ b/xen/arch/ia64/xen/xensetup.c Tue Feb 28 10:29:30 2006 -0700 18.3 @@ -14,7 +14,7 @@ 18.4 #include <public/version.h> 18.5 //#include <xen/delay.h> 18.6 #include <xen/compile.h> 18.7 -//#include <xen/console.h> 18.8 +#include <xen/console.h> 18.9 #include <xen/serial.h> 18.10 #include <xen/trace.h> 18.11 #include <asm/meminit.h> 18.12 @@ -22,6 +22,7 @@ 18.13 #include <asm/setup.h> 18.14 #include <xen/string.h> 18.15 #include <asm/vmx.h> 18.16 +#include <linux/efi.h> 18.17 18.18 unsigned long xenheap_phys_end; 18.19 18.20 @@ -36,6 +37,16 @@ extern unsigned long domain0_ready; 18.21 int find_max_pfn (unsigned long, unsigned long, void *); 18.22 void start_of_day(void); 18.23 18.24 +/* FIXME: which header these declarations should be there ? */ 18.25 +extern long is_platform_hp_ski(void); 18.26 +extern void early_setup_arch(char **); 18.27 +extern void late_setup_arch(char **); 18.28 +extern void hpsim_serial_init(void); 18.29 +extern void alloc_dom0(void); 18.30 +extern void setup_per_cpu_areas(void); 18.31 +extern void mem_init(void); 18.32 +extern void init_IRQ(void); 18.33 + 18.34 /* opt_nosmp: If true, secondary processors are ignored. */ 18.35 static int opt_nosmp = 0; 18.36 boolean_param("nosmp", opt_nosmp); 18.37 @@ -149,8 +160,7 @@ void start_kernel(void) 18.38 { 18.39 unsigned char *cmdline; 18.40 void *heap_start; 18.41 - int i; 18.42 - unsigned long max_mem, nr_pages, firsthole_start; 18.43 + unsigned long nr_pages, firsthole_start; 18.44 unsigned long dom0_memory_start, dom0_memory_size; 18.45 unsigned long dom0_initrd_start, dom0_initrd_size; 18.46 unsigned long initial_images_start, initial_images_end; 18.47 @@ -160,7 +170,7 @@ void start_kernel(void) 18.48 /* Kernel may be relocated by EFI loader */ 18.49 xen_pstart = ia64_tpa(KERNEL_START); 18.50 18.51 - early_setup_arch(&cmdline); 18.52 + early_setup_arch((char **) &cmdline); 18.53 18.54 /* We initialise the serial devices very early so we can get debugging. */ 18.55 if (running_on_sim) hpsim_serial_init(); 18.56 @@ -248,9 +258,9 @@ void start_kernel(void) 18.57 max_page); 18.58 18.59 heap_start = memguard_init(ia64_imva(&_end)); 18.60 - printf("Before heap_start: 0x%lx\n", heap_start); 18.61 + printf("Before heap_start: %p\n", heap_start); 18.62 heap_start = __va(init_boot_allocator(__pa(heap_start))); 18.63 - printf("After heap_start: 0x%lx\n", heap_start); 18.64 + printf("After heap_start: %p\n", heap_start); 18.65 18.66 reserve_memory(); 18.67 18.68 @@ -281,7 +291,7 @@ printk("About to call scheduler_init()\n 18.69 idle_domain = domain_create(IDLE_DOMAIN_ID, 0); 18.70 BUG_ON(idle_domain == NULL); 18.71 18.72 - late_setup_arch(&cmdline); 18.73 + late_setup_arch((char **) &cmdline); 18.74 setup_per_cpu_areas(); 18.75 mem_init(); 18.76 18.77 @@ -298,6 +308,8 @@ printk("About to call timer_init()\n"); 18.78 #endif 18.79 18.80 #ifdef CONFIG_SMP 18.81 + int i; 18.82 + 18.83 if ( opt_nosmp ) 18.84 { 18.85 max_cpus = 0; 18.86 @@ -349,9 +361,9 @@ printk("About to call domain_create()\n" 18.87 * above our heap. The second module, if present, is an initrd ramdisk. 18.88 */ 18.89 printk("About to call construct_dom0()\n"); 18.90 - dom0_memory_start = __va(initial_images_start); 18.91 + dom0_memory_start = (unsigned long) __va(initial_images_start); 18.92 dom0_memory_size = ia64_boot_param->domain_size; 18.93 - dom0_initrd_start = __va(initial_images_start + 18.94 + dom0_initrd_start = (unsigned long) __va(initial_images_start + 18.95 PAGE_ALIGN(ia64_boot_param->domain_size)); 18.96 dom0_initrd_size = ia64_boot_param->initrd_size; 18.97
19.1 --- a/xen/arch/ia64/xen/xentime.c Tue Feb 28 10:26:43 2006 -0700 19.2 +++ b/xen/arch/ia64/xen/xentime.c Tue Feb 28 10:29:30 2006 -0700 19.3 @@ -30,6 +30,9 @@ 19.4 #include <linux/jiffies.h> // not included by xen/sched.h 19.5 #include <xen/softirq.h> 19.6 19.7 +/* FIXME: where these declarations should be there ? */ 19.8 +extern void ia64_init_itm(void); 19.9 + 19.10 seqlock_t xtime_lock __cacheline_aligned_in_smp = SEQLOCK_UNLOCKED; 19.11 19.12 #define TIME_KEEPER_ID 0 19.13 @@ -70,7 +73,7 @@ static inline u64 get_time_delta(void) 19.14 s_time_t get_s_time(void) 19.15 { 19.16 s_time_t now; 19.17 - unsigned long flags, seq; 19.18 + unsigned long seq; 19.19 19.20 do { 19.21 seq = read_seqbegin(&xtime_lock); 19.22 @@ -202,7 +205,7 @@ xen_timer_interrupt (int irq, void *dev_ 19.23 } 19.24 19.25 static struct irqaction xen_timer_irqaction = { 19.26 - .handler = xen_timer_interrupt, 19.27 + .handler = (void *) xen_timer_interrupt, 19.28 .name = "timer" 19.29 }; 19.30 19.31 @@ -217,8 +220,6 @@ ia64_time_init (void) 19.32 /* Late init function (after all CPUs are booted). */ 19.33 int __init init_xen_time() 19.34 { 19.35 - struct timespec tm; 19.36 - 19.37 ia64_time_init(); 19.38 itc_scale = 1000000000UL << 32 ; 19.39 itc_scale /= local_cpu_data->itc_freq; 19.40 @@ -253,7 +254,7 @@ int reprogram_timer(s_time_t timeout) 19.41 } while (unlikely(read_seqretry(&xtime_lock, seq))); 19.42 19.43 local_cpu_data->itm_next = itm_next; 19.44 - vcpu_set_next_timer(current); 19.45 + vcpu_set_next_timer(v); 19.46 return 1; 19.47 } 19.48