[CORE] vmm_loadbal: More improvements to crude balancer

Currently, the crude loadbalancer is not able to correctly
determine worst hcpu if more than one hcpu have 100% cpu
utilization.

This patch improves the meaning of "worst hcpu" for curde
loadbalancer, as follows:
1. A worst hcpu is hcpu with maximum cpu utilization
2. If more than one hcpu have maximum cpu utilization
   then hcpu with more active VCPUs is consided worst.

The above mentioned improvement in "worst hcpu" semantics
helps crude loadbalancer perform better when 2 or more
hcpu are 100% utilized by helping pick more appropriate
"worst hcpu".

Signed-off-by: Anup Patel <anup@brainfault.org>
[CORE] vmm_devdrv: Rename "default" bus to "platform" bus

Our "default" bus is nothing but "platform" bus in linux
terminology hence, this patch does the renaming accordingly.

Signed-off-by: Anup Patel <anup@brainfault.org>
[COMMANDS] cmd_host: Add sub-commands to list buses, classes, and devices

This patch adds following sub-commands to host commands:
bus_list          - List all buses
bus_device_list   - List all devices on given bus
class_list        - List all classes
class_device_list - List all devices on given class

Signed-off-by: Anup Patel <anup@brainfault.org>
[DRIVERS] Move dma_addr_t to core/vmm_types.h

The IOMMU framework uses dma_addr_t type and this framework
will be shared by drivers and emulations hence we move
dma_addr_t to core/vmm_types.h.

Signed-off-by: Anup Patel <anup@brainfault.org>
[CORE] vmm_devdrv: Add public fields for IOMMU framework

The IOMMU framework requires "iommu_ops" field in struct vmm_bus
and "iommu_group" in struct vmm_device hence this patch.

This is more of preparatory patch for IOMMU framework.

Signed-off-by: Anup Patel <anup@brainfault.org>
[CORE] First-cut implementation of IOMMU framework

This patch adds Linux-like IOMMU framework for Xvisor.

Currently, the IOMMU framework is little incomplete due
to pending changes in device driver framework.

The IOMMU framework will be used by device drivers via
linux-compatible linux/iommu.h header. It will be also
used by emulator to setup IOMMU context for pass-through
devices.

Signed-off-by: Anup Patel <anup@brainfault.org>
[ARM] Enable IOMMU framework for arm32ve and arm64

The SystemMMU hardware is generally available on ARM
boards with hardware virtualization support hence
enabled IOMMU framework for arm32ve and arm64 ports.

Signed-off-by: Anup Patel <anup@brainfault.org>
[COMMANDS] Advertise host cpu stats command

We forgot to advertise "host cpu stats" command in host
command usage hence this patch.

Signed-off-by: Anup Patel <anup@brainfault.org>
[CORE] vmm_devdrv: Add support bus event notifications

This patch adds linux-like bus event notifications.

The bus events which can be listened include:
1. Add device
2. Delete device
3. Bind driver
4. Bound driver
5. Unbind driver
6. Unbound driver

Signed-off-by: Anup Patel <anup@brainfault.org>
[DRIVERS] Add linux-compatile bus notification API in linux/device.h

This patch updates linux/device.h header to have linux-compatible
bus notification API in-terms of vmm_devdrv APIs.

Signed-off-by: Anup Patel <anup@brainfault.org>
[CORE] vmm_devdrv: Improve APIs to find and iterate over bus devices

This patch makes APIs to find bus device linux-like and adds
new linux-like API to iterate over bus devices.

Signed-off-by: Anup Patel <anup@brainfault.org>
[CORE] vmm_iommu: IOMMU framework must listen to bus events

The IOMMU framework must monitor/watch bus events and update
IOMMU groups when device is added/deleted.

This patch also establish connection between IOMMU group events
and device driver BUS events.

Signed-off-by: Anup Patel <anup@brainfault.org>
[DRIVERS] Add linux-compatiblity header for porting IOMMU drivers

This patch adds linux/iommu.h header which expresses Linux IOMMU
APIs in-terms of vmm_iommu.h APIs so that porting IOMMU drivers
is easier.

Signed-off-by: Anup Patel <anup@brainfault.org>
Merge remote-tracking branch 'upstream/master'