config-tools: move the pre RTVM's SSRAM base GPA

The pre-rtvm uses the RTCT tab to determine it's SSRAM address.
It was origionally duplicated from the host, and keeped its address
and layout.

To move the SSRAM area in ve820, we have to modify the guest's RTCT
tab first.

This patch uses the board_inspector's RTCT module to parse the host's
RTCT tab, and calculate the offset, then modifies the SSRAM/bin enties,
and saves it to the new RTCT bin file.

Tracked-On: #6674

Signed-off-by: Zhou, Wu <wu.zhou@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
This commit is contained in:
Zhou, Wu
2021-11-05 14:11:09 +08:00
committed by wenlingz
parent f1f6fe11c1
commit 48adda150c
2 changed files with 64 additions and 13 deletions

View File

@@ -72,11 +72,15 @@ VMSIX_VBAR_SIZE = 4 * SIZE_K
# Constant for VIRT_ACPI_NVS_ADDR
"""
VIRT_ACPI_NVS_ADDR needs to be consistant with the layout of hypervisor\arch\x86\guest\ve820.c
VIRT_ACPI_NVS_ADDR, PRE_RTVM_SW_SRAM_BASE_GPA and PRE_RTVM_SW_SRAM_MAX_SIZE
need to be consistant with the layout of hypervisor\arch\x86\guest\ve820.c
"""
VIRT_ACPI_NVS_ADDR = 0x7FF00000
RESERVED_NVS_AREA = 0xB0000
PRE_RTVM_SW_SRAM_BASE_GPA = 0x7F5FB000
PRE_RTVM_SW_SRAM_MAX_SIZE = 0x800000
class AddrWindow(namedtuple(
"AddrWindow", [
"start",
@@ -489,8 +493,9 @@ def allocate_ssram_region(board_etree, scenario_etree, allocation_etree):
allocation_vm_node = common.get_node(f"/acrn-config/vm[@id = '{vm_id}']", allocation_etree)
if allocation_vm_node is None:
allocation_vm_node = common.append_node("/acrn-config/vm", None, allocation_etree, id = vm_id)
common.append_node("./ssram/start_gpa", hex(start), allocation_vm_node)
common.append_node("./ssram/end_gpa", hex(end), allocation_vm_node)
common.append_node("./ssram/start_gpa", hex(PRE_RTVM_SW_SRAM_BASE_GPA), allocation_vm_node)
common.append_node("./ssram/end_gpa", hex(PRE_RTVM_SW_SRAM_BASE_GPA + (end - start)), allocation_vm_node)
common.append_node("./ssram/max_size", hex(PRE_RTVM_SW_SRAM_MAX_SIZE), allocation_vm_node)
def allocate_log_area(board_etree, scenario_etree, allocation_etree):
tpm2_enabled = common.get_node(f"//vm[@id = '0']/mmio_resources/TPM2/text()", scenario_etree)
@@ -527,6 +532,8 @@ def pt_dev_io_port_passthrough(board_etree, scenario_etree, allocation_etree):
| | Offset 0x80000000
... ...
| TPM2 log area at 0x7FFB0000 |
... ...
| SSRAM area at 0x7F5FB000 |
... ...
| |
+--------------------------------------------------+ <--Offset 0