From owner-freebsd-current@freebsd.org Sun Nov 20 04:29:24 2016 Return-Path: Delivered-To: freebsd-current@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 BB005C485EC; Sun, 20 Nov 2016 04:29:24 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-io0-x244.google.com (mail-io0-x244.google.com [IPv6:2607:f8b0:4001:c06::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6EE521A89; Sun, 20 Nov 2016 04:29:24 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-io0-x244.google.com with SMTP id n13so2666942ioe.1; Sat, 19 Nov 2016 20:29:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:cc:message-id:from:to:in-reply-to:content-transfer-encoding :mime-version:subject:date:references; bh=UDdf3YkqEFON3x4jEaBjk5xBxdMUyE8zlWxw7ZtcEgI=; b=eYp+VFtNfln0bZKxl2qRoI3lGWAiHtURTX8pfAiFZW53NYAxd5mIcF/pyiLgkSJSyk eZAWWBO+vY+MOL3fjY1pTn2BGhX5lvk3S3Qpwg7gXoDKDu4oE5n8DlTpol5864A1Wlb6 ntcVwGEOg7L52Bzyk4cMtcXelx4dRmFr+lXy5tDLc3PGK6QNenPI3PGayjeG4ZPq2hzY rI5maG+OL+Eljc4Gb4lUrTzm01KaqPtEldmzXlM4IHRr8OeG93XHM9M9AGalEiibOFAe gtaSOPWKap4ek+UcmkEfF/J8FL2WaL2DNJbixixLP6RCQ8TZlWwmc2VAH6r/9VNq4Y/L RKTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:cc:message-id:from:to:in-reply-to :content-transfer-encoding:mime-version:subject:date:references; bh=UDdf3YkqEFON3x4jEaBjk5xBxdMUyE8zlWxw7ZtcEgI=; b=lPzh/slkNlo3pfKdRxQBqlaZ0CAwvDutwrR9MTPVe4oHm0sdCNjhVlrrObgkSsTAcA bzaa7gbwjY4jeZ4IZVfF4uGJIZbIDbnwuosQJslx1RGd9bPc9NRO2hIQCh1VeOxGkd5O lQqKG9qsAK3BnsXXYZQ44Yel5MSlAQXCB2tleChC+28X1ZTQXG6XVAps2cFh97P0cJqp qacL6Y4PTkm9K0uXF5oOtA43/kGUzmOVpqIwm0urrjiPaN+a78JH6fNXInZ+sts0Dv5K 0BPTvhzBKTksAwbG08Bca/tq2ZqbORkWeH7pgin3s1cSta+0b8VqIZNkw7UYKwiVCR6q LY0Q== X-Gm-Message-State: AKaTC018o9HpkCfCojVSUSyTnv+lUIxBHynmOpWcXyyrVcSIs/MDh5e0CYbIS9RDcBZOow== X-Received: by 10.107.9.82 with SMTP id j79mr5664802ioi.197.1479616163552; Sat, 19 Nov 2016 20:29:23 -0800 (PST) Received: from blackstar.knownspace (50-80-150-234.client.mchsi.com. [50.80.150.234]) by smtp.gmail.com with ESMTPSA id i75sm3890736itf.10.2016.11.19.20.29.21 (version=TLS1 cipher=AES128-SHA bits=128/128); Sat, 19 Nov 2016 20:29:22 -0800 (PST) Sender: Justin Hibbits Cc: svn-src-head@freebsd.org, FreeBSD Current Message-Id: From: Justin Hibbits To: Mark Millard In-Reply-To: <9CDAF14D-2953-4914-BD3D-C91F591DE7DD@dsl-only.net> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: svn commit: r308817 - head/sys/powerpc/include [Still have pmap_t and struct pmap ppowerpc64 problems as of -r308860] Date: Sat, 19 Nov 2016 22:29:19 -0600 References: <39962D4C-29BA-4AA4-B77D-2344A68FDB54@dsl-only.net> <53258F35-C86E-4DE0-BDF0-5C139E68356D@dsl-only.net> <20161119204715.79632a66@zhabar.knownspace> <3D338DB4-9FAF-46A8-96FF-4F77B01871E2@dsl-only.net> <1EC92166-7DF3-42DC-9AAD-AED1BA9D5CC1@dsl-only.net> <59613CEF-BA2D-4010-996C-6FB8F9D126C6@dsl-only.net> <9CDAF14D-2953-4914-BD3D-C91F591DE7DD@dsl-only.net> X-Mailer: Apple Mail (2.936) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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: Sun, 20 Nov 2016 04:29:24 -0000 umastat doesn't even build right now anyway. I just tried: [chmeee@zhabar:pts/29]:~...tools/umastat> make echo umastat.full: /usr/lib/libc.a /usr/lib/libkvm.a >> .depend Warning: Object directory not changed from original /home/chmeee/ freebsd/head/tools/tools/umastat cc -O2 -pipe -g -MD -MF.depend.umastat.o -MTumastat.o -std=gnu99 - fstack-protector-strong -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes - Wpointer-arith -Wno-uninitialized -Wno-pointer-sign -c umastat.c - o umastat.o umastat.c:136: error: 'UMA_ZONE_REFCNT' undeclared here (not in a function) *** Error code 1 - Justin On Nov 19, 2016, at 10:22 PM, Mark Millard wrote: > On 2016-Nov-16, at 8:33 PM, Justin Hibbits > wrote: > >> *sigh* okay, thanks. I just tested, and vm/vm_page.h, and vm/vm.h >> can both be removed from memstat_uma.c for it to compile. I'm >> kicking off a buildworld myself now, too, and hope to have it ready >> to commit tomorrow (takes a couple hours to buildworld on my G5). >> >> - Justin > > That will not be the only potential place: umastat.c in tools/tools/ > umastat/ > also has a include of vm/vm_page.h: > >> # find /usr/src/ -name .svn -prune -o -name sys -prune -o -name man >> -prune -o -exec grep "vm_page[.]h" {} \; -print | more >> #include >> /usr/src/lib/libmemstat/memstat_uma.c >> #define LIBMEMSTAT /* Cause vm_page.h not to include >> opt_vmpage.h */ >> #include >> /usr/src/tools/tools/umastat/umastat.c > > > === > Mark Millard > markmi at dsl-only.net > > On Nov 19, 2016, at 9:47 PM, Mark Millard wrote: > >> [Top post of bad news.] >> >> With the patch I get a different incomplete type used in libmemstat: >> >> struct md_page >> >> --- all_subdir_lib/libmemstat --- >> In file included from /usr/src/lib/libmemstat/memstat_uma.c:34:0: >> /usr/src/sys/vm/vm_page.h:144:17: error: field 'md' has incomplete >> type >> struct md_page md; /* machine dependent stuff */ >> ^ >> *** [memstat_uma.o] Error code 1 >> >> make[5]: stopped in /usr/src/lib/libmemstat >> >> >> === >> Mark Millard >> markmi at dsl-only.net >> >> On 2016-Nov-19, at 7:42 PM, Mark Millard >> wrote: >> >>> On 2016-Nov-19, at 7:36 PM, Mark Millard >>> wrote: >>> >>>> On 2016-Nov-19, at 7:32 PM, Justin Hibbits >>> freebsd.org> wrote: >>>> >>>>> Sorry, I generated the diff from a different tree that wasn't >>>>> synced to head (had the same change in both trees originally). >>>>> If that is the only problem, you can ignore it and try the rest. >>>>> I can generate another diff later too. >>>>> - Justin >>>> >>>> Yep: I manually did the move of the pm_stats line and am building. >>> >>> If it builds and I install it on a PowerMac G5 and it boots, what >>> do I >>> do to test if pm_stats and pm_mtx seems to be working well/right for >>> the out of kernel code? Do you know of a reasonable test? >>> >>> === >>> Mark Millard >>> markmi at dsl-only.net >>> >> On Nov 19, 2016 21:27, "Mark Millard" wrote: >>> [Top post about patch issues.] >>> >>> Looking at the patch it seems to be designed for when #else was in >>> use: >>> >>>> -#else >>>> +#elif defined(BOOKE) >>> >>> but -r308817 already has the 2nd line (BOOKE). Your patch shows: >>> >>>> Index: sys/powerpc/include/pmap.h >>>> =================================================================== >>>> --- sys/powerpc/include/pmap.h (revision 308718) >>>> +++ sys/powerpc/include/pmap.h (working copy) >>> >>> So it looks like you started from before -r308817 . >>> >>> Trying it (I'm at -r308860): >>> >>>> Patching file sys/powerpc/include/pmap.h using Plan A... >>>> Hunk #1 succeeded at 74. >>>> Hunk #2 succeeded at 84. >>>> Hunk #3 succeeded at 132. >>>> Hunk #4 succeeded at 145. >>>> Hunk #5 failed at 180. >>>> Hunk #6 succeeded at 194. >>>> Hunk #7 succeeded at 210. >>>> 1 out of 7 hunks failed--saving rejects to sys/powerpc/include/ >>>> pmap.h.rej >>> >>>> # more sys/powerpc/include/pmap.h.rej >>>> @@ -179,13 +180,13 @@ >>>> struct slb **slb_alloc_user_cache(void); >>>> void slb_free_user_cache(struct slb **); >>>> >>>> -#else >>>> +#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]; >>> >>> >>> === >>> Mark Millard >>> markmi at dsl-only.net >>> >>> On 2016-Nov-19, at 7:00 PM, Mark Millard >>> wrote: >>> >>> It may take a little bit but I'll try the patch. >>> >>> It looks like sys/powerpc/include/pmap.h from -r176700 from 2088- >>> Mar-3 >>> is when the BOOKE/E500 split started with the preprocessor use of >>> AIM >>> and #else . This predates PowerMac G5 support. >>> >>> This is definitely not new for the general structure on the powerpc >>> side of things. Any place that did not have the AIM vs. not status >>> available was subject to problems of possibly mismatched >>> definitions. >>> >>> === >>> Mark Millard >>> markmi at dsl-only.net >>> >>> On 2016-Nov-19, at 6:47 PM, Justin Hibbits >> freebsd.org> wrote: >>> >>> On Sat, 19 Nov 2016 18:36:39 -0800 >>> Mark Millard wrote: >>> >>>> [Quick top post I'm afraid.] >>>> >>>> I think that I figured out why there is a problem even earlier >>>> --that just did not stop the compiles. >>>> >>>> lib/libutil/kinfo_getallproc.c is built here as part of buildworld >>>> (stage 4.2 "building libraries" instead of buildkernel. It does not >>>> have the KERNCONF's AIM vs. BOOKE vs. . . . definitions vs. lack of >>>> them). >>>> >>>> So if it includes machine/pmap.h that binds to >>>> sys/powerpc/include/pmap.h which has the structure. . . >>>> >>>> . . . >>>> #if defined(AIM) >>>> . . . (definitions here) >>>> #elif defined(BOOKE) >>>> . . . (definitions here) >>>> #endif >>>> . . . >>>> >>>> it gets no definition now. >>>> >>>> With the older: >>>> >>>> . . . >>>> #if defined(AIM) >>>> . . . (definitions here) >>>> #else >>>> . . . (definitions here) >>>> #endif >>>> . . . >>>> >>>> It got a definition, just not necessarily the right one. >>>> >>>> >>>> === >>>> Mark Millard >>>> markmi at dsl-only.net >>> >>> Can you try the attached patch? There was a subtle ABI issue that >>> r308817 exposed, which is that the pmap structs aren't identical >>> such >>> that the pm_stats are at different locations, and libkvm ends up >>> reading with the Book-E pmap, getting different stats than >>> expected for >>> AIM. This patch fixes that, bumping version to account for this ABI >>> change. >>> >>> - Justin >> >> >> > >