config_tools: update the logic of getting gpu bdf

The bdf of gpu is not 00:02.0 for the new platform icx-rvp,
it is 05:00.0 now, so we remove the hardcode 00:02.0;
And change to get the gpu bdf from board.xml.

Tracked-On: #6357
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
This commit is contained in:
Kunhui-Li
2021-08-26 15:58:29 +08:00
committed by wenlingz
parent a5ab8d567a
commit 7b19c8e878
3 changed files with 24 additions and 11 deletions

View File

@@ -224,15 +224,16 @@ def interrupt_storm(pt_sel, config):
def gvt_arg_set(dm, vmid, uos_type, config):
gvt_args = dm['gvt_args'][vmid]
if gvt_args == "gvtd":
bus = int(launch_cfg_lib.GPU_BDF.split(':')[0], 16)
dev = int(launch_cfg_lib.GPU_BDF.split('.')[0].split(':')[1], 16)
fun = int(launch_cfg_lib.GPU_BDF.split('.')[1], 16)
gpu_bdf = launch_cfg_lib.get_gpu_bdf()
if gvt_args == "gvtd" and gpu_bdf is not None:
bus = int(gpu_bdf[0:2], 16)
dev = int(gpu_bdf[3:5], 16)
fun = int(gpu_bdf[6:7], 16)
print(' -s 2,passthru,{}/{}/{},gpu \\'.format(bus, dev, fun), file=config)
elif gvt_args:
print(' -s 2,pci-gvt -G "$2" \\', file=config)
def log_level_set(uos_type, config):
print("#logger_setting, format: logger_name,level; like following", file=config)
@@ -603,15 +604,15 @@ def dm_arg_set(names, sel, virt_io, dm, vmid, config):
# set logger_setting for all VMs
print(" $logger_setting \\", file=config)
# GVT args set
gvt_arg_set(dm, vmid, uos_type, config)
# XHCI args set
xhci_args_set(dm, vmid, config)
# VIRTIO args set
virtio_args_set(dm, virt_io, vmid, config)
# GVT args set
gvt_arg_set(dm, vmid, uos_type, config)
# vbootloader setting
vboot_arg_set(dm, vmid, config)

View File

@@ -253,7 +253,8 @@ def gen_pt_head(names, dm, sel, vmid, config):
continue
print('["{}"]="0000:{}"'.format(pt_dev, sel.bdf[pt_dev][vmid]), file=config)
if dm['gvt_args'][vmid] == "gvtd":
print('["gpu"]="0000:{}"'.format(launch_cfg_lib.GPU_BDF), file=config)
gpu_bdf = launch_cfg_lib.get_gpu_bdf()
print('["gpu"]="0000:{}"'.format(gpu_bdf), file=config)
print(')', file=config)
print("", file=config)