-
Notifications
You must be signed in to change notification settings - Fork 0
target/xtensa: merge from upstream generic xtensa LX #3
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
base: master
Are you sure you want to change the base?
Conversation
erhankur
left a comment
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.
@ianstcdns finally merge is completed with little changes. I added some comments.
Automation tests are also running now. So we will be more safe with the next patches.
| } else { | ||
| reg_list[XT_USR_REG_START + i].valid = false; | ||
| } | ||
| #if 0 /* TODO: Breaks the tests. Investigate the reason. */ |
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.
@ianstcdns I had to comment out this lines.
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.
AR3 and AR4 are used as scratch registers (mostly the former but sometimes both). We're really just flagging A3 as dirty so it forces a flush when we resume. Could the value we're setting here in "a3" be wrong for some reason, maybe because of removing the earlier window state save/restore logic?
| /* NOTE: Assumes A3 has already been saved */ | ||
| static int xtensa_window_state_save(struct target *target, uint32_t *woe) | ||
| { | ||
| return ERROR_OK;/* TODO: xtensa_window_state_save/restore breaks the tests. Investigate the reason. */ |
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.
@ianstcdns fyi.
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.
please keep me posted. i did a fairly extensive register state comparison before / after various debug sessions but certainly could have missed something.
| if (reg_idx == XT_REG_IDX_FCR || reg_idx == XT_REG_IDX_FSR) | ||
| return xtensa->core_config->fp_coproc; | ||
| return false; | ||
| return; /* TODO: xtensa_window_state_save/restore breaks the tests. Investigate the reason. */ |
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.
@ianstcdns fyi
| return true; | ||
|
|
||
| return false; | ||
| } | ||
|
|
||
| /* TODO check PS change flow in the upstream. Looks like upstream branch has some issue. This is working version. */ |
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.
@ianstcdns fyi
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.
was this the issue we fixed upstream with the PS vs. EPSn change? if not, what's happening, and is there a way to reproduce it on mainline (either with my wrover-kit or a generic xtensa target)?
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 think, you can simulate with the below values;
- oldps = 60024
- xtensa->stepping_isr_mode = XT_STEPPING_ISR_OFF (xtensa maskisr on)
- xtensa->core_config->debug.irq_level = 6
newps should be set to 60025 before resume
e.g.
icountlvl = MIN((oldps & 0xF) + 1, xtensa->core_config->debug.irq_level); --> calculates 5
if ((oldps & 0xf) >= icountlvl) { --> (4 >= 5) generates false and ps not set to the new value
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.
IIRC, there was a difference between our implementations related to $icountlevel. LX uses this register to determine which instructions "count" during instruction stepping...e.g. if an instruction is run when CINTLEVEL >= ICOUNTLEVEL, then it does not increment $icount. This allows OOCD to set $icountlevel to 1 and single-step user code, and if an overflow exception or L1 interrupt comes in, allow it to run until the core returns to level 0 and $icount increments up to 0. So, we're not masking interrupts (they still occur), but we also don't step into them.
Forcibly disabling interrupts during step can cause unintended side-effects in the system, such as missing timer ticks or watchdog kicks, and should really be avoided.
I think I may have changed the behavior of "xtensa maskisr" to behave more as a "step into ISR" vs. "step over ISR" flag that leave the ISR active in both cases. Could your test be assuming the ISR is getting disabled instead?
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.
Ok I found the old discussion. erhankur/review-openocd#3 (comment)
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.
28578c1 to
3fd1d27
Compare
erhankur
left a comment
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.
@ianstcdns Some more remaining work is done. This is about rtos stackings..
|
Thanks for pulling mainline into your branch, @erhankur. Really appreciate all the time and hard work you've put in to make this solution benefit both Espressif and Cadence, and both of our customers. I know some of these changes have not been trivial, but please do let me know how I can help on our end. FYI, the only remaining significant change I have on my list to eventually make is to add NX support, although that shouldn't affect anything in LX cores. A couple of eventual bug/performance fixes should be pretty small. |
|
@ianstcdns Thanks for your support. My first goal is to get running version with all the changes. static rtos stackings are OK for now but sure I'll implement the dynamic way also. After this work done, I need to create several patches for the minor changes. If you don't mind, can you keep on hold your NX patch until we fully sync with the upstream. Promise will not take too much time :) |
|
Yes, I can definitely wait on the NX work. Let’s get your changes merged first. No big rush either—I’ve got a lot of non-OOCD work coming up over the next few months, and was planning to wait until after 0.12 at a minimum.
From: Erhan Kurubas ***@***.***>
Sent: Tuesday, September 27, 2022 6:56 AM
To: erhankur/openocd-esp32 ***@***.***>
Cc: Ian Thompson ***@***.***>; Mention ***@***.***>
Subject: Re: [erhankur/openocd-esp32] target/xtensa: merge from upstream generic xtensa LX (PR #3)
EXTERNAL MAIL
@ianstcdns<https://urldefense.com/v3/__https:/github.com/ianstcdns__;!!EHscmS1ygiU1lA!DeOmVBMgHDkrCcS6JjgKPf9_cQtqwKLEGnn1ORNufdBbY2hP08fRuSZ1l97olmsqrMRBB_TNVl30cevyQDc7Vg$> Thanks for your support. My first goal is to get running version with all the changes. static rtos stackings are OK for now but sure I'll implement the dynamic way also. After this work done, I need to create several patches for the minor changes. If you don't mind, can you keep on hold your NX patch until we fully sync with the upstream. Promise will not take too much time :)
—
Reply to this email directly, view it on GitHub<https://urldefense.com/v3/__https:/github.com/erhankur/openocd-esp32/pull/3*issuecomment-1259548575__;Iw!!EHscmS1ygiU1lA!DeOmVBMgHDkrCcS6JjgKPf9_cQtqwKLEGnn1ORNufdBbY2hP08fRuSZ1l97olmsqrMRBB_TNVl30cetoWZc7PA$>, or unsubscribe<https://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/AYE3N6I3AJ3L4GJZH764VW3WAL4HBANCNFSM6AAAAAAQUEJ7RQ__;!!EHscmS1ygiU1lA!DeOmVBMgHDkrCcS6JjgKPf9_cQtqwKLEGnn1ORNufdBbY2hP08fRuSZ1l97olmsqrMRBB_TNVl30cevtAaEAdQ$>.
You are receiving this because you were mentioned.Message ID: ***@***.******@***.***>>
|
Pull Request Template
Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
Type of change
User Impact
Please describe the impact of this change. This can be a list of positive and/or negative impacts.
Performance Impact
Please describe any relevant performance impact of this change. This can be positive or negative impact. How did you characterize/test the performance impact?
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.
Hardware Configuration:
Software Configuration:
Checklist: