Re: [PATCH] misc: add assert to check the vBDF conflict

Junjie Mao

"chenli.wei" <chenli.wei@...> writes:

On 8/5/2022 11:19 PM, Junjie Mao wrote:
Chenli Wei <chenli.wei@...> writes:

From: Chenli Wei <chenli.wei@...>

The current ACRN-Configurator just check the conflict of user setting.
have not check the conflict with native PCI device's bdf.

This patch add an assert to check the above conflict.

Tracked-On: #6690
Signed-off-by: Chenli Wei <chenli.wei@...>
misc/config_tools/schema/checks/vbdf_assignment.xsd | 10 ++++++++++
1 file changed, 10 insertions(+)

diff --git a/misc/config_tools/schema/checks/vbdf_assignment.xsd b/misc/config_tools/schema/checks/vbdf_assignment.xsd
index fde14c2b7..062b0fe67 100644
--- a/misc/config_tools/schema/checks/vbdf_assignment.xsd
+++ b/misc/config_tools/schema/checks/vbdf_assignment.xsd
@@ -14,4 +14,14 @@
+ <xs:assert test="every $root in /acrn-config satisfies
+ every $vm in $root/vm satisfies
+ 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() satisfies
Shall we check only the BDFs of ivshmem/vUART devices for the service
VM? To other VMs the BDFs are generated by the config tools which should
be able to avoid BDF collision.

BTW, please do not mix white spaces and tabs.
I thinks the pre-launched VM's vBDF setting should also be checked if we don't
check every VM.
Aren't the vBDF of passthrough devices of a pre-launched VM allocated by
the config tools rather than specified by users?

Best Regards
Junjie Mao

Join to automatically receive all group messages.