Use lsof to check for processes that still open /dev/mcosX at shutdown
time.
If lsof is not installed then the check is just not done (empty PROCS
result)
If -k is not passed, print a message listing pids of users and exit
(taking bets someone will use that and sed to kill out of mcstop+release
and rerun the stop script instead of passing -k at some point)
Change-Id: Idba7486fdede4990d9885d23f8077f33839daeed
Setting CMAKE_C_FLAGS_DEBUG does not work as first expected:
- set(... CACHE) didn't do anything because the variables were
initialized previously
- We could set with FORCE but then users could not change the value
- There is a way to only do that on initial cmake run but it has the
same problem
Thus, use a new regular cache variable directly instead
Change-Id: I20741fb385c171c6c1088bbd6c25666067e07288
Since arm64 shares the return value with the area of
the first argument, rewriting the return value before
the system call execution completes destroys the first argument.
Change-Id: I959944879254d8dd3a29489a65d8f274d45338e6
Fujitsu: POSTK_DEBUG_ARCH_DEP_110
Some memobjs (e.g. devobj) will not be considered 'in memobj' by
page_is_in_memobj.
Instead of trying to play whack-a-mole with the non-fileobj memobjs,
base the copy check on range's memobj and VR_PRIVATE (do not copy
MAP_SHARED mappings, so the fault handler will do the right thing™
when required)
Change-Id: Ic32cdc7766754f6559753b34845eb8c5cff6ed13
Refs: #1255
old gcc versions are stupid with nested structs and need us
to initialize .tickets.head and .tickets.tail in one go
Change-Id: I0d4caf8236066e7edf4a12e3270114132ced9585
The midr_* part of the struct was never used, and confuses older gcc
with partially uninitialized assignments that were not correct.
Just flatten the struct
Change-Id: I7a9cfe064ab97cdcd5ac50ce4fb713c4d7983bd3
These variables cannot be used uninitialized, and newer gcc versions
correctly do not bring the warning up, but this will shut up older ones
Change-Id: I2b2ea9b557196a3e7eea1e04dd1f160bd12d6e54
use generic struct zero initializer instead.
Older gcc used on arm also seem to have trouble with '{}',
so use '{ 0 }' instead
Change-Id: I83d43b05f8d1d44e1dd86502b48e28fe242e1db2
arch_setup_vdso() needs to return something even on panic to please gcc.
In theory, flagging panic() with __attribute__((noreturn)) should work
just the same and is a much better solution but for some reason on older
gcc versions setting the flag leads to the weak memset() symbol not
being found !?
Change-Id: Ifed100df5440ca24bb495817db9afc79f0ba6751
The arrays first init every fields to invalid op then override a few
fields, since this is not something we want to allow everywhere use
a GCC pragma to only ignore the warning there.
Change-Id: I498546fe60d60d4b000d711e22e04c8c360b5b83
We do not need two debug.h files.
Take Fujitsu's STATIC_ASSERT over BUILD_BUG_ON because it is more used
Change-Id: If04c17fbb7406ab15fe86267fed8d6da460cec62
Fujitsu: POSTK_DEBUG_ARCH_DEP_9
Fujitsu added this ifdef together with ifndef __arch64__ and thus disabled
the option for both archs in practice; it probably does not hurt to restore...
I'm not sure I see the point of disabling the option at mcexec level though,
but who am I to care.
Change-Id: I0d4bffb6ed325edac8ae577773e19c0fff6ca2ed
Fujitsu: POSTK_DEBUG_ARCH_DEP_53
Don't ask me why this shares POSTK_DEBUG_ARCH_DEP_50 with the ksym lookups...
Change-Id: Ic3db2cd77ca88be361cefec85d8ed9deb21ffcd8
Fujitsu: POSTK_DEBUG_ARCH_DEP_50
There are valid use cases where a remote page fault has no available
thread data/packet available to use, e.g. when device driver threads
need to access the data (BXI).
Do the per thread data lookup to use the right channel/tid if available,
and use mcctrl_ikc_send_wait with a new message number directly.
The fault is no longer handled in mckernel syscall forwarding code but
in the ikc handler directly in irq, this should be ok because page
faults are interrupts anyway so the code should be irq-safe.
Change-Id: Ie60f413cdaee6c1a824b4a2c93637899cb9bf9c9
Everything already uses kallsyms_lookup_name or similar, this
was leftover from when the build system was ported ages ago
Change-Id: I09dd0249845df90ab2e0adc28d0eb285c0ebb64b
Fujitsu: POSTK_DEBUG_ARCH_DEP_50
coredump() proceeds as follows:
1. coredump() calls gencore()
2. gencore() allocates ELF header to stack
3. gencore() prepares the core table and record the address of the ELF
header to the table and return to coredump()
4. coredump() offloads __NR_coredump with the address of the core
table
This fix prevents the ELF header from getting destroyed in the 3rd
step.
Change-Id: I770418c1658a6fdb640bb491fc076a31dfd41c22
Fujitsu: POSTK_TEMP_FIX_39
CPack takes the source dir as is, so if it was used to build something
it will incorrectly grab the temporary CMakeCache file and cmake will
complain during rpmbuild later on.
The BuildRequires should be a separate patch but logic behind the change
is that the dependencies need to be installed in the sysroot, and
rpmbuild cannot test this, so just move them all to only enforce
BuildRequires for native build.
And while we are here, also add a new kernel_dir specfile option.
Change-Id: Ie67932798f632e6d307f8ead93bdbe043e6e8898
- 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