Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261266AbVDYWbu (ORCPT ); Mon, 25 Apr 2005 18:31:50 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261271AbVDYWbu (ORCPT ); Mon, 25 Apr 2005 18:31:50 -0400 Received: from mx1.redhat.com ([66.187.233.31]:54966 "EHLO mx1.redhat.com") by vger.kernel.org with ESMTP id S261266AbVDYWbe (ORCPT ); Mon, 25 Apr 2005 18:31:34 -0400 Date: Mon, 25 Apr 2005 15:31:25 -0700 Message-Id: <200504252231.j3PMVPTb010573@magilla.sf.frob.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit From: Roland McGrath To: Linus Torvalds Cc: Andi Kleen , Andrew Morton , Kernel Mailing List Subject: Re: [PATCH] x86_64: handle iret faults better In-Reply-To: Linus Torvalds's message of Monday, 25 April 2005 08:55:22 -0700 X-Fcc: ~/Mail/linus X-Shopping-List: (1) Tropical fission (2) Delinquent bugs (3) Onerous golden reservation livers Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1316 Lines: 33 > Why don't you just do > > pushl $0 > pushl $do_iret_error > jmp error_code I quote from the comment in the code: We want * to turn it into a signal. To make that signal's info exactly match what * this same kind of fault in a user instruction would show, the fixup * needs to know the trapno and error code. But those are lost when we get * back to the fixup entrypoint. The error code is not always 0, it might be a bad segment value. I think the kernel ought to give accurate information about the fault consistently no matter where it occurs, so I did not want to pretend the error code is 0. I certainly think it would be cleaner if the fixup code could access the fault information directly. However, it's arguably not so clean to have a do_iret_error function that replicates the work of do_trap and do_general_protection. The iret case is really not so much a special case for what to do, but a special case for how you determine whether the vanilla user-mode thing is done or the vanilla kernel-mode thing is done. Thanks, Roland - 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/