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

arm64: silent asserts before mapping the kernel window #1191

Open
andybui01 opened this issue Feb 9, 2024 · 3 comments
Open

arm64: silent asserts before mapping the kernel window #1191

andybui01 opened this issue Feb 9, 2024 · 3 comments

Comments

@andybui01
Copy link
Contributor

This might not be a big problem, but it's just something I've encountered while debugging the kernel.

Between the elfloader jumping to the kernel and mapping the kernel window, printing is effectively disabled as the kernel UART drivers use a UART_PPTR virtual address. This means that when an assert fails the user may experience kernel "hanging" without any definite reason/clues as to why.

The workaround for this is to change the UART VA to the PA value instead, as the elfloader identity mapping will still be active at this point (mapping the kernel window).

Just wondering if a debug early-UART implementation that makes use of the elfloader 1:1 mapping makes sense.

Side note: similarly, there is a small gap between activate_kernel_vspace() and setVtable(). In this gap, the elfloader vtable will no longer be useable, and we may miss exceptions.

@Ivan-Velickovic
Copy link
Contributor

Is this a duplicate of #540?

@andybui01
Copy link
Contributor Author

Is this a duplicate of #540?

Woops, seems like it, I'm happy to close this.

Is there any real preference for a potential fix here? Since this seems to be a known thing I can work on a patch for this?

@Indanz
Copy link
Contributor

Indanz commented Feb 9, 2024

If using the 1:1 mapping is possible, your solution is better though.

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

No branches or pull requests

3 participants