From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 89609C433E2 for ; Tue, 15 Sep 2020 20:53:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0960A20809 for ; Tue, 15 Sep 2020 20:53:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alien8.de header.i=@alien8.de header.b="DENOFQtQ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728011AbgIOUxr (ORCPT ); Tue, 15 Sep 2020 16:53:47 -0400 Received: from mail.skyhub.de ([5.9.137.197]:46964 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726485AbgIOUt1 (ORCPT ); Tue, 15 Sep 2020 16:49:27 -0400 Received: from zn.tnic (p200300ec2f0e42002ec71013b50744b4.dip0.t-ipconnect.de [IPv6:2003:ec:2f0e:4200:2ec7:1013:b507:44b4]) (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 C1D641EC0268; Tue, 15 Sep 2020 22:49:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1600202960; 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:in-reply-to:in-reply-to: references:references; bh=vH46LhzdOZ1oCzajIbFfe30UVDSp308nP3FSPhHESeg=; b=DENOFQtQn88IXm7pPSvRYkvJK83BCfFBVVLbL8p63mlqbG5uJBoglLOaHYvbqHHiYAIPOs HMcCu4cVuiDb9gRKzxWrtWswW1/8XmFcuzV1AmY1DltbxrYRsyIjPdW14khiQMWh+4g+mA 0RFQ+R6DpzaWvwMcaAAxmoA8k9t4rTw= Date: Tue, 15 Sep 2020 22:49:12 +0200 From: Borislav Petkov To: Nick Desaulniers Cc: Josh Poimboeuf , Rong Chen , kernel test robot , "Li, Philip" , x86-ml , LKML , clang-built-linux , Marco Elver Subject: Re: [tip:x86/seves] BUILD SUCCESS WITH WARNING e6eb15c9ba3165698488ae5c34920eea20eaa38e Message-ID: <20200915204912.GA14436@zn.tnic> References: <5f60c4e0.Ru0MTgSE9A7mqhpG%lkp@intel.com> <20200915135519.GJ14436@zn.tnic> <20200915141816.GC28738@shao2-debian> <20200915160554.GN14436@zn.tnic> <20200915170248.gcv54pvyckteyhk3@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 15, 2020 at 01:12:24PM -0700, Nick Desaulniers wrote: > 1 warning: objtool: ist_exc_vmm_communication()+0x12: unreachable instruction That looks interesting. So your .o has: 00000000000004c0 : 4c0: 55 push %rbp 4c1: 48 89 e5 mov %rsp,%rbp 4c4: 48 c7 c7 00 00 00 00 mov $0x0,%rdi 4cb: 31 c0 xor %eax,%eax 4cd: e8 00 00 00 00 callq 4d2 4d2: 0f 0b ud2 4d4: 66 66 2e 0f 1f 84 00 data16 nopw %cs:0x0(%rax,%rax,1) 4db: 00 00 00 00 4df: 90 nop And the unreachable insn is at 0x4d2. The version I got when building with clang12 built from git of today is: 00000000000003e0 : 3e0: 55 push %rbp 3e1: 48 89 e5 mov %rsp,%rbp 3e4: 48 c7 c7 00 00 00 00 mov $0x0,%rdi 3eb: 31 c0 xor %eax,%eax 3ed: e8 00 00 00 00 callq 3f2 3f2: 66 66 2e 0f 1f 84 00 data16 nopw %cs:0x0(%rax,%rax,1) 3f9: 00 00 00 00 3fd: 0f 1f 00 nopl (%rax) and that version is calling a bunch of NOPs. gcc produces: 00000000000002aa : 2aa: 55 push %rbp 2ab: 48 c7 c7 00 00 00 00 mov $0x0,%rdi 2b2: 48 89 e5 mov %rsp,%rbp 2b5: e8 00 00 00 00 callq 2ba 2ba: 66 0f 1f 44 00 00 nopw 0x0(%rax,%rax,1) (Btw, clang doesn't need to add that "xor %eax,%eax" - panic() should not be returning, ever. :-)) So what that call actually is, is: # arch/x86/kernel/sev-es.c:1342: panic("Can't handle #VC exception from unsupported context\n"); call panic # and the address of panic() gets fixed up by the linker into: ffffffff83066dca : ffffffff83066dca: 55 push %rbp ffffffff83066dcb: 48 c7 c7 08 4f e2 83 mov $0xffffffff83e24f08,%rdi ffffffff83066dd2: 48 89 e5 mov %rsp,%rbp ffffffff83066dd5: e8 52 23 ff ff callq ffffffff8305912c ffffffff83066dda: 66 0f 1f 44 00 00 nopw 0x0(%rax,%rax,1) But your compiler generates a call to UD2. Interesting. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette