<?xml version="1.0"?>
<xs:schema
    xmlns:xi="http://www.w3.org/2001/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="SERIAL_CONSOLE" type="SerialConsoleType" default="None">
      <xs:annotation acrn:title="Serial console port" acrn:views="basic"
		     acrn:options="//ttys/serial[type != '0']/dev_path/text(), 'None' ">
        <xs:documentation>Select the host serial device used for hypervisor debugging.</xs:documentation>
      </xs:annotation>
    </xs:element>
    <xs:element name="MEM_LOGLEVEL" type="LogLevelType" default="5">
      <xs:annotation acrn:title="ACRN log level" acrn:views="basic">
        <xs:documentation>Select the default log level for log messages stored in memory. Value can be changed at runtime. Log messages with the selected value or lower are displayed.</xs:documentation>
      </xs:annotation>
    </xs:element>
    <xs:element name="NPK_LOGLEVEL" type="LogLevelType" default="5">
      <xs:annotation acrn:title="Intel Trace Hub log level" acrn:views="basic">
        <xs:documentation>Select the default log level for the hypervisor via Intel Trace Hub log. Use the Intel Trace Hub's memory to record log messages. Value can be changed at runtime. Log messages with the selected value or lower are displayed.</xs:documentation>
      </xs:annotation>
    </xs:element>
    <xs:element name="CONSOLE_LOGLEVEL" type="LogLevelType" default="5">
      <xs:annotation acrn:title="Serial console log level" acrn:views="basic">
        <xs:documentation>Select the default log level for log messages written to the serial console. Log messages with the selected value or lower are displayed.</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_ENABLED" type="Boolean" default="y">
      <xs:annotation acrn:title="Hypervisor relocation" acrn:views="advanced">
        <xs:documentation>Enable hypervisor relocation in memory. The bootloader may need to change the location of the hypervisor because of other firmware.</xs:documentation>
      </xs:annotation>
    </xs:element>
    <xs:element name="SCHEDULER" type="SchedulerType" default="SCHED_BVT">
      <xs:annotation acrn:title="Virtual CPU scheduler" acrn:views="advanced">
        <xs:documentation>Select the scheduling algorithm for determining the priority of User VMs running on a shared virtual CPU.</xs:documentation>
      </xs:annotation>
    </xs:element>
    <xs:element name="MULTIBOOT2_ENABLED" type="Boolean" default="y">
      <xs:annotation acrn:title="Multiboot2" acrn:views="advanced">
        <xs:documentation>Enable multiboot2 protocol support (with multiboot1 downward compatibility). If multiboot1 meets your requirements, disable this feature to reduce hypervisor code size.</xs:documentation>
      </xs:annotation>
    </xs:element>
    <xs:element name="SPLIT_LOCK_DETECTION_ENABLED" type="Boolean" default="n">
      <xs:annotation acrn:title="Enable split lock detection" acrn:views="advanced">
        <xs:documentation>Enable detection of split locks. A split lock can negatively affect an application's real-time performance. If a lock is detected, an alignment check exception #AC occurs.</xs:documentation>
      </xs:annotation>
    </xs:element>
    <xs:element name="UC_LOCK_DETECTION_ENABLED" type="Boolean" default="n">
      <xs:annotation acrn:title="Enable UC lock detection" acrn:views="advanced">
        <xs:documentation>Enable detection of uncacheable-memory (UC) locks. A UC lock can negatively affect an application's real-time performance. If a lock is detected, a general-protection exception #GP occurs.</xs:documentation>
      </xs:annotation>
    </xs:element>
    <xs:element name="SECURITY_VM_FIXUP" type="Boolean" default="n">
      <xs:annotation acrn:title="Security VM Features" acrn:views="advanced">
          <xs:documentation>This option enables hypervisor features potentially needed by a Security VM:

- The virtual Trusted Platform Module (vTPM) 2.0 ACPI table, likely
  used by a security VM, is usually generated statically at build
  time. Checking this option enables the ACRN hypervisor to update the
  vTPM 2.0 ACPI table if the physical ACPI table was modified by the BIOS.
- Data from the system management BIOS (SMBIOS) can replace probing
  hardware directly to discover what devices are present. Checking
  this option enables the hypervisor to pass through the physical
  SMBIOS to a pre-launched security VM.

If your VM is not a security VM, leave this option unchecked. </xs:documentation>
      </xs:annotation>
    </xs:element>
    <xs:element name="KEEP_IRQ_DISABLED" type="Boolean" default="n">
      <xs:annotation acrn:views="">
        <xs:documentation>If checked, permanently disables all interrupts in HV root mode.</xs:documentation>
      </xs:annotation>
    </xs:element>
    <xs:element name="HYPERV_ENABLED" type="Boolean" default="y">
      <xs:annotation acrn:title="Hyper-V" acrn:views="advanced">
        <xs:documentation>Enable Microsoft Hyper-V Hypervisor Top-Level Functional Specification (TFLS) for User VMs running Windows.</xs:documentation>
      </xs:annotation>
    </xs:element>
    <xs:element name="IOMMU_ENFORCE_SNP" type="Boolean" default="n">
      <xs:annotation acrn:views="">
        <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 acrn:title="Parse ACPI tables" acrn:views="advanced">
        <xs:documentation>Enable ACPI runtime parsing to get DMAR (DMA remapping) configuration data from the ACPI tables. Otherwise, use existing, static information from the associated board configuration file.</xs:documentation>
      </xs:annotation>
    </xs:element>
    <xs:element name="L1D_VMENTRY_ENABLED" type="Boolean" default="n">
      <xs:annotation acrn:title="Mitigate L1 terminal fault" acrn:views="advanced">
        <xs:documentation>Enable L1 cache flush before VM entry to prevent L1 terminal fault. L1 terminal fault is a hardware vulnerability that could allow unauthorized disclosure of information residing in the L1 data cache.</xs:documentation>
      </xs:annotation>
    </xs:element>
    <xs:element name="MCE_ON_PSC_ENABLED" type="Boolean" default="y">
      <xs:annotation acrn:title="Enable MCE workaround" acrn:views="advanced">
        <xs:documentation>Enable the software workaround for Machine Check Error on Page Size Change (erratum in some processor families).  For more information about this workaround and affected processors, see this `MCE Avoidance on Page Size Change White Paper &lt;https://www.intel.com/content/www/us/en/developer/articles/troubleshooting/software-security-guidance/technical-documentation/machine-check-error-avoidance-page-size-change.html&gt;`_.</xs:documentation>
      </xs:annotation>
    </xs:element>
    <xs:element name="RDT" type="RDTType">
      <xs:annotation acrn:title="Intel Resource Director Tech" acrn:views="">
        <xs:documentation>Intel Resource Director Technology (RDT) provides cache and memory bandwidth allocation features. The features can be used to improve an application's real-time performance.</xs:documentation>
      </xs:annotation>
    </xs:element>
    <xs:element name="IVSHMEM" type="IVSHMEMInfo">
      <xs:annotation acrn:title="Inter-VM shared memory" acrn:views="basic">
        <xs:documentation>Configure shared memory regions for inter-VM communication.</xs:documentation>
      </xs:annotation>
    </xs:element>
    <xs:element name="SSRAM" minOccurs="0" type="SSRAMInfo">
      <xs:annotation acrn:title="Software SRAM" acrn:views="">
        <xs:documentation>Configure Software SRAM. This feature reserves memory buffers as always-cached memory to improve an application's real-time performance.</xs:documentation>
      </xs:annotation>
    </xs:element>
    <xs:element name="CPU_PERFORMANCE_POLICY" type="policyType" default="Performance">
      <xs:annotation acrn:title="CPU performance policy type" acrn:views="advanced">
        <xs:documentation>Select the default performance policy type for all CPUs. The hypervisor will set up CPU frequency based on the policy type.

- ``Performance``: CPU runs at its maximum frequency. Enable hardware autonomous frequency selection if the system supports Hardware-Controlled Performance States (HWP).
- ``Nominal``: CPU runs at its guaranteed frequency.</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 acrn:title="CPU memory stack size (bytes)" acrn:views="advanced"
                     acrn:errormsg="'required': 'Stack size is required.'">
        <xs:documentation>Specify the size of the memory stack in bytes for each physical CPU. For example, if you specify 8 kilobytes, each CPU will get its own 8-kilobyte stack.</xs:documentation>
      </xs:annotation>
    </xs:element>
    <xs:element name="HV_RAM_START" type="HexFormat" minOccurs="0">
      <xs:annotation acrn:views="">
        <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 acrn:views="">
        <xs:documentation>Maximum number of User VMs allowed.</xs:documentation>
      </xs:annotation>
    </xs:element>
    <xs:element name="MAX_IOAPIC_NUM" default="1">
      <xs:annotation acrn:views="">
        <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_BUS_NUM" type="xs:integer" default="0">
      <xs:annotation acrn:views="">
        <xs:documentation>Specify the maximum number of PCI buses. The default value is calculated from the board configuration file. Integer from 1 to 256.</xs:documentation>
      </xs:annotation>
    </xs:element>
    <xs:element name="MAX_PCI_DEV_NUM" default="96">
      <xs:annotation acrn:title="Max PCI devices" acrn:views="advanced"
                     acrn:errormsg="'required': 'must config the max number of PCI devices'">
        <xs:documentation>Specify the maximum number of PCI devices. This impacts the amount of memory used to maintain information about these PCI devices. The default value is calculated from the board configuration file. If you have PCI devices that were not detected by the Board Inspector, you may need to change this maximum value.</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 acrn:views="">
        <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" default="256">
      <xs:annotation acrn:title="Max passthrough IRQ entries" acrn:views="advanced"
                     acrn:errormsg="'required': 'must config the max number of passthrough IRQ entries'">
        <xs:documentation>Specify the maximum number of interrupt request (IRQ) entries from all passthrough 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_MSIX_TABLE_NUM" default="64">
        <xs:annotation acrn:title="Max MSI-X tables" acrn:views="advanced"
                       acrn:errormsg="'required': 'must config the max number of MSI-X tables'">
          <xs:documentation>Specify the maximum number of Message Signaled Interrupt MSI-X tables per device. The default value is calculated from the board configuration 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 acrn:title="Max emulated MMIO regions" acrn:views="advanced"
                       acrn:errormsg="'required': 'must config the max number of emulated MMIO regions'">
          <xs:documentation>Specify the maximum number of emulated MMIO regions for device virtualization. The default value is calculated from the board configuration file.</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 acrn:views="">
        <xs:documentation>Segment, Bus, Device, and function of the GPU.</xs:documentation>
      </xs:annotation>
    </xs:element>
  </xs:all>
</xs:complexType>

<xs:complexType name="HVConfigType">
  <xs:all>
    <xs:element name="BUILD_TYPE" type="BuildType" default="debug">
      <xs:annotation acrn:title="Build type" acrn:views="basic">
        <xs:documentation>Select the build type:

* ``Debug`` enables the debug shell, prints, and logs.
* ``Release`` optimizes the ACRN binary for deployment and turns off all debug infrastructure.

These settings can only be changed at build time.</xs:documentation>
      </xs:annotation>
    </xs:element>
    <xs:element name="FEATURES" type="FeatureOptionsType">
      <xs:annotation acrn:title="" acrn:views="basic, advanced">
      </xs:annotation>
    </xs:element>
    <xs:element name="vuart_connections" type="VuartConnectionsType">
      <xs:annotation acrn:title="Inter-VM virtual UART connection" acrn:views="basic">
          <xs:documentation>Specify the vUART connection settings.</xs:documentation>
          <xs:documentation>Refer to :ref:`vuart_config` for detailed vUART settings.</xs:documentation>
      </xs:annotation>
    </xs:element>
    <xs:element name="DEBUG_OPTIONS" type="DebugOptionsType">
      <xs:annotation acrn:title="Debug options" acrn:views="basic">
	<xs:documentation>Configure the debug facilities.</xs:documentation>
      </xs:annotation>
    </xs:element>
    <xs:element name="MEMORY" type="MemoryOptionsType">
      <xs:annotation acrn:title="Memory options" acrn:views="advanced">
      </xs:annotation>
    </xs:element>
    <xs:element name="CAPACITIES" type="CapacitiesOptionsType">
      <xs:annotation acrn:title="Hypervisor capacities" acrn:views="advanced">
      </xs:annotation>
    </xs:element>
    <xs:element name="MISC_CFG" type="MiscCfgOptionsType">
      <xs:annotation acrn:views="">
	<xs:documentation>Miscellaneous options for workarounds.</xs:documentation>
      </xs:annotation>
    </xs:element>

    <xs:element name="HIDDEN_PDEV_REGION" type="HiddenDevType" minOccurs="0">
      <xs:annotation acrn:views="">
        <xs:documentation>Specify the hidden devices.</xs:documentation>
      </xs:annotation>
    </xs:element>

    <xs:element name="CACHE_REGION" type="CacheRegionType" minOccurs="0">
      <xs:annotation acrn:views="advanced">
        <xs:documentation>Specify the cache setting.</xs:documentation>
      </xs:annotation>
    </xs:element>
  </xs:all>
</xs:complexType>

<xs:complexType name="VMConfigType">
  <xs:all>
    <xs:element name="load_order" type="LoadOrderType">
      <xs:annotation acrn:title="Load order" acrn:views="">
        <xs:documentation>Specify the VM load order.</xs:documentation>
      </xs:annotation>
    </xs:element>
    <xs:element name="name" type="VMNameType">
      <xs:annotation acrn:title="VM name" acrn:views="basic"
                     acrn:errormsg="'required': 'VM name is required.'">
        <xs:documentation>Specify the name used to identify this VM. The VM name will be shown in the hypervisor console vm_list command.</xs:documentation>
      </xs:annotation>
    </xs:element>
    <xs:element name="vm_type" type="VMType" default="STANDARD_VM">
      <xs:annotation acrn:title="VM type" acrn:views="basic">
        <xs:documentation>Select the VM type. A Standard VM is for general-purpose applications, such as human-machine interface (HMI). A Real-time VM offers special features for time-sensitive applications.</xs:documentation>
      </xs:annotation>
    </xs:element>
    <xs:element name="console_vuart" type="ConsoleVuartConfiguration" default="None">
      <xs:annotation acrn:title="Console virtual UART type" acrn:views="basic">
        <xs:documentation>Select the console virtual UART (vUART) type. Add the console settings to the kernel command line by typing them in the "Linux kernel command-line parameters" text box (for example, ``console=ttyS0`` for COM port 1).</xs:documentation>
      </xs:annotation>
    </xs:element>
    <xs:element name="os_type" type="OSType" default="Non-Windows OS">
      <xs:annotation acrn:title="OS type" acrn:applicable-vms="post-launched" acrn:views="basic">
          <xs:documentation>Select the OS type for this VM. This is required to run Windows in a User VM.</xs:documentation>
          <xs:documentation>See :ref:`acrn-dm_parameters` for how to include this in the Device Model arguments.</xs:documentation>
      </xs:annotation>
    </xs:element>
    <xs:element name="vuart0" type="Boolean" default="n">
      <xs:annotation acrn:title="Emulate COM1 as stdio I/O" acrn:applicable-vms="post-launched" acrn:views="basic">
	<xs:documentation>Enable the ACRN Device Model to emulate COM1 as a User VM stdio I/O. Hypervisor global emulation will take priority over this VM setting.</xs:documentation>
      </xs:annotation>
    </xs:element>
    <xs:element name="vbootloader" type="Boolean" default="y">
      <xs:annotation acrn:title="Enable Open Virtual Machine FW" acrn:applicable-vms="post-launched" acrn:views="basic">
        <xs:documentation>Use virtual bootloader OVMF (Open Virtual Machine Firmware) to boot this VM.</xs:documentation>
      </xs:annotation>
    </xs:element>
    <xs:element name="memory" type="MemoryInfo" minOccurs="0">
      <xs:annotation acrn:title="" acrn:views="basic, advanced" acrn:applicable-vms="pre-launched, post-launched">
      </xs:annotation>
    </xs:element>
    <xs:element name="own_pcpu" type="Boolean" default="n">
      <xs:annotation acrn:title="Exclusively owns physical CPUs" acrn:views="">
        <xs:documentation>Enable a VM exclusively owns the physical CPUs assigned to it.</xs:documentation>
      </xs:annotation>
    </xs:element>
    <xs:element name="cpu_affinity" type="CPUAffinityConfigurations" minOccurs="0">
      <xs:annotation acrn:title="Physical CPU affinity" acrn:views="basic" acrn:applicable-vms="pre-launched, post-launched">
        <xs:documentation>Select a subset of physical CPUs that this VM can use. More than one can be selected.</xs:documentation>
      </xs:annotation>
    </xs:element>
    <xs:element name="usb_xhci" type="USBDevsConfiguration" minOccurs="0">
        <xs:annotation acrn:title="" acrn:views="basic" acrn:applicable-vms="post-launched">
      </xs:annotation>
    </xs:element>
    <xs:element name="lapic_passthrough" type="Boolean" default="n" minOccurs="0">
      <xs:annotation acrn:title="LAPIC passthrough" acrn:applicable-vms="pre-launched, post-launched, service-vm" acrn:views="advanced">
        <xs:documentation>Enable LAPIC passthrough for this VM. This feature is required for VMs with stringent real-time performance needs.</xs:documentation>
      </xs:annotation>
    </xs:element>
    <xs:element name="io_completion_polling" type="Boolean" default="n" minOccurs="0">
      <xs:annotation acrn:title="I/O completion polling" acrn:applicable-vms="pre-launched, post-launched" acrn:views="advanced">
        <xs:documentation>Enable polling mode for I/O completion for this VM.  This feature is required for VMs with stringent real-time performance needs.</xs:documentation>
      </xs:annotation>
    </xs:element>
    <xs:element name="nested_virtualization_support" type="Boolean" default="n" minOccurs="0">
      <xs:annotation acrn:title="Nested virtualization" acrn:applicable-vms="service-vm" acrn:views="advanced">
        <xs:documentation>Enable nested virtualization for KVM.</xs:documentation>
      </xs:annotation>
    </xs:element>
    <xs:element name="virtual_cat_support" type="Boolean" default="n" minOccurs="0">
      <xs:annotation acrn:title="VM Virtual Cache Allocation Tech" acrn:applicable-vms="pre-launched, post-launched" acrn:views="advanced">
        <xs:documentation>Enable virtualization of the Cache Allocation Technology (CAT) feature in RDT. CAT enables you to allocate cache to VMs, providing isolation to avoid performance interference from other VMs.</xs:documentation>
      </xs:annotation>
    </xs:element>
    <xs:element name="virtual_cat_number" default="0" minOccurs="0">
      <xs:annotation acrn:title="Maximum virtual CLOS" acrn:applicable-vms="pre-launched, post-launched" acrn:views="advanced">
        <xs:documentation>Max number of virtual CLOS MASK</xs:documentation>
      </xs:annotation>
      <xs:simpleType>
        <xs:annotation>
          <xs:documentation>Integer value is not below zero.</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:integer">
          <xs:minInclusive value="0" />
        </xs:restriction>
      </xs:simpleType>
    </xs:element>
    <xs:element name="secure_world_support" type="Boolean" default="n">
      <xs:annotation acrn:title="Enable secure world for running Trusty" acrn:views="advanced" acrn:applicable-vms="post-launched">
        <xs:documentation>Enable secure world for this VM to provide an isolated execution environment which is suitable for running Trusted Execution Environment (TEE) such as Trusty. This is typically enabled when the VM is designed to run Android OS, and disabled otherwise.</xs:documentation>
      </xs:annotation>
    </xs:element>
    <xs:element name="hide_mtrr_support" type="Boolean" default="n" minOccurs="0">
      <xs:annotation acrn:views="">
        <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 acrn:views="">
        <xs:documentation>Specify TPM2 FIXUP for VM.</xs:documentation>
      </xs:annotation>
    </xs:element>
    <xs:element name="epc_section" type="EPCSection" minOccurs="0">
      <xs:annotation acrn:title="SGX Enclave Page Cache" acrn:views="advanced" acrn:applicable-vms="pre-launched">
        <xs:documentation>Specify the Intel Software Guard Extensions (SGX) enclave page cache (EPC) section settings.</xs:documentation>
      </xs:annotation>
    </xs:element>
    <xs:element name="priority" type="PriorityType"  default="PRIO_LOW">
      <xs:annotation acrn:views="">
        <xs:documentation>Specify the VM vCPU priority for scheduling.</xs:documentation>
      </xs:annotation>
    </xs:element>
    <xs:element name="bvt_weight" default="1">
      <xs:annotation acrn:views="advanced">
        <xs:documentation>Specify the VM vCPU weight for scheduling.</xs:documentation>
      </xs:annotation>
      <xs:simpleType>
         <xs:annotation>
           <xs:documentation>Integer 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:element name="bvt_warp_value" default="0">
      <xs:annotation acrn:views="">
        <xs:documentation>Specify the VM vCPU warp in MCU (minimum charging unit, i.e. tick period) to prioritize them.</xs:documentation>
      </xs:annotation>
      <xs:simpleType>
         <xs:annotation>
           <xs:documentation>Integer from -8192 to 8192.</xs:documentation>
         </xs:annotation>
        <xs:restriction base="xs:integer">
          <xs:minInclusive value="-8192" />
          <xs:maxInclusive value="8192" />
        </xs:restriction>
      </xs:simpleType>
    </xs:element>
    <xs:element name="bvt_warp_limit" default="0">
      <xs:annotation acrn:views="">
        <xs:documentation>Specify the VM vCPU warp limit time in MCU (minimum charging unit, i.e. tick period) to prevent starving non-warpped threads.</xs:documentation>
      </xs:annotation>
      <xs:simpleType>
         <xs:annotation>
           <xs:documentation>Integer from 0 to 10.</xs:documentation>
         </xs:annotation>
        <xs:restriction base="xs:integer">
          <xs:minInclusive value="0" />
          <xs:maxInclusive value="10" />
        </xs:restriction>
      </xs:simpleType>
    </xs:element>
    <xs:element name="bvt_unwarp_period" default="0">
      <xs:annotation acrn:views="">
        <xs:documentation>Specify the VM vCPU unwarp period in MCU (minimum charging unit, i.e. tick period) after a warp.</xs:documentation>
      </xs:annotation>
      <xs:simpleType>
         <xs:annotation>
           <xs:documentation>Integer from 0 to 10.</xs:documentation>
         </xs:annotation>
        <xs:restriction base="xs:integer">
          <xs:minInclusive value="0" />
          <xs:maxInclusive value="10" />
        </xs:restriction>
      </xs:simpleType>
    </xs:element>
    <xs:element name="companion_vmid" type="xs:integer" default="65535">
      <xs:annotation acrn:views="">
        <xs:documentation>Specify the companion VM id of this VM.</xs:documentation>
      </xs:annotation>
    </xs:element>
    <xs:element name="os_config" type="OSConfigurations">
      <xs:annotation acrn:title="OS Configuration" acrn:applicable-vms="pre-launched, service-vm" acrn:views="basic">
        <xs:documentation>General information for host kernel, boot
argument and memory.</xs:documentation>
      </xs:annotation>
    </xs:element>
    <xs:element name="mmio_resources" type="MMIOResourcesConfiguration" minOccurs="0">
      <xs:annotation acrn:title="MMIO Resources" acrn:applicable-vms="pre-launched" acrn:views="basic">
        <xs:documentation>Memory-mapped IO (MMIO) resources to passthrough.</xs:documentation>
      </xs:annotation>
    </xs:element>
    <xs:element name="pt_intx" type="xs:string" minOccurs="0">
      <xs:annotation acrn:applicable-vms="pre-launched" acrn:views="">
        <xs:documentation>Specify the pre-launched VM owned IOAPIC pins and the corresponding mapping between physical GSI and virtual GSI.</xs:documentation>
      </xs:annotation>
    </xs:element>
    <xs:element name="pci_devs" type="PCIDevsConfiguration" minOccurs="0">
      <xs:annotation acrn:title="" acrn:applicable-vms="pre-launched, post-launched" acrn:views="basic">
      </xs:annotation>
    </xs:element>
    <xs:element name="PTM" type="Boolean" default="y" minOccurs="0">
      <xs:annotation acrn:title="Precision Time Measurement" acrn:applicable-vms="pre-launched, post-launched" acrn:views="">
        <xs:documentation>Enable virtualization of PCIe Precision Time Measurement (PTM) mechanism for devices with PTM capability and for real-time application. The hypervisor provides PCIe root port emulation instead of host bridge emulation for the VM. PTM coordinates timing between the device and root port with the device's local timebases without relying on software.</xs:documentation>
      </xs:annotation>
    </xs:element>
    <xs:element name="customized_parameters" type="xs:string" minOccurs="0">
      <xs:annotation acrn:title="Customized Parameters" acrn:views="advanced">
        <xs:documentation>Specify the customized parameters that are appened to the device model when launching this VM.</xs:documentation>
      </xs:annotation>
    </xs:element>
    <xs:element name="virtio_devices">
      <xs:annotation acrn:title="Virt-IO devices" acrn:views="basic" acrn:applicable-vms="post-launched">
        <xs:documentation>Enable virt-IO devices in post-launched VMs.</xs:documentation>
      </xs:annotation>
      <xs:complexType>
        <xs:all>
          <xs:element name="gpu" type="VirtioGPUConfiguration" minOccurs="0" maxOccurs="1">
            <xs:annotation acrn:title="Virtio GPU device" acrn:views="basic">
              <xs:documentation>The virtio GPU device presents a GPU device to the VM.
This feature enables you to view the VM's GPU output in the Service VM.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="console" type="VirtioConsoleConfiguration" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation acrn:title="Virtio console device" acrn:views="basic">
              <xs:documentation>Virtio console device for data input and output.
The virtio console BE driver copies data from the frontend's transmitting virtqueue when it receives a kick on virtqueue (implemented as a vmexit).
The BE driver then writes the data to backend, and can be implemented as a PTY, TTY, STDIO, or regular file.</xs:documentation>
              <xs:documentation>For details, see :ref:`virtio-console`.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="network" type="VirtioNetworkConfiguration" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation acrn:title="Virtio network device" acrn:views="basic">
                <xs:documentation>The virtio network device emulates a virtual network interface card (NIC) for the VM.  The frontend
is the virtio network driver, simulating the virtual NIC. The backend could be: ``tap`` device /dev/net/tun,
``MacVTap`` device /dev/tapx, or ``vhost`` device /dev/vhost-net</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="input" type="VirtioInputConfiguration" minOccurs="0" maxOccurs="unbounded">
	        <xs:annotation acrn:title="Virtio input device" acrn:views="basic">
                <xs:documentation>The virtio input device creates a virtual human interface device such as a keyboard,
mouse, or tablet.  The device sends Linux input layer events over virtio.</xs:documentation>
	        </xs:annotation>
	      </xs:element>
          <xs:element name="block" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation acrn:title="Virtio block device" acrn:views="basic">
              <xs:documentation>The virtio-blk device presents a block device to the VM. Each virtio-blk device appears as a disk inside the VM.</xs:documentation>
            </xs:annotation>
              <xs:simpleType>
                <xs:annotation acrn:widget-options="'placeholder': '/home/user/path/to/disk.image'"
                               acrn:errormsg="'required': 'Path to a disk image required.'"/>
                <xs:restriction base="xs:string" />
              </xs:simpleType>
          </xs:element>
          <xs:element name="vsock" type="vsockCIDType" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation acrn:title="Virtio vsock Context ID (CID)" acrn:views="basic">
              <xs:documentation>Specify the post-launched VM's unique Context ID (CID) used by vsock (integer greater than 2).
vsock provides a way for the host system and applications running in a user VM to communicate with each other using the standard socket interface.
vsock uses a (context id, port) pair of integers for identifying processes. The host system CID is always 2. The port is hardcoded in our implementation.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:all>
      </xs:complexType>
    </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 acrn:title="Hypervisor Options">
        <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 acrn:title="Virtual Machine Options">
        <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" />
  <xs:attribute name="scenario" type="xs:string" />
</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>
