From owner-svn-src-head@freebsd.org Sun Nov 20 06:10:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F825C49DE3; Sun, 20 Nov 2016 06:10:14 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 426DF1691; Sun, 20 Nov 2016 06:10:14 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAK6AD6N093777; Sun, 20 Nov 2016 06:10:13 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAK6ADfG093773; Sun, 20 Nov 2016 06:10:13 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201611200610.uAK6ADfG093773@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 20 Nov 2016 06:10:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308873 - in head: . lib/libmemstat sys/powerpc/include tools/tools/umastat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Nov 2016 06:10:14 -0000 Author: jhibbits Date: Sun Nov 20 06:10:12 2016 New Revision: 308873 URL: https://svnweb.freebsd.org/changeset/base/308873 Log: Fix buildworld for powerpc. vmpage requires struct pmap to exist and contain a pm_stats field. As of r308817, either AIM or BOOKE is required to be set in order to get their respective pmap structs. Rather than expose them both, or try to unify them unnecessarily, add a third option which contains only a pm_stats field, and change the two existing pmap structures to place the common fields at the beginning of the struct. This actually fixes the stats collection by libkvm on AIM hardware, because before it was accessing a possibly different offset, which would cause it to read garbage. Bump __FreeBSD_version to denote this ABI change, so that ports which depend on libkvm can be rebuilt. Modified: head/UPDATING head/lib/libmemstat/memstat_uma.c head/sys/powerpc/include/pmap.h head/tools/tools/umastat/umastat.c Modified: head/UPDATING ============================================================================== --- head/UPDATING Sun Nov 20 01:59:22 2016 (r308872) +++ head/UPDATING Sun Nov 20 06:10:12 2016 (r308873) @@ -51,6 +51,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12 ****************************** SPECIAL WARNING: ****************************** +20161119: + The layout of the pmap structure has changed for powerpc to put the pmap + statistics at the front for all CPU variations. libkvm(3) and all tools + that link against it need to be recompiled. + 20161030: isl(4) and cyapa(4) drivers now require a new driver, chromebook_platform(4), to work properly on Chromebook-class hardware. Modified: head/lib/libmemstat/memstat_uma.c ============================================================================== --- head/lib/libmemstat/memstat_uma.c Sun Nov 20 01:59:22 2016 (r308872) +++ head/lib/libmemstat/memstat_uma.c Sun Nov 20 06:10:12 2016 (r308873) @@ -30,9 +30,6 @@ #include #include -#include -#include - #include #include Modified: head/sys/powerpc/include/pmap.h ============================================================================== --- head/sys/powerpc/include/pmap.h Sun Nov 20 01:59:22 2016 (r308872) +++ head/sys/powerpc/include/pmap.h Sun Nov 20 06:10:12 2016 (r308873) @@ -74,6 +74,9 @@ #include #include +struct pmap; +typedef struct pmap *pmap_t; + #if defined(AIM) #if !defined(NPMAPS) @@ -81,8 +84,6 @@ #endif /* !defined(NPMAPS) */ struct slbtnode; -struct pmap; -typedef struct pmap *pmap_t; struct pvo_entry { LIST_ENTRY(pvo_entry) pvo_vlink; /* Link to common virt page */ @@ -131,6 +132,7 @@ RB_PROTOTYPE(pvo_tree, pvo_entry, pvo_pl #define PVO_VSID(pvo) ((pvo)->pvo_vpn >> 16) struct pmap { + struct pmap_statistics pm_stats; struct mtx pm_mtx; #ifdef __powerpc64__ @@ -143,7 +145,6 @@ struct pmap { cpuset_t pm_active; struct pmap *pmap_phys; - struct pmap_statistics pm_stats; struct pvo_tree pmap_pvo; }; @@ -182,10 +183,10 @@ void slb_free_user_cache(struct slb **); #elif defined(BOOKE) struct pmap { + struct pmap_statistics pm_stats; /* pmap statistics */ struct mtx pm_mtx; /* pmap mutex */ tlbtid_t pm_tid[MAXCPU]; /* TID to identify this pmap entries in TLB */ cpuset_t pm_active; /* active on cpus */ - struct pmap_statistics pm_stats; /* pmap statistics */ /* Page table directory, array of pointers to page tables. */ pte_t *pm_pdir[PDIR_NENTRIES]; @@ -193,7 +194,6 @@ struct pmap { /* List of allocated ptbl bufs (ptbl kva regions). */ TAILQ_HEAD(, ptbl_buf) pm_ptbl_list; }; -typedef struct pmap *pmap_t; struct pv_entry { pmap_t pv_pmap; @@ -210,6 +210,16 @@ struct md_page { #define pmap_page_get_memattr(m) VM_MEMATTR_DEFAULT #define pmap_page_is_mapped(m) (!TAILQ_EMPTY(&(m)->md.pv_list)) +#else +/* + * Common pmap members between AIM and BOOKE. + * libkvm needs pm_stats at the same location between both, as it doesn't define + * AIM nor BOOKE, and is expected to work across all. + */ +struct pmap { + struct pmap_statistics pm_stats; /* pmap statistics */ + struct mtx pm_mtx; /* pmap mutex */ +}; #endif /* AIM */ extern struct pmap kernel_pmap_store; Modified: head/tools/tools/umastat/umastat.c ============================================================================== --- head/tools/tools/umastat/umastat.c Sun Nov 20 01:59:22 2016 (r308872) +++ head/tools/tools/umastat/umastat.c Sun Nov 20 06:10:12 2016 (r308873) @@ -28,10 +28,6 @@ #include -#define LIBMEMSTAT /* Cause vm_page.h not to include opt_vmpage.h */ -#include -#include - #include #include