diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c4dc518a629540318c25e254b7afc256248cb7b..0d6b1a625db0cd582f0ac25533556eacff6858fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] ### New + +- Add RISC-V profile ([!220](https://storage.bsc.es/gitlab/hpc/gekkofs/-/merge_requests/220)) + ### Changed - Unify dependency scripts (dl and compile): Unify `-d` and `-p` flags ([!174](https://storage.bsc.es/gitlab/hpc/gekkofs/-/merge_requests/174)). diff --git a/scripts/profiles/0.9.4/install/syscall_intercept.install b/scripts/profiles/0.9.4/install/syscall_intercept.install index f47185c9f2d18346d17f9de8be5a5039dea69087..668e9e85064076d25db957bc137945f893e7768f 100644 --- a/scripts/profiles/0.9.4/install/syscall_intercept.install +++ b/scripts/profiles/0.9.4/install/syscall_intercept.install @@ -66,6 +66,11 @@ pkg_install() { if [[ ${EXTRA_INSTALL_ARGS} == "ARM64" ]]; then cp "${CURR}"/arch/aarch64/include/libsyscall_intercept_hook_point.h ${INSTALL_DIR}/include fi + + # patch for riscv syscall_intercept version to fit other implementations + # it replaces line 91 only if there is the struct wrapper_ret of riscv + sed -i '91s/struct wrapper_ret/long/g' \ + ${INSTALL_DIR}/include/libsyscall_intercept_hook_point.h } pkg_check() { diff --git a/scripts/profiles/0.9.4/riscv.specs b/scripts/profiles/0.9.4/riscv.specs new file mode 100644 index 0000000000000000000000000000000000000000..41edbd008348f352803e85e22fdf1cbfc747f0ba --- /dev/null +++ b/scripts/profiles/0.9.4/riscv.specs @@ -0,0 +1,74 @@ +################################################################################ +# Copyright 2018-2024, Barcelona Supercomputing Center (BSC), Spain # +# Copyright 2015-2024, Johannes Gutenberg Universitaet Mainz, Germany # +# # +# This software was partially supported by the # +# EC H2020 funded project NEXTGenIO (Project ID: 671951, www.nextgenio.eu). # +# # +# This software was partially supported by the # +# ADA-FS project under the SPPEXA project funded by the DFG. # +# # +# This file is part of GekkoFS. # +# # +# GekkoFS is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # +# # +# GekkoFS is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with GekkoFS. If not, see . # +# # +# SPDX-License-Identifier: GPL-3.0-or-later # +################################################################################ + +# vi: ft=bash + +# Variables to be imported into the scripts +declare -A wgetdeps clonedeps clonedeps_args clonedeps_patches extra_install_args +declare -a order + +# Comment that should be displayed when printing the profile +comment="All dependencies" + +# Dependencies that must be downloaded directly +wgetdeps=( + ["lz4"]="1.9.4" + ["capstone"]="6.0.0-Alpha2" + ["argobots"]="1.2" + ["rocksdb"]="8.10.0" + ["json-c"]="0.17-20230812" +) + +# Dependencies that must be cloned. +clonedeps=( + ["libfabric"]="HEAD@v1.20.1" + ["mercury"]="v2.4.0" + ["margo"]="v0.18.3" + ["syscall_intercept"]="2a25b21926ab115d667e135389458a7a159e8bb1" +) + +# Extra arguments for git clone +clonedeps_args=( + ["mercury"]="--recurse-submodules" +) + +# Ordering that MUST be followed when downloading +order=( + "lz4" "capstone" "json-c" "libfabric" "mercury" "argobots" "margo" "rocksdb" "syscall_intercept" +) + +# Extra arguments passed to the installation script. As such, they can +# reference the following variables: +# - CMAKE: a variable that expands to the cmake binary +# - SOURCE_DIR: the directory where the sources for the package were +# downloaded +# - INSTALL_DIR: the directory where the package should be installed +# - CORES: the number of cores to use when building +# - PERFORM_TEST: whether tests for the package should be executed +extra_install_args=( +) diff --git a/src/client/intercept.cpp b/src/client/intercept.cpp index 45346fdc8bc51fdc7c02f813363148ca5f782c4a..b933ff162a9920c146324e1dabf054f82cde8cbb 100644 --- a/src/client/intercept.cpp +++ b/src/client/intercept.cpp @@ -775,20 +775,22 @@ hook(long syscall_number, long arg0, long arg1, long arg2, long arg3, long arg4, reinterpret_cast(arg1), 0); break; #endif +#ifdef SYS_renameat case SYS_renameat: *result = gkfs::hook::hook_renameat( static_cast(arg0), reinterpret_cast(arg1), static_cast(arg2), reinterpret_cast(arg3), 0); break; - +#endif +#ifdef SYS_renameat2 case SYS_renameat2: *result = gkfs::hook::hook_renameat( static_cast(arg0), reinterpret_cast(arg1), static_cast(arg2), reinterpret_cast(arg3), static_cast(arg4)); break; - +#endif case SYS_fstatfs: *result = gkfs::hook::hook_fstatfs( static_cast(arg0), diff --git a/src/client/syscalls/detail/syscall_info.c b/src/client/syscalls/detail/syscall_info.c index 954486f54cfeb7d1d3a1a94cb42acd36303a278e..44092f0c796a6cbba9511497fdddcdfd2ad2fcc4 100644 --- a/src/client/syscalls/detail/syscall_info.c +++ b/src/client/syscalls/detail/syscall_info.c @@ -472,7 +472,9 @@ SYSCALL(getpmsg, 5, S_RET(rdec), S_NARG(arg, "arg0"), #endif SYSCALL(newfstatat, 4, S_RET(rdec), S_NARG(atfd, "dfd"), S_NARG(cstr, "pathname"), S_NARG(ptr, "statbuf"), S_NARG(arg, "flag")), SYSCALL(unlinkat, 3, S_RET(rdec), S_NARG(atfd, "dfd"), S_NARG(cstr, "pathname"), S_NARG(arg, "flag")), +#ifdef SYS_renameat SYSCALL(renameat, 4, S_RET(rdec), S_NARG(atfd, "olddfd"), S_NARG(cstr, "oldname"), S_NARG(atfd, "newdfd"), S_NARG(cstr, "newname")), +#endif SYSCALL(linkat, 5, S_RET(rdec), S_NARG(atfd, "olddfd"), S_NARG(cstr, "oldpath"), S_NARG(atfd, "newdfd"), S_NARG(cstr, "newpath"), S_NARG(arg, "flags")), SYSCALL(symlinkat, 3, S_RET(rdec), S_NARG(cstr, "oldname"), S_NARG(atfd, "newdfd"), S_NARG(cstr, "newname")), SYSCALL(readlinkat, 4, S_RET(rdec), S_NARG(atfd, "dfd"), S_NARG(cstr, "pathname"), S_NARG(ptr, "buf"), S_NARG(arg, "bufsiz")), @@ -1132,7 +1134,9 @@ const struct named_syscall_entry syscalls_by_name[] = { #ifdef SYS_rename SYSCALL_BY_NAME(rename), #endif +#ifdef SYS_renameat SYSCALL_BY_NAME(renameat), +#endif SYSCALL_BY_NAME(renameat2), SYSCALL_BY_NAME(request_key), SYSCALL_BY_NAME(restart_syscall), diff --git a/tests/integration/harness/gkfs.io/syscall_coverage.cpp b/tests/integration/harness/gkfs.io/syscall_coverage.cpp index fb253314ef249ac7b0ca5d7dee4dbee9d27329d0..08246289bc1f931d7f1921d32106866b0fb3b534 100644 --- a/tests/integration/harness/gkfs.io/syscall_coverage.cpp +++ b/tests/integration/harness/gkfs.io/syscall_coverage.cpp @@ -401,19 +401,23 @@ syscall_coverage_exec(const syscall_coverage_options& opts) { } ::close(fd_append); +#ifdef SYS_open // sys_open rv = ::syscall(SYS_open, opts.pathname.c_str(), O_RDONLY, 0); if(rv < 0) { output("sys_open", rv, opts); return; } +#endif +#ifdef SYS_creat // sys_creat rv = ::syscall(SYS_creat, opts.pathname.c_str(), 0777); if(rv < 0) { output("sys_creat", rv, opts); return; } +#endif // sys_unlinkat rv = ::syscall(SYS_unlinkat, AT_FDCWD, opts.pathname.c_str(), 0); @@ -430,12 +434,14 @@ syscall_coverage_exec(const syscall_coverage_options& opts) { return; } +#ifdef SYS_chmod // SYS_chmod rv = ::syscall(SYS_chmod, opts.pathname.c_str(), 0777); if(errno != ENOTSUP) { output("sys_chmod", rv, opts); return; } +#endif // hook_faccessat coverage rv = ::syscall(SYS_faccessat, AT_FDCWD, opts.pathname.c_str(), F_OK, 0); diff --git a/tests/scripts/dl_dep.sh/0.9.4/riscv.out b/tests/scripts/dl_dep.sh/0.9.4/riscv.out new file mode 100644 index 0000000000000000000000000000000000000000..6a8640356efab77677cb717d3f97183ab4562849 --- /dev/null +++ b/tests/scripts/dl_dep.sh/0.9.4/riscv.out @@ -0,0 +1,10 @@ +Downloaded 'https://github.com/lz4/lz4/archive/v1.9.4.tar.gz' to 'lz4' +Downloaded 'https://github.com/aquynh/capstone/archive/6.0.0-Alpha2.tar.gz' to 'capstone' +Downloaded 'https://github.com/json-c/json-c/archive/json-c-0.17-20230812.tar.gz' to 'json-c' +Cloned 'https://github.com/ofiwg/libfabric.git' to 'libfabric' with commit '[HEAD]' and flags '--branch=v1.20.1' +Cloned 'https://github.com/mercury-hpc/mercury' to 'mercury' with commit '[v2.4.0]' and flags '--recurse-submodules' +Downloaded 'https://github.com/pmodels/argobots/archive/v1.2.tar.gz' to 'argobots' +Cloned 'https://github.com/mochi-hpc/mochi-margo' to 'margo' with commit '[v0.18.3]' and flags '' +Downloaded 'https://github.com/facebook/rocksdb/archive/v8.10.0.tar.gz' to 'rocksdb' +Cloned 'https://github.com/GekkoFS/syscall_intercept.git' to 'syscall_intercept' with commit '[2a25b21926ab115d667e135389458a7a159e8bb1]' and flags '' +Done