From owner-svn-src-all@FreeBSD.ORG Tue Dec 24 19:10:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0530F7DE; Tue, 24 Dec 2013 19:10:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CAF6918D5; Tue, 24 Dec 2013 19:10:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBOJAujp030576; Tue, 24 Dec 2013 19:10:56 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBOJAu9X030574; Tue, 24 Dec 2013 19:10:56 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201312241910.rBOJAu9X030574@svn.freebsd.org> From: John Baldwin Date: Tue, 24 Dec 2013 19:10:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259837 - in stable/10: sys/x86/include usr.sbin/bhyve X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Dec 2013 19:10:57 -0000 Author: jhb Date: Tue Dec 24 19:10:56 2013 New Revision: 259837 URL: http://svnweb.freebsd.org/changeset/base/259837 Log: MFC 259013: Fix the processor table entry structure to use a fixed-width type for 32-bit fields so it is the correct size on amd64. Remove a workaround for the broken structure from bhyve(8). Modified: stable/10/sys/x86/include/mptable.h stable/10/usr.sbin/bhyve/mptbl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/x86/include/mptable.h ============================================================================== --- stable/10/sys/x86/include/mptable.h Tue Dec 24 19:03:30 2013 (r259836) +++ stable/10/sys/x86/include/mptable.h Tue Dec 24 19:10:56 2013 (r259837) @@ -85,10 +85,10 @@ typedef struct PROCENTRY { u_char apic_id; u_char apic_version; u_char cpu_flags; - u_long cpu_signature; - u_long feature_flags; - u_long reserved1; - u_long reserved2; + u_int32_t cpu_signature; + u_int32_t feature_flags; + u_int32_t reserved1; + u_int32_t reserved2; } *proc_entry_ptr; #define PROCENTRY_FLAG_EN 0x01 Modified: stable/10/usr.sbin/bhyve/mptbl.c ============================================================================== --- stable/10/usr.sbin/bhyve/mptbl.c Tue Dec 24 19:03:30 2013 (r259836) +++ stable/10/usr.sbin/bhyve/mptbl.c Tue Dec 24 19:10:56 2013 (r259837) @@ -74,19 +74,6 @@ __FBSDID("$FreeBSD$"); /* Number of i/o intr entries */ #define MPEII_MAX_IRQ 16 -/* Define processor entry struct since gets it wrong */ -typedef struct BPROCENTRY { - u_char type; - u_char apic_id; - u_char apic_version; - u_char cpu_flags; - uint32_t cpu_signature; - uint32_t feature_flags; - uint32_t reserved1; - uint32_t reserved2; -} *bproc_entry_ptr; -CTASSERT(sizeof(struct BPROCENTRY) == 20); - /* Bus entry defines */ #define MPE_NUM_BUSES 2 #define MPE_BUSNAME_LEN 6 @@ -134,7 +121,7 @@ mpt_build_mpch(mpcth_t mpch) } static void -mpt_build_proc_entries(bproc_entry_ptr mpep, int ncpu) +mpt_build_proc_entries(proc_entry_ptr mpep, int ncpu) { int i; @@ -247,7 +234,7 @@ mptable_build(struct vmctx *ctx, int ncp mpcth_t mpch; bus_entry_ptr mpeb; io_apic_entry_ptr mpei; - bproc_entry_ptr mpep; + proc_entry_ptr mpep; mpfps_t mpfp; int_entry_ptr mpie; char *curraddr; @@ -268,7 +255,7 @@ mptable_build(struct vmctx *ctx, int ncp mpt_build_mpch(mpch); curraddr += sizeof(*mpch); - mpep = (bproc_entry_ptr)curraddr; + mpep = (proc_entry_ptr)curraddr; mpt_build_proc_entries(mpep, ncpu); curraddr += sizeof(*mpep) * ncpu; mpch->entry_count += ncpu;