[Mini-OS PATCH] Add missing symbol exports for grub-pv

Juergen Gross posted 1 patch 1 month ago
Failed in applying to current master (apply log)
arch/x86/mm.c    | 1 +
arch/x86/setup.c | 1 +
2 files changed, 2 insertions(+)
[Mini-OS PATCH] Add missing symbol exports for grub-pv
Posted by Juergen Gross 1 month ago
Grub-pv needs start_info_union and phys_to_machine_mapping to be
accessible. Export both symbols.

Fixes: 33411a11f848 ("Mini-OS: hide all symbols not exported via EXPORT_SYMBOLS()")
Reported-by: Natanael Copa <ncopa@alpinelinux.org>
Signed-off-by: Juergen Gross <jgross@suse.com>
---
 arch/x86/mm.c    | 1 +
 arch/x86/setup.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/arch/x86/mm.c b/arch/x86/mm.c
index 572e762e..3ba6d917 100644
--- a/arch/x86/mm.c
+++ b/arch/x86/mm.c
@@ -55,6 +55,7 @@
 #endif
 
 unsigned long *phys_to_machine_mapping;
+EXPORT_SYMBOL(phys_to_machine_mapping);
 unsigned long mfn_zero;
 pgentry_t *pt_base;
 EXPORT_SYMBOL(pt_base);
diff --git a/arch/x86/setup.c b/arch/x86/setup.c
index b27bbed7..b613083b 100644
--- a/arch/x86/setup.c
+++ b/arch/x86/setup.c
@@ -41,6 +41,7 @@
  * address of the shared_info structure, and things like that.
  */
 union start_info_union start_info_union;
+EXPORT_SYMBOL(start_info_union);
 #endif
 
 /*
-- 
2.43.0
Re: [Mini-OS PATCH] Add missing symbol exports for grub-pv
Posted by Samuel Thibault 1 month ago
Juergen Gross, le mar. 29 oct. 2024 12:41:58 +0100, a ecrit:
> Grub-pv needs start_info_union and phys_to_machine_mapping to be
> accessible. Export both symbols.
> 
> Fixes: 33411a11f848 ("Mini-OS: hide all symbols not exported via EXPORT_SYMBOLS()")
> Reported-by: Natanael Copa <ncopa@alpinelinux.org>
> Signed-off-by: Juergen Gross <jgross@suse.com>

Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>

> ---
>  arch/x86/mm.c    | 1 +
>  arch/x86/setup.c | 1 +
>  2 files changed, 2 insertions(+)
> 
> diff --git a/arch/x86/mm.c b/arch/x86/mm.c
> index 572e762e..3ba6d917 100644
> --- a/arch/x86/mm.c
> +++ b/arch/x86/mm.c
> @@ -55,6 +55,7 @@
>  #endif
>  
>  unsigned long *phys_to_machine_mapping;
> +EXPORT_SYMBOL(phys_to_machine_mapping);
>  unsigned long mfn_zero;
>  pgentry_t *pt_base;
>  EXPORT_SYMBOL(pt_base);
> diff --git a/arch/x86/setup.c b/arch/x86/setup.c
> index b27bbed7..b613083b 100644
> --- a/arch/x86/setup.c
> +++ b/arch/x86/setup.c
> @@ -41,6 +41,7 @@
>   * address of the shared_info structure, and things like that.
>   */
>  union start_info_union start_info_union;
> +EXPORT_SYMBOL(start_info_union);
>  #endif
>  
>  /*
> -- 
> 2.43.0
Re: [Mini-OS PATCH] Add missing symbol exports for grub-pv
Posted by Andrew Cooper 1 month ago
On 29/10/2024 11:50 am, Samuel Thibault wrote:
> Juergen Gross, le mar. 29 oct. 2024 12:41:58 +0100, a ecrit:
>> Grub-pv needs start_info_union and phys_to_machine_mapping to be
>> accessible. Export both symbols.
>>
>> Fixes: 33411a11f848 ("Mini-OS: hide all symbols not exported via EXPORT_SYMBOLS()")
>> Reported-by: Natanael Copa <ncopa@alpinelinux.org>
>> Signed-off-by: Juergen Gross <jgross@suse.com>
> Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>

Committed.

Jurgen, what do you want to do with updating 4.19?  Don't we need to
fork a 4.19 branch to avoid the CONFIG_XC change ?

~Andrew

Re: [Mini-OS PATCH] Add missing symbol exports for grub-pv
Posted by Jürgen Groß 1 month ago
On 29.10.24 13:01, Andrew Cooper wrote:
> On 29/10/2024 11:50 am, Samuel Thibault wrote:
>> Juergen Gross, le mar. 29 oct. 2024 12:41:58 +0100, a ecrit:
>>> Grub-pv needs start_info_union and phys_to_machine_mapping to be
>>> accessible. Export both symbols.
>>>
>>> Fixes: 33411a11f848 ("Mini-OS: hide all symbols not exported via EXPORT_SYMBOLS()")
>>> Reported-by: Natanael Copa <ncopa@alpinelinux.org>
>>> Signed-off-by: Juergen Gross <jgross@suse.com>
>> Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
> 
> Committed.
> 
> Jurgen, what do you want to do with updating 4.19?  Don't we need to
> fork a 4.19 branch to avoid the CONFIG_XC change ?

Yes, I think this is the way to go.


Juergen
Re: [Mini-OS PATCH] Add missing symbol exports for grub-pv
Posted by Andrew Cooper 1 month ago
On 29/10/2024 12:02 pm, Jürgen Groß wrote:
> On 29.10.24 13:01, Andrew Cooper wrote:
>> On 29/10/2024 11:50 am, Samuel Thibault wrote:
>>> Juergen Gross, le mar. 29 oct. 2024 12:41:58 +0100, a ecrit:
>>>> Grub-pv needs start_info_union and phys_to_machine_mapping to be
>>>> accessible. Export both symbols.
>>>>
>>>> Fixes: 33411a11f848 ("Mini-OS: hide all symbols not exported via
>>>> EXPORT_SYMBOLS()")
>>>> Reported-by: Natanael Copa <ncopa@alpinelinux.org>
>>>> Signed-off-by: Juergen Gross <jgross@suse.com>
>>> Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
>>
>> Committed.
>>
>> Jurgen, what do you want to do with updating 4.19?  Don't we need to
>> fork a 4.19 branch to avoid the CONFIG_XC change ?
>
> Yes, I think this is the way to go.

Ok.  https://xenbits.xen.org/gitweb/?p=mini-os.git;a=summary

master has this fix, and there's a new branch, xen-stable-4.19, starting
from the xen-RELEASE-4.19.0 tag with this change backported.

Xen 4.18 and earlier don't have the symbol restrictions.

~Andrew

Re: [Mini-OS PATCH] Add missing symbol exports for grub-pv
Posted by Juergen Gross 1 month ago
On 29.10.24 13:13, Andrew Cooper wrote:
> On 29/10/2024 12:02 pm, Jürgen Groß wrote:
>> On 29.10.24 13:01, Andrew Cooper wrote:
>>> On 29/10/2024 11:50 am, Samuel Thibault wrote:
>>>> Juergen Gross, le mar. 29 oct. 2024 12:41:58 +0100, a ecrit:
>>>>> Grub-pv needs start_info_union and phys_to_machine_mapping to be
>>>>> accessible. Export both symbols.
>>>>>
>>>>> Fixes: 33411a11f848 ("Mini-OS: hide all symbols not exported via
>>>>> EXPORT_SYMBOLS()")
>>>>> Reported-by: Natanael Copa <ncopa@alpinelinux.org>
>>>>> Signed-off-by: Juergen Gross <jgross@suse.com>
>>>> Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
>>>
>>> Committed.
>>>
>>> Jurgen, what do you want to do with updating 4.19?  Don't we need to
>>> fork a 4.19 branch to avoid the CONFIG_XC change ?
>>
>> Yes, I think this is the way to go.
> 
> Ok.  https://xenbits.xen.org/gitweb/?p=mini-os.git;a=summary
> 
> master has this fix, and there's a new branch, xen-stable-4.19, starting
> from the xen-RELEASE-4.19.0 tag with this change backported.
> 
> Xen 4.18 and earlier don't have the symbol restrictions.

You want a related patch on the Xen 4.19 branch to update the Mini-OS
commit in Config.mk.


Juergen
Re: [Mini-OS PATCH] Add missing symbol exports for grub-pv
Posted by Andrew Cooper 1 month ago
On 29/10/2024 12:17 pm, Juergen Gross wrote:
> On 29.10.24 13:13, Andrew Cooper wrote:
>> On 29/10/2024 12:02 pm, Jürgen Groß wrote:
>>> On 29.10.24 13:01, Andrew Cooper wrote:
>>>> On 29/10/2024 11:50 am, Samuel Thibault wrote:
>>>>> Juergen Gross, le mar. 29 oct. 2024 12:41:58 +0100, a ecrit:
>>>>>> Grub-pv needs start_info_union and phys_to_machine_mapping to be
>>>>>> accessible. Export both symbols.
>>>>>>
>>>>>> Fixes: 33411a11f848 ("Mini-OS: hide all symbols not exported via
>>>>>> EXPORT_SYMBOLS()")
>>>>>> Reported-by: Natanael Copa <ncopa@alpinelinux.org>
>>>>>> Signed-off-by: Juergen Gross <jgross@suse.com>
>>>>> Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
>>>>
>>>> Committed.
>>>>
>>>> Jurgen, what do you want to do with updating 4.19?  Don't we need to
>>>> fork a 4.19 branch to avoid the CONFIG_XC change ?
>>>
>>> Yes, I think this is the way to go.
>>
>> Ok.  https://xenbits.xen.org/gitweb/?p=mini-os.git;a=summary
>>
>> master has this fix, and there's a new branch, xen-stable-4.19, starting
>> from the xen-RELEASE-4.19.0 tag with this change backported.
>>
>> Xen 4.18 and earlier don't have the symbol restrictions.
>
> You want a related patch on the Xen 4.19 branch to update the Mini-OS
> commit in Config.mk.
>

I've only made change to minios.git.  None to Xen.

They'll need separate patches.

~Andrew