-
Notifications
You must be signed in to change notification settings - Fork 334
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
target/riscv: move the dcsr modification out of program buffer #1190
base: riscv
Are you sure you want to change the base?
Conversation
83bd140
to
46e3fe5
Compare
src/target/riscv/riscv-013.c
Outdated
if (register_read_direct(target, &dcsr, GDB_REGNO_DCSR) != ERROR_OK) | ||
return ERROR_FAIL; | ||
|
||
/* dcsr.mprven <- 0 */ |
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 do you set the filed to zero
unconditionally ? should not we preserve the original 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.
riscv_program_load_mprv()
set the dcsr.mprven
to zero unconditionally, and I followed its logic. If I set riscv virt2phys_mode
back to sw, dcsr.mprven
should set to zero?
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.
should not we preserve the original value?
Strictly speaking, I don't think we should -- dcsr
value is managed by the debugger exclusively. Though either approach should work just fine.
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.
@lz-bro, thank you for the patch!
Please take a look at my suggestions.
67516c3
to
af1b33a
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.
LGTM.
Only a minor nitpick.
af1b33a
to
5c47203
Compare
when riscv virt2phys_mode is hw, reduce the use of unnecessary program buffers.
5c47203
to
1390357
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.
Oh, great catch!
LGTM
When riscv virt2phys_mode is hw, reduce the use of unnecessary program buffers. See #1188 for the original issue.