Commit Graph

2092 Commits

Author SHA1 Message Date
7da5fede8b Test "Scalable Vector Extension (SVE) support." on arm64
Change-Id: I3abaca932985a06b06887b962e769f2eac96c738
2019-02-27 06:26:00 +00:00
6810506c3d rusage: Fix available page sizes
Change-Id: I418075ff4b5341e0f5c7ff317e96461879a60f87
2019-02-22 14:08:18 +09:00
c82c2c1231 uti: Redirect uti thread futex() to McKernel do_futex()
Change-Id: I8203d0b60236e3ec72e22615a52907e1fff2c73c
2019-02-22 04:14:14 +00:00
5bc54a3bbe Fixed time processing.
- arm64: Get TSC corresponding to boot time from IHK.

- x86_64: Calculate the current time using vdso.

Refs: #1186
Fujitsu: POSTK_DEBUG_ARCH_DEP_52
Change-Id: I293ba4bbe5390d50dea44b8a5b7471f59237daff
2019-02-22 04:13:13 +00:00
07aa96ef95 arm64: Scalable Vector Extension (SVE) support.
Change-Id: I3568687913f583edfaa297d5cf5ac91d319d97e9
2019-02-22 04:07:29 +00:00
dac99f708c test: Add test programs for #1195
Refs: #1195
Change-Id: I21339f2597caf1704cc7d104e4bc5835d5270af6
2019-02-19 16:29:00 +09:00
f3c9fbf4ea rusage: Don't count PF_PATCH change
Fujitsu: POSTK_DEBUG_TEMP_FIX_86

Change-Id: Ia23f2d95c67062be3390acafad3e87f087466cdc
2019-02-18 14:50:56 +09:00
54122360e8 CMake: move CONFIG_ARM64_64K_PAGES and VA_BITS up to main CMakeLists
user code also needs these defines; there was a hard-coded
definition left out from debugging that didn't get cleaned up

Change-Id: I951fcd6a3d6bc1d1f1c3e897058908167520f7bc
2019-02-18 10:09:21 +09:00
21cf953a03 x86: disable zero mapping and add a boot pt for ap trampoline
the application processor trampoline needs the trampoline physical
address to be mapped for the few instructions between loading the
page table and jumping to normal memory area; setup a new pt for them.

Also make it use its stack where it needs to be directly.

With that, x86 can finally remove the 0 page from its init mapping

Change-Id: Iab3f33a2ed22570eeb47b5ab6e068c9a17c25413
fj_test_201902
2019-02-14 07:59:03 +00:00
c59d8db1b3 CMake: define RHEL_RELEASE_VERSION in config.h for non-rhel kernels
Change-Id: Iaa48e763be71e9cbc8dff6335810d3191bb3c177
2019-02-14 16:44:09 +09:00
abc0a7bdac mcs_rwlock: remove aligned(64) attribute if ENABLE_UBSAN
The attribute would impose 64-bytes alignment that we do not
respect later because the whole structures (e.g. process/thread)
are allocated at 32bytes boundaries with kmalloc

These are however justified for performance reason as we do not want
them on same page cache line, so just accept slower performance for
UBSAN only

Change-Id: Ia28968257675b7ae97b0391471986e6bf6485b7b
2019-02-14 16:44:09 +09:00
2f456b8752 cmake: Add ENABLE_UBSAN for -fsanitize=undefined
Change-Id: I73db5f904a7d86052aae62e67b01281763c83561
2019-02-14 16:44:09 +09:00
2a63c962fc build system switch to cmake
Remove old build system at the same time

Change-Id: Ifdffe1fcd4cfece05f036d8de6e7cb74aca65f62
2019-02-14 16:44:09 +09:00
4bdd9cf512 ubsan: remove most sprintf calls
sprintf is implemented as snprintf(..., INT_MAX, ...) which will overflow
the argument pointer for the end, then fix the end to be -1.
This technically works but we know the actual buffer size in all these
call sites, might as well do this properly

Change-Id: I807d09f46a0221f539063fda515e1c504e658d40
2019-02-14 16:44:09 +09:00
bc2a444828 ubsan: fix undefined shifts
A signed integer cannot be shifted in a way that will flip the
sign bit; make such arguments unsigned to be safe

Change-Id: Iafc060f98f899ae3ffb876ba22fdd6183fbb6e57
2019-02-14 16:44:09 +09:00
d9b2924249 Update patch for "Add test programs for large page"
Change-Id: I6ee96b677c65c5bf4b2312059abd689225c0581d
2019-02-14 16:26:20 +09:00
501531f3b3 shmobj: Don't page_unmap() when count isn't one in shmobj_destroy()
Change-Id: If9d567d61e1dc4db808a2aeee290034acf7be4b5
2019-02-14 16:26:19 +09:00
366e95856c Null-check ihk_os_t and mcctrl_usrdata pointers
Change-Id: I941c58d4ab6a0c1ce6bd53c24b552218a1716750
Refs: #1216
2019-02-14 16:26:19 +09:00
bdf5175d4c invalidate_one_page: Support shmobj and contiguous PTE
Change-Id: I15b74ee4afd8e2dc52c933925aae4a1e0d8bcc72
2019-02-14 16:26:18 +09:00
b174fb8099 move_pages: Check flags argument
Change-Id: Ia74aa463a060ecd43aa56ee08d622421f227dbfe
Fujitsu: POSTK_TEMP_FIX_78
2019-02-14 16:26:16 +09:00
e828398c8b do_mmap: don't pre-populate the whole file when asked for smaller segment
The linker maps parts of libs with different access flags,
so we cannot prepopulate the whole file.

[dominique.martinet@cea.fr: moved min and friends in compiler.h]
Change-Id: Ifbeddc0908699099cfae5ce9cc2adc578221db31
2019-02-14 16:26:15 +09:00
641d9f1b39 clear_range_l1, clear_range_middle: Fix handling contiguous PTE
Change-Id: I2609c94d7f9342fe25aa9a5cfc208375274d46fa
2019-02-14 16:26:14 +09:00
c1270cdf6d fileobj, shmobj: free pages in object destructor (as opposed to page_unmap())
Change-Id: I3ea50fc13ae5c090ba32aad4461f9741a4c35665
2019-02-14 16:26:00 +09:00
022e04b62b shmobj: Clean up code around memory_stat_rss_sub call
Change-Id: I6f678568c3c27799cd2a81f5574b96fd218e942f
2019-02-14 16:26:00 +09:00
9cfc373538 Refactor "do write back only MAP_SHARED pages"
* free_process_memory_range() always passes memobj to
  ihk_mc_pt_free_range()
* clear_range_*() don't flush page in fileobj with MF_PRIVATE flag

Fujitsu: POSTK_DEBUG_TEMP_FIX_87
Change-Id: I8d46d029b3fc51ca6f0e59d748a2fe93e324a374
2019-02-14 16:25:58 +09:00
fb24dcea2e unhandled_page_fault: Refactor architecture dependent parts
Fujitsu: REQ-12
Refs: #1012
Change-Id: I3c61f9cd3f514bdcd4a7f26e7c15043529269cf5
2019-02-14 16:25:57 +09:00
207d653b41 mcctrl: use vmf_insert_pfn for kernel >= 4.18
vmf_insert_pfn got added as a wrapper around vm_insert_pfn in 4.17
1c8f422059ae5da ("mm: change return type to vm_fault_t") and totally
replaced the later in 4.20 ae2b01f37044c ("mm: remove vm_insert_pfn()")

Compare with 4.18 here specifically to avoid troubles when rhel
backports this change later, and avoid adding a rhel version check down
the road.

Change-Id: Ibf108e2fb6f1199f89cde6a7973f4eb55447260b
2019-02-14 16:25:49 +09:00
0a49b6eca5 Add test programs for #1190
Change-Id: Icb63e898d5882e1fab18e6af7859af50448a1d60
2019-02-14 16:25:44 +09:00
950ea678dd Reject "setfsuid: Specify mcexec tid when asking mcexec for fsuid"
This fix is rejected because it only makes the setfsuid test in ostest
pass and doesn't fix the other issues including the one in which file
I/O could be done with the old fsuid because an mcexec thread with an
arbitrary tid could handle the system-call offload request.

Explanation of the rejected fix:

  setfsuid() proceeds as follows:

  1. McKernel asks mcexec for __NR_setfsuid (set)
  2. mcexec calls setfsuid, reports the id to McKernel
  3. McKernel asks mcexec for __NR_setfsuid (get)
  4. mcexec calls mcexec_getcred(), reports the id to Mckernel
  5. McKernel sets proc->fsuid to the obtained value

  tid of mcexec on the 2nd and 4th step could be different. So this
  fix lets mcexec report its tid on the 2nd step and McKernel specify
  it in the 3rd step.

Change-Id: Id5cfeed18c64430d576a56e961bbca1ecb2e39ad
Fujitsu: POSTK_DEBUG_TEMP_FIX_45
2019-02-14 04:42:32 +00:00
cd42d186b7 uti: Report error of offloading ioctl if any
Change-Id: If4218b9fb89f34728c4aaf81bccab2dfbb0d4a87
2019-02-14 04:15:44 +00:00
66bc44f88a Readme.md: move figures to R-CCS server
Change-Id: I6a861c15402c8e925e3692b912a8df3f6f0ffce9
2019-02-13 18:26:18 +09:00
34a995d290 perfctr_stop: add flags to no 'disable_intens'
The original fujitsu code added a whole new ihk_mc_perfctr_stop_first
function, duplicating a lot of code - add a flag to existing function
instead.

Change-Id: Ic9ce0236d68f967ff72cf88e5d9f1bda5c98aa1b
Fujitsu: POSTK_DEBUG_ARCH_DEP_107
2019-02-12 05:18:22 +00:00
d0d99adfb3 Readme.md for github
Change-Id: Ib5aa5cde10acb5f5956212f8c451baedc940d123
2019-02-12 02:37:09 +00:00
d78883c692 fix to missing exclusive processing between terminate() and
finalize_process().

The process of making a child process zombie and the process of setting
the parent of the child process to process ID 1 are excluded.

Refs: #1257
Change-Id: Ic95d4d8ee92d6a4a63847e5eda20ec1ba92566ac
2019-02-08 10:25:20 +09:00
ff0395581c Register PPD and release_handler at the same time.
Fix that process will remain even if signal is received between PPD
registration and release_handler registration.

Refs: #1201
Fujitsu: POSTK_DEBUG_TEMP_FIX_64
Change-Id: I571781963578df8cedb327f19298f595cfb137a3
2019-02-08 10:20:58 +09:00
f5023c9730 page fault handler: protect thread accesses
current cpu's thread can be NULL during init, we don't want null derefs
in the page fault handler

Change-Id: I0a2c22b39cae2c258d211317cffc2408e19f3bbf
2019-02-07 02:41:50 +00:00
fe08ac4a67 arm: turn off cpu on panic
Since interrupts are disabled on panic, linux cannot reset a
panic'd core when NMI are disabled (for e.g. mcreboot/mcstop)

Just always offline it, so linux can get it back

Change-Id: If8107172375f2924e02bd4c36e24645ec38a8999
2019-02-07 02:37:31 +00:00
60dcd0e798 move rusage into kernel ELF image (avoid dynamic alloc before NUMA init)
Change-Id: I7fe86244c8707694b379e567b31de65ee2c56887
2019-02-07 10:43:47 +09:00
4d215de641 Separate mmap area from program loading (relocation) area
We need to separate the two because the heap of a PIE is created in
the area to which it is mapped.

Related commits:

b1309a5d: PIE is mapped at map_end instead of at
          user_start
c4219655: Interpreter is mapped to map_start to make a
          system call that dereferences a NULL pointer fail

[dominique.martinet@cea.fr: Also add ULONG_MAX and friend macroes,
 used for data_min]
[ken.sato.ty@hitachi-solutions.com: fix execve]
Change-Id: I8ecaf22b7965090ab67bebece57c68283ba23664
2019-02-07 09:58:03 +09:00
97e0219f50 Make Linux handler run when mmap to procfs.
Change-Id: I98a3d098c5c676f33c83fa4354c623988ee591f2
Refs: #1222
2019-02-06 11:54:50 +00:00
f9d8d98af1 sysfs: add missing symlinks for cpu/node
Add the following patterns of symlinks:
 - /sys/bus/cpu/drivers/processor/cpu*
 - /sys/bus/node/devices/node*

And slightly change how /sys/devices/system/cpu/cpu*/node* are created
to avoid duplicate lookups

Change-Id: Id94a4d157da06d75f6bd450d5bd9a9e7709a1414
2019-02-06 09:55:54 +00:00
3738b70ad3 git hooks: fix submodule check sloppy match
Submodule check used to match any file containing submodule name (e.g.
lib/include/ihk/foo would match ihk and incorrectly be identified as
a submodule change) -- properly check for full name with anchors instead

Change-Id: Ib4330aec97e9da713cd3ab9e791962f2e0c8d396
2019-02-06 08:34:27 +00:00
9bf225d193 mckernel overlay: replace mcoverlayfs with a soft userspace overlay
mcoverlayfs has a high maintenance burden and does not work on rhel8's 4.18
kernel (while it works on vanilla 4.18...); instead of debugging this further
time is better spent making it independent from overlayfs.

Change-Id: I7454ae95b0fbb3373c256aa2fd83cdfec466c009
2019-02-06 08:27:25 +00:00
6fc9ec1c92 gencore: finish reintegration into arch-independent code
Change-Id: Ic2fc935aeec17c54931817bf43f67ef6da78adc8
Fujitsu: POSTK_DEBUG_ARCH_DEP_18
2019-02-06 17:23:54 +09:00
112ade484a page_table: Fix return value of lookup_pte when ptl4 is blank
Change-Id: I5926fedda182941a4b7a2fe480bffb12d4069713
2019-02-06 07:30:44 +00:00
be708674d3 Reject "do_migrate: Send IPI"
Change-Id: If77a51c9bc6a3caef502dd35a276b0dba22b4d24
Fujitsu: POSTK_TEMP_FIX_57
2019-02-06 04:11:16 +00:00
557f33a705 eliminate futex_cmpxchg_enabled check (not used and dereffed a NULL pointer)
Change-Id: I97b0e79acfd51b57eeaa6556eba880d231330f01
2019-02-06 02:47:31 +00:00
7dd0cbd9a6 ARM: eliminate zero page mapping (i.e, init_low_area())
Change-Id: I89bcce7fb286a4c5983a768534a0d3cea093040c
2019-02-04 04:22:24 +00:00
6ed2e5ffc1 Fix ThunderX2 write-combined PTE flag insanity
Change-Id: I59999a680b556acf3e22ac516f4758e3aee7f355
2019-02-01 21:03:19 +09:00
649059f2d2 contiguous PTE: Fix requested page-shift check
Change-Id: Iafc505457f7e10c94142070113870cd8b8c6922d
2019-02-01 21:01:27 +09:00