[LIBS] Generic libs/unaligned.h for unaligned accesses

There may be scenarios where we may require explicit unaligned
access to u16, u32 or u64 variables.

This patch adds an adapted version of generic unaligned access
headers from Linux source.

Signed-off-by: Anup Patel <anup@brainfault.org>
Merge branch 'x86-next', remote-tracking branch 'upstream/master' into x86-next
[LIBS] bitops: initialize SMP spinlocks with default initializer

Signed-off-by: Jean-Christophe DUBOIS <jcd@tribudubois.net>
[ARM] arm32: refine spinlock operation to help SMP debug

Signed-off-by: Jean-Christophe DUBOIS <jcd@tribudubois.net>
[DRIVERS] Fix struct usb_device_id in linux compatiblity header

Signed-off-by: Anup Patel <anup@brainfault.org>
[ARM] arm32ve: refine spinlock operation to help SMP debug

Signed-off-by: Jean-Christophe DUBOIS <jcd@tribudubois.net>
[ARM] No need for #if CONFIG_SMP in cpu_locks.c

The arch spin lock APIs are only compiled for CONFIG_SMP so
no need for explicit #if CONFIG_SMP in cpu_locks.c

Signed-off-by: Anup Patel <anup@brainfault.org>
[ARM] mmu_lpae: Explicitly initialize table lock for hypervisor ttbl

The unlocked value of spin lock is no longer 0x0 hence we will need
to explicitly initialize hypervisor ttbl lock.

Signed-off-by: Anup Patel <anup@brainfault.org>
[DRIVERS] smc91x: Temporary fix for probe function

This patch fix probe function smc91x driver which is broken
after we made unlocked value of spin lock as 0xFFFFFFFF.

Although, this is just temprorary fix. The smc91x driver has
lot of commented code which need to be enabled for cleaner fix.

Signed-off-by: Anup Patel <anup@brainfault.org>
[ARM] Fix arch_spin_trylock() to return correct result

The current arch_spin_trylock() will have unknown value in tmp
if the lock was already locked.

This patch fixes this issues in arch_spin_trylock().

We also add comments to arch_spin_xxx() APIs in arm32ve.

Signed-off-by: Anup Patel <anup@brainfault.org>
[CORE] Change IPI related functions.

Signed-off-by: Jean-Christophe DUBOIS <jcd@tribudubois.net>
[CORE] Add a crude load balancer to distribute vcpus

Signed-off-by: Jean-Christophe DUBOIS <jcd@tribudubois.net>
[CORE] Add CPU affinity and use IPI to dispatch VCPU to cores

Signed-off-by: Jean-Christophe DUBOIS <jcd@tribudubois.net>
[CORE] move the load balancer to a specific directory.

This will allow to choose a particular load balancer when
more will be added.

Signed-off-by: Jean-Christophe DUBOIS <jcd@tribudubois.net>
[DRIVERS] First-cut implementation of USB framework.

This patch adds first-cut implementation of USB framework.

USB is a complicated and very much needed framework because
of the range and diversity of devices available over USB bus.

This is still work in progress. More patches will follow.

Signed-off-by: Anup Patel <anup@brainfault.org>
[CORE] Introduce vmm_spin_lock_irqsave_lite() API

We add new spin lock APIs which avoids preempt enable/disable
so that locking/unlocking does not depend on scheduler.

This new APIs are for very crucial modules which need to use
spin locks but need it to be faster.

Signed-off-by: Anup Patel <anup@brainfault.org>
[CORE] timer: Protect active event list on each host CPU

Timer events when started are always scheduled on current host CPU.

In case of SMP systems, the timer events may be stopped on-the-fly
from any other host CPU hence, we need to protect the active event
list on each host CPU.

This patch adds protection to active event list on each host CPU.

Signed-off-by: Anup Patel <anup@brainfault.org>
[ARM] arm32ve: Save/restore ADFSR and AIFSR upon VCPU switch

Signed-off-by: Anup Patel <anup@brainfault.org>
[ARM] arm32ve: Fix save/restore of SP_fiq banked register

Signed-off-by: Anup Patel <anup@brainfault.org>
[CORE] scheduler: Use lite spin lock API in vmm_scheduler_state_change()

The usual spin lock APIs call vmm_scheduler_preempt_disable()/enable()
hence, we use lite spin lock API in vmm_scheduler_state_change() to avoid
state changes depending on preempt enable/disable and also make state
changes little faster.

Signed-off-by: Anup Patel <anup@brainfault.org>