Commit Graph

413 Commits

Author SHA1 Message Date
Takayuki Okamoto
3bd0137c25 Fix some race condition on arm64
* move barrier() to architecture depended region
* add barrier() in issue_ipi, kprintf, map_virtual
* enable the workaround for cavium thunderx
2017-10-18 09:20:51 +09:00
Dominique Martinet
217dd9c1e5 x86 set_signal: panic if interrupt came from kernel
This makes debugging errors e.g. FPE from kernel much easier,
we really shouldn't be taking a user level coredump blaming user
in that case anyway
2017-10-13 10:02:11 +09:00
Dominique Martinet
d4cd756a91 x86/cpu.c: unhandled page fault: print pre-fault stack
Do basic manual unwinding and print raw stack addresses, with a
suggested invocation of addr2line to pretty-print the result.
2017-10-13 10:02:11 +09:00
Dominique Martinet
b962da700b do_signal: ignore SIGWINCH
McKernel would terminate() running program on terminal resizing
It actually looks like there is nothing for us to do when we
get that anyway (tested with `dialog`)
2017-10-13 10:02:11 +09:00
Dominique Martinet
196379854b Fix a few more harmless compiler warnings:
- myfree in pager.c was called with an argument, so add one to the
dummy definition
- pgoff is offset_t (unsigned) and doesn't need to be compared to 0
- clang says '*(int *)0 = 0' will be optimized away instead of keeping
the segfault without a volatile hint (?! that is wrong!), but it causes
no harm to add anyway.
2017-10-13 10:02:11 +09:00
Dominique Martinet
4d4279121b process/vm; replace vm_range list by a rbtree
This replaces the chained list used to keep track of all memory ranges
of a process by a standard rbtree (no need of interval tree here
because there is no overlap)

Accesses that were done directly through vm_range_list before were
replaced by lookup_process_memory_range, even full list scan (e.g.
coredump).
The full scans will thus be less efficient because calls to rb_next()
will not be inlined, but these are rarer calls that can probably afford
this compared to code simplicity.

The only reference to the actual backing structure left outside of
process.c is a call to rb_erase in xpmem_free_process_memory_range.

v2: fix lookup_process_memory_range with small start address

v3: make vm_range_insert error out properly

Panic does not lead to easy debug, all error paths
are handled to just return someting on error

v4: fix lookup_process_memory_range (again)

That optimistically going left was a more serious bug than just
last iteration, we could just pass by a match and continue down
the tree if the match was not a leaf.

v5: some users actually needed leftmost match, so restore behavior
without the breakage (hopefully)
2017-10-13 10:00:27 +09:00
Tomoki Shirasawa
99da5b6484 ptrace: unify flags PT_TRACE_SYSCALL_ENTER and PT_TRACE_SYSCALL_EXIT to PT_TRACE_SYSCALL
refs #961
2017-10-11 15:43:57 +09:00
Ken Sato
a1a2900606 ptrace: Fix the timing of save_fp_regs, and Add copy fp_regs to child in clone_thread
refs #702
2017-09-27 17:02:30 +09:00
Masamichi Takagi
79b977ac06 Check xgetbv availability before use for machines without it (i.e. KVM) 2017-09-26 19:31:34 +09:00
Tomoki Shirasawa
df3f388e09 syscall: set -ENOSYS to syscall_return before calling ptrace_syscall_enter
refs #943
2017-09-26 14:25:49 +09:00
Tomoki Shirasawa
a2fbe99b60 madvise: support MADV_DONTDUMP/DODUMP
refs #661
2017-09-26 14:21:40 +09:00
Masamichi Takagi
daa7526127 rusage and ihklib: Fix out-of-memory reporting and cleanup
1. Fix OOM: Count memory usage only when allocation succeeded
2. Fix OOM: Make user allocation fail when memory is running out
3. Fix OOM: Move rusage_init() before numa_init()
4. Cleanup: Rename ihkconfig/ihkosctl functions
5. Cleanup: Pass event type to eventfd()
6. Cleanup: arch/.../rusage.h --> arch/.../arch_rusage.h
2017-09-20 15:11:57 +09:00
Masamichi Takagi
aa7cb970c4 ihk_os_getrusage(): Compile LWK-specific results in mcctrl
1. User asks mcctrl for the result via ihk_os_getrusage() with passing void *
2. mcctrl compiles the results and passes them to the user
3. User interprets it by using the type defined in the LWK-specific header
2017-09-20 15:03:45 +09:00
Dominique Martinet
230272438f init_fpu: only call xgetbv if we have XSAVE cpuid
xgetbv crashes on cpu without avx, the XSAVE bit seems to indicate
that it is ok to call xgetbv
2017-09-12 18:27:28 +09:00
Katsuya Horigome
a05b6e1ba8 Expand dump-functions for excluding user/unused memory (This is rebase commit for merging to development) 2017-09-11 15:49:04 +09:00
Takayuki Okamoto
0278a876db disable POSTK_DEBUG_* on x86_64 2017-09-07 22:20:22 +09:00
Takayuki Okamoto
9a550b310c Add hwcap.h for x86 2017-09-06 11:10:32 +09:00
Takayuki Okamoto
9989f41fd3 add arm64 support
- add arm64 dependent codes with GICv3 and SVE support
- fix bugs based on architecture separation requests
2017-09-05 15:06:27 +09:00
Balazs Gerofi
90fbfd6f7d clear_range_l3(): remove debug message 2017-09-04 08:33:42 +09:00
Yutaka Ishikawa
236a072311 Add qlmpi and swap to mckernel (This is rebase commit for merging to development) 2017-08-29 15:04:58 +09:00
Masamichi Takagi
74f15783d2 ihk_os_getrusage(): Add per-page-size memory usage accounting 2017-08-17 12:49:34 +09:00
Masamichi Takagi
86dedc32fa Eliminate Japanese comments 2017-07-15 20:04:16 +09:00
Balazs Gerofi
bf5ac7afc8 remote_flush_tlb_array_cpumask(): bundle remote TLB invalidations 2017-07-21 15:34:48 +09:00
Tomoki Shirasawa
64c2e437c6 open: check filename address (re-commit) 2017-07-19 11:37:55 +09:00
Balazs Gerofi
dd9675d65e NUMA: only print a short summary at boot time 2017-07-19 09:11:44 +09:00
Tomoki Shirasawa
d7b8e7f4f4 fix to count user pages
refs #864
2017-07-14 09:51:39 +09:00
Masamichi Takagi
8d57ad9bc4 pmc_start, pmc_stop: Error check on counter number 2017-07-11 19:05:45 +09:00
Balazs Gerofi
4c0f401424 move_pages(): parallel implementation v1 2017-07-08 18:36:05 +09:00
Balazs Gerofi
06f824c829 pte_update_phys(): update physical address of a PTE 2017-07-08 18:36:05 +09:00
Balazs Gerofi
209748d913 visit_pte_range(): visit L1 PTEs but don't free for MF_PREMAP files 2017-07-08 18:36:04 +09:00
Balazs Gerofi
2189c55d99 x86: ASM fast memset() 2017-07-08 18:26:51 +09:00
Masamichi Takagi
e64bd49d9e Add comment for x86_sregs 2017-07-03 10:43:36 +09:00
Tomoki Shirasawa
07efb3ab9a support to utility thread offloading 2017-06-27 13:27:09 +09:00
Masamichi Takagi
fa6f20a3c4 Correct comments in gencore.c 2017-06-16 21:47:23 +09:00
Balazs Gerofi
5758dba7cf use spinlocks in MCS rwlock 2017-06-08 14:16:29 +09:00
Balazs Gerofi
dd2ef89997 SMP: generic function call facility for CPU sets 2017-05-28 07:41:48 +09:00
Balazs Gerofi
ba7edf1981 move out local IRQ vector definitions to shared header 2017-05-28 07:36:21 +09:00
Balazs Gerofi
9b5ccb5a33 Pre-map file mappings from /dev/shm (--mpol-shm-premap mcexec argument) 2017-05-23 20:00:06 +09:00
Balazs Gerofi
e3e0f6a174 mcexec: introduction of --profile 2017-05-23 02:42:06 +09:00
Balazs Gerofi
32c8f6192d unhandled_page_fault(): print registers for kernel mode PF 2017-05-23 02:42:05 +09:00
Balazs Gerofi
21373338cc mcctrl: IHK CPU register manipulation implementation 2017-05-20 12:38:14 +09:00
Katsukura
ba58054c9d create rusage branch. 2017-05-19 10:30:36 +09:00
Ken Sato
d66af42f7b Revert "IKC: separate IRQ between Master-channel and Regular-channel"
This reverts commit 3c98b9410966ceebe187ebae1038317b628fbb03.
2017-05-19 10:26:30 +09:00
Ken Sato
65dc3440cb IKC: separate IRQ between Master-channel and Regular-channel 2017-05-19 10:26:30 +09:00
Ken Sato
fbd9086ce5 IKC: delete recieve channel list 2017-05-19 10:26:29 +09:00
Ken Sato
c2b1d8e3ef IKC: delete the comments for review 2017-05-19 10:26:29 +09:00
Ken Sato
8daffa939e IKC: distribute IKC-interrupt to Linux cpus. 2017-05-19 10:26:29 +09:00
Balazs Gerofi
9992fe0d72 mcctrl: support remote CPU MSR read/write operations 2017-05-05 00:01:43 +09:00
Ken Sato
e6c4d7731d Merge remote-tracking branch 'origin/rusage'
Conflicts:
	configure
	kernel/process.c
2017-04-27 15:10:38 +09:00
Katsukura
8c9b207557 configure : add option --enable-rusage 2017-04-27 14:00:59 +09:00