From owner-svn-src-head@freebsd.org Tue Dec 13 12:11:24 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 097BCC72600; Tue, 13 Dec 2016 12:11:24 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 79C90BAB; Tue, 13 Dec 2016 12:11:23 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id uBDCBHuC044928 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Tue, 13 Dec 2016 14:11:18 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua uBDCBHuC044928 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id uBDCBHhf044926; Tue, 13 Dec 2016 14:11:17 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 13 Dec 2016 14:11:17 +0200 From: Konstantin Belousov To: Bruce Evans Cc: Edward Tomasz Napierala , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r309891 - head/sys/kern Message-ID: <20161213121117.GV54029@kib.kiev.ua> References: <201612121522.uBCFMMmm088698@repo.freebsd.org> <20161212163331.GH54029@kib.kiev.ua> <20161212191257.GA11238@brick> <20161213091945.V1082@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161213091945.V1082@besplex.bde.org> User-Agent: Mutt/1.7.1 (2016-10-04) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home 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: Tue, 13 Dec 2016 12:11:24 -0000 On Tue, Dec 13, 2016 at 10:20:30AM +1100, Bruce Evans wrote: > Hrmph. kib didn't like my patch to kill the spam from reentering ddb. > The spam messes up even cases where the ddb command handles errors. > Howver, in most cases the error handling is incomplete. There is always > the outer setjmp/longjmp back to the command loop. This gives null and > bad error handling for unexpected null pointer accesses like the one here. > Other cases set up inner setjump/longjmps which longjmp back to an inner > context which prints an error message (spammed by the reentry messages) > and should clean up. However, cleanup is rarely done. One case is > writing to inaccessible memory on at least x86. Then the page tables > are left in modified state. You have a variant of the patch which makes the behaviour adjustable. I already agreed with that modification, and with making the defaults to not print the backtrace. > > Null pointer panics are also interesting. They seem to have been broken > on i386 by the double mapping of low memory (PTD[0] = PTD[KERNBASE >> 12] = > shared page table for low physical memory). So the null pointer is mapped > and points to physical memory 0 . There are other bugs from the shared > page table. When I fix the other bugs by changing PTD[0] to 0, this also > fixes null pointers. It breaks ACPI resume but not much else. See > locore.s for some details about the mapping -- it is documented as being > mainly for ACPI. But ACPI somehow works on amd64 with PTD[0] = 0. That page table is only active for the kernel processes, so most often, when userspace part is present, page at zero is not mapped.