From owner-freebsd-current@FreeBSD.ORG Mon Jan 24 17:55:36 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A709C106566C for ; Mon, 24 Jan 2011 17:55:36 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id 6E69C8FC19 for ; Mon, 24 Jan 2011 17:55:36 +0000 (UTC) Received: by iyb26 with SMTP id 26so4363415iyb.13 for ; Mon, 24 Jan 2011 09:55:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=UaRpESXim9nRZ6saZyFVENQbxU3zff7bAMVxt2S71Wg=; b=eVp6cA6uHns/AXI6FAS9jOwHEqQ2uOQuRRe/B86Yzu3g6pCnYPK2Ij/i+dUUXZa37/ IQml4iaOGZCS/xKCiLkK9TS/Y8nfixmDccJqmESDHlaWYUpDliFqHHMdkssZJDD85knB c9RkuyLxby8NqWwDkNT4pmm7mfgmN2ouABBR4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=MnH4eY6//LFfvZF2YqAmlzGkf6kj9MbZLMRQDyfOuodJAyUnztQVF/Srk8mzftmMBn FwfU8EUAZH0unM1om76Ewd1VIH9aPPmlBplIJAb4X8iquDr5ixEEkxwDcTxOl+uCgXp/ h8Q/rct3k17yVppPjEc5CXYqMKrrdnqisnzmk= MIME-Version: 1.0 Received: by 10.231.35.141 with SMTP id p13mr5139936ibd.79.1295890316848; Mon, 24 Jan 2011 09:31:56 -0800 (PST) Received: by 10.231.160.147 with HTTP; Mon, 24 Jan 2011 09:31:56 -0800 (PST) In-Reply-To: <67AF693D-FBF1-4AE6-85E0-88B0C11F2483@secure-computing.net> References: <67AF693D-FBF1-4AE6-85E0-88B0C11F2483@secure-computing.net> Date: Mon, 24 Jan 2011 09:31:56 -0800 Message-ID: From: Matthew Fleming To: Eric Crist Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-current@freebsd.org Subject: Re: amd64 build fails within ESXi guest X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jan 2011 17:55:36 -0000 On Mon, Jan 24, 2011 at 8:25 AM, Eric Crist w= rote: > I'm trying to build HEAD within an ESXi guest system, and the build error= s while building the boot code. =A0I've attached the tail end of the log. = =A0The host is a Dell Vostro 230 with CPU: Intel(R) Core(TM)2 Quad CPU =A0 = =A0Q8400 =A0@ 2.66GHz (2659.61-MHz K8-class CPU) and the guest is allocated= 256MB of RAM. =A0This is ESXi 4.1.0. > Locally we've been building the amd64 kernel with a few different flags and ran into this in our kernel build. Try this definition of do_cpuid instead: static __inline void do_cpuid(u_int ax, u_int *p) { #if 0 /* * Isilon: get a compile error on a new hwpmc file: /data/sb/BR_HAB_BSDMERGE_STABLE7/src/sys/modules/hwpmc/../../dev/hwpmc/hwpm= c_core.c: In function 'pmc_core_initialize': ./machine/cpufunc.h:111: error: can't find a register in class 'BREG' while reloading 'asm' ./machine/cpufunc.h:111: error: 'asm' operand has impossible constraints This presumably has to do with -fPIC. See http://sam.zoy.org/blog/2007-04-13-shlib-with-non-pic-code-have-inline-asse= mbly-and-pic-mix-well for this workaround. */ __asm __volatile("cpuid" : "=3Da" (p[0]), "=3Db" (p[1]), "=3Dc" (p[2]), "=3Dd" (p[3]) : "0" (ax)); #else __asm __volatile("push %%ebx \n\t" /* save %ebx */ "cpuid \n\t" "movl %%ebx, %1 \n\t" /* save what cpuid just put in %ebx */ "pop %%ebx \n\t" /* restore the old %ebx */ : "=3Da" (p[0]), "=3Dm" (p[1]), "=3Dc" (p[2]), "=3Dd" (p[3]) : "a"(ax) : "cc"); #endif } Note that using =3Dr for the constraint on p[1] isn't sufficient as once in a while the compiler has chosen %ebx, which then leads to garbage in the register after the pop. Thanks, matthew