<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 12 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        text-align:justify;
        text-justify:inter-ideograph;
        font-size:10.5pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"\6279\6CE8\6846\6587\672C Char";
        margin:0cm;
        margin-bottom:.0001pt;
        text-align:justify;
        text-justify:inter-ideograph;
        font-size:9.0pt;
        font-family:"Calibri","sans-serif";}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin:0cm;
        margin-bottom:.0001pt;
        text-align:justify;
        text-justify:inter-ideograph;
        text-indent:21.0pt;
        font-size:10.5pt;
        font-family:"Calibri","sans-serif";}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.Char
        {mso-style-name:"\6279\6CE8\6846\6587\672C Char";
        mso-style-priority:99;
        mso-style-link:\6279\6CE8\6846\6587\672C;}
.MsoChpDefault
        {mso-style-type:export-only;}
/* Page Definitions */
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="ZH-CN" link="blue" vlink="purple" style="text-justify-trim:punctuation">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">Dear All,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> I’m working to emulate a RAM allocator on barrelfish mem_serv.I used lib mm to initialize and allocate the RAM in mem_serv’s way, but now I encountered a problem.
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">When I allocate a small RAM from a big block, we use slot_prealloc_refill function to refill a slab, then the refill func need to retype the node which is found in the mm_node tree. In this way, the node could not be
retyped because it can’t be looked up(Case 1: At first I used cnode_super to be the mem_cap which is not initialized in a user domain). Then I used the ACPI’s way instead (I create a cnode and cnoderef to do cnode_super’s job and also create the mem_cap from
a RAM), when I use cap_copy to create a cap from RAM, it is INVALID to retype(case 2).
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> Case1:<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:189.0pt;mso-para-margin-left:18.0gd"><span lang="EN-US">ERROR: failed to init slot allocator<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:189.0pt;mso-para-margin-left:18.0gd"><span lang="EN-US">Failure: ( libmm) Nested failure in slot allocator calling mm_alloc [MM_ERR_SLOT_MM_ALLOC]<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:189.0pt;mso-para-margin-left:18.0gd"><span lang="EN-US">Failure: ( libbarrelfish) Failure in cap_retype() [LIB_ERR_CAP_RETYPE]<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:189.0pt;mso-para-margin-left:18.0gd"><span lang="EN-US">Failure: ( kernel) Error looking up source capability [SYS_ERR_SOURCE_CAP_LOOKUP]<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:189.0pt;mso-para-margin-left:18.0gd"><span lang="EN-US">Failure: ( kernel) Capability not found (empty slot encountered) [SYS_ERR_CAP_NOT_FOUND]<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:189.0pt;mso-para-margin-left:18.0gd"><span lang="EN-US">Aborted<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-left:189.0pt;mso-para-margin-left:18.0gd"><span lang="EN-US">Case 2:<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:189.0pt;mso-para-margin-left:18.0gd"><span lang="EN-US">ERROR: failed to init slot allocator<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:189.0pt;mso-para-margin-left:18.0gd"><span lang="EN-US">Failure: ( libmm) Nested failure in slot allocator calling mm_alloc [MM_ERR_SLOT_MM_ALLOC]<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:189.0pt;mso-para-margin-left:18.0gd"><span lang="EN-US">Failure: ( libbarrelfish) Failure in cap_retype() [LIB_ERR_CAP_RETYPE]<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:189.0pt;mso-para-margin-left:18.0gd"><span lang="EN-US">Failure: ( kernel) Invalid source/destination type pair for retyping [SYS_ERR_INVALID_RETYPE]<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:189.0pt;mso-para-margin-left:18.0gd"><span lang="EN-US">Aborted<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:189.0pt;mso-para-margin-left:18.0gd"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">So, How mem_serv’s mm_node struct define the cap? (Is it the node’s corresponding RAM which manages base & size or another thing?)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Which type the cap should be? Which type should I use? (CNode/RAM/Fram/…?)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">How the cap’s type transfer when I chunk a node? (Because cap_retype defines the cap must be CNode type, and transfer to mm_ram’s registed type. Should it transfer from CNODE to RAM?)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Best Regards<o:p></o:p></span></p>
</div>
</body>
</html>