WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

RE: [Xen-devel] [PATCh] Full 64 bits VMCS field operation

To: "Keir Fraser" <Keir.Fraser@xxxxxxxxxxxx>
Subject: RE: [Xen-devel] [PATCh] Full 64 bits VMCS field operation
From: "Dong, Eddie" <eddie.dong@xxxxxxxxx>
Date: Thu, 6 Jul 2006 10:21:49 +0800
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Wed, 05 Jul 2006 19:23:13 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcagQYadA7kGZ0tnT5qehoV3FZqZQgAYCGgA
Thread-topic: [Xen-devel] [PATCh] Full 64 bits VMCS field operation
Keir Fraser wrote:
> On 5 Jul 2006, at 15:04, Dong, Eddie wrote:
> 
>> Cleanup some mis-operation of full 64 bits VMCS fields in 32 bits
>> VMM. 
> 
>  From VMWRITE description in Intel Reference Manual Volume 2:
> "If the VMCS field specified by the secondary source operand is
> shorter than this effective operand size, the high bits of the
> primary source operand are ignored. If the VMCS field is longer, then
> the high bits of the field are cleared to 0."
> 
OK, for those always "0" bits, it is safe.
For virt_to_maddr(io_bitmap_a), it is within low 32 bits today, but it
may 
exceed 4G in PAE case when Xen in future is moved to high end memory 
for some usage model.
How about following one?
Anyway, it is really a minor one.
Eddie

diff -r c5088f03390f xen/arch/x86/hvm/vmx/vmcs.c
--- a/xen/arch/x86/hvm/vmx/vmcs.c       Wed Jul 05 15:47:01 2006 +0800
+++ b/xen/arch/x86/hvm/vmx/vmcs.c       Thu Jul 06 10:20:23 2006 +0800
@@ -151,7 +151,11 @@ static inline int construct_vmcs_control
 
     error |= __vmwrite(IO_BITMAP_A, (u64) virt_to_maddr(io_bitmap_a));
     error |= __vmwrite(IO_BITMAP_B, (u64) virt_to_maddr(io_bitmap_b));
-
+#if defined (__i386__)
+    error |= __vmwrite(IO_BITMAP_A_HIGH,
virt_to_maddr(io_bitmap_a)>>32);
+    error |= __vmwrite(IO_BITMAP_B_HIGH,
virt_to_maddr(io_bitmap_b)>>32);
+#endif
+    
     arch_vmx->io_bitmap_a = io_bitmap_a;
     arch_vmx->io_bitmap_b = io_bitmap_b;
 
@@ -376,8 +380,10 @@ static inline int construct_init_vmcs_gu
     error |= __vmwrite(GUEST_INTERRUPTIBILITY_INFO, 0);
     __asm__ __volatile__ ("mov %%dr7, %0\n" : "=r" (dr7));
     error |= __vmwrite(GUEST_DR7, dr7);
-    error |= __vmwrite(VMCS_LINK_POINTER, 0xffffffff);
-    error |= __vmwrite(VMCS_LINK_POINTER_HIGH, 0xffffffff);
+    error |= __vmwrite(VMCS_LINK_POINTER, -1UL);
+#if defined (__i386__)
+    error |= __vmwrite(VMCS_LINK_POINTER_HIGH, -1UL);
+#endif
 
     return error;
 }

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>