Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp1660956rwb; Sun, 15 Jan 2023 02:03:41 -0800 (PST) X-Google-Smtp-Source: AMrXdXv353JlmSaoCBUyujdZVHD4O7j0cx2xRwEDDtIRRZhUdVvmjOH9Ai/yWcPaBfG+h9sGYjqc X-Received: by 2002:a17:906:7e0e:b0:7c0:d6b6:1ee9 with SMTP id e14-20020a1709067e0e00b007c0d6b61ee9mr18089465ejr.11.1673777021333; Sun, 15 Jan 2023 02:03:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673777021; cv=none; d=google.com; s=arc-20160816; b=bwnerN1YRWLrQziI3opih6ODHdFC93RIysNH5VCMm+2WuuMh46KmtjNw3MLptCwK53 Ww4Eu6He29Sl2hZVNTvAMXOcj23lAGX4hBPiljASBTdSyZzh8lU459IXeazMWzDSkJoH oGTzbMBfz9HIqnQ3XQGk7FqDz7U/QAC8Vsc1J49MTXKeyiXtMAJCe37cddyOmghRLDaF 8brgSi1Vh3Gai+b28Woomt9BHNKV+k1fveHEKNrNeGyurRAEiKsF2LH5xdM1ngJN5uv3 rB4P4FB+p5TyVs8FG2CAdbhLvEi4netHVoQl5IqqgK3JDm+Igh2xBrhJ2xpJNDnHfMgt Em7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=U91tZ1pcL+C5oCwSnm2ekb7b6jfm6xqHe6fUGsu0ktM=; b=vaCJ+O+QE1GVFvJEawr6ymeHziHU/VBDWDFm5HVMPy4Cr4jLZy8fce5E12rdFHGnv9 +fwtK0k2S4UHgtPbqtyTp0JmkUw+scJc4UkkuAz+LRUfqHpP09bE35r/INHj2WaSEtS5 6g6fdGt2Hm1LFWK8mVu5IgHqNkFvlUW8sj6+fDSSEJ906mgubWxlMo4IPyw/bnASO0Gm CuBOsNOJIe1OWHpUJMPAmHoENlYhxkmtkKapOAQi4O04b5ZHI+lE1nZA4YZtbenWOtEN RQKpKa+UZXKsLVDh1vHkQwG6+3IsKAyDHXTsqBIcmbfGSPFizRDhE4wTnYZH0cT5Ohjj 92tA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=nnDDnTlz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id xd9-20020a170907078900b007c16107b16bsi16464709ejb.432.2023.01.15.02.03.27; Sun, 15 Jan 2023 02:03:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=nnDDnTlz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230316AbjAOJsW (ORCPT + 52 others); Sun, 15 Jan 2023 04:48:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229804AbjAOJsS (ORCPT ); Sun, 15 Jan 2023 04:48:18 -0500 Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF6EFB46D; Sun, 15 Jan 2023 01:48:17 -0800 (PST) Received: by mail-ej1-x636.google.com with SMTP id kt14so2840813ejc.3; Sun, 15 Jan 2023 01:48:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=U91tZ1pcL+C5oCwSnm2ekb7b6jfm6xqHe6fUGsu0ktM=; b=nnDDnTlzHuKvIuOwtJ8+Uq5p94FYTsvGa/hjrDCWnj4igFQ/+5OMt9b+0VuOvJTSsF i7+CnSb7s3qDZ5PosseVVS+xilrMjkv66/dEb67/IwDMbVkd7NyGVdjB24XPEYyqnQ7G poVHSWf4P6kv4bpOGH+YVXZjL11kNMKRdc7WZptXhqg+Hqbc4efIfYqaywEeLmjDywSG dO0O1tWss+0Xi1jD3BdkpFUgRn/dHyE6iZY+36C0mjvBQPFYXt+LmoC08/DDGLnFNO5T uG1aFnm6Ik/Ma6VQ0kYR0VA6lJ3U2SM0Q/bUtuAyB73YzxZQDViaE1Ew7hh8tTSW93J2 si4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=U91tZ1pcL+C5oCwSnm2ekb7b6jfm6xqHe6fUGsu0ktM=; b=l6ZFY79aRg/zP+A+RWuiBPSTJQJiLnFh+oNMMRKGpmjq8RGCQbs0YLMEORHsJHRaUX Xh9mrpvVLY2lr401BLcgTI16Ij7ukWSZfBINcqWQwoEql+xpmN5a3LzQhizxpZAjocON aNWErxB3UHdEfKOT/fpZXrNusJDP7nB9PKt1n61jnnD3tyAWW9pugYUICqUwl7dGlciN h/LAwhkcXgE9dIuI4vOwHqYzS/caEQ0PvtfaLSMdIBmOwrrL/TiadmELWvkjugtGYFq0 dkpIXnxIFyf0vYTwhvmaEXmn8RjSZv3Tr+2C/wGQ9ngORFuAcEXmTy00IlrPRVGfCSMn oIXg== X-Gm-Message-State: AFqh2koS/P+yiJKF5ynS8uwkZ/QiZlrl/VHVN+XcCrMLLEGLYrFJFlGx o3VP4lPbvt7Xyb8uD0aLJ+BAUxopwLegDoNcrws= X-Received: by 2002:a17:906:d217:b0:7c1:8a0b:f915 with SMTP id w23-20020a170906d21700b007c18a0bf915mr6150975ejz.42.1673776096219; Sun, 15 Jan 2023 01:48:16 -0800 (PST) MIME-Version: 1.0 References: <20221217044436.4138642-1-davidgow@google.com> <20221217044436.4138642-3-davidgow@google.com> In-Reply-To: <20221217044436.4138642-3-davidgow@google.com> From: =?UTF-8?Q?Sergio_Gonz=C3=A1lez_Collado?= Date: Sun, 15 Jan 2023 10:47:39 +0100 Message-ID: Subject: Re: [PATCH 2/3] rust: arch/um: Disable FP/SIMD instruction to match x86 To: David Gow Cc: Miguel Ojeda , =?UTF-8?Q?Bj=C3=B6rn_Roy_Baron?= , Richard Weinberger , Anton Ivanov , Johannes Berg , Thomas Gleixner , Ingo Molnar , Nathan Chancellor , Nick Desaulniers , rust-for-linux@vger.kernel.org, linux-um@lists.infradead.org, llvm@lists.linux.dev, linux-doc@vger.kernel.org, kunit-dev@googlegroups.com, x86@kernel.org, linux-kernel@vger.kernel.org, Wedson Almeida Filho , Gary Guo , Brendan Higgins , Daniel Latypov , Jonathan Corbet Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 17 Dec 2022 at 05:49, David Gow wrote: > > The kernel disables all SSE and similar FP/SIMD instructions on > x86-based architectures (partly because we shouldn't be using floats in > the kernel, and partly to avoid the need for stack alignment, see: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D53383 ) > > UML does not do the same thing, which isn't in itself a problem, but > does add to the list of differences between UML and "normal" x86 builds. > > In addition, there was a crash bug with LLVM < 15 / rustc < 1.65 when > building with SSE, so disabling it fixes rust builds with earlier > compiler versions, see: > https://github.com/Rust-for-Linux/linux/pull/881 > > Signed-off-by: David Gow > --- > arch/x86/Makefile.um | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/arch/x86/Makefile.um b/arch/x86/Makefile.um > index b3c1ae084180..d2e95d1d4db7 100644 > --- a/arch/x86/Makefile.um > +++ b/arch/x86/Makefile.um > @@ -1,6 +1,12 @@ > # SPDX-License-Identifier: GPL-2.0 > core-y +=3D arch/x86/crypto/ > > +# > +# Disable SSE and other FP/SIMD instructions to match normal x86 > +# > +KBUILD_CFLAGS +=3D -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx > +KBUILD_RUSTFLAGS +=3D -Ctarget-feature=3D-sse,-sse2,-sse3,-ssse3,-sse4.1= ,-sse4.2,-avx,-avx2 > + > ifeq ($(CONFIG_X86_32),y) > START :=3D 0x8048000 > > -- > 2.39.0.314.g84b9a713c41-goog > Reviewed-by: Sergio Gonz=C3=A1lez Collado