Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test of merging KMP stuff - ignore #49

Open
wants to merge 37 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
8f253a2
Add a gpu device abstraction - note that this is for 2D graphics only
PeterDinda Jul 26, 2020
e8683ac
Cleanup of virtio_pci stuff suggested by clang warnings
PeterDinda Sep 7, 2020
3d3bd09
Add test routines to gpudev, plus other cleanup
PeterDinda Sep 7, 2020
d3f0f06
More cleanup of gpudev interface
PeterDinda Sep 7, 2020
aacacb2
More tests in gpudev interface
PeterDinda Sep 11, 2020
35bb63f
Minor gpudev tweak
PeterDinda Sep 14, 2020
d4afbd6
More gpu dev interface cleanup
PeterDinda Sep 11, 2020
bd08068
Update testing config for gpudev
PeterDinda Dec 21, 2020
324dd47
Monitor fix - printing more registers
dakersnar Sep 25, 2020
4327082
configs and readme for cs446 spring 2020
PeterDinda Apr 13, 2020
28afcd7
Add initial glue code for omp (kmp)
PeterDinda May 4, 2020
0366d69
More glue code for kmp
PeterDinda May 9, 2020
3ccea5a
Add stub generator code, and generated stubs
PeterDinda May 9, 2020
fdf6e58
Add environment variable support, with multiple environments
PeterDinda May 12, 2020
0957eb3
Start gluing in pthread embedded library
PeterDinda May 20, 2020
9a3ab74
Move pthread library into new compatability directory structure
PeterDinda Jul 19, 2020
6a15fe4
Restructure compatability code
PeterDinda Jul 19, 2020
0449db3
Add Linux compatability tree and stub out sysconf()
MJChku Jul 19, 2020
acf2baf
Adds optional runtime support for hardware TLS via the FSBASE msr
PeterDinda Jul 15, 2020
92be944
Initial port of pthread library to NK
MJChku Jul 19, 2020
3c73fd2
Update libccompat and linux with features needed by pthreads/omp
MJChku Jul 19, 2020
b142168
Factor out libc and libm compatability. Make missing functionality …
PeterDinda Jul 19, 2020
971f8af
Add glue code and test code for libomp
MJChku Jul 20, 2020
55b4351
Further changes to pthread library port
MJChku Jul 21, 2020
aefe49b
A bit more cleanup of pthread and omp tests
PeterDinda Jul 21, 2020
df0f2dc
add two missing pthread functions
MJChku Jul 22, 2020
989e623
For omptest to run, hwtls has to be allocated some space, the trivial…
MJChku Jul 22, 2020
1802384
More detailed output from omptest and ptest - avoid nan issue in prin…
PeterDinda Jul 22, 2020
f554c8a
Fix more floating point output bugs:
PeterDinda Jul 23, 2020
2ed0f17
Bug caught => xmm use in interrupt handlers breaking floating point code
PeterDinda Aug 22, 2020
898b3a3
Add pthread test code
PeterDinda Jul 29, 2020
d312ad9
Cleanup
PeterDinda Dec 28, 2020
72bd80e
More cleanup, update default testing config to match new features
PeterDinda Dec 28, 2020
501b719
More cleanup (HWTLS config, FP save on IRQ/EXCP config)
PeterDinda Dec 29, 2020
005ad56
Missing file
PeterDinda Dec 29, 2020
b1f52cd
Update testing configs
PeterDinda Dec 29, 2020
c0e5ca0
Merge branch 'master' into kmp
PeterDinda Dec 29, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
97 changes: 96 additions & 1 deletion Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,15 @@ config DEBUG_ISOCORE
Adds debugging output for isolated core execution
The low-level code does not have debugging output

config HARDWARE_TLS
bool "Enable hardware thread-local storage (FSBASE)"
default n
depends on X86_64_HOST
help
Enables use of FSBASE to do faster TLS
When enabled, a thread context switch includes an
FSBASE context switch

config CACHEPART
bool "Enable cache partitioning"
default n
Expand Down Expand Up @@ -822,6 +831,70 @@ menu "Garbage Collection Options"
endmenu
endmenu

menu "Compatability"
config BASE_LIBC_COMPAT
bool "Basic libc compatability"
default y
help
Basic libc compatability layer

config DEBUG_BASE_LIBC_COMPAT
bool "Debug basic libc compatability"
depends on BASE_LIBC_COMPAT
default n
help
Enable debugging output from the basic libc compatability layer

config BASE_LIBM_COMPAT
bool "Basic libm compatability"
default y
help
Basic libm compatability layer

config DEBUG_BASE_LIBM_COMPAT
bool "Debug basic libm compatability"
depends on BASE_LIBM_COMPAT
default n
help
Enable debugging output from the basic libm compatability layer

config BASE_LINUX_COMPAT
bool "Basic Linux user-level compatability layer"
depends on BASE_LIBC_COMPAT
default y
help
Basic Linux user-level compatability layer

config DEBUG_BASE_LINUX_COMPAT
bool "Debug basic Linux compatability"
depends on BASE_LINUX_COMPAT
default n
help
Enable debugging output from the basic Linux compatability layer

config BASE_PTHREAD_COMPAT
bool "POSIX threads compatability layer"
default y
depends on BASE_LIBC_COMPAT && BASE_LINUX_COMPAT
help
POSIX threads

config BASE_PTHREAD_COMPAT_TESTS
bool "Add POSIX threads compatability layer tests"
depends on BASE_PTHREAD_COMPAT
default n
help
Enable tests for this layer

config DEBUG_BASE_PTHREAD_COMPAT
bool "Debug basic POSIX threads compatability layer"
depends on BASE_PTHREAD_COMPAT
default n
help
Enable debugging output from the basic POSIX threads compatability layer

endmenu

menu "Optimizations"

config FPU_SAVE
Expand All @@ -831,6 +904,14 @@ menu "Optimizations"
Compiles the kernel to save FPU state on every context switch.
This is not strictly necessary if processors are not virtualized
(by the HRT).

config FPU_SAVE_IRQ_EXCP
bool "Save FPU state on all interrupts and exceptions"
default y
help
Compiles the kernel to save FPU state on every exception and interrupt.
This is necessary if it is possible for the compiler to use
FP/SSE/AVX/etc state during an exception or interrupt handler

config KICK_SCHEDULE
bool "Kick cores with IPIs on scheduling events"
Expand Down Expand Up @@ -1053,6 +1134,13 @@ menu Debugging
help
Turn on debug prints for C++ initialization/support code

config DEBUG_ENVS
bool "Debug Environments"
depends on DEBUG_PRINTS
default n
help
Turn on debug prints for environment variable support

config DEBUG_THREADS
bool "Debug Threads"
depends on DEBUG_PRINTS
Expand Down Expand Up @@ -1298,6 +1386,7 @@ menu "Address Spaces"

endmenu


menu "Runtimes"

config LEGION_RT
Expand Down Expand Up @@ -1361,7 +1450,7 @@ menu "Runtimes"
bool "OpenMP RT"
default n
help
Include the GOMP-compatible OpenMP run-time
Include the an OpenMP run-time

choice
depends on OPENMP_RT
Expand All @@ -1371,6 +1460,12 @@ menu "Runtimes"
config OPENMP_RT_OMP
bool "CLANG-compatible (OMP)"

config OPENMP_RT_INSTALL_DIR
string "Installation Directory"
depends on OPENMP_RT_OMP
help
Where to find your libomp.a and omp.h

config OPENMP_RT_GOMP
bool "GNU-compatible (GOMP) [going away]"

Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,10 @@ endif # NAUT_CONFIG_CXX_SUPPORT

#/usr/lib64/libc.a \

ifdef NAUT_CONFIG_OPENMP_RT_OMP
libs-y += $(NAUT_CONFIG_OPENMP_RT_INSTALL_DIR)/lib/libomp.a
endif

ifdef NAUT_CONFIG_PALACIOS
PALACIOS_DIR=$(subst "",,$(NAUT_CONFIG_PALACIOS_DIR))
CFLAGS += -I$(PALACIOS_DIR)/nautilus -I$(PALACIOS_DIR)/palacios/include
Expand Down
15 changes: 14 additions & 1 deletion configs/testing/default.config
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
#Nautilus:
# Mon Dec 21 15:41:45 2020
# Mon Dec 28 18:26:53 2020
#

#
Expand Down Expand Up @@ -70,6 +70,7 @@ NAUT_CONFIG_APERIODIC_ROUND_ROBIN=y
#
# NAUT_CONFIG_WATCHDOG is not set
# NAUT_CONFIG_ISOCORE is not set
NAUT_CONFIG_HARDWARE_TLS=y
# NAUT_CONFIG_CACHEPART is not set

#
Expand All @@ -82,10 +83,22 @@ NAUT_CONFIG_APERIODIC_ROUND_ROBIN=y
#
# NAUT_CONFIG_XSAVE_SUPPORT is not set

#
# Compatability
#
NAUT_CONFIG_BASE_LIBC_COMPAT=y
# NAUT_CONFIG_DEBUG_BASE_LIBC_COMPAT is not set
NAUT_CONFIG_BASE_LIBM_COMPAT=y
# NAUT_CONFIG_DEBUG_BASE_LIBM_COMPAT is not set
NAUT_CONFIG_BASE_LINUX_COMPAT=y
# NAUT_CONFIG_DEBUG_BASE_LINUX_COMPAT is not set
# NAUT_CONFIG_BASE_PTHREAD_COMPAT is not set

#
# Optimizations
#
NAUT_CONFIG_FPU_SAVE=y
NAUT_CONFIG_FPU_SAVE_IRQ_EXCP=y
NAUT_CONFIG_KICK_SCHEDULE=y
NAUT_CONFIG_HALT_WHILE_IDLE=y
# NAUT_CONFIG_THREAD_OPTIMIZE is not set
Expand Down
16 changes: 15 additions & 1 deletion configs/testing/full-debug.config
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
#Nautilus:
# Wed Jul 29 15:53:34 2020
# Mon Dec 28 18:26:21 2020
#

#
Expand Down Expand Up @@ -77,6 +77,7 @@ NAUT_CONFIG_TEST_FIBERS=y
#
# NAUT_CONFIG_WATCHDOG is not set
# NAUT_CONFIG_ISOCORE is not set
NAUT_CONFIG_HARDWARE_TLS=y
# NAUT_CONFIG_CACHEPART is not set

#
Expand All @@ -89,10 +90,22 @@ NAUT_CONFIG_TEST_FIBERS=y
#
# NAUT_CONFIG_XSAVE_SUPPORT is not set

#
# Compatability
#
NAUT_CONFIG_BASE_LIBC_COMPAT=y
# NAUT_CONFIG_DEBUG_BASE_LIBC_COMPAT is not set
NAUT_CONFIG_BASE_LIBM_COMPAT=y
# NAUT_CONFIG_DEBUG_BASE_LIBM_COMPAT is not set
NAUT_CONFIG_BASE_LINUX_COMPAT=y
# NAUT_CONFIG_DEBUG_BASE_LINUX_COMPAT is not set
# NAUT_CONFIG_BASE_PTHREAD_COMPAT is not set

#
# Optimizations
#
NAUT_CONFIG_FPU_SAVE=y
NAUT_CONFIG_FPU_SAVE_IRQ_EXCP=y
# NAUT_CONFIG_KICK_SCHEDULE is not set
# NAUT_CONFIG_HALT_WHILE_IDLE is not set
# NAUT_CONFIG_THREAD_OPTIMIZE is not set
Expand All @@ -119,6 +132,7 @@ NAUT_CONFIG_ENABLE_ASSERTS=y
# NAUT_CONFIG_DEBUG_SHELL is not set
# NAUT_CONFIG_DEBUG_SFI is not set
# NAUT_CONFIG_DEBUG_CXX is not set
# NAUT_CONFIG_DEBUG_ENVS is not set
# NAUT_CONFIG_DEBUG_THREADS is not set
NAUT_CONFIG_DEBUG_FIBERS=y
NAUT_CONFIG_DEBUG_TASKS=y
Expand Down
16 changes: 15 additions & 1 deletion configs/testing/prov_test.config
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
#Nautilus:
# Wed Jul 29 11:42:35 2020
# Mon Dec 28 18:33:18 2020
#

#
Expand Down Expand Up @@ -71,6 +71,7 @@ NAUT_CONFIG_APERIODIC_ROUND_ROBIN=y
#
# NAUT_CONFIG_WATCHDOG is not set
# NAUT_CONFIG_ISOCORE is not set
NAUT_CONFIG_HARDWARE_TLS=y
# NAUT_CONFIG_CACHEPART is not set

#
Expand All @@ -83,10 +84,22 @@ NAUT_CONFIG_APERIODIC_ROUND_ROBIN=y
#
# NAUT_CONFIG_XSAVE_SUPPORT is not set

#
# Compatability
#
NAUT_CONFIG_BASE_LIBC_COMPAT=y
# NAUT_CONFIG_DEBUG_BASE_LIBC_COMPAT is not set
NAUT_CONFIG_BASE_LIBM_COMPAT=y
# NAUT_CONFIG_DEBUG_BASE_LIBM_COMPAT is not set
NAUT_CONFIG_BASE_LINUX_COMPAT=y
# NAUT_CONFIG_DEBUG_BASE_LINUX_COMPAT is not set
# NAUT_CONFIG_BASE_PTHREAD_COMPAT is not set

#
# Optimizations
#
NAUT_CONFIG_FPU_SAVE=y
NAUT_CONFIG_FPU_SAVE_IRQ_EXCP=y
# NAUT_CONFIG_KICK_SCHEDULE is not set
# NAUT_CONFIG_HALT_WHILE_IDLE is not set
# NAUT_CONFIG_THREAD_OPTIMIZE is not set
Expand Down Expand Up @@ -115,6 +128,7 @@ NAUT_CONFIG_DEBUG_PROVENANCE=y
# NAUT_CONFIG_DEBUG_SHELL is not set
# NAUT_CONFIG_DEBUG_SFI is not set
# NAUT_CONFIG_DEBUG_CXX is not set
# NAUT_CONFIG_DEBUG_ENVS is not set
# NAUT_CONFIG_DEBUG_THREADS is not set
# NAUT_CONFIG_DEBUG_TASKS is not set
# NAUT_CONFIG_DEBUG_WAITQUEUES is not set
Expand Down
7 changes: 7 additions & 0 deletions include/compat/linux/sysconf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#ifndef _SYS_CONF_H_
#define _SYS_CONF_H_
extern long __sysconf(int name);



#endif
58 changes: 58 additions & 0 deletions include/nautilus/env.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
* This file is part of the Nautilus AeroKernel developed
* by the Hobbes and V3VEE Projects with funding from the
* United States National Science Foundation and the Department of Energy.
*
* The V3VEE Project is a joint project between Northwestern University
* and the University of New Mexico. The Hobbes Project is a collaboration
* led by Sandia National Laboratories that includes several national
* laboratories and universities. You can find out more at:
* http://www.v3vee.org and
* http://xstack.sandia.gov/hobbes
*
* Copyright (c) 2020, Peter Dinda
* Copyright (c) 2020, The V3VEE Project <http://www.v3vee.org>
* The Hobbes Project <http://xstack.sandia.gov/hobbes>
* All rights reserved.
*
* Author: Peter Dinda <pdinda@northwestern.edu>
*
* This is free software. You are permitted to use,
* redistribute, and modify it as specified in the file "LICENSE.txt".
*/

#ifndef __NK_ENV
#define __NK_ENV


#define NK_ENV_MAX_NAME 32

struct nk_env *nk_env_create(char *name,
uint64_t numkeys,
uint64_t maxkeysize,
uint64_t maxvaluesize);

struct nk_env *nk_env_find(char *name);

int nk_env_destroy(struct nk_env *env);

// the following apply to the global environmnet
#define NK_ENV_GLOBAL_NAME "global"
#define NK_ENV_GLOBAL_MAX_NUM_KEYS 64
#define NK_ENV_GLOBAL_MAX_KEY_SIZE 256
#define NK_ENV_GLOBAL_MAX_VAL_SIZE 256

// the global environment is constructed on first use
extern struct nk_env *nk_env_global;

int nk_env_search(struct nk_env *env, char *key, char **value);
int nk_env_insert(struct nk_env *env, char *key, char *val);
int nk_env_update(struct nk_env *env, char *key, char *val);
int nk_env_delete(struct nk_env *env, char *key);

// print list of environments, also their contents if indicated
void nk_env_dump_envs(int contents);
// print contents of an environment
void nk_env_dump_env(struct nk_env *env);

#endif
6 changes: 5 additions & 1 deletion include/nautilus/libccompat.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ extern "C" {
#define UNDEF_FUN_ERR()
#endif

#define BOGUS_FUN_ERR() ERROR_PRINT("Function (%s) is BOGUS\n", __func__)

#define RAND_MAX 2147483647

typedef int clockid_t;
Expand Down Expand Up @@ -242,6 +244,9 @@ size_t strftime(char *str, size_t maxsize, const char *format, const struct tm *

void (*signal(int sig, void (*func)(int)))(int);

int abs(int x);


double pow(double x, double y);
char *tmpnam(char *s);
clock_t clock(void);
Expand All @@ -260,7 +265,6 @@ double fmod(double y, double x);
double frexp(double x, int *e);
double ldexp(double x, int exp);
double strtod(const char *str, char **endptr);
double abs(double x);
double sin(double x);
double sinh(double x);
double cos(double x);
Expand Down
Loading