Commit Graph

6675 Commits

Author SHA1 Message Date
Amy Reyes 377a3b9d49 Update per feedback
Signed-off-by: Amy Reyes <amy.reyes@intel.com>
2021-10-28 13:40:28 -07:00
Amy Reyes a5a4c112d1 doc: terminology cleanup in using_grub.rst
- Replace SOS with Service VM
- Replace guest with VM
- Clean up some of the grammar

Signed-off-by: Amy Reyes <amy.reyes@intel.com>
2021-10-28 13:40:28 -07:00
Amy Reyes 6f92eef2be Updated per feedback
Signed-off-by: Amy Reyes <amy.reyes@intel.com>
2021-10-28 13:39:57 -07:00
Amy Reyes 208fcece20 Replace ACRNSOS with ServiceVM in commands
Signed-off-by: Amy Reyes <amy.reyes@intel.com>
2021-10-28 13:39:57 -07:00
Amy Reyes a2dae1e1a9 Updated per feedback
Signed-off-by: Amy Reyes <amy.reyes@intel.com>
2021-10-28 13:39:57 -07:00
Amy Reyes 8d572e7319 doc: terminology cleanup in acrn_on_qemu.rst
- Replace SOS with Service VM
- Clean up some of the grammar

Signed-off-by: Amy Reyes <amy.reyes@intel.com>
2021-10-28 13:39:57 -07:00
Amy Reyes 8d109003a1 Update dates
Signed-off-by: Amy Reyes <amy.reyes@intel.com>
2021-10-28 13:37:03 -07:00
Amy Reyes 1f681cdedc Updated commands per feedback
Signed-off-by: Amy Reyes <amy.reyes@intel.com>
2021-10-28 13:37:03 -07:00
Amy Reyes 10947ee1ca Updated per feedback
Signed-off-by: Amy Reyes <amy.reyes@intel.com>
2021-10-28 13:37:03 -07:00
Amy Reyes 59f9e6c853 doc: terminology cleanup in acrntrace readme
- Replace SOS with Service VM
- Update file paths to acrntrace directory
- Clean up some of the grammar

Signed-off-by: Amy Reyes <amy.reyes@intel.com>
2021-10-28 13:37:03 -07:00
Amy Reyes da6957f0e7 Updated per feedback
Signed-off-by: Amy Reyes <amy.reyes@intel.com>
2021-10-28 13:34:38 -07:00
Amy Reyes f38a50a874 Updated per feedback
Signed-off-by: Amy Reyes <amy.reyes@intel.com>
2021-10-28 13:34:38 -07:00
Amy Reyes 8fe695c8b3 doc: terminology cleanup in crashlog readme
- Replace SOS with Service VM
- Clean up some of the grammar

Signed-off-by: Amy Reyes <amy.reyes@intel.com>
2021-10-28 13:34:38 -07:00
Amy Reyes 6d61c2dfff Updated per feedback
Signed-off-by: Amy Reyes <amy.reyes@intel.com>
2021-10-28 13:32:11 -07:00
Amy Reyes d868f9fece doc: terminology cleanup in hv-vt-d.rst
- Replace SOS with Service VM
- Replace User OS with User VM
- Clean up some of the grammar

Signed-off-by: Amy Reyes <amy.reyes@intel.com>
2021-10-28 13:32:11 -07:00
David B. Kinder abb564ba41 doc: add top-level redirect
* Add a script for creating top-level redirects on the
  projectacrn.github.io site.
* Use it to generate the top-level index.html redirect to
  latest/index.html in the Makefile (for make publsh).
* Generate a new redirect for hardware.html to catch inbound links.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2021-10-28 13:22:14 -07:00
Junjie Mao f64f253562 config_tools: always initialize hw_ignore when parsing DMAR
Commit 4a04fcc ("config_tools: skip remapping HW units with no devices under
scope") skips hardware remapping units without any device under its scope in the
config tools, which turns out to only work if the HV is not parsing the DMAR at
runtime.

This patch reverts the previous workaround and fixes the previous issue by
always initializing `dmar_hw_list.hw_ignore` when parsing DMAR. This ensures
that the DRHDx_IGNORE macro will always be emitted while DRHD_COUNT is not
impacted.

Fixes: 4a04fcc ("config_tools: skip remapping HW units with no devices under scope")
Tracked-On: #6709
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2021-10-28 19:36:41 +08:00
dongshen dcafcadaf9 hv: rename some C preprocessor macros
Rename some C preprocessor macros:
  NUM_GUEST_MSRS --> NUM_EMULATED_MSRS
  CAT_MSR_START_INDEX --> FLEXIBLE_MSR_INDEX
  NUM_VCAT_MSRS --> NUM_CAT_MSRS
  NUM_VCAT_L2_MSRS --> NUM_CAT_L2_MSRS
  NUM_VCAT_L3_MSRS --> NUM_CAT_L3_MSRS

Tracked-On: #5917
Signed-off-by: Eddie Dong <eddie.dong@Intel.com>
2021-10-28 19:12:29 +08:00
dongshen c0d95558c1 hv: vCAT: propagate vCBM to other vCPUs that share cache with vcpu
Implement the propagate_vcbm() function:
  Set vCBM to to all the vCPUs that share cache with vcpu
  to mimic hardware CAT behavior

Tracked-On: #5917
Signed-off-by: dongshen <dongsheng.x.zhang@intel.com>
Acked-by: Eddie Dong <eddie.dong@Intel.com>
2021-10-28 19:12:29 +08:00
dongshen a7014f4654 hv: vCAT: implementing the vCAT MSRs write handler
Implement the write_vcbm() function to handle the
MSR_IA32_type_MASK_n vCBM MSRs write request

Call write_vclosid() to handle MSR_IA32_PQR_ASSOC MSR write request

Several vCAT P2V (physical to virtual) and V2P (virtual to physical)
mappings exist:

   struct acrn_vm_config *vm_config = get_vm_config(vm_id)

   max_pcbm = vm_config->max_type_pcbm (type: l2 or l3)
   mask_shift = ffs64(max_pcbm)

   vclosid = vmsr - MSR_IA32_type_MASK_0
   pclosid = vm_config->pclosids[vclosid]

   pmsr = MSR_IA32_type_MASK_0 + pclosid
   pcbm = vcbm << mask_shift
   vcbm = pcbm >> mask_shift

   Where
   MSR_IA32_type_MASK_n: L2 or L3 mask msr address for CLOSIDn, from
   0C90H through 0D8FH (inclusive).

   max_pcbm: a bitmask that selects all the physical cache ways assigned to the VM

   vclosid: virtual CLOSID, always starts from 0

   pclosid: corresponding physical CLOSID for a given vclosid

   vmsr: virtual msr address, passed to vCAT handlers by the
   caller functions rdmsr_vmexit_handler()/wrmsr_vmexit_handler()

   pmsr: physical msr address

   vcbm: virtual CBM, passed to vCAT handlers by the
   caller functions rdmsr_vmexit_handler()/wrmsr_vmexit_handler()

   pcbm: physical CBM

Tracked-On: #5917
Signed-off-by: dongshen <dongsheng.x.zhang@intel.com>
Acked-by: Eddie Dong <eddie.dong@Intel.com>
2021-10-28 19:12:29 +08:00
dongshen 3ab50f2ef5 hv: vCAT: implementing the vCAT MSRs read handlers
Implement the read_vcbm() and read_vclosid() functions to handle the MSR_IA32_PQR_ASSOC
and MSR_IA32_type_MASK_n vCAT MSRs read request.

Tracked-On: #5917
Signed-off-by: dongshen <dongsheng.x.zhang@intel.com>
Acked-by: Eddie Dong <eddie.dong@Intel.com>
2021-10-28 19:12:29 +08:00
dongshen be855d2352 hv: vCAT: expose CAT capabilities to vCAT-enabled VM
Expose CAT feature to vCAT VM by reporting the number of
cache ways/CLOSIDs via the 04H/10H cpuid instructions, so that the
VM can take advantage of CAT to prioritize and partition cache
resource for its own tasks.

Add the vcat_pcbm_to_vcbm() function to map pcbm to vcbm

Tracked-On: #5917
Signed-off-by: dongshen <dongsheng.x.zhang@intel.com>
Acked-by: Eddie Dong <eddie.dong@Intel.com>
2021-10-28 19:12:29 +08:00
dongshen 77ae989379 hv: vCAT: initialize vCAT MSRs during vmcs init
Initialize vCBM MSRs

Initialize vCLOSID MSR

Add some vCAT functions:
 Retrieve max_vcbm and max_pcbm
 Check if vCAT is configured or not for the VM
 Map vclosid to pclosid
 write_vclosid: vCLOSID MSR write handler
 write_vcbm: vCBM MSR write handler

Tracked-On: #5917
Signed-off-by: dongshen <dongsheng.x.zhang@intel.com>
Acked-by: Eddie Dong <eddie.dong@Intel.com>
2021-10-28 19:12:29 +08:00
Yang,Yu-chu 75a4dde148 config-tools: allow to use polling mode for legacy vuart
Using polling mode When set a legacy vuart's irq to 0.

Tracked-On: #6652
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
2021-10-28 16:05:32 +08:00
David B. Kinder e790b5cc6e doc: switch to use google tag manager
Use the GTM tag ID instead of UA.  Clean up stray inclusion of
analytics.js code.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2021-10-27 15:17:49 -07:00
Yang,Yu-chu 50fb42c178 config-tools: allow to configure guest flag for post-launched VM
Remove the if statement that block guest flag configuration for
post-launched VM.

Tracked-On: #5917
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
2021-10-27 15:04:33 +08:00
Geoffroy Van Cutsem 6ad9dcb262 config_tools: fix crash in board_inspector if cpuid is missing
Fix a crash in the 'board_inspector.py' tool in case 'cpuid' is not
installed on the system.

The tools crashes because 'cpuid' is used before the check for
dependencies is done in the code. That check for dependencies is
done in the 'legacy/board_parser.py' file. But the native_check()
function that is called before it also expects the cpuid tool to
be installed.

The fix is to move the check for dependencies in the main
'board_inspector.py' file, before any other operation is done.

Tracked-On: #6719
Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2021-10-27 10:17:31 +08:00
jackwhich 54aba7a858 config_tools: update all board file and scenario file
We should generate new board xmls for cfl,whl and nuc11 because of the
board inspector changes. For the details refer to these RPs:#6699 #6710

Tracked-On:#6709

Signed-off-by: zhongzhenx.liu <zhongzhenx.liu@intel.com>
2021-10-27 09:54:58 +08:00
Fei Li 1905ed6124 hv: vMSR: minor fix about rdmsr_vmexit_handler
Specifying a reserved or unimplemented MSR address in ECX for rdmsr will cause a
general protection exception. In this case, we should not change the contents of
registers EDX:EAX.

Tracked-On: #4550
Signed-off-by: Fei Li <fei1.li@intel.com>
2021-10-27 08:23:43 +08:00
Kunhui-Li 5d6f4b3813 config_tools: remove hvlog and memmap parameter in bootargs
remove hvlog and memmap parameter in bootargs for whl-ipc-i5
scenario xml files.

Tracked-On: #6663
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2021-10-26 18:17:40 +08:00
dongshen 39461ef9dd hv: vCAT: initialize the emulated_guest_msrs array for CAT msrs during platform initialization
Initialize the emulated_guest_msrs[] array at runtime for
MSR_IA32_type_MASK_n and MSR_IA32_PQR_ASSOC msrs, there is no good
way to do this initialization statically at build time

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
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
dongshen 3ddcbd424f config_tools: add config UI support for vCAT
Tracked-On: #5917
Signed-off-by: Weiyi Feng <weiyix.feng@intel.com>
2021-10-26 11:48:27 +08:00
dongshen 368f158b46 hv/config-tools: add the support for vCAT
Add the VCAT_ENABLED element to RDTType so that user can enable/disable vCAT globally

Add the GUEST_FLAG_VCAT_ENABLED guest flag to enable/disable vCAT per-VM.

  Currently we have the following per-VM clos element in scenario file for RDT use:
    <clos>
      <vcpu_clos>0</vcpu_clos>
      <vcpu_clos>0</vcpu_clos>
    </clos>

  When the GUEST_FLAG_VCAT_ENABLED guest flag is not specified, clos is for RDT use,
  vcpu_clos is per-CPU and it configures each CPU in VMs to a desired CLOS ID.

  When the GUEST_FLAG_VCAT_ENABLED guest flag is specified, vCAT is enabled for this VM,
  clos is for vCAT use, vcpu_clos is not per-CPU anymore in this case, just a list of
  physical CLOSIDs (minimum 2) that are assigned to VMs for vCAT use. Each vcpu_clos
  will be mapped to a virtual CLOSID, the first vcpu_clos is mapped to virtual CLOSID
  0 and the second is mapped to virtual CLOSID 1, etc

Add xs:assert to prevent any problems with invalid configuration data for vCAT:

  If any GUEST_FLAG_VCAT_ENABLED guest flag is specified, both RDT_ENABLED and VCAT_ENABLED
  must be 'y'

  If VCAT_ENABLED is 'y', RDT_ENABLED must be 'y' and CDP_ENABLED must be 'n'

  For a vCAT VM, vcpu_clos cannot be set to CLOSID 0, CLOSID 0 is reserved to be used by hypervisor

  For a vCAT VM, number of clos/vcpu_clos elements must be greater than 1

  For a vCAT VM, each clos/vcpu_clos must be less than L2/L3 COS_MAX

  For a vCAT VM, its clos/vcpu_clos elements cannot contain duplicate values

  There should not be any CLOS IDs overlap between a vCAT VM and any other VMs

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
Kunhui-Li 66bbf6f751 config_tools: remove HV_RAM_SIZE
1. remove HV_RAM_SIZE and CONFIG_HV_RAM_SIZE in the related python
code, schema and all existing scenario XMLs because PR 6664 has
changed it in HV side.
2. set HV_RAM_START default value to 2M.

Tracked-On: #6663
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2021-10-25 15:47:24 +08:00
Junjie Mao 4a04fcc48f config_tools: skip remapping HW units with no devices under scope
It is seen on some platforms that the ACPI DMAR tables will report
remapping hardware units that does not have any device under its scope,
which is not expected by the board inspector previously and thus causes the
tool to generate inconsistent configuration data.

This patch makes the board inspector skip such remapping hardware units. It
does not impact the functionality of the hypervisor as no device is managed
by those skipped remapping units.

Tracked-On: #6709
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2021-10-25 15:31:54 +08:00
Victor Sun b80b1dde25 config_tools: add PnP uart and rtc for pre-launched VM
In commit of 7cc9c8fe06
the pre-launched VM was set to ACPI HW Reduced platform, then the IRQ
would be allocated from 0 for PCI MSI devices. The Intel igb/igc driver
might get IRQ 8 when do request irq which would conflict with the irq
of RTC device:
    [ 14.264954] genirq: Flags mismatch irq 8. 00000000 (enp0s8-TxRx-3) vs.
                 00000000 (rtc0)
    [ 14.265411] ------------[ cut here ]------------
    [ 14.265508] kernel BUG at drivers/pci/msi.c:376!
    [ 14.265610] invalid opcode: 0000 [#1] PREEMPT SMP
    [ 14.265710] CPU: 0 PID: 296 Comm: connmand Not tainted 5.10.52-acrn-sos
                 -dirty #72
    [ 14.265863] RIP: 0010:free_msi_irqs+0x182/0x1b0

This patch will specify some legacy PnP device like UART and RTC in ACPI
DSDT table of pre-launched VM, so that IRQs from IOAPIC pin 4/3/8 could be
preserved before MSI device requesting IRQs.

Tracked-On: #6704

Signed-off-by: Victor Sun <victor.sun@intel.com>
2021-10-25 13:35:09 +08:00
Yang,Yu-chu 4ca2b3a860 config-tools: allow SERIAL_CONSOLE to use any native ttyS#
Remove the restriction that SERIAL_CONSOLE needs to be ttys0, ttys1,
ttys2 or ttys3.

1. Lossen the restriction in xsd.
2. Rewrite the document.
3. Refine the intx.py. Refine the logic which take effect if the <irq>
is specified in "SOS_COM#_IRQ" for SOS VM's legacy vuart 0.

Tracked-On: #6610
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
2021-10-23 09:34:43 +08:00
Yonghua Huang c8e2060d37 hv: unmap IOMMU register pages from service VM EPT
IOMMU hardware resource is owned by hypervisor, while
 IOMMU capability is reported to service VM in its ACPI
 table. In this case, Service VM may access IOMMU hardware
 resource, which is not expected.

 This patch unmaps all Intel IOMMU register pages for service VM EPT.

Tracked-On: #6677
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
Reviewed-by: Victor Sun <victor.sun@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2021-10-22 09:31:10 +08:00
Amy Reyes a3ec34b3d6 Update Step 2 per feedback
Signed-off-by: Amy Reyes <amy.reyes@intel.com>
2021-10-21 11:42:29 -07:00
Amy Reyes 4706f451eb Update per comments 2021-10-21 11:42:29 -07:00
Amy Reyes c2b10d5dcd Update per comments
Signed-off-by: Amy Reyes <amy.reyes@intel.com>
2021-10-21 11:42:29 -07:00
Amy Reyes 36fc1024e7 Fix line widths
Signed-off-by: Amy Reyes <amy.reyes@intel.com>
2021-10-21 11:42:29 -07:00
Amy Reyes fc0112067e doc: update Overview with DX recommendations
- Capitalize Board Inspector and ACRN Configurator names to highlight them in images and content
- Remove duplicate links between the Overview and GSG where not needed
- Provide additional details that help to deepen developer’s knowledge where applicable.  Potential items: acrn-dm, more clarity of the relationship between the ServiceVM and UserVMs, expanded definitions of scenarios (beyond one liners).

Signed-off-by: Amy Reyes <amy.reyes@intel.com>
2021-10-21 11:42:29 -07:00
Weiyi Feng 2c5db9b7af config_tools: fix the UI issue that fail to overwrite scenario file
1. find default scenario file in board_type and generic_board director
 path.

Tracked-On: #6292
Signed-off-by: Weiyi Feng <weiyix.feng@intel.com>
2021-10-21 15:19:21 +08:00
Kunhui-Li 3450fbfe54 config_tools: fix the UI issue that fail to create a new pre_rt_vm
add hybrid_rt.xml file under the generic_board folder so that
UI can call pre_rt_vm type when the user clicks 'Add a VM below'
button to add a new pre_rt_vm.

Tracked-On: #6292
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2021-10-21 15:19:21 +08:00
Kunhui-Li 0caf214cf1 config_tools: fix UI issue that don't export xml file successfully
call default_populator.py to expand the default value in the
scenario XML file to fix the issue that don't export xml successfully
in UI when user to click the 'Export XML' button to export scenario xml
file because that the unexpanded xml does not conform to schema check.

Tracked-On: #6292
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2021-10-21 15:19:21 +08:00
Junjie Mao aceae3a30f config_tools: update vTPM2 revision to 4
According to TCG ACPI specification (version 1.2), the current revision of
TPM2 table, which has the optional log area fields, is 4. This patch
updates the revision of vTPM2 accordingly.

Tracked-On: #6288
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2021-10-21 12:58:43 +08:00
Junjie Mao ebee11ae11 board_inspector: add _CID to vACPI device objects
ACPI device drivers use both _HID and _CID to identify devices they
match. This patch copies _CID objects to vACPI devices so that guest
drivers can recognize the passthrough devices properly.

Tracked-On: #6288
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2021-10-21 12:58:43 +08:00
Amy Reyes ca32ae7e3d doc: terminology cleanup in hv-dev-passthrough.rst
- Change UOS and SOS to User VM and Service VM, respectively
- Change guest to VM or similar depending on context
- Clean up some of the grammar

Signed-off-by: Amy Reyes <amy.reyes@intel.com>
2021-10-20 11:00:40 -07:00