Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759642AbYBHWAu (ORCPT ); Fri, 8 Feb 2008 17:00:50 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1759592AbYBHV7r (ORCPT ); Fri, 8 Feb 2008 16:59:47 -0500 Received: from smtp2.linux-foundation.org ([207.189.120.14]:48949 "EHLO smtp2.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758354AbYBHV7q (ORCPT ); Fri, 8 Feb 2008 16:59:46 -0500 Date: Fri, 8 Feb 2008 13:58:44 -0800 (PST) From: Linus Torvalds To: Jan Kiszka cc: Andi Kleen , Maxim Levitsky , Ingo Molnar , linux-kernel@vger.kernel.org, Andrew Morton , Thomas Gleixner , "H. Peter Anvin" , Jason Wessel Subject: Re: [RFC][PATCH] KGDB: remove kgdb-own fault handling (was: Re: [git pull] x86 arch updates for v2.6.25) In-Reply-To: <47ACC97C.3000806@web.de> Message-ID: References: <20080130011550.GA31853@elte.hu> <200802050436.31070.maximlevitsky@gmail.com> <47AC95FC.5090701@siemens.com> <20080208185719.GA11573@one.firstfloor.org> <47ACC97C.3000806@web.de> User-Agent: Alpine 1.00 (LFD 882 2007-12-20) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1430 Lines: 37 On Fri, 8 Feb 2008, Jan Kiszka wrote: > > Well, let's try it this way: Find below a patch against kgdb.git that > removes the special fault handling (this wouldn't be the first feature I > recently removed from kgdb :->). Light testing revealed no obvious > problems yet. That is indeed horrible code. No way will I merge anything that has things like that even in it's *history* (ie somebody needs to re-generate the tree without code like that - some things should not be allowed to exist). That said, while just using "probe_kernel_addr()" is certainly much better, it's still really inefficient. If you actually want to do a "safe memory copy", then the right way to do that is basically to do pagefault_disable(); leftover = __copy_from_user_inatomic(dst, src, count); pagefault_enable(); if (leftover) handle_the_fact_that_the_copy_didnt_complete(); which should even be reasonably efficient and should work in all contexts (hardware interrupts disabled, spinlocks held, you name it). So all those "kgdb_{get|set}_mem()" things seem bogus (they also have insane calling semantics - return NULL or errptr? Why not just return an integer error code? Linus -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/