Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3746387rwb; Fri, 16 Dec 2022 21:45:26 -0800 (PST) X-Google-Smtp-Source: AA0mqf5pNzGsCB+ulqPNcC6g3GAAnjj+UdCA85fpFKI6dwo30Jfh80VHP1lfcZNEq3eHrZ5PRIPU X-Received: by 2002:a17:902:bb8b:b0:188:760f:d831 with SMTP id m11-20020a170902bb8b00b00188760fd831mr33781488pls.7.1671255926676; Fri, 16 Dec 2022 21:45:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671255926; cv=none; d=google.com; s=arc-20160816; b=eiTkkhi7KyOHfZ5bik3ecAhs9xrhDlrgJ+9kL8Kh9ANwyp2+OivZhpgqi4aPNhhRM8 3SDKVTD5ykPEJOZczlJjI9PRws9Q5azmnp5s+2onA/KEPhClx9dJRkb96KKR2xTtzdV8 RONM/pxstAV+8zbmRU+XbyJqlYx/6TGkzduLfiZKFmNCklHgAuxSSU6BU1dv90HHoavc JHRZBfHHOCGC6cbB1SRrVH5fk1N0EQHLh6orHc99QXEWeRYLfE0l3DeeZpojgk6TWKqf H6HhVN0uGgTEZ3WHQZNGeTTYamGj2Xyd118KXAIl+yknvxo7H6ZVOfYvGFw3xv542RPS Lgmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=Jwt0kX7GS9Jckw+q61cDxTvmoFnclM/QaQDYT1WYliI=; b=Cpeb2/RMqm/XSJcOzd5XYzkfNloWjKl6mjHZXUujX6Pfw323OccgHNBFLVfdJMONcY DAAnI+2lR6179gnpN1C4K7/rMwFYgKSjc3jl/mW3F8kSsvzzGeL+/UOudy5HfjAKZRqQ kz/VUpz0A9VmZ33UghRVNjWQ8y2kE2monKNJj+5ap+lJtp0eaS9cIuTsgri9UswHXzSE 8q2TI4sfGLVDVh48PhILzt7kW7pdJgfoGNd1CcaHbMRik1V2UnWkz8YqrokRxIYqSkvU GnsA2yVVGQFntIDNLDvrWq+Ic7bx728luMdxDdioZo9arbjOjzQYZkoEed2Wyis4o6Xn kbxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=RQ2MUmTt; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d1-20020a170902cec100b001895031955bsi4953796plg.576.2022.12.16.21.45.17; Fri, 16 Dec 2022 21:45:26 -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=@google.com header.s=20210112 header.b=RQ2MUmTt; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230123AbiLQEpF (ORCPT + 69 others); Fri, 16 Dec 2022 23:45:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230108AbiLQEoy (ORCPT ); Fri, 16 Dec 2022 23:44:54 -0500 Received: from mail-pf1-x449.google.com (mail-pf1-x449.google.com [IPv6:2607:f8b0:4864:20::449]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7126939444 for ; Fri, 16 Dec 2022 20:44:53 -0800 (PST) Received: by mail-pf1-x449.google.com with SMTP id z8-20020aa79588000000b00576e8050ec9so2488673pfj.5 for ; Fri, 16 Dec 2022 20:44:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=Jwt0kX7GS9Jckw+q61cDxTvmoFnclM/QaQDYT1WYliI=; b=RQ2MUmTtopYEBs/CsWjtSAyRTvbAwWSpFqzIOEJodjsQaoaickkjjJcJM86W1PRm4+ L00WYFsnPLw6RPqkS5rZvaE70xfTxfyUMv79omPJp5QGU1h3uXSb9yo+1im3ScqkawMg 0B/OSMYKVttHgeP6PUEHZ/S/2Jj599bUE4n3VDzeHY6bvfvlw0RfzPSQoVlRq1hzGggA 17Q3yPTaMCL+y8dA9cjPe9lauNt+Cbb2UIEfwfJxjJ1rkiA/H6bAYxnVN2t3EqHd9pgc /PwIwuBDmPZlDtujda8rUptA0z951PK+Z8zZA/JQkFcBA3vT92ThAInyxKet9KPswEsB RkDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Jwt0kX7GS9Jckw+q61cDxTvmoFnclM/QaQDYT1WYliI=; b=bTY2ALdXyvH+bGl93vUmGGvtLVL1v8l14DE7AwWH32hzq+2j1g5t83f3pPB8mMt82N TnJJd/U4alMKG5sl5vnStpENFAhBElODuYGPoHl4cLHyfTJ/LuDZiJNcuGrX7V0rw0w4 3wTFxHTCdArUxx3FyXVmE3oZbe/PIKjLwT48H53T2rJ9XDhrHX7F2yi951gbiKEKsk4e YrTFPlHk9Yw8CF9ba7iqvwsp/JtJ30Szt4+AHHBr9nJVaDf/rZ+Ahuo7UiA4MJxurlH4 4ptJfpaQCcWMFu9Tp0oGm6RWRlYeVSC4DQyPGWB/2yrt4bjcs0BW2VDdSrdLlFDUFKYb m4EQ== X-Gm-Message-State: ANoB5pnPaaGMzGQNOZPnnlh06gQ6ZQK+wdlwIkdA9Ce9KGxPvYrRQGeA yNWQE6SuGjvCLrhhSTrW4itE3UKIV6KxaA== X-Received: from slicestar.c.googlers.com ([fda3:e722:ac3:cc00:4f:4b78:c0a8:20a1]) (user=davidgow job=sendgmr) by 2002:aa7:85cb:0:b0:575:871f:2e7a with SMTP id z11-20020aa785cb000000b00575871f2e7amr4562595pfn.35.1671252293098; Fri, 16 Dec 2022 20:44:53 -0800 (PST) Date: Sat, 17 Dec 2022 12:44:35 +0800 In-Reply-To: <20221217044436.4138642-1-davidgow@google.com> Mime-Version: 1.0 References: <20221217044436.4138642-1-davidgow@google.com> X-Mailer: git-send-email 2.39.0.314.g84b9a713c41-goog Message-ID: <20221217044436.4138642-3-davidgow@google.com> Subject: [PATCH 2/3] rust: arch/um: Disable FP/SIMD instruction to match x86 From: David Gow To: Miguel Ojeda , "=?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?=" , Richard Weinberger , Anton Ivanov , Johannes Berg , Thomas Gleixner , Ingo Molnar , Nathan Chancellor , Nick Desaulniers Cc: David Gow , 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" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL 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 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=53383 ) 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 += arch/x86/crypto/ +# +# Disable SSE and other FP/SIMD instructions to match normal x86 +# +KBUILD_CFLAGS += -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx +KBUILD_RUSTFLAGS += -Ctarget-feature=-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-avx,-avx2 + ifeq ($(CONFIG_X86_32),y) START := 0x8048000 -- 2.39.0.314.g84b9a713c41-goog