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

MAX_UNTYPED_OBJECTS too small for some processors #1257

Open
chrisguikema opened this issue Jun 10, 2024 · 2 comments
Open

MAX_UNTYPED_OBJECTS too small for some processors #1257

chrisguikema opened this issue Jun 10, 2024 · 2 comments
Assignees

Comments

@chrisguikema
Copy link
Contributor

The MAX_UNTYPED_OBJECTS configuration value is too small for a newer x86 processor DornerWorks has been using. We've run into the issue in the past on a Qualcomm processor as well. Previously, I was just able to allocate 2 pages for the BootInfo struct, but changes in the seL4 kernel seem to hardcode the BootInfo struct to 1 page.

To get things booting on my processor card, I just created a new entry in the BootInfo enum, SEL4_BOOTINFO_HEADER_EXTRA_UNTYPEDS.

Then I added an entry:

    /* populate extra untypeds block */
    {
        seL4_BootInfoHeader header;
        header.id = SEL4_BOOTINFO_HEADER_EXTRA_UNTYPEDS;
        header.len = sizeof(header) + sizeof(seL4_BootInfoExtraUntypeds);
        *(seL4_BootInfoHeader *)(extra_bi_region.start + extra_bi_offset) = header;
        extra_bi_offset += sizeof(header) + sizeof(seL4_BootInfoExtraUntypeds);
    }

In provide_untyped_cap, if the untyped objects overflow, the object is added to the extra untypeds array. If the extra untypeds header doesn't exist, then the existing behavior of printing a warning and returning is true.

Is this a good solution to the problem? I can't just not provide these resources to userspace, as they're some of the largest memory chunks available.

@axel-h
Copy link
Member

axel-h commented Jun 10, 2024

I have a pending branch axel-h#94 that allows simply increasing BI_FRAME_PAGES to provide more space for untyped caps array. Changing seL4_BootInfoFrameBits is still not possible due to the static order rootserver object are allocated. All that would break the ABI assumptions a root task might have. Your change with an extra region could implement things in a less breaking way. Do you have the patch somewhere?

@chrisguikema
Copy link
Contributor Author

I'll check to see if I'm allowed to release code. My goal was just to get something functional for now, but obviously I'd like to have things done properly, without any effect on the proof.

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

2 participants