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=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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 BD3F2C11F65 for ; Wed, 30 Jun 2021 09:38:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A642361D0B for ; Wed, 30 Jun 2021 09:38:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233984AbhF3Jko (ORCPT ); Wed, 30 Jun 2021 05:40:44 -0400 Received: from mail.skyhub.de ([5.9.137.197]:43448 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233817AbhF3Jkm (ORCPT ); Wed, 30 Jun 2021 05:40:42 -0400 Received: from zn.tnic (p200300ec2f12c3005601b47fb9547aa2.dip0.t-ipconnect.de [IPv6:2003:ec:2f12:c300:5601:b47f:b954:7aa2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 90C741EC0528; Wed, 30 Jun 2021 11:38:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1625045892; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=7/Ij8gtUUK45jvstUT5DxylQ3O9KokzsF1985ci5zq8=; b=JvG+JKnBWf9zCbGzM30JoUYM1Knm7WKCM2G1q10IvU4I4dT+328pmpUmldfjlkEwP/JftJ kKyzyIj23q0hMe3PvzkadT5nBO86J5z+NqLivX+55UdC8v7OqpqKZ70C5HumMJjANY9btj tjmqhOY66I/vpRmXd4f6qY70uFf3mtQ= Date: Wed, 30 Jun 2021 11:38:07 +0200 From: Borislav Petkov To: Marcos Del Sol Vives Cc: x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] x86: add NOPL and CMOV emulation Message-ID: References: <20210626130313.1283485-1-marcos@orca.pet> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 29, 2021 at 10:45:17PM +0200, Marcos Del Sol Vives wrote: > All the documentation I had previously read suggested that only CMOV and > NOPL had been introduced with the i686, and hence these were the two > instructions I emulated only. As stated previously this is also enough to > boot Debian mostly flawless. > > However, and contrary to what I thought, the i686 also saw the introduction > of a handful of other x87 instructions (FCMOVB, FCMOVBE, FCMOVE, FCMOVNB, > FCMOVNBE, FCMOVNE, FCMOVNU, FCMOVU, FCOMI, FCOMIP, FUCOMI, FUCOMIP) Yah, looka here: https://en.wikipedia.org/wiki/FCMOV So before we play with this further, you could try to add a "nofpu" kernel cmdline param which does what fpu__init_system_early_generic() does: setup_clear_cpu_cap(X86_FEATURE_FPU) to stop the kernel from setting up FPU support and see how far you can get there. I'm afraid glibc does its own feature detection so it will see the FPU CPUID bit but if the kernel doesn't support an FPU - and glibc needs the kernel to handle the context - then maybe it'll stop using FPU instructions. But you'll have to try it because I fear no one even tested such a thing. Good luck. :) -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette