acrn-hypervisor/misc/config_tools/xforms
dongshen cb2bb78b6f hv/config_tools: amend the struct acrn_vm_config to make it compatible with vCAT
For vCAT, it may need to store more than MAX_VCPUS_PER_VM of closids,
change clos in vm_config.h to a pointer to accommodate this situation

Rename clos to pclosids

pclosids now is a pointer to an array of physical CLOSIDs that is defined
in vm_configurations.c by vmconfig. The number of elements in the array
must be equal to the value given by num_pclosids

Add max_type_pcbm (type: l2 or l3) to struct acrn_vm_config, which stores a bitmask
that selects/covers all the physical cache ways assigned to the VM

Change vmsr.c to accommodate this amended data structure

Change the config-tools to generate vm_configurations.c, and fill in the num_closids
and clos pointers based on the information from the scenario file.

Now vm_configurations.c.xsl generates all the clos related code so remove the same
code from misc_cfg.h.xsl.

Examples:

  Scenario file:

  <RDT>
    <RDT_ENABLED>y</RDT_ENABLED>
    <CDP_ENABLED>n</CDP_ENABLED>
    <VCAT_ENABLED>y</VCAT_ENABLED>
    <CLOS_MASK>0x7ff</CLOS_MASK>
    <CLOS_MASK>0x7ff</CLOS_MASK>
    <CLOS_MASK>0x7ff</CLOS_MASK>
    <CLOS_MASK>0xff800</CLOS_MASK>
    <CLOS_MASK>0xff800</CLOS_MASK>
    <CLOS_MASK>0xff800</CLOS_MASK>
    <CLOS_MASK>0xff800</CLOS_MASK>
    <CLOS_MASK>0xff800</CLOS_MASK>
  /RDT>

  <vm id="0">
   <guest_flags>
     <guest_flag>GUEST_FLAG_VCAT_ENABLED</guest_flag>
   </guest_flags>
   <clos>
     <vcpu_clos>3</vcpu_clos>
     <vcpu_clos>4</vcpu_clos>
     <vcpu_clos>5</vcpu_clos>
     <vcpu_clos>6</vcpu_clos>
     <vcpu_clos>7</vcpu_clos>
   </clos>
  </vm>

  <vm id="1">
   <clos>
     <vcpu_clos>1</vcpu_clos>
     <vcpu_clos>2</vcpu_clos>
   </clos>
  </vm>

 vm_configurations.c (generated by config-tools) with the above vCAT config:

  static uint16_t vm0_vcpu_clos[5U] = {3U, 4U, 5U, 6U, 7U};
  static uint16_t vm1_vcpu_clos[2U] = {1U, 2U};

  struct acrn_vm_config vm_configs[CONFIG_MAX_VM_NUM] = {
  {
  .guest_flags = (GUEST_FLAG_VCAT_ENABLED),
  .pclosids = vm0_vcpu_clos,
  .num_pclosids = 5U,
  .max_l3_pcbm = 0xff800U,
  },
  {
  .pclosids = vm1_vcpu_clos,
  .num_pclosids = 2U,
  },
  };

Tracked-On: #5917
Signed-off-by: dongshen <dongsheng.x.zhang@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2021-10-26 11:48:27 +08:00
..
board_info.h.xsl hv: use per platform maximum physical address width 2021-08-20 11:02:21 +08:00
config_common.xsl hv/config-tools: add the support for vCAT 2021-10-26 11:48:27 +08:00
config.h.xsl config-tools: refine MAX_MSIX_TABLE_NUM 2021-08-10 13:16:36 +08:00
config.mk.xsl config-tools: refine MAX_MSIX_TABLE_NUM 2021-08-10 13:16:36 +08:00
ivshmem_cfg.h.xsl hv: mod: do not use explicit arch name when including headers 2021-05-08 11:15:46 +08:00
lib.xsl hv/config_tools: amend the struct acrn_vm_config to make it compatible with vCAT 2021-10-26 11:48:27 +08:00
misc_cfg.h.xsl hv/config_tools: amend the struct acrn_vm_config to make it compatible with vCAT 2021-10-26 11:48:27 +08:00
pci_dev.c.xsl config-tools: enable PTM through config-tools 2021-05-25 11:32:11 +08:00
pt_intx.c.xsl config_tools: allocate interrupt lines among VMs 2021-08-09 09:05:01 +08:00
vm_configurations.c.xsl hv/config_tools: amend the struct acrn_vm_config to make it compatible with vCAT 2021-10-26 11:48:27 +08:00
vm_configurations.h.xsl hv && config-tool: Rename GUEST_FLAG_TPM2_FIXUP 2021-08-26 09:24:50 +08:00