Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for arm64? #152

Open
shockx2 opened this issue Jan 18, 2018 · 3 comments
Open

Support for arm64? #152

shockx2 opened this issue Jan 18, 2018 · 3 comments

Comments

@shockx2
Copy link

shockx2 commented Jan 18, 2018

I tried to port f-stack with reference board include SoC that support DPDK.
(SoC vender: NXP or Marvell...)
I modifed lib/Makefile and complete cross compile.
But, Segmentation fault occured in ff_freebsd_init()
Do you have any plan to support arm64 architecture?
And Do you have nice idea to resolve the Segmentation fault?

#0 get_curthread () at ./machine_include/machine/pcpu.h:62
#1 0x000000000042d988 in sysctl_load_tunable_by_oid_locked (
oidp=0x7d5390 <sysctl___kern_smp_disabled>)
at /home/sehoon/workspace/macchiatobin/f-stack/lib/../freebsd/kern/kern_sysctl.c:221
#2 0x000000000042e03c in sysctl_register_oid (
oidp=0x7d5390 <sysctl___kern_smp_disabled>)
at /home/sehoon/workspace/macchiatobin/f-stack/lib/../freebsd/kern/kern_sysctl.c:423
#3 0x000000000042ebfc in sysctl_register_all (arg=0x0)
at /home/sehoon/workspace/macchiatobin/f-stack/lib/../freebsd/kern/kern_sysctl.c:797
#4 0x00000000004075c0 in mi_startup () at ff_init_main.c:260
#5 0x00000000004070c0 in ff_freebsd_init () at ff_freebsd_init.c:111
#6 0x0000000000510234 in ff_init (argc=5, argv=0x7ffffffc28) at ff_init.c:47

Thread 1 "udp_receiver" hit Breakpoint 4, get_curthread ()
at ./machine_include/machine/pcpu.h:62
62 __asm __volatile("ldr %0, [x18]" : "=&r"(td));
(gdb) list
57 static inline struct thread *
58 get_curthread(void)
59 {
60 struct thread *td;
61
62 __asm __volatile("ldr %0, [x18]" : "=&r"(td));
63 return (td);
64 }
65
66 #define curthread get_curthread()

@whl739
Copy link
Member

whl739 commented Jan 18, 2018

Do you have any plan to support arm64 architecture?

No, becuase we don't have any arm64 machine for now.

About the segment fault, it seemed that you havn't include the lib/include/machine/pcpu.h first.
See the file:

#include_next <machine/pcpu.h>

#undef __curthread

static __inline struct thread *
__curthread_ff(void)
{
    return (pcurthread);
}
#define __curthread __curthread_ff

Or, maybe you need add:

#undef curthread

@jeff-lv-github
Copy link

I tried to port f-stack with reference board include SoC that support DPDK. (SoC vender: NXP or Marvell...) I modifed lib/Makefile and complete cross compile. But, Segmentation fault occured in ff_freebsd_init() Do you have any plan to support arm64 architecture? And Do you have nice idea to resolve the Segmentation fault?

#0 get_curthread () at ./machine_include/machine/pcpu.h:62 #1 0x000000000042d988 in sysctl_load_tunable_by_oid_locked ( oidp=0x7d5390 <sysctl___kern_smp_disabled>) at /home/sehoon/workspace/macchiatobin/f-stack/lib/../freebsd/kern/kern_sysctl.c:221 #2 0x000000000042e03c in sysctl_register_oid ( oidp=0x7d5390 <sysctl___kern_smp_disabled>) at /home/sehoon/workspace/macchiatobin/f-stack/lib/../freebsd/kern/kern_sysctl.c:423 #3 0x000000000042ebfc in sysctl_register_all (arg=0x0) at /home/sehoon/workspace/macchiatobin/f-stack/lib/../freebsd/kern/kern_sysctl.c:797 #4 0x00000000004075c0 in mi_startup () at ff_init_main.c:260 #5 0x00000000004070c0 in ff_freebsd_init () at ff_freebsd_init.c:111 #6 0x0000000000510234 in ff_init (argc=5, argv=0x7ffffffc28) at ff_init.c:47

Thread 1 "udp_receiver" hit Breakpoint 4, get_curthread () at ./machine_include/machine/pcpu.h:62 62 __asm __volatile("ldr %0, [x18]" : "=&r"(td)); (gdb) list 57 static inline struct thread * 58 get_curthread(void) 59 { 60 struct thread *td; 61 62 __asm __volatile("ldr %0, [x18]" : "=&r"(td)); 63 return (td); 64 } 65 66 #define curthread get_curthread()

I am porting the project to arm64 and meet some crash problems;
Could you share your setps in porting f-stack?

@jeff-lv-github
Copy link

Do you have any plan to support arm64 architecture?

No, becuase we don't have any arm64 machine for now.

About the segment fault, it seemed that you havn't include the lib/include/machine/pcpu.h first. See the file:

#include_next <machine/pcpu.h>

#undef __curthread

static __inline struct thread *
__curthread_ff(void)
{
    return (pcurthread);
}
#define __curthread __curthread_ff

Or, maybe you need add:

#undef curthread

Could you share the experience about porting freebsd in x86?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants