All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Stabellini <sstabellini@kernel.org>
To: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>
Cc: Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"marmarek@invisiblethingslab.com"
	<marmarek@invisiblethingslab.com>,
	xen-devel <xen-devel@lists.xenproject.org>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>
Subject: Re: xen/mem-reservation API and out-of-tree kernel modules
Date: Thu, 31 Jan 2019 13:44:15 -0800 (PST)	[thread overview]
Message-ID: <alpine.DEB.2.10.1901311343370.22962__5151.18340715475$1548971115$gmane$org@sstabellini-ThinkPad-X260> (raw)
In-Reply-To: <f3ca533d-7f51-c59e-6a96-4e1fba687c8f@epam.com>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1718 bytes --]

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)?

[-- Attachment #2: Type: text/plain, Size: 157 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  parent reply	other threads:[~2019-01-31 21:44 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-31 14:02 [Xen-devel] xen/mem-reservation API and out-of-tree kernel modules Oleksandr Andrushchenko
2019-01-31 21:44 ` Stefano Stabellini
2019-02-01  8:27   ` Christoph Hellwig
2019-02-01  8:38     ` Oleksandr Andrushchenko
2019-02-01  8:38     ` [Xen-devel] " Oleksandr Andrushchenko
2019-02-01  8:45       ` Christoph Hellwig
2019-02-01  8:45       ` [Xen-devel] " Christoph Hellwig
2019-02-01  8:27   ` Christoph Hellwig
2019-02-01  8:39   ` [Xen-devel] " Oleksandr Andrushchenko
2019-02-01  9:14     ` Juergen Gross
2019-02-01  9:14     ` [Xen-devel] " Juergen Gross
2019-02-01  9:40       ` Oleksandr Andrushchenko
2019-02-01  9:40       ` [Xen-devel] " Oleksandr Andrushchenko
2019-02-01  8:39   ` Oleksandr Andrushchenko
2019-01-31 21:44 ` Stefano Stabellini [this message]
2019-01-31 14:02 Oleksandr Andrushchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='alpine.DEB.2.10.1901311343370.22962__5151.18340715475$1548971115$gmane$org@sstabellini-ThinkPad-X260' \
    --to=sstabellini@kernel.org \
    --cc=Oleksandr_Andrushchenko@epam.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=jgross@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marmarek@invisiblethingslab.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.