Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1075940imm; Fri, 14 Sep 2018 10:46:07 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaW5Jc27UzRFtSeBYSL3oM+W+ZCmdsr9Xryhgf6AxWps7p+aXKtU2KtV11YPk8UNDoD+3ij X-Received: by 2002:a17:902:e088:: with SMTP id cb8-v6mr13277635plb.189.1536947167266; Fri, 14 Sep 2018 10:46:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536947167; cv=none; d=google.com; s=arc-20160816; b=Szn8EtXATMioe2augHCXkb8Lr8afCL9efduqjOOdk0bUffULvVHPS63ArKQmFCVnab LcoFOUa8B0jZnMhvnV0KuhTKBvYEcNCBrmZiQfz84s7gOavA2e1oO9NKE3pQBmQ0rORX dtN9dFGratiatelQEChqoJRyyQcCLkHIMhJUlU5Ulsv0cyfNFERBDMMe+2YEiaFNmpgS AnLhxQwrzWLDhUXeSmYEMjJpGh0WnnZghmgNnih+ssKGGJcYcd2z1l9GpysF/5E3/74g ySIsuvfaAzw8W5EzQXamPLTPy/dqfyXJQrCKKeR/fey4cT+4j68G9wPh1xTEdMtkouNr BY0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=VXXx9HvWRIDEQarI3gEXwi4IGS4iD4IPQ5hP7GBn9wk=; b=X75/ABj2+2nJZgEsEDBPRhGjHUnYbYrAVV7t/vuU7B497jVGoJH928CFRJslWQZQXQ 1nV6vVXLzOvx5EP3kWnrNrve5d8kJK9O8T8Sj1oHuR8h/iq7lfOKqRtngm2b8ZkQvQ19 hTfHPv9OTZBGZtLE5+z9Lx1+6nNAFPxXKW57MazC1v51BIDex2kVvMkd6UAfZZgQ2VBC citGrY3s9b5uLSBZxxENKL/NVbBj6pHP7+ueYEXx10FsL5rC0o5xQK3YrY7n0aLua4yw ba7YansJYwvprk6NHr9zAik1oi0vp1Ii2g2/9NsY4tZRcpF5eISxcywsfNvHbs0IgwJc LKdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=sbwT+coS; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v10-v6si8466047pfj.354.2018.09.14.10.45.51; Fri, 14 Sep 2018 10:46:07 -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=fail header.i=@gmail.com header.s=20161025 header.b=sbwT+coS; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728064AbeINXBF (ORCPT + 99 others); Fri, 14 Sep 2018 19:01:05 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:37584 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727118AbeINXBF (ORCPT ); Fri, 14 Sep 2018 19:01:05 -0400 Received: by mail-wr1-f66.google.com with SMTP id u12-v6so11398126wrr.4; Fri, 14 Sep 2018 10:45:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=VXXx9HvWRIDEQarI3gEXwi4IGS4iD4IPQ5hP7GBn9wk=; b=sbwT+coSpCG5fPfmqnDkLr9Hvz0UfYfPNqPUGynYAYA/O/oMPDg9ztk2i9SkIIjh9u D5jTQG4YYpNNaiOReVzNyyMp4UzJlmBrs5mcE6ENo0n4tdpVZfU8xIwSV6LSDwy5dOAd qpYlDNt898XwCwx9073PKAWZ4mUrqgDBdLRZM5Kocd+cllHFJazXVRpBmmO561TT9weC uYUMY7ZqsAAJxeFfuMbhwbUJs/vsMV+wjMknUcAu0GnWmxyA8I3HH+LHHkm1tFJXmxdI f99H8Z55xtiQ89MUy9Oe50XWr1LzqvOZ2lMH8i161YjNJN4Ow2+K7T+RexeZebP95UUe 7HKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=VXXx9HvWRIDEQarI3gEXwi4IGS4iD4IPQ5hP7GBn9wk=; b=GBnLRmF3yX+h01cdC6tTUCxiR1gczTahpmjzxQZEQt4JgCOkQmkMQlfVGGg/d/ExVz 1keFe8TtPjatU+zpnI4+SrGAmDqxcs30SsBzktA7X7+3eUrkPp6tO8xl1GtlqeMF3+tb wqg1p1x2UMHEll//zTbxccKlZX7aWg1FcVTyzvFfXS/pNqwc3qDNC3ZmRsy3bGwtPCHk T3OY7Z7ZqR8SptPJT9xFsxmOzLtp2W7iuj2U/Z0mZMil+EB01EUx2lJfBmcRQCHePiBp ziyWVllMJNYwAbbzMbBC9ryih2oBDd1WmCRiSwO/iZFEhbfZu/UJmDiAV6i2v0fpqsx/ An5A== X-Gm-Message-State: APzg51ApjKwCwjewCaKkHL5ec0459EYPB3fPUn4SKITu3AgjBbSOzq57 IkYamBzsJyqoGjKcbEAhL3w= X-Received: by 2002:a5d:5344:: with SMTP id t4-v6mr11194075wrv.257.1536947131798; Fri, 14 Sep 2018 10:45:31 -0700 (PDT) Received: from gmail.com (2E8B0CD5.catv.pool.telekom.hu. [46.139.12.213]) by smtp.gmail.com with ESMTPSA id e133-v6sm4918754wma.33.2018.09.14.10.45.30 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 14 Sep 2018 10:45:30 -0700 (PDT) Date: Fri, 14 Sep 2018 19:45:28 +0200 From: Ingo Molnar To: Arnd Bergmann Cc: linux-arch@vger.kernel.org, linux-api@vger.kernel.org, Joseph =?iso-8859-1?Q?Myers=A0?= , David Howells , libc-alpha@sourceware.org, Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] [RFC] making uapi/linux/elfcore.h useful again Message-ID: <20180914174528.GA35000@gmail.com> References: <20180914113929.953895-1-arnd@arndb.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180914113929.953895-1-arnd@arndb.de> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Arnd Bergmann wrote: > After finding a bug in glibc the question came up how linux/elfcore.h > is supposed to be used from user space. As far as I can tell, it's > not possible, as it references data types that are simply unavailable > there. > > The #ifndef __KERNEL__ section in that header dates back to when the > file was introduced in linux-1.3.5, and presumably was meant to > provide the structures for the libc sys/procfs.h implementation. > However, this was never portable to architectures other than x86-32, > and has been broken on that architecture at a later point. > > These are the steps that I needed to make it possible to include the > header file, e.g. for libc self-testing in order to make sure the > structures are compatible with its own: > > - drop the #ifndef __KERNEL__ section that are obviously useless > and get in the way > > - change the pid_t references to __kernel_pid_t > > - Move required data from the private x86 asm/elf.h file into > a new uapi/asm/elf.h. Some other architectures already do that, > but most of them do not. Before applying the patch, we have > to do this for all architectures > > - Change ELF_NGREG to an integer literal constant instead of > a sizeof operation based on a private type. > > Cc: Joseph Myers? > Cc: David Howells > Cc: libc-alpha@sourceware.org > Link: https://patchwork.ozlabs.org/patch/969540/ > Signed-off-by: Arnd Bergmann > --- > arch/x86/include/asm/elf.h | 24 +----------------------- > arch/x86/include/uapi/asm/elf.h | 30 ++++++++++++++++++++++++++++++ > arch/x86/include/uapi/asm/signal.h | 2 +- > include/uapi/linux/elf.h | 1 + > include/uapi/linux/elfcore.h | 26 +++++--------------------- > 5 files changed, 38 insertions(+), 45 deletions(-) > create mode 100644 arch/x86/include/uapi/asm/elf.h Acked-by: Ingo Molnar I suspect this wants to go through -mm, or do you want to carry it? Thanks, Ingo