acrn-hypervisor/misc/config_tools/xforms/config.mk.xsl

88 lines
2.5 KiB
XML
Raw Normal View History

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2021 Intel Corporation. -->
<!-- SPDX-License-Identifier: BSD-3-Clause -->
<xsl:stylesheet
version="1.0"
xmlns:xi="http://www.w3.org/2003/XInclude"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:math="http://exslt.org/math"
xmlns:exslt="http://exslt.org/common"
xmlns:acrn="http://projectacrn.org">
<xsl:include href="lib.xsl" />
<xsl:output method="text" />
<xsl:variable name="integer-suffix" select="''" />
<xi:include href="config_common.xsl" xpointer="xpointer(id('config_common')/*)" />
<xsl:template match="/acrn-offline-data">
<xsl:apply-templates select="board-data/acrn-config" />
<xsl:apply-templates select="config-data/acrn-config" />
</xsl:template>
<xsl:template name="entry-by-key-value">
<xsl:param name="prefix" />
<xsl:param name="key" />
<xsl:param name="value" />
<xsl:param name="default" />
<xsl:choose>
<xsl:when test="$prefix != ''">
<xsl:value-of select="$prefix" />
</xsl:when>
<xsl:otherwise>
<xsl:text>CONFIG_</xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:value-of select="$key" />
<xsl:text>=</xsl:text>
<xsl:choose>
<xsl:when test="$value != ''">
<xsl:value-of select="$value" />
</xsl:when>
<xsl:when test="$default != ''">
<xsl:value-of select="$default" />
</xsl:when>
</xsl:choose>
<xsl:value-of select="$newline" />
</xsl:template>
<xsl:template name="boolean-by-key-value">
<xsl:param name="key" />
<xsl:param name="value" />
<xsl:choose>
config tool: remove guest_flags in user interface The concept of guest_flags is hard to understand for users. So turn guest_flags into several parameters in config tool user interface, list as below: GUEST_FLAG_LAPIC_PASSTHROUGH ---> lapic_passthrough GUEST_FLAG_IO_COMPLETION_POLLING ---> io_completion_polling GUEST_FLAG_VCAT_ENABLED ---> virtual_cat_support GUEST_FLAG_SECURE_WORLD_ENABLED ---> secure_world_support GUEST_FLAG_HIDE_MTRR ---> hide_mtrr_support GUEST_FLAG_NVMX_ENABLED ---> nested_virtualization_support GUEST_FLAG_SECURITY_VM ---> security_vm GUEST_FLAG_RT ---> vm_type(RTVM) GUEST_FLAG_TEE ---> vm_type(TEE_VM) GUEST_FLAG_REE ---> vm_type(REE_VM) In addition, HV global parameter NVMX_ENABLE is removed from user interface, when config tool detects more than one VM with nested_virtualization_support, NVMX_ENABLE is assigned as 'y' automatically. v1->v2: *Rebase on the latest xml schema checking change *Remove "all rights reserved" from the license header in guest_flags.py v2->v3: *Change the name of the new config items to CAPITAL_CASE style *Combine guest flag policy to an XPATH in guest_flags.py *Use count() to directly deduce NVMX_ENABLED in config_common.xsl and update `boolean-by-key-value` to process 'true' v3->v4: *Change the name of the new config items to lower_case style *Change guest_flag_node to allocation_vm_node in guest_flags.py *Separate value case and key case for boolean-by-key-value Tracked-On: #6690 Signed-off-by: hangliu1 <hang1.liu@linux.intel.com> Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-02-21 09:52:11 +08:00
<xsl:when test="($value = 'true') or ($value = 'y')">
<xsl:call-template name="entry-by-key-value">
<xsl:with-param name="key" select="$key" />
<xsl:with-param name="value" select="'y'" />
</xsl:call-template>
</xsl:when>
<xsl:when test="($key = 'RELEASE')">
<xsl:call-template name="entry-by-key-value">
<xsl:with-param name="key" select="$key" />
<xsl:with-param name="value" select="'n'" />
config tool: remove guest_flags in user interface The concept of guest_flags is hard to understand for users. So turn guest_flags into several parameters in config tool user interface, list as below: GUEST_FLAG_LAPIC_PASSTHROUGH ---> lapic_passthrough GUEST_FLAG_IO_COMPLETION_POLLING ---> io_completion_polling GUEST_FLAG_VCAT_ENABLED ---> virtual_cat_support GUEST_FLAG_SECURE_WORLD_ENABLED ---> secure_world_support GUEST_FLAG_HIDE_MTRR ---> hide_mtrr_support GUEST_FLAG_NVMX_ENABLED ---> nested_virtualization_support GUEST_FLAG_SECURITY_VM ---> security_vm GUEST_FLAG_RT ---> vm_type(RTVM) GUEST_FLAG_TEE ---> vm_type(TEE_VM) GUEST_FLAG_REE ---> vm_type(REE_VM) In addition, HV global parameter NVMX_ENABLE is removed from user interface, when config tool detects more than one VM with nested_virtualization_support, NVMX_ENABLE is assigned as 'y' automatically. v1->v2: *Rebase on the latest xml schema checking change *Remove "all rights reserved" from the license header in guest_flags.py v2->v3: *Change the name of the new config items to CAPITAL_CASE style *Combine guest flag policy to an XPATH in guest_flags.py *Use count() to directly deduce NVMX_ENABLED in config_common.xsl and update `boolean-by-key-value` to process 'true' v3->v4: *Change the name of the new config items to lower_case style *Change guest_flag_node to allocation_vm_node in guest_flags.py *Separate value case and key case for boolean-by-key-value Tracked-On: #6690 Signed-off-by: hangliu1 <hang1.liu@linux.intel.com> Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-02-21 09:52:11 +08:00
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:text># CONFIG_</xsl:text>
<xsl:value-of select="$key" />
<xsl:text> is not set&#xa;</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="string-by-key-value">
<xsl:param name="key" />
<xsl:param name="value" />
<xsl:call-template name="entry-by-key-value">
<xsl:with-param name="key" select="$key" />
<xsl:with-param name="value" select="$value" />
</xsl:call-template>
</xsl:template>
</xsl:stylesheet>