From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752855AbdFPLSh (ORCPT ); Fri, 16 Jun 2017 07:18:37 -0400 Received: from ozlabs.org ([103.22.144.67]:50673 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752676AbdFPLSg (ORCPT ); Fri, 16 Jun 2017 07:18:36 -0400 From: Michael Ellerman To: Ram Pai , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Cc: benh@kernel.crashing.org, paulus@samba.org, khandual@linux.vnet.ibm.com, aneesh.kumar@linux.vnet.ibm.com, bsingharora@gmail.com, dave.hansen@intel.com, hbabu@us.ibm.com, linuxram@us.ibm.com Subject: Re: [RFC PATCH 7/7 v1]powerpc: Deliver SEGV signal on protection key violation. In-Reply-To: <1496711109-4968-8-git-send-email-linuxram@us.ibm.com> References: <1496711109-4968-1-git-send-email-linuxram@us.ibm.com> <1496711109-4968-8-git-send-email-linuxram@us.ibm.com> User-Agent: Notmuch/0.21 (https://notmuchmail.org) Date: Fri, 16 Jun 2017 21:18:29 +1000 Message-ID: <87zid8uqnu.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Ram Pai writes: > diff --git a/arch/powerpc/include/uapi/asm/ptrace.h b/arch/powerpc/include/uapi/asm/ptrace.h > index 8036b38..109d0c2 100644 > --- a/arch/powerpc/include/uapi/asm/ptrace.h > +++ b/arch/powerpc/include/uapi/asm/ptrace.h > @@ -49,6 +49,8 @@ struct pt_regs { > unsigned long dar; /* Fault registers */ > unsigned long dsisr; /* on 4xx/Book-E used for ESR */ > unsigned long result; /* Result of a system call */ > + unsigned long dscr; /* contents of the DSCR register */ > + unsigned long amr; /* contents of AMR register */ > }; You can't change pt_regs, it's ABI. > @@ -109,7 +111,8 @@ struct pt_regs { > #define PT_DSISR 42 > #define PT_RESULT 43 > #define PT_DSCR 44 > -#define PT_REGS_COUNT 44 > +#define PT_AMR 45 > +#define PT_REGS_COUNT 45 You can add PT_AMR, but it has to be synthetic like DSCR, ie. not actually in pt_regs but available via ptrace. But do we want to do that? How does the x86 code export the key(s) of a process? Or doesn't it? cheers