ia64/xen-unstable

changeset 5802:d4ecbd89d954

Fix PAL_PTCE_INFO and cpuid (pfmon now works)
author djm@kirby.fc.hp.com
date Wed Jul 13 13:12:00 2005 -0700 (2005-07-13)
parents a87242c44417
children ea8caf38c914
files xen/arch/ia64/dom_fw.c xen/arch/ia64/vcpu.c
line diff
     1.1 --- a/xen/arch/ia64/dom_fw.c	Wed Jul 13 06:43:49 2005 -0700
     1.2 +++ b/xen/arch/ia64/dom_fw.c	Wed Jul 13 13:12:00 2005 -0700
     1.3 @@ -313,7 +313,14 @@ xen_pal_emulator(unsigned long index, un
     1.4  		status = ia64_pal_freq_ratios(&r9,&r10,&r11);
     1.5  		break;
     1.6  	    case PAL_PTCE_INFO:
     1.7 -		status = ia64_get_ptce(&r9);
     1.8 +		{
     1.9 +			ia64_ptce_info_t ptce;
    1.10 +			status = ia64_get_ptce(&ptce);
    1.11 +			if (status != 0) break;
    1.12 +			r9 = ptce.base;
    1.13 +			r10 = (ptce.count[0]<<32)|(ptce.count[1]&0xffffffffL);
    1.14 +			r11 = (ptce.stride[0]<<32)|(ptce.stride[1]&0xffffffffL);
    1.15 +		}
    1.16  		break;
    1.17  	    case PAL_VERSION:
    1.18  		status = ia64_pal_version(&r9,&r10);
    1.19 @@ -340,18 +347,30 @@ xen_pal_emulator(unsigned long index, un
    1.20  		status = ia64_pal_register_info(in1,&r9,&r10);
    1.21  		break;
    1.22  	    case PAL_CACHE_FLUSH:
    1.23 -		return pal_emulator_static(index); /* FIXME */
    1.24 +		/* FIXME */
    1.25 +		printk("PAL_CACHE_FLUSH NOT IMPLEMENTED!\n");
    1.26 +		BUG();
    1.27  		break;
    1.28  	    case PAL_PERF_MON_INFO:
    1.29  		{
    1.30  			unsigned long pm_buffer[16];
    1.31 +			int i;
    1.32  			status = ia64_pal_perf_mon_info(pm_buffer,&r9);
    1.33 -			if (status != 0) break;
    1.34 +			if (status != 0) {
    1.35 +				while(1)
    1.36 +				printk("PAL_PERF_MON_INFO fails ret=%d\n",status);
    1.37 +				break;
    1.38 +			}
    1.39  			if (copy_to_user((void __user *)in1,pm_buffer,128)) {
    1.40 +				while(1)
    1.41  				printk("xen_pal_emulator: PAL_PERF_MON_INFO "
    1.42  					"can't copy to user!!!!\n");
    1.43  				status = -1;
    1.44 +				break;
    1.45  			}
    1.46 +			printk("PAL_PERF_MON_INFO succeeds! r9=%lx\n",r9);
    1.47 +			for (i=0; i<16;i++)
    1.48 +			printk("pm_buffer[i]=%lx\n",pm_buffer[i]);
    1.49  		}
    1.50  		break;
    1.51  	    case PAL_CACHE_INFO:
    1.52 @@ -364,8 +383,10 @@ xen_pal_emulator(unsigned long index, un
    1.53  		}
    1.54  		break;
    1.55  	    case PAL_VM_TR_READ:	/* FIXME: vcpu_get_tr?? */
    1.56 +		printk("PAL_VM_TR_READ NOT IMPLEMENTED, IGNORED!\n");
    1.57  		break;
    1.58  	    case PAL_HALT_INFO:		/* inappropriate info for guest? */
    1.59 +		printk("PAL_HALT_INFO NOT IMPLEMENTED, IGNORED!\n");
    1.60  		break;
    1.61  	    default:
    1.62  		printk("xen_pal_emulator: UNIMPLEMENTED PAL CALL %d!!!!\n",
     2.1 --- a/xen/arch/ia64/vcpu.c	Wed Jul 13 06:43:49 2005 -0700
     2.2 +++ b/xen/arch/ia64/vcpu.c	Wed Jul 13 13:12:00 2005 -0700
     2.3 @@ -1499,20 +1499,24 @@ IA64FAULT vcpu_get_cpuid(VCPU *vcpu, UIN
     2.4  	// if reg > 3
     2.5  	switch(reg) {
     2.6  	    case 0:
     2.7 +		memcpy(pval,"Xen/ia64",8);
     2.8 +		break;
     2.9  	    case 1:
    2.10 -		memcpy(pval,"Xen/ia64",8);
    2.11 +		*pval = 0;
    2.12  		break;
    2.13  	    case 2:
    2.14  		*pval = 0;
    2.15  		break;
    2.16  	    case 3:
    2.17 -		*pval = 0;  //FIXME: See vol1, 3.1.11
    2.18 +		*pval = ia64_get_cpuid(3);
    2.19  		break;
    2.20  	    case 4:
    2.21 -		*pval = 1;  //FIXME: See vol1, 3.1.11
    2.22 +		*pval = ia64_get_cpuid(4);
    2.23  		break;
    2.24  	    default:
    2.25 -		*pval = 0;  //FIXME: See vol1, 3.1.11
    2.26 +		if (reg > (ia64_get_cpuid(3) & 0xff))
    2.27 +			return IA64_RSVDREG_FAULT;
    2.28 +		*pval = ia64_get_cpuid(reg);
    2.29  		break;
    2.30  	}
    2.31  	return (IA64_NO_FAULT);