Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp910769ybz; Wed, 22 Apr 2020 10:05:20 -0700 (PDT) X-Google-Smtp-Source: APiQypIXf71dHQvlb2fvZou9k/rWtqjCVeEhFLdqi7VPHI4k6/nDUKTGVP57s0lPzjbWRE3xkzrk X-Received: by 2002:a17:906:4f03:: with SMTP id t3mr26101408eju.254.1587575120068; Wed, 22 Apr 2020 10:05:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587575120; cv=none; d=google.com; s=arc-20160816; b=iTbCFHdyCvORkviEFszbfBDNh2wbUIHo1swmBIh3HFkvyuzzCMv1y6yRe4T+FbIpPR l304GabvrkQOQrIOO3lujRo8WcATSfSuBYPKybJSMTLroTpIV4uf8BZcIkCvMTbWFDAN 6QvOaB7khV/wUozvQDQ4Sn2qF8pfoOQTPa2j25SKRY0g0H5gKEz3poDLzdpCd+ab1RMv l6gzumyPpxkWGxQxXoeZ3DqrIrGzpfwI8AtJvSts5shZsrCEU4ERDKRGk5HQ/JSllV19 vcMeZI/YTWXn6LgZ83p7TP+WovZVs6Ogjv40Wp4WcAHkXOl3indEuNc5BsiEFKNDJjj2 HIOw== 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:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=K+Vw95hzbBrvACE7p1+DGBuatgWYBdD+qziGcMPXbJ0=; b=xCIkaRPLBcUeHDIUXwIU98o6Ab4TqvgkVySn43wZq29X3gVUt83CLge8RcAp6SIfRJ aVrOFWbHwBiFPLrSsb6hBynYWDYtNwyUHMzoPleP0eFzi98LU8rTLLU6Hk5s+16b0kWV KAS2r7qSrTsEVNbUCb8VMk/WCZCiB/wJKs37q67UGtIhekq36r9n1pe1AwPn7SU0Z2+y IDqK0KxtHz09MhGgujtLgD03CNdTq9sxpb8l4Da7pyakxA2ZhcMlfdmev94FlXBIPH99 wifUXIe5FMbfboDFhKDVU0kErpLOJYQVlwJs5H/QNZzxHLh6gksP8hBxS3mIv301HAkj NKdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=AxpNiQo8; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 27si3847387ejx.245.2020.04.22.10.04.41; Wed, 22 Apr 2020 10:05:20 -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=@redhat.com header.s=mimecast20190719 header.b=AxpNiQo8; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726855AbgDVRDf (ORCPT + 99 others); Wed, 22 Apr 2020 13:03:35 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:36313 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726147AbgDVRDf (ORCPT ); Wed, 22 Apr 2020 13:03:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587575014; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=K+Vw95hzbBrvACE7p1+DGBuatgWYBdD+qziGcMPXbJ0=; b=AxpNiQo8cNoISyIjci7l1IYB8ofUH+5fXJ8zb2Oql6BO1cNCl3lAgIorGo9bIkQ3NfCGc8 Eg2skCy+AUHlfDx64m3+tUkp18h2Mbq3y3pubZ6rJOlOUTKHT1sZySD1UklXySw1ByhEN1 uvbZQPV9kmxc1so2hb5xVKg0ufkrnr8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-87-HYUCnAmwNdGbaFJx3Q681A-1; Wed, 22 Apr 2020 13:03:28 -0400 X-MC-Unique: HYUCnAmwNdGbaFJx3Q681A-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 88DD918B9FC3; Wed, 22 Apr 2020 17:03:26 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-112-104.ams2.redhat.com [10.36.112.104]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 231BE10190D6; Wed, 22 Apr 2020 17:03:25 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id 03MH3AfF003682; Wed, 22 Apr 2020 19:03:15 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id 03MH2pcI003681; Wed, 22 Apr 2020 19:02:51 +0200 Date: Wed, 22 Apr 2020 19:02:51 +0200 From: Jakub Jelinek To: Borislav Petkov Cc: Martin =?utf-8?B?TGnFoWth?= , 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: <20200422170251.GQ2424@tucnak> Reply-To: Jakub Jelinek 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> <20200422165339.GE26846@zn.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200422165339.GE26846@zn.tnic> User-Agent: Mutt/1.11.3 (2019-02-01) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 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 06:53:39PM +0200, Borislav Petkov wrote: > > $ 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. If it is x86 specific, it can work, though I'd suggest -o - instead of -o/dev/stdout and being more picky on where you want to match the jmp, as you don't want to match it in comments, or say filenames in the asm file etc. E.g. require that jmp must be preceeded on the line only by whitespace and followed by whitespace. Jakub