[Barrelfish-users] Two problems in arm appcore booting code
Wang Nan
wangnan0 at huawei.com
Wed Jul 10 11:53:44 CEST 2013
Hi,
I found 2 problems when booting armv7 appcores:
1:
After appcore bootup, monitor unmap cpu_buf_memory AFTER the cap destroied, which will cause cap-not-found error.
I suggest following patch, which unmap the buffer BEFORE destroy the cap.
diff --git a/usr/monitor/arch/armv7/boot.c b/usr/monitor/arch/armv7/boot.c
index 876b475..885c1ee 100644
--- a/usr/monitor/arch/armv7/boot.c
+++ b/usr/monitor/arch/armv7/boot.c
@@ -392,6 +392,12 @@ errval_t spawn_xcore_monitor(coreid_t coreid, int hwid, enum cpu_type cpu_type,
/* Clean up */ // XXX: Should not delete the remote cap
+
+ err = vspace_unmap(cpu_buf_memory);
+ if (err_is_fail(err)) {
+ USER_PANIC_ERR(err, "vspace unmap CPU driver memory failed");
+ }
+
err = cap_destroy(cpu_memory_cap);
if (err_is_fail(err)) {
USER_PANIC_ERR(err, "cap_destroy failed");
@@ -400,10 +406,6 @@ errval_t spawn_xcore_monitor(coreid_t coreid, int hwid, enum cpu_type cpu_type,
if (err_is_fail(err)) {
USER_PANIC_ERR(err, "cap_destroy failed");
}
- err = vspace_unmap(cpu_buf_memory);
- if (err_is_fail(err)) {
- USER_PANIC_ERR(err, "vspace unmap CPU driver memory failed");
- }
return SYS_ERR_OK;
}
2.
monitor use ram_set_affinity before allocing cpu_memory_cap, which I believe is to make cpu driver to reside in directly mapped physical memory. But spawn_memory_cap is freely allocated, and not
guarantee to reside in directly mapped memory.
I suggest to use ram_set_affinity before following line:
err = frame_alloc(&spawn_memory_cap, ARM_CORE_DATA_PAGES * arch_page_size,
NULL);
More information about the Barrelfish-users
mailing list