Commit Graph

6746 Commits

Author SHA1 Message Date
Kunhui-Li 3124097a78 config_tools: remove hvlog parameter and update HV_RAM_START default address
1. remove hvlog parameter in bootargs for all platforms.
2. update HV_RAM_START default address from 2MB to 4MB.
3. add the check that the HV_RAM_START value should be larger
than or equal to 2MB and 2MB aligned.

Tracked-On: #6663
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2021-11-03 10:28:40 +08:00
Yang,Yu-chu 1bc7f0f6a5 config-tools: refine MMIO32/64_START and MMIO32/64_END
Get the start and end address based on all pci bus memory resource.

Tracked-On: #6752
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
2021-11-03 09:28:23 +08:00
Xiangyang Wu 9e2edd5192 misc: config_tools: add vuart for communication
In this patch, add vuart configuration in scenario XML of
each board to support communication between service VM and
user VM since system shutdown feature need to send commands
through this vuart communication channel.

The follow changes are made in this patch:
- Add multi legacy vuart for service VM for communication
- Add one legacy vuart for user VM for communication
- Add 8250.nr_uarts parameter in command line of service OS

Tracked-On: #6652
Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
2021-11-03 09:13:41 +08:00
David B. Kinder 603780e6ef doc: draft release notes for v2.7
Start documenting the major changes to v2.7, in particular the UOS/SOS
term changes that impact the APIs and documentation, and the scenario name changes.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2021-11-02 18:04:26 -07:00
David B. Kinder fb226e2938 doc: clean up UOS/SOS and scenario names in glossary
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2021-11-02 18:04:06 -07:00
David B. Kinder 0bcb66e94e doc: tweak CSS for Sphinx/Breathe API documents
Words in the function prototypes looked run together making it hard to
read, so tweak the CSS to add a bit of padding.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2021-11-02 17:28:02 -07:00
Weiyi Feng 648b880f89 config_tools: Update launch xml for Sriov/GPU passthrough support
1. Update launch xml for Sriov/GPU passthrough support

Tracked-On: #6290
Signed-off-by: Weiyi Feng <weiyix.feng@intel.com>
2021-11-02 18:30:54 +08:00
Weiyi Feng 20f1dfd9c3 config_tools: Update GPU passthrough support
1. Remove gvt_args field.
2. Add passthrough GPU devices support.
3. Add sriov device support.

Tracked-On: #6290
Signed-off-by: Weiyi Feng <weiyix.feng@intel.com>
2021-11-02 18:30:54 +08:00
Hu Fenglin f65a87585b deb-pkg: add acrn-hypervisor and acrn-board-inspector into debian package
1. "make clean && make BOARD=nuc11tnbi5  SCENARIO=shared" will generate the acrn debian package.
 2. "make clean && make board_inspector" will generate the acrn board_inspector debian package

Tracked-On: #6688
Signed-off-by: Hu Fenglin <fenglin.hu@intel.com>
2021-11-02 15:31:18 +08:00
Peter Fang 856815bb5c OVMF release v2.7
- OvmfPkg/PlatformGopPolicy: Add OpRegion 2.1 support
- OvmfPkg: refine Platform GOP Policy

Tracked-On: #6749
Signed-off-by: Peter Fang <peter.fang@intel.com>
2021-11-02 15:11:42 +08:00
Yifan Liu 10963b04d1 hv: Fix vcpu signaling racing problem in lock instruction emulation
In lock instruction emulation, we use vcpu_make_request and
signal_event pairs to shoot down/release other vcpus.
However, vcpu_make_request is async and does not guarantee an execution
of wait_event on target vcpu, and we want wait_event to be consistent
with signal_event.

Consider following scenarios:

1, When target vcpu's state has not yet turned to VCPU_RUNNING,
vcpu_make_request on ACRN_REQUEST_SPLIT_LOCK does not make sense, and will
not result in wait_event.

2, When target vcpu is already requested on ACRN_REQUEST_SPLIT_LOCK (i.e., the
corresponding bit in pending_req is set) but not yet handled,
the vcpu_make_request call does not result in wait_event as 1 bit is not
enough to cache multiple requests.

This patch tries to add checks in vcpu_kick_lock_instr_emulation and
vcpu_complete_lock_instr_emulation to resolve these issues.

Tracked-On: #6502
Signed-off-by: Yifan Liu <yifan1.liu@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
2021-11-02 15:01:20 +08:00
Liu Long 3f4ea38158 ACRN: misc: Unify terminology for service vm/user vm
Rename SOS_VM type to SERVICE_VM
rename UOS to User VM in XML description
rename uos_thread_pid to user_vm_thread_pid
rename devname_uos to devname_user_vm
rename uosid to user_vmid
rename UOS_ACK to USER_VM_ACK
rename SOS_VM_CONFIG_CPU_AFFINITY to SERVICE_VM_CONFIG_CPU_AFFINITY
rename SOS_COM to SERVICE_VM_COM
rename SOS_UART1_VALID_NUM" to SERVICE_VM_UART1_VALID_NUM
rename SOS_BOOTARGS_DIFF to SERVICE_VM_BOOTARGS_DIFF
rename uos to user_vm in launch script and xml

Tracked-On: #6744
Signed-off-by: Liu Long <long.liu@linux.intel.com>
Reviewed-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2021-11-02 10:00:55 +08:00
Liu Long c0554f9d99 ACRN: misc: Unify terminology for uos in macro
Rename uos_rpmb_size to user_vm_rpmb_size.
rename get_uos_count to get_user_vm_count.
rename get_uos_id to get_user_vmid.
rename uos_id to user_vmid.

Tracked-On: #6744
Signed-off-by: Liu Long <long.liu@linux.intel.com>
Reviewed-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2021-11-02 10:00:55 +08:00
Liu Long 14c6e21efa ACRN: misc: Unify terminology for sos/uos rin macro
Rename SOS_VM_NUM to SERVICE_VM_NUM.
rename SOS_SOCKET_PORT to SERVICE_VM_SOCKET_PORT.
rename PROCESS_RUN_IN_SOS to PROCESS_RUN_IN_SERVICE_VM.
rename PCI_DEV_TYPE_SOSEMUL to PCI_DEV_TYPE_SERVICE_VM_EMUL.
rename SHUTDOWN_REQ_FROM_SOS to SHUTDOWN_REQ_FROM_SERVICE_VM.
rename PROCESS_RUN_IN_SOS to PROCESS_RUN_IN_SERVICE_VM.
rename SHUTDOWN_REQ_FROM_UOS to SHUTDOWN_REQ_FROM_USER_VM.
rename UOS_SOCKET_PORT to USER_VM_SOCKET_PORT.
rename SOS_CONSOLE to SERVICE_VM_OS_CONSOLE.
rename SOS_LCS_SOCK to SERVICE_VM_LCS_SOCK.
rename SOS_VM_BOOTARGS to SERVICE_VM_OS_BOOTARGS.
rename SOS_ROOTFS to SERVICE_VM_ROOTFS.
rename SOS_IDLE to SERVICE_VM_IDLE.
rename SEVERITY_SOS to SEVERITY_SERVICE_VM.
rename SOS_VM_UUID to SERVICE_VM_UUID.
rename SOS_REQ to SERVICE_VM_REQ.
rename RTCT_NATIVE_FILE_PATH_IN_SOS to RTCT_NATIVE_FILE_PATH_IN_SERVICE_VM.
rename CBC_REQ_T_UOS_ACTIVE to CBC_REQ_T_USER_VM_ACTIVE.
rename CBC_REQ_T_UOS_INACTIVE to CBC_REQ_T_USER_VM_INACTIV.
rename uos_active to user_vm_active.

Tracked-On: #6744
Signed-off-by: Liu Long <long.liu@linux.intel.com>
Reviewed-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2021-11-02 10:00:55 +08:00
Liu Long e9c4ced460 ACRN: hv: Unify terminology for user vm
Rename gpa_uos to gpa_user_vm
rename base_gpa_in_uos to base_gpa_in_user_vm
rename UOS_VIRT_PCI_MMCFG_BASE to USER_VM_VIRT_PCI_MMCFG_BASE
rename UOS_VIRT_PCI_MMCFG_START_BUS to USER_VM_VIRT_PCI_MMCFG_START_BUS
rename UOS_VIRT_PCI_MMCFG_END_BUS to USER_VM_VIRT_PCI_MMCFG_END_BUS
rename UOS_VIRT_PCI_MEMBASE32 to USER_VM_VIRT_PCI_MEMBASE32
rename UOS_VIRT_PCI_MEMLIMIT32 to USER_VM_VIRT_PCI_MEMLIMIT32
rename UOS_VIRT_PCI_MEMBASE64 to USER_VM_VIRT_PCI_MEMBASE64
rename UOS_VIRT_PCI_MEMLIMIT64 to USER_VM_VIRT_PCI_MEMLIMIT64
rename UOS in comments message to User VM.

Tracked-On: #6744
Signed-off-by: Liu Long <long.liu@linux.intel.com>
Reviewed-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2021-11-02 10:00:55 +08:00
Liu Long 92b7d6a9a3 ACRN: hv: Terminology modification in hv code
Rename sos_vm to service_vm.
rename sos_vmid to service_vmid.
rename sos_vm_ptr to service_vm_ptr.
rename get_sos_vm to get_service_vm.
rename sos_vm_gpa to service_vm_gpa.
rename sos_vm_e820 to service_vm_e820.
rename sos_efi_info to service_vm_efi_info.
rename sos_vm_config to service_vm_config.
rename sos_vm_hpa2gpa to service_vm_hpa2gpa.
rename vdev_in_sos to vdev_in_service_vm.
rename create_sos_vm_e820 to create_service_vm_e820.
rename sos_high64_max_ram to service_vm_high64_max_ram.
rename prepare_sos_vm_memmap to prepare_service_vm_memmap.
rename post_uos_sworld_memory to post_user_vm_sworld_memory
rename hcall_sos_offline_cpu to hcall_service_vm_offline_cpu.
rename filter_mem_from_sos_e820 to filter_mem_from_service_vm_e820.
rename create_sos_vm_efi_mmap_desc to create_service_vm_efi_mmap_desc.
rename HC_SOS_OFFLINE_CPU to HC_SERVICE_VM_OFFLINE_CPU.
rename SOS to Service VM in comments message.

Tracked-On: #6744
Signed-off-by: Liu Long <long.liu@linux.intel.com>
Reviewed-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2021-11-02 10:00:55 +08:00
Liu Long 26e507a06e ACRN: hv: Unify terminology for service vm
Rename is_sos_vm to is_service_vm

Tracked-On: #6744
Signed-off-by: Liu Long <longliu@intel.com>
2021-11-02 10:00:55 +08:00
David B. Kinder 2554c8f8cc doc: fix broken links
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2021-10-29 11:33:02 -07:00
Hu Fenglin e6de236caa deb-pkg: load msr driver in board_parse.py
Tracked-On: #6688
Signed-off-by: Hu Fenglin <fenglin.hu@intel.com>
2021-10-29 14:50:48 +08:00
Geoffroy Van Cutsem 9bae63b941 config_tools: improve logging readability for the board inspector
Improve the logging readibility for the Board Inspector tool by adding
a space after "Error:" and "Warning:" instead of have the text directly
attached to it.

Tracked-On: #6736
Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2021-10-29 12:17:49 +08:00
Amy Reyes 8587f73919 Remove prompts in commands
Signed-off-by: Amy Reyes <amy.reyes@intel.com>
2021-10-28 13:40:28 -07:00
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