diff --git a/misc/config_tools/configurator/packages/configurator/src/pages/Config.vue b/misc/config_tools/configurator/packages/configurator/src/pages/Config.vue
index bd15bd107e..0fe513eb5f 100644
--- a/misc/config_tools/configurator/packages/configurator/src/pages/Config.vue
+++ b/misc/config_tools/configurator/packages/configurator/src/pages/Config.vue
@@ -494,6 +494,7 @@ export default {
let postVerification = await this.verifyBDFCollision(this.board, this.scenario)
console.log('postVerification: ',postVerification)
+ /*
if(!postVerification){
let all_errors = configurator.pythonObject.validateScenario(this.board.content, scenarioXMLData)
console.log(all_errors)
@@ -503,6 +504,7 @@ export default {
}
//i have not find the place to show error messages which is not satisfied with regex yet, i place the error messages in console now
}
+ */
this.scenario.vm.map((vmConfig) => {
if (vmConfig['load_order'] === 'POST_LAUNCHED_VM') {
diff --git a/misc/config_tools/configurator/pyodide/verifyBDFCollision.py b/misc/config_tools/configurator/pyodide/verifyBDFCollision.py
index e4ae692fa7..b7f197aa9e 100644
--- a/misc/config_tools/configurator/pyodide/verifyBDFCollision.py
+++ b/misc/config_tools/configurator/pyodide/verifyBDFCollision.py
@@ -14,6 +14,18 @@
from .pyodide import convert_result, nuc11_board, nuc11_scenario
+def validate_load_order(base, name, vbdf):
+ vms = base.xpath('vm')
+ for vm in vms:
+ vm_name = vm.xpath('name/text()')[0].strip()
+ load_order = vm.xpath('load_order/text()')[0].strip()
+ if vm_name == name and load_order != 'POST_LAUNCHED_VM':
+ return True
+ elif vm_name == name and load_order == 'POST_LAUNCHED_VM':
+ check_ = lambda x: True if (t := int('0x' + x[3:5], 16)) >= 3 and t < 31 else False # 3,1e
+ return check_(vbdf)
+
+
def validate_(bdf):
pat = re.compile(r"([0-9a-fA-F]{1,2}:[0-1][0-9A-Fa-f]\.[0-7]).*")
if (m := re.search(pat, bdf.strip())) and (m1 := m.group(1).strip()):
@@ -22,93 +34,140 @@ def validate_(bdf):
return ""
-def _valid(scenario_etree, bdfs):
- vuart_vbdf = scenario_etree.xpath('/acrn-config/hv/DEBUG_OPTIONS/VUART_VBDF/text()')[0].strip()
- vuart_vbdf_ = validate_(vuart_vbdf)
- return True if bdfs and vuart_vbdf_ and vuart_vbdf_ not in bdfs else False
-
-
-def validate_pci(board, scenario):
- if board.startswith('
-
+ every $vbdf in $root/hv//vuart_connection[type='pci']/endpoint[vm_name=$vm/name]/vbdf/text() |
+ $root/hv//IVSHMEM_VM[VM_NAME=$vm/name]/VBDF/text() |
+ $root/hv//DEBUG_OPTIONS[SERIAL_CONSOLE=Vuart]/VUART_VBDF/text() satisfies
+ count($root/hv//vuart_connection[type='pci']/endpoint[vm_name=$vm/name and vbdf=$vbdf] |
+ $root/hv//IVSHMEM_VM[VM_NAME=$vm/name and VBDF=$vbdf] |
+ $root/hv//DEBUG_OPTIONS[SERIAL_CONSOLE=Vuart and VUART_VBDF=$vbdf]) = 1">
+
VM "{$vm/name}" contains multiple virtual UART controllers or IVSHMEM interfaces using BDF {$vbdf}. Adjust the BDF of those devices to be unique.
-
+
-
+
VM "{$vm/name}" virtual UART controllers or IVSHMEM interfaces using BDF {$vbdf} conflict with native PCI device. Adjust the BDF of those devices to be unique.
diff --git a/misc/config_tools/schema/config.xsd b/misc/config_tools/schema/config.xsd
index ecb735d07d..0bb29c8421 100644
--- a/misc/config_tools/schema/config.xsd
+++ b/misc/config_tools/schema/config.xsd
@@ -20,10 +20,10 @@
-
+
Specify the virtual Bus:Device.Function (BDF) for each PCI virtual UART. Virtual BDF is automatically assigned when the configuration is saved and can be changed if needed.
diff --git a/misc/config_tools/xforms/lib.xsl b/misc/config_tools/xforms/lib.xsl
index 2ac4739cab..8ecffb61dc 100644
--- a/misc/config_tools/xforms/lib.xsl
+++ b/misc/config_tools/xforms/lib.xsl
@@ -316,6 +316,39 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/misc/config_tools/xforms/pci_dev.c.xsl b/misc/config_tools/xforms/pci_dev.c.xsl
index c08e8a7964..3522329c78 100644
--- a/misc/config_tools/xforms/pci_dev.c.xsl
+++ b/misc/config_tools/xforms/pci_dev.c.xsl
@@ -47,6 +47,7 @@
+
@@ -144,13 +145,12 @@
-
-
+
{
diff --git a/misc/config_tools/xforms/vm_configurations.c.xsl b/misc/config_tools/xforms/vm_configurations.c.xsl
index 8e4a5beefc..83924fd878 100644
--- a/misc/config_tools/xforms/vm_configurations.c.xsl
+++ b/misc/config_tools/xforms/vm_configurations.c.xsl
@@ -336,6 +336,13 @@
},
+
+
+
+
+
+
+
diff --git a/misc/config_tools/xforms/vm_configurations.h.xsl b/misc/config_tools/xforms/vm_configurations.h.xsl
index 43bc18ca9f..cdf7fb0940 100644
--- a/misc/config_tools/xforms/vm_configurations.h.xsl
+++ b/misc/config_tools/xforms/vm_configurations.h.xsl
@@ -48,7 +48,14 @@
-
+
+
+
+
+
+
+
+