Commit Graph

4153 Commits

Author SHA1 Message Date
dongshen a1ef0ab9d9 hv: move ACPI related defines/structs to acpi.h
Currently ACPI related defines/structs are scattered across multiple C
source files, move them into acpi.h so that they can be shared and used by
vacpi code (to be added in subsequent commits).

Tracked-On: #3601
Signed-off-by: dongshen <dongsheng.x.zhang@intel.com>
Reviewed-by: Eddie Dong <eddie.dong@intel.com>
2019-08-29 10:12:25 +08:00
Deb Taylor 6ca4095d9c Update pages with missing links
Signed-off-by: Deb Taylor <deb.taylor@intel.com>
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-08-28 09:37:15 -07:00
Geoffroy Van Cutsem cc1dd6da86 doc: add "-f/--force' optional arg to 'acrnctl' documentation
Add the new and optional "-f/--force" flag to the 'acrnctl'
documentation.

Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2019-08-28 12:54:37 +02:00
Conghui Chen 2d57c5feb7 dm: virtio-console: add subclass
Add subclass for virtio-console pci device. Without the subclass, the
device may be probed by 8250_pci serial driver,  and lead to segment
fault in acrn-dm. This issue appears when running debian as Guest OS.

But there is a potential issue, if a new serial driver, which use class
and subclass same as virtio-console, the problem may still trigger. Need
to fix it case by case.

Tracked-On: #3615
Signed-off-by: Conghui Chen <conghui.chen@intel.com>
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
2019-08-27 09:47:00 +08:00
Yin Fengwei 66056c1acb dm: bzimage loader: get linux bzimage setup_sects from header
According to $(LINUX_SRC)/Documentation/x86/boot.txt, the header
of bzimage has setup sector number in offset 0x1f1. We don't
need to scan the SETUP_SIG and detect the setup sector number
actually which is not documented in x86 boot protocol.

Tracked-On: #3619
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2019-08-27 09:46:23 +08:00
Xiaoguang Wu fc3d19bee4 DM USB: fix potential crash risk due to null pointer
Fix potential risk to crash due to null pointer.

Tracked-On: #3612
Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2019-08-26 14:17:49 +08:00
Binbin Wu 4a71a16a13 hv: vtd: remove global cache invalidation per vm
Cacheline is flushed on EPT entry change, no need to invalidate cache globally
when VM created per VM.

Tracked-On: #3607
Signed-off-by: Binbin Wu <binbin.wu@intel.com>
Reviewed-by: Anthony Xu <anthony.xu@intel.com>
2019-08-26 10:47:17 +08:00
Binbin Wu 5c81659713 hv: ept: flush cache for modified ept entries
EPT tables are shared by MMU and IOMMU.
Some IOMMUs don't support page-walk coherency, the cpu cache of EPT entires
should be flushed to memory after modifications, so that the modifications
are visible to the IOMMUs.

This patch adds a new interface to flush the cache of modified EPT entires.
There are different implementations for EPT/PPT entries:
- For PPT, there is no need to flush the cpu cache after update.
- For EPT, need to call iommu_flush_cache to make the modifications visible
to IOMMUs.

Tracked-On: #3607
Signed-off-by: Binbin Wu <binbin.wu@intel.com>
Reviewed-by: Anthony Xu <anthony.xu@intel.com>
2019-08-26 10:47:17 +08:00
Binbin Wu 2abd8b34ef hv: vtd: export iommu_flush_cache
VT-d shares the EPT tables as the second level translation tables.
For the IOMMUs that don't support page-walk coherecy, cpu cache should
be flushed for the IOMMU EPT entries that are modified.

For the current implementation, EPT tables for translating from GPA to HPA
for EPT/IOMMU are not modified after VM is created, so cpu cache invlidation is
done once per VM before starting execution of VM.
However, this may be changed, runtime EPT modification is possible.

When cpu cache of EPT entries is invalidated when modification, there is no need
invalidate cpu cache globally per VM.

This patch exports iommu_flush_cache for EPT entry cache invlidation operations.
- IOMMUs share the same copy of EPT table, cpu cache should be flushed if any of
  the IOMMU active doesn't support page-walk coherency.
- In the context of ACRN, GPA to HPA mapping relationship is not changed after
  VM created, skip flushing iotlb to avoid potential performance penalty.

Tracked-On: #3607
Signed-off-by: Binbin Wu <binbin.wu@intel.com>
Reviewed-by: Anthony Xu <anthony.xu@intel.com>
2019-08-26 10:47:17 +08:00
Jack Ren 826aaf7bab version: 1.3-unstable
Signed-off-by: Jack Ren <jack.ren@intel.com>
2019-08-24 09:35:51 +08:00
lirui34 48d06da743 doc: Add three known issues to the v1.2 release notes
Add three known issues to the v1.2 release notes.

Signed-off-by: lirui34 <ruix.li@intel.com>
2019-08-23 19:50:42 +08:00
Mingqiang Chi 2310d99ebf hv: cleanup vmcs.h
-- move 'RFLAGS_AC' to cpu.h
-- move 'VMX_SUPPORT_UNRESTRICTED_GUEST' to msr.h
   and rename it to 'MSR_IA32_MISC_UNRESTRICTED_GUEST'
-- move 'get_vcpu_mode' to vcpu.h
-- remove deadcode 'vmx_eoi_exit()'

Tracked-On: #1842
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-08-22 14:13:15 +08:00
Mingqiang Chi bd09f471a6 hv:move some APIs related host reset to pm.c
move some data structures and APIs related host reset
from vm_reset.c to pm.c, these are not related with guest.

Tracked-On: #1842
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
2019-08-22 14:09:18 +08:00
Victor Sun 2736b6c4cd HV: add vCOM2 setting for hybrid and industry scenario
The vCOM2 of each VM is designed for VM communication, one VM could send
command or request to another VM through this channel. The feature will
be used for system S3/S5 implementation.

On Hybird scenario, vCOM2 of pre-launched VM will connect to vCOM2 of SOS_VM;
On Industry scenario, vCOM2 of post-launched RTVM will connect to vCOM2 of
SOS_VM.

Tracked-On: #3602

Signed-off-by: Victor Sun <victor.sun@intel.com>
Reviewed-by: Eddie Dong <eddie.dong@intel.com>
2019-08-22 13:12:54 +08:00
Victor Sun c8cdc7e807 HV: move vCOM setting from Kconfig to board configs
The settings of SOS VM COM1 which is used for console is board specific,
and this result in SOS VM COM2 which used for VM communication is also
board specific, so move the configure method from Kconfig to board configs
folder. The MACRO definition will be handled by acrn-config tool in future.

Tracked-On: #3602

Signed-off-by: Victor Sun <victor.sun@intel.com>
Reviewed-by: Eddie Dong <eddie.dong@intel.com>
2019-08-22 13:12:54 +08:00
Yan, Like 5dd07f7113 doc: remove "pincpu" option description
Update the document becase the "pincpu" option is removed.

Tracked-On: #3600
Signed-off-by: Yan, Like <like.yan@intel.com>
2019-08-22 13:06:28 +08:00
Yan, Like 2fab3c5198 dm: remove unsupported "pincpu" option
ACRN-DM does not support "pincpu" option to pin 'vcpu' to 'hostcpu', ACRN support vcpu to pcpu static mapping
via vm_config.
This commit removes the "pincpu" option.

Tracked-On: #3600
Signed-off-by: Yan, Like <like.yan@intel.com>
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
2019-08-22 13:06:28 +08:00
Victor Sun 1399f47987 doc: update partition desc for up2 board
modify partition desc table of up2 board to make it consistent with
launch uos script.

Signed-off-by: Lei Lu <leix.lu@intel.com>
Signed-off-by: Victor Sun <victor.sun@intel.com>
2019-08-22 09:10:38 +08:00
Victor Sun 4709554af9 DM: set data partition of apl-up2 to mmcblk0p1
mmcblk0p3 will be reserved for sos rootfs, so use mmcblk0p1 for data partion.

Tracked-On: #3214

Signed-off-by: Victor Sun <victor.sun@intel.com>
2019-08-22 09:10:38 +08:00
Victor Sun 5a1842afb8 HV: set sos root dev of apl-up2 to mmcblk0p3
Set sos root device of apl-up2 to mmcblk0p3 and let UP2 uefi variant
and sbl variant share one config for now.

Tracked-On: #3214

Signed-off-by: Victor Sun <victor.sun@intel.com>
2019-08-22 09:10:38 +08:00
Victor Sun 6c99f76404 HV: prepare ve820 for apl up2
We need ve820 table to enable prelaunched VM for apl-up2 board;

Tracked-On: #3214

Signed-off-by: Victor Sun <victor.sun@intel.com>
2019-08-22 09:10:38 +08:00
Yuan Liu 3cc0eabac6 dm: pm: support control method power button
ACPI supports two ways for power button device, one of them is control
method, and its _HID object is PNP0C0C.

If power button mediator doesn't scan power button from LNXPWRBN node
try to scan PNP0C0C node instead.

v2): Move the functions of openning fixed/control method power button to open_native_power_button

Tracked-On: #3594
Signed-off-by: Yuan Liu <yuan1.liu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2019-08-20 09:27:32 +08:00
Yin Fengwei 6beb34c3cb vm_load: update init gdt preparation
Now, we use native gdt saved in boot context for guest and assume
it could be put to same address of guest. But it may not be true
after the pre-launched VM is introduced. The gdt for guest could
be overwritten by guest images.

This patch make 32bit protect mode boot not use saved boot context.
Insteadly, we use predefined vcpu_regs value for protect guest to
initialize the guest bsp registers and copy pre-defined gdt table
to a safe place of guest memory to avoid gdt table overwritten by
guest images.

Tracked-On: #3532

Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-08-20 09:22:20 +08:00
Yonghua Huang 700a37856f hv: remove 'flags' field in struct vm_io_range
Currently, 'flags' is defined and set but never be used
  in the flow of handling i/o request after then.

Tracked-On: #861
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-08-19 10:19:54 +08:00
Conghui Chen eab4e42e7b hv: enable console vuart in industry scenario
Enable console vuart for the reset of VMs in industry scenario.

Tracked-On: #3370
Signed-off-by: Conghui Chen <conghui.chen@intel.com>
Reviewed-by: Eddie Dong <eddie.dong@intel.com>
2019-08-19 08:54:25 +08:00
fuzhongl c7f569da30 HV: switch launch LaaG with OVMF by default
OVMF will open source for V1.2, so enable launch LaaG with OVMF.

Tracked-On: #3506
Reviewed-by: Binbin Wu <binbin.wu@intel.com>
Signed-off-by: fuzhongl <fuzhong.liu@intel.com>
2019-08-19 08:53:39 +08:00
David B. Kinder 4d4c4e7b68 doc: remove modernizr.min.js
modernizr.min.js is no longer used by Sphinx's rtd theme and is causing
some browsers to have a noticable flash when pages are loaded. While we
can't easily remove it from the RTD theme, we can replace the script
with an empty file instead.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-08-16 15:36:46 -07:00
Yonghua Huang f791574f0e hv: refine the function pointer type of port I/O request handlers
In the definition of port i/o handler, struct acrn_vm * pointer
 is redundant as input, as context of acrn_vm is aleady linked
 in struct acrn_vcpu * by vcpu->vm, 'vm' is not required as input.

 this patch removes argument '*vm' from 'io_read_fn_t' &
 'io_write_fn_t', use '*vcpu' for them instead.

Tracked-On: #861
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
2019-08-16 11:44:27 +08:00
Jie Deng 866935a53f hv: vcr: check guest cr3 before loading pdptrs
Check whether the address area pointed by the guest
cr3 is valid or not before loading pdptrs. Inject #GP(0)
to guest if there are any invalid cases.

Tracked-On: #3572
Signed-off-by: Jie Deng <jie.deng@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-08-16 11:43:17 +08:00
David B. Kinder 5b5efe7193 doc: add v1.2 to the release navigation picker
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-08-15 09:50:33 -07:00
David B. Kinder 7131b19f4a doc: remove references to 2.0 in intro
While we internally call the "new" ACRN architecture 2.0, it could be
confusing to users since we also are calling the upcoming release v1.2
and there is no 2.0 release yet.  Remove references to 2.0 in the
introduction.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-08-15 09:41:23 -07:00
lirui34 27b7cc23ea doc: Release Notes v1.2
Add release notes v1.2

Signed-off-by: lirui34 <ruix.li@intel.com>
2019-08-15 09:23:40 -07:00
David B. Kinder e77d1d7343 doc: add new scenario-based intro
Add the scenario configurations to the ACRN introduction.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-08-15 09:16:24 -07:00
Deb Taylor a5647e9edf Content edits
Signed-off-by: Deb Taylor <deb.taylor@intel.com>
2019-08-14 21:09:49 -07:00
huihuang.shi f147c388a5 hv: fix Violations touched ACRN Coding Guidelines
fix violations touched below:
1.Cast operation on a constant value
2.signed/unsigned implicity conversion
3.return value unused.

V1->V2:
1.bitmap api will return boolean type, not need to check "!= 0", deleted.
2.The behaves ~(uint32_t)X and (uint32_t)~X are not defined in ACRN hypervisor Coding Guidelines,
removed the change of it.
Tracked-On: #861
Signed-off-by: Huihuang Shi <huihuang.shi@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2019-08-15 09:47:11 +08:00
Yuan Liu f1b71d983a dm: expand default WaaG memory to 4G
This patch is used to expand WaaG memory from 2G to 4G in launch script.

Tracked-On: #3576
Signed-off-by: Yuan Liu <yuan1.liu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2019-08-14 16:10:03 +08:00
Shiqing Gao 062fe19800 hv: move vmx_rdmsr_pat/vmx_wrmsr_pat from vmcs.c to vmsr.c
This patch moves vmx_rdmsr_pat/vmx_wrmsr_pat from vmcs.c to vmsr.c,
so that these two functions would become internal functions inside
vmsr.c.
This approach improves the modularity.

v1 -> v2:
 * remove 'vmx_rdmsr_pat'
 * rename 'vmx_wrmsr_pat' with 'write_pat_msr'

Tracked-On: #1842
Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
2019-08-14 10:51:35 +08:00
David B. Kinder 9144c56771 doc: incorporate new scenario-based hardware doc
Changing from just describing the supported hardware to a new hardware
support matrix based on the usage scenarios.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-08-13 18:30:25 -07:00
Tianhua Sun 9c48fc4ac5 hv: fix failed to build release version build with Kconfig setting
Hardcode "RELEASE=0" will cause the value of "CONFIG_RELEASE"
to be 'n' in kconfig.mk, it will be overwritten "CONFIG_RELEASE"
with Kconfig setting.

Tracked-On: #3565
Signed-off-by: Tianhua Sun <tianhuax.s.sun@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2019-08-14 08:52:59 +08:00
yunzha4x bbf4df7bf7 doc: update Getting started guide for Intel NUC software setup
Signed-off-by: yunzha4x <yunx.zhang@intel.com>
2019-08-13 14:59:00 -07:00
yunzha4x 02073a2d72 doc: update Getting started guide for Intel NUC software setup
Signed-off-by: yunzha4x <yunx.zhang@intel.com>
2019-08-13 14:59:00 -07:00
yunzha4x b06c84ba1f doc:update Getting started guide for Intel NUC software setup
Signed-off-by: yunzha4x <yunx.zhang@intel.com>
2019-08-13 14:59:00 -07:00
Lei Lu bf1a162c3e doc: update Using SBL on UP2 Board
1. The origin clearlinux version 29070 in this doucment example is not
   workable with acrn latest code, update the clearlinux version.
2. Replace the sos_console_login.png with vm_console_login.png

Signed-off-by: Lei Lu <leix.lu@intel.com>
2019-08-13 14:30:16 -07:00
Shiqing Gao c3001e61a2 doc: add limitation for UEFI services
- add limitation for UEFI services

Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
2019-08-13 14:29:20 -07:00
Tonny Tzeng 0a067a833f make: white-list SBL firmware boards
The top-level Makefile white-lists BOARDs require to generate UEFI
executable, but more UEFI BOARDs have been supported since then.
As a result, the build instructions in existing documents may not be
sufficient for those new BOARD targets, if the reader misses to supply
the FIRMWARE variable while building the hypervisor.

Instead of adding new UEFI BOARD types using the original long if-else
statements, I'd like to propose to white-list SBL BOARD types, and add
the new SBL BOARD types to the list while needed.

Tracked-On: #3541
Signed-off-by: Tonny Tzeng <tonny.tzeng@intel.com>
Reviewed-by: Binbin Wu <binbin.wu@intel.com>
2019-08-12 11:24:55 +08:00
Li, Fei1 d82a00a128 hv: vpci: remove pBDF configure for emulated device
Since now we use vBDF to search the device for PCI vdev.

Tracked-On: #3475
Signed-off-by: Li, Fei1 <fei1.li@intel.com>
2019-08-12 10:00:44 +08:00
Li, Fei1 90480db553 hv: vpci: split vPCI device from SOS for post-launched VM
When assgined a PCI PTDev to post-launched VM from SOS, using a pointer to point to
the real struct pci_vdev. When post-launched VM access its PTDev configure space in
SOS address space, using this real struct pci_vdev.

Tracked-On: #3475
Signed-off-by: Li, Fei1 <fei1.li@intel.com>
2019-08-12 10:00:44 +08:00
Deb Taylor 13de9a4cf6 Formatting for new Hardware Support page 2019-08-09 16:58:20 -07:00
lirui34 70e1e8d154 doc: hybrid mode scenario introduction
Add introduction about how to enable hybrid mode scenario.

Signed-off-by: lirui34 <ruix.li@intel.com>
2019-08-09 16:32:13 -07:00
Li, Fei1 4c8e60f1d0 hv: vpci: add each vdev_ops for each emulated PCI device
Add a field (vdev_ops) in struct acrn_vm_pci_dev_config to configure a PCI CFG
operation for an emulated PCI device. Use pci_pt_dev_ops for PCI_DEV_TYPE_PTDEV
by default if there's no such configure.

Tracked-On: #3475
Signed-off-by: Li, Fei1 <fei1.li@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-08-09 14:19:49 +08:00