From patchwork Tue Jun 5 11:35:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 137707 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp845308lji; Tue, 5 Jun 2018 04:38:09 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJkuc0JSsjvEGijz+sHKg+aJx+CvJVFhToM0MJZEa30EnrZXp1HxDTv3wDRpw9xnSbNHBf8 X-Received: by 2002:a65:6397:: with SMTP id h23-v6mr3420125pgv.380.1528198689509; Tue, 05 Jun 2018 04:38:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528198689; cv=none; d=google.com; s=arc-20160816; b=MvPltx6uZaLPcaW9LAEpmprAhvCHxcbGf7QzqtlbuDk0mRDs8tZ8VBPj8bypVZti85 2M/KHivZiFrvxKfMmfuyf3DHg1cLsdBAyYY8HtpUoWd70rBh1JDVgnzURplOKXYva++P +ae44r96fx/4LLQ2JpMgMRAWc83McrRZA+TjZvg1eLB1ZVINx0KBRwTPhYi52g2mO2ou PkdcSIIYXLkIPf818XF8HcvP3AF9C5f9dKEJA6S3muPa/Zs+9HErG7fD94RjOSsK+6m9 TnNuqll9BK+zcERhxF2WINQOUgF8m6aox5+kwJAVVAhX/2a+xyxops5b1XmYPPAwo+Ie 5Kiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=YLXWtizyouhXjCsS3kfWDPYPJ7lRnLi/kSZ9G6XnbKM=; b=dP/A2h14hbxRkzUBG1QNdxXHyULgxnGDuMsaaMrKLFlW8AWo386g3uTo/sIOYshtii sB11Mr76Od1DxLWwpIH9CUDjN2m4ZX4Yd/BZLJ1bf72BfAzGhRjwoA3CZzRSpocJePJV LZQxlIy5N5V897LrUBh6L5AWkQ+OsvN0OToxZaOdibgqHmoNrraxrJNN2EVbHywHu3os AVOeNbKF9ifqpXkql/Za8pw7+hSsIYhyaGs4B5mtWaDTEXc0QB1JSTJyRvleAj/ActtR KsNbiVR+P/HVBCUX1thwzQ7kB4JBwJSajjLucD0vL/9oGbuFYScSPAjez8BQAQRwM1FN EngQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m6-v6si17341800pgt.636.2018.06.05.04.38.09; Tue, 05 Jun 2018 04:38:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751765AbeFELiG (ORCPT + 30 others); Tue, 5 Jun 2018 07:38:06 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:41941 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751588AbeFELiF (ORCPT ); Tue, 5 Jun 2018 07:38:05 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue104 [212.227.15.145]) with ESMTPA (Nemesis) id 0MFKXk-1fTPO90toy-00EOmI; Tue, 05 Jun 2018 13:37:21 +0200 From: Arnd Bergmann To: Thomas Gleixner , Ingo Molnar , x86@kernel.org Cc: Arnd Bergmann , "H. Peter Anvin" , "Kirill A. Shutemov" , Andrew Morton , Dave Hansen , Greg Kroah-Hartman , Zi Yan , Naoya Horiguchi , linux-kernel@vger.kernel.org Subject: [PATCH] x86: mark native_set_p4d() as __always_inline Date: Tue, 5 Jun 2018 13:35:15 +0200 Message-Id: <20180605113715.1133726-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K1:3jiT0AcdXGPwkDX3jDsLr/EUaq2di6XVid1sscnP79ubIgD1TEz hfShsJahlNLz9J5KXRedWG5xmyBo7qgtNAvWtVxqC7mOn15sdGwY7OILoHeUBjjMnIwE1V7 bgKndQmJIzbMkX5V2wKhDIo7Wl8SfFVlzzAOwBmDBR4TW9MaTWvp5KwkfnsBUaCiGv0FPEi FoTWZ1yzZyj/HdK7llY/g== X-UI-Out-Filterresults: notjunk:1; V01:K0:Lw3GqVoN2cE=:OjvoOqHmW0xtAO7w/xQMCj qQrkKpGLFPX3r9pOQ4zCw8FsjOb/DrbXrp7qix5qo7XD9hv7FO8wCAxdfZykUTq1gcUE0maEj mB1i87UvM/l5HpoWO9hukfSYECWl3/jcX2ltJ8YS/2qzCtL0GGXbIcoJCyl4GszokuFR/Zu6P o8d9BkP45UOlOc+jsPWlOzjLPechYK4eqJIkDtouDb3k0ZyFr2ksVdk64scj0E+RAfZ1lQx2d 15nI54qe73Iq4XeKH+w614oucWB9xLtIWErRi0jHIu+8Akufm1k62toR33n6kcCrqVY+ZQIt1 E0vOPL7nDFO4Ytz6sAAVtFazN8XCcrGGxk0GwqsITWp6IcZXvqzny2X4Jmnj0oZ5NjKC8XWe8 TJD/PKEQu7QfGIUoHmfTTbme9QJne0UF/6JlxWIBGPLqxvQABfscMDWcQUXUt1L+4rrTf6oYi pLsmWrlEqXE2rJtJR66LS0r3GsP7mleqZnXncRriKQ/LKJjJj49sHwEazUm73IkMnvu7xYH86 VysoOYqiDPaFJB0oFnQgagkl0gk9inF9NdEJa4KTe0ej9XAdhWhsQVHRFW06xS1+hpBrhJNNR RMhs5k2ivfZrrw36d+PwJuKiKh7IOch6pzKX7QZqnLy2LIiKgEzU12oZzYGYGnVRAupvmEt+m XVP0K6dLJRt3QMOnfIvkGnhnXcP7tAIq9kf6LV32gKeLv1N/NirjALLHcLbA2BdxF7do= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When CONFIG_OPTIMIZE_INLINING is enabled, the function native_set_p4d() may not be fully inlined into the caller, resulting in a false-positive warning about an access to the __pgtable_l5_enabled variable from a non-__init function, despite the original caller being an __init function: WARNING: vmlinux.o(.text.unlikely+0x1429): Section mismatch in reference from the function native_set_p4d() to the variable .init.data:__pgtable_l5_enabled WARNING: vmlinux.o(.text.unlikely+0x1429): Section mismatch in reference from the function native_p4d_clear() to the variable .init.data:__pgtable_l5_enabled The function native_set_p4d() references the variable __initdata __pgtable_l5_enabled. This is often because native_set_p4d lacks a __initdata annotation or the annotation of __pgtable_l5_enabled is wrong. Marking the native_set_p4d function and its caller native_p4d_clear() avoids this problem. I did not bisect the original cause, but I assume this is related to the recent rework that turned pgtable_l5_enabled() into an inline function, which in turn caused the compiler to make different inlining decisions. Fixes: ad3fe525b950 ("x86/mm: Unify pgtable_l5_enabled usage in early boot code") Signed-off-by: Arnd Bergmann --- arch/x86/include/asm/pgtable_64.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.9.0 Acked-by: Kirill A. Shutemov diff --git a/arch/x86/include/asm/pgtable_64.h b/arch/x86/include/asm/pgtable_64.h index 3c5385f9a88f..0fdcd21dadbd 100644 --- a/arch/x86/include/asm/pgtable_64.h +++ b/arch/x86/include/asm/pgtable_64.h @@ -216,7 +216,7 @@ static inline pgd_t pti_set_user_pgd(pgd_t *pgdp, pgd_t pgd) } #endif -static inline void native_set_p4d(p4d_t *p4dp, p4d_t p4d) +static __always_inline void native_set_p4d(p4d_t *p4dp, p4d_t p4d) { pgd_t pgd; @@ -230,7 +230,7 @@ static inline void native_set_p4d(p4d_t *p4dp, p4d_t p4d) *p4dp = native_make_p4d(native_pgd_val(pgd)); } -static inline void native_p4d_clear(p4d_t *p4d) +static __always_inline void native_p4d_clear(p4d_t *p4d) { native_set_p4d(p4d, native_make_p4d(0)); }