From owner-freebsd-virtualization@FreeBSD.ORG Tue Jun 25 00:11:18 2013 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6CAE4CC3 for ; Tue, 25 Jun 2013 00:11:18 +0000 (UTC) (envelope-from neelnatu@gmail.com) Received: from mail-ie0-x233.google.com (mail-ie0-x233.google.com [IPv6:2607:f8b0:4001:c03::233]) by mx1.freebsd.org (Postfix) with ESMTP id 4582717E9 for ; Tue, 25 Jun 2013 00:11:18 +0000 (UTC) Received: by mail-ie0-f179.google.com with SMTP id c10so26237098ieb.38 for ; Mon, 24 Jun 2013 17:11:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=QPfS6xLERg63bRYs5elQEp+XdtM/qubWvtUDsuYvzpw=; b=Qk/XSzeJaWiTTn8LKSwns44qtcMfontd2lN+iDSInu1nhqwzpbhm3n0XT75xzC03FF Bsj2epx/oAn1L87LX4eM5pF5OcWTbqZYDcWHXyIPORnwX0YPtQfjcuRN1hJbNA8ZEFDj Bam8/FrCS9jdll7aujZ9+NXK9Ff2HwdhWq9s9oF6+kyhP0ukq7qHtXIYWBGGH89siCWk emGbxMxC+bTmgFLnHypeElk5VcrvxWq0Kj4jyVAZEochiDcVatv9+rp2nhs2WGHmFypg tF7zyDD87/4Xtp3o5l1yStGlI04lZtoLXC70ZyyusdDmVMyBAXoDs+V00J2facDYuqAu otmQ== MIME-Version: 1.0 X-Received: by 10.42.36.3 with SMTP id s3mr8029096icd.42.1372119078017; Mon, 24 Jun 2013 17:11:18 -0700 (PDT) Received: by 10.42.151.74 with HTTP; Mon, 24 Jun 2013 17:11:17 -0700 (PDT) In-Reply-To: References: Date: Mon, 24 Jun 2013 17:11:17 -0700 Message-ID: Subject: Re: bhyve guest dies on building java/openjdk6 From: Neel Natu To: Aryeh Friedman Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-virtualization@freebsd.org X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2013 00:11:18 -0000 Hi Aryeh, On Mon, Jun 24, 2013 at 4:25 PM, Aryeh Friedman wrote: > > As soon as java/openjdk6 starts its build process (fdesc and procfs > both are present as per pkg-message) bhyve dies with: > > vm exit[0] > reason VMX > rip 0x00000008032322ac > > inst_length 2 > > error 0 > > exit_reason 10 Thanks for reporting this. The exit reason indicates bhyve is not happy with the cpuid leaf that the guest is querying. Tycho Nightingale has a patch to the cpuid emulation that should fix the issue you are seeing. Could you give it a spin? Index: x86.c =================================================================== --- x86.c (revision 251672) +++ x86.c (working copy) @@ -45,7 +45,7 @@ #define CPUID_VM_HIGH 0x40000000 -static const char bhyve_id[12] = "BHyVE BHyVE "; +static const char bhyve_id[12] = "bhyve bhyve "; int x86_emulate_cpuid(struct vm *vm, int vcpu_id, @@ -80,12 +80,10 @@ case CPUID_0000_0000: case CPUID_0000_0002: case CPUID_0000_0003: - case CPUID_0000_000A: cpuid_count(*eax, *ecx, regs); break; case CPUID_8000_0000: - case CPUID_8000_0001: case CPUID_8000_0002: case CPUID_8000_0003: case CPUID_8000_0004: @@ -94,6 +92,15 @@ cpuid_count(*eax, *ecx, regs); break; + case CPUID_8000_0001: + /* + * Hide rdtscp/ia32_tsc_aux until we know how + * to deal with them. + */ + cpuid_count(*eax, *ecx, regs); + regs[3] &= ~AMDID_RDTSCP; + break; + case CPUID_8000_0007: cpuid_count(*eax, *ecx, regs); /* @@ -151,6 +158,11 @@ regs[2] &= ~CPUID2_MON; /* + * Hide the performance and debug features. + */ + regs[2] &= ~CPUID2_PDCM; + + /* * Hide thermal monitoring */ regs[3] &= ~(CPUID_ACPI | CPUID_TM); @@ -161,6 +173,11 @@ */ regs[3] &= ~(CPUID_MCA | CPUID_MCE | CPUID_MTRR); + /* + * Hide the debug store capability. + */ + regs[3] &= ~CPUID_DS; + /* * Disable multi-core. */ @@ -180,6 +197,7 @@ case CPUID_0000_0006: case CPUID_0000_0007: + case CPUID_0000_000A: /* * Handle the access, but report 0 for * all options @@ -203,12 +221,17 @@ case 0x40000000: regs[0] = CPUID_VM_HIGH; bcopy(bhyve_id, ®s[1], 4); - bcopy(bhyve_id, ®s[2], 4); - bcopy(bhyve_id, ®s[3], 4); + bcopy(bhyve_id + 4, ®s[2], 4); + bcopy(bhyve_id + 8, ®s[3], 4); break; + default: - /* XXX: Leaf 5? */ - return (0); + /* + * The leaf value has already been clamped, so + * simply pass this through + */ + cpuid_count(*eax, *ecx, regs); + break; } *eax = regs[0]; best Neel > qualification 0x0000000000000000 > _______________________________________________ > freebsd-virtualization@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-virtualization > To unsubscribe, send any mail to "freebsd-virtualization-unsubscribe@freebsd.org"