direct-io.hg

changeset 5464:dfa0c3f7cf60

bitkeeper revision 1.1709.1.11 (42b0b93aUkhSewPtS6RpEdWHg0T5Mw)

More hyperprivops
Signed-off-by: Dan Magenheimer <dan.magenheimer@hp.com>
author djm@kirby.fc.hp.com
date Wed Jun 15 23:26:50 2005 +0000 (2005-06-15)
parents 39bf99b109dd
children bb00ea361eb8
files xen/arch/ia64/privop.c xen/arch/ia64/vcpu.c xen/include/asm-ia64/vcpu.h
line diff
     1.1 --- a/xen/arch/ia64/privop.c	Wed Jun 15 20:26:42 2005 +0000
     1.2 +++ b/xen/arch/ia64/privop.c	Wed Jun 15 23:26:50 2005 +0000
     1.3 @@ -753,11 +753,17 @@ priv_emulate(VCPU *vcpu, REGS *regs, UIN
     1.4  #define HYPERPRIVOP_SET_TPR		0xa
     1.5  #define HYPERPRIVOP_EOI			0xb
     1.6  #define HYPERPRIVOP_SET_ITM		0xc
     1.7 -#define HYPERPRIVOP_MAX			0xc
     1.8 +#define HYPERPRIVOP_THASH		0xd
     1.9 +#define HYPERPRIVOP_PTC_GA		0xe
    1.10 +#define HYPERPRIVOP_ITR_D		0xf
    1.11 +#define HYPERPRIVOP_GET_RR		0x10
    1.12 +#define HYPERPRIVOP_SET_RR		0x11
    1.13 +#define HYPERPRIVOP_MAX			0x11
    1.14  
    1.15  char *hyperpriv_str[HYPERPRIVOP_MAX+1] = {
    1.16  	0, "rfi", "rsm.dt", "ssm.dt", "cover", "itc.d", "itc.i", "ssm.i",
    1.17 -	"=ivr", "=tpr", "tpr=", "eoi", "itm=",
    1.18 +	"=ivr", "=tpr", "tpr=", "eoi", "itm=", "thash", "ptc.ga", "itr.d",
    1.19 +	"=rr", "rr=",
    1.20  	0
    1.21  };
    1.22  
    1.23 @@ -772,6 +778,7 @@ ia64_hyperprivop(unsigned long iim, REGS
    1.24  	struct vcpu *v = (struct domain *) current;
    1.25  	INST64 inst;
    1.26  	UINT64 val;
    1.27 +	UINT64 itir, ifa;
    1.28  
    1.29  // FIXME: Handle faults appropriately for these
    1.30  	if (!iim || iim > HYPERPRIVOP_MAX) {
    1.31 @@ -820,6 +827,27 @@ ia64_hyperprivop(unsigned long iim, REGS
    1.32  	    case HYPERPRIVOP_SET_ITM:
    1.33  		(void)vcpu_set_itm(v,regs->r8);
    1.34  		return 1;
    1.35 +	    case HYPERPRIVOP_THASH:
    1.36 +		(void)vcpu_thash(v,regs->r8,&val);
    1.37 +		regs->r8 = val;
    1.38 +		return 1;
    1.39 +	    case HYPERPRIVOP_PTC_GA:
    1.40 +		// FIXME: this doesn't seem to work yet, turned off
    1.41 +		//(void)vcpu_ptc_ga(v,regs->r8,regs->r9);
    1.42 +		//return 1;
    1.43 +		break;
    1.44 +	    case HYPERPRIVOP_ITR_D:
    1.45 +		(void)vcpu_get_itir(v,&itir);
    1.46 +		(void)vcpu_get_ifa(v,&ifa);
    1.47 +		(void)vcpu_itr_d(v,regs->r8,regs->r9,itir,ifa);
    1.48 +		return 1;
    1.49 +	    case HYPERPRIVOP_GET_RR:
    1.50 +		(void)vcpu_get_rr(v,regs->r8,&val);
    1.51 +		regs->r8 = val;
    1.52 +		return 1;
    1.53 +	    case HYPERPRIVOP_SET_RR:
    1.54 +		(void)vcpu_set_rr(v,regs->r8,regs->r9);
    1.55 +		return 1;
    1.56  	}
    1.57  	return 0;
    1.58  }
     2.1 --- a/xen/arch/ia64/vcpu.c	Wed Jun 15 20:26:42 2005 +0000
     2.2 +++ b/xen/arch/ia64/vcpu.c	Wed Jun 15 23:26:50 2005 +0000
     2.3 @@ -43,8 +43,9 @@ typedef	union {
     2.4  
     2.5  #ifdef PRIVOP_ADDR_COUNT
     2.6  struct privop_addr_count privop_addr_counter[PRIVOP_COUNT_NINSTS] = {
     2.7 -	{ "rsm", { 0 }, { 0 }, 0 },
     2.8 -	{ "ssm", { 0 }, { 0 }, 0 }
     2.9 +	{ "=ifa", { 0 }, { 0 }, 0 },
    2.10 +	{ "thash", { 0 }, { 0 }, 0 },
    2.11 +	0
    2.12  };
    2.13  extern void privop_count_addr(unsigned long addr, int inst);
    2.14  #define	PRIVOP_COUNT_ADDR(regs,inst) privop_count_addr(regs->cr_iip,inst)
    2.15 @@ -135,7 +136,7 @@ IA64FAULT vcpu_reset_psr_sm(VCPU *vcpu, 
    2.16  	struct ia64_psr psr, imm, *ipsr;
    2.17  	REGS *regs = vcpu_regs(vcpu);
    2.18  
    2.19 -	PRIVOP_COUNT_ADDR(regs,_RSM);
    2.20 +	//PRIVOP_COUNT_ADDR(regs,_RSM);
    2.21  	// TODO: All of these bits need to be virtualized
    2.22  	// TODO: Only allowed for current vcpu
    2.23  	__asm__ __volatile ("mov %0=psr;;" : "=r"(psr) :: "memory");
    2.24 @@ -183,7 +184,7 @@ IA64FAULT vcpu_set_psr_sm(VCPU *vcpu, UI
    2.25  	REGS *regs = vcpu_regs(vcpu);
    2.26  	UINT64 mask, enabling_interrupts = 0;
    2.27  
    2.28 -	PRIVOP_COUNT_ADDR(regs,_SSM);
    2.29 +	//PRIVOP_COUNT_ADDR(regs,_SSM);
    2.30  	// TODO: All of these bits need to be virtualized
    2.31  	__asm__ __volatile ("mov %0=psr;;" : "=r"(psr) :: "memory");
    2.32  	imm = *(struct ia64_psr *)&imm24;
    2.33 @@ -369,6 +370,8 @@ IA64FAULT vcpu_get_iip(VCPU *vcpu, UINT6
    2.34  IA64FAULT vcpu_get_ifa(VCPU *vcpu, UINT64 *pval)
    2.35  {
    2.36  	UINT64 val = PSCB(vcpu,ifa);
    2.37 +	REGS *regs = vcpu_regs(vcpu);
    2.38 +	PRIVOP_COUNT_ADDR(regs,_GET_IFA);
    2.39  	*pval = val;
    2.40  	return (IA64_NO_FAULT);
    2.41  }
    2.42 @@ -422,6 +425,8 @@ IA64FAULT vcpu_get_iha(VCPU *vcpu, UINT6
    2.43  {
    2.44  	//return vcpu_thash(vcpu,PSCB(vcpu,ifa),pval);
    2.45  	UINT64 val = PSCB(vcpu,iha);
    2.46 +	REGS *regs = vcpu_regs(vcpu);
    2.47 +	PRIVOP_COUNT_ADDR(regs,_THASH);
    2.48  	*pval = val;
    2.49  	return (IA64_NO_FAULT);
    2.50  }
     3.1 --- a/xen/include/asm-ia64/vcpu.h	Wed Jun 15 20:26:42 2005 +0000
     3.2 +++ b/xen/include/asm-ia64/vcpu.h	Wed Jun 15 23:26:50 2005 +0000
     3.3 @@ -23,8 +23,8 @@ typedef struct pt_regs REGS;
     3.4  
     3.5  #define PRIVOP_ADDR_COUNT
     3.6  #ifdef PRIVOP_ADDR_COUNT
     3.7 -#define _RSM 0
     3.8 -#define _SSM 1
     3.9 +#define _GET_IFA 0
    3.10 +#define _THASH 1
    3.11  #define PRIVOP_COUNT_NINSTS 2
    3.12  #define PRIVOP_COUNT_NADDRS 30
    3.13