Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2179063iof; Tue, 7 Jun 2022 22:20:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy7dfdvP6Fp5hTB1TGgii5b79CV/cADk79OXTFNY7GvwqqSqpXSIernpOKk6qlzUUAvbTDs X-Received: by 2002:a63:4514:0:b0:3fc:20d2:2e74 with SMTP id s20-20020a634514000000b003fc20d22e74mr28714814pga.623.1654665626357; Tue, 07 Jun 2022 22:20:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654665626; cv=none; d=google.com; s=arc-20160816; b=0BzPXJVArvy+yOmLZUJ3S7pD9fKj71WRzo5YJjmab+gIZVFFCK5hg6IbEkzq8M2tkl s+23dTUTyyFRbEJIOsiJKDp1sE/OFNGT51MVm/M6seEVqTfvyrWUepIDaAsaroqJZcVQ +oCGTSSFwLAbqfCuqeUYepGx5HfZELEqWsGjKoZGdEALYmvzCdSeZlP8PZY73C+EN0sb K+fH0mDIcWs3Msv3ps5n4PZTMHcHfPrA2pewglJ7HD7PGD/ZRa1sVwCH5jGgjiW6l/4e trT21rFUcNKDag7UG+mnAgxaQFcG98erfPMPAurLiFI5LjPuJvzIpyBpuBHmfccU9wQr w3LA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date:dkim-signature; bh=+Q/l+1BIWj7/SPzON1ArdWUZIpyRfEQx9lxp0+WGJXY=; b=SVBlWlSO1vU+xFYY7rQ4jekOSwzK8Mq6xzOYk7s3LpUiCDD6GV07sYaBesJ8vx9z8T JDVmHsFXRayq9l3WrEJhSA97V/SEba2m9RcDS4lTBcIBRyqsomu0BGYt6ggMVbfPaDCs Dz/G7wNjMc+O0hQVnHpdnzr2ASkoAZlyGyxBCd3raPqQ/y2D/T9ZYSs1yNfzRD/q+0XQ kiu0s4YBCNo3Le+pB2cbK9DKO2u/+xTPeEsh+EzrBBxOy7J/YbTba8IUlTKOJSU9wfeh jhm4vXeX0i1B5Awp8Z79zKF1KWsYI4a/7YYNGdyyM3XC5XhOUwtj2bYj5olCzBcRLasZ tG9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Trpi4HAV; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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. [23.128.96.19]) by mx.google.com with ESMTPS id mw15-20020a17090b4d0f00b001dfbea70331si30870234pjb.37.2022.06.07.22.20.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 22:20:26 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Trpi4HAV; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 D25C9462262; Tue, 7 Jun 2022 21:56:45 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235316AbiFFXnr (ORCPT + 99 others); Mon, 6 Jun 2022 19:43:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234848AbiFFXnq (ORCPT ); Mon, 6 Jun 2022 19:43:46 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 220B0FD1C for ; Mon, 6 Jun 2022 16:43:45 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 974A060C95 for ; Mon, 6 Jun 2022 23:43:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 617FAC385A9; Mon, 6 Jun 2022 23:43:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1654559023; bh=2RsyEJs423JMN7A4DtLut/N786UxEQNyTITZ2k18fmk=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=Trpi4HAVxEqaKQq4B+EdeXeU+KZkabNoC/7XURg0Z/+qu5AtKD4f3zRolw/7wIX10 N/B8UeHfiiUzZb1bQyFzl8sN0JzdXg2D/3XzGIz16C8yz0m59b0HIIWV3yldkT9JTJ fWwq71Nn5rMyKGiew4pGv+/7TaLA6SHgmURb54Nk1rXBo1muZ1bblrVmNDkR6QdQ9y v7QOHLt0tyfeJGKz+ezS1Ftkn4FFoN0VMw/C7HV/qliXWQ8APfO06dEZeQgEE+C1wB XwG3Y1K87Db1701zGVxDWwaEY1DP3Y0MpD9NlcYc+DrBt8Dw+7SkemjECmnbxVRIXB goYLcu/X0N9eg== Date: Mon, 6 Jun 2022 16:43:35 -0700 (PDT) From: Stefano Stabellini X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop To: Oleksandr cc: Masahiro Yamada , Juergen Gross , Stefano Stabellini , Oleksandr Tyshchenko , moderated for non-subscribers , Stephen Rothwell , Julien Grall , Shannon Zhao , linux-kernel@vger.kernel.org Subject: Re: [PATCH] xen: unexport __init-annotated xen_xlate_map_ballooned_pages() In-Reply-To: <20c9cd23-429f-896c-b59b-c518ff2562e2@gmail.com> Message-ID: References: <20220606045920.4161881-1-masahiroy@kernel.org> <20c9cd23-429f-896c-b59b-c518ff2562e2@gmail.com> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 On Mon, 6 Jun 2022, Oleksandr wrote: > On 06.06.22 07:59, Masahiro Yamada wrote: > > Hello > > > 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. > > Good description. > > > > > > Fixes: 243848fc018c ("xen/grant-table: Move xlated_setup_gnttab_pages to > > common place") > > Reported-by: Stephen Rothwell > > Signed-off-by: Masahiro Yamada > > I think the patch is correct. > > Reviewed-by: Oleksandr Tyshchenko Acked-by: Stefano Stabellini > > --- > > > > 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; > > -- > Regards, > > Oleksandr Tyshchenko >