ia64/xen-unstable

changeset 11687:792fb641ea7b

[HVM][SVM] Obtaining instruction address needs to mask to 32 bits
if not running in 64-bit mode.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Fri Sep 29 11:50:51 2006 +0100 (2006-09-29)
parents e229687561cf
children 477a0084ff47
files xen/arch/x86/hvm/svm/emulate.c
line diff
     1.1 --- a/xen/arch/x86/hvm/svm/emulate.c	Fri Sep 29 11:25:25 2006 +0100
     1.2 +++ b/xen/arch/x86/hvm/svm/emulate.c	Fri Sep 29 11:50:51 2006 +0100
     1.3 @@ -341,7 +341,11 @@ unsigned long svm_rip2pointer(struct vmc
     1.4       * %cs is update, but fortunately, base contain the valid base address
     1.5       * no matter what kind of addressing is used.
     1.6       */
     1.7 -    return vmcb->cs.base + vmcb->rip;
     1.8 +    unsigned long p = vmcb->cs.base + vmcb->rip;
     1.9 +    if (!(vmcb->cs.attributes.fields.l && vmcb->efer & EFER_LMA))
    1.10 +        return (u32)p; /* mask to 32 bits */
    1.11 +    /* NB. Should mask to 16 bits if in real mode or 16-bit protected mode. */
    1.12 +    return p;
    1.13  }
    1.14  
    1.15