Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp164447pxv; Wed, 30 Jun 2021 02:39:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx/GgXesHSsFXaRiAZ79w1nOQzu7luyBxsC8Q4TCwT1hOINP0DOd472Zcd2ijwRDXEkFqrM X-Received: by 2002:a5d:9750:: with SMTP id c16mr7117968ioo.142.1625045951888; Wed, 30 Jun 2021 02:39:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625045951; cv=none; d=google.com; s=arc-20160816; b=EQCTIIzd42J10kpOrBpDnsznHYMZ/NjDqrfNBFLmHVdMl+OXdwc5u++4bqv/G/NrDC ga3h+xgJdKn4s8/fkTEMTo3w4ubnftszDHc2WROkrtP4fJBSma0tDwx68DVt8e2EL2if uUuW62TStmx0WOpmDgPGRXpoOLZo3gij/C9InAdIjU7lADBjcSP83/iH10/K6qAqe0Wz g7LilH6xZMbomE7HSEFINygW7hb7OsD4AtdgjrznDaYfcAc3WJZecZdM7hLEfbWsH1pv Cbx3HvHaslo6jYXe8yfZEryiYNWSbJgbO2eMbAPrGJqEvYUACKRgZQgc2vj9c3n665ly 3eiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=7/Ij8gtUUK45jvstUT5DxylQ3O9KokzsF1985ci5zq8=; b=m08G45TNcDDMoktQLArJiIVxUWKxh/HUTi5X92Jn7N5BnuIogq9B1Re0GX+c5C7mkR rcDnC8yAfsh+hz3d4P1e04v6wq+hHM4xuLdg1PpppIrrccEyknkDXkC29YllFcCnsWGO tpn3n5G/LrKnbm3Y6JJPdzQUCGhvSPbnJg81j0H0/O/yxgL0NS46+nuAhqJ98MF2nk9A DRv4XxNNR/quvi5MXcRFt8SqEW/fDI3HJfFidFAV8Y8ennkQZPr3fi2FGCUoXqMy0xau jN4G1gHYwT0Dd6nglM8LLD294bY2B2vjIWhRCQ7YSPOjpMv6WLdOWJOFaVeKqNUKJuO5 f4OQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=JvG+JKnB; 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=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p19si24162924jas.9.2021.06.30.02.39.00; Wed, 30 Jun 2021 02:39: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=@alien8.de header.s=dkim header.b=JvG+JKnB; 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=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233951AbhF3Jkn (ORCPT + 99 others); Wed, 30 Jun 2021 05:40:43 -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