diff mbox series

[Groovy] UBUNTU: SAUCE: export __get_vm_area_caller() and map_kernel_range()

Message ID 20200731095540.29456-1-paolo.pisati@canonical.com
State New
Headers show
Series [Groovy] UBUNTU: SAUCE: export __get_vm_area_caller() and map_kernel_range() | expand

Commit Message

Paolo Pisati July 31, 2020, 9:55 a.m. UTC
As explained here:

https://www.virtualbox.org/ticket/19644

and in the recent virtualbox DKMS upload changelog:

https://metadata.ftp-master.debian.org/changelogs/contrib/v/virtualbox/virtualbox_6.1.12-dfsg-8_changelog

Virtualbox DKMS now requires access to these two kernel functions to fix a FTBFS
against Linux 5.8, so until they rewrite their VM code (something that is not
happening anytime soon, see comment 8 in the first link), export these two
symbols.

Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
---
 mm/vmalloc.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Colin Ian King July 31, 2020, 10:21 a.m. UTC | #1
On 31/07/2020 10:55, Paolo Pisati wrote:
> As explained here:
> 
> https://www.virtualbox.org/ticket/19644
> 
> and in the recent virtualbox DKMS upload changelog:
> 
> https://metadata.ftp-master.debian.org/changelogs/contrib/v/virtualbox/virtualbox_6.1.12-dfsg-8_changelog
> 
> Virtualbox DKMS now requires access to these two kernel functions to fix a FTBFS
> against Linux 5.8, so until they rewrite their VM code (something that is not
> happening anytime soon, see comment 8 in the first link), export these two
> symbols.
> 
> Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
> ---
>  mm/vmalloc.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/mm/vmalloc.c b/mm/vmalloc.c
> index 317afdc7d247..dffac67ba7f7 100644
> --- a/mm/vmalloc.c
> +++ b/mm/vmalloc.c
> @@ -326,6 +326,7 @@ int map_kernel_range(unsigned long start, unsigned long size, pgprot_t prot,
>  	flush_cache_vmap(start, start + size);
>  	return ret;
>  }
> +EXPORT_SYMBOL(map_kernel_range);
>  
>  int is_vmalloc_or_module_addr(const void *x)
>  {
> @@ -2130,6 +2131,7 @@ struct vm_struct *__get_vm_area_caller(unsigned long size, unsigned long flags,
>  	return __get_vm_area_node(size, 1, flags, start, end, NUMA_NO_NODE,
>  				  GFP_KERNEL, caller);
>  }
> +EXPORT_SYMBOL(__get_vm_area_caller);
>  
>  /**
>   * get_vm_area - reserve a contiguous kernel virtual area
> 
Sigh, I guess that needs to be done. Thanks for cornering this Paolo.
Are you going to keep monitoring the upstream driver so we can rip these
out once they fix their code?

Acked-by: Colin Ian King <colin.king@canonical.com>
Andrea Righi July 31, 2020, 10:25 a.m. UTC | #2
On Fri, Jul 31, 2020 at 11:55:40AM +0200, Paolo Pisati wrote:
> As explained here:
> 
> https://www.virtualbox.org/ticket/19644
> 
> and in the recent virtualbox DKMS upload changelog:
> 
> https://metadata.ftp-master.debian.org/changelogs/contrib/v/virtualbox/virtualbox_6.1.12-dfsg-8_changelog
> 
> Virtualbox DKMS now requires access to these two kernel functions to fix a FTBFS
> against Linux 5.8, so until they rewrite their VM code (something that is not
> happening anytime soon, see comment 8 in the first link), export these two
> symbols.
> 
> Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>

Makes sense to me, but, as mentioned by Colin, we should drop this patch
once virtualbox fixes this upstream.

Acked-by: Andrea Righi <andrea.righi@canonical.com>

> ---
>  mm/vmalloc.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/mm/vmalloc.c b/mm/vmalloc.c
> index 317afdc7d247..dffac67ba7f7 100644
> --- a/mm/vmalloc.c
> +++ b/mm/vmalloc.c
> @@ -326,6 +326,7 @@ int map_kernel_range(unsigned long start, unsigned long size, pgprot_t prot,
>  	flush_cache_vmap(start, start + size);
>  	return ret;
>  }
> +EXPORT_SYMBOL(map_kernel_range);
>  
>  int is_vmalloc_or_module_addr(const void *x)
>  {
> @@ -2130,6 +2131,7 @@ struct vm_struct *__get_vm_area_caller(unsigned long size, unsigned long flags,
>  	return __get_vm_area_node(size, 1, flags, start, end, NUMA_NO_NODE,
>  				  GFP_KERNEL, caller);
>  }
> +EXPORT_SYMBOL(__get_vm_area_caller);
>  
>  /**
>   * get_vm_area - reserve a contiguous kernel virtual area
> -- 
> 2.25.1
> 
> 
> -- 
> kernel-team mailing list
> kernel-team@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team
Paolo Pisati July 31, 2020, 2:50 p.m. UTC | #3
On Fri, Jul 31, 2020 at 12:21 PM Colin Ian King
<colin.king@canonical.com> wrote:
>
> Sigh, I guess that needs to be done. Thanks for cornering this Paolo.
> Are you going to keep monitoring the upstream driver so we can rip these
> out once they fix their code?

I added a card/reminder in the Groovy board to check back if there's
any update to the DKMS/kernel Virtualbox patches.

Thanks.
Colin Ian King July 31, 2020, 2:56 p.m. UTC | #4
On 31/07/2020 15:50, Paolo Pisati wrote:
> On Fri, Jul 31, 2020 at 12:21 PM Colin Ian King
> <colin.king@canonical.com> wrote:
>>
>> Sigh, I guess that needs to be done. Thanks for cornering this Paolo.
>> Are you going to keep monitoring the upstream driver so we can rip these
>> out once they fix their code?
> 
> I added a card/reminder in the Groovy board to check back if there's
> any update to the DKMS/kernel Virtualbox patches.
> 
> Thanks.
> 
Thanks Paolo
Colin Ian King July 31, 2020, 3:58 p.m. UTC | #5
On 31/07/2020 10:55, Paolo Pisati wrote:
> As explained here:
> 
> https://www.virtualbox.org/ticket/19644
> 
> and in the recent virtualbox DKMS upload changelog:
> 
> https://metadata.ftp-master.debian.org/changelogs/contrib/v/virtualbox/virtualbox_6.1.12-dfsg-8_changelog
> 
> Virtualbox DKMS now requires access to these two kernel functions to fix a FTBFS
> against Linux 5.8, so until they rewrite their VM code (something that is not
> happening anytime soon, see comment 8 in the first link), export these two
> symbols.
> 
> Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
> ---
>  mm/vmalloc.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/mm/vmalloc.c b/mm/vmalloc.c
> index 317afdc7d247..dffac67ba7f7 100644
> --- a/mm/vmalloc.c
> +++ b/mm/vmalloc.c
> @@ -326,6 +326,7 @@ int map_kernel_range(unsigned long start, unsigned long size, pgprot_t prot,
>  	flush_cache_vmap(start, start + size);
>  	return ret;
>  }
> +EXPORT_SYMBOL(map_kernel_range);
>  
>  int is_vmalloc_or_module_addr(const void *x)
>  {
> @@ -2130,6 +2131,7 @@ struct vm_struct *__get_vm_area_caller(unsigned long size, unsigned long flags,
>  	return __get_vm_area_node(size, 1, flags, start, end, NUMA_NO_NODE,
>  				  GFP_KERNEL, caller);
>  }
> +EXPORT_SYMBOL(__get_vm_area_caller);
>  
>  /**
>   * get_vm_area - reserve a contiguous kernel virtual area
> 

I just spotted this:


    https://sources.debian.org/src/virtualbox/6.1.12-dfsg-8/debian/patches/

https://sources.debian.org/data/contrib/v/virtualbox/6.1.12-dfsg-8/debian/patches/kernel-5.8-1.patch

https://sources.debian.org/data/contrib/v/virtualbox/6.1.12-dfsg-8/debian/patches/kernel-5.8-2.patch

https://sources.debian.org/data/contrib/v/virtualbox/6.1.12-dfsg-8/debian/patches/kernel-5.8-3.patch

Maybe that is worth looking at.

Colin
Seth Forshee July 31, 2020, 8:50 p.m. UTC | #6
On Fri, Jul 31, 2020 at 11:55:40AM +0200, Paolo Pisati wrote:
> As explained here:
> 
> https://www.virtualbox.org/ticket/19644
> 
> and in the recent virtualbox DKMS upload changelog:
> 
> https://metadata.ftp-master.debian.org/changelogs/contrib/v/virtualbox/virtualbox_6.1.12-dfsg-8_changelog
> 
> Virtualbox DKMS now requires access to these two kernel functions to fix a FTBFS
> against Linux 5.8, so until they rewrite their VM code (something that is not
> happening anytime soon, see comment 8 in the first link), export these two
> symbols.
> 
> Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
> ---
>  mm/vmalloc.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/mm/vmalloc.c b/mm/vmalloc.c
> index 317afdc7d247..dffac67ba7f7 100644
> --- a/mm/vmalloc.c
> +++ b/mm/vmalloc.c
> @@ -326,6 +326,7 @@ int map_kernel_range(unsigned long start, unsigned long size, pgprot_t prot,
>  	flush_cache_vmap(start, start + size);
>  	return ret;
>  }
> +EXPORT_SYMBOL(map_kernel_range);
>  
>  int is_vmalloc_or_module_addr(const void *x)
>  {
> @@ -2130,6 +2131,7 @@ struct vm_struct *__get_vm_area_caller(unsigned long size, unsigned long flags,
>  	return __get_vm_area_node(size, 1, flags, start, end, NUMA_NO_NODE,
>  				  GFP_KERNEL, caller);
>  }
> +EXPORT_SYMBOL(__get_vm_area_caller);

Please use EXPORT_SYMBOL_GPL instead.

Seth
Paolo Pisati Aug. 3, 2020, 8:03 a.m. UTC | #7
On Fri, Jul 31, 2020 at 5:58 PM Colin Ian King <colin.king@canonical.com> wrote:
>
>
> I just spotted this:
>
>
>     https://sources.debian.org/src/virtualbox/6.1.12-dfsg-8/debian/patches/
>
> https://sources.debian.org/data/contrib/v/virtualbox/6.1.12-dfsg-8/debian/patches/kernel-5.8-1.patch
>
> https://sources.debian.org/data/contrib/v/virtualbox/6.1.12-dfsg-8/debian/patches/kernel-5.8-2.patch
>
> https://sources.debian.org/data/contrib/v/virtualbox/6.1.12-dfsg-8/debian/patches/kernel-5.8-3.patch
>
> Maybe that is worth looking at.

Yes, those are the 3 patches applied to the DKMS deb pkg (that we
already have in groovy since it's synced from debian/unstable) - the
kernel EXPORT patch is on top of those:

virtualbox (6.1.12-dfsg-8) unstable; urgency=medium

  * debian/patches/kernel-5.8-1.patch:
  * debian/patches/kernel-5.8-2.patch:
  * debian/patches/kernel-5.8-3.patch:
    - apply upstream proposed patches to fix a build failure with kernel 5.8
      (note, this requires also a kernel patch)
      https://www.virtualbox.org/ticket/19644

 -- Gianfranco Costamagna <locutusofborg@debian.org>  Thu, 30 Jul 2020
18:58:32 +0200

$ rmadison virtualbox-dkms
...
 virtualbox-dkms | 6.1.12-dfsg-8                       |
groovy/multiverse          | amd64
Paolo Pisati Aug. 3, 2020, 12:36 p.m. UTC | #8
On Fri, Jul 31, 2020 at 10:50 PM <seth.forshee@canonical.com> wrote:
>
>
> Please use EXPORT_SYMBOL_GPL instead.

Ack, i'll apply the patch with EXPORT_SYMBOL_GPL() instead.
diff mbox series

Patch

diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index 317afdc7d247..dffac67ba7f7 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -326,6 +326,7 @@  int map_kernel_range(unsigned long start, unsigned long size, pgprot_t prot,
 	flush_cache_vmap(start, start + size);
 	return ret;
 }
+EXPORT_SYMBOL(map_kernel_range);
 
 int is_vmalloc_or_module_addr(const void *x)
 {
@@ -2130,6 +2131,7 @@  struct vm_struct *__get_vm_area_caller(unsigned long size, unsigned long flags,
 	return __get_vm_area_node(size, 1, flags, start, end, NUMA_NO_NODE,
 				  GFP_KERNEL, caller);
 }
+EXPORT_SYMBOL(__get_vm_area_caller);
 
 /**
  * get_vm_area - reserve a contiguous kernel virtual area