From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B4D09C433F4 for ; Thu, 20 Sep 2018 22:33:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 34E7321533 for ; Thu, 20 Sep 2018 22:33:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 34E7321533 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725991AbeIUETG (ORCPT ); Fri, 21 Sep 2018 00:19:06 -0400 Received: from foss.arm.com ([217.140.101.70]:53786 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725783AbeIUETG (ORCPT ); Fri, 21 Sep 2018 00:19:06 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 43DCC80D; Thu, 20 Sep 2018 15:33:22 -0700 (PDT) Received: from big-swifty.misterjones.org (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 098663F5C0; Thu, 20 Sep 2018 15:33:22 -0700 (PDT) Date: Thu, 20 Sep 2018 23:33:20 +0100 Message-ID: <86lg7vx0i7.wl-marc.zyngier@arm.com> From: Marc Zyngier To: Pavel Machek Cc: , , Catalin Marinas , Will Deacon Subject: Re: [PATCH] arm64: Trap WFI executed in userspace In-Reply-To: <20180920220430.GA27468@xo-6d-61-c0.localdomain> References: <20180807093326.5090-1-marc.zyngier@arm.com> <20180920220430.GA27468@xo-6d-61-c0.localdomain> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 EasyPG/1.0.0 Emacs/25.1 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) Organization: ARM Ltd MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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. > > I don't think that's reasonable. Userspace should not be doing that, > and we do not want to encourage it. SIGILL would be reasonable, I'd > say. This ship has already sailed. Sending SIGILL changes the ABI in an incompatible way. Immediately returning to userspace without doing anything else (see v2 [1]) is the best we can do without changing the behaviour of userspace. Thanks, M. [1] https://patchwork.kernel.org/patch/10562517/ -- Jazz is not dead, it just smell funny.