Skip to content
This repository has been archived by the owner on Apr 13, 2019. It is now read-only.

fix bug of pmpcfg_csr_read #166

Closed
wants to merge 1 commit into from
Closed

fix bug of pmpcfg_csr_read #166

wants to merge 1 commit into from

Conversation

wxjstz
Copy link

@wxjstz wxjstz commented Sep 20, 2018

related code:

target_ulong cfg_val = 0;
uint8_t val = 0;
cfg_val |= (val << (i * 8));

C language automatic type promotion to int. The length of the int under RV64 may be small with target_ulong, and the upper 32 bits can't be read.

related code:
```c
target_ulong cfg_val = 0;
uint8_t val = 0;
cfg_val |= (val << (i * 8));
```
C language automatic type promotion to int. The length of the int under RV64 may be small with target_ulong, and the upper 32 bits can't be read.
@michaeljclark
Copy link
Collaborator

All three of your changes are merged in the (default) integration branch

We can move them from:

to:

once we have tests (before/after fail/pass) for the changes...

I will help with some open source tests, so that we can put them into regression testing. We also will need to rebase qemu-for-testing with Signed-Off-By tags and links to these PRs and tests (minimal reproducers) so we can post them to upstream QEMU, the changes can be verified. We also need to verify the granularity behavior (as mentioned) due to QEMU's TLB limiting permission checks to 4K granules.

@michaeljclark
Copy link
Collaborator

thanks again

@wxjstz
Copy link
Author

wxjstz commented Sep 20, 2018

This needs to be merged. When reading pmpcfg0 / pmpcfg2 under RV64, this bug will cause the upper 32 bits to be zero.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants