Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4561884yba; Tue, 7 May 2019 21:52:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqxX1UGVsigeumeQkSYYgMtvzh+yY8CDuw/F96/NmVCfAb6AlP3KJ5d92zhIriq15WRkSLLN X-Received: by 2002:a62:520b:: with SMTP id g11mr44561760pfb.215.1557291147991; Tue, 07 May 2019 21:52:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557291147; cv=none; d=google.com; s=arc-20160816; b=TLcPsrwpxb4f9+2J77+BdmZ3MgXaeNKwTlc06vmKEkQs9Zmt+5VJDb7gQgpqv05Q4t WWq2llkCsB7s8EQOAh9UAhovqzQh3GlE+2xkJ5dukYcBpSFXwfVsvHCO18VBbba/mkMM 1HbpTIU0rRAUr/8xWB3vxr0TZ7s9glq3FnrCrVZbXtd1MVAdY1eTY4djYWRGeqAl/CkS BjHjPgzhFC7IpjXFfL2iU62VY58kuqHCwCGBJ4ZnxZCnaOOeHZBa7BtCS+Y8T0XSvvWB hLYGiDnBH4+u5ocpyVmdFAthowPZyxWN+cnXUF2WXvxJZj6HguVAzw6OPmf0NOR0wDDP 2N4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=I5e/UfOxO1ET3GG/v6CYadKGMC4a8arhmGhydGAJn8s=; b=zydRuaqWBA7CP8+yLCNPvVFUgS55+7Jx9AdH9NAmmREy3bIBN0R2PHaO8eEmtDKFkN ajkTbD1p3wQOXYW0efuCXSKMtva+sMaoH0oOmmoZZcqgsab+pIE5cknI/eE/K7q2nkPy gQaQV38hhMwM6ZqdYvz23wlCPkd/oxYy8fNiiO6eAzf1ZgCmw63IX26tGBpBNjRyFvuv XTnQfiVHmRaijl1A6gpGUfJxkM5uRrYZakUEUzgV7qzbCVzp4ChiU2PxVTLKxX7eiph7 RAgpHy2VrWuCSeY7LAsklHaN9I74Gg048SN45q+eLzNC7GZhgT7bSXYhORlOOjkmYRAN yO6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=fCVBMlCq; 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 v8si23188957plg.156.2019.05.07.21.52.10; Tue, 07 May 2019 21:52:27 -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; dkim=pass header.i=@linux-foundation.org header.s=google header.b=fCVBMlCq; 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 S1725884AbfEHEvQ (ORCPT + 99 others); Wed, 8 May 2019 00:51:16 -0400 Received: from mail-lf1-f66.google.com ([209.85.167.66]:34861 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725778AbfEHEvP (ORCPT ); Wed, 8 May 2019 00:51:15 -0400 Received: by mail-lf1-f66.google.com with SMTP id j20so13521215lfh.2 for ; Tue, 07 May 2019 21:51:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=I5e/UfOxO1ET3GG/v6CYadKGMC4a8arhmGhydGAJn8s=; b=fCVBMlCqXFaNG3/T7joMRaQg4ceXtuYdPorGYMf1oXOX02JSfkDNtMBZ392mp3Xa+w XzLxNjp4lFJG4QNeeBTaE98AcmNY9mHk/ZS6OieHVwaCDyObPW9cGux/hc2VnbzcJFR6 4ExSRI8O2Vzt05xYgeQ6pkrUST7OnP3nm4W/A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=I5e/UfOxO1ET3GG/v6CYadKGMC4a8arhmGhydGAJn8s=; b=m6R0SsysZ+qkGkv7H0dBzwhCeCn6W+0yaF1cZYpS62uMvW+Cp0uAPHPWE2Y3nDLJEr 5v1v03qj+YGk5JMLrMAm7hWJ0+9JRvT0vZrh9KbkVlsxPCmvR0rm5dpEgUens6WX3YkC IgJPGnXtoDP6VkVmLooCBAnRluuMSwYow3oyV6vjJOHWYLRwXApk4HUCuHjVUKAargLS wAZwruGKHcP8wE52m/YK9lC9zvZpGnX5G+Z9XE52olEPFwOefMmxU+k2VUksdnWLXkDR ngoI4nZSHbtE6hFl5zXSv4c8Dn63GHU5yXQnOwhGwAXumw0IJGRk6U7mTK42VwIBk/Na pmNw== X-Gm-Message-State: APjAAAWy9dm6OV5lh75b3wbpI/CKdmDjo67J3SWmwptdAWelerPKstvH qUQbKauHIKy2+Qc6LKrwq3Z2eQxgeiY= X-Received: by 2002:a19:c194:: with SMTP id r142mr17227167lff.41.1557291073473; Tue, 07 May 2019 21:51:13 -0700 (PDT) Received: from mail-lj1-f169.google.com (mail-lj1-f169.google.com. [209.85.208.169]) by smtp.gmail.com with ESMTPSA id k8sm2110654ljc.91.2019.05.07.21.51.08 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 May 2019 21:51:09 -0700 (PDT) Received: by mail-lj1-f169.google.com with SMTP id s7so10843974ljh.1 for ; Tue, 07 May 2019 21:51:08 -0700 (PDT) X-Received: by 2002:a2e:9d86:: with SMTP id c6mr17393609ljj.135.1557291068666; Tue, 07 May 2019 21:51:08 -0700 (PDT) MIME-Version: 1.0 References: <20190506225819.11756974@oasis.local.home> <20190506232158.13c9123b@oasis.local.home> <20190507111227.1d4268d7@gandalf.local.home> <20190507163440.GV2606@hirez.programming.kicks-ass.net> <20190507172159.5t3bm3mjkwagvite@treble> <20190507172418.67ef6fc3@gandalf.local.home> In-Reply-To: <20190507172418.67ef6fc3@gandalf.local.home> From: Linus Torvalds Date: Tue, 7 May 2019 21:50:52 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC][PATCH 1/2] x86: Allow breakpoints to emulate call functions To: Steven Rostedt Cc: Josh Poimboeuf , 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" , 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 7, 2019 at 2:24 PM Steven Rostedt wrote: > > And there's been several times I forget that regs->sp can not be read > directly. Especially most of my bug reports are for x86_64 these days. > But when I had that seldom x86_32 one, and go debugging, I would print > out "regs->sp" and then the system would crash. And I spend some time > wondering why? > > It's been a bane of mine for some time. Guys, I have basically a one-liner patch for your hangups. It's called "rename 'sp' to 'user_sp' on x86-32". Then we make the 'sp' field on x86-64 be a union, so that you can call it user_sp or sp as you wish. Yeah, it's really more than one line, because obviously the users will need chaning, but honestly, that would be a _real_ cleanup. Make the register match what it actually is. And it doesn't mess up the stack frame, and it doesn't change the entry code. It just reminds people that the entry is the USER stack pointer. Problem solved. Linus