acrn-hypervisor/hypervisor/bsp
Xiangyang Wu c4c788ca33 HV:BSP:Update firmware detection and operations selecting logic
In the current design, hypervisor only detects two kinds of
multiboot compiliant firwares (UEFI loader and non-UEFI loader),
It can't detect other multiboot compliant firware (such GRUB
loader) and can't detect UEFI loader explicitly since loader
name is not supported by UEFI loader (efi stub). In the
logical partition scenario on KBL NUC i7, one multiboot
compliant firware is used to boot hypervisor and load guest
OS image, and firware runtime service shall be disable to
avoid interference. So GRUB can be selected as a candidate
to enable logical partition scenario on KBL NUC i7.

Update firware detection and operations selecting logic to detect
more multiboot compiliant firware (such as GRUB and UEFI loader)
explicitly, different operations is selected according to the
boot load name through a static mapping table between boot load name
and firmware operations. GRUB loader can use the SBL operations
to handle multiboot information parsing and vm booting since
these multiboot compiliant firmware (SBL/ABL/GRUB) which boots
hypervisor (binary format), provides multiboot information and
the start address of guest OS image(binary format) in the same way,
and only runs on boot time.
From MISRA C view, viarble array is not allowed, so define the
static array for above mapping table;
From security view, it is better use strncmp insteads of strcmp.

TODO: In future, need to redesign boot moudle to suport different
boot loader, different VM boot, and different guest OS.

V2-->V3:
        Update firmware detection logic to handle GRUB loader
        which is need to provided multiboot information to the
        hypervisor (such as the address of guest OS image);
V3-->V4:
        Update firmware detection and operations selecting logic
	to enable GRUB loader support in hypervisor;
V4-->V5:
	Separte UEFI loader name supporting in a separate patch,
	and update commit comment to make patch clearer.
V5-->V6:
	Update "Tracked-On"

Tracked-On: #2944

Signed-off-by: Xiangyang Wu <xiangyang.wu@linux.intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-04-16 12:07:58 +08:00
..
include HV:BSP:Update firmware detection and operations selecting logic 2019-04-16 12:07:58 +08:00
ld hv: enable NX in hypervisor 2018-12-12 12:53:18 +08:00
cmdline.c hv: merge SBL and UEFI related stuff under bsp 2019-03-13 10:26:55 +08:00
const_dmar.c HV: Remove hypervisor.h from bsp folder 2019-03-25 11:13:57 +08:00
firmware_sbl.c HV: Remove hypervisor.h from bsp folder 2019-03-25 11:13:57 +08:00
firmware_uefi.c HV: Remove hypervisor.h from bsp folder 2019-03-25 11:13:57 +08:00
firmware_wrapper.c HV:BSP:Update firmware detection and operations selecting logic 2019-04-16 12:07:58 +08:00