ia64/xen-unstable

changeset 15885:b5488dee14af

[IA64] Remove some legacy debug code.

Read cpl in priv_handle_op instead of priv_emulate

Signed-off-by: Tristan Gingold <tgingold@free.fr>
author Alex Williamson <alex.williamson@hp.com>
date Mon Sep 17 09:28:58 2007 -0600 (2007-09-17)
parents ea0b57e35c2c
children 487df63c4ae9
files xen/arch/ia64/xen/privop.c
line diff
     1.1 --- a/xen/arch/ia64/xen/privop.c	Wed Sep 12 09:36:36 2007 -0600
     1.2 +++ b/xen/arch/ia64/xen/privop.c	Mon Sep 17 09:28:58 2007 -0600
     1.3 @@ -13,10 +13,10 @@
     1.4  #include <asm/dom_fw.h>
     1.5  #include <asm/vhpt.h>
     1.6  #include <asm/bundle.h>
     1.7 +#include <asm/debugger.h>
     1.8  #include <xen/perfc.h>
     1.9  
    1.10 -long priv_verbose = 0;
    1.11 -unsigned long privop_trace = 0;
    1.12 +static const long priv_verbose = 0;
    1.13  
    1.14  /* Set to 1 to handle privified instructions from the privify tool. */
    1.15  #ifndef CONFIG_PRIVIFY
    1.16 @@ -583,7 +583,7 @@ static const PPEFCN Mpriv_funcs[64] = {
    1.17  	0, 0, 0, 0, 0, 0, 0, 0
    1.18  };
    1.19  
    1.20 -static IA64FAULT priv_handle_op(VCPU * vcpu, REGS * regs, int privlvl)
    1.21 +static IA64FAULT priv_handle_op(VCPU * vcpu, REGS * regs)
    1.22  {
    1.23  	IA64_BUNDLE bundle;
    1.24  	int slot;
    1.25 @@ -599,26 +599,8 @@ static IA64FAULT priv_handle_op(VCPU * v
    1.26  		//return vcpu_force_data_miss(vcpu, regs->cr_iip);
    1.27  		return vcpu_force_inst_miss(vcpu, regs->cr_iip);
    1.28  	}
    1.29 -#if 0
    1.30 -	if (iip == 0xa000000100001820) {
    1.31 -		static int firstpagefault = 1;
    1.32 -		if (firstpagefault) {
    1.33 -			printk("*** First time to domain page fault!\n");
    1.34 -			firstpagefault = 0;
    1.35 -		}
    1.36 -	}
    1.37 -#endif
    1.38 -	if (privop_trace) {
    1.39 -		static long i = 400;
    1.40 -		//if (i > 0) printk("priv_handle_op: at 0x%lx\n",iip);
    1.41 -		if (i > 0)
    1.42 -			printk("priv_handle_op: privop trace at 0x%lx, "
    1.43 -			       "itc=%lx, itm=%lx\n",
    1.44 -			       iip, ia64_get_itc(), ia64_get_itm());
    1.45 -		i--;
    1.46 -	}
    1.47  	slot = ((struct ia64_psr *)&ipsr)->ri;
    1.48 -	if (!slot)
    1.49 +	if (slot == 0)
    1.50  		inst.inst = (bundle.i64[0] >> 5) & MASK_41;
    1.51  	else if (slot == 1)
    1.52  		inst.inst =
    1.53 @@ -626,7 +608,8 @@ static IA64FAULT priv_handle_op(VCPU * v
    1.54  	else if (slot == 2)
    1.55  		inst.inst = (bundle.i64[1] >> 23) & MASK_41;
    1.56  	else
    1.57 -		printk("priv_handle_op: illegal slot: %d\n", slot);
    1.58 +		panic_domain(regs,
    1.59 +			     "priv_handle_op: illegal slot: %d\n", slot);
    1.60  
    1.61  	slot_type = slot_types[bundle.template][slot];
    1.62  	if (priv_verbose) {
    1.63 @@ -636,8 +619,9 @@ static IA64FAULT priv_handle_op(VCPU * v
    1.64  	}
    1.65  	if (slot_type == B && inst.generic.major == 0 && inst.B8.x6 == 0x0) {
    1.66  		// break instr for privified cover
    1.67 -	} else if (privlvl > CONFIG_CPL0_EMUL)
    1.68 +	} else if (ia64_get_cpl(ipsr) > CONFIG_CPL0_EMUL)
    1.69  		return IA64_ILLOP_FAULT;
    1.70 +
    1.71  	switch (slot_type) {
    1.72  	case M:
    1.73  		if (inst.generic.major == 0) {
    1.74 @@ -765,9 +749,7 @@ static IA64FAULT priv_handle_op(VCPU * v
    1.75  IA64FAULT priv_emulate(VCPU * vcpu, REGS * regs, u64 isr)
    1.76  {
    1.77  	IA64FAULT fault;
    1.78 -	u64 ipsr = regs->cr_ipsr;
    1.79  	u64 isrcode = (isr >> 4) & 0xf;
    1.80 -	int privlvl;
    1.81  
    1.82  	// handle privops masked as illops? and breaks (6)
    1.83  	if (isrcode != 1 && isrcode != 2 && isrcode != 0 && isrcode != 6) {
    1.84 @@ -776,10 +758,8 @@ IA64FAULT priv_emulate(VCPU * vcpu, REGS
    1.85  		while (1) ;
    1.86  		return IA64_ILLOP_FAULT;
    1.87  	}
    1.88 -	//if (isrcode != 1 && isrcode != 2) return 0;
    1.89 -	privlvl = ia64_get_cpl(ipsr);
    1.90  	// its OK for a privified-cover to be executed in user-land
    1.91 -	fault = priv_handle_op(vcpu, regs, privlvl);
    1.92 +	fault = priv_handle_op(vcpu, regs);
    1.93  	if ((fault == IA64_NO_FAULT) || (fault == IA64_EXTINT_VECTOR)) {
    1.94  		// success!!
    1.95  		// update iip/ipsr to point to the next instruction