From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751668AbbB1KhH (ORCPT ); Sat, 28 Feb 2015 05:37:07 -0500 Received: from gate.crashing.org ([63.228.1.57]:58959 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750905AbbB1KhE (ORCPT ); Sat, 28 Feb 2015 05:37:04 -0500 Message-ID: <1425119814.4645.114.camel@kernel.crashing.org> Subject: Re: Generic page fault (Was: libsigsegv ....) From: Benjamin Herrenschmidt To: Linus Torvalds Cc: "linux-arch@vger.kernel.org" , "linux-kernel@vger.kernel.org" , linux-mm@kvack.org Date: Sat, 28 Feb 2015 21:36:54 +1100 In-Reply-To: <1425107646.4645.109.camel@kernel.crashing.org> References: <1422361485.6648.71.camel@opensuse.org> <54C78756.9090605@suse.cz> <1422364084.6648.82.camel@opensuse.org> <1422836637.17302.9.camel@au1.ibm.com> <1425107567.4645.108.camel@kernel.crashing.org> <1425107646.4645.109.camel@kernel.crashing.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.10-0ubuntu1~14.10.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 2015-02-28 at 18:14 +1100, Benjamin Herrenschmidt wrote: > On Sat, 2015-02-28 at 18:12 +1100, Benjamin Herrenschmidt wrote: > > > > Let me know what you think of the approach. It's boot tested on x86_64 > > in qemu and > > ... and powerpc64 LE on qemu as well :-) One thing I'd like to do is fold handle_kernel_fault() into handle_bad_area() (and in fact fold do_sigbus as well). Basically have a single handle_bad_fault() that takes sig and si_code as arguments which we call from the generic code for all faults. It will test for kernel vs. user mode and do the right thing (and we could handle the sigbus special case by simply comparing sig to sigbus). The one reason I haven't done it so far is that x86 handle_bad_area() has the is_f00f_bug() call which isn't do for other cases of no_context() and I'm not sure generalizing it is safe for all cases (or maybe I can call it only when sig is SIGSEGV ?) ... I don't actually understand what it does :) Cheers, Ben.