-
Notifications
You must be signed in to change notification settings - Fork 97
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
Bring up Linux kernel #508
base: master
Are you sure you want to change the base?
Conversation
b21d054
to
fd87884
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Benchmarks
Benchmark suite | Current: 0574e35 | Previous: 36d664e | Ratio |
---|---|---|---|
Dhrystone |
1515 Average DMIPS over 10 runs |
1530 Average DMIPS over 10 runs |
1.01 |
Coremark |
1426.81 Average iterations/sec over 10 runs |
1417.099 Average iterations/sec over 10 runs |
0.99 |
This comment was automatically generated by workflow using github-action-benchmark.
@@ -90,7 +90,7 @@ enum op_field { | |||
) \ | |||
/* RV32 Zicsr Standard Extension */ \ | |||
IIF(RV32_HAS(Zicsr))( \ | |||
_(csrrw, 0, 4, 0, ENC(rs1, rd)) \ | |||
_(csrrw, 1, 4, 0, ENC(rs1, rd)) \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If SYSTEM
configuration is set, the Zicsr should be set accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If
SYSTEM
configuration is set, the Zicsr should be set accordingly.
Zicsr is enabled by default if no configuration file or ENABLE_Zicsr
parameter is used. So, would it be better notice this on README is good enough?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Zicsr is enabled by default if no configuration file or
ENABLE_Zicsr
parameter is used. So, would it be better notice this on README is good enough?
It would be good to document the two configuration options and clarify the dependency in build system.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Zicsr is enabled by default if no configuration file or
ENABLE_Zicsr
parameter is used. So, would it be better notice this on README is good enough?It would be good to document the two configuration options and clarify the dependency in build system.
Mentioned in README. Also mentioned that ENABLE_Zifencei
, ENABLE_EXT_M
and ENABLE_EXT_A
are mandatory. see 0915b75
Can you exploit the prebuilt image files used by semu? |
Yes, intended. Ultimately, the Image in current build directory will be removed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move the hardware model files such as UART and PLIC to the directory src/devices
for maintenance purposes.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as resolved.
This comment was marked as resolved.
@@ -1018,6 +1107,8 @@ static void __trap_handler(riscv_t *rv) | |||
assert(insn); | |||
|
|||
rv_decode(ir, insn); | |||
reloc_enable_mmu_jalr_addr = rv->PC; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is reloc_enable_mmu_jalr_addr
generally available? It should be SYSTEM specific.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is. Thanks for pointing out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ICYMI, is the __trap_handler
already conditionally built by SYSTEM?
261b2be
to
dd0b1c5
Compare
- modify Makefile to enable detect devices directory - decouple PLIC and UART into separate files - Bind RISC-V core to plic_t to enable sending interrupt from PLIC to core
You can create a file containing the necessary version setting in directory
Agree. Can you specify the explicit rules to trigger the builds for Linux kernel and/or rootfs? |
Got it.
Yes, I will include the CI trigger rules in this PR. |
With the Linux image and ELF executable already separated, it is also necessary to decouple the tags. Add the suffix 'Linux-Image' for the Linux image release artifact and 'ELF' for the test bench ELF executable. Additionally, include the Buildroot and Linux kernel version files in .ci/. Updating either of these files will trigger a rebuild of the Linux image artifact.
bb46246
to
fa9181b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use eval
to generalize variables.
See https://github.com/sysprog21/mado/blob/main/mk/common.mk
64abe47
to
f60e662
Compare
Use the released Linux image once it becomes available in rv32emu-prebuilt. |
Let's stick with the Linux v6.1.y in this PR. Bump to v6.6.y in new PR after this. |
13062be
to
6d8f3a3
Compare
Prebuilt Linux image are available now. Please give it a try. The |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw repeated messages as following:
Can you clarify this? By the way, I attempted to run
|
I have used a SMP-enabled Linux configuration to build the Linux kernel, thus the remote fence SBI probing is working to enable flushing cache in different core but there is no corresponding SBI implementation currently. Two ways to suppress this:
Nonetheless, the remote fence SBI is an essential future feature for accurately simulating SMP behavior. Also, note that the repeated message appears in semu as well.
I have encountered the same issue. But, when using |
- reuse mk/external.mk to verify integrity of the source. - let build-system-image Makefile target can be reused in build-artifact CI. - the download, extract and verify function in mk/external.mk are adjusted since git CLI command is added to pull buildroot and Linux. Note that the '*/.git/*' of a git cloned repository has to be filtered out during SHA value verification because the metadata is difference every time when cloning. - all linux image store in build/linux-image directory.
e4481d6
to
201f7cc
Compare
Note that ENABLE_SYSTEM=1 shall be specified
201f7cc
to
ab8b756
Compare
The rv32emu-prebuilt latest release tag has been added suffix After merging this PR, the new release of test benches will automatically have the suffix |
Why uppercase |
I think it just a typical naming convention when mentioning ELF format, but please let me know if you prefer something different. |
The Linux image rebuild will be triggered if and only if the version of them are changed in mk/external.mk.
Hi! I have observed that random occurrences of segmentation faults, kernel panics, and crashes are happening. It feels like approximately one out of every five or six runs results in one of these issues. The tests were conducted on Commit The command I used is:
For multiple tests afterward, I used:
Below is one of the kernel panic cases:
Below is another crash example:
Below is another segmentation fault example:
|
I have identified several issues here. A segmentation fault occurs in the Also, the Additionally, the program randomly enters an unresponsive state. In such cases, it gets stuck in the following code, and the behavior looks like it gets into an infinite loop: /* BNE: Branch if Not Equal */
RVOP(
bne,
{ BRANCH_FUNC(uint32_t, ==); },
GEN({
rald2, rs1, rs2;
cmp, VR1, VR0;
break;
setjmpoff;
jcc, 0x85;
cond, branch_untaken;
jmp, pc, 4;
end;
ldimm, TMP, pc, 4;
st, S32, TMP, PC;
exit;
jmpoff;
cond, branch_taken;
jmp, pc, imm;
end;
ldimm, TMP, pc, imm;
st, S32, TMP, PC;
exit;
})) When stuck in this code, the local variables Below is the log at the time of the segmentation fault:
|
@Mes0903 Hi, thanks for your several testing, appreciate that! The Upon investigation, some page faults are successfully detected and handled by the |
To make PTE variable more semantic. Also, it can be easily to support more MMU schema afterwards.
Clone the branch:
Checkout the repo:
Fetch prebuilt Linux image and run:
To exit VM: