eco32: handle vmalloc faults

+ alot of debug printing

Signed-off-by: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
eco32: pgtable: add READ and EXEC flags to certain pages

Software only flag, hardware will ignore those.

Signed-off-by: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
eco32: pgtable: let pmd_val(pmd) represent pmd_present

We can either ignore the _PAGE_PRESENT bit or set it in
the pmd_populate_xxx() macros, this takes the path of
ignoring it and only rely on that the address part of the
pmd is set to consider it valid.

Signed-off-by: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
eco32: entry: push the syscall arg regs $8 and $9 to stack

Since we have a slightly different ABI for system calls and
normal function calls, we have to accomodate for this before
calling the system call function from syscall_handler.

Signed-off-by: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
eco32: entry: load $30 from pt_regs before modifiying it.

$30 (exception return) might have been clobbered while handling
the system call, so we have to load it before modifying it.

Signed-off-by: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
eco32: fault: add more checks for bad areas

Signed-off-by: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
eco32: fault: remove/change/add debug prints
eco32: thread_info: include asm/page

We depend on this for the THREAD_SIZE calculation,
and when trying to use the THREAD_SIZE define in asm without
having PAGE_SIZE defined, the instruction will silently be
omitted.

Signed-off-by: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
eco32: pgalloc: remove TODO note
eco32: process: use regs->pc to show $30 in show_regs()

gpr[30] is never set, so it doesn't hold valid info.

Signed-off-by: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
eco32: entry: fix stack extraction on user->kernel exceptions

Pulling out the actual kernel stack pointer,
as the old code did, is completely wrong.
The way it's supposed to work, is that the entry point
for the user->kernel exception stack never changes.
This works, since there can only be one user->kernel
transition even if nested interrupts will occur.

Signed-off-by: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
eco32: entry: adjust the return address before calling syscalls

When the fork system call is used, the path to ret_from_syscall
will take a different route back, so we must have the correct
$30 saved to the stack before calling the system call.

Signed-off-by: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
eco32: mmu_context: flush tlbs on destroy_context
eco32: remove endless debug loop from ret_from_fork

the forked thread should return from the sys call, just as
the parent, the only difference is the path they do it in.

Signed-off-by: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
eco32: add/change/remove debug prints and use pr_debug
eco32: entry: fix load of $9 in syscall debug