Skip to content
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

PSRAM 2MB's EID indistinguishable from lookup failure (QEMU-239) #117

Open
muggenhor opened this issue Jan 24, 2025 · 0 comments · May be fixed by #119
Open

PSRAM 2MB's EID indistinguishable from lookup failure (QEMU-239) #117

muggenhor opened this issue Jan 24, 2025 · 0 comments · May be fixed by #119
Assignees

Comments

@muggenhor
Copy link

muggenhor commented Jan 24, 2025

(Found this while reading through the code, so the bug report template is irrelevant.)

The EID lookup function returns the same number/constant for the error case as it does when requested to allocate 2 MiB of PSRAM:

qemu/hw/misc/ssi_psram.c

Lines 58 to 59 in 48b3fa9

case 2:
return 0x00;

vs error:

qemu/hw/misc/ssi_psram.c

Lines 68 to 71 in 48b3fa9

default:
qemu_log_mask(LOG_UNIMP, "%s: PSRAM size %" PRIu32 "MB not implemented\n",
__func__, size_mbytes);
return 0;

I.e. 0x00 == 0.

This causes this false positive error to be emitted:

qemu/hw/misc/ssi_psram.c

Lines 196 to 198 in 48b3fa9

if (get_eid_by_size(s->size_mbytes) == 0) {
error_report("[PSRAM] Invalid size %dMB for the PSRAM", s->size_mbytes);
}

Project release version

48b3fa9

@github-actions github-actions bot changed the title PSRAM 2MB's EID indistinguishable from lookup failure PSRAM 2MB's EID indistinguishable from lookup failure (QEMU-239) Jan 24, 2025
muggenhor added a commit to muggenhor/qemu that referenced this issue Jan 24, 2025
To be able to distinguish them from valid EIDs.

Fixes espressif#117
@muggenhor muggenhor linked a pull request Jan 24, 2025 that will close this issue
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants