Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4082047pxb; Tue, 26 Jan 2021 11:54:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJxDqQtS8tXn52C3HDJQcB7ZPaXrsK8gtuiEwqdlQoqJIPDDRzG0z0Mz26D2i/4WzuriXzLA X-Received: by 2002:a17:906:7156:: with SMTP id z22mr4378351ejj.441.1611690898482; Tue, 26 Jan 2021 11:54:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611690898; cv=none; d=google.com; s=arc-20160816; b=Y75YTvNLA13rMMk2otIerZnCSZbOrl+fdkElmmqzLFOsNH/4qu+Xsd1OfgacgjX7sy ikTyK32CmTClomA1w/a3iXfCviMkbd/vbRhqWZKyOR5647TTASs3fn1mnk/x4c3H98e1 oiD+ZIqLfPzdNvg1illrb2PhC3KAVH1w/TcaZwvMhBWh9mkhFE8W7hVb0h+6A7dG3MVT G+3yhY/682F+UmmgwCUv2QaSX7Q4R7rqpLHox+ocg3mQY5ihkPSPdynM4BXwu8lhlQe2 yoYg0s6XtQx7j3zRkvvuiIFrhIT9DyHt3RgPjGf91B4y6I5a+yfNJLnESHiOCgF1WDrx MtnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=TrMD3FOf+kYV4iVemjpv9uv2g6NIByAxM4bdy2QXUcg=; b=r1T5ZfLExnnpqifE+CztbyNK2eHqLX9iSvwwxBCP6um6hDh8skJ3YDn9OZAt+rGv8u yKZjqbO8ToUXs7NrURuyafzC0mnA0j/9IIRzmsraIq/8wEhLJidv4gxVFhGylDyOxjHf 1kZWFnnCK5UY8aEas5QAnRHQ2x1+36I9LQCWVFgyaQfXZY/noabAMxzM1TU3lvgf7eKc 6v/S6dtE2yxa1nep3AlEykCDGj6Lzi+p+6lgi7QAOf0fPOiAR5IxFq+ckgakHfJxqlVQ bQyJhB5lKhYcAQhb27ImgkLUVAKPlAPzorgYT/7trciyEWHUOFKjFCH513QsLwWBBzz3 GRrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ans.pl header.s=20190507 header.b=JRknTEvF; 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 u15si7447469ejf.716.2021.01.26.11.54.32; Tue, 26 Jan 2021 11:54:58 -0800 (PST) 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=@ans.pl header.s=20190507 header.b=JRknTEvF; 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 S2389148AbhAZRZp (ORCPT + 99 others); Tue, 26 Jan 2021 12:25:45 -0500 Received: from cmyk.emenem.pl ([217.79.154.63]:33666 "EHLO smtp.emenem.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389301AbhAZHEZ (ORCPT ); Tue, 26 Jan 2021 02:04:25 -0500 X-Virus-Scanned: amavisd-new at emenem.pl Received: from [192.168.1.10] (50-78-106-33-static.hfc.comcastbusiness.net [50.78.106.33]) (authenticated bits=0) by cmyk.emenem.pl (8.16.1/8.16.1) with ESMTPSA id 10Q73KTY004535 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Tue, 26 Jan 2021 08:03:22 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ans.pl; s=20190507; t=1611644604; bh=TrMD3FOf+kYV4iVemjpv9uv2g6NIByAxM4bdy2QXUcg=; h=Subject:To:Cc:References:From:Date:In-Reply-To; b=JRknTEvF/LG/fVhbNvod3UxDwkueT+HBJHzM9aScl+Jm6/rr3cOgLC2SHoBZHny7l HXj6uI35w9kIi+fZZJg4rv1tyDt1yW26h4BTWz3WYfS8I1uOTcRsqQgz6NVoHmun0b xTDw4fR7Jhpyh5vjw2TKxyKBXFmAHpjoahkuFNy0= Subject: Re: [PATCH 5.4 55/86] x86/mmx: Use KFPU_387 for MMX string operations To: Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Andy Lutomirski Cc: stable@vger.kernel.org, Krzysztof Mazur , Borislav Petkov References: <20210125183201.024962206@linuxfoundation.org> <20210125183203.376765980@linuxfoundation.org> From: =?UTF-8?Q?Krzysztof_Ol=c4=99dzki?= Message-ID: Date: Mon, 25 Jan 2021 23:03:18 -0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: <20210125183203.376765980@linuxfoundation.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021-01-25 at 10:39, Greg Kroah-Hartman wrote: > From: Andy Lutomirski > > commit 67de8dca50c027ca0fa3b62a488ee5035036a0da upstream. > > The default kernel_fpu_begin() doesn't work on systems that support XMM but > haven't yet enabled CR4.OSFXSR. This causes crashes when _mmx_memcpy() is > called too early because LDMXCSR generates #UD when the aforementioned bit > is clear. > > Fix it by using kernel_fpu_begin_mask(KFPU_387) explicitly. > > Fixes: 7ad816762f9b ("x86/fpu: Reset MXCSR to default in kernel_fpu_begin()") > Reported-by: Krzysztof Mazur > Signed-off-by: Andy Lutomirski > Signed-off-by: Borislav Petkov > Tested-by: Krzysztof Piotr Olędzki > Tested-by: Krzysztof Mazur > Cc: > Link: https://lkml.kernel.org/r/e7bf21855fe99e5f3baa27446e32623358f69e8d.1611205691.git.luto@kernel.org > Signed-off-by: Greg Kroah-Hartman Similar to 5.10.11, we also need https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e45122893a9870813f9bd7b4add4f613e6f29008 in 5.4.93: Otherwise, the kernel will fail to compile if CONFIG_X86_USE_3DNOW=y arch/x86/lib/mmx_32.c: In function '_mmx_memcpy': arch/x86/lib/mmx_32.c:50:2: error: implicit declaration of function 'kernel_fpu_begin_mask'; did you mean 'kernel_fpu_begin'? [-Werror=implicit-function-declaration] 50 | kernel_fpu_begin_mask(KFPU_387); | ^~~~~~~~~~~~~~~~~~~~~ | kernel_fpu_begin arch/x86/lib/mmx_32.c:50:24: error: 'KFPU_387' undeclared (first use in this function) 50 | kernel_fpu_begin_mask(KFPU_387); | ^~~~~~~~ arch/x86/lib/mmx_32.c:50:24: note: each undeclared identifier is reported only once for each function it appears in arch/x86/lib/mmx_32.c: In function 'fast_clear_page': arch/x86/lib/mmx_32.c:140:24: error: 'KFPU_387' undeclared (first use in this function) 140 | kernel_fpu_begin_mask(KFPU_387); | ^~~~~~~~ arch/x86/lib/mmx_32.c: In function 'fast_copy_page': arch/x86/lib/mmx_32.c:173:24: error: 'KFPU_387' undeclared (first use in this function) 173 | kernel_fpu_begin_mask(KFPU_387); | ^~~~~~~~ Thanks, Krzysztof