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=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS 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 348C1C04AB4 for ; Tue, 14 May 2019 05:45:27 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B6126208C3 for ; Tue, 14 May 2019 05:45:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B6126208C3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 45368z6KJYzDqKv for ; Tue, 14 May 2019 15:45:23 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=permerror (mailfrom) smtp.mailfrom=kernel.crashing.org (client-ip=63.228.1.57; helo=gate.crashing.org; envelope-from=benh@kernel.crashing.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 45366y6FkMzDq6l for ; Tue, 14 May 2019 15:43:38 +1000 (AEST) Received: from localhost (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id x4E5hO0j014621; Tue, 14 May 2019 00:43:25 -0500 Message-ID: Subject: Re: [PATCH 1/2] [PowerPC] Add simd.h implementation From: Benjamin Herrenschmidt To: Shawn Landden Date: Tue, 14 May 2019 15:43:23 +1000 In-Reply-To: <20190514014412.25373-1-shawn@git.icu> References: <20190513005104.20140-1-shawn@git.icu> <20190514014412.25373-1-shawn@git.icu> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paul Mackerras , linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Mon, 2019-05-13 at 22:44 -0300, Shawn Landden wrote: > + > +/* > + * Were we in user mode when we were > + * interrupted? > + * > + * Doing kernel_altivec/vsx_begin/end() is ok if we are running > + * in an interrupt context from user mode - we'll just > + * save the FPU state as required. > + */ > +static bool interrupted_user_mode(void) > +{ > + struct pt_regs *regs = get_irq_regs(); > + > + return regs && user_mode(regs); > +} > + That's interesting .... it *could* work but we'll have to careful audit the code to make sure thats ok. We probably also want to handle the case where the CPU is in the idle loop. Do we always save the user state when switching out these days ? If yes, then there's no "live" state to worry about... Cheers, Ben.