Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp899914ybz; Wed, 22 Apr 2020 09:55:05 -0700 (PDT) X-Google-Smtp-Source: APiQypI4Nz7LWA2DOtEzg86ledw4wDNqVtFapQR/Je6V5jNberDDzpAi4QpSe8n0/pBOy8lcrF8z X-Received: by 2002:a17:906:5601:: with SMTP id f1mr26132245ejq.152.1587574504791; Wed, 22 Apr 2020 09:55:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587574504; cv=none; d=google.com; s=arc-20160816; b=PpZg5fSNsJHwRS7Pcfl0tzTrH2pkKrwAFt5AgdZ6Ydg0IFnwIvEFu/xD/FRTJRwZHi qmV+Wgk+tybGaxCOFhk/yB0xkYBc09M/Fr8/n+qenZX3eA5gZSrCI+dBJygABPSBKQtc koXjxusVGKMKQ7dNnOKWGGRLxfRozSlS/Qhn/Bv10m2h4bz1VyGn2wiJxtvSR1tSl68g ehml2lwo9S0WA+R1POEJ7nxqwLvn2+1FiipNJ1LEaMQ/XZTP2YkdJwnDU5+KBa2RpB1g 0Q6OL1ASa8AnYACyE8N/bWunIQGsYUDofq3xxQRD8HMbUkEgknoOvv4tAu5vK7UrdVpG Zphg== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=AVKnR0QOloA4aew99lOCASo2crQf98GdsdZcG1lVtB8=; b=GnlQE0JvCf52uKyXH5M+RY3QWuyf8iHfSwuirBkKDOSOTeYZV+3/lL8ZlM77gb7Xg8 pNykDOkyKqNOqnhS+snSjLy7NXMOj4Wvnb2au9uP7aK05vuON5qhP8ezNLO9dJrKmw7A vK73tWpKJjmeilSF+uLN5uDZqfJz/I2O1VsFVNgeuwXOmOfMhd1Jv6QHKkExmy5cd6jY Li0lLp2r3rcwcTlc/5h4AjK/3eIC1wNlIDYHlOmIWq2nN0DB9JHMLEqGjM+kQOlzaVn9 50Hi5GL8kQgdL6rqA1ugL9iNPrvEJadIm/Yps1M+Av6ZvEKVF7dLQLy31CLZpvmqTKXV f1DQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=NZV5+Dl7; 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 v19si3844314edr.209.2020.04.22.09.54.41; Wed, 22 Apr 2020 09:55:04 -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=NZV5+Dl7; 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 S1726429AbgDVQxk (ORCPT + 99 others); Wed, 22 Apr 2020 12:53:40 -0400 Received: from mail.skyhub.de ([5.9.137.197]:47074 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726057AbgDVQxk (ORCPT ); Wed, 22 Apr 2020 12:53:40 -0400 Received: from zn.tnic (p200300EC2F0DC10099981D244BC6B235.dip0.t-ipconnect.de [IPv6:2003:ec:2f0d:c100:9998:1d24:4bc6:b235]) (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 4D8651EC0D4E; Wed, 22 Apr 2020 18:53:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1587574419; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AVKnR0QOloA4aew99lOCASo2crQf98GdsdZcG1lVtB8=; b=NZV5+Dl7EGPIw4/KYqCmncuiKXzr+/gOLUTmaT8wOqxBvX8e+PWKV1dAcT6trRB/UeHZog KN/sfzwnFChYC14r48VTkq18iy3W+iymCDt9wAGMDyR22A0A7Xgs7/Nrnl39oWMyfUTKY2 +RerxXb8IfTmBm4AVFmg1+zCt9jBEOE= Date: Wed, 22 Apr 2020 18:53:39 +0200 From: Borislav Petkov To: Martin =?utf-8?B?TGnFoWth?= Cc: Jakub Jelinek , Peter Zijlstra , Nick Desaulniers , Michael Matz , Sergei Trofimovich , LKML , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Andy Lutomirski , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , clang-built-linux Subject: Re: [PATCH v2] x86: fix early boot crash on gcc-10 Message-ID: <20200422165339.GE26846@zn.tnic> References: <20200417190607.GY2424@tucnak> <20200422102309.GA26846@zn.tnic> <20200422114007.GC20730@hirez.programming.kicks-ass.net> <20200422134924.GB26846@zn.tnic> <20200422135531.GM2424@tucnak> <20a91f2e-0f25-8dba-e441-3233cc1ef398@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20a91f2e-0f25-8dba-e441-3233cc1ef398@suse.cz> 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 Wed, Apr 22, 2020 at 04:16:53PM +0200, Martin Liška wrote: > And as I talked to Boris, I would recommend to come up with a "configure" check > that a compiler does not optimize the key code sequence: > > $ cat asm-detect.c > int foo(int a); > int bar(int a) > { > int r = foo(a); > asm (""); > return r; > } > > $ gcc -O2 -c asm-detect.c -S -o/dev/stdout | grep jmp > [no output] That is a good test to run at the beginning of the compilation I guess. Without the asm("") it produces: bar: .LFB0: .cfi_startproc jmp foo@PLT .cfi_endproc I'd like for LLVM folks to confirm that this is a good test for LLVM too Trying that here with clang gives: bar: # @bar .cfi_startproc # %bb.0: jmp foo # TAILCALL .Lfunc_end0: so this *looks* like it would work with LLVM too but I might be missing something... Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette