Re: [PATCH 4/6] arm64: pmu: Add hook to handle pmu-related undefined instructions

2019-05-17 Thread Peter Zijlstra
On Fri, May 17, 2019 at 10:26:55AM +0200, Peter Zijlstra wrote: > On Fri, May 17, 2019 at 09:04:20AM +0100, Mark Rutland wrote: > > > Remember that this is in an undefined (trap) handler. > > > > If userspace _attempts_ to write to the registers, the CPU will trap to the > > kernel. The comment

Re: [PATCH 4/6] arm64: pmu: Add hook to handle pmu-related undefined instructions

2019-05-17 Thread Peter Zijlstra
On Fri, May 17, 2019 at 09:04:20AM +0100, Mark Rutland wrote: > Remember that this is in an undefined (trap) handler. > > If userspace _attempts_ to write to the registers, the CPU will trap to the > kernel. The comment is perhaps misleading; when we "do nothing", the common > trap handling code

Re: [PATCH 4/6] arm64: pmu: Add hook to handle pmu-related undefined instructions

2019-05-17 Thread Mark Rutland
On Fri, May 17, 2019 at 09:10:18AM +0200, Peter Zijlstra wrote: > On Thu, May 16, 2019 at 02:21:46PM +0100, Raphael Gault wrote: > > In order to prevent the userspace processes which are trying to access > > the registers from the pmu registers on a big.LITTLE environment we > > introduce a hook

Re: [PATCH 4/6] arm64: pmu: Add hook to handle pmu-related undefined instructions

2019-05-17 Thread Raphael Gault
Hi, On 5/17/19 8:10 AM, Peter Zijlstra wrote: > On Thu, May 16, 2019 at 02:21:46PM +0100, Raphael Gault wrote: >> In order to prevent the userspace processes which are trying to access >> the registers from the pmu registers on a big.LITTLE environment we >> introduce a hook to handle undefined

Re: [PATCH 4/6] arm64: pmu: Add hook to handle pmu-related undefined instructions

2019-05-17 Thread Peter Zijlstra
On Thu, May 16, 2019 at 02:21:46PM +0100, Raphael Gault wrote: > In order to prevent the userspace processes which are trying to access > the registers from the pmu registers on a big.LITTLE environment we > introduce a hook to handle undefined instructions. > > The goal here is to prevent the

[PATCH 4/6] arm64: pmu: Add hook to handle pmu-related undefined instructions

2019-05-16 Thread Raphael Gault
In order to prevent the userspace processes which are trying to access the registers from the pmu registers on a big.LITTLE environment we introduce a hook to handle undefined instructions. The goal here is to prevent the process to be interrupted by a signal when the error is caused by the task