ia64/xen-unstable

changeset 9684:918ce6a565b7

[IA64] VM_SUMMARY and VM_INFO

xen_pal_emulator: implements VM_SUMMARY and VM_INFO.

Signed-off-by: Tristan Gingold <tristan.gingold@bull.net>
author awilliam@xenbuild.aw
date Thu Apr 13 14:57:13 2006 -0600 (2006-04-13)
parents cae4f6e6deab
children 4e8a64d8bd0e
files xen/arch/ia64/xen/dom_fw.c
line diff
     1.1 --- a/xen/arch/ia64/xen/dom_fw.c	Thu Apr 13 14:52:07 2006 -0600
     1.2 +++ b/xen/arch/ia64/xen/dom_fw.c	Thu Apr 13 14:57:13 2006 -0600
     1.3 @@ -200,7 +200,7 @@ xen_pal_emulator(unsigned long index, u6
     1.4  	unsigned long r9  = 0;
     1.5  	unsigned long r10 = 0;
     1.6  	unsigned long r11 = 0;
     1.7 -	long status = -1;
     1.8 +	long status = PAL_STATUS_UNIMPLEMENTED;
     1.9  
    1.10  	if (running_on_sim)
    1.11  		return pal_emulator_static(index);
    1.12 @@ -254,25 +254,84 @@ xen_pal_emulator(unsigned long index, u6
    1.13  		status = ia64_pal_cache_summary(&r9,&r10);
    1.14  		break;
    1.15  	    case PAL_VM_SUMMARY:
    1.16 -		// FIXME: what should xen return for these, figure out later
    1.17 -		// For now, linux does the right thing if pal call fails
    1.18 -		// In particular, rid_size must be set properly!
    1.19 -		//status = ia64_pal_vm_summary(
    1.20 -		//		(pal_vm_info_1_u_t *) &r9,
    1.21 -		//		(pal_vm_info_2_u_t *) &r10);
    1.22 +	        {
    1.23 +			/* Use xen-specific values.
    1.24 +			   hash_tag_id is somewhat random! */
    1.25 +			const pal_vm_info_1_u_t v1 =
    1.26 +				{.pal_vm_info_1_s =
    1.27 +				 { .vw = 1,
    1.28 +				   .phys_add_size = 44,
    1.29 +				   .key_size = 16,
    1.30 +				   .max_pkr = 15,
    1.31 +				   .hash_tag_id = 0x30,
    1.32 +				   .max_dtr_entry = NDTRS - 1,
    1.33 +				   .max_itr_entry = NITRS - 1,
    1.34 +#ifdef VHPT_GLOBAL
    1.35 +				   .max_unique_tcs = 3,
    1.36 +				   .num_tc_levels = 2
    1.37 +#else
    1.38 +				   .max_unique_tcs = 2,
    1.39 +				   .num_tc_levels = 1
    1.40 +#endif
    1.41 +				 }};
    1.42 +			const pal_vm_info_2_u_t v2 =
    1.43 +				{ .pal_vm_info_2_s =
    1.44 +				  { .impl_va_msb = 50,
    1.45 +				    .rid_size = current->domain->arch.rid_bits,
    1.46 +				    .reserved = 0 }};
    1.47 +			r9 = v1.pvi1_val;
    1.48 +			r10 = v2.pvi2_val;
    1.49 +			status = PAL_STATUS_SUCCESS;
    1.50 +		}
    1.51 +		break;
    1.52 +	    case PAL_VM_INFO:
    1.53 +#ifdef VHPT_GLOBAL
    1.54 +		if (in1 == 0 && in2 == 2) {
    1.55 +			/* Level 1: VHPT  */
    1.56 +			const pal_tc_info_u_t v =
    1.57 +				{ .pal_tc_info_s = {.num_sets = 128,
    1.58 +						    .associativity = 1,
    1.59 +						    .num_entries = 128,
    1.60 +						    .pf = 1,
    1.61 +						    .unified = 1,
    1.62 +						    .reduce_tr = 0,
    1.63 +						    .reserved = 0}};
    1.64 +			r9 = v.pti_val;
    1.65 +			/* Only support PAGE_SIZE tc.  */
    1.66 +			r10 = PAGE_SIZE;
    1.67 +			status = PAL_STATUS_SUCCESS;
    1.68 +		}
    1.69 +#endif
    1.70 +	        else if (
    1.71 +#ifdef VHPT_GLOBAL 
    1.72 +	                in1 == 1 /* Level 2. */
    1.73 +#else
    1.74 +			in1 == 0 /* Level 1. */
    1.75 +#endif
    1.76 +			 && (in2 == 1 || in2 == 2))
    1.77 +		{
    1.78 +			/* itlb/dtlb, 1 entry.  */
    1.79 +			const pal_tc_info_u_t v =
    1.80 +				{ .pal_tc_info_s = {.num_sets = 1,
    1.81 +						    .associativity = 1,
    1.82 +						    .num_entries = 1,
    1.83 +						    .pf = 1,
    1.84 +						    .unified = 0,
    1.85 +						    .reduce_tr = 0,
    1.86 +						    .reserved = 0}};
    1.87 +			r9 = v.pti_val;
    1.88 +			/* Only support PAGE_SIZE tc.  */
    1.89 +			r10 = PAGE_SIZE;
    1.90 +			status = PAL_STATUS_SUCCESS;
    1.91 +		}
    1.92 +	        else
    1.93 +			status = PAL_STATUS_EINVAL;
    1.94  		break;
    1.95  	    case PAL_RSE_INFO:
    1.96  		status = ia64_pal_rse_info(
    1.97  				&r9,
    1.98  				(pal_hints_u_t *) &r10);
    1.99  		break;
   1.100 -	    case PAL_VM_INFO:
   1.101 -		status = ia64_pal_vm_info(
   1.102 -				in1,
   1.103 -				in2,
   1.104 -				(pal_tc_info_u_t *) &r9,
   1.105 -				&r10);
   1.106 -		break;
   1.107  	    case PAL_REGISTER_INFO:
   1.108  		status = ia64_pal_register_info(in1, &r9, &r10);
   1.109  		break;
   1.110 @@ -296,7 +355,7 @@ xen_pal_emulator(unsigned long index, u6
   1.111  				while(1)
   1.112  				printk("xen_pal_emulator: PAL_PERF_MON_INFO "
   1.113  					"can't copy to user!!!!\n");
   1.114 -				status = -1;
   1.115 +				status = PAL_STATUS_UNIMPLEMENTED;
   1.116  				break;
   1.117  			}
   1.118  		}