ia64/xen-unstable

changeset 19358:0f7e2ba5d0e6

[SVM] fix segment descriptors to allow migration to Intel VT systems

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Mar 13 07:43:45 2009 +0000 (2009-03-13)
parents f97e737373cd
children 4fd39881f9f1
files xen/arch/x86/hvm/svm/svm.c
line diff
     1.1 --- a/xen/arch/x86/hvm/svm/svm.c	Fri Mar 13 07:38:47 2009 +0000
     1.2 +++ b/xen/arch/x86/hvm/svm/svm.c	Fri Mar 13 07:43:45 2009 +0000
     1.3 @@ -488,28 +488,40 @@ static void svm_get_segment_register(str
     1.4      {
     1.5      case x86_seg_cs:
     1.6          memcpy(reg, &vmcb->cs, sizeof(*reg));
     1.7 +        reg->attr.fields.g = reg->limit > 0xFFFFF;
     1.8          break;
     1.9      case x86_seg_ds:
    1.10          memcpy(reg, &vmcb->ds, sizeof(*reg));
    1.11 +        if ( reg->attr.fields.type != 0 )
    1.12 +            reg->attr.fields.type |= 0x1;
    1.13          break;
    1.14      case x86_seg_es:
    1.15          memcpy(reg, &vmcb->es, sizeof(*reg));
    1.16 +        if ( reg->attr.fields.type != 0 )
    1.17 +            reg->attr.fields.type |= 0x1;
    1.18          break;
    1.19      case x86_seg_fs:
    1.20          svm_sync_vmcb(v);
    1.21          memcpy(reg, &vmcb->fs, sizeof(*reg));
    1.22 +        if ( reg->attr.fields.type != 0 )
    1.23 +            reg->attr.fields.type |= 0x1;
    1.24          break;
    1.25      case x86_seg_gs:
    1.26          svm_sync_vmcb(v);
    1.27          memcpy(reg, &vmcb->gs, sizeof(*reg));
    1.28 +        if ( reg->attr.fields.type != 0 )
    1.29 +            reg->attr.fields.type |= 0x1;
    1.30          break;
    1.31      case x86_seg_ss:
    1.32          memcpy(reg, &vmcb->ss, sizeof(*reg));
    1.33          reg->attr.fields.dpl = vmcb->cpl;
    1.34 +        if ( reg->attr.fields.type == 0 )
    1.35 +            reg->attr.fields.db = 0;
    1.36          break;
    1.37      case x86_seg_tr:
    1.38          svm_sync_vmcb(v);
    1.39          memcpy(reg, &vmcb->tr, sizeof(*reg));
    1.40 +        reg->attr.fields.type |= 0x2;
    1.41          break;
    1.42      case x86_seg_gdtr:
    1.43          memcpy(reg, &vmcb->gdtr, sizeof(*reg));