Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2039139380 | |||
| c80b112ce7 | |||
| 4a05024656 | |||
| 7a04c6eb5c | |||
| 3e00189de0 | |||
| c94cf8e6f0 | |||
| ee974b200d |
@ -7,7 +7,7 @@ endif (NOT CMAKE_BUILD_TYPE)
|
|||||||
enable_language(C ASM)
|
enable_language(C ASM)
|
||||||
|
|
||||||
project(mckernel C ASM)
|
project(mckernel C ASM)
|
||||||
set(MCKERNEL_VERSION "1.7.6")
|
set(MCKERNEL_VERSION "1.7.8")
|
||||||
|
|
||||||
# See "Fedora Packaging Guidelines -- Versioning"
|
# See "Fedora Packaging Guidelines -- Versioning"
|
||||||
set(MCKERNEL_RELEASE "")
|
set(MCKERNEL_RELEASE "")
|
||||||
@ -124,6 +124,14 @@ if(ENABLE_FUGAKU_DEBUG)
|
|||||||
set(KBUILD_C_FLAGS "${KBUILD_C_FLAGS} -DENABLE_FUGAKU_DEBUG")
|
set(KBUILD_C_FLAGS "${KBUILD_C_FLAGS} -DENABLE_FUGAKU_DEBUG")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# redirect kernel messages to Linux's /dev/kmsg
|
||||||
|
option(ENABLE_KMSG_REDIRECT "Redirect kernel message to Linux's /dev/kmsg" OFF)
|
||||||
|
|
||||||
|
if(ENABLE_KMSG_REDIRECT)
|
||||||
|
add_definitions(-DENABLE_KMSG_REDIRECT)
|
||||||
|
set(KBUILD_C_FLAGS "${KBUILD_C_FLAGS} -DENABLE_KMSG_REDIRECT")
|
||||||
|
endif()
|
||||||
|
|
||||||
option(PROFILE_ENABLE "System call profile" ON)
|
option(PROFILE_ENABLE "System call profile" ON)
|
||||||
if(PROFILE_ENABLE)
|
if(PROFILE_ENABLE)
|
||||||
add_definitions(-DPROFILE_ENABLE)
|
add_definitions(-DPROFILE_ENABLE)
|
||||||
@ -340,4 +348,5 @@ message("ENABLE_WERROR: ${ENABLE_WERROR}")
|
|||||||
message("ENABLE_UBSAN: ${ENABLE_UBSAN}")
|
message("ENABLE_UBSAN: ${ENABLE_UBSAN}")
|
||||||
message("ENABLE_LINUX_WORK_IRQ_FOR_IKC: ${ENABLE_LINUX_WORK_IRQ_FOR_IKC}")
|
message("ENABLE_LINUX_WORK_IRQ_FOR_IKC: ${ENABLE_LINUX_WORK_IRQ_FOR_IKC}")
|
||||||
message("ENABLE_PER_CPU_ALLOC_CACHE: ${ENABLE_PER_CPU_ALLOC_CACHE}")
|
message("ENABLE_PER_CPU_ALLOC_CACHE: ${ENABLE_PER_CPU_ALLOC_CACHE}")
|
||||||
|
message("ENABLE_KMSG_REDIRECT: ${ENABLE_KMSG_REDIRECT}")
|
||||||
message("-------------------------------")
|
message("-------------------------------")
|
||||||
|
|||||||
@ -912,7 +912,6 @@ unsigned long cpu_enable_interrupt_save(void)
|
|||||||
return flags;
|
return flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ENABLE_FUGAKU_HACKS
|
|
||||||
int cpu_interrupt_disabled(void)
|
int cpu_interrupt_disabled(void)
|
||||||
{
|
{
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
@ -925,7 +924,6 @@ int cpu_interrupt_disabled(void)
|
|||||||
: "memory");
|
: "memory");
|
||||||
return (flags == masked);
|
return (flags == masked);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#else /* defined(CONFIG_HAS_NMI) */
|
#else /* defined(CONFIG_HAS_NMI) */
|
||||||
|
|
||||||
@ -989,6 +987,18 @@ unsigned long cpu_enable_interrupt_save(void)
|
|||||||
: "memory");
|
: "memory");
|
||||||
return flags;
|
return flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int cpu_interrupt_disabled(void)
|
||||||
|
{
|
||||||
|
unsigned long flags;
|
||||||
|
|
||||||
|
asm volatile(
|
||||||
|
"mrs %0, daif // arch_local_irq_save\n"
|
||||||
|
: "=r" (flags)
|
||||||
|
:
|
||||||
|
: "memory");
|
||||||
|
return !!(flags & 0x2);
|
||||||
|
}
|
||||||
#endif /* defined(CONFIG_HAS_NMI) */
|
#endif /* defined(CONFIG_HAS_NMI) */
|
||||||
|
|
||||||
/* we not have "pause" instruction, instead "yield" instruction */
|
/* we not have "pause" instruction, instead "yield" instruction */
|
||||||
|
|||||||
@ -1273,6 +1273,15 @@ unsigned long cpu_enable_interrupt_save(void)
|
|||||||
return flags;
|
return flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int cpu_interrupt_disabled(void)
|
||||||
|
{
|
||||||
|
unsigned long flags;
|
||||||
|
|
||||||
|
asm volatile("pushf; pop %0" : "=r"(flags) : : "memory", "cc");
|
||||||
|
|
||||||
|
return !(flags & 0x200);
|
||||||
|
}
|
||||||
|
|
||||||
/*@
|
/*@
|
||||||
@ behavior valid_vector:
|
@ behavior valid_vector:
|
||||||
@ assumes 32 <= vector <= 255;
|
@ assumes 32 <= vector <= 255;
|
||||||
|
|||||||
@ -1,3 +1,52 @@
|
|||||||
|
=============================================
|
||||||
|
Version 1.7.8 (Mar 12, 2021)
|
||||||
|
=============================================
|
||||||
|
|
||||||
|
----------------------
|
||||||
|
IHK major updates
|
||||||
|
----------------------
|
||||||
|
N/A
|
||||||
|
|
||||||
|
------------------------
|
||||||
|
IHK major bug fixes
|
||||||
|
------------------------
|
||||||
|
#. ihklib: ihk_reserve_cpu: fix job cpu check when using krm
|
||||||
|
|
||||||
|
----------------------
|
||||||
|
McKernel major updates
|
||||||
|
----------------------
|
||||||
|
N/A
|
||||||
|
|
||||||
|
------------------------
|
||||||
|
McKernel major bug fixes
|
||||||
|
------------------------
|
||||||
|
N/A
|
||||||
|
|
||||||
|
=============================================
|
||||||
|
Version 1.7.7 (Mar 11, 2021)
|
||||||
|
=============================================
|
||||||
|
|
||||||
|
----------------------
|
||||||
|
IHK major updates
|
||||||
|
----------------------
|
||||||
|
N/A
|
||||||
|
|
||||||
|
------------------------
|
||||||
|
IHK major bug fixes
|
||||||
|
------------------------
|
||||||
|
N/A
|
||||||
|
|
||||||
|
----------------------
|
||||||
|
McKernel major updates
|
||||||
|
----------------------
|
||||||
|
N/A
|
||||||
|
|
||||||
|
------------------------
|
||||||
|
McKernel major bug fixes
|
||||||
|
------------------------
|
||||||
|
#. mcexec: fput executable just after its contents is transferred
|
||||||
|
#. spec: cmake-config cmake parameters
|
||||||
|
|
||||||
=============================================
|
=============================================
|
||||||
Version 1.7.6 (Mar 11, 2021)
|
Version 1.7.6 (Mar 11, 2021)
|
||||||
=============================================
|
=============================================
|
||||||
|
|||||||
@ -166,22 +166,6 @@ Create the tarball and the spec file:
|
|||||||
make dist
|
make dist
|
||||||
cp mckernel-<version>.tar.gz <rpmbuild>/SOURCES
|
cp mckernel-<version>.tar.gz <rpmbuild>/SOURCES
|
||||||
|
|
||||||
(optional) Edit the following line in ``scripts/mckernel.spec`` to change
|
|
||||||
cmake options. For example:
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
%cmake -DCMAKE_BUILD_TYPE=Release \
|
|
||||||
-DUNAME_R=%{kernel_version} \
|
|
||||||
-DKERNEL_DIR=%{kernel_dir} \
|
|
||||||
%{?cmake_libdir:-DCMAKE_INSTALL_LIBDIR=%{cmake_libdir}} \
|
|
||||||
%{?build_target:-DBUILD_TARGET=%{build_target}} \
|
|
||||||
%{?toolchain_file:-DCMAKE_TOOLCHAIN_FILE=%{toolchain_file}} \
|
|
||||||
-DENABLE_TOFU=ON -DENABLE_FUGAKU_HACKS=ON \
|
|
||||||
-DENABLE_KRM_WORKAROUND=OFF -DWITH_KRM=ON \
|
|
||||||
-DENABLE_FUGAKU_DEBUG=OFF -DENABLE_UTI=ON \
|
|
||||||
.
|
|
||||||
|
|
||||||
Create the rpm package:
|
Create the rpm package:
|
||||||
|
|
||||||
When not cross-compiling:
|
When not cross-compiling:
|
||||||
|
|||||||
@ -2010,7 +2010,7 @@ int mcexec_open_exec(ihk_os_t os, char * __user filename)
|
|||||||
fullpath = d_path(&file->f_path, pathbuf, PATH_MAX);
|
fullpath = d_path(&file->f_path, pathbuf, PATH_MAX);
|
||||||
if (IS_ERR(fullpath)) {
|
if (IS_ERR(fullpath)) {
|
||||||
retval = PTR_ERR(fullpath);
|
retval = PTR_ERR(fullpath);
|
||||||
goto out_free;
|
goto out_put_file;
|
||||||
}
|
}
|
||||||
|
|
||||||
mcef = kmalloc(sizeof(*mcef), GFP_KERNEL);
|
mcef = kmalloc(sizeof(*mcef), GFP_KERNEL);
|
||||||
|
|||||||
@ -2419,6 +2419,7 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
#endif // MCEXEC_BIND_MOUNT
|
#endif // MCEXEC_BIND_MOUNT
|
||||||
|
|
||||||
|
/* fget executable as well */
|
||||||
if ((ret = load_elf_desc_shebang(argv[optind], &desc,
|
if ((ret = load_elf_desc_shebang(argv[optind], &desc,
|
||||||
&shebang_argv, 1 /* execvp */))) {
|
&shebang_argv, 1 /* execvp */))) {
|
||||||
fprintf(stderr, "%s: could not load program: %s\n",
|
fprintf(stderr, "%s: could not load program: %s\n",
|
||||||
@ -2860,6 +2861,14 @@ int main(int argc, char **argv)
|
|||||||
fprintf(stderr, "error: transferring image\n");
|
fprintf(stderr, "error: transferring image\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* fput executable */
|
||||||
|
if ((ret = ioctl(fd, MCEXEC_UP_CLOSE_EXEC)) != 0) {
|
||||||
|
fprintf(stderr, "error: MCEXEC_UP_CLOSE_EXEC failed with %d\n",
|
||||||
|
ret);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
fflush(stderr);
|
fflush(stderr);
|
||||||
|
|
||||||
@ -4111,11 +4120,6 @@ int main_loop(struct thread_data_s *my_thread)
|
|||||||
It is done by not calling do_syscall_return(fd, cpu, 0, 0, 0, 0, 0);
|
It is done by not calling do_syscall_return(fd, cpu, 0, 0, 0, 0, 0);
|
||||||
here and making McKernel side wait until release_handler() is called. */
|
here and making McKernel side wait until release_handler() is called. */
|
||||||
|
|
||||||
/* Drop executable file */
|
|
||||||
if ((ret = ioctl(fd, MCEXEC_UP_CLOSE_EXEC)) != 0) {
|
|
||||||
fprintf(stderr, "WARNING: close_exec() couldn't find exec file?\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
__dprintf("__NR_exit/__NR_exit_group: %ld (cpu_id: %d)\n",
|
__dprintf("__NR_exit/__NR_exit_group: %ld (cpu_id: %d)\n",
|
||||||
w.sr.args[0], cpu);
|
w.sr.args[0], cpu);
|
||||||
if(w.sr.number == __NR_exit_group){
|
if(w.sr.number == __NR_exit_group){
|
||||||
@ -4308,15 +4312,6 @@ gettid_out:
|
|||||||
__dprintf("pid(%d): signals and syscall threads OK\n",
|
__dprintf("pid(%d): signals and syscall threads OK\n",
|
||||||
getpid());
|
getpid());
|
||||||
|
|
||||||
/* Hold executable also in the child process */
|
|
||||||
if ((ret = ioctl(fd, MCEXEC_UP_OPEN_EXEC, exec_path))
|
|
||||||
!= 0) {
|
|
||||||
fprintf(stderr, "Error: open_exec() fails for %s: %d (fd: %d)\n",
|
|
||||||
exec_path, ret, fd);
|
|
||||||
fs->status = -errno;
|
|
||||||
goto fork_child_sync_pipe;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Check if we need to limit number of threads in the pool */
|
/* Check if we need to limit number of threads in the pool */
|
||||||
if ((ret = ioctl(fd, MCEXEC_UP_GET_NUM_POOL_THREADS)) < 0) {
|
if ((ret = ioctl(fd, MCEXEC_UP_GET_NUM_POOL_THREADS)) < 0) {
|
||||||
fprintf(stderr, "Error: obtaining thread pool count\n");
|
fprintf(stderr, "Error: obtaining thread pool count\n");
|
||||||
@ -4472,6 +4467,7 @@ fork_err:
|
|||||||
}
|
}
|
||||||
filename = pathbuf;
|
filename = pathbuf;
|
||||||
|
|
||||||
|
/* fget executable as well */
|
||||||
if ((ret = load_elf_desc_shebang(filename, &desc,
|
if ((ret = load_elf_desc_shebang(filename, &desc,
|
||||||
&shebang_argv, 0)) != 0) {
|
&shebang_argv, 0)) != 0) {
|
||||||
goto return_execve1;
|
goto return_execve1;
|
||||||
@ -4569,6 +4565,13 @@ return_execve1:
|
|||||||
}
|
}
|
||||||
__dprintf("%s", "execve(): image transferred\n");
|
__dprintf("%s", "execve(): image transferred\n");
|
||||||
|
|
||||||
|
/* fput executable */
|
||||||
|
if ((ret = ioctl(fd, MCEXEC_UP_CLOSE_EXEC)) != 0) {
|
||||||
|
fprintf(stderr, "error: MCEXEC_UP_CLOSE_EXEC failed with %d\n",
|
||||||
|
ret);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
if (close_cloexec_fds(fd) < 0) {
|
if (close_cloexec_fds(fd) < 0) {
|
||||||
ret = EINVAL;
|
ret = EINVAL;
|
||||||
goto return_execve2;
|
goto return_execve2;
|
||||||
|
|||||||
2
ihk
2
ihk
Submodule ihk updated: 8e637b7873...2ced7eda65
@ -87,7 +87,7 @@ void kputs(char *buf)
|
|||||||
debug_spin_unlock_irqrestore(&kmsg_buf->lock, flags_inner);
|
debug_spin_unlock_irqrestore(&kmsg_buf->lock, flags_inner);
|
||||||
kprintf_unlock(flags_outer);
|
kprintf_unlock(flags_outer);
|
||||||
|
|
||||||
if (irqflags_can_interrupt(flags_outer) &&
|
if (!cpu_interrupt_disabled() &&
|
||||||
DEBUG_KMSG_USED > IHK_KMSG_HIGH_WATER_MARK) {
|
DEBUG_KMSG_USED > IHK_KMSG_HIGH_WATER_MARK) {
|
||||||
eventfd(IHK_OS_EVENTFD_TYPE_KMSG);
|
eventfd(IHK_OS_EVENTFD_TYPE_KMSG);
|
||||||
ihk_mc_delay_us(IHK_KMSG_NOTIFY_DELAY);
|
ihk_mc_delay_us(IHK_KMSG_NOTIFY_DELAY);
|
||||||
@ -128,7 +128,7 @@ int __kprintf(const char *format, ...)
|
|||||||
}
|
}
|
||||||
|
|
||||||
debug_spin_unlock_irqrestore(&kmsg_buf->lock, flags_inner);
|
debug_spin_unlock_irqrestore(&kmsg_buf->lock, flags_inner);
|
||||||
if (irqflags_can_interrupt(flags_inner) &&
|
if (!cpu_interrupt_disabled() &&
|
||||||
DEBUG_KMSG_USED > IHK_KMSG_HIGH_WATER_MARK) {
|
DEBUG_KMSG_USED > IHK_KMSG_HIGH_WATER_MARK) {
|
||||||
eventfd(IHK_OS_EVENTFD_TYPE_KMSG);
|
eventfd(IHK_OS_EVENTFD_TYPE_KMSG);
|
||||||
ihk_mc_delay_us(IHK_KMSG_NOTIFY_DELAY);
|
ihk_mc_delay_us(IHK_KMSG_NOTIFY_DELAY);
|
||||||
@ -171,7 +171,7 @@ int kprintf(const char *format, ...)
|
|||||||
debug_spin_unlock_irqrestore(&kmsg_buf->lock, flags_inner);
|
debug_spin_unlock_irqrestore(&kmsg_buf->lock, flags_inner);
|
||||||
kprintf_unlock(flags_outer);
|
kprintf_unlock(flags_outer);
|
||||||
|
|
||||||
if (irqflags_can_interrupt(flags_outer) &&
|
if (!cpu_interrupt_disabled() &&
|
||||||
DEBUG_KMSG_USED > IHK_KMSG_HIGH_WATER_MARK) {
|
DEBUG_KMSG_USED > IHK_KMSG_HIGH_WATER_MARK) {
|
||||||
eventfd(IHK_OS_EVENTFD_TYPE_KMSG);
|
eventfd(IHK_OS_EVENTFD_TYPE_KMSG);
|
||||||
ihk_mc_delay_us(IHK_KMSG_NOTIFY_DELAY);
|
ihk_mc_delay_us(IHK_KMSG_NOTIFY_DELAY);
|
||||||
|
|||||||
@ -23,9 +23,7 @@ extern int num_processors;
|
|||||||
|
|
||||||
void cpu_enable_interrupt(void);
|
void cpu_enable_interrupt(void);
|
||||||
void cpu_disable_interrupt(void);
|
void cpu_disable_interrupt(void);
|
||||||
#ifdef ENABLE_FUGAKU_HACKS
|
|
||||||
int cpu_interrupt_disabled(void);
|
int cpu_interrupt_disabled(void);
|
||||||
#endif
|
|
||||||
void cpu_halt(void);
|
void cpu_halt(void);
|
||||||
#ifdef ENABLE_FUGAKU_HACKS
|
#ifdef ENABLE_FUGAKU_HACKS
|
||||||
void cpu_halt_panic(void);
|
void cpu_halt_panic(void);
|
||||||
|
|||||||
@ -15,6 +15,11 @@
|
|||||||
%{!?kernel_dir: %global kernel_dir /usr/src/kernels/%{kernel_version}}
|
%{!?kernel_dir: %global kernel_dir /usr/src/kernels/%{kernel_version}}
|
||||||
%define krequires %(echo %{kernel_version} | sed "s/.%{_target_cpu}$//")
|
%define krequires %(echo %{kernel_version} | sed "s/.%{_target_cpu}$//")
|
||||||
%define ktag %(echo %{krequires} | tr '-' '_' | sed -e 's/\.el[0-9_]*$//' | sed -e 's/\.\([a-zA-Z]\)/_\1/')
|
%define ktag %(echo %{krequires} | tr '-' '_' | sed -e 's/\.el[0-9_]*$//' | sed -e 's/\.\([a-zA-Z]\)/_\1/')
|
||||||
|
%if "@ENABLE_UTI@" == "ON"
|
||||||
|
%define enable_uti 1
|
||||||
|
%else
|
||||||
|
%define enable_uti 0
|
||||||
|
%endif
|
||||||
|
|
||||||
Name: mckernel
|
Name: mckernel
|
||||||
Version: @MCKERNEL_VERSION@
|
Version: @MCKERNEL_VERSION@
|
||||||
@ -77,9 +82,10 @@ pushd build
|
|||||||
%{?cmake_libdir:-DCMAKE_INSTALL_LIBDIR=%{cmake_libdir}} \
|
%{?cmake_libdir:-DCMAKE_INSTALL_LIBDIR=%{cmake_libdir}} \
|
||||||
%{?build_target:-DBUILD_TARGET=%{build_target}} \
|
%{?build_target:-DBUILD_TARGET=%{build_target}} \
|
||||||
%{?toolchain_file:-DCMAKE_TOOLCHAIN_FILE=%{toolchain_file}} \
|
%{?toolchain_file:-DCMAKE_TOOLCHAIN_FILE=%{toolchain_file}} \
|
||||||
-DENABLE_TOFU=ON -DENABLE_FUGAKU_HACKS=ON \
|
-DENABLE_TOFU=@ENABLE_TOFU@ -DENABLE_FUGAKU_HACKS=@ENABLE_FUGAKU_HACKS@ \
|
||||||
-DENABLE_KRM_WORKAROUND=OFF -DWITH_KRM=ON \
|
-DENABLE_KRM_WORKAROUND=@ENABLE_KRM_WORKAROUND@ -DWITH_KRM=@WITH_KRM@ \
|
||||||
-DENABLE_FUGAKU_DEBUG=OFF -DENABLE_UTI=ON \
|
-DENABLE_FUGAKU_DEBUG=@ENABLE_FUGAKU_DEBUG@ -DENABLE_UTI=@ENABLE_UTI@ \
|
||||||
|
-DENABLE_FJMPI_WORKAROUND=@ENABLE_FJMPI_WORKAROUND@ \
|
||||||
..
|
..
|
||||||
%make_build
|
%make_build
|
||||||
popd
|
popd
|
||||||
@ -112,6 +118,7 @@ popd
|
|||||||
%{_libdir}/libsched_yield.so.1.0.0
|
%{_libdir}/libsched_yield.so.1.0.0
|
||||||
%{_libdir}/libsched_yield.so
|
%{_libdir}/libsched_yield.so
|
||||||
%{_libdir}/libldump2mcdump.so
|
%{_libdir}/libldump2mcdump.so
|
||||||
|
%if 0%{?enable_uti}
|
||||||
%{_libdir}/libmck_syscall_intercept.so
|
%{_libdir}/libmck_syscall_intercept.so
|
||||||
%{_libdir}/libsyscall_intercept.so.0.1.0
|
%{_libdir}/libsyscall_intercept.so.0.1.0
|
||||||
%{_libdir}/libsyscall_intercept.so.0
|
%{_libdir}/libsyscall_intercept.so.0
|
||||||
@ -119,6 +126,7 @@ popd
|
|||||||
%{_libdir}/mck/libuti.so.1.0.0
|
%{_libdir}/mck/libuti.so.1.0.0
|
||||||
%{_libdir}/mck/libuti.so.1
|
%{_libdir}/mck/libuti.so.1
|
||||||
%{_libdir}/mck/libuti.so
|
%{_libdir}/mck/libuti.so
|
||||||
|
%endif
|
||||||
%{_sysconfdir}/irqbalance_mck.in
|
%{_sysconfdir}/irqbalance_mck.in
|
||||||
%{_mandir}/man1/mcreboot.1.gz
|
%{_mandir}/man1/mcreboot.1.gz
|
||||||
%{_mandir}/man1/ihkconfig.1.gz
|
%{_mandir}/man1/ihkconfig.1.gz
|
||||||
|
|||||||
Reference in New Issue
Block a user