From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752151AbbIOVQF (ORCPT ); Tue, 15 Sep 2015 17:16:05 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:62561 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751415AbbIOVQC (ORCPT ); Tue, 15 Sep 2015 17:16:02 -0400 From: Arnd Bergmann To: Peter Zijlstra , mathieu.desnoyers@efficios.com Cc: Palmer Dabbelt , dhowells@redhat.com, viro@zeniv.linux.org.uk, ast@plumgrid.com, aishchuk@linux.vnet.ibm.com, aarcange@redhat.com, akpm@linux-foundation.org, luto@kernel.org, acme@kernel.org, bhe@redhat.com, 3chas3@gmail.com, chris@zankel.net, dave@sr71.net, dyoung@redhat.com, drysdale@google.com, davem@davemloft.net, ebiederm@xmission.com, geoff@infradead.org, gregkh@linuxfoundation.org, hpa@zytor.com, mingo@kernel.org, iulia.manda21@gmail.com, plagnioj@jcrosoft.com, jikos@kernel.org, josh@joshtriplett.org, kexec@lists.infradead.org, linux-api@vger.kernel.org, linux-arch@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, jcmvbkbc@gmail.com, paulmck@linux.vnet.ibm.com, tglx@linutronix.de, tomi.valkeinen@ti.com, vgoyal@redhat.com, x86@kernel.org, Frederic Weisbecker Subject: Re: [PATCH 09/13] Move bp_type_idx to kernel/event/hw_breakpoint.c Date: Tue, 15 Sep 2015 23:15:29 +0200 Message-ID: <2023922.x7a6gQp0x7@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <20150915080607.GW16853@twins.programming.kicks-ass.net> References: <1441832902-28993-1-git-send-email-palmer@dabbelt.com> <1442271047-4908-10-git-send-email-palmer@dabbelt.com> <20150915080607.GW16853@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:M1xZowsdHr2JE/Ur5dXX+83/fGwaxY0GBuIP3byUD6oG00AfSd5 9XzcO0mudUvafUrOM4P/mx+vryhgZ3Z0FyZ3o6c31hqaJafL2H21rKWL+QdcGMcMoFvJ6zI NbxIoBlmgLUy6sjic1MzknG1iWOBG79gEzXPaJJm7JpjYw/ZQWiMIwImRpIBdt+4extSS4W ZZFcsxFzLiO30k5R4qwQQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:DZhc8KkJ64s=:WytowhwUA4nqOVtnC0eIFs ZFpJqllqlzuSuxW+1H3DOjNp/9J734nw/W7UxF9Let8osFjK3pITcYX3D4b5xoWSnw5jSnDu1 Q+HlHBZXgBawMu+LJVX+wK48t7Cznob1X/Y/uAOhMQz7qqw8N41N/04+5RZ1sJQsGTt7FLCNK huZ491nKwAHMNaRRuQeQY/gE9BIvTQRuVYkVl59TayByNIkj7zWynW2gcZvh5d3CKadgTxJL5 EbdCevUPUcL4q3MdNSmdaP63VyS2bNdP7yoTXudfMd5wfe9TMMx9u08qFeBz7zjGKxe3QKgG2 zS0jv3B2NkIuDSiqt60/fJl4TzTcUJj2fgOyZiaeWDA1ZMIsdLcogqfl7jPB1ErdLJmPaYHzQ OAOLv4lg5Oqimj/71xq4kQnfb8aJMF0amT75UUph/8rtXIPnylpOLxGNNZHCXhXonW1RDB/Ar 7ODcsXELxZR/AGmywYmMoCd9dillj8rHePgOBBLK0HxrEJtNUbtgKhlXi61eWEFV1ypngrgvl /BhTQM7HltKdxHGdTq8Spm7ooVCi1fFrJVFwZjCugVHL2TgpRbhUY8ofjrgD3mKsaOrQbIZ+s +35GuD6x3LGFmGIfZ48uQwv5451sl6CJtus+9d3OdhfmCtCgQmpW+ywtfebhYKkl8lqfau3Qk Jx4Pw9JjZU7C8Li9+r8uqxhBTJSvEtmqAfNfhoDQiheU7VUTebWSmk574qW7mVSzGYpUuEPpY 48F1uhYLGUxsadEg Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tuesday 15 September 2015 10:06:07 Peter Zijlstra wrote: > > diff --git a/include/uapi/linux/hw_breakpoint.h b/include/uapi/linux/hw_breakpoint.h > > index b04000a2296a..7a6a5a7f9511 100644 > > --- a/include/uapi/linux/hw_breakpoint.h > > +++ b/include/uapi/linux/hw_breakpoint.h > > @@ -17,14 +17,4 @@ enum { > > HW_BREAKPOINT_INVALID = HW_BREAKPOINT_RW | HW_BREAKPOINT_X, > > }; > > > > -enum bp_type_idx { > > - TYPE_INST = 0, > > -#ifdef CONFIG_HAVE_MIXED_BREAKPOINTS_REGS > > - TYPE_DATA = 0, > > -#else > > - TYPE_DATA = 1, > > -#endif > > - TYPE_MAX > > -}; > > This is rather unfortunate; you are correct that the naming is too > generic (and I tend to agree), but I think these values are required by > userspace to fill out: > > perf_event_attr::bp_type > > So removing them will break things. > > Frederic? If user space actually relies on the definition from this header file, then it will use the wrong one on x86 and get 'TYPE_DATA = 1', while the kernel uses 'TYPE_DATA = 0'. That seems unlikely to work, so I suspect it gets a different definition. If it uses this definition and it does work, we can probably use #if defined(__KERNEL__) && defined(CONFIG_HAVE_MIXED_BREAKPOINTS_REGS) but that requires a comment explaining exactly why that works. Arnd