Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3862546yba; Tue, 7 May 2019 08:13:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqxOh//7U4CniRHhJyGz5+hKHNFf13MKdfepCFFRRbjObWJH9GewqEu6YIT7nsjjD4j8lLfl X-Received: by 2002:a17:902:322:: with SMTP id 31mr35877012pld.204.1557242024047; Tue, 07 May 2019 08:13:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557242024; cv=none; d=google.com; s=arc-20160816; b=vuR9oDfYx//fNng7V6XRESqQOD7Vcc5qzyY5pnPLBsfk3D5yMLuVPH8KGGtPoz5cz4 jiVx7qA/c7znDcCVUknjYPYUnyvzQuEMrCO8QIiACzOKpCE1WtqEhIIj6Uj3BCjy2AJx jFCKuZELd32Vo435MouL2Zd7S/6infAiQrY1/r4ru6gR+U8GNkdBni15A7g879A5aAdA H3HlXotTTLTqZWLqV35SfxVhFgTZQ7EkJ+5QFq/GJg60tKG/A1AYGt2mQpQMGAQqMomp wuPwvzVRJuBiXtecHcAkVzQBh188UKWGkgLi80h6cDvt6O5BNmNxu9oqFuqb6cknP1uA 9WPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=JsnyD6J+JlIrzMRth9fVrwWHtzua3TU1fXk+yucyEjE=; b=Ng90CY+/QlhEbG+gUCDX1n2vp2FplZvzZ7ouCHKtEB3UlYUsUO0r/hi1PLOBMjQ6I/ HV9MtPQKbrWadypQVmTT4rzYvE+5K2GrrFVFyGMlBS8p6LxkrU+cvIibm1uLQNRF+Muv CQHjYH6Lc9u0fGb9LywAvtJd5vSQxBBRrUubCUT4oxoPab9pqEsp3bOK/1AMzH2/8bPb ePzk/gwhVq7ogZQpSVeu+gEceP7ZNMpO509gcUCjCHTB0IutgQ5MMklil9I1KJqJA4ZZ Oz5baxhv8baCXwySvoWZjQTyR0CSfB+GNJ/IJT74VagDjDbZKY8StQcQSdarP+MuxJXe d6/w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l11si20072156plb.370.2019.05.07.08.13.28; Tue, 07 May 2019 08:13:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726727AbfEGPMd (ORCPT + 99 others); Tue, 7 May 2019 11:12:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:47564 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726556AbfEGPMc (ORCPT ); Tue, 7 May 2019 11:12:32 -0400 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 126A7205ED; Tue, 7 May 2019 15:12:28 +0000 (UTC) Date: Tue, 7 May 2019 11:12:27 -0400 From: Steven Rostedt To: Linus Torvalds Cc: Peter Zijlstra , Andy Lutomirski , Linux List Kernel Mailing , Ingo Molnar , Andrew Morton , Andy Lutomirski , Nicolai Stange , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , "the arch/x86 maintainers" , Josh Poimboeuf , Jiri Kosina , Miroslav Benes , Petr Mladek , Joe Lawrence , Shuah Khan , Konrad Rzeszutek Wilk , Tim Chen , Sebastian Andrzej Siewior , Mimi Zohar , Juergen Gross , Nick Desaulniers , Nayna Jain , Masahiro Yamada , Joerg Roedel , "open list:KERNEL SELFTEST FRAMEWORK" , stable , Masami Hiramatsu Subject: Re: [RFC][PATCH 1/2] x86: Allow breakpoints to emulate call functions Message-ID: <20190507111227.1d4268d7@gandalf.local.home> In-Reply-To: References: <20190502181811.GY2623@hirez.programming.kicks-ass.net> <20190506145745.17c59596@gandalf.local.home> <20190506162915.380993f9@gandalf.local.home> <20190506174511.2f8b696b@gandalf.local.home> <20190506210416.2489a659@oasis.local.home> <20190506215353.14a8ef78@oasis.local.home> <20190506225819.11756974@oasis.local.home> <20190506232158.13c9123b@oasis.local.home> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 7 May 2019 07:54:53 -0700 Linus Torvalds wrote: > And honestly, I absolutely despise PeterZ's patch. The notion that we > should suddenly say that "oh, the i386 kernel stack is odd" after 28 > years of having that standard i386 stack is just crazy. And this: > > arch/x86/entry/entry_32.S | 136 ++++++++++++++++++++++++++++------- > ... > 12 files changed, 323 insertions(+), 140 deletions(-) > > > vs this: > > arch/x86/entry/entry_32.S | 7 +++- > ... > 6 files changed, 120 insertions(+), 13 deletions(-) > > is still pretty damn conclusive. Not to mention that the simple > approach had a truly mindbogglingly simple solution with no actual > subtle changes anywhere else. > > So I still claim that we should do my patch. Because it is SIMPLE. > It's straightforward, and I can explain every single line in it. Even > if I spent *way* too long until I realized that the "trivial" > memmove() wasn't so trivial. Yes, band-aids are usually simpler than a proper fix. We have 28 years of hacks built on hacks. There's a lot of hacks in the C code to handle the differences between the crappy way x86_32 does pt_regs and the proper way x86_64 does them. If the goal was just to add another band-aid to this, we now have one more subtle work around caused by two different methods being handled by a single code base. I don't look at Peter's patch and think "this is the solution for int3 emulate calls". I see Peter's patch as "Thanks God, we are finally getting rid of the cause of all theses work around hacks all over the place! and oh by the way, we can easily implement int3 call emulation because of it". To implement your way, we need to change how the int3 handler works. It will be the only exception handler having to return regs, otherwise it will crash. Sure, it's an easily solution for the one off change of emulating calls, but it's just another complex work around that nobody is going to understand in 5 years. -- Steve