-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Arm64 irq1 #13520
Arm64 irq1 #13520
Conversation
|
1e1c326
to
2b07421
Compare
2539ba1
to
5d4b00a
Compare
8f7fb07
to
851d7ff
Compare
Summary The original implement for exception handler is very simple and haven't framework for breakpoint/watchpoint routine or brk instruction. I refine the fatal handler and add framework for debug handler to register or unregister. this is a prepare for watchpoint/breakpoint implement Signed-off-by: qinwei1 <[email protected]>
Signed-off-by: ligd <[email protected]>
851d7ff
to
a94e570
Compare
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
Summary Add a macro to obtain current execute level Signed-off-by: qinwei1 <[email protected]>
Signed-off-by: ligd <[email protected]>
Signed-off-by: lipengfei28 <[email protected]>
a94e570
to
848afc2
Compare
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
|
||
bne exc_handle | ||
|
||
#ifdef CONFIG_LIB_SYSCALL |
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.
Why exactly was this part changed??? Now you destroy the incoming system call parameter registers x0-x6, and then re-read them from the context wasting massive amounts of CPU time??
WHY WAS THIS CHANGED? I spent days making this optimized system call path to work, please restore this functionality as it was.
* cannot yet handle nested system calls. | ||
*/ | ||
|
||
regs[REG_X0] = dispatch_syscall(regs[REG_X0], regs[REG_X1], |
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.
This is completely unnecessary, the registers x0-x6 are already correct when coming from userspace. There is NO REASON TO READ THEM FROM THE CONTEXT AREA. What I had done is much more optimized than what this does.
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.
Another thing this change does; the system call now runs with interrupts disabled, affecting interrupt service latency.
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.
@lipengfei28 please take a look.
After this PR got merged, nuttx is not compiling any more. I am getting this: common/arm64_fatal.c:84:30: error: initialized field overwritten [-Werror=override-init] |
commit 8288fe4 (HEAD -> master, apache/master)
commit a5b85fc
This commit build is ok |
This PR seems problematic also for the performance; what is the reason for example for saving the FPU registers every time? Before this PR we had well working and performant arm64 in both flat and kernel builds (and extensively using FPU as well). Or why to execute system calls with interrupts disabled? That is clearly wrong. Can you please explain what is the problem this PR is trying to solve? Just to break everything for fun? Sorry to be negative, but I don't see any benefits in breaking things like this, please explain! |
FYI: I managed to get things running in our own branches again by reverting everything in this PR except for e38f2b2 |
let's revert this patch first and refine the change later. |
The idea in "arm64: refine the fatal handler" is good; I'd suggest making a separate PR of that one, on top of the existing implementation. |
@GUIDINGLI will resend the patch again. |
#if CONFIG_ARCH_ARM64_EXCEPTION_LEVEL == 3 | ||
mrs x0, esr_el3 | ||
/* Switch to IRQ stack and save current sp on it. */ | ||
#ifdef CONFIG_SMP |
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.
@GUIDINGLI I assume this is the code that SMP needs ? I can adapt this part so that kernel mode works like before. I'll try to provide a patch tomorrow, or on Monday.
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.
good
@@ -299,6 +299,9 @@ struct regs_context | |||
uint64_t spsr; | |||
uint64_t sp_el0; | |||
uint64_t exe_depth; | |||
#ifdef CONFIG_ARCH_FPU |
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 the content of this patch needed by SMP too ?
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.
The removable of FPU trap reason:
- The FPU trap logic is not stable in some SMP situation (HERE haven't the detail analysis)
- Make the logic Complex and different to read.
- The most important reason: it has almost no benefit for the performance, because the compiler will optimize the code with float/double instructions when use the option -O3 (always be). Even the printf/syslog will use use the FPU, so the FPU is used too often and almost each context switch.
Or, you must use -mgeneral-regs-only to limit the FPU registers usage, that will harmful for the speed. - How about use the FPU registers in the IRQ/SVC ISR, maybe there are hidden bugs ?
Summary
arm64: simply the vectors
Impact
Testing