akaros.git
4 years agoAdd an assert for UTEST that takes a format string
Barret Rhoden [Wed, 25 Nov 2015 22:39:07 +0000 (17:39 -0500)]
Add an assert for UTEST that takes a format string

UT_ASSERT_M() just prints the message verbatim.  Its va_args are cleanup
routines.  UT_ASSERT_FMT() takes a format string, and its va_args is the
values for the format string.

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoAdd the #vars device to export kernel variables
Barret Rhoden [Tue, 24 Nov 2015 13:29:44 +0000 (08:29 -0500)]
Add the #vars device to export kernel variables

With #vars, you can specify certain variables, such as num_cores, to be
exposed to userspace.  If you want, you can:

$ bind -a \#vars /dev
$ cat /dev/num_cores!dw

For debugging, you can add entries with the DEVVARS_ENTRY(name, format)
macro.  'format' is two chars, the data_format and the data_size, using
Qemu's notation.

Privileged users (i.e. anyone) can add new entries to #vars, which
internally will do a lookup in the symbol table and trust the format
string.  This is a little dangerous.

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoRemove the edata symbol
Barret Rhoden [Wed, 25 Nov 2015 17:16:40 +0000 (12:16 -0500)]
Remove the edata symbol

It is mostly useless and probably confusing.  I'm not even sure if the
linker had to put it directly after .data, or if it could put it wherever
it wanted before the .bss, since it was not inside the .data section.

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoMemset the BSS explicitly
Barret Rhoden [Wed, 25 Nov 2015 17:05:40 +0000 (12:05 -0500)]
Memset the BSS explicitly

Previously, we were assuming that everything from the end of .data to the
end of the kernel image was .bss.  That is definitely not the case, which
becomes apparent if you try to add an attribute for another section and
then you wonder why said section is zeroed at runtime (but not in the
object!).

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoAdd kmalloc_array() interface
Barret Rhoden [Mon, 30 Nov 2015 21:04:08 +0000 (16:04 -0500)]
Add kmalloc_array() interface

One thing to be careful of is that these functions can fail and return 0,
regardless of your kmalloc flags.

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoRename 'reallocarray' to 'kreallocarray'.
Dan Cross [Wed, 25 Nov 2015 22:34:40 +0000 (17:34 -0500)]
Rename 'reallocarray' to 'kreallocarray'.

...as it should have been named originally.
My oversight: apologies for that.

Signed-off-by: Dan Cross <crossd@gmail.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agox86: Provide an option to enable legacy USB
Barret Rhoden [Thu, 19 Nov 2015 02:08:21 +0000 (18:08 -0800)]
x86: Provide an option to enable legacy USB

If you want to use a USB keyboard, you'll need to enable this CONFIG.
It is disabled by default, since we usually use serial access and it is
a source of interference.  Sometimes you want a keyboard for debugging.

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoUpdate Makelocale.template for syslinux
Barret Rhoden [Thu, 19 Nov 2015 01:54:41 +0000 (17:54 -0800)]
Update Makelocale.template for syslinux

Our USB sticks expect a kernel named 'akaros' in /boot.  The kernel can
be either a compressed kernel or uncompressed.  I recommend compressed.
(Have your Makelocal's usb target depend on CMP_KERNEL_OBJ).

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoAdded test for devarch MSR file
Davide Libenzi [Mon, 9 Nov 2015 04:11:28 +0000 (20:11 -0800)]
Added test for devarch MSR file

Added test for devarch MSR file.

Signed-off-by: Davide Libenzi <dlibenzi@google.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoAdded whitelisting to MSR read/write code
Davide Libenzi [Tue, 10 Nov 2015 00:33:48 +0000 (16:33 -0800)]
Added whitelisting to MSR read/write code

Added whitelisting to MSR read/write code.

Signed-off-by: Davide Libenzi <dlibenzi@google.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoAdded APIs to read and write MSR values on multiple CPUs
Davide Libenzi [Sun, 8 Nov 2015 19:33:56 +0000 (11:33 -0800)]
Added APIs to read and write MSR values on multiple CPUs

Added APIs to read and write MSR values on multiple CPUs.
Cleaned up devarch.c code to remove unused code.
Plugged MSR read and write APIs into devarch MSR file.

Signed-off-by: Davide Libenzi <dlibenzi@google.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoAdded address range library utility to be able to express whitelists
Davide Libenzi [Mon, 9 Nov 2015 23:10:44 +0000 (15:10 -0800)]
Added address range library utility to be able to express whitelists

Added address range library utility to be able to express whitelists for
MSR code, and potentially anything which can be expressed as address
range (ie, PCI, DMA, ...).

Signed-off-by: Davide Libenzi <dlibenzi@google.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoAdded API to run a function in multiple CPUs, and wait for completion
Davide Libenzi [Mon, 16 Nov 2015 19:14:52 +0000 (11:14 -0800)]
Added API to run a function in multiple CPUs, and wait for completion

Added API to run a function in multiple CPUs, and wait for completion.

Signed-off-by: Davide Libenzi <dlibenzi@google.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoWired GP fault exception tables handling
Davide Libenzi [Tue, 24 Nov 2015 20:22:53 +0000 (12:22 -0800)]
Wired GP fault exception tables handling

Wired GP fault exception tables handling.

Signed-off-by: Davide Libenzi <dlibenzi@google.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoAdded exception table based safe MSR access APIs
Davide Libenzi [Tue, 24 Nov 2015 14:30:46 +0000 (06:30 -0800)]
Added exception table based safe MSR access APIs

Added exception table based safe MSR access APIs.

Signed-off-by: Davide Libenzi <dlibenzi@google.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoAdded CPU set data structure
Davide Libenzi [Sun, 8 Nov 2015 19:27:01 +0000 (11:27 -0800)]
Added CPU set data structure

Added CPU set data structure.

Signed-off-by: Davide Libenzi <dlibenzi@google.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoAdded completion data structure
Davide Libenzi [Sun, 8 Nov 2015 19:25:39 +0000 (11:25 -0800)]
Added completion data structure

Added completion data structure. It allows waiters to be woken up once
the given number of complete operations have been issued.

Signed-off-by: Davide Libenzi <dlibenzi@google.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoA utest to test nanosleep, sleep, and usleep
Kevin Klues [Fri, 20 Nov 2015 02:14:33 +0000 (18:14 -0800)]
A utest to test nanosleep, sleep, and usleep

We currently don't test the abort path for these calls, and this is
added as a TODO in the test file.

Signed-off-by: Kevin Klues <klueska@cs.berkeley.edu>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoAdd support for sleep, nanosleep, and usleep (XCC)
Kevin Klues [Fri, 20 Nov 2015 02:11:18 +0000 (18:11 -0800)]
Add support for sleep, nanosleep, and usleep (XCC)

The nanosleep call is a pass through to SYS_nanosleep, the usleep call
is a pass through to SYS_block, and sleep is implemented in terms of
nanosleep. We previously had our own copy of sysdeps/posix/sleep.c in
sysdeps/akaros, but this is now removed in favor of
sysdeps/posix/sleep.c which uses nanosleep under the hood.

Signed-off-by: Kevin Klues <klueska@cs.berkeley.edu>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoAdd the nanosleep syscall
Kevin Klues [Fri, 20 Nov 2015 02:07:45 +0000 (18:07 -0800)]
Add the nanosleep syscall

This syscall provides the nanosleep API as specified here:

http://pubs.opengroup.org/onlinepubs/009695399/functions/nanosleep.html

However, it currently runs with a microsecond alarm under the hood, so
all requests are rounded to tbe nearest microsecond. In the future we
may change the underlying alarm subsystem to be nanosecond-based, at
which time we will update the precision of this sleep call.

Signed-off-by: Kevin Klues <klueska@cs.berkeley.edu>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoImport 'reallocarray' from OpenBSD.
Dan Cross [Tue, 24 Nov 2015 02:57:01 +0000 (21:57 -0500)]
Import 'reallocarray' from OpenBSD.

Add this new function: a safe version of 'realloc' that avoids
integer overflow when computing the new size of the thing to
allocate.

Signed-off-by: Dan Cross <crossd@gmail.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoRemove kernel scheduler dependence on sched_pcore
Kevin Klues [Thu, 12 Nov 2015 20:17:11 +0000 (12:17 -0800)]
Remove kernel scheduler dependence on sched_pcore

There is no need for the kernel scheduler to be aware of the internal
sched_pcore struct.  Instead it can operate completely on pcoreids.
Currently we still include the sched_pcore struct as part of the
fcfs_corealloc.h header file, but this is now only necessary so that we
can provide inline functions for getting at its various fields.  If we
decide this doesn't matter much, we can probably push the definition of
this struct into a .c file somwhere. Though this may be difficult given
the separation of coreprov.c and *_corealloc.c, which both need access
to this struct. Regardless, we should be able to hide it if necessary in
an "internal" header file or something.

Signed-off-by: Kevin Klues <klueska@cs.berkeley.edu>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoMove coreprov_proc_init() to corealloc_proc_init()
Kevin Klues [Tue, 6 Oct 2015 02:16:08 +0000 (19:16 -0700)]
Move coreprov_proc_init() to corealloc_proc_init()

Initially we were initializing the fields of the core_reuqest_data
struct in coreprov.c, but now that we have allocator specific
definitions for this struct, it makes more sense to have them
initialized in the core allocator they are associated with. Moreover,
it was unclear when we first introduced the coreprov_proc_init()
function that the initialization of the core request data should have
been associated with this file in the first place (the fields it
contains are really more about allocation anyway, even though they work
with a list of provisioned cores).

Signed-off-by: Kevin Klues <klueska@cs.berkeley.edu>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoDeclare sched_pcore in allocator specific file
Kevin Klues [Tue, 6 Oct 2015 00:08:18 +0000 (17:08 -0700)]
Declare sched_pcore in allocator specific file

As part of this, we need to move the definitions of any helper functions
in corerequest.h which access fields of the sched_pcore or otherwise
depend on its size. This will become more important as we start to add
other allocators that need extra fields in the sche_pcore struct, and we
want the accessor functions (e.g. spc2pcoreid()) to remain as static
inlines so they are fast.

We also need to move our declaration of core_reqeust_data struct into
the allocator specific header as well.

I don't really like the #ifdef around including the allocator specific
header files, but it's the best compromise if we want our accessor
functions to remain in the header file. Altrnatively, we could try and
come up with a way to not need these accessor functions at all, but that
is for another day.

Signed-off-by: Kevin Klues <klueska@cs.berkeley.edu>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoKconfig option to change core allocation policy
Kevin Klues [Mon, 5 Oct 2015 22:27:42 +0000 (15:27 -0700)]
Kconfig option to change core allocation policy

We still have only option for core allocation at this point, but the
scaffolding is now in place to add others. As part of this, we rename
corealloc.c to fcfs_corealloc.c because we want to be able to add a
prefix to files that implement other core allocation strategies.

Signed-off-by: Kevin Klues <klueska@cs.berkeley.edu>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoMove is_ll_core(), max_vcores() to corerequest.h
Kevin Klues [Mon, 5 Oct 2015 22:00:59 +0000 (15:00 -0700)]
Move is_ll_core(), max_vcores() to corerequest.h

These make more logical sense in this file now. They can be used by both
corealloc.c and coreprov.c as well as schedule.c if desired.

Signed-off-by: Kevin Klues <klueska@cs.berkeley.edu>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoRefactor to move alloc stuff to corealloc.c (7/7)
Kevin Klues [Tue, 29 Sep 2015 01:47:14 +0000 (18:47 -0700)]
Refactor to move alloc stuff to corealloc.c (7/7)

This commit moves the printing of the idlecore map from schedule.c into
corealloc.c. With this commit, all references to the idlecore map are
removed from schedule.c. There are still a few "core" specific functions
hanging around in schedule.c, but that's because they are all currently
protected by the sched_lock. We should consider either making the
locking finer grained, or externing the sched_lock so these functions
can be completely removed.

Signed-off-by: Kevin Klues <klueska@cs.berkeley.edu>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoRefactor to move alloc stuff to corealloc.c (6/7)
Kevin Klues [Tue, 29 Sep 2015 01:22:25 +0000 (18:22 -0700)]
Refactor to move alloc stuff to corealloc.c (6/7)

This commit moves the primary logic of the next_core() and sort_idles()
functions from schedule.c into corealloc.c. These are one off functions
to make 'pcoreid' the next core chosen by the core allocation algorithm
(so long as no provisioned cores are still idle), and to sort the idle
core list for debugging. These functions only really make sense for this
simple core request algorithm. We should revisit their usefulness once
we start to add in more sophisticated core allocation policies.

Signed-off-by: Kevin Klues <klueska@cs.berkeley.edu>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoRefactor to move alloc stuff to corealloc.c (5/7)
Kevin Klues [Tue, 29 Sep 2015 01:00:59 +0000 (18:00 -0700)]
Refactor to move alloc stuff to corealloc.c (5/7)

This commit moves the find_best_core() function out of schedule.c and
puts it in corealloc.c. It is renamed to __find_best_core_to_alloc() to
make it clearer what its intended purpose is.

Signed-off-by: Kevin Klues <klueska@cs.berkeley.edu>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoRefactor to move alloc stuff to corealloc.c (4/7)
Kevin Klues [Tue, 29 Sep 2015 00:45:43 +0000 (17:45 -0700)]
Refactor to move alloc stuff to corealloc.c (4/7)

This commit moves the primary logic of the get_any_idle_core(),
get_specific_idle_core(), put_idle_core() functions from schedule.c into
corealloc.c. The 'get' calls are intended to allow external code to extract
idle cores from consideration by the core allocation algorithm.  Once
obtained, the core allocation algorithm forgets about them until they are
reinserted via a call to put_idle_core().

Signed-off-by: Kevin Klues <klueska@cs.berkeley.edu>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoRefactor to move alloc stuff to corealloc.c (3/7)
Kevin Klues [Tue, 29 Sep 2015 00:18:24 +0000 (17:18 -0700)]
Refactor to move alloc stuff to corealloc.c (3/7)

In this commit we move over the __prov_track_alloc() and
__prov_track_dealloc() functions from schedule.c into corealloc.c. We
also rename them to more meaningful names in the process.

Signed-off-by: Kevin Klues <klueska@cs.berkeley.edu>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoRefactor to move alloc stuff to corealloc.c (2/7)
Kevin Klues [Tue, 29 Sep 2015 00:01:10 +0000 (17:01 -0700)]
Refactor to move alloc stuff to corealloc.c (2/7)

In this commit we introduce inline helper functions in our corerequest.h
header to acces the alloc_proc and prov_proc fields of the sched_pcore
struct. We do this so that all references to internal fields of this
struct can eventually be moved completely out of schedule.h.

Signed-off-by: Kevin Klues <klueska@cs.berkeley.edu>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoRefactor to move alloc stuff to corealloc.c (1/7)
Kevin Klues [Mon, 28 Sep 2015 23:04:27 +0000 (16:04 -0700)]
Refactor to move alloc stuff to corealloc.c (1/7)

This series of commits refactors the kernel scheduler to move all core
allocation logic out into a file called corealloc.c. In this first
commit, we move the idlecore list and the all_pcores list over to this
file along with their initialization. Future commits will move the rest
of the logic over.

Signed-off-by: Kevin Klues <klueska@cs.berkeley.edu>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoRefactor to move prov stuff to coreprov.c (4/4)
Kevin Klues [Mon, 28 Sep 2015 22:09:54 +0000 (15:09 -0700)]
Refactor to move prov stuff to coreprov.c (4/4)

This is the final commit of this series. It moves the functionality
to initialize the proc_alloc_me and prov_not_alloc_me lists out of
schedule.c and into coreprov.c.

At first it was unclear if we wanted to do the initialization of these
lists here, or wait until we do initialization in our corealloc.c file
(because these lists are used in the coreallocation process as well).
However, these list only exist because provisioning exits, so it
probably makes sense to initialize them here. Anyway, the lists are only
accessed by the core allocation logic upon branching to determine that a
core is provisioned in the first place.

Signed-off-by: Kevin Klues <klueska@cs.berkeley.edu>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoRefactor to move prov stuff to coreprov.c (3/4)
Kevin Klues [Mon, 28 Sep 2015 21:38:37 +0000 (14:38 -0700)]
Refactor to move prov stuff to coreprov.c (3/4)

In this commit we move the printing of a process's list of provisioned
cores from schedule.c into coreprov.c

Signed-off-by: Kevin Klues <klueska@cs.berkeley.edu>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoRefactor to move prov stuff to coreprov.c (2/4)
Kevin Klues [Mon, 28 Sep 2015 21:32:30 +0000 (14:32 -0700)]
Refactor to move prov stuff to coreprov.c (2/4)

In this commit we move the logic out of schedule.c for unprovisioning
all cores from a process at once.

Signed-off-by: Kevin Klues <klueska@cs.berkeley.edu>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoRefactor to move prov stuff to coreprov.c (1/4)
Kevin Klues [Mon, 28 Sep 2015 21:16:04 +0000 (14:16 -0700)]
Refactor to move prov stuff to coreprov.c (1/4)

In this commit we first move the primary logic for actually provisioning
a core out of schedule.c and into coreprov.c. In subsequent commits we
will move the rest of the functionality out as well.

Signed-off-by: Kevin Klues <klueska@cs.berkeley.edu>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoMove spc2pcoreid and pcoreid2spc into header file
Kevin Klues [Mon, 28 Sep 2015 21:52:33 +0000 (14:52 -0700)]
Move spc2pcoreid and pcoreid2spc into header file

All of schedule.c, coreprov.c and corealloc.c will need access to these
functions, and we want them to be fast. To make this possible, we move
the *definition* of these functions into the corerequest.h header file
(otherwise we would just put their declaration in the header). It's a
little unfortunate that we need to extern in the all_pcores variable
(mostly because this ties us to an implementation where all pcores are
allocated next to each other in memory), but it's worth it to make this
call fast.

Signed-off-by: Kevin Klues <klueska@cs.berkeley.edu>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoMove sched_pcore and friends to corerequest.h
Kevin Klues [Mon, 28 Sep 2015 21:04:10 +0000 (14:04 -0700)]
Move sched_pcore and friends to corerequest.h

We are now starting to begin our separation of corerequest logic from
scheduler logic so that alternate core request strategies can be chosen.
This commit simply moves the sched_pcore struct and parts of the
sched_proc_data into corelloc.h (which is now contained in a standalong
corerequest_data struct). We still need access to corerequest_data
inside sched_proc_data, we just embed it now as its own type in a field
called 'crd' (for core_request_data). As such, we've had to modify
schedule.c to access this data through that field.

Eventually, all code that ever references 'crd' will sit inside
coreprov.c and corealloc.c, and schedule.c will not reference it
directly.

Signed-off-by: Kevin Klues <klueska@cs.berkeley.edu>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoFirst step to move corerequest API from schedule.c
leymariv [Wed, 23 Sep 2015 20:57:59 +0000 (13:57 -0700)]
First step to move corerequest API from schedule.c

This is the first step to refactor the akaros kernel scheduler to move
the core-provisioning and core-allocation APIs into 3 new files:
corerequest.h, coreprov.c and corealloc.c. The corerequest.h file
contains the full API for both allocating and provisioning cores, while
the coreprov.c and corealloc.c files implement the provisiong and
allocation APIs respectively.  We separate these implementation so that
alternate core provisioning and core allocation strategies can be
implemented without duplicating code.

In the next commits we will eventually move the code for provisioning
into coreprov.c and the code for core allocation into corealloc.c

Signed-off-by: Kevin Klues <klueska@cs.berkeley.edu>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoCreate ak-kill-9pserver.sh that kills ufs server
Edward Hyunkoo Jee [Tue, 17 Nov 2015 20:58:15 +0000 (12:58 -0800)]
Create ak-kill-9pserver.sh that kills ufs server

Signed-off-by: Edward Hyunkoo Jee <edjee@google.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoIgnore build output for snc and kprof2perf in git
Barret Rhoden [Wed, 18 Nov 2015 18:17:42 +0000 (10:17 -0800)]
Ignore build output for snc and kprof2perf in git

Any byproducts of building must be ignored by git.

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoAdded test case for circular buffer code
Davide Libenzi [Fri, 6 Nov 2015 02:04:48 +0000 (18:04 -0800)]
Added test case for circular buffer code

Added test case for circular buffer code.

Signed-off-by: Davide Libenzi <dlibenzi@google.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoRemoved lingering error string variables
Davide Libenzi [Mon, 2 Nov 2015 03:05:29 +0000 (19:05 -0800)]
Removed lingering error string variables

Removed lingering error string variables, leftovers after the migration
to the new error handling code.

Signed-off-by: Davide Libenzi <dlibenzi@google.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoAdded simple netcat client for Akaros
Davide Libenzi [Mon, 26 Oct 2015 01:09:55 +0000 (18:09 -0700)]
Added simple netcat client for Akaros

Added simple netcat client for Akaros. It allows to cat files to remote
servers listening with real netcat.

Signed-off-by: Davide Libenzi <dlibenzi@google.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoAdded patch to Linux perf to allow it to work with Akaros
Davide Libenzi [Wed, 28 Oct 2015 17:45:45 +0000 (10:45 -0700)]
Added patch to Linux perf to allow it to work with Akaros

Added patch to Linux perf to allow it to work with Akaros.

Signed-off-by: Davide Libenzi <dlibenzi@google.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoAdded kprof to perf converter
Davide Libenzi [Tue, 24 Nov 2015 02:47:16 +0000 (18:47 -0800)]
Added kprof to perf converter

Added kprof to perf converter.

Signed-off-by: Davide Libenzi <dlibenzi@google.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoEnabled /prof/kptrace collection of anything which goes into cprintf
Davide Libenzi [Sun, 8 Nov 2015 02:47:16 +0000 (18:47 -0800)]
Enabled /prof/kptrace collection of anything which goes into cprintf

Enabled /prof/kptrace collection of anything which goes into cprintf,
printk, and its associates.
The kptrace collector is a circular buffer whose default size is 128KB.

Signed-off-by: Davide Libenzi <dlibenzi@google.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoImplemented the new profiler
Davide Libenzi [Wed, 21 Oct 2015 23:39:04 +0000 (16:39 -0700)]
Implemented the new profiler

Implemented the new profiler format and added simple userspace
stack trace (waiting for copy_from_user()).

Signed-off-by: Davide Libenzi <dlibenzi@google.com>
[checkpatch touchups]
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoAdded API to append data into a circular buffer
Davide Libenzi [Fri, 6 Nov 2015 01:30:24 +0000 (17:30 -0800)]
Added API to append data into a circular buffer

Added API to append data into a circular buffer. The buffer data is
allocated once at init time, and no more allocations happen after that.

Signed-off-by: Davide Libenzi <dlibenzi@google.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoAdded generic backtrace functions to allow backtrace output on buffers
Davide Libenzi [Thu, 5 Nov 2015 20:31:37 +0000 (12:31 -0800)]
Added generic backtrace functions to allow backtrace output on buffers

Added generic backtrace functions to allow backtrace output on buffers.

Signed-off-by: Davide Libenzi <dlibenzi@google.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoAdded API to enumerate the VM regions of a process
Davide Libenzi [Tue, 27 Oct 2015 22:29:10 +0000 (15:29 -0700)]
Added API to enumerate the VM regions of a process

Added API to enumerate the VM regions of a process.

Signed-off-by: Davide Libenzi <dlibenzi@google.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoAdded API to retrieve the current set of processes on the system
Davide Libenzi [Tue, 27 Oct 2015 22:04:15 +0000 (15:04 -0700)]
Added API to retrieve the current set of processes on the system

Added API to retrieve the current set of processes on the system.

Signed-off-by: Davide Libenzi <dlibenzi@google.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoExtend hash enumeration API to accept an opaque pointer
Davide Libenzi [Tue, 27 Oct 2015 21:46:49 +0000 (14:46 -0700)]
Extend hash enumeration API to accept an opaque pointer

Extend hash enumeration API to accept an opaque pointer.

Signed-off-by: Davide Libenzi <dlibenzi@google.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoAdded API to retrieve the full path of a struct dentry
Davide Libenzi [Sat, 24 Oct 2015 02:50:43 +0000 (19:50 -0700)]
Added API to retrieve the full path of a struct dentry

Added API to retrieve the full path of a struct dentry.

Signed-off-by: Davide Libenzi <dlibenzi@google.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoAdded APIs to access process startup information
Davide Libenzi [Thu, 22 Oct 2015 17:56:37 +0000 (10:56 -0700)]
Added APIs to access process startup information

Added APIs to access process startup information. For now only argc and
argv copies are supported.

Signed-off-by: Davide Libenzi <dlibenzi@google.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoAdded full binary path into the proc structure
Davide Libenzi [Thu, 22 Oct 2015 21:30:26 +0000 (14:30 -0700)]
Added full binary path into the proc structure

Added full binary path into the proc structure.
Fixed a bug where we would set the progname on the current process,
and not the new one.

Signed-off-by: Davide Libenzi <dlibenzi@google.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoAdded struct proc pointer to base of the executable args block
Davide Libenzi [Thu, 22 Oct 2015 17:32:37 +0000 (10:32 -0700)]
Added struct proc pointer to base of the executable args block

Added struct proc pointer to base of the executable args block.
This allows kernel code to be able to access the executable startup
info, which previous code would have discarded.

Signed-off-by: Davide Libenzi <dlibenzi@google.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoDo not race when multiple init happen at the same time
Davide Libenzi [Tue, 20 Oct 2015 23:34:26 +0000 (16:34 -0700)]
Do not race when multiple init happen at the same time

Do not race when multiple init happen at the same time, and handle
proper cleanup when all users are gone.

Signed-off-by: Davide Libenzi <dlibenzi@google.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoRemoved unused old oprofile code
Davide Libenzi [Tue, 20 Oct 2015 22:57:58 +0000 (15:57 -0700)]
Removed unused old oprofile code

Removed unused old oprofile code. Most of it wasn't even used
in the previous code.

Signed-off-by: Davide Libenzi <dlibenzi@google.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoCompletely restructured profiler code cutting all the unused code
Davide Libenzi [Tue, 20 Oct 2015 22:53:08 +0000 (15:53 -0700)]
Completely restructured profiler code cutting all the unused code

Completely restructured profiler code cutting all the unused code
that was imported from Linux.
Moved the kernel/userspace detection logic into the profiler code
to open the door to userspace stack traces.

Signed-off-by: Davide Libenzi <dlibenzi@google.com>
[checkpatch touchups]
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoReplace the Inferno console driver with a less-crippled Plan 9 driver.
Dan Cross [Thu, 29 Oct 2015 18:02:23 +0000 (14:02 -0400)]
Replace the Inferno console driver with a less-crippled Plan 9 driver.

Integrate the console driver from the UCB Plan 9 release into Akaros,
in preparation for getting rid of devfs.c and moving towards getting
rid of the VFS.

Signed-off-by: Dan Cross <crossd@gmail.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoRun spatch on devcons.c
Dan Cross [Thu, 29 Oct 2015 15:34:00 +0000 (11:34 -0400)]
Run spatch on devcons.c

Signed-off-by: Dan Cross <crossd@gmail.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoRun lindent on devcons.c
Dan Cross [Thu, 15 Oct 2015 20:07:48 +0000 (16:07 -0400)]
Run lindent on devcons.c

Signed-off-by: Dan Cross <crossd@gmail.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoImport the unmodified Plan 9 console driver.
Dan Cross [Thu, 15 Oct 2015 20:00:06 +0000 (16:00 -0400)]
Import the unmodified Plan 9 console driver.

Step 1 in replacing the relatively less-functional Inferno
console driver with the Plan 9 driver from the UCB Plan 9
release. This is the original, unmodified source from the
Plan 9 distribution.

Signed-off-by: Dan Cross <crossd@gmail.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoRemove old virtualization debugging programs
Barret Rhoden [Mon, 16 Nov 2015 23:31:43 +0000 (15:31 -0800)]
Remove old virtualization debugging programs

These were blobs that Ron used for old virtualization debugging.

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoAdd support for EPIPE and SIGPIPE (XCC)
Kevin Klues [Tue, 27 Oct 2015 18:05:23 +0000 (11:05 -0700)]
Add support for EPIPE and SIGPIPE (XCC)

With this change, we now support proper handling of SIGPIPE.  This
allows us to now run things such as:

$ hexdump -C bin/hexdump | head

However, this only currently works for files in the vfs. Things are
still broken for chans in the 9ns.  For example,

$ hexdump -C mnt/go.cpio | head

will page fault in the kernel with an error of "rpc tags".  The SIGPIPE
is still generated properly. but the call to sys_proc_destroy in the
SIGPIPE signal handler never completes. Specifically, the kernel never
returns from the call to close_fdt() in proc_destroy(). My guess is a
call to cclose() on the fd for 'mnt/go.cpio' is sleeping on its
kref->release(), and never recovering properly.

For now we can ignore this, since a workaround is to just copy the file
into the vfs, but we will need to figure this out eventually.

Signed-off-by: Kevin Klues <klueska@cs.berkeley.edu>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoAdd a sigself() signal_op
Kevin Klues [Wed, 11 Nov 2015 08:46:25 +0000 (00:46 -0800)]
Add a sigself() signal_op

All of the existing signal_ops map directly to traditional signal
operations fro glibc. This commit introduces a new operation, called sigself().
This operation is meant to trigger a signal immediately on the calling
thread.  Before this call returns, the signal passed into it will be
generated and run to compeltion.

Signed-off-by: Kevin Klues <klueska@cs.berkeley.edu>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoAdd signal support to our basic thread0 scheduler
Kevin Klues [Wed, 11 Nov 2015 08:43:59 +0000 (00:43 -0800)]
Add signal support to our basic thread0 scheduler

As part of this, I needed to add an implementation of thread_paused()
since the signal stuff relies on this.  Since it would do nothing other
than call thread0_thread_runnable, I just reuse this function directly
in the function pointer table.

Signed-off-by: Kevin Klues <klueska@cs.berkeley.edu>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoMigrate signal code from pthread.c to signal.c
Kevin Klues [Wed, 11 Nov 2015 03:00:04 +0000 (19:00 -0800)]
Migrate signal code from pthread.c to signal.c

Previously all of the code to support intraprocess signals was isolated
to the pthread library.  However, the actual functionality it provided
was quite generic.  This commit pushes all of that code into
parlib/signal.c and makes uthreads aware of the ability handle posix
signals. It is still up to the specific 2LS to actually use these
facilities in their scheduler though. For 2LSs that don't require posix
signals, the only waste is a few words in the uthread struct, and a few
unnecessary instructions to clear these fields when a uthread is first
initialized.  There is no actual performance hit unless the APIs from
parlib/signal.h are actually called (as they are in pthread.c now).

Signed-off-by: Kevin Klues <klueska@cs.berkeley.edu>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoAdd uthread_paused() API call
Kevin Klues [Wed, 11 Nov 2015 02:10:27 +0000 (18:10 -0800)]
Add uthread_paused() API call

This call is much like uthread_has_blocked(), except that it indicates
that some external component has temporarily paused a uthread, rather
than blocked it. That is, the external component calls uthread_yield()
directly, but then wishes to hand control of the uthread back to the 2LS
in the body of theyield callback.

It is the job of the 2LS to implement sched_ops->paused() such that the
thread becomes runnable again. This sched op actually already exists
because things like preemption can trigger it. Now it is triggerable by
any external component that wishes to temporarily pause a uthread with
its own yield call.

This functionality will prove useful when pausing a temporarily pausing
thread to run a signal handler in its place.

Signed-off-by: Kevin Klues <klueska@cs.berkeley.edu>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoEncapsulate pthread sigstate into a single struct
Kevin Klues [Tue, 10 Nov 2015 22:58:14 +0000 (14:58 -0800)]
Encapsulate pthread sigstate into a single struct

Signed-off-by: Kevin Klues <klueska@cs.berkeley.edu>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoRemove need for externally alloced sigdata struct
Kevin Klues [Tue, 10 Nov 2015 21:52:31 +0000 (13:52 -0800)]
Remove need for externally alloced sigdata struct

We now use space on the stack for storing the original user context and
and any signal specific state when triggering a posix signal on a
pthread.

As a side effect, we should now be able to safely longjmp out of a
signal handler because there is no longer any external state
to clean up when the signal handler completes.

Signed-off-by: Kevin Klues <klueska@cs.berkeley.edu>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoAdd arch independent accessor for user ctx stack
Kevin Klues [Tue, 10 Nov 2015 21:50:52 +0000 (13:50 -0800)]
Add arch independent accessor for user ctx stack

Signed-off-by: Kevin Klues <klueska@cs.berkeley.edu>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoWeasel apart parlib/libc symbols for signals (XCC)
Kevin Klues [Tue, 10 Nov 2015 02:45:25 +0000 (18:45 -0800)]
Weasel apart parlib/libc symbols for signals (XCC)

Previously, all of the akaros signal handling code was in parlib, which meant
that none of the glibc functions could use it. Moreover, there was no
good way for an individul 2LS to overwrite many of the commong signal
handling functions with its own functionality.  This commit weasels
apart some of this mess, allowing a 2LS to hook in its own set of
functions for common functions for masking/relaying posix signals.
Moreover, it allows glibc to now access the generic signal_ops struct,
so any function pointers a 2LS wishes to set in there can be called from
glibc if desired.  This will prove useful when implementing SIGPIPE in a
subsequent commit.

Signed-off-by: Kevin Klues <klueska@cs.berkeley.edu>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoAdd parlib-compat.c for weak symbols with parlib
Kevin Klues [Mon, 9 Nov 2015 22:56:26 +0000 (14:56 -0800)]
Add parlib-compat.c for weak symbols with parlib

This commit requires a rebuild of glibc (XCC)

Historically, parlib and glibc have been 2 separate entities. In spirit,
however, they both serve to provide low level functionalitity required
by higher level libraries. In theory, all of the functionality we
provide in parlib could (and arguably should) eventually be pushed down
into the akaros port of glibc. However, for now, we have opted to keep
parlib and glibc separate to maintain a faster turn-around time with
building parlib vs. glibc.

Unfortunately, keeping parlib and glibc separate is not very clean when
it comes to building glibc. Glibc is designed to be the lowest level
library on the system, and as such, doesn't like it when it has
unresolved symbols from parlib at link time. Since all executables
eventually link with parlib, this is not a problem (in theory), but
glibc doesn't like it nonetheless, and we have problems building our
cross compiler if any parlib symbols are referenced inside our akaros
port of glibc.

To help with this, I've introduced a new file called parlib-compat.c,
to define weak symbols for any parlib symbol that needs to be accessed
internally by glibc. This way, the symbol will exist at the time libc is
linked (to get our cross compiler build to stop complaining), but those
symbols will be overridden by parlib.a in any final executable that
gets linked.

Unfortunately, this trick only works so long as we leave parlib as a
static library. If we ever decide to make parlib a .so, then we will
have to revisit this and use function pointers at runtime or something
similar. Maybe by then we will have pushed all of parlib's functionality
down into glibc, so the point will be moot anyway.

Signed-off-by: Kevin Klues <klueska@cs.berkeley.edu>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoFix bug in pthread_sigmask() semantics.
Kevin Klues [Tue, 27 Oct 2015 17:12:37 +0000 (10:12 -0700)]
Fix bug in pthread_sigmask() semantics.

Previously, the 'how' parameter was not being ignored correctly if 'set'
was NULL. Moreover, we were not setting the value of 'oset' properly in
cases where 'set' was NULL and 'how' should be ignored. This patch
attempts to fix these semantics to match the specification in:

http://linux.die.net/man/2/sigprocmask

Signed-off-by: Kevin Klues <klueska@cs.berkeley.edu>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoTabified file carrying spaces
Davide Libenzi [Sun, 1 Nov 2015 01:31:15 +0000 (18:31 -0700)]
Tabified file carrying spaces

Tabified file carrying spaces.

Signed-off-by: Davide Libenzi <dlibenzi@google.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoMigrated user memory copy APIs to use the new exception table guards
Davide Libenzi [Sat, 31 Oct 2015 01:31:15 +0000 (18:31 -0700)]
Migrated user memory copy APIs to use the new exception table guards

Migrated user memory copy APIs to use the new exception table guards.
Added string copy APIs as well.

Signed-off-by: Davide Libenzi <dlibenzi@google.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoAdd RISCV uaccess.h
Barret Rhoden [Mon, 16 Nov 2015 21:02:25 +0000 (13:02 -0800)]
Add RISCV uaccess.h

This was written by Davide, but got lost in a rebase involving
6cc759554b02 ("Plugged the exception handling code") on his branch,
which was already c7c7f1ceb352 ("Plugged the exception handling code")
on master.

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoMake userspace think it has at least one vcore
Barret Rhoden [Fri, 13 Nov 2015 20:29:56 +0000 (15:29 -0500)]
Make userspace think it has at least one vcore

This popped up if you ran Akaros on a single core machine.  In that case, you'd
have 0 CG cores, which means the kernel gives you 0 vcores.  However, SCPs
think they have one vcore.  If a process runs at all, it needs to think it has
at least one vcore.

Rebuild busybox.

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoUpdate the user Makefrag to be more generic
Kevin Klues [Fri, 13 Nov 2015 02:51:53 +0000 (18:51 -0800)]
Update the user Makefrag to be more generic

This commit updates the makefrag for user libs so that it can handle
libraries that organize their header files using different patterns. As
part of this, we are now able to remove our custom pthread Makefile, as
one of the patterns we now support is the one used by the pthread
library.

Signed-off-by: Kevin Klues <klueska@cs.berkeley.edu>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoAdd space between text and url in ak-code-review
Kevin Klues [Thu, 12 Nov 2015 17:32:56 +0000 (09:32 -0800)]
Add space between text and url in ak-code-review

Signed-off-by: Kevin Klues <klueska@cs.berkeley.edu>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoWhen starting a VM, just copy all registers in.
Ronald G. Minnich [Wed, 11 Nov 2015 01:29:28 +0000 (17:29 -0800)]
When starting a VM, just copy all registers in.

This allows the VMM to initialize registers, which we ought to do.

We need this anyway to pass in a bootparams pointer.

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoLet the toolchain Makefile respect MAKE_JOBS environment variable
Edward Hyunkoo Jee [Tue, 10 Nov 2015 19:26:05 +0000 (11:26 -0800)]
Let the toolchain Makefile respect MAKE_JOBS environment variable

Users may want to use environment variables or command-line arguments,
instead of using Makelocal file.

Signed-off-by: Edward Hyunkoo Jee <edjee@google.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoModified vmx_launch in vmx.c to track the phy core of the vm every exit
GanShun [Wed, 4 Nov 2015 15:24:08 +0000 (07:24 -0800)]
Modified vmx_launch in vmx.c to track the phy core of the vm every exit

This change updates the vmctl every time we exit from the vm to ensure
that we keep track of the correct core to send the IPIs to.

Signed-off-by: GanShun <ganshun@gmail.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoAdded Timer thread. Started by consin thread.
GanShun [Tue, 3 Nov 2015 21:18:09 +0000 (13:18 -0800)]
Added Timer thread. Started by consin thread.

Timer thread is started by the consin thread and injects interrupts into the
guest every so often.

Signed-off-by: GanShun <ganshun@gmail.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoMigrated Akaros code to use pragma once (XCC)
Davide Libenzi [Thu, 29 Oct 2015 13:22:45 +0000 (06:22 -0700)]
Migrated Akaros code to use pragma once (XCC)

Migrated Akaros code to use pragma once include file marker.

Rebuild glibc.

Signed-off-by: Davide Libenzi <dlibenzi@google.com>
[toolchain notice]
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoMigrated position dependent initialization, to label based
Davide Libenzi [Tue, 10 Nov 2015 02:31:47 +0000 (18:31 -0800)]
Migrated position dependent initialization, to label based

Migrated position dependent initialization, to label based.

Signed-off-by: Davide Libenzi <dlibenzi@google.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoAdded kernel test case for command line parsing code
Davide Libenzi [Tue, 3 Nov 2015 12:48:49 +0000 (04:48 -0800)]
Added kernel test case for command line parsing code

Added kernel test case for command line parsing code.

Signed-off-by: Davide Libenzi <dlibenzi@google.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoAdded support for multiboot protocol command line extraction
Davide Libenzi [Tue, 3 Nov 2015 03:14:32 +0000 (19:14 -0800)]
Added support for multiboot protocol command line extraction

Added support for multiboot protocol command line extraction.
Added API to fetch kernel boot command line parameters.

Signed-off-by: Davide Libenzi <dlibenzi@google.com>
[removed unnecessary null-termiate after strlcpy]
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoRename static_assert to avoid conflicting with C++'11 (and later) (XCC)
Dan Cross [Wed, 4 Nov 2015 19:22:26 +0000 (14:22 -0500)]
Rename static_assert to avoid conflicting with C++'11 (and later) (XCC)

The C++ standard laid claim to the name, 'static_assert' in the
C++'11 standard; our macro caused conflict trying to build C++
programs. Rename ours to avoid the conflict.

C11 also has support for _Static_assert and the 'static_assert'
macro in the 'assert.h' header. We should migrate to that.  This
is an incremental step in that direction.

Signed-off-by: Dan Cross <crossd@gmail.com>
[removed undef of parlib_static_assert; we aren't overriding stuff]
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoAdd empty akaros-specific sysmacros.h (XCC)
Dan Cross [Tue, 3 Nov 2015 17:11:03 +0000 (12:11 -0500)]
Add empty akaros-specific sysmacros.h (XCC)

Traditionally, this header file contains macros for
accessing the major and minor portions of a device
number, as well as a macro for combing a (major,minor)
pair into a single dev num. Unfortunately, these macros
can cause conflicts with other code (the identifiers
are too generic). Since Akaros doesn't use device
numbers, we can just have an empty file.

Signed-off-by: Dan Cross <crossd@gmail.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoPatch Busybox to use it's own version of major/minor/makedev macros
Dan Cross [Tue, 3 Nov 2015 21:19:13 +0000 (16:19 -0500)]
Patch Busybox to use it's own version of major/minor/makedev macros

These are needed for compatibility with legacy file formats (e.g.,
tar, cpio), but are absent from Akaros proper.

Signed-off-by: Dan Cross <crossd@gmail.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoAdd a set of ak-scripts for use by docopt-scripts
Kevin Klues [Tue, 3 Nov 2015 15:45:57 +0000 (07:45 -0800)]
Add a set of ak-scripts for use by docopt-scripts

The docopt-scripts tool provides a framework for invoking a collection
of bash scripts through a single command line interface. Its purpose is
to ease the development of these scripts with well-formed usage
semantics from docopt and collect them into a single place for easy
access.

The docopt-scripts tool can be downloaded from here:
https://github.com/google/docopt-scripts

Signed-off-by: Kevin Klues <klueska@cs.berkeley.edu>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoRemove unnecessary #if.
Dan Cross [Mon, 2 Nov 2015 15:28:35 +0000 (10:28 -0500)]
Remove unnecessary #if.

Remove a #if that sets a prerequisite for GCC 4.4.  No one
uses gcc 4.4 anymore, and our toolbase is based around gcc
4.9.2 so this is unnecessary.

Signed-off-by: Dan Cross <crossd@gmail.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoMade the timer interrupt setup callback consistent in behavior
Davide Libenzi [Sat, 31 Oct 2015 23:02:18 +0000 (16:02 -0700)]
Made the timer interrupt setup callback consistent in behavior

Made the timer interrupt setup callback consistent in behavior among
local and remote CPU invocation.

Signed-off-by: Davide Libenzi <dlibenzi@google.com>
[touched up checkpatch warnings]
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoAdd networking unit tests
Xiao Jia [Wed, 28 Oct 2015 00:36:41 +0000 (17:36 -0700)]
Add networking unit tests

Currently it includes a unit test for ptclbsum, and unit tests for
checksum benchmark.

Signed-off-by: Xiao Jia <stfairy@gmail.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoFix manager to run tests if KERNEL_TESTING is set
Xiao Jia [Wed, 28 Oct 2015 00:36:40 +0000 (17:36 -0700)]
Fix manager to run tests if KERNEL_TESTING is set

KERNEL_POSTBOOT_TESTING is not defined, and if USERSPACE_TESTING is
disabled, we won't run any unit tests, which is not right.

Fix it by letting the tests run whenever KERNEL_TESTING is present.

Signed-off-by: Xiao Jia <stfairy@gmail.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
4 years agoExplain why ptclcsum_finalize is correct
Xiao Jia [Wed, 28 Oct 2015 00:36:39 +0000 (17:36 -0700)]
Explain why ptclcsum_finalize is correct

Signed-off-by: Xiao Jia <stfairy@gmail.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>