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

[Xen-devel] Re: [RFC, PATCH 5/24] i386 Vmi code patching

To: Zachary Amsden <zach@xxxxxxxxxx>
Subject: [Xen-devel] Re: [RFC, PATCH 5/24] i386 Vmi code patching
From: Anthony Liguori <aliguori@xxxxxxxxxx>
Date: Wed, 15 Mar 2006 16:05:48 -0600
Cc: Andrew Morton <akpm@xxxxxxxx>, Joshua LeVasseur <jtl@xxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, Pratap Subrahmanyam <pratap@xxxxxxxxxx>, Wim Coekaerts <wim.coekaerts@xxxxxxxxxx>, Chris Wright <chrisw@xxxxxxxx>, Jack Lo <jlo@xxxxxxxxxx>, Dan Hecht <dhecht@xxxxxxxxxx>, Linux Kernel Mailing List <linux-kernel@xxxxxxxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxxxx>, Christopher Li <chrisl@xxxxxxxxxx>, Virtualization Mailing List <virtualization@xxxxxxxxxxxxxx>, Linus Torvalds <torvalds@xxxxxxxx>, Anne Holler <anne@xxxxxxxxxx>, Jyothy Reddy <jreddy@xxxxxxxxxx>, Kip Macy <kmacy@xxxxxxxxxxx>, Ky Srinivasan <ksrinivasan@xxxxxxxxxx>, Leendert van Doorn <leendert@xxxxxxxxxxxxxx>, Dan Arai <arai@xxxxxxxxxx>
Delivery-date: Fri, 17 Mar 2006 10:37:47 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <200603131802.k2DI2nv8005665@xxxxxxxxxxxxxxxxxxx>
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>
References: <200603131802.k2DI2nv8005665@xxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mail/News 1.5 (X11/20060309)
Zachary Amsden wrote:
+void __init vmi_init(void)
+{
+       int romsize;
+
+       /*
+        * Setup optional callback functions if we found the VMI ROM
+        */
+       if (hypervisor_found) {
+               romsize = vmi_rom->romLength * 512;
+               if (VROMFunc(vmi_rom, VMI_CALL_Init)) {
+                       printk(KERN_WARNING "VMI ROM failed to initialize\n");
+                       hypervisor_found = 0;
+               } else {
+                       memcpy(&__VMI_START, (char *)vmi_rom, romsize);
+                       scan_builtin_annotations();
+               }
+       }
+ if (!vmi_rom) + printk(KERN_WARNING "VMI ROM not found"
+                      " - falling back to native mode\n");
+       else if (!hypervisor_found)
+               printk(KERN_WARNING "VMI ROM version mismatch "
+                      "(kernel requires version >= %d.%d) "
+                      " - falling back to native mode\n",
+                      VMI_API_REV_MAJOR, MIN_VMI_API_REV_MINOR);
+}
Minor nitpick.

The error logic here is somewhat confusing. If a VMI_CALL_Init results in a failure, you end up with:

 VMI ROM failed to initialize
VMI ROM version mismatch (kernel requires version >= 13.0) - falling back to native mode

The later error is misleading as the version may actually match. The nesting here probably could be simplified to.

Regards,

Anthony Liguori


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