<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">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; I&#8217;m working to emulate a RAM allocator on barrelfish mem_serv.I used lib mm to initialize and allocate the RAM in mem_serv&#8217;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&#8217;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&#8217;s way instead (I create a cnode and cnoderef to do cnode_super&#8217;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>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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: (&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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: (&nbsp; 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: (&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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: (&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</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: (&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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: (&nbsp; 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: (&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">So, How mem_serv&#8217;s mm_node struct define the cap?&nbsp; (Is it the node&#8217;s corresponding RAM which manages base &amp; 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/&#8230;?)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">How the cap&#8217;s type transfer when I chunk a node?&nbsp;&nbsp;&nbsp;&nbsp; (Because cap_retype defines the cap must be CNode type, and transfer to mm_ram&#8217;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>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Best Regards<o:p></o:p></span></p>
</div>
</body>
</html>