Do not return from fork() until mcctrl side has created mckernel's
procfs entries for the child PID.
This fixes programs doing fork() immediately followed by opening
/proc/<child pid>/something, and would get some error
Refs: #1189
Change-Id: Ie10ea56b65c55f59e96a1ab6ef83a1070e36048d
This includes the following fix:
send_syscall, do_syscall: remove argument pid
Fujitsu: POSTK_TEMP_FIX_26
Refs: #1165
Change-Id: I702362c07a28f507a5e43dd751949aefa24bc8c0
We had a deadlock between:
- free_process_memory_range (take lock) -> ihk_mc_pt_free_range ->
... -> remote_flush_tlb_array_cpumask -> "/* Wait for all cores */"
and
- obj_list_lookup() under fileobj_list_lock that disabled irqs
and thus never ack'd the remote flush
The rework is quite big but removes the need for the big lock,
although devobj and shmobj needed a new smaller lock to be
introduced - the new locks are used much more locally and
should not cause problems.
On the bright side, refcounting being moved to memobj level means
we could remove refcounting implemented separately in all object
types and simplifies code a bit.
Change-Id: I6bc8438a98b1d8edddc91c4ac33c11b88e097ebb
This optimization make the offloading thread quickly yield to
another thread. Without this, it yileded only after the interval timer
set the rescheduling flag.
Change-Id: Ida3b17ed94782d5d1af0185a96b1f50d9db8d244
Defining C structures for the following objects:
(1) Remote and local context
(2) Stack of system call arguments / return values
Change-Id: Iafbb6c795bd765e3c78c54a255d8a1e4d4536288
(1) Add --enable-uti option. The binary-patch library is
preloaded with this option.
(2) Binary-patching is done by syscall_intercept developed by Intel
This commit includes the following fixes:
(1) Fix do_exit() and terminate() handling
(2) Fix timing of killing mcexec threads when McKernel thread calls terminate()
Change-Id: Iad885e1e5540ed79f0808debd372463e3b8fecea
Set PROT_EXEC to host VMA because uti needs PROT_EXEC for text VMAs.
Meanings of prot bits of Host VMA has been changed as follows.
RWX: No mapping or RW mapping
RX: Read only mapping
This is because this is a normal case since terminate() is changed so
that it first kills all mcexec threads and then kill McKernel threads.
Change-Id: I88380bf28b60645d361baded525d71105235c16f
(1) Masquerade clv
(2) Fix timeout
(3) Let mcexec thread with the same tid as McKernel thread migrating
to Linux handles the migration request
(4) Call create_tracer() before creating proxy related objects
Change-Id: I6b2689b70db49827f10aa7d5a4c581aa81319b55
One CPU could be chosen by concurrent forks because CPU selection and
runq addition are not done atomicly. So this fix makes the two steps
atomic.
Change-Id: Ib6b75ad655789385d13207e0a47fa4717dec854a
Add check for start/end being larger than the range we're checking.
Fix corner case where the access_check() was done on last vm range, and
we would be looking beyond last element (null deref)
It's enabled by adding -s to mcreboot.sh.
Cherry-pick of the following commit:
commit b5c13ce51a5a4926c2cf11c817cd0d369ac4402d
Author: Katsuya Horigome <katsuya.horigome.rj@ps.hitachi-solutions.com>
Date: Mon Nov 20 09:40:41 2017 +0900
Include measures to prevent memory destruction on Linux side (This is rebase commit for merging to development+hfi)
Device map with MAP_PRIVATE is copied when forking using copy_user_pte.
So the map isn't copied by those statements.
Futjitsu: POSTK_TEMP_FIX_14
Refs: #1039
Change-Id: I1a697ed2e003055d66a8eebd3e8d5e9e49d094ad
the pagers are all destroyed when linux thinks there is no process left,
but there is no synchronisation with mcexec on that and some new process
might have spawned and started using these pagers in the meantime,
leading to weird crashes because an invalid pager was used.
The reason we're cleaning up pagers when no process is left is that
mcctrl does not handle pager_req_release is the linux-side process got
killed or died before the mckernel one for some reason, so:
- move pager_req_release to a new __do_in_kernel_irq_syscall() helper
- have free_all_process_memory_range not set MF_HOST_RELEASED on the
memobj
- just in case, clean up everything like before on mcctrl shutdown
instead of when no process is left.
Change-Id: I53b8b9b81b1e5b807593850af17b5ea5e8471174
Refs: #1154
-ESRCH from mcctrl doesn't mean an error but the file is not a regular
file and mcctrl wants McKernel to treat it as a device file.
Change-Id: Ie121f0e6a8b1f0a29c2f2cf193a51f4f52337809