# HG changeset patch
# User awilliam@xxxxxxxxxxx
# Node ID 0b0be946cf9c76dd0a6e6ececb056f73919a5513
# Parent bd9cb8dc97b65b6da4b9f3d4919b273c0c2bf275
[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@xxxxxxxxxxxxxx>
Signed-off-by: Kouya SHIMURA <kouya@xxxxxxxxxxxxxx>
Signed-off-by: Masaki Kanno <kanno.masaki@xxxxxxxxxxxxxx>
Signed-off-by: Akio Takebe <takebe_akio@xxxxxxxxxxxxxx>
diff -r bd9cb8dc97b6 -r 0b0be946cf9c xen/arch/ia64/xen/acpi.c
--- a/xen/arch/ia64/xen/acpi.c Tue Feb 28 17:26:43 2006
+++ b/xen/arch/ia64/xen/acpi.c Tue Feb 28 17:29:30 2006
@@ -178,7 +178,7 @@
if (lapic->address) {
iounmap((void *) ipi_base_addr);
- ipi_base_addr = (unsigned long) ioremap(lapic->address, 0);
+ ipi_base_addr = (void __iomem *) ioremap(lapic->address, 0);
}
return 0;
}
@@ -265,7 +265,9 @@
acpi_table_entry_header *header, const unsigned long end)
{
struct acpi_table_plat_int_src *plintsrc;
+#if 0
int vector;
+#endif
plintsrc = (struct acpi_table_plat_int_src *) header;
@@ -369,9 +371,9 @@
/* Get base address of IPI Message Block */
if (acpi_madt->lapic_address)
- ipi_base_addr = (unsigned long)
ioremap(acpi_madt->lapic_address, 0);
-
- printk(KERN_INFO PREFIX "Local APIC address 0x%lx\n", ipi_base_addr);
+ ipi_base_addr = (void __iomem *)
ioremap(acpi_madt->lapic_address, 0);
+
+ printk(KERN_INFO PREFIX "Local APIC address %p\n", ipi_base_addr);
acpi_madt_oem_check(acpi_madt->header.oem_id,
acpi_madt->header.oem_table_id);
diff -r bd9cb8dc97b6 -r 0b0be946cf9c xen/arch/ia64/xen/dom0_ops.c
--- a/xen/arch/ia64/xen/dom0_ops.c Tue Feb 28 17:26:43 2006
+++ b/xen/arch/ia64/xen/dom0_ops.c Tue Feb 28 17:29:30 2006
@@ -17,6 +17,7 @@
#include <xen/trace.h>
#include <xen/console.h>
#include <public/sched_ctl.h>
+#include <asm/vmx.h>
long arch_do_dom0_op(dom0_op_t *op, dom0_op_t *u_dom0_op)
{
@@ -143,7 +144,7 @@
n += j;
}
- free_xenheap_page((unsigned long)l_arr);
+ free_xenheap_page((void *) l_arr);
put_domain(d);
}
@@ -160,7 +161,6 @@
unsigned long nr_pages = op->u.getmemlist.max_pfns & 0xffffffff;
unsigned long mfn;
unsigned long *buffer = op->u.getmemlist.buffer;
- struct page *page;
ret = -EINVAL;
if ( d != NULL )
diff -r bd9cb8dc97b6 -r 0b0be946cf9c xen/arch/ia64/xen/dom_fw.c
--- a/xen/arch/ia64/xen/dom_fw.c Tue Feb 28 17:26:43 2006
+++ b/xen/arch/ia64/xen/dom_fw.c Tue Feb 28 17:29:30 2006
@@ -39,7 +39,8 @@
while(1);
}
if (imva - imva_fw_base > PAGE_SIZE) {
- printf("dom_pa: bad offset! imva=%p, imva_fw_base=%p
(spinning...)\n",imva,imva_fw_base);
+ printf("dom_pa: bad offset! imva=0x%lx, imva_fw_base=0x%lx
(spinning...)\n",
+ imva, imva_fw_base);
while(1);
}
return dom_fw_base_mpa + (imva - imva_fw_base);
@@ -48,31 +49,29 @@
// builds a hypercall bundle at domain physical address
void dom_efi_hypercall_patch(struct domain *d, unsigned long paddr, unsigned
long hypercall)
{
- unsigned long imva;
+ unsigned long *imva;
if (d == dom0) paddr += dom0_start;
- imva = domain_mpa_to_imva(d,paddr);
- build_hypercall_bundle(imva,d->arch.breakimm,hypercall,1);
+ imva = (unsigned long *) domain_mpa_to_imva(d, paddr);
+ build_hypercall_bundle(imva, d->arch.breakimm, hypercall, 1);
}
// builds a hypercall bundle at domain physical address
static void dom_fw_hypercall_patch(struct domain *d, unsigned long paddr,
unsigned long hypercall,unsigned long ret)
{
- unsigned long imva;
-
- imva = domain_mpa_to_imva(d,paddr);
- build_hypercall_bundle(imva,d->arch.breakimm,hypercall,ret);
+ unsigned long *imva;
+
+ imva = (unsigned long *) domain_mpa_to_imva(d, paddr);
+ build_hypercall_bundle(imva, d->arch.breakimm, hypercall, ret);
}
static void dom_fw_pal_hypercall_patch(struct domain *d, unsigned long paddr)
{
unsigned long *imva;
- imva = (unsigned long *)domain_mpa_to_imva(d,paddr);
-
- build_pal_hypercall_bundles (imva, d->arch.breakimm,
- FW_HYPERCALL_PAL_CALL);
+ imva = (unsigned long *) domain_mpa_to_imva(d, paddr);
+ build_pal_hypercall_bundles(imva, d->arch.breakimm,
FW_HYPERCALL_PAL_CALL);
}
@@ -85,15 +84,13 @@
dom_fw_base_mpa = 0;
if (d == dom0) dom_fw_base_mpa += dom0_start;
- imva_fw_base = domain_mpa_to_imva(d,dom_fw_base_mpa);
- bp = dom_fw_init(d,args,arglen,imva_fw_base,PAGE_SIZE);
- return dom_pa((unsigned long)bp);
+ imva_fw_base = domain_mpa_to_imva(d, dom_fw_base_mpa);
+ bp = dom_fw_init(d, args, arglen, (char *) imva_fw_base, PAGE_SIZE);
+ return dom_pa((unsigned long) bp);
}
/* the following heavily leveraged from linux/arch/ia64/hp/sim/fw-emu.c */
-
-#define MB (1024*1024UL)
#define NUM_EFI_SYS_TABLES 6
# define NUM_MEM_DESCS 5
@@ -256,7 +253,8 @@
if (((in1 & ~0xffffffffUL) && (in4 == 0)) ||
(in4 > 1) ||
(in2 > 8) || (in2 & (in2-1)))
- printf("***
SAL_PCI_CONF_WRITE?!?(adr=%p,typ=%p,sz=%p,val=%p)\n",in1,in4,in2,in3);
+ printf("***
SAL_PCI_CONF_WRITE?!?(adr=0x%lx,typ=0x%lx,sz=0x%lx,val=0x%lx)\n",
+ in1,in4,in2,in3);
// note that args are in a different order!!
status = ia64_sal_pci_config_write(in1,in4,in2,in3);
}
@@ -296,7 +294,7 @@
long status = -1;
if (running_on_sim) return pal_emulator_static(index);
- printk("xen_pal_emulator: index=%d\n",index);
+ printk("xen_pal_emulator: index=%lu\n", index);
// pal code must be mapped by a TR when pal is called, however
// calls are rare enough that we will map it lazily rather than
// at every context switch
@@ -312,10 +310,16 @@
status = ia64_pal_proc_get_features(&r9,&r10,&r11);
break;
case PAL_BUS_GET_FEATURES:
- status = ia64_pal_bus_get_features(&r9,&r10,&r11);
+ status = ia64_pal_bus_get_features(
+ (pal_bus_features_u_t *) &r9,
+ (pal_bus_features_u_t *) &r10,
+ (pal_bus_features_u_t *) &r11);
break;
case PAL_FREQ_RATIOS:
- status = ia64_pal_freq_ratios(&r9,&r10,&r11);
+ status = ia64_pal_freq_ratios(
+ (struct pal_freq_ratio *) &r9,
+ (struct pal_freq_ratio *) &r10,
+ (struct pal_freq_ratio *) &r11);
break;
case PAL_PTCE_INFO:
{
@@ -326,7 +330,9 @@
}
break;
case PAL_VERSION:
- status = ia64_pal_version(&r9,&r10);
+ status = ia64_pal_version(
+ (pal_version_u_t *) &r9,
+ (pal_version_u_t *) &r10);
break;
case PAL_VM_PAGE_SIZE:
status = ia64_pal_vm_page_size(&r9,&r10);
@@ -341,13 +347,21 @@
// FIXME: what should xen return for these, figure out later
// For now, linux does the right thing if pal call fails
// In particular, rid_size must be set properly!
- //status = ia64_pal_vm_summary(&r9,&r10);
+ //status = ia64_pal_vm_summary(
+ // (pal_vm_info_1_u_t *) &r9,
+ // (pal_vm_info_2_u_t *) &r10);
break;
case PAL_RSE_INFO:
- status = ia64_pal_rse_info(&r9,&r10);
+ status = ia64_pal_rse_info(
+ &r9,
+ (pal_hints_u_t *) &r10);
break;
case PAL_VM_INFO:
- status = ia64_pal_vm_info(in1,in2,&r9,&r10);
+ status = ia64_pal_vm_info(
+ in1,
+ in2,
+ (pal_tc_info_u_t *) &r9,
+ &r10);
break;
case PAL_REGISTER_INFO:
status = ia64_pal_register_info(in1,&r9,&r10);
@@ -360,11 +374,12 @@
case PAL_PERF_MON_INFO:
{
unsigned long pm_buffer[16];
- int i;
- status = ia64_pal_perf_mon_info(pm_buffer,&r9);
+ status = ia64_pal_perf_mon_info(
+ pm_buffer,
+ (pal_perf_mon_info_u_t *) &r9);
if (status != 0) {
while(1)
- printk("PAL_PERF_MON_INFO fails
ret=%d\n",status);
+ printk("PAL_PERF_MON_INFO fails ret=%ld\n",
status);
break;
}
if (copy_to_user((void __user *)in1,pm_buffer,128)) {
@@ -409,7 +424,7 @@
domain_shutdown (current->domain, 0);
break;
default:
- printk("xen_pal_emulator: UNIMPLEMENTED PAL CALL %d!!!!\n",
+ printk("xen_pal_emulator: UNIMPLEMENTED PAL CALL %lu!!!!\n",
index);
break;
}
@@ -434,7 +449,7 @@
/* Provide only one LP to guest */
static int
-acpi_update_lsapic (acpi_table_entry_header *header)
+acpi_update_lsapic (acpi_table_entry_header *header, const unsigned long end)
{
struct acpi_table_lsapic *lsapic;
@@ -529,8 +544,8 @@
strcpy(xsdt->asl_compiler_id, "XEN");
xsdt->asl_compiler_revision = (XEN_VERSION<<16)|(XEN_SUBVERSION);
- xsdt->table_offset_entry[0] = dom_pa(fadt);
- tables->madt_ptr = dom_pa(madt);
+ xsdt->table_offset_entry[0] = dom_pa((unsigned long) fadt);
+ tables->madt_ptr = dom_pa((unsigned long) madt);
xsdt->checksum = generate_acpi_checksum(xsdt, xsdt->length);
@@ -547,8 +562,8 @@
facs->version = 1;
facs->length = sizeof(struct facs_descriptor_rev2);
- fadt->xfirmware_ctrl = dom_pa(facs);
- fadt->Xdsdt = dom_pa(dsdt);
+ fadt->xfirmware_ctrl = dom_pa((unsigned long) facs);
+ fadt->Xdsdt = dom_pa((unsigned long) dsdt);
/*
* All of the below FADT entries are filled it to prevent warnings
@@ -558,15 +573,15 @@
fadt->pm1_evt_len = 4;
fadt->xpm1a_evt_blk.address_space_id = ACPI_ADR_SPACE_SYSTEM_MEMORY;
fadt->xpm1a_evt_blk.register_bit_width = 8;
- fadt->xpm1a_evt_blk.address = dom_pa(&tables->pm1a_evt_blk);
+ fadt->xpm1a_evt_blk.address = dom_pa((unsigned long)
&tables->pm1a_evt_blk);
fadt->pm1_cnt_len = 1;
fadt->xpm1a_cnt_blk.address_space_id = ACPI_ADR_SPACE_SYSTEM_MEMORY;
fadt->xpm1a_cnt_blk.register_bit_width = 8;
- fadt->xpm1a_cnt_blk.address = dom_pa(&tables->pm1a_cnt_blk);
+ fadt->xpm1a_cnt_blk.address = dom_pa((unsigned long)
&tables->pm1a_cnt_blk);
fadt->pm_tm_len = 4;
fadt->xpm_tmr_blk.address_space_id = ACPI_ADR_SPACE_SYSTEM_MEMORY;
fadt->xpm_tmr_blk.register_bit_width = 8;
- fadt->xpm_tmr_blk.address = dom_pa(&tables->pm_tmr_blk);
+ fadt->xpm_tmr_blk.address = dom_pa((unsigned long) &tables->pm_tmr_blk);
fadt->checksum = generate_acpi_checksum(fadt, fadt->length);
@@ -575,7 +590,7 @@
strcpy(rsdp->oem_id, "XEN");
rsdp->revision = 2; /* ACPI 2.0 includes XSDT */
rsdp->length = sizeof(struct acpi20_table_rsdp);
- rsdp->xsdt_address = dom_pa(xsdt);
+ rsdp->xsdt_address = dom_pa((unsigned long) xsdt);
rsdp->checksum = generate_acpi_checksum(rsdp,
ACPI_RSDP_CHECKSUM_LENGTH);
@@ -640,7 +655,7 @@
unsigned long maxmem = (d->max_pages - d->arch.sys_pgnr) * PAGE_SIZE;
const unsigned long start_mpaddr = ((d==dom0)?dom0_start:0);
-# define MAKE_MD(typ, attr, start, end, abs) \
+# define MAKE_MD(typ, attr, start, end, abs) \
do { \
md = efi_memmap + i++; \
md->type = typ; \
@@ -669,7 +684,7 @@
sal_ed = (void *) cp; cp += sizeof(*sal_ed);
efi_memmap = (void *) cp; cp += NUM_MEM_DESCS*sizeof(*efi_memmap);
bp = (void *) cp; cp += sizeof(*bp);
- pfn = (void *) cp; cp += NFUNCPTRS * 2 * sizeof(pfn);
+ pfn = (void *) cp; cp += NFUNCPTRS * 2 * sizeof(pfn);
cmd_line = (void *) cp;
if (args) {
@@ -690,19 +705,19 @@
cp += sizeof(FW_VENDOR) + (8-((unsigned long)cp & 7)); // round to
64-bit boundary
memcpy(fw_vendor,FW_VENDOR,sizeof(FW_VENDOR));
- efi_systab->fw_vendor = dom_pa(fw_vendor);
+ efi_systab->fw_vendor = dom_pa((unsigned long) fw_vendor);
efi_systab->fw_revision = 1;
- efi_systab->runtime = (void *) dom_pa(efi_runtime);
+ efi_systab->runtime = (void *) dom_pa((unsigned long) efi_runtime);
efi_systab->nr_tables = NUM_EFI_SYS_TABLES;
- efi_systab->tables = dom_pa(efi_tables);
+ efi_systab->tables = dom_pa((unsigned long) efi_tables);
efi_runtime->hdr.signature = EFI_RUNTIME_SERVICES_SIGNATURE;
efi_runtime->hdr.revision = EFI_RUNTIME_SERVICES_REVISION;
efi_runtime->hdr.headersize = sizeof(efi_runtime->hdr);
#define EFI_HYPERCALL_PATCH(tgt,call) do { \
dom_efi_hypercall_patch(d,FW_HYPERCALL_##call##_PADDR,FW_HYPERCALL_##call); \
- tgt = dom_pa(pfn); \
+ tgt = dom_pa((unsigned long) pfn); \
*pfn++ = FW_HYPERCALL_##call##_PADDR + start_mpaddr; \
*pfn++ = 0; \
} while (0)
@@ -719,7 +734,7 @@
EFI_HYPERCALL_PATCH(efi_runtime->reset_system,EFI_RESET_SYSTEM);
efi_tables[0].guid = SAL_SYSTEM_TABLE_GUID;
- efi_tables[0].table = dom_pa(sal_systab);
+ efi_tables[0].table = dom_pa((unsigned long) sal_systab);
for (i = 1; i < NUM_EFI_SYS_TABLES; i++) {
efi_tables[i].guid = NULL_GUID;
efi_tables[i].table = 0;
@@ -773,7 +788,7 @@
dom_fw_fake_acpi(acpi_tables);
efi_tables[i].guid = ACPI_20_TABLE_GUID;
- efi_tables[i].table = dom_pa(acpi_tables);
+ efi_tables[i].table = dom_pa((unsigned long)
acpi_tables);
printf(" ACPI 2.0=0x%lx",efi_tables[i].table);
i++;
}
@@ -850,12 +865,12 @@
MAKE_MD(EFI_RESERVED_TYPE,0,0,0,0);
}
- bp->efi_systab = dom_pa(fw_mem);
- bp->efi_memmap = dom_pa(efi_memmap);
+ bp->efi_systab = dom_pa((unsigned long) fw_mem);
+ bp->efi_memmap = dom_pa((unsigned long) efi_memmap);
bp->efi_memmap_size = NUM_MEM_DESCS*sizeof(efi_memory_desc_t);
bp->efi_memdesc_size = sizeof(efi_memory_desc_t);
bp->efi_memdesc_version = 1;
- bp->command_line = dom_pa(cmd_line);
+ bp->command_line = dom_pa((unsigned long) cmd_line);
bp->console_info.num_cols = 80;
bp->console_info.num_rows = 25;
bp->console_info.orig_x = 0;
diff -r bd9cb8dc97b6 -r 0b0be946cf9c xen/arch/ia64/xen/domain.c
--- a/xen/arch/ia64/xen/domain.c Tue Feb 28 17:26:43 2006
+++ b/xen/arch/ia64/xen/domain.c Tue Feb 28 17:29:30 2006
@@ -45,6 +45,7 @@
#include <asm/vmx.h>
#include <asm/vmx_vcpu.h>
#include <asm/vmx_vpd.h>
+#include <asm/vmx_phy_mode.h>
#include <asm/pal.h>
#include <asm/vhpt.h>
#include <public/hvm/ioreq.h>
@@ -65,6 +66,15 @@
unsigned long *, unsigned long *, unsigned long *);
extern unsigned long dom_fw_setup(struct domain *, char *, int);
+/* FIXME: where these declarations should be there ? */
+extern void domain_pend_keyboard_interrupt(int);
+extern long platform_is_hp_ski(void);
+extern unsigned long allocate_metaphysical_rr(void);
+extern int allocate_rid_range(struct domain *, unsigned long);
+extern void sync_split_caches(void);
+extern void init_all_rr(struct vcpu *);
+extern void serial_input_init(void);
+
static void init_switch_stack(struct vcpu *v);
/* this belongs in include/asm, but there doesn't seem to be a suitable place
*/
@@ -275,8 +285,6 @@
{
struct pt_regs *regs = vcpu_regs (v);
struct domain *d = v->domain;
- int i, rc, ret;
- unsigned long progress = 0;
printf("arch_set_info_guest\n");
if ( test_bit(_VCPUF_initialised, &v->vcpu_flags) )
@@ -304,7 +312,7 @@
v->vcpu_info->arch.evtchn_vector = c->vcpu.evtchn_vector;
if ( c->vcpu.privregs && copy_from_user(v->arch.privregs,
c->vcpu.privregs, sizeof(mapped_regs_t))) {
- printk("Bad ctxt address in arch_set_info_guest: 0x%lx\n",
c->vcpu.privregs);
+ printk("Bad ctxt address in arch_set_info_guest: %p\n",
c->vcpu.privregs);
return -EFAULT;
}
@@ -331,9 +339,7 @@
{
struct domain *d = v->domain;
struct pt_regs *regs;
- struct ia64_boot_param *bp;
extern char saved_command_line[];
-
#ifdef CONFIG_DOMAIN0_CONTIGUOUS
if (d == dom0) start_pc += dom0_start;
@@ -384,8 +390,9 @@
static struct page * assign_new_domain0_page(unsigned long mpaddr)
{
if (mpaddr < dom0_start || mpaddr >= dom0_start + dom0_size) {
- printk("assign_new_domain0_page: bad domain0 mpaddr
%p!\n",mpaddr);
-printk("assign_new_domain0_page:
start=%p,end=%p!\n",dom0_start,dom0_start+dom0_size);
+ printk("assign_new_domain0_page: bad domain0 mpaddr
0x%lx!\n",mpaddr);
+ printk("assign_new_domain0_page: start=0x%lx,end=0x%lx!\n",
+ dom0_start, dom0_start+dom0_size);
while(1);
}
return mfn_to_page((mpaddr >> PAGE_SHIFT));
@@ -430,13 +437,13 @@
if (p) memset(__va(page_to_maddr(p)),0,PAGE_SIZE);
}
if (unlikely(!p)) {
-printf("assign_new_domain_page: Can't alloc!!!! Aaaargh!\n");
+ printf("assign_new_domain_page: Can't alloc!!!!
Aaaargh!\n");
return(p);
}
if (unlikely(page_to_maddr(p) > __get_cpu_var(vhpt_paddr)
&& page_to_maddr(p) < __get_cpu_var(vhpt_pend))) {
- printf("assign_new_domain_page: reassigned vhpt page %p!!\n",
- page_to_maddr(p));
+ printf("assign_new_domain_page: reassigned vhpt page
%lx!!\n",
+ page_to_maddr(p));
}
set_pte(pte, pfn_pte(page_to_maddr(p) >> PAGE_SHIFT,
__pgprot(__DIRTY_BITS | _PAGE_PL_2 | _PAGE_AR_RWX)));
@@ -534,8 +541,8 @@
#ifdef CONFIG_DOMAIN0_CONTIGUOUS
if (d == dom0) {
if (mpaddr < dom0_start || mpaddr >= dom0_start + dom0_size) {
- //printk("lookup_domain_mpa: bad dom0 mpaddr
%p!\n",mpaddr);
-//printk("lookup_domain_mpa:
start=%p,end=%p!\n",dom0_start,dom0_start+dom0_size);
+ //printk("lookup_domain_mpa: bad dom0 mpaddr
0x%lx!\n",mpaddr);
+ //printk("lookup_domain_mpa:
start=0x%lx,end=0x%lx!\n",dom0_start,dom0_start+dom0_size);
mpafoo(mpaddr);
}
pte_t pteval = pfn_pte(mpaddr >> PAGE_SHIFT,
@@ -563,8 +570,8 @@
if ((mpaddr >> PAGE_SHIFT) < d->max_pages) {
if (assign_new_domain_page(d,mpaddr)) goto tryagain;
}
- printk("lookup_domain_mpa: bad mpa %p (> %p\n",
- mpaddr,d->max_pages<<PAGE_SHIFT);
+ printk("lookup_domain_mpa: bad mpa 0x%lx (> 0x%lx)\n",
+ mpaddr, (unsigned long) d->max_pages<<PAGE_SHIFT);
mpafoo(mpaddr);
return 0;
}
@@ -577,7 +584,7 @@
unsigned long imva;
pte &= _PAGE_PPN_MASK;
- imva = __va(pte);
+ imva = (unsigned long) __va(pte);
imva |= mpaddr & ~PAGE_MASK;
return(imva);
}
@@ -606,13 +613,13 @@
{
int remain;
- if (IS_XEN_ADDRESS(dom0,src)) {
+ if (IS_XEN_ADDRESS(dom0,(unsigned long) src)) {
memcpy(dst,src,size);
}
else {
printf("About to call __copy_from_user(%p,%p,%d)\n",
dst,src,size);
- while (remain = __copy_from_user(dst,src,size)) {
+ while ((remain = __copy_from_user(dst,src,size)) != 0) {
printf("incomplete user copy, %d remain of %d\n",
remain,size);
dst += size - remain; src += size - remain;
@@ -623,16 +630,15 @@
void loaddomainelfimage(struct domain *d, unsigned long image_start)
{
- char *elfbase = image_start;
+ char *elfbase = (char *) image_start;
//Elf_Ehdr *ehdr = (Elf_Ehdr *)image_start;
Elf_Ehdr ehdr;
Elf_Phdr phdr;
- int h, filesz, memsz, paddr;
+ int h, filesz, memsz;
unsigned long elfaddr, dom_mpaddr, dom_imva;
struct page *p;
- unsigned long pteval;
- copy_memory(&ehdr,image_start,sizeof(Elf_Ehdr));
+ copy_memory(&ehdr, (void *) image_start, sizeof(Elf_Ehdr));
for ( h = 0; h < ehdr.e_phnum; h++ ) {
copy_memory(&phdr,elfbase + ehdr.e_phoff + (h*ehdr.e_phentsize),
sizeof(Elf_Phdr));
@@ -641,7 +647,7 @@
continue;
}
filesz = phdr.p_filesz; memsz = phdr.p_memsz;
- elfaddr = elfbase + phdr.p_offset;
+ elfaddr = (unsigned long) elfbase + phdr.p_offset;
dom_mpaddr = phdr.p_paddr;
//printf("p_offset: %x, size=%x\n",elfaddr,filesz);
#ifdef CONFIG_DOMAIN0_CONTIGUOUS
@@ -650,9 +656,9 @@
printf("Domain0 doesn't fit in allocated space!\n");
while(1);
}
- dom_imva = __va(dom_mpaddr + dom0_start);
- copy_memory(dom_imva,elfaddr,filesz);
- if (memsz > filesz) memset(dom_imva+filesz,0,memsz-filesz);
+ dom_imva = (unsigned long) __va(dom_mpaddr + dom0_start);
+ copy_memory((void *) dom_imva, (void *) elfaddr, filesz);
+ if (memsz > filesz) memset((void *) dom_imva+filesz, 0,
memsz-filesz);
//FIXME: This test for code seems to find a lot more than objdump -x does
if (phdr.p_flags & PF_X) privify_memory(dom_imva,filesz);
}
@@ -661,20 +667,20 @@
while (memsz > 0) {
p = assign_new_domain_page(d,dom_mpaddr);
if (unlikely(!p)) BUG();
- dom_imva = __va(page_to_maddr(p));
+ dom_imva = (unsigned long) __va(page_to_maddr(p));
if (filesz > 0) {
if (filesz >= PAGE_SIZE)
- copy_memory(dom_imva,elfaddr,PAGE_SIZE);
+ copy_memory((void *) dom_imva, (void *)
elfaddr, PAGE_SIZE);
else { // copy partial page, zero the rest of page
- copy_memory(dom_imva,elfaddr,filesz);
- memset(dom_imva+filesz,0,PAGE_SIZE-filesz);
+ copy_memory((void *) dom_imva, (void *)
elfaddr, filesz);
+ memset((void *) dom_imva+filesz, 0,
PAGE_SIZE-filesz);
}
//FIXME: This test for code seems to find a lot more than objdump -x does
if (phdr.p_flags & PF_X)
privify_memory(dom_imva,PAGE_SIZE);
}
else if (memsz > 0) // always zero out entire page
- memset(dom_imva,0,PAGE_SIZE);
+ memset((void *) dom_imva, 0, PAGE_SIZE);
memsz -= PAGE_SIZE; filesz -= PAGE_SIZE;
elfaddr += PAGE_SIZE; dom_mpaddr += PAGE_SIZE;
}
@@ -689,33 +695,33 @@
copy_memory(&ehdr,elfbase,sizeof(Elf_Ehdr));
if ( !elf_sanity_check(&ehdr) ) {
- printk("ELF sanity check failed.\n");
- return -EINVAL;
+ printk("ELF sanity check failed.\n");
+ return -EINVAL;
}
if ( (ehdr.e_phoff + (ehdr.e_phnum * ehdr.e_phentsize)) > elfsize )
{
- printk("ELF program headers extend beyond end of image.\n");
- return -EINVAL;
+ printk("ELF program headers extend beyond end of image.\n");
+ return -EINVAL;
}
if ( (ehdr.e_shoff + (ehdr.e_shnum * ehdr.e_shentsize)) > elfsize )
{
- printk("ELF section headers extend beyond end of image.\n");
- return -EINVAL;
+ printk("ELF section headers extend beyond end of image.\n");
+ return -EINVAL;
}
#if 0
/* Find the section-header strings table. */
if ( ehdr.e_shstrndx == SHN_UNDEF )
{
- printk("ELF image has no section-header strings table
(shstrtab).\n");
- return -EINVAL;
+ printk("ELF image has no section-header strings table
(shstrtab).\n");
+ return -EINVAL;
}
#endif
*entry = ehdr.e_entry;
-printf("parsedomainelfimage: entry point = %p\n",*entry);
+ printf("parsedomainelfimage: entry point = 0x%lx\n", *entry);
return 0;
}
@@ -727,22 +733,21 @@
if (platform_is_hp_ski()) {
dom0_size = 128*1024*1024; //FIXME: Should be configurable
}
- printf("alloc_dom0: starting (initializing %d
MB...)\n",dom0_size/(1024*1024));
+ printf("alloc_dom0: starting (initializing %lu
MB...)\n",dom0_size/(1024*1024));
- /* FIXME: The first trunk (say 256M) should always be assigned to
- * Dom0, since Dom0's physical == machine address for DMA purpose.
- * Some old version linux, like 2.4, assumes physical memory existing
- * in 2nd 64M space.
- */
- dom0_start = alloc_boot_pages(
- dom0_size >> PAGE_SHIFT, dom0_align >> PAGE_SHIFT);
- dom0_start <<= PAGE_SHIFT;
+ /* FIXME: The first trunk (say 256M) should always be assigned to
+ * Dom0, since Dom0's physical == machine address for DMA purpose.
+ * Some old version linux, like 2.4, assumes physical memory existing
+ * in 2nd 64M space.
+ */
+ dom0_start = alloc_boot_pages(dom0_size >> PAGE_SHIFT, dom0_align >>
PAGE_SHIFT);
+ dom0_start <<= PAGE_SHIFT;
if (!dom0_start) {
- printf("construct_dom0: can't allocate contiguous memory size=%p\n",
+ printf("alloc_dom0: can't allocate contiguous memory size=%lu\n",
dom0_size);
while(1);
}
- printf("alloc_dom0: dom0_start=%p\n",dom0_start);
+ printf("alloc_dom0: dom0_start=0x%lx\n", dom0_start);
#else
dom0_start = 0;
#endif
@@ -770,13 +775,8 @@
unsigned long initrd_start, unsigned long initrd_len,
char *cmdline)
{
- char *dst;
int i, rc;
- unsigned long pfn, mfn;
- unsigned long nr_pt_pages;
- unsigned long count;
unsigned long alloc_start, alloc_end;
- struct page_info *page = NULL;
start_info_t *si;
struct vcpu *v = d->vcpu[0];
@@ -787,7 +787,15 @@
unsigned long pkern_end;
unsigned long pinitrd_start = 0;
unsigned long pstart_info;
- unsigned long ret, progress = 0;
+#if 0
+ char *dst;
+ unsigned long nr_pt_pages;
+ unsigned long count;
+#endif
+#ifdef VALIDATE_VT
+ unsigned long mfn;
+ struct page_info *page = NULL;
+#endif
//printf("construct_dom0: starting\n");
@@ -843,7 +851,7 @@
pinitrd_start=(dom0_start+dom0_size) -
(PAGE_ALIGN(initrd_len) + 4*1024*1024);
- memcpy(__va(pinitrd_start),initrd_start,initrd_len);
+ memcpy(__va(pinitrd_start), (void *) initrd_start, initrd_len);
pstart_info = PAGE_ALIGN(pinitrd_start + initrd_len);
} else {
pstart_info = PAGE_ALIGN(pkern_end);
@@ -861,7 +869,8 @@
{
printk("Initial guest OS requires too much space\n"
"(%luMB is greater than %luMB limit)\n",
- (pkern_end-pkern_start)>>20, (d->max_pages<<PAGE_SHIFT)>>20);
+ (pkern_end-pkern_start)>>20,
+ (unsigned long) (d->max_pages<<PAGE_SHIFT)>>20);
return -ENOMEM;
}
diff -r bd9cb8dc97b6 -r 0b0be946cf9c xen/arch/ia64/xen/hypercall.c
--- a/xen/arch/ia64/xen/hypercall.c Tue Feb 28 17:26:43 2006
+++ b/xen/arch/ia64/xen/hypercall.c Tue Feb 28 17:29:30 2006
@@ -16,10 +16,15 @@
#include <asm/vcpu.h>
#include <asm/dom_fw.h>
+#include <public/dom0_ops.h>
+#include <public/event_channel.h>
#include <public/memory.h>
#include <public/sched.h>
extern unsigned long translate_domain_mpaddr(unsigned long);
+/* FIXME: where these declarations should be there ? */
+extern int dump_privop_counts_to_user(char *, int);
+extern int zero_privop_counts_to_user(char *, int);
unsigned long idle_when_pending = 0;
unsigned long pal_halt_light_count = 0;
@@ -135,12 +140,12 @@
regs->r8 = EFI_UNSUPPORTED;
break;
case FW_HYPERCALL_EFI_GET_TIME:
- tv = vcpu_get_gr(v,32);
- tc = vcpu_get_gr(v,33);
+ tv = (unsigned long *) vcpu_get_gr(v,32);
+ tc = (unsigned long *) vcpu_get_gr(v,33);
//printf("efi_get_time(%p,%p) called...",tv,tc);
- tv = __va(translate_domain_mpaddr(tv));
- if (tc) tc = __va(translate_domain_mpaddr(tc));
- regs->r8 = (*efi.get_time)(tv,tc);
+ tv = (unsigned long *) __va(translate_domain_mpaddr((unsigned
long) tv));
+ if (tc) tc = (unsigned long *)
__va(translate_domain_mpaddr((unsigned long) tc));
+ regs->r8 = (*efi.get_time)((efi_time_t *) tv, (efi_time_cap_t
*) tc);
//printf("and returns %lx\n",regs->r8);
break;
case FW_HYPERCALL_EFI_SET_TIME:
@@ -161,23 +166,23 @@
break;
case 0xffff:
regs->r8 = dump_privop_counts_to_user(
- vcpu_get_gr(v,32),
- vcpu_get_gr(v,33));
+ (char *) vcpu_get_gr(v,32),
+ (int) vcpu_get_gr(v,33));
break;
case 0xfffe:
regs->r8 = zero_privop_counts_to_user(
- vcpu_get_gr(v,32),
- vcpu_get_gr(v,33));
+ (char *) vcpu_get_gr(v,32),
+ (int) vcpu_get_gr(v,33));
break;
case __HYPERVISOR_dom0_op:
- regs->r8 = do_dom0_op(regs->r14);
+ regs->r8 = do_dom0_op((struct dom0_op *) regs->r14);
break;
case __HYPERVISOR_memory_op:
/* we don't handle reservations; just return success */
{
struct xen_memory_reservation reservation;
- void *arg = regs->r15;
+ void *arg = (void *) regs->r15;
switch(regs->r14) {
case XENMEM_increase_reservation:
@@ -189,34 +194,34 @@
regs->r8 = reservation.nr_extents;
break;
default:
- regs->r8 = do_memory_op(regs->r14, regs->r15);
+ regs->r8 = do_memory_op((int) regs->r14, (void
*)regs->r15);
break;
}
}
break;
case __HYPERVISOR_event_channel_op:
- regs->r8 = do_event_channel_op(regs->r14);
+ regs->r8 = do_event_channel_op((struct evtchn_op *) regs->r14);
break;
case __HYPERVISOR_grant_table_op:
- regs->r8 = do_grant_table_op(regs->r14, regs->r15, regs->r16);
+ regs->r8 = do_grant_table_op((unsigned int) regs->r14, (void *)
regs->r15, (unsigned int) regs->r16);
break;
case __HYPERVISOR_console_io:
- regs->r8 = do_console_io(regs->r14, regs->r15, regs->r16);
+ regs->r8 = do_console_io((int) regs->r14, (int) regs->r15,
(char *) regs->r16);
break;
case __HYPERVISOR_xen_version:
- regs->r8 = do_xen_version(regs->r14, regs->r15);
+ regs->r8 = do_xen_version((int) regs->r14, (void *) regs->r15);
break;
case __HYPERVISOR_multicall:
- regs->r8 = do_multicall(regs->r14, regs->r15);
+ regs->r8 = do_multicall((struct multicall_entry *) regs->r14,
(unsigned int) regs->r15);
break;
default:
- printf("unknown hypercall %x\n", regs->r2);
+ printf("unknown hypercall %lx\n", regs->r2);
regs->r8 = do_ni_hypercall();
}
return 1;
diff -r bd9cb8dc97b6 -r 0b0be946cf9c xen/arch/ia64/xen/irq.c
--- a/xen/arch/ia64/xen/irq.c Tue Feb 28 17:26:43 2006
+++ b/xen/arch/ia64/xen/irq.c Tue Feb 28 17:29:30 2006
@@ -286,7 +286,9 @@
int handle_IRQ_event(unsigned int irq,
struct pt_regs *regs, struct irqaction *action)
{
+#ifndef XEN
int status = 1; /* Force the "do bottom halves" bit */
+#endif
int retval = 0;
#ifndef XEN
@@ -657,8 +659,10 @@
if (!action)
return -ENOMEM;
+#ifdef XEN
+ action->handler = (void *) handler;
+#else
action->handler = handler;
-#ifndef XEN
action->flags = irqflags;
action->mask = 0;
#endif
@@ -698,7 +702,9 @@
#endif
{
irq_desc_t *desc;
+#ifndef XEN
struct irqaction **p;
+#endif
unsigned long flags;
if (irq >= NR_IRQS)
@@ -755,7 +761,8 @@
* disabled.
*/
-static DECLARE_MUTEX(probe_sem);
+#ifndef XEN
+static int DECLARE_MUTEX(probe_sem);
/**
* probe_irq_on - begin an interrupt autodetect
@@ -765,7 +772,6 @@
*
*/
-#ifndef XEN
unsigned long probe_irq_on(void)
{
unsigned int i;
@@ -936,7 +942,9 @@
int setup_irq(unsigned int irq, struct irqaction * new)
{
+#ifndef XEN
int shared = 0;
+#endif
unsigned long flags;
struct irqaction *old, **p;
irq_desc_t *desc = irq_descp(irq);
@@ -1371,7 +1379,7 @@
return 0;
}
-int pirq_guest_bind(struct vcpu *d, int irq, int will_share)
+int pirq_guest_bind(struct vcpu *v, int irq, int will_share)
{
irq_desc_t *desc = &irq_desc[irq];
irq_guest_action_t *action;
@@ -1431,7 +1439,7 @@
goto out;
}
- action->guest[action->nr_guests++] = d;
+ action->guest[action->nr_guests++] = v->domain;
out:
spin_unlock_irqrestore(&desc->lock, flags);
@@ -1480,6 +1488,7 @@
#ifdef XEN
#ifdef IA64
// this is a temporary hack until real console input is implemented
+extern void domain_pend_keyboard_interrupt(int irq);
irqreturn_t guest_forward_keyboard_input(int irq, void *nada, struct pt_regs
*regs)
{
domain_pend_keyboard_interrupt(irq);
diff -r bd9cb8dc97b6 -r 0b0be946cf9c xen/arch/ia64/xen/mm_init.c
--- a/xen/arch/ia64/xen/mm_init.c Tue Feb 28 17:26:43 2006
+++ b/xen/arch/ia64/xen/mm_init.c Tue Feb 28 17:29:30 2006
@@ -47,6 +47,7 @@
#include <asm/uaccess.h>
#include <asm/unistd.h>
#include <asm/mca.h>
+#include <asm/vhpt.h>
#ifndef XEN
DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
@@ -63,7 +64,7 @@
EXPORT_SYMBOL(vmem_map);
#endif
-static int pgt_cache_water[2] = { 25, 50 };
+// static int pgt_cache_water[2] = { 25, 50 };
struct page *zero_page_memmap_ptr; /* map entry for zero page */
EXPORT_SYMBOL(zero_page_memmap_ptr);
@@ -222,7 +223,7 @@
ia64_set_rbs_bot (void)
{
#ifdef XEN
- unsigned stack_size = MAX_USER_STACK_SIZE;
+ unsigned long stack_size = MAX_USER_STACK_SIZE;
#else
unsigned long stack_size = current->rlim[RLIMIT_STACK].rlim_max & -16;
#endif
@@ -279,7 +280,7 @@
#endif
}
-setup_gate (void)
+void setup_gate (void)
{
printk("setup_gate not-implemented.\n");
}
@@ -287,7 +288,10 @@
void __devinit
ia64_mmu_init (void *my_cpu_data)
{
- unsigned long psr, pta, impl_va_bits;
+ unsigned long psr, impl_va_bits;
+#if 0
+ unsigned long pta;
+#endif
extern void __devinit tlb_init (void);
int cpu;
diff -r bd9cb8dc97b6 -r 0b0be946cf9c xen/arch/ia64/xen/pcdp.c
--- a/xen/arch/ia64/xen/pcdp.c Tue Feb 28 17:26:43 2006
+++ b/xen/arch/ia64/xen/pcdp.c Tue Feb 28 17:29:30 2006
@@ -71,7 +71,9 @@
{
struct pcdp *pcdp;
struct pcdp_uart *uart;
+#ifndef XEN
struct pcdp_device *dev, *end;
+#endif
int i, serial = 0;
pcdp = efi.hcdp;
diff -r bd9cb8dc97b6 -r 0b0be946cf9c xen/arch/ia64/xen/privop.c
--- a/xen/arch/ia64/xen/privop.c Tue Feb 28 17:26:43 2006
+++ b/xen/arch/ia64/xen/privop.c Tue Feb 28 17:29:30 2006
@@ -11,7 +11,12 @@
#include <asm/processor.h>
#include <asm/delay.h> // Debug only
#include <asm/dom_fw.h>
+#include <asm/vhpt.h>
//#include <debug.h>
+
+/* FIXME: where these declarations should be there ? */
+extern int dump_reflect_counts(char *);
+extern void zero_reflect_counts(void);
long priv_verbose=0;
@@ -600,7 +605,7 @@
if (__copy_from_user(&bundle,iip,sizeof(bundle)))
#endif
{
-//printf("*** priv_handle_op: privop bundle @%p not mapped, retrying\n",iip);
+//printf("*** priv_handle_op: privop bundle at 0x%lx not mapped,
retrying\n",iip);
return vcpu_force_data_miss(vcpu,regs->cr_iip);
}
#if 0
@@ -613,8 +618,8 @@
#endif
if (privop_trace) {
static long i = 400;
- //if (i > 0) printf("privop @%p\n",iip);
- if (i > 0) printf("priv_handle_op: @%p, itc=%lx, itm=%lx\n",
+ //if (i > 0) printf("priv_handle_op: at 0x%lx\n",iip);
+ if (i > 0) printf("priv_handle_op: privop trace at 0x%lx,
itc=%lx, itm=%lx\n",
iip,ia64_get_itc(),ia64_get_itm());
i--;
}
@@ -727,7 +732,7 @@
break;
}
//printf("We who are about do die salute you\n");
- printf("handle_op: can't handle privop at 0x%lx (op=0x%016lx) slot %d
(type=%d), ipsr=%p\n",
+ printf("priv_handle_op: can't handle privop at 0x%lx (op=0x%016lx) slot
%d (type=%d), ipsr=0x%lx\n",
iip, (UINT64)inst.inst, slot, slot_type, ipsr);
//printf("vtop(0x%lx)==0x%lx\n", iip, tr_vtop(iip));
//thread_mozambique("privop fault\n");
@@ -768,7 +773,7 @@
(void)vcpu_increment_iip(vcpu);
}
if (fault == IA64_ILLOP_FAULT)
- printf("priv_emulate: priv_handle_op fails, isr=%p\n",isr);
+ printf("priv_emulate: priv_handle_op fails, isr=0x%lx\n",isr);
return fault;
}
@@ -797,8 +802,7 @@
char *hyperpriv_str[HYPERPRIVOP_MAX+1] = {
0, "rfi", "rsm.dt", "ssm.dt", "cover", "itc.d", "itc.i", "ssm.i",
"=ivr", "=tpr", "tpr=", "eoi", "itm=", "thash", "ptc.ga", "itr.d",
- "=rr", "rr=", "kr=",
- 0
+ "=rr", "rr=", "kr="
};
unsigned long slow_hyperpriv_cnt[HYPERPRIVOP_MAX+1] = { 0 };
@@ -809,15 +813,14 @@
int
ia64_hyperprivop(unsigned long iim, REGS *regs)
{
- struct vcpu *v = (struct domain *) current;
- INST64 inst;
+ struct vcpu *v = current;
UINT64 val;
UINT64 itir, ifa;
// FIXME: Handle faults appropriately for these
if (!iim || iim > HYPERPRIVOP_MAX) {
printf("bad hyperprivop; ignored\n");
- printf("iim=%d, iip=%p\n",iim,regs->cr_iip);
+ printf("iim=%lx, iip=0x%lx\n", iim, regs->cr_iip);
return 1;
}
slow_hyperpriv_cnt[iim]++;
@@ -946,48 +949,48 @@
for (i=0; i < 64; i++) sum += privcnt.Mpriv_cnt[i];
s += sprintf(s,"Privop statistics: (Total privops: %ld)\n",sum);
if (privcnt.mov_to_ar_imm)
- s += sprintf(s,"%10d %s [%d%%]\n", privcnt.mov_to_ar_imm,
+ s += sprintf(s,"%10ld %s [%ld%%]\n", privcnt.mov_to_ar_imm,
"mov_to_ar_imm", (privcnt.mov_to_ar_imm*100L)/sum);
if (privcnt.mov_to_ar_reg)
- s += sprintf(s,"%10d %s [%d%%]\n", privcnt.mov_to_ar_reg,
+ s += sprintf(s,"%10ld %s [%ld%%]\n", privcnt.mov_to_ar_reg,
"mov_to_ar_reg", (privcnt.mov_to_ar_reg*100L)/sum);
if (privcnt.mov_from_ar)
- s += sprintf(s,"%10d %s [%d%%]\n", privcnt.mov_from_ar,
+ s += sprintf(s,"%10ld %s [%ld%%]\n", privcnt.mov_from_ar,
"privified-mov_from_ar",
(privcnt.mov_from_ar*100L)/sum);
if (privcnt.ssm)
- s += sprintf(s,"%10d %s [%d%%]\n", privcnt.ssm,
+ s += sprintf(s,"%10ld %s [%ld%%]\n", privcnt.ssm,
"ssm", (privcnt.ssm*100L)/sum);
if (privcnt.rsm)
- s += sprintf(s,"%10d %s [%d%%]\n", privcnt.rsm,
+ s += sprintf(s,"%10ld %s [%ld%%]\n", privcnt.rsm,
"rsm", (privcnt.rsm*100L)/sum);
if (privcnt.rfi)
- s += sprintf(s,"%10d %s [%d%%]\n", privcnt.rfi,
+ s += sprintf(s,"%10ld %s [%ld%%]\n", privcnt.rfi,
"rfi", (privcnt.rfi*100L)/sum);
if (privcnt.bsw0)
- s += sprintf(s,"%10d %s [%d%%]\n", privcnt.bsw0,
+ s += sprintf(s,"%10ld %s [%ld%%]\n", privcnt.bsw0,
"bsw0", (privcnt.bsw0*100L)/sum);
if (privcnt.bsw1)
- s += sprintf(s,"%10d %s [%d%%]\n", privcnt.bsw1,
+ s += sprintf(s,"%10ld %s [%ld%%]\n", privcnt.bsw1,
"bsw1", (privcnt.bsw1*100L)/sum);
if (privcnt.cover)
- s += sprintf(s,"%10d %s [%d%%]\n", privcnt.cover,
+ s += sprintf(s,"%10ld %s [%ld%%]\n", privcnt.cover,
"cover", (privcnt.cover*100L)/sum);
if (privcnt.fc)
- s += sprintf(s,"%10d %s [%d%%]\n", privcnt.fc,
+ s += sprintf(s,"%10ld %s [%ld%%]\n", privcnt.fc,
"privified-fc", (privcnt.fc*100L)/sum);
if (privcnt.cpuid)
- s += sprintf(s,"%10d %s [%d%%]\n", privcnt.cpuid,
+ s += sprintf(s,"%10ld %s [%ld%%]\n", privcnt.cpuid,
"privified-getcpuid", (privcnt.cpuid*100L)/sum);
for (i=0; i < 64; i++) if (privcnt.Mpriv_cnt[i]) {
if (!Mpriv_str[i]) s += sprintf(s,"PRIVSTRING NULL!!\n");
- else s += sprintf(s,"%10d %s [%d%%]\n", privcnt.Mpriv_cnt[i],
+ else s += sprintf(s,"%10ld %s [%ld%%]\n", privcnt.Mpriv_cnt[i],
Mpriv_str[i], (privcnt.Mpriv_cnt[i]*100L)/sum);
if (i == 0x24) { // mov from CR
s += sprintf(s," [");
for (j=0; j < 128; j++) if (from_cr_cnt[j]) {
if (!cr_str[j])
s += sprintf(s,"PRIVSTRING NULL!!\n");
- s +=
sprintf(s,"%s(%d),",cr_str[j],from_cr_cnt[j]);
+ s +=
sprintf(s,"%s(%ld),",cr_str[j],from_cr_cnt[j]);
}
s += sprintf(s,"]\n");
}
@@ -996,7 +999,7 @@
for (j=0; j < 128; j++) if (to_cr_cnt[j]) {
if (!cr_str[j])
s += sprintf(s,"PRIVSTRING NULL!!\n");
- s +=
sprintf(s,"%s(%d),",cr_str[j],to_cr_cnt[j]);
+ s +=
sprintf(s,"%s(%ld),",cr_str[j],to_cr_cnt[j]);
}
s += sprintf(s,"]\n");
}
@@ -1050,7 +1053,7 @@
s += sprintf(s,"%s:\n",v->instname);
for (j = 0; j < PRIVOP_COUNT_NADDRS; j++) {
if (!v->addr[j]) break;
- s += sprintf(s," @%p #%ld\n",v->addr[j],v->count[j]);
+ s += sprintf(s," at 0x%lx
#%ld\n",v->addr[j],v->count[j]);
}
if (v->overflow)
s += sprintf(s," other #%ld\n",v->overflow);
@@ -1085,17 +1088,17 @@
int dump_misc_stats(char *buf)
{
char *s = buf;
- s += sprintf(s,"Virtual TR translations: %d\n",tr_translate_count);
- s += sprintf(s,"Virtual VHPT slow translations:
%d\n",vhpt_translate_count);
- s += sprintf(s,"Virtual VHPT fast translations:
%d\n",fast_vhpt_translate_count);
- s += sprintf(s,"Virtual DTLB translations: %d\n",dtlb_translate_count);
- s += sprintf(s,"Physical translations: %d\n",phys_translate_count);
- s += sprintf(s,"Recoveries to page fault:
%d\n",recover_to_page_fault_count);
- s += sprintf(s,"Recoveries to break fault:
%d\n",recover_to_break_fault_count);
- s += sprintf(s,"Idle when pending: %d\n",idle_when_pending);
- s += sprintf(s,"PAL_HALT_LIGHT (no pending):
%d\n",pal_halt_light_count);
- s += sprintf(s,"context switches: %d\n",context_switch_count);
- s += sprintf(s,"Lazy covers: %d\n",lazy_cover_count);
+ s += sprintf(s,"Virtual TR translations: %ld\n",tr_translate_count);
+ s += sprintf(s,"Virtual VHPT slow translations:
%ld\n",vhpt_translate_count);
+ s += sprintf(s,"Virtual VHPT fast translations:
%ld\n",fast_vhpt_translate_count);
+ s += sprintf(s,"Virtual DTLB translations: %ld\n",dtlb_translate_count);
+ s += sprintf(s,"Physical translations: %ld\n",phys_translate_count);
+ s += sprintf(s,"Recoveries to page fault:
%ld\n",recover_to_page_fault_count);
+ s += sprintf(s,"Recoveries to break fault:
%ld\n",recover_to_break_fault_count);
+ s += sprintf(s,"Idle when pending: %ld\n",idle_when_pending);
+ s += sprintf(s,"PAL_HALT_LIGHT (no pending):
%ld\n",pal_halt_light_count);
+ s += sprintf(s,"context switches: %ld\n",context_switch_count);
+ s += sprintf(s,"Lazy covers: %ld\n",lazy_cover_count);
return s - buf;
}
@@ -1120,17 +1123,17 @@
char *s = buf;
unsigned long total = 0;
for (i = 1; i <= HYPERPRIVOP_MAX; i++) total += slow_hyperpriv_cnt[i];
- s += sprintf(s,"Slow hyperprivops (total %d):\n",total);
+ s += sprintf(s,"Slow hyperprivops (total %ld):\n",total);
for (i = 1; i <= HYPERPRIVOP_MAX; i++)
if (slow_hyperpriv_cnt[i])
- s += sprintf(s,"%10d %s\n",
+ s += sprintf(s,"%10ld %s\n",
slow_hyperpriv_cnt[i], hyperpriv_str[i]);
total = 0;
for (i = 1; i <= HYPERPRIVOP_MAX; i++) total += fast_hyperpriv_cnt[i];
- s += sprintf(s,"Fast hyperprivops (total %d):\n",total);
+ s += sprintf(s,"Fast hyperprivops (total %ld):\n",total);
for (i = 1; i <= HYPERPRIVOP_MAX; i++)
if (fast_hyperpriv_cnt[i])
- s += sprintf(s,"%10d %s\n",
+ s += sprintf(s,"%10ld %s\n",
fast_hyperpriv_cnt[i], hyperpriv_str[i]);
return s - buf;
}
diff -r bd9cb8dc97b6 -r 0b0be946cf9c xen/arch/ia64/xen/process.c
--- a/xen/arch/ia64/xen/process.c Tue Feb 28 17:26:43 2006
+++ b/xen/arch/ia64/xen/process.c Tue Feb 28 17:29:30 2006
@@ -33,8 +33,14 @@
#include <xen/multicall.h>
#include <asm/debugger.h>
-extern unsigned long vcpu_get_itir_on_fault(struct vcpu *, UINT64);
extern void die_if_kernel(char *str, struct pt_regs *regs, long err);
+/* FIXME: where these declarations shold be there ? */
+extern void load_region_regs(struct vcpu *);
+extern void panic_domain(struct pt_regs *, const char *, ...);
+extern long platform_is_hp_ski(void);
+extern int ia64_hyperprivop(unsigned long, REGS *);
+extern int ia64_hypercall(struct pt_regs *regs);
+extern void vmx_do_launch(struct vcpu *);
extern unsigned long dom0_start, dom0_size;
@@ -98,14 +104,17 @@
mpaddr = ((pteval & _PAGE_PPN_MASK) & ~mask) | (address & mask);
if (d == dom0) {
if (mpaddr < dom0_start || mpaddr >= dom0_start + dom0_size) {
- //printk("translate_domain_pte: out-of-bounds dom0
mpaddr %p! itc=%lx...\n",mpaddr,ia64_get_itc());
+ /*
+ printk("translate_domain_pte: out-of-bounds dom0 mpaddr
0x%lx! itc=%lx...\n",
+ mpaddr, ia64_get_itc());
+ */
tdpfoo();
}
}
else if ((mpaddr >> PAGE_SHIFT) > d->max_pages) {
if ((mpaddr & ~0x1fffL ) != (1L << 40))
- printf("translate_domain_pte: bad mpa=%p (>
%p),vadr=%p,pteval=%p,itir=%p\n",
- mpaddr,d->max_pages<<PAGE_SHIFT,address,pteval,itir);
+ printf("translate_domain_pte: bad mpa=0x%lx (>
0x%lx),vadr=0x%lx,pteval=0x%lx,itir=0x%lx\n",
+ mpaddr, (unsigned long) d->max_pages<<PAGE_SHIFT,
address, pteval, itir);
tdpfoo();
}
pteval2 = lookup_domain_mpa(d,mpaddr);
@@ -123,7 +132,8 @@
if (current->domain == dom0) {
if (mpaddr < dom0_start || mpaddr >= dom0_start + dom0_size) {
- printk("translate_domain_mpaddr: out-of-bounds dom0
mpaddr %p! continuing...\n",mpaddr);
+ printk("translate_domain_mpaddr: out-of-bounds dom0
mpaddr 0x%lx! continuing...\n",
+ mpaddr);
tdpfoo();
}
}
@@ -150,7 +160,7 @@
s += sprintf(s,"Slow reflections by vector:\n");
for (i = 0, j = 0; i < 0x80; i++) {
- if (cnt = slow_reflect_count[i]) {
+ if ( (cnt = slow_reflect_count[i]) != 0 ) {
s += sprintf(s,"0x%02x00:%10d, ",i,cnt);
if ((j++ & 3) == 3) s += sprintf(s,"\n");
}
@@ -158,7 +168,7 @@
if (j & 3) s += sprintf(s,"\n");
s += sprintf(s,"Fast reflections by vector:\n");
for (i = 0, j = 0; i < 0x80; i++) {
- if (cnt = fast_reflect_count[i]) {
+ if ( (cnt = fast_reflect_count[i]) != 0 ) {
s += sprintf(s,"0x%02x00:%10d, ",i,cnt);
if ((j++ & 3) == 3) s += sprintf(s,"\n");
}
@@ -186,7 +196,6 @@
void reflect_interruption(unsigned long isr, struct pt_regs *regs, unsigned
long vector)
{
- unsigned long vcpu_get_ipsr_int_state(struct vcpu *,unsigned long);
struct vcpu *v = current;
if (!PSCB(v,interrupt_collection_enabled))
@@ -205,7 +214,7 @@
#ifdef CONFIG_SMP
#warning "SMP FIXME: sharedinfo doesn't handle smp yet, need page per vcpu"
#endif
- regs->r31 = &(((mapped_regs_t *)SHARED_ARCHINFO_ADDR)->ipsr);
+ regs->r31 = (unsigned long) &(((mapped_regs_t
*)SHARED_ARCHINFO_ADDR)->ipsr);
PSCB(v,interrupt_delivery_enabled) = 0;
PSCB(v,interrupt_collection_enabled) = 0;
@@ -219,13 +228,13 @@
void reflect_extint(struct pt_regs *regs)
{
- extern unsigned long vcpu_verbose, privop_trace;
+// extern unsigned long vcpu_verbose, privop_trace;
unsigned long isr = regs->cr_ipsr & IA64_PSR_RI;
struct vcpu *v = current;
- static first_extint = 1;
+ static int first_extint = 1;
if (first_extint) {
- printf("Delivering first extint to domain: isr=%p,
iip=%p\n",isr,regs->cr_iip);
+ printf("Delivering first extint to domain: isr=0x%lx,
iip=0x%lx\n", isr, regs->cr_iip);
//privop_trace = 1; vcpu_verbose = 1;
first_extint = 0;
}
@@ -297,11 +306,11 @@
// should never happen. If it does, region 0 addr may
// indicate a bad xen pointer
printk("*** xen_handle_domain_access: exception table"
- " lookup failed, iip=%p, addr=%p, spinning...\n",
- iip,address);
+ " lookup failed, iip=0x%lx, addr=0x%lx,
spinning...\n",
+ iip, address);
panic_domain(regs,"*** xen_handle_domain_access:
exception table"
- " lookup failed, iip=%p, addr=%p, spinning...\n",
- iip,address);
+ " lookup failed, iip=0x%lx, addr=0x%lx,
spinning...\n",
+ iip, address);
}
return;
}
@@ -329,9 +338,12 @@
unsigned long arg6, unsigned long arg7, unsigned long stack)
{
struct pt_regs *regs = (struct pt_regs *) &stack;
- unsigned long code, error = isr;
+ unsigned long code;
+#if 0
+ unsigned long error = isr;
+ int result, sig;
+#endif
char buf[128];
- int result, sig;
static const char *reason[] = {
"IA-64 Illegal Operation fault",
"IA-64 Privileged Operation fault",
@@ -543,7 +555,6 @@
/**/ static int last_fd, last_count; // FIXME FIXME FIXME
/**/ // BROKEN FOR MULTIPLE DOMAINS & SMP
/**/ struct ssc_disk_stat { int fd; unsigned count;} *stat, last_stat;
- extern unsigned long vcpu_verbose, privop_trace;
arg0 = vcpu_get_gr(current,32);
switch(ssc) {
@@ -588,11 +599,11 @@
arg3 = vcpu_get_gr(current,35);
if (arg2) { // metaphysical address of descriptor
struct ssc_disk_req *req;
- unsigned long mpaddr, paddr;
+ unsigned long mpaddr;
long len;
arg2 = translate_domain_mpaddr(arg2);
- req = (struct disk_req *)__va(arg2);
+ req = (struct ssc_disk_req *) __va(arg2);
req->len &= 0xffffffffL; // avoid strange bug
len = req->len;
/**/ last_fd = arg1;
@@ -640,7 +651,8 @@
vcpu_set_gr(current,8,-1L,0);
break;
default:
- printf("ia64_handle_break: bad ssc code %lx, iip=%p, b0=%p...
spinning\n",ssc,regs->cr_iip,regs->b0);
+ printf("ia64_handle_break: bad ssc code %lx, iip=0x%lx,
b0=0x%lx... spinning\n",
+ ssc, regs->cr_iip, regs->b0);
while(1);
break;
}
@@ -696,9 +708,9 @@
ia64_handle_privop (unsigned long ifa, struct pt_regs *regs, unsigned long
isr, unsigned long itir)
{
IA64FAULT vector;
- struct domain *d = current->domain;
struct vcpu *v = current;
- vector = priv_emulate(current,regs,isr);
+
+ vector = priv_emulate(v,regs,isr);
if (vector != IA64_NO_FAULT && vector != IA64_RFI_IN_PROGRESS) {
// Note: if a path results in a vector to reflect that requires
// iha/itir (e.g. vcpu_force_data_miss), they must be set there
@@ -712,8 +724,7 @@
void
ia64_handle_reflection (unsigned long ifa, struct pt_regs *regs, unsigned long
isr, unsigned long iim, unsigned long vector)
{
- struct domain *d = (struct domain *) current->domain;
- struct vcpu *v = (struct domain *) current;
+ struct vcpu *v = current;
unsigned long check_lazy_cover = 0;
unsigned long psr = regs->cr_ipsr;
@@ -753,7 +764,7 @@
}
#endif
printf("*** NaT fault... attempting to handle as privop\n");
-printf("isr=%p, ifa=%p,iip=%p,ipsr=%p\n",isr,ifa,regs->cr_iip,psr);
+printf("isr=0x%lx, ifa=0x%lx, iip=0x%lx, ipsr=0x%lx\n", isr, ifa,
regs->cr_iip, psr);
//regs->eml_unat = 0; FIXME: DO WE NEED THIS???
// certain NaT faults are higher priority than privop faults
vector = priv_emulate(v,regs,isr);
@@ -800,8 +811,7 @@
unsigned int op, unsigned int nr_args, ...)
{
struct mc_state *mcs = &mc_state[smp_processor_id()];
- VCPU *vcpu = current;
- struct cpu_user_regs *regs = vcpu_regs(vcpu);
+ struct vcpu *v = current;
unsigned int i;
va_list args;
@@ -809,25 +819,25 @@
if ( test_bit(_MCSF_in_multicall, &mcs->flags) ) {
panic("PREEMPT happen in multicall\n"); // Not support yet
} else {
- vcpu_set_gr(vcpu, 2, op, 0);
+ vcpu_set_gr(v, 2, op, 0);
for ( i = 0; i < nr_args; i++) {
switch (i) {
- case 0: vcpu_set_gr(vcpu, 14, va_arg(args, unsigned long), 0);
+ case 0: vcpu_set_gr(v, 14, va_arg(args, unsigned long), 0);
break;
- case 1: vcpu_set_gr(vcpu, 15, va_arg(args, unsigned long), 0);
+ case 1: vcpu_set_gr(v, 15, va_arg(args, unsigned long), 0);
break;
- case 2: vcpu_set_gr(vcpu, 16, va_arg(args, unsigned long), 0);
+ case 2: vcpu_set_gr(v, 16, va_arg(args, unsigned long), 0);
break;
- case 3: vcpu_set_gr(vcpu, 17, va_arg(args, unsigned long), 0);
+ case 3: vcpu_set_gr(v, 17, va_arg(args, unsigned long), 0);
break;
- case 4: vcpu_set_gr(vcpu, 18, va_arg(args, unsigned long), 0);
+ case 4: vcpu_set_gr(v, 18, va_arg(args, unsigned long), 0);
break;
default: panic("Too many args for hypercall continuation\n");
break;
}
}
}
- vcpu->arch.hypercall_continuation = 1;
+ v->arch.hypercall_continuation = 1;
va_end(args);
return op;
}
diff -r bd9cb8dc97b6 -r 0b0be946cf9c xen/arch/ia64/xen/regionreg.c
--- a/xen/arch/ia64/xen/regionreg.c Tue Feb 28 17:26:43 2006
+++ b/xen/arch/ia64/xen/regionreg.c Tue Feb 28 17:29:30 2006
@@ -18,6 +18,8 @@
extern void ia64_new_rr7(unsigned long rid,void *shared_info, void
*shared_arch_info, unsigned long p_vhpt, unsigned long v_pal);
extern void *pal_vaddr;
+/* FIXME: where these declarations should be there ? */
+extern void panic_domain(struct pt_regs *, const char *, ...);
#define IA64_MIN_IMPL_RID_BITS (IA64_MIN_IMPL_RID_MSB+1)
#define IA64_MAX_IMPL_RID_BITS 24
@@ -142,7 +144,7 @@
// setup domain struct
d->arch.rid_bits = ridbits;
d->arch.starting_rid = i << IA64_MIN_IMPL_RID_BITS; d->arch.ending_rid
= (i+n_rid_blocks) << IA64_MIN_IMPL_RID_BITS;
-printf("###allocating rid_range, domain %p: starting_rid=%lx,
ending_rid=%lx\n",
+printf("###allocating rid_range, domain %p: starting_rid=%x, ending_rid=%x\n",
d,d->arch.starting_rid, d->arch.ending_rid);
return 1;
@@ -219,8 +221,8 @@
newrid = v->arch.starting_rid + rrv.rid;
if (newrid > v->arch.ending_rid) {
- printk("can't set rr%d to %lx, starting_rid=%lx,"
- "ending_rid=%lx, val=%lx\n", rreg, newrid,
+ printk("can't set rr%d to %lx, starting_rid=%x,"
+ "ending_rid=%x, val=%lx\n", (int) rreg, newrid,
v->arch.starting_rid,v->arch.ending_rid,val);
return 0;
}
@@ -253,7 +255,7 @@
else if (rreg == 7)
ia64_new_rr7(vmMangleRID(newrrv.rrval),v->vcpu_info,
v->arch.privregs, __get_cpu_var(vhpt_paddr),
- pal_vaddr);
+ (unsigned long) pal_vaddr);
else set_rr(rr,newrrv.rrval);
#endif
return 1;
@@ -263,11 +265,12 @@
int set_metaphysical_rr0(void)
{
struct vcpu *v = current;
- ia64_rr rrv;
+// ia64_rr rrv;
// rrv.ve = 1; FIXME: TURN ME BACK ON WHEN VHPT IS WORKING
ia64_set_rr(0,v->arch.metaphysical_rr0);
ia64_srlz_d();
+ return 1;
}
// validates/changes region registers 0-6 in the currently executing domain
diff -r bd9cb8dc97b6 -r 0b0be946cf9c xen/arch/ia64/xen/sn_console.c
--- a/xen/arch/ia64/xen/sn_console.c Tue Feb 28 17:26:43 2006
+++ b/xen/arch/ia64/xen/sn_console.c Tue Feb 28 17:29:30 2006
@@ -9,7 +9,13 @@
#include <asm/sn/sn_sal.h>
#include <xen/serial.h>
-void sn_putc(struct serial_port *, char);
+/*
+ * sn_putc - Send a character to the console, polled or interrupt mode
+ */
+static void sn_putc(struct serial_port *port, char c)
+{
+ ia64_sn_console_putc(c);
+}
static struct uart_driver sn_sal_console = {
.putc = sn_putc,
@@ -75,11 +81,3 @@
return 0;
}
-
-/*
- * sn_putc - Send a character to the console, polled or interrupt mode
- */
-void sn_putc(struct serial_port *port, char c)
-{
- return ia64_sn_console_putc(c);
-}
diff -r bd9cb8dc97b6 -r 0b0be946cf9c xen/arch/ia64/xen/vcpu.c
--- a/xen/arch/ia64/xen/vcpu.c Tue Feb 28 17:26:43 2006
+++ b/xen/arch/ia64/xen/vcpu.c Tue Feb 28 17:29:30 2006
@@ -21,7 +21,15 @@
#include <asm/processor.h>
#include <asm/delay.h>
#include <asm/vmx_vcpu.h>
+#include <asm/vhpt.h>
+#include <asm/tlbflush.h>
#include <xen/event.h>
+
+/* FIXME: where these declarations should be there ? */
+extern void getreg(unsigned long regnum, unsigned long *val, int *nat, struct
pt_regs *regs);
+extern void setreg(unsigned long regnum, unsigned long val, int nat, struct
pt_regs *regs);
+extern void panic_domain(struct pt_regs *, const char *, ...);
+extern int set_metaphysical_rr0(void);
typedef union {
struct ia64_psr ia64_psr;
@@ -47,10 +55,10 @@
#define STATIC
#ifdef PRIVOP_ADDR_COUNT
-struct privop_addr_count privop_addr_counter[PRIVOP_COUNT_NINSTS] = {
- { "=ifa", { 0 }, { 0 }, 0 },
+struct privop_addr_count privop_addr_counter[PRIVOP_COUNT_NINSTS+1] = {
+ { "=ifa", { 0 }, { 0 }, 0 },
{ "thash", { 0 }, { 0 }, 0 },
- 0
+ { 0, { 0 }, { 0 }, 0 }
};
extern void privop_count_addr(unsigned long addr, int inst);
#define PRIVOP_COUNT_ADDR(regs,inst)
privop_count_addr(regs->cr_iip,inst)
@@ -375,7 +383,7 @@
UINT64 vcpu_get_ipsr_int_state(VCPU *vcpu,UINT64 prevpsr)
{
UINT64 dcr = PSCBX(vcpu,dcr);
- PSR psr = {0};
+ PSR psr;
//printf("*** vcpu_get_ipsr_int_state (0x%016lx)...",prevpsr);
psr.i64 = prevpsr;
@@ -397,7 +405,7 @@
IA64FAULT vcpu_get_dcr(VCPU *vcpu, UINT64 *pval)
{
-extern unsigned long privop_trace;
+//extern unsigned long privop_trace;
//privop_trace=0;
//verbose("vcpu_get_dcr: called @%p\n",PSCB(vcpu,iip));
// Reads of cr.dcr on Xen always have the sign bit set, so
@@ -525,7 +533,7 @@
IA64FAULT vcpu_set_dcr(VCPU *vcpu, UINT64 val)
{
-extern unsigned long privop_trace;
+//extern unsigned long privop_trace;
//privop_trace=1;
// Reads of cr.dcr on SP always have the sign bit set, so
// a domain can differentiate whether it is running on SP or not
@@ -747,7 +755,7 @@
IA64FAULT vcpu_get_lid(VCPU *vcpu, UINT64 *pval)
{
-extern unsigned long privop_trace;
+//extern unsigned long privop_trace;
//privop_trace=1;
//TODO: Implement this
printf("vcpu_get_lid: WARNING: Getting cr.lid always returns zero\n");
@@ -764,9 +772,10 @@
#define HEARTBEAT_FREQ 16 // period in seconds
#ifdef HEARTBEAT_FREQ
#define N_DOMS 16 // period in seconds
+#if 0
static long count[N_DOMS] = { 0 };
+#endif
static long nonclockcount[N_DOMS] = { 0 };
- REGS *regs = vcpu_regs(vcpu);
unsigned domid = vcpu->domain->domain_id;
#endif
#ifdef IRQ_DEBUG
@@ -803,7 +812,7 @@
// getting ivr has "side effects"
#ifdef IRQ_DEBUG
if (firsttime[vector]) {
- printf("*** First get_ivr on vector=%d,itc=%lx\n",
+ printf("*** First get_ivr on vector=%lu,itc=%lx\n",
vector,ia64_get_itc());
firsttime[vector]=0;
}
@@ -817,7 +826,7 @@
i = vector >> 6;
mask = 1L << (vector & 0x3f);
-//printf("ZZZZZZ vcpu_get_ivr: setting insvc mask for vector %ld\n",vector);
+//printf("ZZZZZZ vcpu_get_ivr: setting insvc mask for vector %lu\n",vector);
PSCBX(vcpu,insvc[i]) |= mask;
PSCBX(vcpu,irr[i]) &= ~mask;
//PSCB(vcpu,pending_interruption)--;
@@ -983,19 +992,19 @@
{
PSCBX(vcpu,xen_timer_interval) = cycles;
vcpu_set_next_timer(vcpu);
- printf("vcpu_enable_timer(%d): interval set to %d cycles\n",
+ printf("vcpu_enable_timer: interval set to %lu cycles\n",
PSCBX(vcpu,xen_timer_interval));
__set_bit(PSCB(vcpu,itv), PSCB(vcpu,delivery_mask));
}
IA64FAULT vcpu_set_itv(VCPU *vcpu, UINT64 val)
{
-extern unsigned long privop_trace;
+//extern unsigned long privop_trace;
//privop_trace=1;
if (val & 0xef00) return (IA64_ILLOP_FAULT);
PSCB(vcpu,itv) = val;
if (val & 0x10000) {
-printf("**** vcpu_set_itv(%d): vitm=%lx, setting to
0\n",val,PSCBX(vcpu,domain_itm));
+printf("**** vcpu_set_itv(%lu): vitm=%lx, setting to
0\n",val,PSCBX(vcpu,domain_itm));
PSCBX(vcpu,domain_itm) = 0;
}
else vcpu_enable_timer(vcpu,1000000L);
@@ -1103,7 +1112,7 @@
IA64FAULT vcpu_set_itm(VCPU *vcpu, UINT64 val)
{
- UINT now = ia64_get_itc();
+ //UINT now = ia64_get_itc();
//if (val < now) val = now + 1000;
//printf("*** vcpu_set_itm: called with %lx\n",val);
@@ -1114,7 +1123,10 @@
IA64FAULT vcpu_set_itc(VCPU *vcpu, UINT64 val)
{
-
+#define DISALLOW_SETTING_ITC_FOR_NOW
+#ifdef DISALLOW_SETTING_ITC_FOR_NOW
+printf("vcpu_set_itc: Setting ar.itc is currently disabled\n");
+#else
UINT64 oldnow = ia64_get_itc();
UINT64 olditm = PSCBX(vcpu,domain_itm);
unsigned long d = olditm - oldnow;
@@ -1122,10 +1134,6 @@
UINT64 newnow = val, min_delta;
-#define DISALLOW_SETTING_ITC_FOR_NOW
-#ifdef DISALLOW_SETTING_ITC_FOR_NOW
-printf("vcpu_set_itc: Setting ar.itc is currently disabled\n");
-#else
local_irq_disable();
if (olditm) {
printf("**** vcpu_set_itc(%lx): vitm changed to %lx\n",val,newnow+d);
@@ -1314,7 +1322,7 @@
// this down, but since it has been apparently harmless, just flag it for now
// panic_domain(vcpu_regs(vcpu),
printk(
- "vcpu_translate: bad physical address: %p\n",address);
+ "vcpu_translate: bad physical address:
0x%lx\n",address);
}
*pteval = (address & _PAGE_PPN_MASK) | __DIRTY_BITS |
_PAGE_PL_2 | _PAGE_AR_RWX;
*itir = PAGE_SHIFT << 2;
@@ -1327,7 +1335,8 @@
unsigned long vipsr = PSCB(vcpu,ipsr);
unsigned long iip = regs->cr_iip;
unsigned long ipsr = regs->cr_ipsr;
- printk("vcpu_translate: bad address %p, viip=%p, vipsr=%p,
iip=%p, ipsr=%p continuing\n", address, viip, vipsr, iip, ipsr);
+ printk("vcpu_translate: bad address 0x%lx, viip=0x%lx,
vipsr=0x%lx, iip=0x%lx, ipsr=0x%lx continuing\n",
+ address, viip, vipsr, iip, ipsr);
}
rr = PSCB(vcpu,rrs)[region];
@@ -1888,7 +1897,7 @@
IA64FAULT vcpu_ptc_ga(VCPU *vcpu,UINT64 vadr,UINT64 addr_range)
{
- extern ia64_global_tlb_purge(UINT64 start, UINT64 end, UINT64 nbits);
+ extern void ia64_global_tlb_purge(UINT64 start, UINT64 end, UINT64
nbits);
// FIXME: validate not flushing Xen addresses
// if (Xen address) return(IA64_ILLOP_FAULT);
// FIXME: ??breaks if domain PAGE_SIZE < Xen PAGE_SIZE
diff -r bd9cb8dc97b6 -r 0b0be946cf9c xen/arch/ia64/xen/vhpt.c
--- a/xen/arch/ia64/xen/vhpt.c Tue Feb 28 17:26:43 2006
+++ b/xen/arch/ia64/xen/vhpt.c Tue Feb 28 17:29:30 2006
@@ -21,7 +21,7 @@
void vhpt_flush(void)
{
struct vhpt_lf_entry *v = (void *)VHPT_ADDR;
- int i, cnt = 0;
+ int i;
#if 0
static int firsttime = 2;
@@ -48,7 +48,6 @@
#ifdef VHPT_GLOBAL
void vhpt_flush_address(unsigned long vadr, unsigned long addr_range)
{
- unsigned long ps;
struct vhpt_lf_entry *vlfe;
if ((vadr >> 61) == 7) {
@@ -131,7 +130,8 @@
// allocate a huge chunk of physical memory.... how???
vhpt_total_size = 1 << VHPT_SIZE_LOG2; // 4MB, 16MB, 64MB, or 256MB
vhpt_alignment = 1 << VHPT_SIZE_LOG2; // 4MB, 16MB, 64MB, or 256MB
- printf("vhpt_init: vhpt size=%p,
align=%p\n",vhpt_total_size,vhpt_alignment);
+ printf("vhpt_init: vhpt size=0x%lx, align=0x%lx\n",
+ vhpt_total_size, vhpt_alignment);
/* This allocation only holds true if vhpt table is unique for
* all domains. Or else later new vhpt table should be allocated
* from domain heap when each domain is created. Assume xen buddy
@@ -146,8 +146,8 @@
paddr = page_to_maddr(page);
__get_cpu_var(vhpt_paddr) = paddr;
__get_cpu_var(vhpt_pend) = paddr + vhpt_total_size - 1;
- printf("vhpt_init: vhpt paddr=%p, end=%p\n",
- paddr, __get_cpu_var(vhpt_pend));
+ printf("vhpt_init: vhpt paddr=0x%lx, end=0x%lx\n",
+ paddr, __get_cpu_var(vhpt_pend));
pte = pte_val(pfn_pte(paddr >> PAGE_SHIFT, PAGE_KERNEL));
vhpt_map(pte);
ia64_set_pta(VHPT_ADDR | (1 << 8) | (VHPT_SIZE_LOG2 << 2) |
@@ -173,6 +173,6 @@
if (v->CChain) vhpt_chains++;
}
s += sprintf(s,"VHPT usage: %ld/%ld (%ld collision chains)\n",
- vhpt_valid,VHPT_NUM_ENTRIES,vhpt_chains);
+ vhpt_valid, (unsigned long) VHPT_NUM_ENTRIES, vhpt_chains);
return s - buf;
}
diff -r bd9cb8dc97b6 -r 0b0be946cf9c xen/arch/ia64/xen/xenirq.c
--- a/xen/arch/ia64/xen/xenirq.c Tue Feb 28 17:26:43 2006
+++ b/xen/arch/ia64/xen/xenirq.c Tue Feb 28 17:29:30 2006
@@ -24,7 +24,7 @@
firstirq = 0;
}
if (firsttime[vector]) {
- printf("**** (entry) First received int on vector=%d,itc=%lx\n",
+ printf("**** (entry) First received int on
vector=%lu,itc=%lx\n",
(unsigned long) vector, ia64_get_itc());
firsttime[vector] = 0;
}
@@ -38,13 +38,13 @@
extern void vcpu_pend_interrupt(void *, int);
#if 0
if (firsttime[vector]) {
- printf("**** (iterate) First received int on
vector=%d,itc=%lx\n",
- (unsigned long) vector, ia64_get_itc());
+ printf("**** (iterate) First received int on
vector=%lu,itc=%lx\n",
+ (unsigned long) vector, ia64_get_itc());
firsttime[vector] = 0;
}
if (firstpend[vector]) {
- printf("**** First pended int on vector=%d,itc=%lx\n",
- (unsigned long) vector,ia64_get_itc());
+ printf("**** First pended int on vector=%lu,itc=%lx\n",
+ (unsigned long) vector, ia64_get_itc());
firstpend[vector] = 0;
}
#endif
diff -r bd9cb8dc97b6 -r 0b0be946cf9c xen/arch/ia64/xen/xenmem.c
--- a/xen/arch/ia64/xen/xenmem.c Tue Feb 28 17:26:43 2006
+++ b/xen/arch/ia64/xen/xenmem.c Tue Feb 28 17:29:30 2006
@@ -34,7 +34,6 @@
void
paging_init (void)
{
- struct page_info *pg;
unsigned int mpt_order;
/* Create machine to physical mapping table
* NOTE: similar to frame table, later we may need virtually
@@ -61,7 +60,7 @@
#define FT_ALIGN_SIZE (16UL << 20)
void __init init_frametable(void)
{
- unsigned long i, pfn;
+ unsigned long pfn;
frame_table_size = max_page * sizeof(struct page_info);
frame_table_size = (frame_table_size + PAGE_SIZE - 1) & PAGE_MASK;
diff -r bd9cb8dc97b6 -r 0b0be946cf9c xen/arch/ia64/xen/xenmisc.c
--- a/xen/arch/ia64/xen/xenmisc.c Tue Feb 28 17:26:43 2006
+++ b/xen/arch/ia64/xen/xenmisc.c Tue Feb 28 17:29:30 2006
@@ -19,12 +19,18 @@
#include <public/sched.h>
#include <asm/vhpt.h>
#include <asm/debugger.h>
+#include <asm/vmx.h>
+#include <asm/vmx_vcpu.h>
efi_memory_desc_t ia64_efi_io_md;
EXPORT_SYMBOL(ia64_efi_io_md);
unsigned long wait_init_idle;
int phys_proc_id[NR_CPUS];
unsigned long loops_per_jiffy = (1<<12); // from linux/init/main.c
+
+/* FIXME: where these declarations should be there ? */
+extern void load_region_regs(struct vcpu *);
+extern void show_registers(struct pt_regs *regs);
void ia64_mca_init(void) { printf("ia64_mca_init() skipped (Machine check
abort handling)\n"); }
void ia64_mca_cpu_init(void *x) { }
@@ -251,6 +257,7 @@
unsigned long user_rbs_end, unsigned long addr, long *val)
{
printk("ia64_peek: called, not implemented\n");
+ return 1;
}
long
@@ -258,6 +265,7 @@
unsigned long user_rbs_end, unsigned long addr, long val)
{
printk("ia64_poke: called, not implemented\n");
+ return 1;
}
void
@@ -314,7 +322,7 @@
static int i = 100;
int id = ((struct vcpu *)current)->domain->domain_id & 0xf;
if (!cnt[id]--) { printk("%x",id); cnt[id] = 500000; }
-if (!i--) { printk("+",id); i = 1000000; }
+if (!i--) { printk("+"); i = 1000000; }
}
if (VMX_DOMAIN(current)){
@@ -358,12 +366,12 @@
va_list args;
char buf[128];
struct vcpu *v = current;
- static volatile int test = 1; // so can continue easily in debug
- extern spinlock_t console_lock;
- unsigned long flags;
+// static volatile int test = 1; // so can continue easily in debug
+// extern spinlock_t console_lock;
+// unsigned long flags;
loop:
- printf("$$$$$ PANIC in domain %d (k6=%p): ",
+ printf("$$$$$ PANIC in domain %d (k6=0x%lx): ",
v->domain->domain_id,
__get_cpu_var(cpu_kr)._kr[IA64_KR_CURRENT]);
va_start(args, fmt);
@@ -378,7 +386,7 @@
}
domain_pause_by_systemcontroller(current->domain);
v->domain->shutdown_code = SHUTDOWN_crash;
- set_bit(_DOMF_shutdown, v->domain->domain_flags);
+ set_bit(_DOMF_shutdown, &v->domain->domain_flags);
if (v->domain->domain_id == 0) {
int i = 1000000000L;
// if domain0 crashes, just periodically print out panic
diff -r bd9cb8dc97b6 -r 0b0be946cf9c xen/arch/ia64/xen/xensetup.c
--- a/xen/arch/ia64/xen/xensetup.c Tue Feb 28 17:26:43 2006
+++ b/xen/arch/ia64/xen/xensetup.c Tue Feb 28 17:29:30 2006
@@ -14,7 +14,7 @@
#include <public/version.h>
//#include <xen/delay.h>
#include <xen/compile.h>
-//#include <xen/console.h>
+#include <xen/console.h>
#include <xen/serial.h>
#include <xen/trace.h>
#include <asm/meminit.h>
@@ -22,6 +22,7 @@
#include <asm/setup.h>
#include <xen/string.h>
#include <asm/vmx.h>
+#include <linux/efi.h>
unsigned long xenheap_phys_end;
@@ -35,6 +36,16 @@
int find_max_pfn (unsigned long, unsigned long, void *);
void start_of_day(void);
+
+/* FIXME: which header these declarations should be there ? */
+extern long is_platform_hp_ski(void);
+extern void early_setup_arch(char **);
+extern void late_setup_arch(char **);
+extern void hpsim_serial_init(void);
+extern void alloc_dom0(void);
+extern void setup_per_cpu_areas(void);
+extern void mem_init(void);
+extern void init_IRQ(void);
/* opt_nosmp: If true, secondary processors are ignored. */
static int opt_nosmp = 0;
@@ -149,8 +160,7 @@
{
unsigned char *cmdline;
void *heap_start;
- int i;
- unsigned long max_mem, nr_pages, firsthole_start;
+ unsigned long nr_pages, firsthole_start;
unsigned long dom0_memory_start, dom0_memory_size;
unsigned long dom0_initrd_start, dom0_initrd_size;
unsigned long initial_images_start, initial_images_end;
@@ -160,7 +170,7 @@
/* Kernel may be relocated by EFI loader */
xen_pstart = ia64_tpa(KERNEL_START);
- early_setup_arch(&cmdline);
+ early_setup_arch((char **) &cmdline);
/* We initialise the serial devices very early so we can get debugging. */
if (running_on_sim) hpsim_serial_init();
@@ -248,9 +258,9 @@
max_page);
heap_start = memguard_init(ia64_imva(&_end));
- printf("Before heap_start: 0x%lx\n", heap_start);
+ printf("Before heap_start: %p\n", heap_start);
heap_start = __va(init_boot_allocator(__pa(heap_start)));
- printf("After heap_start: 0x%lx\n", heap_start);
+ printf("After heap_start: %p\n", heap_start);
reserve_memory();
@@ -281,7 +291,7 @@
idle_domain = domain_create(IDLE_DOMAIN_ID, 0);
BUG_ON(idle_domain == NULL);
- late_setup_arch(&cmdline);
+ late_setup_arch((char **) &cmdline);
setup_per_cpu_areas();
mem_init();
@@ -298,6 +308,8 @@
#endif
#ifdef CONFIG_SMP
+ int i;
+
if ( opt_nosmp )
{
max_cpus = 0;
@@ -349,9 +361,9 @@
* above our heap. The second module, if present, is an initrd ramdisk.
*/
printk("About to call construct_dom0()\n");
- dom0_memory_start = __va(initial_images_start);
+ dom0_memory_start = (unsigned long) __va(initial_images_start);
dom0_memory_size = ia64_boot_param->domain_size;
- dom0_initrd_start = __va(initial_images_start +
+ dom0_initrd_start = (unsigned long) __va(initial_images_start +
PAGE_ALIGN(ia64_boot_param->domain_size));
dom0_initrd_size = ia64_boot_param->initrd_size;
diff -r bd9cb8dc97b6 -r 0b0be946cf9c xen/arch/ia64/xen/xentime.c
--- a/xen/arch/ia64/xen/xentime.c Tue Feb 28 17:26:43 2006
+++ b/xen/arch/ia64/xen/xentime.c Tue Feb 28 17:29:30 2006
@@ -30,6 +30,9 @@
#include <linux/jiffies.h> // not included by xen/sched.h
#include <xen/softirq.h>
+/* FIXME: where these declarations should be there ? */
+extern void ia64_init_itm(void);
+
seqlock_t xtime_lock __cacheline_aligned_in_smp = SEQLOCK_UNLOCKED;
#define TIME_KEEPER_ID 0
@@ -70,7 +73,7 @@
s_time_t get_s_time(void)
{
s_time_t now;
- unsigned long flags, seq;
+ unsigned long seq;
do {
seq = read_seqbegin(&xtime_lock);
@@ -202,7 +205,7 @@
}
static struct irqaction xen_timer_irqaction = {
- .handler = xen_timer_interrupt,
+ .handler = (void *) xen_timer_interrupt,
.name = "timer"
};
@@ -217,8 +220,6 @@
/* Late init function (after all CPUs are booted). */
int __init init_xen_time()
{
- struct timespec tm;
-
ia64_time_init();
itc_scale = 1000000000UL << 32 ;
itc_scale /= local_cpu_data->itc_freq;
@@ -253,7 +254,7 @@
} while (unlikely(read_seqretry(&xtime_lock, seq)));
local_cpu_data->itm_next = itm_next;
- vcpu_set_next_timer(current);
+ vcpu_set_next_timer(v);
return 1;
}
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|