From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.9 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_NEOMUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7F1DBC04A6B for ; Wed, 8 May 2019 11:58:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 55FA220989 for ; Wed, 8 May 2019 11:58:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728331AbfEHL6J (ORCPT ); Wed, 8 May 2019 07:58:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57724 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727488AbfEHL6I (ORCPT ); Wed, 8 May 2019 07:58:08 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 620AF3087948; Wed, 8 May 2019 11:58:08 +0000 (UTC) Received: from treble (ovpn-123-166.rdu2.redhat.com [10.10.123.166]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8EFBA4123; Wed, 8 May 2019 11:58:01 +0000 (UTC) Date: Wed, 8 May 2019 06:57:59 -0500 From: Josh Poimboeuf To: Peter Zijlstra Cc: linux-kernel@vger.kernel.org, Linus Torvalds , Ingo Molnar , Andrew Morton , Andy Lutomirski , Nicolai Stange , Thomas Gleixner , Borislav Petkov , "H. Peter Anvin" , x86@kernel.org, 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 , linux-kselftest@vger.kernel.org, Masami Hiramatsu Subject: Re: [RFC][PATCH 4/4] x86_32: Provide consistent pt_regs Message-ID: <20190508115759.yvxjgsqriez4z22l@treble> References: <20190508074901.982470324@infradead.org> <20190508080612.832694080@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190508080612.832694080@infradead.org> User-Agent: NeoMutt/20180716 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Wed, 08 May 2019 11:58:08 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 08, 2019 at 09:49:05AM +0200, Peter Zijlstra wrote: > Currently pt_regs on x86_32 has an oddity in that kernel regs > (!user_mode(regs)) are short two entries (esp/ss). This means that any > code trying to use them (typically: regs->sp) needs to jump through > some unfortunate hoops. > > Change the entry code to fix this up and create a full pt_regs frame. > > This then simplifies: > > - ftrace > - kprobes > - stack unwinder > - ptrace > - kdump > - kgdb > > Hated-by: Linus Torvalds > Signed-off-by: Peter Zijlstra (Intel) > --- > arch/x86/entry/entry_32.S | 105 ++++++++++++++++++++++++++++++++++---- > arch/x86/include/asm/kexec.h | 17 ------ > arch/x86/include/asm/ptrace.h | 17 ------ > arch/x86/include/asm/stacktrace.h | 2 > arch/x86/kernel/crash.c | 8 -- > arch/x86/kernel/ftrace_32.S | 81 ++++++++++++++++------------- > arch/x86/kernel/kgdb.c | 8 -- > arch/x86/kernel/kprobes/common.h | 4 - > arch/x86/kernel/kprobes/core.c | 29 ++++------ > arch/x86/kernel/kprobes/opt.c | 20 ++++--- > arch/x86/kernel/process_32.c | 16 +---- > arch/x86/kernel/ptrace.c | 29 ---------- > arch/x86/kernel/time.c | 3 - > arch/x86/kernel/unwind_frame.c | 32 +---------- > arch/x86/kernel/unwind_orc.c | 2 > 15 files changed, 181 insertions(+), 192 deletions(-) Very nice diffstat. This moves all the pain to the 32-bit entry code where it belongs. -- Josh