Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751669AbWCOWF7 (ORCPT ); Wed, 15 Mar 2006 17:05:59 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751671AbWCOWF7 (ORCPT ); Wed, 15 Mar 2006 17:05:59 -0500 Received: from e35.co.us.ibm.com ([32.97.110.153]:21439 "EHLO e35.co.us.ibm.com") by vger.kernel.org with ESMTP id S1751662AbWCOWF6 (ORCPT ); Wed, 15 Mar 2006 17:05:58 -0500 Message-ID: <44188FBC.3090603@us.ibm.com> Date: Wed, 15 Mar 2006 16:05:48 -0600 From: Anthony Liguori User-Agent: Mail/News 1.5 (X11/20060309) MIME-Version: 1.0 To: Zachary Amsden CC: Linus Torvalds , Linux Kernel Mailing List , Virtualization Mailing List , Xen-devel , Andrew Morton , Dan Hecht , Dan Arai , Anne Holler , Pratap Subrahmanyam , Christopher Li , Joshua LeVasseur , Chris Wright , Rik Van Riel , Jyothy Reddy , Jack Lo , Kip Macy , Jan Beulich , Ky Srinivasan , Wim Coekaerts , Leendert van Doorn Subject: Re: [RFC, PATCH 5/24] i386 Vmi code patching References: <200603131802.k2DI2nv8005665@zach-dev.vmware.com> In-Reply-To: <200603131802.k2DI2nv8005665@zach-dev.vmware.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1471 Lines: 49 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 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/