Double allocation of UTCB__MAPPING in Pistachio

"Moritz Kroll" <[email protected]> Sun, 22 Feb 2009 18:04:28 +0100
Newsgroups gmane.comp.micro-kernel.l4.l4ka.general
Message-ID <3B498B3E167C42E0BE92C500F3C9898E@MComp>
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