Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1459002ybg; Tue, 2 Jun 2020 10:29:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyTeQY0R6j4M4NYi5z5ieqvfP2a7U8YJaSya+vWHB3H9YcsOEWxhjbekarguNwQcvOCNN8W X-Received: by 2002:aa7:c6d1:: with SMTP id b17mr28967903eds.39.1591118960925; Tue, 02 Jun 2020 10:29:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591118960; cv=none; d=google.com; s=arc-20160816; b=LhmyPj/r7BHojzAXWDJgMa4aEHUEdxr4e1PMB4FQtTSVKIEorGJSKTzDIO/lV4mBHW +wIKMZ/dOlLEjN24bB1r2nb6FPepakUYkMDyGim1YlcejxZxt0AKgXAtJTBSRr8Rfm2n SAbmU2AdnOZST0JCCAoyDePrDSlNQEU7kby+xL1KrgJe1AEAYhkQYcnXM0IZq5J9f6LW smdzYvg27suLvHJjL/1uWR4ez3JXnRBs4GEHktsfONvgjHg1zdRNiZfAEogvrrYS7vJy z6URYz6BApcyoxge9K8GdgvH9r1/3lEdStItGr24kxFJmt0nAvLIPzu9M4kj5TQYWZWX 1B/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=iesdJmddYmf/ykPLINC0s6duDM2tr0OEvrj44zXcoWc=; b=zqdiucvBXd1vSKxR3F190HC/mY0u4JJPX2mv7PEsE8vcjx8LIBl/yb8LbuveB9tgcU A0/QuqzPhFuUUekPFGrHIGctLQOzzigVV0RdkCM8ysF1akWiP0EP+HKF/SemVAjarubj 1GZa9dEm17MXkzZ7zV25dFTprG7Es4pDYczkEInqJeuvk/9UFftoH9qpF+HN1uykkoZq V+tsdpiwJOrjydgDI0P/w6M6mRTvrQOIipWrc6vA9Kjqg+w9FQZ7SfBAZ4AovNtxGKST VU8Qdx5VhQzmie8X0iZ+JkNXhCx6dVsa236h7TzSxq0x25JEdsp00S4k096crnaVMb/4 pk/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b="gmSYlDf/"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p13si962175ejf.178.2020.06.02.10.28.58; Tue, 02 Jun 2020 10:29:20 -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=@linuxfoundation.org header.s=google header.b="gmSYlDf/"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726380AbgFBR1M (ORCPT + 99 others); Tue, 2 Jun 2020 13:27:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726037AbgFBR1L (ORCPT ); Tue, 2 Jun 2020 13:27:11 -0400 Received: from mail-oi1-x242.google.com (mail-oi1-x242.google.com [IPv6:2607:f8b0:4864:20::242]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6830AC05BD1E for ; Tue, 2 Jun 2020 10:27:11 -0700 (PDT) Received: by mail-oi1-x242.google.com with SMTP id z9so12727872oid.2 for ; Tue, 02 Jun 2020 10:27:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=iesdJmddYmf/ykPLINC0s6duDM2tr0OEvrj44zXcoWc=; b=gmSYlDf/V9gk1oDLdqfWhPTpd0ui0RQveZg67Qxf3uEG7N8KrFAiBRsmN0mWSChTjZ 7AGb/+0XeYTm8lQuTmndoUEhkq0NWu6EUKKbKDWl4JCosplCESefOJgCHte45MfAZy2I A7tMJQmcpPXT5n0JNXsHnO+Kln2hpnjZTnUwM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=iesdJmddYmf/ykPLINC0s6duDM2tr0OEvrj44zXcoWc=; b=J690b4z6TFBBvfKzp2UsQF6gFkvE4NeeHn5U9uC6+GVH+g5OX4A9eA1PG34zaFxxdF Kg8xk5RbW5D5hb3I1ZHXXtC87NYZZ3bZytmfKE4lLjZ6KhDp9FrWo/CWhCjYrPW2CC/A YAIvO9LV+Yh+zsC8IAIT31lpFFIawFXpfIPPjnAtrAuTQ3fLO2cMt945xLxcTDoWGvXC bxVDrBocilFnn6edcD9f1cgTVPAJgUFVWcjUoJnadooNzvGZHl26gBI1iYJMpRB+74rI H3KjIrrBVs5GpZObK2GbHteXsvg9eRto8wlbfeQNx9sxIoi2ZIoF61T3QycA/YpU4jsT DjSQ== X-Gm-Message-State: AOAM532XzQlMgpl5J7bNXnOJMrbfxb1z9VUjS5xuIfcyCZUAQtmd3/ow imETXPTcx7yxRRJw8MrLe0tk3A== X-Received: by 2002:aca:3e46:: with SMTP id l67mr3859330oia.92.1591118830160; Tue, 02 Jun 2020 10:27:10 -0700 (PDT) Received: from [192.168.1.112] (c-24-9-64-241.hsd1.co.comcast.net. [24.9.64.241]) by smtp.gmail.com with ESMTPSA id k7sm213929oon.29.2020.06.02.10.27.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 02 Jun 2020 10:27:09 -0700 (PDT) Subject: Re: [PATCH] arch/x86: reset MXCSR to default in kernel_fpu_begin() To: Andy Lutomirski , Borislav Petkov , Shuah Khan Cc: Petteri Aimonen , Dave Hansen , "H. Peter Anvin" , x86-ml , lkml , skhan@linuxfoundation.org References: <20200602101119.GA11634@zn.tnic> <20200602102951.GE17423@lakka.kapsi.fi> <20200602105649.GB11634@zn.tnic> From: Shuah Khan Message-ID: <8b1f0bfa-79b0-74e4-0241-8b2a94491807@linuxfoundation.org> Date: Tue, 2 Jun 2020 11:27:08 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/2/20 11:03 AM, Andy Lutomirski wrote: > 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. > Let's extend it to do what we want it to do. I will happy to take patches. If you have some concrete ideas on what we can add, please do a short summary of what is missing. I will find a way to get this done. > 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. > Is this a workaround for the lack of selftest tooling for kernel modules? In which case, let's us focus on fix selftest tooling. thanks, -- Shuah