Merge pull request #15 from hschauhan/x86-next

X86 next
[DRIVERS] i8042: Replace CONFIG_X86 with CONFIG_ARCH_x86

Signed-off-by: Anup Patel <anup@brainfault.org>
[CORE] Do VCPU state transitions in vmm_scheduler only

Till now, vmm_manager_vcpu_state_change() used to control
VCPU state transitions and notify vmm_scheduler using
vmm_scheduler_state_change() API.

This unifies the VCPU state transition and moves it to
vmm_scheduler_state_change() API.

The vmm_manager_vcpu_state_change() would be still required
for SMP to do vmm_scheduler_state_change() on appropriate
host CPU.

Signed-off-by: Anup Patel <anup@brainfault.org>
[CORE] Minor bug fix in vmm_scheduler_state_change() API

Signed-off-by: Anup Patel <anup@brainfault.org>
[CORE] net: More debug prints in netswitch source

Signed-off-by: Anup Patel <anup@brainfault.org>
[CORE] Maintain preempt count in all flavours of spinlock APIs

This patch makes our spinlock APIs more consistent with spinlock API
semantics in linux.

In linux, all flavours of spinlock APIs call preempt_enable() and
preempt_disable() for both UP and SMP.

Signed-off-by: Anup Patel <anup@brainfault.org>
[CORE] scheduler: Introduce arch_vcpu_orphan_preempt() for Orphan VCPUs

This patch introduces arch_vcpu_orphan_preempt() API which can be
optionally provided by architecture specific code to have faster
yielding/preemption of Orphan VCPUs

Till now we were dependent on vmm_timer_event_expire() for yielding or
preempting Orphan VCPUs. The issue with this approach is that not all
hardware clockchips are accurate, robust and fast so, implementing an
expire callback is always tricky. Usually, the clockchip expier callback
will have a polling loop which will potentially waste lot of CPU cycles.

Once all architectures (primarily ARM & x86) move from
vmm_timer_event_expire() to arch_vcpu_preempt_orphan(), the
arch_vcpu_preempt_orphan() will be mandated for all architecture supports.

Signed-off-by: Anup Patel <anup@brainfault.org>
[ARM] arm32: Implement arch_vcpu_preempt_orphan() for Orphan VCPUs

Signed-off-by: Anup Patel <anup@brainfault.org>
[ARM] arm32ve: Implement arch_vcpu_preempt_orphan() for Orphan VCPUs

Signed-off-by: Anup Patel <anup@brainfault.org>
[CORE] scheduler: Make APIs atomic for CPU on which called

This patch makes few vmm_scheduler APIs atomic for the CPU
on which they are called.

The rationale here is that vmm_scheduler has per-CPU context
for every host CPU hence, the per-CPU context on each CPU
should be accessed atomically using arch_cpu_irq_save() and
arch_cpu_irq_restore() APIs.

Signed-off-by: Anup Patel <anup@brainfault.org>
[CORE] Fix completion_wait_common() for wait timeout case

When the __vmm_waitqueue_wait() returns due to timeout the
return value is VMM_ETIMEDOUT which is not VMM_OK.

In this case, we should still be decrementing completion
done flag if it was not zero. If this is not done then
subsequenent completion wait will not sleep because done
flag was not decremented.

Signed-off-by: Anup Patel <anup@brainfault.org>
[CORE] net: Make netport default queue size in-relation to max queue size

Instead of having fixed value for netport default queue size, we should have
default queue size to be in-relation to max queue size.

This patch makes netport default queue size as 1/4th of netport max queue
size.

Signed-off-by: Anup Patel <anup@brainfault.org>
[CORE] net: Improve netswitch bottom-half thread

This patch does two improvements for the bottom-half thread of
netswitch. This are as follows:

1. The thread should not wait infinitely for xfer request. Instead,
it should wake periodically after sufficently long time to check
for available xfer request.

2. We should not hold xfer request instance till mbuf is being process.
The xfer request should be freed immediately so that more xfer request
can be submitted.

Signed-off-by: Anup Patel <anup@brainfault.org>
[ARM] i.MX timer: increase the minimum time for a timer expire.

We need this time to have a minimum value to get a normal
behavior on real hardware.

Signed-off-by: Jean-Christophe DUBOIS <jcd@tribudubois.net>
[ARM] Add i.MX25 3DStack evaluation board from Freescale.

Signed-off-by: Jean-Christophe DUBOIS <jcd@tribudubois.net>
[DRIVERS] i.MX: Add full serial driver for i.MX.

This driver is still not complete an rely on the boot loader to set
the baudrate.

Signed-off-by: Jean-Christophe DUBOIS <jcd@tribudubois.net>
[DRIVERS] i.MX UART: disable TX interrupts.

The code does not work on real hardware for now.

Need fixing.

Signed-off-by: Jean-Christophe DUBOIS <jcd@tribudubois.net>
[LIBS] Fix brief description of fifo APIs

Signed-off-by: Anup Patel <anup@brainfault.org>
[LIBS] Add generic last-in-first-out queue APIs

Signed-off-by: Anup Patel <anup@brainfault.org>
Merge pull request #16 from hschauhan/x86-next

X86 next