Modified the copyright year range in code, and corrected "int32_tel"
into "Intel" in two "hypervisor/include/debug/profiling.h" and
"hypervisor/include/debug/profiling_internal.h".
Tracked-On: #7559
Signed-off-by: Ziheng Li <ziheng.li@intel.com>
Many of the license and Intel copyright headers include the "All rights
reserved" string. It is not relevant in the context of the BSD-3-Clause
license that the code is released under. This patch removes those strings
throughout the code (hypervisor, devicemodel and misc).
Tracked-On: #7254
Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
The current code does not always check the return value of function
ioctl called in ACRN userspace, and lack of error message printing
to help debug.
This code fixes it by checking the return value of ioctl, and adding
function errormsg to return a string describing of the error code.
Tracked-On: #7029
Signed-off-by: Wen Qian <qian.wen@intel.com>
Signed-off-by: Li Fei <fei1.li@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
By default, pCPU is allowed to request software SRAM buffer
from given region in TCC buffer driver only if this pCPU is
set in the target region's CPU affinity configuration.
This check shall be disabled for software SRAM virtualization
usage in ACRN service VM, because software SRAM buffers are
requested by ACRN DM on behalf of user VM, but ACRN DM and
user VM may run on different CPUs while the target software
SRAM region may be configured only for pCPUs that user VM runs on.
This patch turns off such affinity check in TCC driver when
initializing vSSRAM for user VM.
Tracked-On: #7010
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Reviewed-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
GET_PLATFORM_INFO IOCTL syscall will not be supported
from ACRN HSM driver, while vm_get_config() API depends
on it hence shall be removed.
Without vm_get_config(), vm_get_cpu_affinity_dm() is used
to get guest CPU bitmask.
Tracked-On: #6690
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
The GET_PLATFORM_INFO will be removed from hypervisor. The acrn-dm can
only refer to Service VM's resources from now, all the resources out of
Service VM are not awared by acrn-dm. The original info got from
GET_PLATFORM_INFO needs to changed to Service VM's perspective like lapic id.
The pcpu_id is the index of lapic instance in MADT table. This patch
parses the Service VM's MADT table to convert the pcpu_id to lapic_id instead
of GET_PLATFORM_INFO.
Tracked-On: #6690
Signed-off-by: Yuanyuan Zhao <yuanyuan.zhao@linux.intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
Hook ssram init && de-init functions to vdev
devices lifecycle management:
1) initialize ssram when vdev devices
are initialized.
2) de-initialize ssram when vdev devices
are reset or destroyed.
notes:
ssram configuration data can be released only when
user VM shutdown, hence it can't be done in deinit_vssram().
- VM reboot:
do deinit_vssram() only.
- VM shutdown:
do both deinit_vssram() and clean_vssram_config().
Tracked-On: #7010
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Wang Yu1 <yu1.wang@intel.com>
Add TCC native memory hierarchy entries to vRTCT:
- wrap one function to get TCC RTCT data.
- Add memory hierarchy entries from TCC
RTCT to vRTCT.
Tracked-On: #7010
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Wang Yu1 <yu1.wang@intel.com>
add all L2 & L3 cache buffers to RTCT entries:
- SSRAM WAY_MASK entry, cache ways bitmask indicates
the cache ways used by specific cache buffer.
- SSRAM region entry, support format V2 only.
Tracked-On: #7010
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Wang Yu1 <yu1.wang@intel.com>
This patch initializes below entries in vRTCT:
- Hardcode ACPI header
- Hardcode RTCT compatibility entry, support RTCT v2 only
for ACRN user VMs.
Tracked-On: #7010
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Wang Yu1 <yu1.wang@intel.com>
Add EPT mapping for all L2 & L3 vSSRAM buffers
for user VM.
Tracked-On: #7010
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Yu1 Wang <yu1.wang@intel.com>
This patch allocates cache buffers from native TCC
buffer driver and do setup, make them ready to be
mapped to ACRN user VMs as software SRAM regions.
Tracked-On: #7010
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Yu1 Wang <yu1.wang@intel.com>
- wrap TCC driver interface to get SSRAM regions count
and region configuration.
- add function to load configurations of all SSRAM regions.
- Add header file to describe TCC data structure.
Tracked-On: #7010
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Wang Yu1 <yu1.wang@intel.com>
This patch figures out the guest cache hierarchy:
- calculate the cache hierarchy parameters, including
cache thread sharing number and inclusiveness of LLC.
- define and initialize data structure to describe
L2 & L3 cache buffers, these buffers will be mapped
to user VM as ssram regions.
- add some utility functions.
- complete the implementation of function
'create_ssram_rtct_entries()', though most functions
inside are not implemented yet.
Tracked-On: #7010
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Yu1 Wang <yu1.wang@intel.com>
1) With this patch, '--ssram' option is updated to enable
vSSRAM feature support for ACRN user VMs.
'--ssram' argument of Device Model shall follow below format:
--ssram {Ln,vcpu=vcpu_set,size=nK|M;}
example:
--ssram L2,vcpu=0,1,size=4K;L2,vcpu=2,3,size=1M;L3,vcpu=all,size=2M
2) define data structure and variable
to store the configuration data for later processing.
3) add new API to cleanup configuration data when VM shutdown.
Tracked-On: #7010
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Wang Yu1 <yu1.wang@intel.com>
Move below logic out of init_vssram():
- get guest vCPU information
- vssram GPA space
Tracked-On: #7010
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Wang Yu1 <yu1.wang@intel.com>
virtual RTCT will be created on TCC driver interface, instead of
pass-through native RTCT to ACRN user VMs.
this patch removes dependency on native RTCT table:
- rename build_vrtct() function to init_ssram()
and minor changes inside.
- drop function create_and_inject_vrtct()
- add one API to get virtual RTCT table.
- rename variable 'pt_rtct' to 'ssram'
Tracked-On: #7010
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Wang Yu1 <yu1.wang@intel.com>
Rename them to unify the coding style or for simplification
purpose, also remove redundant function declearations
in pci_core.h header file.
v4 update:
SSRAM* -> VSSRAM*
ssram* -> vssram*
Tracked-On: #7010
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Wang Yu1 <yu1.wang@intel.com>
guest ssram will be virtualized based on tcc driver interface,
instead of pass-thru native rtct, rename its source files to
avoid confusing:
- rename:
rtct.c -> vssram.c
rtct.h -> vssram.h
- move rtct.c from platform/acpci/ to platform/
- new directory 'vssram' to hold vssram source files.
Tracked-On: #7010
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Wang Yu1 <yu1.wang@intel.com>