Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 29 Oct 2022 12:21:41 -0300
From:      Mitchell Horne <mhorne@freebsd.org>
To:        Cy Schubert <Cy.Schubert@cschubert.com>
Cc:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   Re: git: 1da65dcb1c57 - main - linux: populate sv_syscallnames in each sysentvec
Message-ID:  <87ba6e9b-fa69-d131-0941-6688d58ae029@freebsd.org>
In-Reply-To: <20221029150145.6BD6713@slippy.cwsent.com>
References:  <202210282133.29SLXqfq064166@gitrepo.freebsd.org> <20221029150145.6BD6713@slippy.cwsent.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 10/29/22 12:01, Cy Schubert wrote:
> In message <202210282133.29SLXqfq064166@gitrepo.freebsd.org>, Mitchell
> Horne wr
> ites:
>> The branch main has been updated by mhorne:
>>
>> URL: https://cgit.FreeBSD.org/src/commit/?id=1da65dcb1c57fae7be75ddf1bd300ddf
>> 19ced850
>>
>> commit 1da65dcb1c57fae7be75ddf1bd300ddf19ced850
>> Author:     Mitchell Horne <mhorne@FreeBSD.org>
>> AuthorDate: 2022-10-28 21:19:39 +0000
>> Commit:     Mitchell Horne <mhorne@FreeBSD.org>
>> CommitDate: 2022-10-28 21:21:08 +0000
>>
>>      linux: populate sv_syscallnames in each sysentvec
>>      
>>      This allows the syscallname() function to give a usable result for Linux
>>      ABIs.
>>      
>>      Reported by:    jrtc27
>>      Reviewed by:    jrtc27, markj, jhb
>>      MFC after:      1 week
>>      Sponsored by:   The FreeBSD Foundation
>>      Differential Revision:  https://reviews.freebsd.org/D37199
>> ---
>>   sys/amd64/linux/linux_sysvec.c     | 3 ++-
>>   sys/amd64/linux32/linux32_sysvec.c | 3 ++-
>>   sys/arm64/linux/linux_sysvec.c     | 3 ++-
>>   sys/i386/linux/linux_sysvec.c      | 3 ++-
>>   4 files changed, 8 insertions(+), 4 deletions(-)
>>
>> diff --git a/sys/amd64/linux/linux_sysvec.c b/sys/amd64/linux/linux_sysvec.c
>> index abb498370f79..2a9e4909340b 100644
>> --- a/sys/amd64/linux/linux_sysvec.c
>> +++ b/sys/amd64/linux/linux_sysvec.c
>> @@ -110,6 +110,7 @@ extern char _binary_linux_vdso_so_o_end;
>>   static vm_offset_t linux_vdso_base;
>>   
>>   extern struct sysent linux_sysent[LINUX_SYS_MAXSYSCALL];
>> +extern const char *linux_syscallnames[];
>>   
>>   SET_DECLARE(linux_ioctl_handler_set, struct linux_ioctl_handler);
>>   
>> @@ -729,7 +730,7 @@ struct sysentvec elf_linux_sysvec = {
>>   	    SV_SIG_WAITNDQ | SV_TIMEKEEP,
>>   	.sv_set_syscall_retval = linux_set_syscall_retval,
>>   	.sv_fetch_syscall_args = linux_fetch_syscall_args,
>> -	.sv_syscallnames = NULL,
>> +	.sv_syscallnames = linux_syscallnames,
>>   	.sv_shared_page_base = LINUX_SHAREDPAGE_LA48,
>>   	.sv_shared_page_len = PAGE_SIZE,
>>   	.sv_schedtail	= linux_schedtail,
>> diff --git a/sys/amd64/linux32/linux32_sysvec.c b/sys/amd64/linux32/linux32_s
>> ysvec.c
>> index bd10d659979c..15caa5a2c2cc 100644
>> --- a/sys/amd64/linux32/linux32_sysvec.c
>> +++ b/sys/amd64/linux32/linux32_sysvec.c
>> @@ -113,6 +113,7 @@ extern char _binary_linux32_vdso_so_o_end;
>>   static vm_offset_t linux_vdso_base;
>>   
>>   extern struct sysent linux32_sysent[LINUX32_SYS_MAXSYSCALL];
>> +extern const char *linux32_syscallnames[];
>>   
>>   SET_DECLARE(linux_ioctl_handler_set, struct linux_ioctl_handler);
>>   
>> @@ -882,7 +883,7 @@ struct sysentvec elf_linux_sysvec = {
>>   	    SV_SIG_DISCIGN | SV_SIG_WAITNDQ | SV_TIMEKEEP,
>>   	.sv_set_syscall_retval = linux32_set_syscall_retval,
>>   	.sv_fetch_syscall_args = linux32_fetch_syscall_args,
>> -	.sv_syscallnames = NULL,
>> +	.sv_syscallnames = linux32_syscallnames,
>>   	.sv_shared_page_base = LINUX32_SHAREDPAGE,
>>   	.sv_shared_page_len = PAGE_SIZE,
>>   	.sv_schedtail	= linux_schedtail,
>> diff --git a/sys/arm64/linux/linux_sysvec.c b/sys/arm64/linux/linux_sysvec.c
>> index 362917c3de31..41ac2912be29 100644
>> --- a/sys/arm64/linux/linux_sysvec.c
>> +++ b/sys/arm64/linux/linux_sysvec.c
>> @@ -98,6 +98,7 @@ extern char _binary_linux_vdso_so_o_end;
>>   static vm_offset_t linux_vdso_base;
>>   
>>   extern struct sysent linux_sysent[LINUX_SYS_MAXSYSCALL];
>> +extern const char *linux_syscallnames[];
>>   
>>   SET_DECLARE(linux_ioctl_handler_set, struct linux_ioctl_handler);
>>   
>> @@ -576,7 +577,7 @@ struct sysentvec elf_linux_sysvec = {
>>   	    SV_SIG_WAITNDQ | SV_TIMEKEEP,
>>   	.sv_set_syscall_retval = linux_set_syscall_retval,
>>   	.sv_fetch_syscall_args = linux_fetch_syscall_args,
>> -	.sv_syscallnames = NULL,
>> +	.sv_syscallnames = linux_syscallnames,
>>   	.sv_shared_page_base = LINUX_SHAREDPAGE,
>>   	.sv_shared_page_len = PAGE_SIZE,
>>   	.sv_schedtail	= linux_schedtail,
>> diff --git a/sys/i386/linux/linux_sysvec.c b/sys/i386/linux/linux_sysvec.c
>> index e964f475a393..f67b19725cdf 100644
>> --- a/sys/i386/linux/linux_sysvec.c
>> +++ b/sys/i386/linux/linux_sysvec.c
>> @@ -96,6 +96,7 @@ extern char _binary_linux_vdso_so_o_end;
>>   static vm_offset_t linux_vdso_base;
>>   
>>   extern struct sysent linux_sysent[LINUX_SYS_MAXSYSCALL];
>> +extern const char *linux_syscallnames[];
>>   
>>   SET_DECLARE(linux_ioctl_handler_set, struct linux_ioctl_handler);
>>   
>> @@ -782,7 +783,7 @@ struct sysentvec linux_sysvec = {
>>   	    SV_SIG_DISCIGN | SV_SIG_WAITNDQ,
>>   	.sv_set_syscall_retval = linux_set_syscall_retval,
>>   	.sv_fetch_syscall_args = linux_fetch_syscall_args,
>> -	.sv_syscallnames = NULL,
>> +	.sv_syscallnames = linux_syscallnames,
>>   	.sv_schedtail	= linux_schedtail,
>>   	.sv_thread_detach = linux_thread_detach,
>>   	.sv_trap	= NULL,
>>
> 
> This results in the following error:
> 
> cwsys# nice -20 poudriere bulk -j HEADamd64 -J 4 -p prod -f _bulk-queue
> kldload: an error occurred while loading module linux. Please check
> dmesg(8) for more details.
> [00:00:02] Error: Required kernel module 'linux' not found
> cwsys#
> 
> 
> dmesg shows:
> 
> link_elf_obj: symbol linux32_syscallnames undefined
> linker_load_file: /boot/kernel/linux.ko - unsupported file type
> 
> 

This is my bad, I only compile-tested the change :(

Thank you for the report, I am testing the fix. It is only a matter of 
adding the missing source file to each module... but I'll ensure it 
actually loads for each architecture before committing.

Cheers,
Mitchell



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?87ba6e9b-fa69-d131-0941-6688d58ae029>