xen/mem-reservation API and out-of-tree kernel modules
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 inxenmem_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:
drivers/xen/mem-reservation.c +0 -0
@@ -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
Stefano Stabellini
maintainerQuoted 41 lines · Oleksandr Andrushchenko
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 asxen_scrub_pagesvariable, which is checked inxenmem_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:drivers/xen/mem-reservation.c +1
-0@@ -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?
Quoted 7 lines
I am looking for community advice here and help
Thank you,
Oleksandr
The alternative would be to turn xenmem_reservation_scrub_page into a regular function (not a static inline)?
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Stefano Stabellini
maintainerQuoted 41 lines · Oleksandr Andrushchenko
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 asxen_scrub_pagesvariable, which is checked inxenmem_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:drivers/xen/mem-reservation.c +1
-0@@ -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?
Quoted 7 lines
I am looking for community advice here and help
Thank you,
Oleksandr
The alternative would be to turn xenmem_reservation_scrub_page into a regular function (not a static inline)?
Quoted 2 lines · Stefano Stabellini
The alternative would be to turn
xenmem_reservation_scrub_pageinto a regular function (not a static inline)?
All that is a moot point until said currently out of tree module gets submitted for inclusion anyway.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 2 lines · Stefano Stabellini
The alternative would be to turn
xenmem_reservation_scrub_pageinto a regular function (not a static inline)?
All that is a moot point until said currently out of tree module gets submitted for inclusion anyway.
Quoted 5 lines · Christoph Hellwig
Quoted 2 lines · Stefano Stabellini
The alternative would be to turn
xenmem_reservation_scrub_pageinto a regular function (not a static inline)?All that is a moot point until said currently out of tree module gets submitted for inclusion anyway.
Indeed this is a moot point, so I can't argue here. But this is how it is and unfortunately we have to live with those modules and depend on 3rd parties willing or not to disclose their sources to public...
_______________________________________________
Xen-devel mailing list [email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 5 lines · Christoph Hellwig
Quoted 2 lines · Stefano Stabellini
The alternative would be to turn
xenmem_reservation_scrub_pageinto a regular function (not a static inline)?All that is a moot point until said currently out of tree module gets submitted for inclusion anyway.
Indeed this is a moot point, so I can't argue here. But this is how it is and unfortunately we have to live with those modules and depend on 3rd parties willing or not to disclose their sources to public...
Quoted 10 lines · Oleksandr Andrushchenko
Quoted 5 lines · Christoph Hellwig
Quoted 2 lines · Stefano Stabellini
The alternative would be to turn
xenmem_reservation_scrub_pageinto a regular function (not a static inline)?All that is a moot point until said currently out of tree module gets submitted for inclusion anyway.
Indeed this is a moot point, so I can't argue here. But this is how it is and unfortunately we have to live with those modules and depend on 3rd parties willing or not to disclose their sources to public...
The point is that the kernel does generally not export interfaces not used by in-tree modules. So there is no reason to change anything here.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 10 lines · Oleksandr Andrushchenko
Quoted 5 lines · Christoph Hellwig
Quoted 2 lines · Stefano Stabellini
The alternative would be to turn
xenmem_reservation_scrub_pageinto a regular function (not a static inline)?All that is a moot point until said currently out of tree module gets submitted for inclusion anyway.
Indeed this is a moot point, so I can't argue here. But this is how it is and unfortunately we have to live with those modules and depend on 3rd parties willing or not to disclose their sources to public...
The point is that the kernel does generally not export interfaces not used by in-tree modules. So there is no reason to change anything here.
Quoted 44 lines · Stefano Stabellini
Quoted 43 lines · Oleksandr Andrushchenko
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 asxen_scrub_pagesvariable, which is checked inxenmem_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:drivers/xen/mem-reservation.c +1
-0@@ -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
Quoted 7 lines
Quoted 5 lines
Thank you,
OleksandrThe alternative would be to turn
xenmem_reservation_scrub_pageinto a regular function (not a static inline)?
Yes, it seems there is no other reasonable solution to this, but a regular function. I'll send a patch for that
Thank you,
Oleksandr
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 44 lines · Stefano Stabellini
Quoted 43 lines · Oleksandr Andrushchenko
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 asxen_scrub_pagesvariable, which is checked inxenmem_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:drivers/xen/mem-reservation.c +1
-0@@ -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
Quoted 7 lines
Quoted 5 lines
Thank you,
OleksandrThe alternative would be to turn
xenmem_reservation_scrub_pageinto a regular function (not a static inline)?
Yes, it seems there is no other reasonable solution to this, but a regular function. I'll send a patch for that
Thank you,
Oleksandr
Juergen Gross
maintainerQuoted 48 lines · Oleksandr Andrushchenko
Quoted 47 lines · Stefano Stabellini
Quoted 46 lines · Oleksandr Andrushchenko
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 asxen_scrub_pagesvariable, which is checked inxenmem_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:drivers/xen/mem-reservation.c +1
-0@@ -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
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
The alternative would be to turn
xenmem_reservation_scrub_pageinto a regular function (not a static inline)?Yes, it seems there is no other reasonable solution to this, but a regular function. I'll send a patch for that
What would you gain? This function would need to be exported.
So its either the variable or the function.
Juergen
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Juergen Gross
maintainerQuoted 48 lines · Oleksandr Andrushchenko
Quoted 47 lines · Stefano Stabellini
Quoted 46 lines · Oleksandr Andrushchenko
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 asxen_scrub_pagesvariable, which is checked inxenmem_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:drivers/xen/mem-reservation.c +1
-0@@ -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
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
The alternative would be to turn
xenmem_reservation_scrub_pageinto a regular function (not a static inline)?Yes, it seems there is no other reasonable solution to this, but a regular function. I'll send a patch for that
What would you gain? This function would need to be exported.
So its either the variable or the function.
Juergen
Quoted 49 lines · Juergen Gross
Quoted 48 lines · Oleksandr Andrushchenko
Quoted 47 lines · Stefano Stabellini
Quoted 46 lines · Oleksandr Andrushchenko
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 asxen_scrub_pagesvariable, which is checked inxenmem_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:drivers/xen/mem-reservation.c +1
-0@@ -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
Quoted 7 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
The alternative would be to turn
xenmem_reservation_scrub_pageinto a regular function (not a static inline)?Yes, it seems there is no other reasonable solution to this, but a regular function. I'll send a patch for that
What would you gain? This function would need to be exported.
Yes, this is true, the function should be exported then
Quoted 1 line
So its either the variable or the function.
I am a bit confused with this because I'll have to export module parameter in this case, e.g.
core_param(xen_scrub_pages, xen_scrub_pages, bool, 0); EXPORT_SYMBOL(xen_scrub_pages);
which looks a bit unusual to me
Quoted 2 lines
Juergen
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 49 lines · Juergen Gross
Quoted 48 lines · Oleksandr Andrushchenko
Quoted 47 lines · Stefano Stabellini
Quoted 46 lines · Oleksandr Andrushchenko
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 asxen_scrub_pagesvariable, which is checked inxenmem_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:drivers/xen/mem-reservation.c +1
-0@@ -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
Quoted 7 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
The alternative would be to turn
xenmem_reservation_scrub_pageinto a regular function (not a static inline)?Yes, it seems there is no other reasonable solution to this, but a regular function. I'll send a patch for that
What would you gain? This function would need to be exported.
Yes, this is true, the function should be exported then
Quoted 1 line
So its either the variable or the function.
I am a bit confused with this because I'll have to export module parameter in this case, e.g.
core_param(xen_scrub_pages, xen_scrub_pages, bool, 0); EXPORT_SYMBOL(xen_scrub_pages);
which looks a bit unusual to me
Quoted 2 lines
Juergen