1 /*
2  * Copyright (C) 2019-2022 Intel Corporation.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #ifndef VACPI_H
8 #define VACPI_H
9 
10 #include <acpi.h>
11 #include <asm/guest/vm.h>
12 
13 #define ACPI_OEM_ID           "ACRN  "
14 
15 /* Use a pre-loaded multiboot module as pre-launched VM ACPI table.
16  * The module file size is fixed to 1MB and loaded to GPA 0x7fe00000.
17  * A hardcoded RSDP table at GPA 0x000f2400 will point to the XSDT
18  * table which at GPA 0x7fe00080;
19  * The module file should be generated by acrn-config tool;
20  */
21 #define VIRT_ACPI_DATA_LEN	MEM_1M
22 #define VIRT_ACPI_NVS_LEN	MEM_1M
23 /* Currently ACPI NVS start addr is presumed to be consecutive with ACPI DATA area right below 0x80000000 */
24 #define VIRT_ACPI_NVS_ADDR	(0x80000000UL - VIRT_ACPI_NVS_LEN)
25 #define VIRT_ACPI_DATA_ADDR	(VIRT_ACPI_NVS_ADDR - VIRT_ACPI_DATA_LEN)
26 #define VIRT_RSDP_ADDR		0x000f2400UL
27 #define VIRT_XSDT_ADDR		0x7fe00080UL
28 
29 /* virtual PCI MMCFG address base for pre/post-launched VM. */
30 #define USER_VM_VIRT_PCI_MMCFG_BASE		0xE0000000UL
31 #define USER_VM_VIRT_PCI_MMCFG_START_BUS	0x0U
32 #define USER_VM_VIRT_PCI_MMCFG_END_BUS	0xFFU
33 #define USER_VM_VIRT_PCI_MEMBASE32      0x80000000UL    /* 2GB */
34 #define USER_VM_VIRT_PCI_MEMLIMIT32     0xE0000000UL    /* 3.5GB */
35 #define USER_VM_VIRT_PCI_MEMBASE64      0x4000000000UL   /* 256GB */
36 #define USER_VM_VIRT_PCI_MEMLIMIT64     0x8000000000UL   /* 512GB */
37 
38 void build_vrsdp(struct acrn_vm *vm);
39 
40 #endif /* VACPI_H */
41