2018-03-21 14:57:44 +08:00
|
|
|
/*-
|
|
|
|
* Copyright (c) 2018 Intel Corporation
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY NETAPP, INC ``AS IS'' AND
|
|
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL NETAPP, INC OR CONTRIBUTORS BE LIABLE
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _CORE_SW_LOAD_
|
|
|
|
#define _CORE_SW_LOAD_
|
|
|
|
|
|
|
|
#define STR_LEN 1024
|
2019-05-18 08:12:32 +08:00
|
|
|
#define BOOT_ARG_LEN 2048
|
2018-03-21 14:57:44 +08:00
|
|
|
|
|
|
|
/* E820 memory types */
|
2019-08-14 16:34:29 +08:00
|
|
|
#define E820_TYPE_RAM 1U /* EFI 1, 2, 3, 4, 5, 6, 7 */
|
2018-03-21 14:57:44 +08:00
|
|
|
/* EFI 0, 11, 12, 13 (everything not used elsewhere) */
|
2019-08-14 16:34:29 +08:00
|
|
|
#define E820_TYPE_RESERVED 2U
|
|
|
|
#define E820_TYPE_ACPI_RECLAIM 3U /* EFI 9 */
|
|
|
|
#define E820_TYPE_ACPI_NVS 4U /* EFI 10 */
|
|
|
|
#define E820_TYPE_UNUSABLE 5U /* EFI 8 */
|
2018-03-21 14:57:44 +08:00
|
|
|
|
dm:reserve 64M hole for graphics stolen memory in e820 table
Add 64M@0xDB000000 for GVT-d usage as below.
Currently, use 64M for graphics stolen memory,
gop driver and uos IGD driver will use this memory region.
start end size Note
[0x 00000000, 0x 000A0000] 640K
[0x 000A0000, 0x 00100000] 384K
[0x 00100000, 0x 7ff00000] 2G-1M lowmem-1M
[0x 80000000, 0x 88000000] 128M [lowmem, +128M]
[0x DB000000, 0x DF000000] 64MB graphics stolen memory for GVT-d
[0x DF000000, 0x E0000000] 16M gvt
[0x e0000000, 0x100000000] 512M
[0x100000000, 0x140000000] 1G
Tracked-On: #4360
Signed-off-by: Junming Liu <junming.liu@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Reviewed-by: Liu XinYun <xinyun.liu@intel.com>
Reviewed-by: Shuo A Liu <shuo.a.liu@intel.com>
Reviewed-by: Wu Binbin <binbin.wu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2020-01-11 05:34:48 +08:00
|
|
|
#define NUM_E820_ENTRIES 10
|
2019-03-15 17:23:55 +08:00
|
|
|
#define LOWRAM_E820_ENTRY 2
|
dm:reserve 64M hole for graphics stolen memory in e820 table
Add 64M@0xDB000000 for GVT-d usage as below.
Currently, use 64M for graphics stolen memory,
gop driver and uos IGD driver will use this memory region.
start end size Note
[0x 00000000, 0x 000A0000] 640K
[0x 000A0000, 0x 00100000] 384K
[0x 00100000, 0x 7ff00000] 2G-1M lowmem-1M
[0x 80000000, 0x 88000000] 128M [lowmem, +128M]
[0x DB000000, 0x DF000000] 64MB graphics stolen memory for GVT-d
[0x DF000000, 0x E0000000] 16M gvt
[0x e0000000, 0x100000000] 512M
[0x100000000, 0x140000000] 1G
Tracked-On: #4360
Signed-off-by: Junming Liu <junming.liu@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Reviewed-by: Liu XinYun <xinyun.liu@intel.com>
Reviewed-by: Shuo A Liu <shuo.a.liu@intel.com>
Reviewed-by: Wu Binbin <binbin.wu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2020-01-11 05:34:48 +08:00
|
|
|
#define HIGHRAM_E820_ENTRY 9
|
2018-03-21 14:57:44 +08:00
|
|
|
|
|
|
|
/* Defines a single entry in an E820 memory map. */
|
|
|
|
struct e820_entry {
|
|
|
|
/** The base address of the memory range. */
|
|
|
|
uint64_t baseaddr;
|
|
|
|
/** The length of the memory range. */
|
|
|
|
uint64_t length;
|
|
|
|
/** The type of memory region. */
|
|
|
|
uint32_t type;
|
|
|
|
} __attribute__((packed));
|
|
|
|
|
|
|
|
extern const struct e820_entry e820_default_entries[NUM_E820_ENTRIES];
|
|
|
|
extern int with_bootargs;
|
2019-07-12 06:53:03 +08:00
|
|
|
extern bool writeback_nv_storage;
|
2018-03-21 14:57:44 +08:00
|
|
|
|
2018-12-12 17:46:16 +08:00
|
|
|
size_t ovmf_image_size(void);
|
|
|
|
|
2018-03-21 14:57:44 +08:00
|
|
|
int acrn_parse_kernel(char *arg);
|
|
|
|
int acrn_parse_ramdisk(char *arg);
|
|
|
|
int acrn_parse_bootargs(char *arg);
|
|
|
|
int acrn_parse_gvtargs(char *arg);
|
|
|
|
int acrn_parse_vsbl(char *arg);
|
2018-12-12 17:46:16 +08:00
|
|
|
int acrn_parse_ovmf(char *arg);
|
2018-10-10 23:10:23 +08:00
|
|
|
int acrn_parse_elf(char *arg);
|
2018-03-27 13:46:19 +08:00
|
|
|
int acrn_parse_guest_part_info(char *arg);
|
2018-03-21 14:57:44 +08:00
|
|
|
char *get_bootargs(void);
|
|
|
|
void vsbl_set_bdf(int bnum, int snum, int fnum);
|
|
|
|
|
2018-12-12 17:34:30 +08:00
|
|
|
int check_image(char *path, size_t size_limit, size_t *size);
|
2018-03-21 14:57:44 +08:00
|
|
|
uint32_t acrn_create_e820_table(struct vmctx *ctx, struct e820_entry *e820);
|
2018-04-04 16:01:25 +08:00
|
|
|
int add_e820_entry(struct e820_entry *e820, int len, uint64_t start,
|
|
|
|
uint64_t size, uint32_t type);
|
2018-03-21 14:57:44 +08:00
|
|
|
|
2018-03-27 12:40:39 +08:00
|
|
|
int acrn_sw_load_bzimage(struct vmctx *ctx);
|
2018-10-10 23:10:23 +08:00
|
|
|
int acrn_sw_load_elf(struct vmctx *ctx);
|
2018-03-21 14:57:44 +08:00
|
|
|
int acrn_sw_load_vsbl(struct vmctx *ctx);
|
2018-12-12 17:46:16 +08:00
|
|
|
int acrn_sw_load_ovmf(struct vmctx *ctx);
|
2019-07-12 06:53:03 +08:00
|
|
|
int acrn_writeback_ovmf_nvstorage(struct vmctx *ctx);
|
2018-03-21 14:57:44 +08:00
|
|
|
int acrn_sw_load(struct vmctx *ctx);
|
|
|
|
#endif
|
|
|
|
|