Commit 6a39f5be authored by Charles Jacobsen's avatar Charles Jacobsen Committed by Vikram Narayanan

pmfs: mount: Fixed memory mapping bug in microkernel.

Wasn't storing metadata in cnode in cspace in a certain case.
parent 2f5ea458
......@@ -579,6 +579,7 @@ void __lcd_put_memory_object(struct lcd *caller, struct cnode *cnode,
* @mo: the memory object to map
* @meta: the per-LCD mapping metadata associated with the memory object
* @base: the base physical address to map the memory object at
* @cnode: the cnode in the @lcd's cspace where @mo is
*
* Maps the memory object in a contiguous chunk of the LCD's physical
* address space. Note: For non-isolated LCD's, this function is a no-op (all
......@@ -590,7 +591,8 @@ void __lcd_put_memory_object(struct lcd *caller, struct cnode *cnode,
int __lcd_do_map_memory_object(struct lcd *lcd,
struct lcd_memory_object *mo,
struct lcd_mapping_metadata *meta,
gpa_t base);
gpa_t base,
struct cnode *cnode);
/**
* __lcd_map_memory_object -- See __lcd_do_map_memory_object.
......
......@@ -280,7 +280,7 @@ static int do_map(struct lcd *lcd, struct lcd_memory_object *mo,
* memory as mapped for non-isolated code right now)
*/
ret = __lcd_do_map_memory_object(lcd, mo, cap_cnode_metadata(cnode),
__gpa(0));
__gpa(0), cnode);
if (ret) {
LIBLCD_ERR("physical map failed");
goto fail1;
......
......@@ -279,8 +279,10 @@ static int lookup_memory_object(struct cspace *cspace, cptr_t slot,
* Look up
*/
ret = cap_cnode_get(cspace, slot, cnode);
if (ret)
if (ret) {
LCD_ERR("microkernel couldn't get memory object");
goto fail1;
}
/*
* Confirm it's a memory object
*/
......@@ -470,7 +472,8 @@ static int isolated_map_memory_object(struct lcd *lcd,
int __lcd_do_map_memory_object(struct lcd *lcd,
struct lcd_memory_object *mo,
struct lcd_mapping_metadata *meta,
gpa_t base)
gpa_t base,
struct cnode *cnode)
{
int ret;
/*
......@@ -488,6 +491,7 @@ int __lcd_do_map_memory_object(struct lcd *lcd,
ret = -ENOMEM;
goto out;
}
cap_cnode_set_metadata(cnode, meta);
}
if (meta->is_mapped) {
ret = -EALREADYMAPPED;
......@@ -549,7 +553,7 @@ int __lcd_map_memory_object(struct lcd *caller, cptr_t mo_cptr, gpa_t base)
/*
* Do the map
*/
ret = __lcd_do_map_memory_object(caller, mo, meta, base);
ret = __lcd_do_map_memory_object(caller, mo, meta, base, cnode);
if (ret)
goto fail2;
/*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment