Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp194605ima; Thu, 31 Jan 2019 14:52:13 -0800 (PST) X-Google-Smtp-Source: ALg8bN58spPIUo1+OQRkaGlKw7UBs1tRjZM9bicyEvyDY9MZZBHlFxb4Nud0bL20t/n8k5hu/IcT X-Received: by 2002:a63:790e:: with SMTP id u14mr33345298pgc.452.1548975133112; Thu, 31 Jan 2019 14:52:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548975133; cv=none; d=google.com; s=arc-20160816; b=NrNV3z1qDqqlDcGfebityyfN9kuqC7brkfD6zGZsB684TWs3vBF9EeGTBtS/2OepTB AE7TMQGaB9v5ojwFP9x0lGuk5EaCJ3ibf9ToMrOZzQFHiBuGEta6ZOC2s5yaWvd1ZnoH 0zDwtDMVjdpLfiXg4SIbo0Wv7tXkcLtWtPqmcPZzP2dc8KMDn1Nya9lhOpqyHdaX2Qfj fOgDSW7FSH3ns2RLuzdjodiTuqn7wLbtuiDA3qVQwDZCnEmV3SwdUxwEZi8DzFV1rJOu dXSwQJyC+iD1C/96RutKZPR6PdfHp7Z/o8YtRw4xD3FXZTcslRLrcLXQNFjylqaD3xxx WnTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature; bh=FwPPc+WvC0NqXmsrK8edHrzWtWKMmn7Fz+5EXr5u9Uw=; b=HHpn+FK1hcG+j66vT+HILyofezj35Ng/xDFvmDuLDvIgIWX9Kx7mrngiW2Ge2stRkx E3U2x4sNHJQ0pU1R4FeQxOk9da+vVilEcQlPTlavtWgvTtNdZQBERQvQMACiQ6OkqhTZ b9wMifUPs7JrcoQ5VxqjGHVLvwfHDA8sZYfMT/9GntcYHR5hMsuNdD8YPGgpkRBgNmgI KV5f0GW9VW3YUO/HIFMH6y/vwsGbiNVfOsgvZd3+A7CkehfGZOzWXA56aXZ8vkz8pFmh mSxQTNtU2vYDdRKoYDs5ceJpXqNCHiwe30Fu3KGxG/c4ZelTRtNT/rJHGIuLoZmgPf2b KAjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=mIJ9gCdD; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f10si5070320pgo.356.2019.01.31.14.51.58; Thu, 31 Jan 2019 14:52:13 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=mIJ9gCdD; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728820AbfAaVoU (ORCPT + 99 others); Thu, 31 Jan 2019 16:44:20 -0500 Received: from mail.kernel.org ([198.145.29.99]:48716 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726233AbfAaVoT (ORCPT ); Thu, 31 Jan 2019 16:44:19 -0500 Received: from localhost (c-67-164-102-47.hsd1.ca.comcast.net [67.164.102.47]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 98EA420869; Thu, 31 Jan 2019 21:44:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548971059; bh=tONGFam/ja1LeJ4xY5qGd4SoU1LxE70EjcaZ++/CmYQ=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=mIJ9gCdDNofYKWSkONXiUcAe43xsbKzDXQBlCcUJVuFg4BVxOPUx2i8hfMLcTzfMT ANhEo5//Z2pDDIwXYcwKhadw4bnakeR1ouuSAw9tkd0de9ivoK5Gf6pJYrdIcDTIhn 5JtKlTBjZNKyet0B/5vxEkXMbdj0XG4O95eNONxU= Date: Thu, 31 Jan 2019 13:44:15 -0800 (PST) From: Stefano Stabellini X-X-Sender: sstabellini@sstabellini-ThinkPad-X260 To: Oleksandr Andrushchenko cc: xen-devel , Boris Ostrovsky , Juergen Gross , Stefano Stabellini , "linux-kernel@vger.kernel.org" , "marmarek@invisiblethingslab.com" Subject: Re: [Xen-devel] xen/mem-reservation API and out-of-tree kernel modules In-Reply-To: Message-ID: References: User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323329-1499689100-1548971056=:22962" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-1499689100-1548971056=:22962 Content-Type: TEXT/PLAIN; charset=UTF-8 Content-Transfer-Encoding: 8BIT On Thu, 31 Jan 2019, Oleksandr Andrushchenko wrote: > Hello, > > I am working on porting an out-of-tree kernel driver to the kernel > 5.0 and that driver uses functionality provided by > drivers/xen/mem-reservation.c > module.  Since commit [1] it is not possible to build a kernel module > which uses mem-reservation API as xen_scrub_pages variable, which is > checked in > xenmem_reservation_scrub_page, became a kernel module parameter and is > now only > accessible for built-in modules: > > static inline void xenmem_reservation_scrub_page(struct page *page) > ^^^^^^^^^^^^^ > { >     if (xen_scrub_pages) >         ^^^^^^^^^^^^^^^ >         clear_highpage(page); > } > > This results in link-time warning: > >     WARNING: "xen_scrub_pages" [yourmodule.ko] undefined! > > and thus not allowing the module to run. At the moment I can only see a > possible fix > for this by making the following change: > > diff --git a/drivers/xen/mem-reservation.c b/drivers/xen/mem-reservation.c > index 3782cf070338..85fecfec50e1 100644 > --- a/drivers/xen/mem-reservation.c > +++ b/drivers/xen/mem-reservation.c > @@ -18,6 +18,7 @@ > >  bool __read_mostly xen_scrub_pages = > IS_ENABLED(CONFIG_XEN_SCRUB_PAGES_DEFAULT); >  core_param(xen_scrub_pages, xen_scrub_pages, bool, 0); > +EXPORT_SYMBOL(xen_scrub_pages); > > but this looks a bit unusual for the kernel? > > I am looking for community advice here and help > > Thank you, > Oleksandr > > [1] > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=197ecb3802c04499d8ff4f8cb28f6efa008067db The alternative would be to turn xenmem_reservation_scrub_page into a regular function (not a static inline)? --8323329-1499689100-1548971056=:22962--