Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp3963852pxb; Mon, 4 Oct 2021 13:50:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwlymEOLQrlrwckQ6lY1Rez+YAwSA5DdYyKiqfMeWESq+84HsK9xasLwHN6RlpFD7pn0y98 X-Received: by 2002:a17:906:c014:: with SMTP id e20mr20111971ejz.166.1633380653889; Mon, 04 Oct 2021 13:50:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633380653; cv=none; d=google.com; s=arc-20160816; b=khtXT3KJoq60admxulAKH0+Arb5YWTPVPJWEeQ6kByjOUkazWO2Vx1PMbCZyJWS8HC 17dSn48S/8HH8bR9cA5r6KE5wllFzT41b+5JuqDf/a6orTnqzJC942ah2DF6sCRgTpUn lVijVLdQ5M9V6bsfU+BGTxQkiaB0fVXgzF6Qh3zNxjkcbYccIFr2mx/ZEfXjRVa50n73 fIeqoToHOiHdBXP6PcFK8B1somOe2LrBCv64lERpu+tlAebq5c7CTJZBASmX4feo5tD7 FHV7dVvpzNHlJN7qMeUBCXfDIHJ5bZ2MBP+2z8B9eOpsbScXt9mgI7A8KUaMmCH80eHR pfOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=27lrZRkY8bOMx1nsoL1ppayA7ulMLNMHwIwWpEFLupU=; b=Prw5ILKPDLTGSTUYCSe2Ua4RRqneIdkRLQBa4gubLzZ7+2XfuIuBWPP2Z38v65A2D1 C5Bj0Pr6ksilH6gMSQCBIdGbAWMjYNIcKNb2oG3wDnCF9S2f86LKJo7b38DAlZnkTKSg xO3fnNBsVEjpmnI0vP5kOi0j2jYXGXiG6UUUtVWt7UUvTfX1MAfywCX/rxgPpEtRZ6zS 8CwpQB45kOjTYJjxXY73gCq0R+05UxIDwXUwd43OGOao1vpDQPmzJtnVIvjdinA8xv3d ixvUCNeBXPrYHd7lC2rGQYeu3s6+/rMXVlHO5v1s3LOO7Muu8tWrJyh3NsUg9ags9J2B 81Fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Y4LwBmzH; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hs4si28570777ejc.266.2021.10.04.13.50.30; Mon, 04 Oct 2021 13:50:53 -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=@linuxfoundation.org header.s=korg header.b=Y4LwBmzH; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238608AbhJDNku (ORCPT + 99 others); Mon, 4 Oct 2021 09:40:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:52290 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238578AbhJDNir (ORCPT ); Mon, 4 Oct 2021 09:38:47 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 76C4C6323C; Mon, 4 Oct 2021 13:17:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1633353474; bh=ySpziAZem5KNqlDnou3VwQL1fS/N6AvHf+/pgMkMVQk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y4LwBmzH1JGL4OLoNT+IepK+Ow/6onCv63lYHufJZ1thztKzcg06ltGi3haX09a7F KhaLC8i2kt8jBFCRswGfBN285l/vafN/Gg87GXEcLCjH0TNgN/vIzi6w2VhXRjezjt OshhSjNa2idX+7jy70FjKSivsjgLGLAJctAY18ps= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Borislav Petkov , Paolo Bonzini , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Peter Zijlstra , Josh Poimboeuf , Nathan Chancellor , Linus Torvalds , Sasha Levin Subject: [PATCH 5.14 143/172] kvm: fix objtool relocation warning Date: Mon, 4 Oct 2021 14:53:13 +0200 Message-Id: <20211004125049.582434477@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211004125044.945314266@linuxfoundation.org> References: <20211004125044.945314266@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Linus Torvalds [ Upstream commit 291073a566b2094c7192872cc0f17ce73d83cb76 ] The recent change to make objtool aware of more symbol relocation types (commit 24ff65257375: "objtool: Teach get_alt_entry() about more relocation types") also added another check, and resulted in this objtool warning when building kvm on x86: arch/x86/kvm/emulate.o: warning: objtool: __ex_table+0x4: don't know how to handle reloc symbol type: kvm_fastop_exception The reason seems to be that kvm_fastop_exception() is marked as a global symbol, which causes the relocation to ke kept around for objtool. And at the same time, the kvm_fastop_exception definition (which is done as an inline asm statement) doesn't actually set the type of the global, which then makes objtool unhappy. The minimal fix is to just not mark kvm_fastop_exception as being a global symbol. It's only used in that one compilation unit anyway, so it was always pointless. That's how all the other local exception table labels are done. I'm not entirely happy about the kinds of games that the kvm code plays with doing its own exception handling, and the fact that it confused objtool is most definitely a symptom of the code being a bit too subtle and ad-hoc. But at least this trivial one-liner makes objtool no longer upset about what is going on. Fixes: 24ff65257375 ("objtool: Teach get_alt_entry() about more relocation types") Link: https://lore.kernel.org/lkml/CAHk-=wiZwq-0LknKhXN4M+T8jbxn_2i9mcKpO+OaBSSq_Eh7tg@mail.gmail.com/ Cc: Borislav Petkov Cc: Paolo Bonzini Cc: Sean Christopherson Cc: Vitaly Kuznetsov Cc: Wanpeng Li Cc: Jim Mattson Cc: Joerg Roedel Cc: Peter Zijlstra Cc: Josh Poimboeuf Cc: Nathan Chancellor Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- arch/x86/kvm/emulate.c | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 2837110e66ed..50050d06672b 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -435,7 +435,6 @@ static int fastop(struct x86_emulate_ctxt *ctxt, fastop_t fop); __FOP_RET(#op) asm(".pushsection .fixup, \"ax\"\n" - ".global kvm_fastop_exception \n" "kvm_fastop_exception: xor %esi, %esi; ret\n" ".popsection"); -- 2.33.0