ia64/xen-unstable

changeset 6869:8906825d5197

Fix dcr.pp and psr.pp support (non-VTI) so pfmon --system-wide works
Signed-off by: Dan Magenheimer <dan.magenheimer@hp.com>
author djm@kirby.fc.hp.com
date Tue Sep 20 16:11:19 2005 -0600 (2005-09-20)
parents f2309ac2648a
children e608c8118f25
files xen/arch/ia64/linux-xen/setup.c xen/arch/ia64/xen/hyperprivop.S xen/arch/ia64/xen/vcpu.c xen/include/public/arch-ia64.h
line diff
     1.1 --- a/xen/arch/ia64/linux-xen/setup.c	Tue Sep 20 13:03:25 2005 -0600
     1.2 +++ b/xen/arch/ia64/linux-xen/setup.c	Tue Sep 20 16:11:19 2005 -0600
     1.3 @@ -824,8 +824,13 @@ cpu_init (void)
     1.4  	 * shouldn't be affected by this (moral: keep your ia32 locks aligned and you'll
     1.5  	 * be fine).
     1.6  	 */
     1.7 +#ifdef XEN
     1.8 +	ia64_setreg(_IA64_REG_CR_DCR,  (  IA64_DCR_DP | IA64_DCR_DK | IA64_DCR_DX | IA64_DCR_DR
     1.9 +			  | IA64_DCR_PP | IA64_DCR_DA | IA64_DCR_DD | IA64_DCR_LC));
    1.10 +#else
    1.11  	ia64_setreg(_IA64_REG_CR_DCR,  (  IA64_DCR_DP | IA64_DCR_DK | IA64_DCR_DX | IA64_DCR_DR
    1.12  					| IA64_DCR_DA | IA64_DCR_DD | IA64_DCR_LC));
    1.13 +#endif
    1.14  	atomic_inc(&init_mm.mm_count);
    1.15  	current->active_mm = &init_mm;
    1.16  #ifdef XEN
     2.1 --- a/xen/arch/ia64/xen/hyperprivop.S	Tue Sep 20 13:03:25 2005 -0600
     2.2 +++ b/xen/arch/ia64/xen/hyperprivop.S	Tue Sep 20 16:11:19 2005 -0600
     2.3 @@ -261,7 +261,8 @@ ENTRY(hyper_ssm_i)
     2.4  	;;
     2.5  	// FOR SSM_I ONLY, also turn on psr.i and psr.ic
     2.6  	movl r28=(IA64_PSR_DT|IA64_PSR_IT|IA64_PSR_RT|IA64_PSR_I|IA64_PSR_IC);;
     2.7 -	movl r27=~(IA64_PSR_BE|IA64_PSR_PP|IA64_PSR_BN);;
     2.8 +//	movl r27=~(IA64_PSR_BE|IA64_PSR_PP|IA64_PSR_BN);;
     2.9 +	movl r27=~(IA64_PSR_BE|IA64_PSR_BN);;
    2.10  	or r30=r30,r28;;
    2.11  	and r30=r30,r27;;
    2.12  	adds r21=XSI_IPSR_OFS-XSI_PSR_IC_OFS,r18 ;;
     3.1 --- a/xen/arch/ia64/xen/vcpu.c	Tue Sep 20 13:03:25 2005 -0600
     3.2 +++ b/xen/arch/ia64/xen/vcpu.c	Tue Sep 20 16:11:19 2005 -0600
     3.3 @@ -191,7 +191,12 @@ IA64FAULT vcpu_reset_psr_sm(VCPU *vcpu, 
     3.4  			return (IA64_ILLOP_FAULT);
     3.5  	if (imm.dfh) ipsr->dfh = 0;
     3.6  	if (imm.dfl) ipsr->dfl = 0;
     3.7 -	if (imm.pp) { ipsr->pp = 0; psr.pp = 0; }
     3.8 +	if (imm.pp) {
     3.9 +		ipsr->pp = 1;
    3.10 +		psr.pp = 1;	// priv perf ctrs always enabled
    3.11 +// FIXME: need new field in mapped_regs_t for virtual psr.pp (psr.be too?)
    3.12 +		PSCB(vcpu,tmp[8]) = 0;	// but fool the domain if it gets psr
    3.13 +	}
    3.14  	if (imm.up) { ipsr->up = 0; psr.up = 0; }
    3.15  	if (imm.sp) { ipsr->sp = 0; psr.sp = 0; }
    3.16  	if (imm.be) ipsr->be = 0;
    3.17 @@ -233,7 +238,11 @@ IA64FAULT vcpu_set_psr_sm(VCPU *vcpu, UI
    3.18  	if (imm24 & ~mask) return (IA64_ILLOP_FAULT);
    3.19  	if (imm.dfh) ipsr->dfh = 1;
    3.20  	if (imm.dfl) ipsr->dfl = 1;
    3.21 -	if (imm.pp) { ipsr->pp = 1; psr.pp = 1; }
    3.22 +	if (imm.pp) {
    3.23 +		ipsr->pp = 1; psr.pp = 1;
    3.24 +// FIXME: need new field in mapped_regs_t for virtual psr.pp (psr.be too?)
    3.25 +		PSCB(vcpu,tmp[8]) = 1;
    3.26 +	}
    3.27  	if (imm.sp) { ipsr->sp = 1; psr.sp = 1; }
    3.28  	if (imm.i) {
    3.29  		if (!PSCB(vcpu,interrupt_delivery_enabled)) {
    3.30 @@ -284,7 +293,15 @@ IA64FAULT vcpu_set_psr_l(VCPU *vcpu, UIN
    3.31  	// however trying to set other bits can't be an error as it is in ssm
    3.32  	if (newpsr.dfh) ipsr->dfh = 1;
    3.33  	if (newpsr.dfl) ipsr->dfl = 1;
    3.34 -	if (newpsr.pp) { ipsr->pp = 1; psr.pp = 1; }
    3.35 +	if (newpsr.pp) {
    3.36 +		ipsr->pp = 1; psr.pp = 1;
    3.37 +// FIXME: need new field in mapped_regs_t for virtual psr.pp (psr.be too?)
    3.38 +		PSCB(vcpu,tmp[8]) = 1;
    3.39 +	}
    3.40 +	else {
    3.41 +		ipsr->pp = 1; psr.pp = 1;
    3.42 +		PSCB(vcpu,tmp[8]) = 0;
    3.43 +	}
    3.44  	if (newpsr.up) { ipsr->up = 1; psr.up = 1; }
    3.45  	if (newpsr.sp) { ipsr->sp = 1; psr.sp = 1; }
    3.46  	if (newpsr.i) {
    3.47 @@ -331,6 +348,9 @@ IA64FAULT vcpu_get_psr(VCPU *vcpu, UINT6
    3.48  	else newpsr.i = 0;
    3.49  	if (PSCB(vcpu,interrupt_collection_enabled)) newpsr.ic = 1;
    3.50  	else newpsr.ic = 0;
    3.51 +// FIXME: need new field in mapped_regs_t for virtual psr.pp (psr.be too?)
    3.52 +	if (PSCB(vcpu,tmp[8])) newpsr.pp = 1;
    3.53 +	else newpsr.pp = 0;
    3.54  	*pval = *(unsigned long *)&newpsr;
    3.55  	return IA64_NO_FAULT;
    3.56  }
     4.1 --- a/xen/include/public/arch-ia64.h	Tue Sep 20 13:03:25 2005 -0600
     4.2 +++ b/xen/include/public/arch-ia64.h	Tue Sep 20 16:11:19 2005 -0600
     4.3 @@ -229,6 +229,7 @@ typedef struct {
     4.4  	    unsigned long krs[8];	// kernel registers
     4.5  	    unsigned long pkrs[8];	// protection key registers
     4.6  	    unsigned long tmp[8];	// temp registers (e.g. for hyperprivops)
     4.7 +		// FIXME: tmp[8] temp'ly being used for virtual psr.pp
     4.8  	  };
     4.9          };
    4.10  #if 0