diff --git a/misc/acrn-config/board_config/board_info_h.py b/misc/acrn-config/board_config/board_info_h.py index cd5a4ecd4..75edde94a 100644 --- a/misc/acrn-config/board_config/board_info_h.py +++ b/misc/acrn-config/board_config/board_info_h.py @@ -96,7 +96,12 @@ def generate_file(config): and board_cfg_lib.is_p2sb_passthru_possible()): print("", file=config) print("#define P2SB_VGPIO_DM_ENABLED", file=config) - print("#define P2SB_BAR_ADDR\t\t\t0x{:X}UL".format(board_cfg_lib.find_p2sb_bar_addr()), file=config) + + hpa = board_cfg_lib.find_p2sb_bar_addr() + print("#define P2SB_BAR_ADDR\t\t\t0x{:X}UL".format(hpa), file=config) + gpa = common.hpa2gpa(0, hpa, 0x1000000) + print("#define P2SB_BAR_ADDR_GPA\t\t0x{:X}UL".format(gpa), file=config) + print("#define P2SB_BAR_SIZE\t\t\t0x1000000UL", file=config) if board_cfg_lib.is_matched_board(("ehl-crb-b")): print("", file=config) diff --git a/misc/acrn-config/scenario_config/vm_configurations_c.py b/misc/acrn-config/scenario_config/vm_configurations_c.py index 57bd824d2..d433a3fb9 100644 --- a/misc/acrn-config/scenario_config/vm_configurations_c.py +++ b/misc/acrn-config/scenario_config/vm_configurations_c.py @@ -337,15 +337,13 @@ def gen_pre_launch_vm(vm_type, vm_i, scenario_items, config): print("\t\t},", file=config) print("#endif", file=config) - if (vm_i == 0 and vm_info.mmio_resource_info.p2sb.get(vm_i) is not None - and vm_info.mmio_resource_info.p2sb[vm_i]): + if vm_i == 0: print("#ifdef P2SB_BAR_ADDR", file=config) print("\t\t.pt_p2sb_bar = true,", file=config) print("\t\t.mmiodevs[0] = {", file=config) - gpa = common.hpa2gpa(0, board_cfg_lib.find_p2sb_bar_addr(), 0x1000000) - print("\t\t\t.base_gpa = 0x{:X}UL,".format(gpa), file=config) + print("\t\t\t.base_gpa = P2SB_BAR_ADDR_GPA,", file=config) print("\t\t\t.base_hpa = P2SB_BAR_ADDR,", file=config) - print("\t\t\t.size = 0x1000000UL,", file=config) + print("\t\t\t.size = P2SB_BAR_SIZE,", file=config) print("\t\t},", file=config) print("#endif", file=config)