ia64/xen-unstable

changeset 7742:84f9bec4feaf

Fix read of guest psr to properly set dfh and other bits (by Matt Chapman)
author djm@kirby.fc.hp.com
date Fri Nov 18 11:04:58 2005 -0600 (2005-11-18)
parents 14393678d999
children e62c54ab862f
files xen/arch/ia64/xen/vcpu.c
line diff
     1.1 --- a/xen/arch/ia64/xen/vcpu.c	Fri Nov 18 10:58:03 2005 -0600
     1.2 +++ b/xen/arch/ia64/xen/vcpu.c	Fri Nov 18 11:04:58 2005 -0600
     1.3 @@ -345,19 +345,17 @@ IA64FAULT vcpu_set_psr_l(VCPU *vcpu, UIN
     1.4  
     1.5  IA64FAULT vcpu_get_psr(VCPU *vcpu, UINT64 *pval)
     1.6  {
     1.7 -	UINT64 psr;
     1.8 +	REGS *regs = vcpu_regs(vcpu);
     1.9  	struct ia64_psr newpsr;
    1.10  
    1.11 -	// TODO: This needs to return a "filtered" view of
    1.12 -	// the psr, not the actual psr.  Probably the psr needs
    1.13 -	// to be a field in regs (in addition to ipsr).
    1.14 -	__asm__ __volatile ("mov %0=psr;;" : "=r"(psr) :: "memory");
    1.15 -	newpsr = *(struct ia64_psr *)&psr;
    1.16 +	newpsr = *(struct ia64_psr *)&regs->cr_ipsr;
    1.17  	if (newpsr.cpl == 2) newpsr.cpl = 0;
    1.18  	if (PSCB(vcpu,interrupt_delivery_enabled)) newpsr.i = 1;
    1.19  	else newpsr.i = 0;
    1.20  	if (PSCB(vcpu,interrupt_collection_enabled)) newpsr.ic = 1;
    1.21  	else newpsr.ic = 0;
    1.22 +	if (PSCB(vcpu,metaphysical_mode)) newpsr.dt = 0;
    1.23 +	else newpsr.dt = 1;
    1.24  // FIXME: need new field in mapped_regs_t for virtual psr.pp (psr.be too?)
    1.25  	if (PSCB(vcpu,tmp[8])) newpsr.pp = 1;
    1.26  	else newpsr.pp = 0;