Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750879AbdL2VwM (ORCPT ); Fri, 29 Dec 2017 16:52:12 -0500 Received: from puleglot.ru ([78.47.112.147]:44294 "EHLO puleglot.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750741AbdL2VwK (ORCPT ); Fri, 29 Dec 2017 16:52:10 -0500 Message-ID: <1514584257.28262.13.camel@tsoy.me> Subject: Re: 4.14.9 with CONFIG_MCORE2 fails to boot From: Alexander Tsoy To: Linus Torvalds Cc: Dave Hansen , Greg KH , Andy Lutomirski , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Boris Ostrovsky , Borislav Petkov , Borislav Petkov , Brian Gerst , Dave Hansen , David Laight , Denys Vlasenko , Eduardo Valentin , Greg KH , "H. Peter Anvin" , Josh Poimboeuf , Juergen Gross , Peter Zijlstra , Rik van Riel , Will Deacon , "Liguori, Anthony" , Daniel Gruss , Hugh Dickins , Kees Cook , Kernel Mailing List , stable Date: Sat, 30 Dec 2017 00:50:57 +0300 In-Reply-To: References: <1514453602.6251.8.camel@tsoy.me> <20171229091741.GC18441@kroah.com> <1514557888.28262.1.camel@tsoy.me> <1514558513.28262.3.camel@tsoy.me> <1b4569ee-8c06-4480-447b-2af8f6804053@intel.com> <1514578936.28262.11.camel@tsoy.me> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.6 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1896 Lines: 45 В Пт, 29/12/2017 в 12:34 -0800, Linus Torvalds пишет: > On Fri, Dec 29, 2017 at 12:22 PM, Alexander Tsoy > wrote: > > > But double-checking that "-march=core2" case is definitely worth > > > looking into. Especially since there are clear indications that > > > it's > > > gcc version-dependent anyway. Alexander? > > > > Yes, the change suggested by Dave makes the problem go away. > > Ok, that's good information. > > It doesn't really explain *why* that commit 7f2590a110b8 > ("x86/entry/64: Use a per-CPU trampoline stack for IDT entries") ends > up being sensitive to that compiler option, though. > > So it narrows the cause down, but it doesn't really root-cause the > problem. It tends to be almost impossible to find differences in code > generation, because they are generally all over. > > Ho humm. What happens if you change the "-march=core2" to > "-mtune=core2"? Does it still boot? > > Because maybe the actual differences that "-march=core2" generates > might be easier to see when compared to "-mtune=core2". That's interesting. Compiled with -mtune=core2, the kernel fails to boot. diff --git a/arch/x86/Makefile b/arch/x86/Makefile index 3e73bc255e4e..f4d8f9497666 100644 --- a/arch/x86/Makefile +++ b/arch/x86/Makefile @@ -127,8 +127,7 @@ else          cflags-$(CONFIG_MK8) += $(call cc-option,-march=k8)          cflags-$(CONFIG_MPSC) += $(call cc-option,-march=nocona)   -        cflags-$(CONFIG_MCORE2) += \ -                $(call cc-option,-march=core2,$(call cc-option,- mtune=generic)) +        cflags-$(CONFIG_MCORE2) += $(call cc-option,-mtune=core2)     cflags-$(CONFIG_MATOM) += $(call cc-option,-march=atom) \         $(call cc-option,-mtune=atom,$(call cc-option,-mtune=generic))          cflags-$(CONFIG_GENERIC_CPU) += $(call cc-option,- mtune=generic)