# HG changeset patch # User yamahata@xxxxxxxxxxxxx # Date 1202374642 -32400 # Node ID f35a7fb1393b94d7917d58f37f05ffec52522e81 # Parent e83d2b840e88223a92f8473b23ae57876e298fc8 fix vcpu_tranlate(). When handling resion7 opt feature, it should check the range. PATCHNAME: fix_vcpu_translate Signed-off-by: Isaku Yamahata diff --git a/xen/arch/ia64/xen/vcpu.c b/xen/arch/ia64/xen/vcpu.c --- a/xen/arch/ia64/xen/vcpu.c +++ b/xen/arch/ia64/xen/vcpu.c @@ -1688,7 +1688,7 @@ IA64FAULT vcpu_translate(VCPU * vcpu, u6 IA64FAULT vcpu_translate(VCPU * vcpu, u64 address, BOOLEAN is_data, u64 * pteval, u64 * itir, u64 * iha) { - unsigned long region = address >> 61; + unsigned long region = REGION_NUMBER(address); unsigned long pta, rid, rr, key = 0; union pte_flags pte; TR_ENTRY *trp; @@ -1775,7 +1775,8 @@ IA64FAULT vcpu_translate(VCPU * vcpu, u6 /* Optimization for identity mapped region 7 OS (linux) */ if (optf->mask & XEN_IA64_OPTF_IDENT_MAP_REG7_FLG && - region == 7 && ia64_psr(regs)->cpl == CONFIG_CPL0_EMUL) { + region == 7 && ia64_psr(regs)->cpl == CONFIG_CPL0_EMUL && + REGION_OFFSET(address) < _PAGE_PPN_MASK) { pte.val = address & _PAGE_PPN_MASK; pte.val = pte.val | optf->im_reg7.pgprot; key = optf->im_reg7.key;