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

What is the best way to port the lkl code back old linux kernel(like 3.2.16)? #251

Open
weiqiandai opened this issue Oct 15, 2016 · 2 comments

Comments

@weiqiandai
Copy link

Try to find out the list of files outside arch/lkl that LKL modified. Look like the master branch don't have the latest tag (the last one in the master branch is v4.7-rc7) - not v4.8.
Need to study the diff and port the LKL code to based on old linux kernel (like 3.2.16).
Would like to get your suggestion to accomplish this task.
thanks,
Weiqian

@M1cha
Copy link

M1cha commented Oct 15, 2016

you can use git diff c8d2bc9 for that. c8d2bc9 is that latest merged upstream tag.
If you do a git diff --stat --diff-filter=M c8d2bc9 which excludes new files and only shows a statistics instead of a full diff you can see that the number of changes is actually very small:

 MAINTAINERS                       |  8 ++++++++
 Makefile                          |  1 +
 crypto/xor.c                      |  2 ++
 fs/xfs/xfs_buf.c                  | 27 +++++++++++++++++++++++++++
 include/asm-generic/atomic64.h    |  2 ++
 include/asm-generic/vmlinux.lds.h |  9 +++++++--
 include/linux/compiler-gcc.h      |  4 ++++
 include/linux/cpu.h               |  2 ++
 include/linux/syscalls.h          |  6 ++++++
 init/Kconfig                      | 12 ++++++++++++
 kernel/cpu.c                      |  5 +++++
 kernel/signal.c                   |  2 +-
 lib/.gitignore                    |  1 +
 lib/raid6/.gitignore              |  1 +
 lib/raid6/algos.c                 |  9 ++++++---
 scripts/.gitignore                |  2 ++
 scripts/Makefile                  |  2 ++
 scripts/basic/.gitignore          |  2 ++
 scripts/checkpatch.pl             |  6 ++++--
 scripts/kallsyms.c                | 15 +++++++++++----
 scripts/kconfig/.gitignore        |  1 +
 scripts/link-vmlinux.sh           | 16 +++++++++++-----
 scripts/mod/.gitignore            |  1 +
 tools/Makefile                    | 12 +++++++-----
 24 files changed, 126 insertions(+), 22 deletions(-)

@weiqiandai
Copy link
Author

Hi Folks,
Need some hint to port the arch/lkl/kernel/time.c back to linux 3.2.16.
Look like it has a major changes between 4.7 and 3.2.16 on the data structure "struct clock_event_device".
The field for enum clock_event_state machine is new.
How can we initialize the structure:
static struct clock_event_device clockevent = {
.name = "lkl",
.features = CLOCK_EVT_FEAT_ONESHOT,
.set_state_oneshot = clockevent_set_state_oneshot,
.set_next_event = clockevent_next_event,
.set_state_shutdown = clockevent_set_state_shutdown,
};
Since some of the fields are new on 4.7 kernel.
Thanks,
Weiqian

thehajime pushed a commit to libos-nuse/lkl-linux that referenced this issue Oct 11, 2017
Andrey Konovalov reported a BUG caused by the ip6mr code which is caused
because we call unregister_netdevice_many for a device that is already
being destroyed. In IPv4's ipmr that has been resolved by two commits
long time ago by introducing the "notify" parameter to the delete
function and avoiding the unregister when called from a notifier, so
let's do the same for ip6mr.

The trace from Andrey:
------------[ cut here ]------------
kernel BUG at net/core/dev.c:6813!
invalid opcode: 0000 [#1] SMP KASAN
Modules linked in:
CPU: 1 PID: 1165 Comm: kworker/u4:3 Not tainted 4.11.0-rc7+ lkl#251
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs
01/01/2011
Workqueue: netns cleanup_net
task: ffff880069208000 task.stack: ffff8800692d8000
RIP: 0010:rollback_registered_many+0x348/0xeb0 net/core/dev.c:6813
RSP: 0018:ffff8800692de7f0 EFLAGS: 00010297
RAX: ffff880069208000 RBX: 0000000000000002 RCX: 0000000000000001
RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff88006af90569
RBP: ffff8800692de9f0 R08: ffff8800692dec60 R09: 0000000000000000
R10: 0000000000000006 R11: 0000000000000000 R12: ffff88006af90070
R13: ffff8800692debf0 R14: dffffc0000000000 R15: ffff88006af90000
FS:  0000000000000000(0000) GS:ffff88006cb00000(0000)
knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fe7e897d870 CR3: 00000000657e7000 CR4: 00000000000006e0
Call Trace:
 unregister_netdevice_many.part.105+0x87/0x440 net/core/dev.c:7881
 unregister_netdevice_many+0xc8/0x120 net/core/dev.c:7880
 ip6mr_device_event+0x362/0x3f0 net/ipv6/ip6mr.c:1346
 notifier_call_chain+0x145/0x2f0 kernel/notifier.c:93
 __raw_notifier_call_chain kernel/notifier.c:394
 raw_notifier_call_chain+0x2d/0x40 kernel/notifier.c:401
 call_netdevice_notifiers_info+0x51/0x90 net/core/dev.c:1647
 call_netdevice_notifiers net/core/dev.c:1663
 rollback_registered_many+0x919/0xeb0 net/core/dev.c:6841
 unregister_netdevice_many.part.105+0x87/0x440 net/core/dev.c:7881
 unregister_netdevice_many net/core/dev.c:7880
 default_device_exit_batch+0x4fa/0x640 net/core/dev.c:8333
 ops_exit_list.isra.4+0x100/0x150 net/core/net_namespace.c:144
 cleanup_net+0x5a8/0xb40 net/core/net_namespace.c:463
 process_one_work+0xc04/0x1c10 kernel/workqueue.c:2097
 worker_thread+0x223/0x19c0 kernel/workqueue.c:2231
 kthread+0x35e/0x430 kernel/kthread.c:231
 ret_from_fork+0x31/0x40 arch/x86/entry/entry_64.S:430
Code: 3c 32 00 0f 85 70 0b 00 00 48 b8 00 02 00 00 00 00 ad de 49 89
47 78 e9 93 fe ff ff 49 8d 57 70 49 8d 5f 78 eb 9e e8 88 7a 14 fe <0f>
0b 48 8b 9d 28 fe ff ff e8 7a 7a 14 fe 48 b8 00 00 00 00 00
RIP: rollback_registered_many+0x348/0xeb0 RSP: ffff8800692de7f0
---[ end trace e0b29c57e9b3292c ]---

Reported-by: Andrey Konovalov <[email protected]>
Signed-off-by: Nikolay Aleksandrov <[email protected]>
Tested-by: Andrey Konovalov <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
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

2 participants