acrn-hypervisor/misc/config_tools/schema/config.xsd
Junjie Mao e88532b59d config_tools: refine console virtual UARTs
As is recommended by UX/DX reviews, the per-VM console virtual UART is now
limited to the following choices:

  - Disabled
  - a COM port from COM1 to COM4
  - PCI based

This patch converts the schema of scenario XMLs to integrate this
recommendation and add logic in the scenario upgrader to migrate data from
old scenario XMLs.

v1 -> v2:

  * Update the static allocators and C source transformers according to the
    new console vUART config item.

Tracked-On: #6690
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-03-15 10:22:37 +08:00

472 lines
19 KiB
XML

<?xml version="1.0"?>
<xs:schema
xmlns:xi="http://www.w3.org/2003/XInclude"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:acrn="https://projectacrn.org">
<xi:include href="types.xsd" xpointer="xpointer(id('root')/*)" />
<xi:include href="VMtypes.xsd" xpointer="xpointer(id('root')/*)" />
<xs:complexType name="DebugOptionsType">
<xs:annotation>
<xs:documentation>Options for debugging the hypervisor.</xs:documentation>
</xs:annotation>
<xs:all>
<xs:element name="BUILD_TYPE" type="BuildType" default="debug">
<xs:annotation acrn:title="Build type" acrn:views="basic">
<xs:documentation>Build an image for release (``y``) or debug (``n``).
In a **release** image, assertions are not enforced and debugging
features are disabled, including logs, serial console, and the
hypervisor shell.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="SERIAL_CONSOLE" type="SerialConsoleOptions" default="/dev/ttyS0">
<xs:annotation>
<xs:documentation>Specify the host serial device used for hypervisor debugging.
This option is only valid if :option:`hv.DEBUG_OPTIONS.RELEASE` is set to ``n``.
This option impacts the content of ``vm.(legacy_vuart id="0").base`` when :option:`vm.load_order` is ``SERVICE_VM``,
which specifies the PIO base for Service VM legacy vUART 0 (used for the console).
The PIO base for the Service VM's legacy vUART 0 is determined using these rules:
- If :option:`hv.DEBUG_OPTIONS.SERIAL_CONSOLE` is any available ttyS# in the native environment,
the PIO base of the Service VM legacy vUART 0 would be the same as the PIO base
corresponding to :option:`hv.DEBUG_OPTIONS.SERIAL_CONSOLE` in the native environment.
- Otherwise, a PIO base would be assigned to the Service VM legacy vUART 0 from the available PIO list.
This logic is implemented in the configuration tools.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="MEM_LOGLEVEL" type="LogLevelType" default="5">
<xs:annotation>
<xs:documentation>Default loglevel for log messages stored in
memory. Value can be changed at runtime.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="NPK_LOGLEVEL" type="LogLevelType" default="5">
<xs:annotation>
<xs:documentation>Default loglevel for the hypervisor North Peak
(NPK) log. Value can be changed at runtime.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="CONSOLE_LOGLEVEL" type="LogLevelType" default="3">
<xs:annotation>
<xs:documentation>Default loglevel for log messages
written to the serial console.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:all>
</xs:complexType>
<xs:complexType name="FeatureOptionsType">
<xs:annotation>
<xs:documentation>Options for enabling hypervisor features.</xs:documentation>
</xs:annotation>
<xs:all>
<xs:element name="RELOC" type="Boolean" default="y">
<xs:annotation>
<xs:documentation>Specify if hypervisor relocation is enabled on
booting.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="SCHEDULER" type="SchedulerType" default="SCHED_BVT">
<xs:annotation>
<xs:documentation>The CPU scheduler used by the hypervisor.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="MULTIBOOT2" type="Boolean" default="y">
<xs:annotation>
<xs:documentation>Specify if the ACRN hypervisor image can be booted using the
multiboot2 protocol. If set to ``n``, GRUB's multiboot2 is not available as a
boot option.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="ENFORCE_TURNOFF_AC" type="Boolean" default="y">
<xs:annotation>
<xs:documentation>Force to disable #AC for Split-locked Access. If CPU has #AC for
split-locked access, HV enables it and VMs can't disable. Set this to enforce turning off that
#AC, for debugging purposes only.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="ENFORCE_TURNOFF_GP" type="Boolean" default="n">
<xs:annotation>
<xs:documentation>Force to disable #GP for Split-locked Access. If CPU has #GP for
UC lock, HV enable it and VMs can't disable. Set this to enforce turn off that #GP, for community
developer only.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="SECURITY_VM_FIXUP" type="Boolean" default="n">
<xs:annotation>
<xs:documentation>Enable to do fixup for TPM2 and SMBIOS for Security VM. If no
Security VM, setting this option to ``n``</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="KEEP_IRQ_DISABLED" type="Boolean" default="n">
<xs:annotation>
<xs:documentation>If ``y``, permanently disables all interrupts in HV root mode.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="RDT" type="RDTType">
<xs:annotation>
<xs:documentation>Enable the Intel Resource Director Technology (RDT)
allocation feature and Code and Data Prioritization (CDP). If the board hardware does not
support RDT or CDP, setting this option to ``y`` is ignored.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="HYPERV_ENABLED" type="Boolean" default="y">
<xs:annotation>
<xs:documentation>Enable Hyper-V.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="IOMMU_ENFORCE_SNP" type="Boolean" default="n">
<xs:annotation>
<xs:documentation>Specify if the IOMMU enforces snoop behavior
of DMA operations.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="ACPI_PARSE_ENABLED" type="Boolean" default="y">
<xs:annotation>
<xs:documentation>Enable ACPI runtime parsing.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="L1D_VMENTRY_ENABLED" type="Boolean" default="y">
<xs:annotation>
<xs:documentation>Enable L1 cache flush before VM entry. Default
value ``n``.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="MCE_ON_PSC_DISABLED" type="Boolean" default="y">
<xs:annotation>
<xs:documentation>Force disabling software workaround for
Machine Check Error on Page Size Change.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="IVSHMEM" type="IVSHMEMInfo">
<xs:annotation>
<xs:documentation>Enable Inter-VM Shared memory feature.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="SSRAM" minOccurs="0" type="SSRAMInfo">
<xs:annotation>
<xs:documentation>Pseudo SRAM configuration.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:all>
</xs:complexType>
<xs:complexType name="MemoryOptionsType">
<xs:all>
<xs:element name="STACK_SIZE" type="HexFormat" default="0x2000">
<xs:annotation>
<xs:documentation>Capacity of one stack (in bytes) used by a
physical core. Each core uses one stack for normal operation and another
three for specific exceptions.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="HV_RAM_START" type="HexFormat" default="0x00400000">
<xs:annotation>
<xs:documentation>The 2MB-aligned starting physical address of
the RAM region used by the hypervisor.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:all>
</xs:complexType>
<xs:complexType name="CapacitiesOptionsType">
<xs:annotation>
<xs:documentation>Capacity limits for static assigned data structure or
maximum supported resource.</xs:documentation>
</xs:annotation>
<xs:all>
<xs:element name="MAX_VM_NUM" type="xs:integer" default="16">
<xs:annotation>
<xs:documentation>Maximum number of User VMs allowed.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="IOMMU_BUS_NUM" type="HexFormat" default="0x100">
<xs:annotation>
<xs:documentation>Highest PCI bus ID used during IOMMU
initialization.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="MAX_IOAPIC_NUM" default="1">
<xs:annotation>
<xs:documentation>Maximum number of IOAPICs.</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:annotation>
<xs:documentation>Integer from 1 to 10.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:integer">
<xs:minInclusive value="1" />
<xs:maxInclusive value="10" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="MAX_PCI_DEV_NUM" default="96">
<xs:annotation>
<xs:documentation>Maximum number of PCI devices.</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:annotation>
<xs:documentation>Integer from 1 to 1024.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:integer">
<xs:minInclusive value="1" />
<xs:maxInclusive value="1024" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="MAX_IOAPIC_LINES" default="120">
<xs:annotation>
<xs:documentation>Maximum number of interrupt lines per IOAPIC.</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:annotation>
<xs:documentation>Integer from 1 to 120.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:integer">
<xs:minInclusive value="1" />
<xs:maxInclusive value="120" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="MAX_PT_IRQ_ENTRIES" type="xs:integer" default="256">
<xs:annotation>
<xs:documentation>The pre-defined number of interrupt sources of all pass-through devices.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="MAX_MSIX_TABLE_NUM" default="64">
<xs:annotation>
<xs:documentation>Pre-defined maximum number of virtual MSI-X table entries per device.
If this value is empty, then the default value will be calculated from information in the board XML file.</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:annotation>
<xs:documentation>Integer value from 1 to 2048.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:integer">
<xs:minInclusive value="1" />
<xs:maxInclusive value="2048" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="MAX_EMULATED_MMIO" default="16">
<xs:annotation>
<xs:documentation>Maximum number of emulated MMIO regions.</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:annotation>
<xs:documentation>Integer value from 1 to 128.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:integer">
<xs:minInclusive value="1" />
<xs:maxInclusive value="128" />
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:all>
</xs:complexType>
<xs:complexType name="MiscCfgOptionsType">
<xs:all>
<xs:element name="GPU_SBDF" type="HexFormat" default="0x00000010">
<xs:annotation>
<xs:documentation>Segment, Bus, Device, and function of the GPU.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="UEFI_OS_LOADER_NAME" type="xs:string" minOccurs="0">
<xs:annotation>
<xs:documentation>UEFI OS loader name.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:all>
</xs:complexType>
<xs:complexType name="HVConfigType">
<xs:all>
<xs:element name="DEBUG_OPTIONS" type="DebugOptionsType" />
<xs:element name="FEATURES" type="FeatureOptionsType" />
<xs:element name="MEMORY" type="MemoryOptionsType" />
<xs:element name="CAPACITIES" type="CapacitiesOptionsType" />
<xs:element name="MISC_CFG" type="MiscCfgOptionsType" />
<xs:element name="vuart_connections" type="VuartConnectionsType" minOccurs="0" maxOccurs="8">
<xs:annotation>
<xs:documentation>Specify the vUART connection setting.
Refer to :ref:`vuart_config` for detailed vUART settings.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:all>
</xs:complexType>
<xs:complexType name="VMConfigType">
<xs:all>
<xs:element name="vm_type" type="VMType">
<xs:annotation>
<xs:documentation>Specify the VM type.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="load_order" type="LoadOrderType">
<xs:annotation>
<xs:documentation>Specify the load_order.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="name">
<xs:annotation>
<xs:documentation>Specify the VM name shown in the
hypervisor console ``vm_list`` command.</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:annotation>
<xs:documentation>string from 1 to 32 characters long.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:minLength value="1" />
<xs:maxLength value="15" />
<xs:pattern value="\S+" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="lapic_passthrough" type="Boolean" default="n" minOccurs="0">
<xs:annotation>
<xs:documentation>Specify LAPIC to passthrough.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="io_completion_polling" type="Boolean" default="n" minOccurs="0">
<xs:annotation>
<xs:documentation>Specify Polling mode for IO Completion.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="nested_virtualization_support" type="Boolean" default="n" minOccurs="0">
<xs:annotation>
<xs:documentation>Specify nested virtualization support for KVM.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="virtual_cat_support" type="Boolean" default="n" minOccurs="0">
<xs:annotation>
<xs:documentation>Specify virtual CAT support for VM.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="secure_world_support" type="Boolean" default="n" minOccurs="0">
<xs:annotation>
<xs:documentation>Specify secure world support for trustry OS.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="hide_mtrr_support" type="Boolean" default="n" minOccurs="0">
<xs:annotation>
<xs:documentation>Specify MTRR capability to hide for VM.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="security_vm" type="Boolean" default="n" minOccurs="0">
<xs:annotation>
<xs:documentation>Specify TPM2 FIXUP for VM.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="cpu_affinity" type="CPUAffinityConfiguration" minOccurs="0">
<xs:annotation>
<xs:documentation>List of pCPU that this VM's vCPUs are pinned to.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="clos" type="CLOSConfiguration">
<xs:annotation>
<xs:documentation>Class of Service for Cache Allocation Technology.
Refer SDM 17.19.2 for details, and use with caution.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="epc_section" type="EPCSection" minOccurs="0">
<xs:annotation>
<xs:documentation>Specify SGX Enclave Page Cache section base and size in byte. It must be page aligned.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="memory" type="MemoryInfo" minOccurs="0">
<xs:annotation>
<xs:documentation>Specify memory information for Service and User VMs.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="priority" type="PriorityType" default="PRIO_LOW">
<xs:annotation>
<xs:documentation>Specify the VM vCPU priority for scheduling.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="companion_vmid" type="xs:integer" default="65535">
<xs:annotation>
<xs:documentation>Specify the companion VM id of this VM.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="os_config" type="OSConfigurations" minOccurs="0">
<xs:annotation>
<xs:documentation>General information for host kernel, boot
argument and memory.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="console_vuart" type="ConsoleVuartConfiguration" default="None">
<xs:annotation>
<xs:documentation>Specify the console vUART (aka PCI based vUART) with the vUART ID by
its ``id`` attribute.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="mmio_resources" type="MMIOResourcesConfiguration" minOccurs="0">
<xs:annotation>
<xs:documentation>MMIO resources to passthrough.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="pci_dev_num" type="xs:string" minOccurs="0">
<xs:annotation>
<xs:documentation>PCI devices number of the VM.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="pt_intx" type="xs:string" minOccurs="0">
<xs:annotation>
<xs:documentation>pt intx mapping.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="pci_devs" type="PCIDevsConfiguration" minOccurs="0">
<xs:annotation>
<xs:documentation>PCI devices list.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="PTM" type="Boolean" default="y" minOccurs="0">
<xs:annotation>
<xs:documentation>Enable and disable PTM(Precision Timing Measurement) feature.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:all>
<xs:attribute name="id" type="xs:integer" />
</xs:complexType>
<xs:complexType name="ACRNConfigType">
<xs:all>
<xs:element name="hv" type="HVConfigType">
<xs:annotation>
<xs:documentation>The hypervisor configuration defines a working scenario and target
board by configuring the hypervisor image features and capabilities such as
setting up the log and the serial port.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="vm" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>VM configuration includes **scenario-based** VM configuration
information that is used to describe the characteristics and attributes for
all VMs in a user scenario. It also includes **launch script-based** VM
configuration information, where parameters are passed to the device model
to launch post-launched User VMs.</xs:documentation>
</xs:annotation>
<xs:alternative test=".//load_order = 'PRE_LAUNCHED_VM'" type="VMConfigType" />
<xs:alternative test=".//load_order = 'SERVICE_VM'" type="VMConfigType" />
<xs:alternative test=".//load_order = 'POST_LAUNCHED_VM'" type="VMConfigType" />
</xs:element>
</xs:all>
<xs:attribute name="board" type="xs:string" use="required" />
<xs:attribute name="scenario" type="xs:string" use="required" />
</xs:complexType>
<xs:element name="acrn-config" type="ACRNConfigType">
<xs:unique name="vmNameUnique">
<xs:selector xpath="vm"/>
<xs:field xpath="name"/>
</xs:unique>
</xs:element>
</xs:schema>