From patchwork Wed Sep 9 21:08:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Palmer Dabbelt X-Patchwork-Id: 7149091 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BB14C9F1D3 for ; Wed, 9 Sep 2015 21:15:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B99EB20959 for ; Wed, 9 Sep 2015 21:15:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9D8232096E for ; Wed, 9 Sep 2015 21:15:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755626AbbIIVOf (ORCPT ); Wed, 9 Sep 2015 17:14:35 -0400 Received: from mail-pa0-f48.google.com ([209.85.220.48]:34927 "EHLO mail-pa0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752676AbbIIVIv (ORCPT ); Wed, 9 Sep 2015 17:08:51 -0400 Received: by pacfv12 with SMTP id fv12so21099585pac.2 for ; Wed, 09 Sep 2015 14:08:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc :cc:cc:subject:date:message-id:in-reply-to:references; bh=lav/zjUGnA2Jt52eR4cvjGWE+oaTVH5JH+Y8EkXvJ0g=; b=R7fRfx/sE6Du+G+TmfAwldPBE412pN3TwCYhlyNGXXG0aoasCgEhdrapxLJ8NerjEQ cpn8xe3q9LREEuQXNtTS/0EwmyYPPuhNTmgYLm2Wx+N/OuUCE7KYO4G2Q/AvYoA19xFB 3e7XA/QrAC8WRYsw5j0l8dfguOB457FwQY8pxVsQYsUYf7UbwJ08g1IDpQreXSaAr484 8XUsNvqrJ/YbLijjtgbmYYLM18EWn5emOy6ZNFXZKEKZQDHUEbWAPGpcB4up1+8GOVoE /HJ3+ht3aGPAArADx0PP3RsyROoTnewlgWfQVWWT/6Qu0yz2hgVN3gKB99+rIsMLPE4I rUvg== X-Gm-Message-State: ALoCoQmMnKwOfa6OX7zRlvhHbuUjhejDC95COdTFZqgTx/wUyhyzk4JWGF7Z5ZFRXun8OUVuh4tG X-Received: by 10.68.174.100 with SMTP id br4mr74927420pbc.73.1441832930479; Wed, 09 Sep 2015 14:08:50 -0700 (PDT) Received: from localhost (wap-cal.CS.Berkeley.EDU. [128.32.35.228]) by smtp.gmail.com with ESMTPSA id z6sm8011702pbt.51.2015.09.09.14.08.49 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Sep 2015 14:08:50 -0700 (PDT) From: Palmer Dabbelt To: arnd@arndb.de Cc: 3chas3@gmail.com Cc: hpa@zytor.com Cc: mingo@redhat.com Cc: plagnioj@jcrosoft.com Cc: jikos@kernel.org Cc: linux-api@vger.kernel.org Cc: linux-arch@vger.kernel.org Cc: linux-atm-general@lists.sourceforge.net Cc: linux-fbdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: netdev@vger.kernel.org Cc: tglx@linutronix.de Cc: tomi.valkeinen@ti.com Cc: x86@kernel.org Cc: Palmer Dabbelt Subject: [PATCH 05/13] Hide some of "struct elf_prstatus" behind #ifdef __KERNEL__ Date: Wed, 9 Sep 2015 14:08:14 -0700 Message-Id: <1441832902-28993-6-git-send-email-palmer@dabbelt.com> X-Mailer: git-send-email 2.4.6 In-Reply-To: <1441832902-28993-1-git-send-email-palmer@dabbelt.com> References: <2644177.lVCYzIBfPW@wuerfel> <1441832902-28993-1-git-send-email-palmer@dabbelt.com> Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This one scares me: while I can't find any system calls that directly take this as an argument, a comment in " Generic ptrace interface that exports the architecture specific regsets using the corresponding NT_* types (which are also used in the core dump). Please note that the NT_PRSTATUS note type in a core dump contains a full 'struct elf_prstatus'. But the user_regset for NT_PRSTATUS contains just the elf_gregset_t that is the pr_reg field of 'struct elf_prstatus'. For all the other user_regset flavors, the user_regset layout and the ELF core dump note payload are exactly the same layout. " seems to indicate that it's possible to see this sometimes. Since this would only be visible to userspace in a somewhat convoluted manner, I'm going to try and keep it as it was. Signed-off-by: Palmer Dabbelt Reviewed-by: Andrew Waterman Reviewed-by: Albert Ou --- include/uapi/linux/elfcore.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/uapi/linux/elfcore.h b/include/uapi/linux/elfcore.h index 569737cfb557..f9320b588937 100644 --- a/include/uapi/linux/elfcore.h +++ b/include/uapi/linux/elfcore.h @@ -60,7 +60,7 @@ struct elf_prstatus long pr_instr; /* Current instruction */ #endif elf_gregset_t pr_reg; /* GP registers */ -#ifdef CONFIG_BINFMT_ELF_FDPIC +#if defined(__KERNEL__) && defined(CONFIG_BINFMT_ELF_FDPIC) /* When using FDPIC, the loadmap addresses need to be communicated * to GDB in order for GDB to do the necessary relocations. The * fields (below) used to communicate this information are placed