Commit Graph

6326 Commits

Author SHA1 Message Date
Yang,Yu-chu fec1f87adc config-tools: do not exit when the board inspector runs in hypervisor
While running in a nested environment, such as qemu, parse the board
information should be allowed even it is not in a native environment.

Replace the error with warning message and does not exit the program.

Tracked-On: #6208
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
2021-07-19 10:13:28 +08:00
Kunhui-Li 005dacbbae config_tools: enlarge max size to store RTCT table
Enlarge the max size to store the PTCT/RTCT table to 1k bytes
because the size of RTCT table exceeded the original max size
0x1100 - 0xF00 which makes RTCT table overlap other ACPI tables.

Tracked-On: #6303
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2021-07-19 10:11:11 +08:00
Kunhui-Li fb0a9ccb5e config_tools: update nuc11tnbi5 xml files
1. Update the vaule of the tag CLOS_MASK to 0xfffff according to board.xml
in all scenario xml files.
2. Replace industry_launch_2uos.xml launch file with industry_launch_6uos.xml.
3. Update logical_partition.xml file.
4. Remove hybrid_rt.xml file, then add a second POST_STD_VM in hybrid.xml and
add hybrid_launch_2uos.xml launch file correspondingly.

Tracked-On: #6244
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2021-07-19 10:08:40 +08:00
Yang,Yu-chu 73547471c7 config-tools: refine the MAX_MSIX_TABLE_NUM in config.h
Find the maximum of counts MSI and table_size of MSI-X based on
board.xml.

Tracked-On: #6235
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
2021-07-19 10:00:40 +08:00
Yang,Yu-chu 987216fef0 config-tools: add MSI-X capability
Add the MSI-X capability structure nodes under <capability
id="MSI-X"> in board.xml.
Example:
  <capability id="MSI-X">
    <table_size>16</table_size>
    <table_bir>1</table_bir>
    <table_offset>0x1000000</table_offset>
    <pba_bir>1</pba_bir>
    <pba_offset>0x0</pba_offset>
  </capability>

Fix the MSI <count> nodes when there is only one vector.

Tracked-On: #6235
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
2021-07-19 10:00:40 +08:00
David B. Kinder 86f9cda177 doc: add enable PTM tutorial
Restore PTM tutorial removed for the 2.5 release (it's tested as
working now)

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2021-07-16 12:20:26 -07:00
Kunhui-Li 6f083154b6 config_tools: update board xml files for MAX_MSIX_TABLE_NUM fix
The PR 6236 has modified the board.xml format for MAX_MSIX_TABLE_NUM fix.
To compromise this PR, updates all the source file board.xmls.

Tracked-On: #6235
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2021-07-15 14:42:55 +08:00
Yonghua Huang 48908d522f hv: minor coding style fix in list.h
To add brakets for '(char *)(ptr)' in MACRO
 container_of(), which may be used recursively.

Tracked-On: #6284
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
2021-07-15 14:18:13 +08:00
Shuo A Liu 7947b4dae8 doc: Adapt documents to new HSM driver
Tracked-On: #6282
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
2021-07-15 11:53:54 +08:00
Shuo A Liu 4c9e9b9e4a doc: Change VHM to HSM in documentations
Mainly do the renaming(VHM->HSM) in the Doc.

Tracked-On: #6282
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
2021-07-15 11:53:54 +08:00
Shuo A Liu 4896faaebb hv: dm: Remove aligned attribute of common structures
Common structures are used by DM, kernel, HV. Aligned attribute might
caused structures size mismatch between DM/HV and kernel, as kernel uses
default GCC alignment.

So, make DM/HV also use the default GCC alignment.

Tracked-On: #6282
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
2021-07-15 11:53:54 +08:00
Shuo A Liu 1bccfab3b6 config_tools: Use new HSM driver device node
Tracked-On: #6282
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
2021-07-15 11:53:54 +08:00
Shuo A Liu b218544872 dm: Remove hardcode vm_config size from vm_get_config()
vm_config size can be calced by platform_info.sw.max_vms *
platform_info.sw.vm_config_size.

Change vm_get_config() to call IOCTL ACRN_IOCTL_GET_PLATFORM_INFO
twice, first to get platform_info, second to get the vm_configs
content.

Tracked-On: #6282
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
2021-07-15 11:53:54 +08:00
Shuo A Liu d170336e90 hv: Remove unused definition
Below data structures definition are deprecated, remove them.

struct acrn_create_vcpu
struct acrn_nmi_entry
struct acrn_vm_pci_msix_remap

Tracked-On: #6282
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
2021-07-15 11:53:54 +08:00
Shuo A Liu 07381888d3 dm: Use the new HSM eventfd ioctls
IC_EVENT_IOEVENTFD		->	ACRN_IOCTL_IOEVENTFD
IC_EVENT_IRQFD			->	ACRN_IOCTL_IRQFD

Tracked-On: #6282
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
2021-07-15 11:53:54 +08:00
Shuo A Liu 6e0b12180c hv: dm: Use new power management data structures
struct cpu_px_data		->	struct acrn_pstate_data
struct cpu_cx_data		->	struct acrn_cstate_data
enum pm_cmd_type		->	enum acrn_pm_cmd_type
struct acpi_generic_address	->	struct acrn_acpi_generic_address
cpu_cx_data			->	acrn_cstate_data
cpu_px_data			->	acrn_pstate_data

IC_PM_GET_CPU_STATE		->	ACRN_IOCTL_PM_GET_CPU_STATE

PMCMD_GET_PX_CNT		->	ACRN_PMCMD_GET_PX_CNT
PMCMD_GET_CX_CNT		->	ACRN_PMCMD_GET_CX_CNT
PMCMD_GET_PX_DATA		->	ACRN_PMCMD_GET_PX_DATA
PMCMD_GET_CX_DATA		->	ACRN_PMCMD_GET_CX_DATA

Tracked-On: #6282
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
2021-07-15 11:53:54 +08:00
Shuo A Liu 98c80d75b8 hv: dm: Use new virtual device management ioctls
IC_ADD_HV_VDEV		->	ACRN_IOCTL_CREATE_VDEV
IC_REMOVE_HV_VDEV	->	ACRN_IOCTL_DESTROY_VDEV
struct acrn_emul_dev	->	struct acrn_vdev

Also, move struct acrn_vdev to acrn_common.h as this structure is used
by both DM and HV.

Tracked-On: #6282
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
2021-07-15 11:53:54 +08:00
Shuo A Liu 9e7abbb38c dm: Use new MMIO device passthrough management ioctls
IC_ASSIGN_MMIODEV	->	ACRN_IOCTL_ASSIGN_MMIODEV
IC_DEASSIGN_MMIODEV	->	ACRN_IOCTL_DEASSIGN_MMIODEV

struct acrn_mmiodev has slight change. Move struct acrn_mmiodev into
acrn_common.h because it is used by both DM and HV.

Tracked-On: #6282
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
2021-07-15 11:53:54 +08:00
Shuo A Liu 3625eb7a99 hv: dm: Use new pci device passthrough management ioctls
IC_ASSIGN_PCIDEV		->	ACRN_IOCTL_ASSIGN_PCIDEV
IC_DEASSIGN_PCIDEV		->	ACRN_IOCTL_DEASSIGN_PCIDEV
QUIRK_PTDEV			->	ACRN_PTDEV_QUIRK_ASSIGN
struct acrn_assign_pcidev	->	struct acrn_pcidev

Move struct acrn_pcidev into acrn_common.h because it is used by both
DM and HV.

Tracked-On: #6282
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
2021-07-15 11:53:54 +08:00
Shuo A Liu 9d67745037 dm: Use new ptdev interrupt management ioctls
IC_SET_PTDEV_INTR_INFO	 ->	ACRN_IOCTL_SET_PTDEV_INTR
IC_RESET_PTDEV_INTR_INFO ->	ACRN_IOCTL_RESET_PTDEV_INTR
struct ic_ptdev_irq	 ->	struct acrn_ptdev_irq
IRQ_INTX		 ->	ACRN_PTDEV_IRQ_INTX
IRQ_MSI			 ->	ACRN_PTDEV_IRQ_MSI

Tracked-On: #6282
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
2021-07-15 11:53:54 +08:00
Shuo A Liu 7e01d90b87 dm: Use new memory management ioctls
struct vm_memmap	->	struct acrn_vm_memmap
VM_MEMMAP_SYSMEM	->	ACRN_MEMMAP_RAM
VM_MMIO			->	ACRN_MEMMAP_MMIO
PROT_ALL		->	ACRN_MEM_ACCESS_RWX

Tracked-On: #6282
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
2021-07-15 11:53:54 +08:00
Shuo A Liu 9c910bae44 hv: dm: Use new I/O request data structures
struct vhm_request		->	struct acrn_io_request
union vhm_request_buffer	->	struct acrn_io_request_buffer
struct pio_request		->	struct acrn_pio_request
struct mmio_request		->	struct acrn_mmio_request
struct ioreq_notify		->	struct acrn_ioreq_notify

VHM_REQ_PIO_INVAL		->	IOREQ_PIO_INVAL
VHM_REQ_MMIO_INVAL		->	IOREQ_MMIO_INVAL
REQ_PORTIO			->	ACRN_IOREQ_TYPE_PORTIO
REQ_MMIO			->	ACRN_IOREQ_TYPE_MMIO
REQ_PCICFG			->	ACRN_IOREQ_TYPE_PCICFG
REQ_WP				->	ACRN_IOREQ_TYPE_WP

REQUEST_READ			->	ACRN_IOREQ_DIR_READ
REQUEST_WRITE			->	ACRN_IOREQ_DIR_WRITE
REQ_STATE_PROCESSING		->	ACRN_IOREQ_STATE_PROCESSING
REQ_STATE_PENDING		->	ACRN_IOREQ_STATE_PENDING
REQ_STATE_COMPLETE		->	ACRN_IOREQ_STATE_COMPLETE
REQ_STATE_FREE			->	ACRN_IOREQ_STATE_FREE

IC_CREATE_IOREQ_CLIENT		->	ACRN_IOCTL_CREATE_IOREQ_CLIENT
IC_DESTROY_IOREQ_CLIENT		->	ACRN_IOCTL_DESTROY_IOREQ_CLIENT
IC_ATTACH_IOREQ_CLIENT		->	ACRN_IOCTL_ATTACH_IOREQ_CLIENT
IC_NOTIFY_REQUEST_FINISH	->	ACRN_IOCTL_NOTIFY_REQUEST_FINISH
IC_CLEAR_VM_IOREQ		->	ACRN_IOCTL_CLEAR_VM_IOREQ
HYPERVISOR_CALLBACK_VHM_VECTOR	->	HYPERVISOR_CALLBACK_HSM_VECTOR

arch_fire_vhm_interrupt()	->	arch_fire_hsm_interrupt()
get_vhm_notification_vector()	->	get_hsm_notification_vector()
set_vhm_notification_vector()	->	set_hsm_notification_vector()
acrn_vhm_notification_vector	->	acrn_hsm_notification_vector
get_vhm_req_state()		->	get_io_req_state()
set_vhm_req_state()		->	set_io_req_state()

Below structures have slight difference with former ones.

  struct acrn_ioreq_notify
  strcut acrn_io_request

Tracked-On: #6282
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
2021-07-15 11:53:54 +08:00
Shuo A Liu 3c66ba7ef5 dm: Use new interrupt management ioctls
IC_INJECT_MSI		->	ACRN_IOCTL_INJECT_MSI
IC_SET_IRQLINE		->	ACRN_IOCTL_SET_IRQLINE
IC_VM_INTR_MONITOR	->	ACRN_IOCTL_VM_INTR_MONITOR

Tracked-On: #6282
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
2021-07-15 11:53:54 +08:00
Shuo A Liu 107cae316a hv: dm: Use new ioctl ACRN_IOCTL_SET_VCPU_REGS
struct acrn_set_vcpu_regs	->	struct acrn_vcpu_regs
struct acrn_vcpu_regs		->	struct acrn_regs
IC_SET_VCPU_REGS		->	ACRN_IOCTL_SET_VCPU_REGS

Tracked-On: #6282
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
2021-07-15 11:53:54 +08:00
Shuo A Liu f476ca55ab hv: dm: Use new VM management ioctls
IC_CREATE_VM		->	ACRN_IOCTL_CREATE_VM
IC_DESTROY_VM		->	ACRN_IOCTL_DESTROY_VM
IC_START_VM		->	ACRN_IOCTL_START_VM
IC_PAUSE_VM		->	ACRN_IOCTL_PAUSE_VM
IC_RESET_VM		->	ACRN_IOCTL_RESET_VM

struct acrn_create_vm	->	struct acrn_vm_creation

Tracked-On: #6282
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
2021-07-15 11:53:54 +08:00
Shuo A Liu 7efe18a84b hv: Use new struct acrn_platform_info to adapt new HSM driver
struct hc_platform_info	->	struct acrn_platform_info
MAX_PLATFORM_LAPIC_IDS	->	ACRN_PLATFORM_LAPIC_IDS_MAX

A layout change to the struct hc_platform_info is that move
max_kata_containers to back of vm_config_size,
		uint16_t max_vcpus_per_vm;
		uint16_t max_vms;
		uint32_t vm_config_size;
		uint64_t max_kata_containers;
Then, they are nature 64-bits aligned.

Tracked-On: #6282
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
2021-07-15 11:53:54 +08:00
Shuo A Liu 3deb973b7a dm: Use new ioctl ACRN_IOCTL_GET_PLATFORM_INFO
IC_GET_PLATFORM_INFO	->	ACRN_IOCTL_GET_PLATFORM_INFO
struct acrn_vm_config	->	struct acrn_vm_config_header(DM only)
struct platform_info	->	struct acrn_platform_info

Tracked-On: #6282
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
2021-07-15 11:53:54 +08:00
Shuo A Liu 82fa2d6355 dm: Rename vhm_ioctl_defs.h to hsm_ioctl_defs.h
Tracked-On: #6282
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
2021-07-15 11:53:54 +08:00
Shuo A Liu 5a8bfff7a4 dm: return value 0 of vm_create_ioreq_client is valid
Negative return value of vm_create_ioreq_client is invalid. 0 is valid.

Tracked-On: #6282
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2021-07-15 11:53:54 +08:00
Shuo A Liu 42989f753e dm: Remove header vmm.h
vmm.h has some unused definitions.

Keep the useful definitions and delete vmm.h

Tracked-On: #6282
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2021-07-15 11:53:54 +08:00
Shuo A Liu 21e095dda0 dm: Remove unused vm_create_vcpu() interface
The hypervisor creates vCPUs for a User VM in VM creation interface. The
vm_create_vcpu() interface is not needed anymore.

Remove vm_create_vcpu() from acrn-dm.

Tracked-On: #6282
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2021-07-15 11:53:54 +08:00
Shuo A Liu 6ae5f8388e dm: Remove the API version check
Interface version is not recommended in Linux kernel community. Please
check Documentation/driver-api/ioctl.rst for reasons.

Remove the unused API version check from acrn-dm.

Tracked-On: #6282
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2021-07-15 11:53:54 +08:00
David B. Kinder 24b555c75d doc: remove doc dependency on kerneldoc and acrn-kernel repo
We no longer need to generate API documentation for the upstreamed
gvt-g kernel additions so we can remove the doc generation dependency on
the acrn-kernel repo (and all use of the kerneldoc extension). We also
remove GVT-g API documentation and porting guide that are obsolete with
ACRN v2.6 and referenced this API documentation.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2021-07-14 18:56:07 -07:00
Yonghua Huang c4cb95f3b4 doc: Update address to report security vulnerability
acrn-security@lists.projectacrn.org shall be used.

Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
2021-07-13 16:24:46 -07:00
Tao Yuhong ad53894fdb DM: TPM: tpm passthrough device must use fixed base GPA
The TPM driver will access some mmio registers using absolute address,
That means TPM base GPA must use same HPA value, when passthough it to VM

Tracked-On: #6126
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
2021-07-05 13:18:29 +08:00
Tao Yuhong a82020839a DM: TPM2: Fix remove hard code GPA base miss control register info
CRB_REGS_CTRL_REQ is offset of control register to TPM mmio base,
need use the address to generate TPM2 acpi table

Tracked-On: #6126
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
2021-07-05 13:18:29 +08:00
Kunhui-Li a8ef428b4b config_tools: fix cpu offline issue in launch script
In launch script, update cpu offline method to fix the issue
that it isn't offline cpu on ADL-S board.

Tracked-On: #6266
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2021-07-02 13:56:37 +08:00
Kunhui-Li e6d447e462 config_tools: update board_inspector to copy RTCT file
1. Remove acpi_template/ehl-crb-b/PTCT and acpi_template/tgl-rvp/PTCT files.
2. Update board_inspector/legacy/acpi.py script to copy RTCT file.

Tracked-On: #6238
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2021-07-02 13:42:06 +08:00
Sun Peng 28509b61c9 dm: Add PCI IDS for EHL/TGL/ADL in GPU passthrough
Add PCI IDS for ElkhartLake/TigerLake/AlderLake in GPU DSM and OpRegion
passthrough.

Tracked-On: #6270
Signed-off-by: Sun Peng <peng.p.sun@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2021-07-02 09:50:05 +08:00
Shuo A Liu 9c1caad25a hv: nested: Keep privilege bits sync in shadow EPT entry
Guest may not use INVEPT instruction after enabling any of bits 2:0 from
0 to 1 of a present EPT entry, then the shadow EPT entry has no chance
to sync guest EPT entry. According to the SDM,
"""
Software may use the INVEPT instruction after modifying a present EPT
paging-structure entry (see Section 28.2.2) to change any of the
privilege bits 2:0 from 0 to 1.1 Failure to do so may cause an EPT
violation that would not otherwise occur. Because an EPT violation
invalidates any mappings that would be used by the access that caused
the EPT violation (see Section 28.3.3.1), an EPT violation will not
recur if the original access is performed again, even if the INVEPT
instruction is not executed.
"""

Sync the afterthought of privilege bits from guest EPT entry to shadow
EPT entry to cover above case.

Tracked-On: #5923
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2021-07-02 09:24:12 +08:00
Shuo A Liu a431cff94e hv: Use 64 bits definition for 64 bits MSR_IA32_VMX_EPT_VPID_CAP operation
MSR_IA32_VMX_EPT_VPID_CAP is 64 bits. Using 32 bits MACROs with it may
cause the bit expression wrong.

Unify the MSR_IA32_VMX_EPT_VPID_CAP operation with 64 bits definition.

Tracked-On: #5923
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2021-07-02 09:24:12 +08:00
Shuo A Liu a65e01ae95 dm: Reset virtio device before release
With virtio polling mode enabled, a timer is running in the virtio
backend service. And the timer will also be triggered if its frondend
driver didn't do the device reset in shutdown. A freed virtio device
will be accessed in the polling timer handler.

Do the virtio reset() callback specifically to clear the polling timer
before the free.

Tracked-On: #6147
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
2021-07-02 09:12:42 +08:00
David B. Kinder 4f0b86adf9 doc: fix doc reference using symbolic link
enable_s5.rst has a couple of literalinclude directives referencing
sample scripts that were moved and now go through a symbolic link to the
new folder.  Symbolic links don't work on Windows, so change the
references in enable_s5.rst to not go through the symbolic link.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2021-06-29 19:15:33 -07:00
David B. Kinder 0c52b9601a doc: update known issues list in v2.5 release notes
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2021-06-28 18:16:05 -07:00
wenlingz 25a16663fa version: 2.6-unstable
Signed-off-by: wenlingz <wenling.zhang@intel.com>
2021-06-25 14:45:38 +08:00
David B. Kinder 62bad63afa doc: add 2.5 to version menu choice
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2021-06-24 21:22:23 -07:00
fuzhongl e8bd5acc8a Doc: release notes update
Adding known issue in release note.

Signed-off-by: fuzhongl <fuzhong.liu@eintel.com>
2021-06-24 19:51:39 -07:00
David B. Kinder b82b8073a9 doc: remove PTM tutorial for now
PTM feature postponed to v2.6 so remove documentation about enabling
this feature.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2021-06-24 18:53:22 -07:00
David Kinder 8d2f158d26
release notes edits (#6255)
- fix titles for fixed issues list
- edit what's new section to improve readability

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2021-06-24 16:39:32 -07:00
David B. Kinder 55644741fb doc: fix link in hardware doc
Links to UP2 Shop were incorrect

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2021-06-24 12:23:37 -07:00