Re: [PATCH] arm64: Trap WFI executed in userspace

2018-09-20 Thread Marc Zyngier
On Thu, 20 Sep 2018 23:04:30 +0100, Pavel Machek wrote: > > On Tue 2018-08-07 10:33:26, Marc Zyngier wrote: > > It recently came to light that userspace can execute WFI, and that > > the arm64 kernel doesn trap this event. This sounds rather benign, > > but the kernel should decide when it wants

Re: [PATCH] arm64: Trap WFI executed in userspace

2018-09-20 Thread Marc Zyngier
On Thu, 20 Sep 2018 23:04:30 +0100, Pavel Machek wrote: > > On Tue 2018-08-07 10:33:26, Marc Zyngier wrote: > > It recently came to light that userspace can execute WFI, and that > > the arm64 kernel doesn trap this event. This sounds rather benign, > > but the kernel should decide when it wants

Re: [PATCH] arm64: Trap WFI executed in userspace

2018-09-20 Thread Pavel Machek
On Tue 2018-08-07 10:33:26, Marc Zyngier wrote: > It recently came to light that userspace can execute WFI, and that > the arm64 kernel doesn trap this event. This sounds rather benign, > but the kernel should decide when it wants to wait for an interrupt, > and not userspace. > > Let's trap WFI

Re: [PATCH] arm64: Trap WFI executed in userspace

2018-09-20 Thread Pavel Machek
On Tue 2018-08-07 10:33:26, Marc Zyngier wrote: > It recently came to light that userspace can execute WFI, and that > the arm64 kernel doesn trap this event. This sounds rather benign, > but the kernel should decide when it wants to wait for an interrupt, > and not userspace. > > Let's trap WFI

Re: [PATCH] arm64: Trap WFI executed in userspace

2018-08-09 Thread Marc Zyngier
On Thu, 09 Aug 2018 13:47:01 +0100, Dave Martin wrote: > > On Thu, Aug 09, 2018 at 01:38:12PM +0100, Will Deacon wrote: > > On Thu, Aug 09, 2018 at 01:34:57PM +0100, Dave Martin wrote: > > > On Wed, Aug 08, 2018 at 01:34:09PM +0100, Catalin Marinas wrote: > > > > On Tue, Aug 07, 2018 at

Re: [PATCH] arm64: Trap WFI executed in userspace

2018-08-09 Thread Marc Zyngier
On Thu, 09 Aug 2018 13:47:01 +0100, Dave Martin wrote: > > On Thu, Aug 09, 2018 at 01:38:12PM +0100, Will Deacon wrote: > > On Thu, Aug 09, 2018 at 01:34:57PM +0100, Dave Martin wrote: > > > On Wed, Aug 08, 2018 at 01:34:09PM +0100, Catalin Marinas wrote: > > > > On Tue, Aug 07, 2018 at

Re: [PATCH] arm64: Trap WFI executed in userspace

2018-08-09 Thread Dave Martin
On Thu, Aug 09, 2018 at 01:38:12PM +0100, Will Deacon wrote: > On Thu, Aug 09, 2018 at 01:34:57PM +0100, Dave Martin wrote: > > On Wed, Aug 08, 2018 at 01:34:09PM +0100, Catalin Marinas wrote: > > > On Tue, Aug 07, 2018 at 11:24:34AM +0100, Marc Zyngier wrote: > > > > On 07/08/18 11:05, Dave

Re: [PATCH] arm64: Trap WFI executed in userspace

2018-08-09 Thread Dave Martin
On Thu, Aug 09, 2018 at 01:38:12PM +0100, Will Deacon wrote: > On Thu, Aug 09, 2018 at 01:34:57PM +0100, Dave Martin wrote: > > On Wed, Aug 08, 2018 at 01:34:09PM +0100, Catalin Marinas wrote: > > > On Tue, Aug 07, 2018 at 11:24:34AM +0100, Marc Zyngier wrote: > > > > On 07/08/18 11:05, Dave

Re: [PATCH] arm64: Trap WFI executed in userspace

2018-08-09 Thread Will Deacon
On Thu, Aug 09, 2018 at 01:34:57PM +0100, Dave Martin wrote: > On Wed, Aug 08, 2018 at 01:34:09PM +0100, Catalin Marinas wrote: > > On Tue, Aug 07, 2018 at 11:24:34AM +0100, Marc Zyngier wrote: > > > On 07/08/18 11:05, Dave Martin wrote: > > > > On Tue, Aug 07, 2018 at 10:33:26AM +0100, Marc

Re: [PATCH] arm64: Trap WFI executed in userspace

2018-08-09 Thread Will Deacon
On Thu, Aug 09, 2018 at 01:34:57PM +0100, Dave Martin wrote: > On Wed, Aug 08, 2018 at 01:34:09PM +0100, Catalin Marinas wrote: > > On Tue, Aug 07, 2018 at 11:24:34AM +0100, Marc Zyngier wrote: > > > On 07/08/18 11:05, Dave Martin wrote: > > > > On Tue, Aug 07, 2018 at 10:33:26AM +0100, Marc

Re: [PATCH] arm64: Trap WFI executed in userspace

2018-08-09 Thread Dave Martin
On Wed, Aug 08, 2018 at 01:34:09PM +0100, Catalin Marinas wrote: > On Tue, Aug 07, 2018 at 11:24:34AM +0100, Marc Zyngier wrote: > > On 07/08/18 11:05, Dave Martin wrote: > > > On Tue, Aug 07, 2018 at 10:33:26AM +0100, Marc Zyngier wrote: > > >> It recently came to light that userspace can execute

Re: [PATCH] arm64: Trap WFI executed in userspace

2018-08-09 Thread Dave Martin
On Wed, Aug 08, 2018 at 01:34:09PM +0100, Catalin Marinas wrote: > On Tue, Aug 07, 2018 at 11:24:34AM +0100, Marc Zyngier wrote: > > On 07/08/18 11:05, Dave Martin wrote: > > > On Tue, Aug 07, 2018 at 10:33:26AM +0100, Marc Zyngier wrote: > > >> It recently came to light that userspace can execute

Re: [PATCH] arm64: Trap WFI executed in userspace

2018-08-08 Thread Catalin Marinas
On Tue, Aug 07, 2018 at 11:24:34AM +0100, Marc Zyngier wrote: > On 07/08/18 11:05, Dave Martin wrote: > > On Tue, Aug 07, 2018 at 10:33:26AM +0100, Marc Zyngier wrote: > >> It recently came to light that userspace can execute WFI, and that > >> the arm64 kernel doesn trap this event. This sounds

Re: [PATCH] arm64: Trap WFI executed in userspace

2018-08-08 Thread Catalin Marinas
On Tue, Aug 07, 2018 at 11:24:34AM +0100, Marc Zyngier wrote: > On 07/08/18 11:05, Dave Martin wrote: > > On Tue, Aug 07, 2018 at 10:33:26AM +0100, Marc Zyngier wrote: > >> It recently came to light that userspace can execute WFI, and that > >> the arm64 kernel doesn trap this event. This sounds

Re: [PATCH] arm64: Trap WFI executed in userspace

2018-08-07 Thread Dave Martin
On Tue, Aug 07, 2018 at 01:12:03PM +0100, Robin Murphy wrote: > On 07/08/18 11:30, Dave Martin wrote: > >On Tue, Aug 07, 2018 at 11:24:34AM +0100, Marc Zyngier wrote: > >>On 07/08/18 11:05, Dave Martin wrote: > >>>On Tue, Aug 07, 2018 at 10:33:26AM +0100, Marc Zyngier wrote: > It recently came

Re: [PATCH] arm64: Trap WFI executed in userspace

2018-08-07 Thread Dave Martin
On Tue, Aug 07, 2018 at 01:12:03PM +0100, Robin Murphy wrote: > On 07/08/18 11:30, Dave Martin wrote: > >On Tue, Aug 07, 2018 at 11:24:34AM +0100, Marc Zyngier wrote: > >>On 07/08/18 11:05, Dave Martin wrote: > >>>On Tue, Aug 07, 2018 at 10:33:26AM +0100, Marc Zyngier wrote: > It recently came

Re: [PATCH] arm64: Trap WFI executed in userspace

2018-08-07 Thread Robin Murphy
On 07/08/18 11:30, Dave Martin wrote: On Tue, Aug 07, 2018 at 11:24:34AM +0100, Marc Zyngier wrote: On 07/08/18 11:05, Dave Martin wrote: On Tue, Aug 07, 2018 at 10:33:26AM +0100, Marc Zyngier wrote: It recently came to light that userspace can execute WFI, and that the arm64 kernel doesn

Re: [PATCH] arm64: Trap WFI executed in userspace

2018-08-07 Thread Robin Murphy
On 07/08/18 11:30, Dave Martin wrote: On Tue, Aug 07, 2018 at 11:24:34AM +0100, Marc Zyngier wrote: On 07/08/18 11:05, Dave Martin wrote: On Tue, Aug 07, 2018 at 10:33:26AM +0100, Marc Zyngier wrote: It recently came to light that userspace can execute WFI, and that the arm64 kernel doesn

Re: [PATCH] arm64: Trap WFI executed in userspace

2018-08-07 Thread Dave Martin
On Tue, Aug 07, 2018 at 11:24:34AM +0100, Marc Zyngier wrote: > On 07/08/18 11:05, Dave Martin wrote: > > On Tue, Aug 07, 2018 at 10:33:26AM +0100, Marc Zyngier wrote: > >> It recently came to light that userspace can execute WFI, and that > >> the arm64 kernel doesn trap this event. This sounds

Re: [PATCH] arm64: Trap WFI executed in userspace

2018-08-07 Thread Dave Martin
On Tue, Aug 07, 2018 at 11:24:34AM +0100, Marc Zyngier wrote: > On 07/08/18 11:05, Dave Martin wrote: > > On Tue, Aug 07, 2018 at 10:33:26AM +0100, Marc Zyngier wrote: > >> It recently came to light that userspace can execute WFI, and that > >> the arm64 kernel doesn trap this event. This sounds

Re: [PATCH] arm64: Trap WFI executed in userspace

2018-08-07 Thread Marc Zyngier
On 07/08/18 11:05, Dave Martin wrote: > On Tue, Aug 07, 2018 at 10:33:26AM +0100, Marc Zyngier wrote: >> It recently came to light that userspace can execute WFI, and that >> the arm64 kernel doesn trap this event. This sounds rather benign, >> but the kernel should decide when it wants to wait

Re: [PATCH] arm64: Trap WFI executed in userspace

2018-08-07 Thread Marc Zyngier
On 07/08/18 11:05, Dave Martin wrote: > On Tue, Aug 07, 2018 at 10:33:26AM +0100, Marc Zyngier wrote: >> It recently came to light that userspace can execute WFI, and that >> the arm64 kernel doesn trap this event. This sounds rather benign, >> but the kernel should decide when it wants to wait

Re: [PATCH] arm64: Trap WFI executed in userspace

2018-08-07 Thread Dave Martin
On Tue, Aug 07, 2018 at 10:33:26AM +0100, Marc Zyngier wrote: > It recently came to light that userspace can execute WFI, and that > the arm64 kernel doesn trap this event. This sounds rather benign, > but the kernel should decide when it wants to wait for an interrupt, > and not userspace. > >

Re: [PATCH] arm64: Trap WFI executed in userspace

2018-08-07 Thread Dave Martin
On Tue, Aug 07, 2018 at 10:33:26AM +0100, Marc Zyngier wrote: > It recently came to light that userspace can execute WFI, and that > the arm64 kernel doesn trap this event. This sounds rather benign, > but the kernel should decide when it wants to wait for an interrupt, > and not userspace. > >

[PATCH] arm64: Trap WFI executed in userspace

2018-08-07 Thread Marc Zyngier
It recently came to light that userspace can execute WFI, and that the arm64 kernel doesn trap this event. This sounds rather benign, but the kernel should decide when it wants to wait for an interrupt, and not userspace. Let's trap WFI and treat it as a way to yield the CPU to another process.

[PATCH] arm64: Trap WFI executed in userspace

2018-08-07 Thread Marc Zyngier
It recently came to light that userspace can execute WFI, and that the arm64 kernel doesn trap this event. This sounds rather benign, but the kernel should decide when it wants to wait for an interrupt, and not userspace. Let's trap WFI and treat it as a way to yield the CPU to another process.