Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp135291iof; Sun, 5 Jun 2022 23:25:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzeeAUZ7BS0b1DaoPwaM8p3CGACLunkyA5sTIr83OYp4qF9xNFuO1Fis53/l5JxFMovZtW5 X-Received: by 2002:a05:6a00:124c:b0:518:cbfa:c0f6 with SMTP id u12-20020a056a00124c00b00518cbfac0f6mr22683370pfi.85.1654496717063; Sun, 05 Jun 2022 23:25:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654496717; cv=none; d=google.com; s=arc-20160816; b=UizgmirwWCj72jwWWXgmL+b2Qsk2c4207cCpsfdjZ16zMj03SCqCUjeKM1DKznQt2a 7qobwhN4eaAPS6Z0uAioODm9WbJcIuYkNJW+tRX5jU/6r9GbSs7zl1ROAwq2RphQffe5 SPewvSwCNRG6il7tvlOKnjdK0yso6BDgGrQixXSd4jRO6ezRU9/9BFbxBEYztMFGPlqF IYN0XibY3he/OMB4jARvCv65xrcpItTvsBx3+roWOyq0BHQ52fMA1hXjqiXMSHpMeP1H YE153YBuCWgJtLh8Hz4pYNDLroPVbhkqfNRZlYukHWw2I2a3f6rb11zZ0i+/1g+0+iVL 3qzg== 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 :message-id:date:subject:cc:to:from:dkim-signature:dkim-filter; bh=02SaZmEKBPMSF76nbpCPhuGFilCILCVnozQUdrfNE4A=; b=i54iKb/meTa/PHKL1A5YETDePqnFfj5qBGJIeeqUQBYHyKGaG0LDe3WOXJYoaDbwR4 fojg4WhFFe0kBhmyqp68KbXBjBl3c8UR9LVdh/9jz0NDVcc/GtwM7APwsmffeDFfAJhD Ry+hGIvYAxk5pIlia+54YiREvnZsCPsYFl/hhzGa1PDYYaFQ/mm2Pe2q1f9Md2dAjeyK DqC+lrqVZfUyEMeAvVQoCyhZxKyvW5ON0APD4WhjL+4OGmtqp6G+cWPEYaX4rtUUIcUd TI7qgbejKrAk3CcunF6BieYpKRVwZD3eW/ZGEEcwzXIHrQ4Y3r4AMfHWHtz3LmWW1i44 FtUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=RkkHLUjq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id s10-20020a63770a000000b00381ff256f5esi19241954pgc.551.2022.06.05.23.25.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jun 2022 23:25:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=RkkHLUjq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 267E5ED715; Sun, 5 Jun 2022 22:27:26 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229578AbiFFF1P (ORCPT + 99 others); Mon, 6 Jun 2022 01:27:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229607AbiFFF1K (ORCPT ); Mon, 6 Jun 2022 01:27:10 -0400 Received: from condef-07.nifty.com (condef-07.nifty.com [202.248.20.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4FA4D6F4A6 for ; Sun, 5 Jun 2022 22:03:48 -0700 (PDT) Received: from conuserg-12.nifty.com ([10.126.8.75])by condef-07.nifty.com with ESMTP id 25651Pml026657 for ; Mon, 6 Jun 2022 14:01:25 +0900 Received: from grover.sesame (133-32-177-133.west.xps.vectant.ne.jp [133.32.177.133]) (authenticated) by conuserg-12.nifty.com with ESMTP id 2564xNUT024943; Mon, 6 Jun 2022 13:59:23 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-12.nifty.com 2564xNUT024943 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1654491564; bh=02SaZmEKBPMSF76nbpCPhuGFilCILCVnozQUdrfNE4A=; h=From:To:Cc:Subject:Date:From; b=RkkHLUjqmtVqOahyc+gud1UArOBglFYPpJZgVzg8bXRPULtWmrJ+kliGNUKHHtDny JiWmrEm1pKeMQhx2JCtK9wQffux2NWWrU2BsRIZYg4fVi8QAJBz/YpNdoCzKKf7LoC vlI95bU/MbYRII7rJ4vFT9VnOmGsvYvVjmfBi67GMgy6q/HMo/eJE1mr/Cp8Ciqoyv 0YxSF9sCrBzJ/Pj0oh9NLLnSXjg/VriRCI5ccSBEb2gDb7aiUlEeceQTnmO3Sunl3e 3lE9jXK7ywjcnYJylguEOjMYY88BLGf0e+gIJPOolZo3FUDfdRnG2wpAtAxSG0/lgj ONhdPeLT6l+rg== X-Nifty-SrcIP: [133.32.177.133] From: Masahiro Yamada To: Juergen Gross , Stefano Stabellini , Oleksandr Tyshchenko , xen-devel@lists.xenproject.org (moderated for non-subscribers) Cc: Masahiro Yamada , Stephen Rothwell , Julien Grall , Shannon Zhao , linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org Subject: [PATCH] xen: unexport __init-annotated xen_xlate_map_ballooned_pages() Date: Mon, 6 Jun 2022 13:59:20 +0900 Message-Id: <20220606045920.4161881-1-masahiroy@kernel.org> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=no 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 EXPORT_SYMBOL and __init is a bad combination because the .init.text section is freed up after the initialization. Hence, modules cannot use symbols annotated __init. The access to a freed symbol may end up with kernel panic. modpost used to detect it, but it has been broken for a decade. Recently, I fixed modpost so it started to warn it again, then this showed up in linux-next builds. There are two ways to fix it: - Remove __init - Remove EXPORT_SYMBOL I chose the latter for this case because none of the in-tree call-sites (arch/arm/xen/enlighten.c, arch/x86/xen/grant-table.c) is compiled as modular. Fixes: 243848fc018c ("xen/grant-table: Move xlated_setup_gnttab_pages to common place") Reported-by: Stephen Rothwell Signed-off-by: Masahiro Yamada --- drivers/xen/xlate_mmu.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/xen/xlate_mmu.c b/drivers/xen/xlate_mmu.c index 34742c6e189e..f17c4c03db30 100644 --- a/drivers/xen/xlate_mmu.c +++ b/drivers/xen/xlate_mmu.c @@ -261,7 +261,6 @@ int __init xen_xlate_map_ballooned_pages(xen_pfn_t **gfns, void **virt, return 0; } -EXPORT_SYMBOL_GPL(xen_xlate_map_ballooned_pages); struct remap_pfn { struct mm_struct *mm; -- 2.32.0