# HG changeset patch # User dietmar.hahn@xxxxxxxxxxxxxxxxxxx # Node ID 3bb17207e1417548827073805b8d756f3829a1a3 # Parent 315c348e5f9e2f929032dae3fec3e2583ca91785 First step to support big-endian PV domU's. Signed-off-by: Dietmar Hahn diff -r 315c348e5f9e -r 3bb17207e141 xen/arch/ia64/xen/faults.c --- a/xen/arch/ia64/xen/faults.c Tue Feb 20 15:43:57 2007 -0700 +++ b/xen/arch/ia64/xen/faults.c Wed Feb 21 11:59:17 2007 +0100 @@ -91,6 +91,10 @@ void reflect_interruption(unsigned long regs->cr_iip = ((unsigned long)PSCBX(v, iva) + vector) & ~0xffUL; regs->cr_ipsr = (regs->cr_ipsr & ~DELIVER_PSR_CLR) | DELIVER_PSR_SET; +#if defined(SUPPORT_PV_BE_DOMU) + if(PSCB(v, dcr) & IA64_DCR_BE) + regs->cr_ipsr |= IA64_PSR_BE; +#endif if (PSCB(v, hpsr_dfh)) regs->cr_ipsr |= IA64_PSR_DFH; @@ -154,6 +158,10 @@ void reflect_event(void) regs->cr_iip = v->arch.event_callback_ip; regs->cr_ipsr = (regs->cr_ipsr & ~DELIVER_PSR_CLR) | DELIVER_PSR_SET; +#if defined(SUPPORT_PV_BE_DOMU) + if(PSCB(v, dcr) & IA64_DCR_BE) + regs->cr_ipsr |= IA64_PSR_BE; +#endif if (PSCB(v, hpsr_dfh)) regs->cr_ipsr |= IA64_PSR_DFH; diff -r 315c348e5f9e -r 3bb17207e141 xen/arch/ia64/xen/vcpu.c --- a/xen/arch/ia64/xen/vcpu.c Tue Feb 20 15:43:57 2007 -0700 +++ b/xen/arch/ia64/xen/vcpu.c Wed Feb 21 11:59:17 2007 +0100 @@ -326,7 +326,11 @@ IA64FAULT vcpu_set_psr_sm(VCPU * vcpu, u // just handle psr.sp,pp and psr.i,ic (and user mask) for now mask = IA64_PSR_PP | IA64_PSR_SP | IA64_PSR_I | IA64_PSR_IC | IA64_PSR_UM | +#if defined(SUPPORT_PV_BE_DOMU) + IA64_PSR_DT | IA64_PSR_DFL | IA64_PSR_DFH | IA64_PSR_BE; +#else IA64_PSR_DT | IA64_PSR_DFL | IA64_PSR_DFH; +#endif if (imm24 & ~mask) return IA64_ILLOP_FAULT; if (imm.dfh) { @@ -371,8 +375,12 @@ IA64FAULT vcpu_set_psr_sm(VCPU * vcpu, u psr.up = 1; } if (imm.be) { +#if defined(SUPPORT_PV_BE_DOMU) + ipsr->be = 1; +#else printk("*** DOMAIN TRYING TO TURN ON BIG-ENDIAN!!!\n"); return IA64_ILLOP_FAULT; +#endif } if (imm.dt) vcpu_set_metaphysical_mode(vcpu, FALSE); @@ -451,8 +459,12 @@ IA64FAULT vcpu_set_psr_l(VCPU * vcpu, u6 else vcpu_set_metaphysical_mode(vcpu, TRUE); if (newpsr.be) { +#if defined(SUPPORT_PV_BE_DOMU) + ipsr->be = 1; +#else printk("*** DOMAIN TRYING TO TURN ON BIG-ENDIAN!!!\n"); return IA64_ILLOP_FAULT; +#endif } if (enabling_interrupts && vcpu_check_pending_interrupts(vcpu) != SPURIOUS_VECTOR) @@ -506,9 +518,11 @@ u64 vcpu_get_ipsr_int_state(VCPU * vcpu, //printk("*** vcpu_get_ipsr_int_state (0x%016lx)...\n",prevpsr); psr.i64 = prevpsr; +#if !defined(SUPPORT_PV_BE_DOMU) psr.ia64_psr.be = 0; if (dcr & IA64_DCR_BE) psr.ia64_psr.be = 1; +#endif psr.ia64_psr.pp = 0; if (dcr & IA64_DCR_PP) psr.ia64_psr.pp = 1; @@ -1376,10 +1390,12 @@ IA64FAULT vcpu_rfi(VCPU * vcpu) psr.ia64_psr.it = 1; psr.ia64_psr.bn = 1; //psr.pk = 1; // checking pkeys shouldn't be a problem but seems broken +#if !defined(SUPPORT_PV_BE_DOMU) if (psr.ia64_psr.be) { printk("*** DOMAIN TRYING TO TURN ON BIG-ENDIAN!!!\n"); return IA64_ILLOP_FAULT; } +#endif ifs = PSCB(vcpu, ifs); if (ifs & 0x8000000000000000UL) diff -r 315c348e5f9e -r 3bb17207e141 xen/arch/ia64/xen/xensetup.c --- a/xen/arch/ia64/xen/xensetup.c Tue Feb 20 15:43:57 2007 -0700 +++ b/xen/arch/ia64/xen/xensetup.c Wed Feb 21 11:59:17 2007 +0100 @@ -566,5 +566,9 @@ void arch_get_xen_caps(xen_capabilities_ snprintf(s, sizeof(s), "hvm-%d.%d-ia64 ", major, minor); safe_strcat(*info, s); } -} - +#if defined(SUPPORT_PV_BE_DOMU) + snprintf(s, sizeof(s), "xen-%d.%d-ia64be ", major, minor); + safe_strcat(*info, s); +#endif +} +