mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-24 22:42:53 +00:00
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:
parent
9cc090e677
commit
76f384779c
@ -224,15 +224,16 @@ def interrupt_storm(pt_sel, config):
|
|||||||
def gvt_arg_set(dm, vmid, uos_type, config):
|
def gvt_arg_set(dm, vmid, uos_type, config):
|
||||||
|
|
||||||
gvt_args = dm['gvt_args'][vmid]
|
gvt_args = dm['gvt_args'][vmid]
|
||||||
if gvt_args == "gvtd":
|
gpu_bdf = launch_cfg_lib.get_gpu_bdf()
|
||||||
bus = int(launch_cfg_lib.GPU_BDF.split(':')[0], 16)
|
|
||||||
dev = int(launch_cfg_lib.GPU_BDF.split('.')[0].split(':')[1], 16)
|
if gvt_args == "gvtd" and gpu_bdf is not None:
|
||||||
fun = int(launch_cfg_lib.GPU_BDF.split('.')[1], 16)
|
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)
|
print(' -s 2,passthru,{}/{}/{},gpu \\'.format(bus, dev, fun), file=config)
|
||||||
elif gvt_args:
|
elif gvt_args:
|
||||||
print(' -s 2,pci-gvt -G "$2" \\', file=config)
|
print(' -s 2,pci-gvt -G "$2" \\', file=config)
|
||||||
|
|
||||||
|
|
||||||
def log_level_set(uos_type, config):
|
def log_level_set(uos_type, config):
|
||||||
|
|
||||||
print("#logger_setting, format: logger_name,level; like following", file=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
|
# set logger_setting for all VMs
|
||||||
print(" $logger_setting \\", file=config)
|
print(" $logger_setting \\", file=config)
|
||||||
|
|
||||||
|
# GVT args set
|
||||||
|
gvt_arg_set(dm, vmid, uos_type, config)
|
||||||
|
|
||||||
# XHCI args set
|
# XHCI args set
|
||||||
xhci_args_set(dm, vmid, config)
|
xhci_args_set(dm, vmid, config)
|
||||||
|
|
||||||
# VIRTIO args set
|
# VIRTIO args set
|
||||||
virtio_args_set(dm, virt_io, vmid, config)
|
virtio_args_set(dm, virt_io, vmid, config)
|
||||||
|
|
||||||
# GVT args set
|
|
||||||
gvt_arg_set(dm, vmid, uos_type, config)
|
|
||||||
|
|
||||||
# vbootloader setting
|
# vbootloader setting
|
||||||
vboot_arg_set(dm, vmid, config)
|
vboot_arg_set(dm, vmid, config)
|
||||||
|
|
||||||
|
@ -253,7 +253,8 @@ def gen_pt_head(names, dm, sel, vmid, config):
|
|||||||
continue
|
continue
|
||||||
print('["{}"]="0000:{}"'.format(pt_dev, sel.bdf[pt_dev][vmid]), file=config)
|
print('["{}"]="0000:{}"'.format(pt_dev, sel.bdf[pt_dev][vmid]), file=config)
|
||||||
if dm['gvt_args'][vmid] == "gvtd":
|
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)
|
||||||
|
|
||||||
print("", file=config)
|
print("", file=config)
|
||||||
|
@ -57,7 +57,6 @@ PM_CHANNEL_DIC = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
MOUNT_FLAG_DIC = {}
|
MOUNT_FLAG_DIC = {}
|
||||||
GPU_BDF = "00:02.0"
|
|
||||||
|
|
||||||
|
|
||||||
def usage(file_name):
|
def usage(file_name):
|
||||||
@ -506,12 +505,24 @@ def bdf_duplicate_check(bdf_dic):
|
|||||||
bdf_used.append(dev_bdf)
|
bdf_used.append(dev_bdf)
|
||||||
|
|
||||||
|
|
||||||
|
def get_gpu_bdf():
|
||||||
|
|
||||||
|
pci_lines = board_cfg_lib.get_info(common.BOARD_INFO_FILE, "<PCI_DEVICE>", "</PCI_DEVICE>")
|
||||||
|
|
||||||
|
for line in pci_lines:
|
||||||
|
if "VGA compatible controller" in line:
|
||||||
|
global gpu_bdf
|
||||||
|
gpu_bdf = line.split('\t')[1]
|
||||||
|
gpu_bdf = gpu_bdf[0:7]
|
||||||
|
return gpu_bdf
|
||||||
|
|
||||||
def get_gpu_vpid():
|
def get_gpu_vpid():
|
||||||
|
|
||||||
vpid = ''
|
vpid = ''
|
||||||
vpid_lines = board_cfg_lib.get_info(common.BOARD_INFO_FILE, "<PCI_VID_PID>", "</PCI_VID_PID>")
|
vpid_lines = board_cfg_lib.get_info(common.BOARD_INFO_FILE, "<PCI_VID_PID>", "</PCI_VID_PID>")
|
||||||
|
gpu_bdf = get_gpu_bdf()
|
||||||
for vpid_line in vpid_lines:
|
for vpid_line in vpid_lines:
|
||||||
if GPU_BDF in vpid_line:
|
if gpu_bdf in vpid_line:
|
||||||
vpid = " ".join(vpid_line.split()[2].split(':'))
|
vpid = " ".join(vpid_line.split()[2].split(':'))
|
||||||
return vpid
|
return vpid
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user