From patchwork Tue Dec 29 21:43:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 11992735 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=-18.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 5FB60C433DB for ; Tue, 29 Dec 2020 21:45:27 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0CA89207CF for ; Tue, 29 Dec 2020 21:45:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0CA89207CF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=V6+2hYsav4yPTFQ3pnYjku1N7CeiC4u4hmQaVuVrOKk=; b=eZeU/U/hh4WrRVtGmj0R7il4Uh Wu/mISBwav3t+0qf6AW5XRJJSvZARW3HRMbVHWPwXYIttttldVr45VRKBY23xHJdk6HKPmxURs1uc +3P+TYvux2vlr8xCvGcJ444zTR3xtSexRtLTcU+dfzOExYRkvfxAlwgzgh6+vZBHjoasZuaAdwDb+ TyKF/AWH53Ek2cJvR+O+QuXTq6FbgybnywJpQBTiyvpT/o2aeGK5FVh4XfK3KilYy1EQbD30G32Rf SLHR6h/pwL5uldPyU4M7Rm94gYkQexQ6IzPzkpUQH0ypeCp/N+Mgciz1mTGWsR4Wm66ss2uovH1Dj oERw1tGw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kuMmU-00062Y-Nv; Tue, 29 Dec 2020 21:43:50 +0000 Received: from mail-qt1-x833.google.com ([2607:f8b0:4864:20::833]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kuMmQ-00061t-QH for linux-arm-kernel@lists.infradead.org; Tue, 29 Dec 2020 21:43:48 +0000 Received: by mail-qt1-x833.google.com with SMTP id 2so9844821qtt.10 for ; Tue, 29 Dec 2020 13:43:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=HyTMgo2VSftHBiDIe/SLp0txxvwc3jI6o6j5ZlWh/dw=; b=f0dILRFveWykzV+Z08AvfOmj26DARStkXTD2rimwgfWkfyVMqtfKDgl3xemZfvShcu wchzqQrdG3m9iLk3zCc2lgOa4be5mWmA4hJxWlc9OIqKOIavkMFv6U0Wjp6biO7jNHxK VMfU2h8EmtfFqiB1wQ3c5h10hPIZ7hfjpQAmzIEK/42ryVwsOtWnfffmx2hRQxlvPRm+ lRPE3BxPkpJITLJ7pTCbUOWEdU8v3PPQzLPhxT2jCXyBltLlN/cFMCVqIUwTYvGWhpfP ahaKWxBfxutvEc4bFDrcIH5LZPJsw0wSv2gcWlpWUfD8WAA4MzYvetKlsExY7T9FmwSZ aFhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=HyTMgo2VSftHBiDIe/SLp0txxvwc3jI6o6j5ZlWh/dw=; b=OlHsA0OLfQJSXjHW8RbFqiSSn04+eq/XMXJ/u1kUU5na32WXypOlrwOpVksvTHqIo9 tOQ6Je3cjZXrLf0zARVCq0NGTXb3QGsTW2Q3cnW69THoGK7iyKOxes+ihh7XF6WcYKh6 5H40M/bOP7+JKbFqxEwyMFSZOzuzaFeH/Ncfo8+xz3PptATjL7bV6rxYObbyAGMLjXDT jMSij7a34A4Re8JYCop1sfso1A6mALZHBdJHV4+LoV/sCycsldILLMP+Vi6yXB+v3bEW 2GZmo+0JFG3yqG3Rx8Qfqx2OwlClljQyXO4VEOnBkH6UgOiAeJtSkKjv3oZmSk+tLrQs GJLg== X-Gm-Message-State: AOAM533ePfQhDvo/t1PF3gA88ZBPBYOs6yzZOjrl9E1d+IWffXI9M4SZ /VktfWoK0aaDkaDooBjUQQM= X-Google-Smtp-Source: ABdhPJxNRqILS8BFoDpnYl60ROLPkm6ALqjECJjXraNE4zHWZETdZN9t0HskLPCKTUrnD0VAHbTDpA== X-Received: by 2002:ac8:1184:: with SMTP id d4mr50229998qtj.103.1609278221078; Tue, 29 Dec 2020 13:43:41 -0800 (PST) Received: from localhost.localdomain ([2604:1380:45f1:1d00::1]) by smtp.gmail.com with ESMTPSA id 17sm25725927qtb.17.2020.12.29.13.43.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Dec 2020 13:43:40 -0800 (PST) From: Nathan Chancellor To: Marc Zyngier Subject: [PATCH] KVM: arm64: Fix section mismatches around hyp_cpu_pm_{init, exit} Date: Tue, 29 Dec 2020 14:43:36 -0700 Message-Id: <20201229214336.4098955-1-natechancellor@gmail.com> X-Mailer: git-send-email 2.30.0 MIME-Version: 1.0 X-Patchwork-Bot: notify X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201229_164347_274668_2C5F59DD X-CRM114-Status: GOOD ( 16.20 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Suzuki K Poulose , Catalin Marinas , linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, James Morse , Julien Thierry , Nathan Chancellor , Will Deacon , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Commit fa8c3d65538a ("KVM: arm64: Keep nVHE EL2 vector installed") inadvertently changed clang's inlining decisions around hyp_cpu_pm_{init,exit}, causing the following section mismatch warnings: WARNING: modpost: vmlinux.o(.text+0x95c6c): Section mismatch in reference from the function kvm_arch_init() to the function .init.text:hyp_cpu_pm_exit() The function kvm_arch_init() references the function __init hyp_cpu_pm_exit(). This is often because kvm_arch_init lacks a __init annotation or the annotation of hyp_cpu_pm_exit is wrong. WARNING: modpost: vmlinux.o(.text+0x97054): Section mismatch in reference from the function init_subsystems() to the function .init.text:hyp_cpu_pm_init() The function init_subsystems() references the function __init hyp_cpu_pm_init(). This is often because init_subsystems lacks a __init annotation or the annotation of hyp_cpu_pm_init is wrong. Remove the __init annotation so that there are no warnings regardless of how functions are inlined. Fixes: 1fcf7ce0c602 ("arm: kvm: implement CPU PM notifier") Fixes: 06a71a24bae5 ("arm64: KVM: unregister notifiers in hyp mode teardown path") Link: https://github.com/ClangBuiltLinux/linux/issues/1230 Signed-off-by: Nathan Chancellor --- arch/arm64/kvm/arm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) base-commit: 5c8fe583cce542aa0b84adc939ce85293de36e5e diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c index 6e637d2b4cfb..71a49eae9ea0 100644 --- a/arch/arm64/kvm/arm.c +++ b/arch/arm64/kvm/arm.c @@ -1574,12 +1574,12 @@ static struct notifier_block hyp_init_cpu_pm_nb = { .notifier_call = hyp_init_cpu_pm_notifier, }; -static void __init hyp_cpu_pm_init(void) +static void hyp_cpu_pm_init(void) { if (!is_protected_kvm_enabled()) cpu_pm_register_notifier(&hyp_init_cpu_pm_nb); } -static void __init hyp_cpu_pm_exit(void) +static void hyp_cpu_pm_exit(void) { if (!is_protected_kvm_enabled()) cpu_pm_unregister_notifier(&hyp_init_cpu_pm_nb);