HV: init one dev config with service vm config param

When we do init_all_dev_config() in pci.c, the pdevs added to pci dev_config
will be exposed to Service VM or passthru to prelauched VM. The original code
would find service VM config in every pci pdev init loop, this is unnecessary
and definitely impact performance. Here we generate Service VM config pointer
with config tool so that init_one_dev_config() could refer service VM config
directly.

Tracked-On: #8491
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
Signed-off-by: Qiang Zhang <qiang4.zhang@intel.com>
Signed-off-by: Victor Sun <victor.sun@intel.com>
This commit is contained in:
Qiang Zhang
2023-08-24 09:32:26 +08:00
committed by acrnsi-robot
parent deccb22ea8
commit bf653d277b
3 changed files with 34 additions and 26 deletions

View File

@@ -87,6 +87,15 @@
</xsl:if>
<xsl:value-of select="$newline"/>
<xsl:value-of select="$end_of_array_initializer" />
<xsl:value-of select="$newline"/>
<xsl:choose>
<xsl:when test="count(vm[load_order='SERVICE_VM'])">
<xsl:value-of select="concat('struct acrn_vm_config *const service_vm_config = &amp;vm_configs[', vm[load_order='SERVICE_VM']/@id, '];')" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat('struct acrn_vm_config *const service_vm_config =', ' NULL;')" />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="vm">