ia64/xen-unstable

changeset 12394:529b3f3fb127

[IA64] Guest PAL_INIT support for IPI

Signed-off-by: Zhang Xin <xing.z.zhang@intel.com>
author awilliam@xenbuild.aw
date Fri Nov 10 13:01:23 2006 -0700 (2006-11-10)
parents dbfd94442e46
children 63cb737b9a24
files xen/arch/ia64/vmx/mmio.c
line diff
     1.1 --- a/xen/arch/ia64/vmx/mmio.c	Fri Nov 10 12:55:52 2006 -0700
     1.2 +++ b/xen/arch/ia64/vmx/mmio.c	Fri Nov 10 13:01:23 2006 -0700
     1.3 @@ -380,6 +380,24 @@ memread_p(VCPU *vcpu, u64 *src, u64 *des
     1.4  }
     1.5  */
     1.6  
     1.7 +/*
     1.8 + * To inject INIT to guest, we must set the PAL_INIT entry 
     1.9 + * and set psr to switch to physical mode
    1.10 + */
    1.11 +#define PAL_INIT_ENTRY 0x80000000ffffffa0
    1.12 +#define PSR_SET_BITS (IA64_PSR_DT | IA64_PSR_IT | IA64_PSR_RT |	\
    1.13 +                      IA64_PSR_IC | IA64_PSR_RI)
    1.14 +
    1.15 +static void vmx_inject_guest_pal_init(VCPU *vcpu)
    1.16 +{
    1.17 +    REGS *regs = vcpu_regs(vcpu);
    1.18 +    uint64_t psr = vmx_vcpu_get_psr(vcpu);
    1.19 +
    1.20 +    regs->cr_iip = PAL_INIT_ENTRY;
    1.21 +
    1.22 +    psr = psr & (~PSR_SET_BITS);
    1.23 +    vmx_vcpu_set_psr(vcpu,psr);
    1.24 +}
    1.25  
    1.26  /*
    1.27   * Deliver IPI message. (Only U-VP is supported now)
    1.28 @@ -403,8 +421,7 @@ static void deliver_ipi (VCPU *vcpu, uin
    1.29          vmx_vcpu_pend_interrupt (vcpu, 2);
    1.30          break;
    1.31      case 5:     // INIT
    1.32 -        // TODO -- inject guest INIT
    1.33 -        panic_domain (NULL, "Inject guest INIT!\n");
    1.34 +        vmx_inject_guest_pal_init(vcpu);
    1.35          break;
    1.36      case 7:     // ExtINT
    1.37          vmx_vcpu_pend_interrupt (vcpu, 0);