Double allocation of UTCB__MAPPING in Pistachio

View: New views
2 Messages — Rating Filter:   Alert me  

Double allocation of UTCB__MAPPING in Pistachio

by Moritz Kroll :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

This looks like a double commit in
l4ka-pistachio-38b2e96fc5a6/kernel/src/glue/v4-x86/space.cc:703:

    /* MYUTCB mapping
     * allocate a full page for all myutcb pointers.
     * access must be performed via gs:0, when setting up the gdt
     * each processor gets a full cache line to avoid bouncing
     * page is user-writable and global
     */
    EXTERN_KMEM_GROUP(kmem_misc);
    add_mapping((addr_t)UTCB_MAPPING,
        virt_to_phys(kmem.alloc(kmem_misc, X86_PAGE_SIZE)),
        pgent_t::size_4k, true, false, true);

    EXTERN_KMEM_GROUP(kmem_misc);
    utcb_page = kmem.alloc(kmem_misc, X86_PAGE_SIZE);
    ASSERT(utcb_page);
    add_mapping((addr_t)UTCB_MAPPING,  virt_to_phys(utcb_page),
        pgent_t::size_4k, true, false, true);

I guess, the first mapping should be removed. Am I right?

Best regards
Moritz Kroll



RE: Double allocation of UTCB__MAPPING in Pistachio

by Philipp Kupferschmied :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> I guess, the first mapping should be removed. Am I right?

I think you're right. Seems as if this had been introduced when the implementations for IA32 and AMD64 were merged. I removed the first mapping.

Thanks for the hint,
Philipp