Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752665AbdHNOjG (ORCPT ); Mon, 14 Aug 2017 10:39:06 -0400 Received: from mail-oi0-f66.google.com ([209.85.218.66]:35483 "EHLO mail-oi0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752336AbdHNOjF (ORCPT ); Mon, 14 Aug 2017 10:39:05 -0400 MIME-Version: 1.0 In-Reply-To: <20170814120807.GB3305@osiris> References: <49c5e39b-a7d9-1e2d-24ec-57852f7d1e51@linux.vnet.ibm.com> <598492A6.10707@iogearbox.net> <20170814120807.GB3305@osiris> From: Arnd Bergmann Date: Mon, 14 Aug 2017 16:39:03 +0200 X-Google-Sender-Auth: P3KrybeyfEmeME8I9pJk7am-GtM Message-ID: Subject: Re: Fwd: struct pt_regs missing in /usr/include/ tree for eBPF program compile To: Heiko Carstens Cc: Daniel Borkmann , Thomas-Mich Richter , ast@kernel.org, Hendrik Brueckner , Martin Schwidefsky , Linux Kernel Mailing List , Michael Holzheu , David Miller , yhs@fb.com, linux-arch Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1500 Lines: 35 On Mon, Aug 14, 2017 at 2:08 PM, Heiko Carstens wrote: > > I really don't think that struct pt_regs is part of uapi and should be > exported. We did change the layout of the pt_regs structure more than once > and would like to be able to do so in the future as well. On some architectures, pt_regs is definitely part of the uapi, as we define sigcontext in terms of pt_regs: arch/cris/include/uapi/asm/sigcontext.h: struct pt_regs regs; /* needs to be first */ arch/m32r/include/uapi/asm/sigcontext.h: struct pt_regs *sc_pt_regs; arch/microblaze/include/uapi/asm/sigcontext.h: struct pt_regs regs; arch/powerpc/include/uapi/asm/sigcontext.h: struct pt_regs __user *regs; arch/tile/include/uapi/asm/sigcontext.h: * struct sigcontext has the same shape as struct pt_regs, arch/unicore32/include/uapi/asm/sigcontext.h: struct pt_regs regs; On other architectures, they just use the same layout but different names. arm32 also uses pt_regs in struct kvm_regs, the other ones don't: arch/arm/include/uapi/asm/kvm.h: struct pt_regs usr_regs; /* R0_usr - R14_usr, PC, CPSR */ > In addition what about compat processes? Most architectures define their > struct pt_regs with "unsigned long" members, which have different sizes for > 32/64 bit, while the structure on the kernel stack contains 64 bit > members. And as far as I know the bpf test cases want to access the kernel > stack, no? Then this seems to be broken also. Right. Arnd