Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp1366350imi; Sat, 23 Jul 2022 03:48:50 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uHnFMclV23RfR2pEZqGY+ltG/lQ5KOEcmqDw0JOvT+0FuRzmJHBt2Z2FEIGivbYePDmucF X-Received: by 2002:a05:6402:11c9:b0:43b:b905:cb88 with SMTP id j9-20020a05640211c900b0043bb905cb88mr3860066edw.102.1658573329873; Sat, 23 Jul 2022 03:48:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658573329; cv=none; d=google.com; s=arc-20160816; b=BfUU2w2hRGM9TInPK1mDuKvQr8Cz9HqL8pd8JcBSbeYWlI9gl2f9oBBwFRUwXAjxxh zSRTFNm8juiYZthhnp73T5HfIcRpJaSTCPmA3GUvdZgQop1EKCMXgc1CAJaBl86iMUMG HdahGaTdEG5g3oC/oK4Z1yLKS7wa6af5x3sHMIuOhCQJLNWc0ncI6bVElQ2MfZpqOxzx zJ9V32CBffVAdlVBCvBuXE7oP0Dx7lHy4kH74emwTeHleOLmgDlUiXeYgeJuAjFgcisO Px3lRirLFnRa3GRYi2HYtdtF9bx4BhqIWl+srPh1Y55Jzos8oXR5xlyUugqwxBYFSEM6 8gGw== 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=7esPN++sHn2PlrrIJ2uMTsZN9y1n7eWrB08exLB2zZU=; b=WgTqbNEuvVPmIAa/Ywve1p/kKy/qGYT+DdZKkfyMzJa+1XAkHeieqyFIxjynARLuBz Q7uOUue/MBO0zWcTAwEqB0FNUjGp/9JxRuoc/ZmHWC+ZLNxLU/f5AXIK6lKnbYEVL8ae zZbVLGEBeB9mbK4w1h4ohZ3SB2HHntqSskNqEWFFV0T4ztUVS+aPeIVp8XFnKObIYGOF OlPFaj0yR95Ok6F3m4KhFX0wmI7UreyC8+ybUpXf9vDOjQciojJhXUoUcXTs1qWNOM+t kGOqawjG8C+ePtAu9TnRWueAdzY5p2PmmLj30iZuJY5KBlieXYEs5mdUhJoZT5MD3HA+ VECg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tJc7e3WA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g13-20020a1709065d0d00b0072ee7a299f5si9143504ejt.19.2022.07.23.03.48.24; Sat, 23 Jul 2022 03:48:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tJc7e3WA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S239537AbiGWKNe (ORCPT + 99 others); Sat, 23 Jul 2022 06:13:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239535AbiGWKNN (ORCPT ); Sat, 23 Jul 2022 06:13:13 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9ABEE8B4A2; Sat, 23 Jul 2022 03:03:54 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id C131DB82C1B; Sat, 23 Jul 2022 10:03:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0BE96C341C0; Sat, 23 Jul 2022 10:03:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1658570605; bh=zMPVrNhp/F3QfRcx1IwmUr2ts61b2A89EFn63wrxbtY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tJc7e3WAQ9MG/JsLo6JpnxCMs5Gwr+Pa/wESpXLKykzDY2lOJnHWeN7OibGB4Jtb9 HwwgrQTj3toxmQ4UPItVA2qFURaAwNm4eEHo2Hbf8hEGJPIQzmogQYmz+skSEec5To o8t3X5PdZ8vyfcy8sV5+ra38rEg+EZX5FmT6UWjk= 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 Subject: [PATCH 5.10 145/148] kvm: fix objtool relocation warning Date: Sat, 23 Jul 2022 11:55:57 +0200 Message-Id: <20220723095304.971051168@linuxfoundation.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220723095224.302504400@linuxfoundation.org> References: <20220723095224.302504400@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Linus Torvalds commit 291073a566b2094c7192872cc0f17ce73d83cb76 upstream. 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: Greg Kroah-Hartman --- arch/x86/kvm/emulate.c | 1 - 1 file changed, 1 deletion(-) --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -452,7 +452,6 @@ static int fastop(struct x86_emulate_ctx ".skip " __stringify(SETCC_ALIGN) " - (.-" #op "), 0xcc \n\t" asm(".pushsection .fixup, \"ax\"\n" - ".global kvm_fastop_exception \n" "kvm_fastop_exception: xor %esi, %esi; " ASM_RET ".popsection");