Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1445718ybg; Tue, 2 Jun 2020 10:08:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzdKxDsONahiWEYmwtiT6kn5a2xYOAWv7pnlPpmz9B68kmIg+mkOf3nWUx5oQqmq4IqJ2hk X-Received: by 2002:a50:fb1a:: with SMTP id d26mr27595155edq.83.1591117691256; Tue, 02 Jun 2020 10:08:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591117691; cv=none; d=google.com; s=arc-20160816; b=r1kBX/8PKUk/OzSYdpdvcJ9inB0OE58mckbZFDN7iawMIFoDMm+8cBiaN11ejBanHc KNzVrnVl6MwJ9+Wm70UHOSDMRS54sscFEoCoJGkXpPcLeXo/qbKvnC46rPSkrFOgkiCL ldHt6YmchSPAZd+T8rdnimtw7dX018D0Ml28uDRDLLw05DGFYrGHQrz0G0mNOwD/THPI uvat7yt3btjXTNsyFH+NsPPFGUlfKo9TioXczsSuTTTotgUv8/X8WzepKYWkkcp1BLe9 5QmSnmERsEGQLVBobK2xIaqtF1GsRVlnNRS1uqq25+7u1u3QTMRtr4huTXfy86oBatsw hJJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=M9yFqEsnAJY8PjaSY7FC8X+IjT+EM+Bi7a/UMAdiB4Q=; b=mZhzJRRyPL5rlOoTnMr6jfzOGIx0lUoTmfVmrTdrhVO+QRhgIW5FVDb1YxvCxgJCEC j7/v4j4yIXy63gxiwyRmJCkmTyBrUZRwSUEA6LKBcBYzyfi32ypXIuzLgl4r4aMfLIxP jM2ktTpFgng7NMmwP2q3hMeXdaFfDRP4XzrUs++NATrep7N8qQcgb1jIYhytFOTU6y7z l6tfENRaSS/X+L6FkTd0KkinjQ7K8gN4DY8+WG7tRnUvpU9MJZVqvJ9FiXPBHU5xThHQ fsrcCR9QSdxxLVPKlQq+pLsS8jUsCo+gk1++GCq9fEYkopYK6KmXIK29yMq0sYh8TZj+ D20w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SW7cpXwI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b16si1817015edw.278.2020.06.02.10.07.47; Tue, 02 Jun 2020 10:08:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SW7cpXwI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726625AbgFBRDi (ORCPT + 99 others); Tue, 2 Jun 2020 13:03:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:43416 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725969AbgFBRDh (ORCPT ); Tue, 2 Jun 2020 13:03:37 -0400 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F0206206C3 for ; Tue, 2 Jun 2020 17:03:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591117417; bh=NmxHHzmeXgBSqTQznbwVLX6fsWxKeOGY6mr4ppJx8Yw=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=SW7cpXwIpzc2gbnz20I9frQFGlfnXLhceDHrxY5V6P22eSYotRKMcvwxLQIG9M6q1 N2QB1KB0/zIQZ2C81douga7HylX4hz0OeafwMvAdtZ4JnjIj6aROJnAfyfHPxgcI2m 1kW4JHbtAvBVJji2GuaOjugvKzu7c+qiFPoXLjss= Received: by mail-wm1-f52.google.com with SMTP id c71so3627690wmd.5 for ; Tue, 02 Jun 2020 10:03:36 -0700 (PDT) X-Gm-Message-State: AOAM530c+ZhkBwLNuNv3ZK24jHybW+Rk7ZDdUJ1vAgZLzKSU20pgYjaL dvlfxTfhAGyJSGb6qAa9dnPwlE1Mb+jc6/Tnc1hSLw== X-Received: by 2002:a1c:abc3:: with SMTP id u186mr4934933wme.21.1591117415542; Tue, 02 Jun 2020 10:03:35 -0700 (PDT) MIME-Version: 1.0 References: <20200602101119.GA11634@zn.tnic> <20200602102951.GE17423@lakka.kapsi.fi> <20200602105649.GB11634@zn.tnic> In-Reply-To: <20200602105649.GB11634@zn.tnic> From: Andy Lutomirski Date: Tue, 2 Jun 2020 10:03:24 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] arch/x86: reset MXCSR to default in kernel_fpu_begin() To: Borislav Petkov , Shuah Khan Cc: Petteri Aimonen , Andy Lutomirski , Dave Hansen , "H. Peter Anvin" , x86-ml , lkml Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 2, 2020 at 3:56 AM Borislav Petkov wrote: > > Hi, > > On Tue, Jun 02, 2020 at 01:29:51PM +0300, Petteri Aimonen wrote: > > The kernel module is not actually x86-specific, even though it is > > currently only enabled for x86. amdgpu driver already does kernel mode > > floating point operations on PPC64 also, and the same module could be > > used to test the same thing there. > > Then make it generic please and put the user portion in, say, > tools/testing/selftests/fpu/ and we can ask ppc people to test it too. > People might wanna add more stuff to it in the future, which would be > good. > > > To deterministically trigger the bug, the syscall has to come from the > > same thread that has modified MXCSR. Going through /usr/sbin/modprobe > > won't work, and manually doing the necessary syscalls for module loading > > seems too complicated. > > Ok, fair enough. But put that file in debugfs pls. I think I agree. While it would be delightful to have general selftest tooling for kernel modules, we don't have that right now, and having the test just work with an appropriately configured kernel would be nice. How about putting the file you frob in /sys/kernel/debug/selftest_helpers/something_or_other. The idea would be that /sys/kernel/debug/selftest_helpers would be a general place for kernel helpers needed to make selftests work. --Andy