Skip to content

Shared memory regions mapped as private #988

@MatthiasGr

Description

@MatthiasGr

Hello everyone,

While working with the SVSM code base, I encountered a small but hard to debug (at least for me :)).
When mapping a memory region using PageTable::map_region_4k, setting the shared flag should allocate the resulting memory region as shared addresses. The function correctly sets the address bit to do that, but then calls PageTable::map_4k, which always forces a private page address. The 2m versions of these functions have the same issue.

Since both functions are public APIs, I am not sure if just removing the call to make_private_address in map_4k would be safe. I unfortunately could not get rust-analyzer to a point where it reliably reports symbol usage across the project. One way to address this would be to just inline the call to map_{4k,2m} in the respective map_region function.

Regards
Matthias

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions