Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3324231ybi; Fri, 19 Jul 2019 01:19:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqzy0dAMxi6X0gIr2YZrPX20JFLzaGCeiZ8op4qFb9F9FzmUQlZI2LCJpFCw29RHQNwifZsc X-Received: by 2002:a17:90a:2385:: with SMTP id g5mr57627032pje.12.1563524342359; Fri, 19 Jul 2019 01:19:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563524342; cv=none; d=google.com; s=arc-20160816; b=shlrrg9tme7Y70yuW/6ar+S5otEBB0aHOjJh7MOYjSnl+QKnTKwLiyVGRguIy4OUSF uRh8e+eGb+CnJfbAVaw5aSO9oeir5lRq3W6IUZp+TjvjJ6vqnxzDoGIGqfUsXGG/NXGc NKcE7ROJBqsfXJ3DErwVgouj0+k5FDj0OeD96CHSoZQtnxjBB5IyLypCP66o2+cPvUqT fJoGMsmyKIBoxnvqD6ushopiiKrUPYgIuJHBxIWdVG66JeCSlKxboUM0Wqv1Ov+6yTo+ qWhoM3D/NzqEnfrGq3lfecYvK2UI27MOyvE7K4BFDVIRULG6sP03NhK0elDHsNsrNjXg graA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=/N0fwQUf+LFvYWyDwHukfaEU87+mI1t965IcqrX5RhE=; b=zrXRVEFtb5yO44pCpo1B7AW6XNZcGaFHpqmRS238dCNxu928z1VmHA/gCUskR8Ijh1 gcmhnbIFf1sU3Is3NCO+GvBotrIAL3oeueF+niBZ+Z7awR07Z/z0eKlw98RPGolHwhPT h7IYyx65klnUwIFzbK1wWFO2DGv1fq+Y7uDTWExxI/MHqqVNpVU+03XVSk5XN+TJ6tY+ +Mcb2VQXYgi8ec0PjzZY2Z3QJCEQKIQJRJJOxl3gd1gV23G10iQvdEvwQeCObfU0NOaa 3FwZmDj/XKH/URwK9D4ob3stZmfD/g48C7L3ZA9s7JNJBZK4H7LX71kbFMuIIGH/hJ10 y+/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=v2decXNu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m12si1473746pfa.81.2019.07.19.01.18.46; Fri, 19 Jul 2019 01:19:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=v2decXNu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726410AbfGSIRo (ORCPT + 99 others); Fri, 19 Jul 2019 04:17:44 -0400 Received: from merlin.infradead.org ([205.233.59.134]:50546 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725853AbfGSIRn (ORCPT ); Fri, 19 Jul 2019 04:17:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=/N0fwQUf+LFvYWyDwHukfaEU87+mI1t965IcqrX5RhE=; b=v2decXNuCTpVdF6+CgRLhcO3L jHU+Qf9NVcoLiWtFL/ZtApdPGMJaG6QP8YBPEIVkRBL3qQxANVMrXF7vJ54m3hEXjatalIBx95WjK 55KCOmUjp4QyLDFlm21HP1wLl8TTUI7xrYS9BLbRteSH7GBMV7uvjxFDeXSrRK1nehlP4HtepoZQB u+phEYp/CcpqadxUr7EiUVLmw8rIQVfKnYDe2shYNV89Yex3x+09WSI7QWHv3hbPO7fT74CJDx6kq coPMV/5T8E1VsRPJjrmDRCaCYUMXoDU8xd1LvSKjgQV2v7P93izlo4kHGjE9cTo0Vab+Ws2Swoq/M oJbjwiszQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1hoO57-0004wo-JA; Fri, 19 Jul 2019 08:17:34 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 558B820BA5401; Fri, 19 Jul 2019 10:17:32 +0200 (CEST) Date: Fri, 19 Jul 2019 10:17:32 +0200 From: Peter Zijlstra To: Nick Desaulniers Cc: Vaibhav Rustagi , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , LKML , Vivek Goyal , "# 3.4.x" Subject: Re: [PATCH 1/2] x86/purgatory: add -mno-sse, -mno-mmx, -mno-sse2 to Makefile Message-ID: <20190719081732.GF3419@hirez.programming.kicks-ass.net> References: <20190718000206.121392-1-vaibhavrustagi@google.com> <20190718000206.121392-2-vaibhavrustagi@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 18, 2019 at 02:34:44PM -0700, Nick Desaulniers wrote: > On Wed, Jul 17, 2019 at 5:02 PM Vaibhav Rustagi > wrote: > > > > Compiling the purgatory code with clang results in using of mmx > > registers. > > > > $ objdump -d arch/x86/purgatory/purgatory.ro | grep xmm > > > > 112: 0f 28 00 movaps (%rax),%xmm0 > > 115: 0f 11 07 movups %xmm0,(%rdi) > > 122: 0f 28 00 movaps (%rax),%xmm0 > > 125: 0f 11 47 10 movups %xmm0,0x10(%rdi) > > > > Add -mno-sse, -mno-mmx, -mno-sse2 to avoid generating SSE instructions. > > > > Signed-off-by: Vaibhav Rustagi > > --- > > arch/x86/purgatory/Makefile | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/arch/x86/purgatory/Makefile b/arch/x86/purgatory/Makefile > > index 3cf302b26332..3589ec4a28c7 100644 > > --- a/arch/x86/purgatory/Makefile > > +++ b/arch/x86/purgatory/Makefile > > @@ -20,6 +20,7 @@ KCOV_INSTRUMENT := n > > # sure how to relocate those. Like kexec-tools, use custom flags. > > > > KBUILD_CFLAGS := -fno-strict-aliasing -Wall -Wstrict-prototypes -fno-zero-initialized-in-bss -fno-builtin -ffreestanding -c -Os -mcmodel=large > > +KBUILD_CFLAGS += -mno-mmx -mno-sse -mno-sse2 > > Yep, this is a commonly recurring bug in the kernel, observed again > and again for Clang builds. The top level Makefile carefully sets > KBUILD_CFLAGS, then lower subdirs in the kernel wipe them away with > `:=` assignment. Invariably important flags don't always get re-added. > In this case, these flags are used in arch/x86/Makefile, but not here > and should be IMO. Thanks for the patch. Should we then not fix/remove these := assignments?