config-tools: enable PTM through config-tools

Configure PTM in post-launched VM using <PTM> element. If the //vm/PTM
sets to 'y', pci_dev.c.xsl appends the virtual root port to
corresponding struct acrn_vm_pci_dev_config of that VM. Currently it
supports only post-launched VMs.

Configure enable_ptm for dm argument. If a uos/enable_ptm with uos id
= 'vm_id 'sets to 'y' and the vm/PTM with the same vm_id sets to 'y',
append an "enable_ptm" flag to the end of passthrough ethernet devices.
Currently there is only ethernet card can support the "enable_ptm"flag.

For the schema validation, the <PTM> can only be ['y', 'n'].

For the launched script validation, the <enable_ptm> can only be ['y',
'n']. If the <enable_ptm> sets to 'y' but the corresponding <PTM> sets
to 'n', the launch script will fail to generate.

Tracked-On: #6054
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
This commit is contained in:
Yang,Yu-chu
2021-05-20 17:43:48 -07:00
committed by wenlingz
parent 68e4c66175
commit 346490a7dc
7 changed files with 57 additions and 6 deletions

View File

@@ -48,6 +48,9 @@
<xsl:apply-templates select="console_vuart" />
<xsl:apply-templates select="communication_vuart" />
<xsl:apply-templates select="pci_devs" />
<xsl:if test="acrn:is-post-launched-vm(vm_type)">
<xsl:apply-templates select="PTM" />
</xsl:if>
<xsl:if test="acrn:is-sos-vm(vm_type) or acrn:pci-dev-num(@id)">
<xsl:value-of select="$end_of_array_initializer" />
@@ -164,4 +167,15 @@
</xsl:for-each>
</xsl:template>
<xsl:template match="PTM">
<xsl:if test="text() = 'y'">
<xsl:text>{</xsl:text>
<xsl:value-of select="$newline" />
<xsl:value-of select="acrn:initializer('vbdf.value', 'UNASSIGNED_VBDF', '')" />
<xsl:value-of select="acrn:initializer('vrp_sec_bus', '1', '')" />
<xsl:text>},</xsl:text>
<xsl:value-of select="$newline" />
</xsl:if>
</xsl:template>
</xsl:stylesheet>