Commit Graph

4439 Commits

Author SHA1 Message Date
Gao Junhao 70f2ee398b doc: add hostbridge emulation doc
add hostbridge emulation doc and entry

Signed-off-by: Gao Junhao <junhao.gao@intel.com>
2019-10-27 10:14:06 -04:00
Gao Junhao a7e34644d7 doc: add RTC emulation in hypervisor doc
add RTC emulation in hypervisor doc and add entry in hld-emulated-devices

Signed-off-by: Gao Junhao <junhao.gao@intel.com>
2019-10-27 09:58:17 -04:00
Gao Junhao bdc4a96f82 doc: add virtio-gpio doc
add virtio-gpio doc

Signed-off-by: Gao Junhao <junhao.gao@intel.com>
2019-10-27 09:18:02 -04:00
Deb Taylor 339e959962 Doc: remove tutorials/rt_linux.rst file
Signed-off-by: Deb Taylor <deb.taylor@intel.com>
2019-10-25 21:34:26 -04:00
lirui34 8695545d5a doc: Align the updates of rt gsg with 1.3
Need to align the rt gsg updates with 1.3 branch.

Signed-off-by: lirui34 <ruix.li@intel.com>
2019-10-25 16:58:33 -04:00
Gao Junhao 5e11b47d9d doc: add entry for passthru realization
add entry for passthru realization in device model

Signed-off-by: Gao Junhao <junhao.gao@intel.com>
2019-10-25 10:39:53 -04:00
Gao Junhao 016c624b4e doc: modify virtio-i2c doc path
move virtio-i2c doc from tutorials to developer-guilders/hld and add
entry for virtio-i2c in hld-virtio-devices

Signed-off-by: Gao Junhao <junhao.gao@intel.com>
2019-10-25 10:38:25 -04:00
Gao Junhao 69e7649560 doc: add UART emulation in hypervisor doc
add UART emulation in hypervisor doc

Signed-off-by: Gao Junhao <junhao.gao@intel.com>
2019-10-25 10:37:11 -04:00
Yuan Liu 395e54b1bc doc: add ahci virtualization introduction
Signed-off-by: Yuan Liu <yuan1.liu@intel.com>
2019-10-25 10:33:35 -04:00
Jason Chen CJ 0b00bbd65f document: update HLD for vm management
add VM state transition, and make this chapter into
part of hypervisor hld, the user level vm management
should be introduced in ACRN tools.

Tracked-On: #3882
Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
2019-10-25 10:31:51 -04:00
Kaige Fu d5c3523d30 hv: Update industry scenarios configuration
This patch makes the following changes:
  - Remove the 4th VM
  - Make the default vcpu num of RTVM as 2

---
  v1 -> v2: Modify CONFIG_MAX_VM_NUM to 3U + KATA

Tracked-On: #3925
Signed-off-by: Yan, Like <like.yan@intel.com>
Signed-off-by: Kaige Fu <kaige.fu@intel.com>
2019-10-25 15:23:16 +08:00
Victor Sun 6f7081f620 acrn-config: remove vm3 for industry scenario
The VM2 of INDUSTRY scenario need 2 vCPUs for performance, so there would
be no available pCPU for VM3, need to remove VM3 for this scenario.

Tracked-On: #3925

Signed-off-by: Victor Sun <victor.sun@intel.com>
2019-10-25 15:17:40 +08:00
Gao Junhao 9143e56336 dm: update ACPI with latest ASL standard
The device model generating ACPI table use the old ASL
standard(version:20190816), then the iasl in clearlinux(version:31360)
is 20191018, it can't disassemble the ACPI table compiled by old
standard.

Tracked-On: #3933
Signed-off-by: Gao Junhao <junhao.gao@intel.com>
Reviewed-by: Fengwei Yin <fengwei.yin@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2019-10-25 15:12:00 +08:00
Shuo A Liu 5f8e7a6cb7 hv: sched: add kick_thread to support notification
kick means to notify one thread_object. If the target thread object is
running, send a IPI to notify it; if the target thread object is
runnable, make reschedule on it.

Also add kick_vcpu API in vcpu layer to notify vcpu.

Tracked-On: #3813
Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
Signed-off-by: Yu Wang <yu1.wang@intel.com>
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-10-25 13:00:21 +08:00
Conghui Chen 810305be98 hv: sched: disable interrupt when grab schedule spinlock
After moving softirq to following interrupt path, softirq handler might
break in the schedule spinlock context and try to grab the lock again,
then deadlock.

Disable interrupt with schedule spinlock context.
For the IRQ disable/restore operations:
  CPU_INT_ALL_DISABLE(&rflag)
  CPU_INT_ALL_RESTORE(rflag)
each takes 50~60 cycles.

renaming: get_schedule_lock -> obtain_schedule_lock

Tracked-On: #3813
Signed-off-by: Conghui Chen <conghui.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-10-25 13:00:21 +08:00
Shuo A Liu 15c6a3e31f hv: sched: remove do_switch
Clean up do_swtich and do switch related things in schedule().

Tracked-On: #3813
Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
Signed-off-by: Yu Wang <yu1.wang@intel.com>
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-10-25 13:00:21 +08:00
Shuo A Liu f04c491259 hv: sched: decouple scheduler from schedule framework
This patch decouple some scheduling logic and abstract into a scheduler.
Then we have scheduler, schedule framework. From modulization
perspective, schedule framework provides some APIs for other layers to
use, also interact with scheduler through scheduler interaces.

Tracked-On: #3813
Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
Signed-off-by: Yu Wang <yu1.wang@intel.com>
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-10-25 13:00:21 +08:00
Shuo A Liu cad195c018 hv: sched: add pcpu_id in sched_control
To get pcpu_id from sched_control quickly and easier.

Tracked-On: #3813
Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
Signed-off-by: Yu Wang <yu1.wang@intel.com>
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
2019-10-25 13:00:21 +08:00
Peter Fang 84e5a8e894 OVMF release v1.4
- Add back USB keyboard support

Tracked-On: #3927
Signed-off-by: Peter Fang <peter.fang@intel.com>
2019-10-25 11:01:04 +08:00
Wei Liu feba836944 acrn-config: refine ttyS info of board file
The previous method to handle ttyS info has an assumption that PCI
serial devices are all mmio type, this caused incorrect BDF info in
board XML file.
This patch fix this issue by dropping serial device BDF info and
replace it with IO type.

Tracked-On: #3900
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-10-25 10:56:23 +08:00
Wei Liu b6a8052045 acrn-config: filter out the proper wifi/ethernet device
Filter out the wifi/ethernet device from webUI with below PCI device class coding rule:
ethernet: 0200/0280;
wifi: 0280/0d20/0d21/0d80;

Tracked-On: #3917
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-10-25 09:02:23 +08:00
Shuang Zheng defeb851bc acrn-config: fix the issue no error message in launch setting
fix the issue that there is no error message displayed in launch setting of WebUI.

Tracked-On: #3913
Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
Reviewed-by: Victor Sun <victor.sun@intel.com>
2019-10-25 09:02:23 +08:00
Wei Liu d9f0d8dcf0 acrn-config: fix the wrong 'key' type returned to webUI
Fix the wrong 'key' type of error list returned to webUI for parsing.

 Tracked-On: #3913
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-10-25 09:02:23 +08:00
Victor Sun e7134585b6 makefile: add dash support to build efi
Usually We use '==' or '=' to compare strings under sh environment,
but '==' is not supported by dash which is the default sh environment
on Ubuntu, this leads efi build failure with current makefile.

Change the '==' to '=' to support both bash and dash.

Tracked-On: #3779

Signed-off-by: Victor Sun <victor.sun@intel.com>
2019-10-25 09:01:55 +08:00
Wei Liu 9ea7a85ca5 acrn-config: set default package value for _S3 and _S5
Some BIOS does not support s3/s5, so there might be no _S3 or _S5
package in host ACPI table, previous code did not handle this, so
the build would be failed with the generated board file.
Set default s3/s5 package value to 0 for such case.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-10-24 15:13:51 +08:00
Wei Liu 24d3eaba27 acrn-config: skip git environment check when not do git commit
Check git environment only when '--enable_commit' option was set.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-10-24 15:13:51 +08:00
Wei Liu fbd8597fbf acrn-config: refine 'lpc' setting with console type
Refine 'lpc' setting for acrn-dm option.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-10-24 15:13:51 +08:00
Yonghua Huang 2e62ad9574 hv[v2]: remove registration of default port IO and MMIO handlers
- The default behaviors of PIO & MMIO handlers are same
   for all VMs, no need to expose dedicated APIs to register
   default hanlders for SOS and prelaunched VM.

Tracked-On: #3904
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2019-10-24 13:21:19 +08:00
Yuan Liu 73b8c91e06 Misc: lifemngr-daemon-on-UOS for windows
For cross-VM S5 notify via vUART, life_mngr service is running on UOS.
It is listening on COM2 to get SOS's commands.
The protocol is: SOS send "shutdown", UOS feedback "acked".

When SOS triggle shutdown, SOS can 1) check VM's status until UOS
stopped, 2) retry shutdown UOS normally with timeout.
So, no matter life_mngr server is running, SOS's shutdown procedure will
properly finish.

Tracked-On: #3564
Signed-off-by: Yuan Liu <yuan1.liu@intel.com>
2019-10-24 13:20:53 +08:00
Yonghua Huang 82a0d39e84 hv:fix reference to uninitialized variable in vmsi_remap()
'info.pmsi_addr' may be written to physicall device's
  PCI configuration field without initialization when
  'enable' is false in 'vmsi_remap()'.
  this patch is to fix above issues, 'PCIR_MSI_ADDR'
  and 'PCIR_MSI_ADDR_HIGH' only be programmed when
  'enable' is true.

Tracked-On: #3903
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2019-10-24 11:42:59 +08:00
Wei Liu 1c7bf9fd56 acrn-config: refine the vbootloader of vm
Refine the vbootloader type of vm,
The vbootloader type should be select from vsbl/ovmf/none in webUI item.

Tracked-On: #3879
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-10-24 11:42:27 +08:00
Wei Liu a71623595e acrn-config: add '--windows' option for WaaG vm
Add the '--windows' option to launch WaaG vm.

Tracked-On: #3880
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-10-24 11:40:17 +08:00
Mingqiang Chi 343aabca4b doc:Update hypercall and upcall
update hld for hypercall and upcall

Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
2019-10-23 20:35:30 -04:00
Kaige Fu 6f9367a50c Doc: Add ART virtualization hld
This patch adds ART virtualization hld.

Signed-off-by: Kaige Fu <kaige.fu@intel.com>
2019-10-23 20:33:48 -04:00
Yonghua Huang b3142e1600 doc: update hld-security verified boot section
1. Remove vSBL and ABL descriptions, which are absolete.
2. Add UEFI bootflow description.

Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
2019-10-23 20:32:09 -04:00
Tw edffde4e3c doc: update MSR virtualization in HLD
add some missing MSR virtualizations.

Tracked-On: #3882
Signed-off-by: Tw <wei.tan@intel.com>
2019-10-23 18:13:34 -04:00
Tw 227ee64b3b doc: update IO/MMIO HLD
remove unexisted APIs.

Tracked-On: #3882
Signed-off-by: Tw <wei.tan@intel.com>
2019-10-23 18:13:34 -04:00
Tw d541ee90a6 doc: update CR HLD
add missing bits in CR4 virtualization.

Tracked-On: #3882
Signed-off-by: Tw <wei.tan@intel.com>
2019-10-23 18:13:34 -04:00
Tw 050c0880c2 doc: update CPUID HLD
SGX virtualization has been implemented, update according CPUID leaf.

Tracked-On: #3882
Signed-off-by: Tw <wei.tan@intel.com>
2019-10-23 18:13:34 -04:00
Mingqiang Chi d81872ba18 hv:Change the function parameter for init_ept_mem_ops
Currently the parameter of init_ept_mem_ops is
'struct acrn_vm *vm' for this api,change it to
'struct memory_ops *mem_ops' and 'vm_id' to avoid
the reversed dependency, page.c is hardware layer and vm structure
is its upper-layer stuff.

Tracked-On: #1842
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Reviewed-by: Eddie Dong <eddie.dong@intel.com>
2019-10-23 12:48:30 +08:00
Shuo A Liu 0f70a5ca3a hv: sched: decouple idle stuff from schedule module
Let init thread end with run_idle_thread(), then idle thread take over and
start to do scheduling.
Change enter_guest_mode() to init_guest_mode() as run_idle_thread() is removed
out of it. Also add run_thread() in schedule module to run
thread_object's thread loop directly.

rename: switch_to_idle -> run_idle_thread

Tracked-On: #3813
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-10-23 12:47:08 +08:00
Shuo A Liu 27163df9b1 hv: sched: add sleep/wake for thread object
sleep one thread_object means to prevent it from being scheduled.
wake one thread_object is an opposite operation of sleep.
This patch also add notify_mode in thread_object to indicate how to
deliver the request.

Tracked-On: #3813
Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
Signed-off-by: Yu Wang <yu1.wang@intel.com>
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-10-23 12:47:08 +08:00
Shuo A Liu 9b8c6e6a90 hv: sched: add status for thread_object
Now, we have three valid status for thread_object:
	THREAD_STS_RUNNING,
	THREAD_STS_RUNNABLE,
	THREAD_STS_BLOCKED.
This patch also provide several helpers to check the thread's status and
a status set wrapper function.

Tracked-On: #3813
Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
Signed-off-by: Yu Wang <yu1.wang@intel.com>
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-10-23 12:47:08 +08:00
Shuo A Liu fafd5cf063 hv: sched: move schedule initialization to each pcpu init
schedule infrastructure is per pcpu, so move its initialization to each
pcpu's initialization.

Tracked-On: #3813
Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
Signed-off-by: Yu Wang <yu1.wang@intel.com>
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-10-23 12:47:08 +08:00
Shuo A Liu dadcdcefa0 hv: sched: support vcpu context switch on one pcpu
To support cpu sharing, multiple vcpu can run on same pcpu. We need do
necessary vcpu context switch. This patch add below actions in context
switch.
  1) fxsave/fxrstor;
  2) save/restore MSRs: MSR_IA32_STAR, MSR_IA32_LSTAR,
	MSR_IA32_FMASK, MSR_IA32_KERNEL_GS_BASE;
  3) switch vmcs.

Tracked-On: #3813
Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
Signed-off-by: Yu Wang <yu1.wang@intel.com>
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-10-23 12:47:08 +08:00
Shuo A Liu 7e66c0d4fa hv: sched: use get_running_vcpu to replace per_cpu vcpu with cpu sharing
With cpu sharing enabled, per_cpu vcpu cannot work properly as we might
has multiple vcpus running on one pcpu.
Add a schedule API sched_get_current to get current thread_object on
specific pcpu, also add a vcpu API get_running_vcpu to get corresponding
vcpu of the thread_object.

Tracked-On: #3813
Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
Signed-off-by: Yu Wang <yu1.wang@intel.com>
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-10-23 12:47:08 +08:00
Shuo A Liu 891e46453d hv: sched: move pcpu_id from acrn_vcpu to thread_object
With cpu sharing enabled, we will map acrn_vcpu to thread_object
in scheduling. From modulization perspective, we'd better hide the
pcpu_id in acrn_vcpu and move it to thread_object.

Tracked-On: #3813
Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
Signed-off-by: Yu Wang <yu1.wang@intel.com>
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-10-23 12:47:08 +08:00
Shuo A Liu f85106d1ed hv: Do not reset vcpu thread's stack when reset_vcpu
vcpu thread's stack shouldn't follow reset_vcpu to reset.
There is also a bug here:
while vcpu B thread set vcpu->running to false, other vcpu A thread
will treat the vcpu B is paused while it has not been switch out
completely, then reset_vcpu will reset the vcpu B thread's stack and
corrupt its running context.

This patch will remove the vcpu thread's stack reset from reset_vcpu.
With the change, we need do init_vmcs between vcpu startup address be
settled and scheduled in. And switch_to_idle() is not needed anymore
as S3 thread's stack will not be reset.

Tracked-On: #3813
Signed-off-by: Fengwei Yin <fengwei.yin@intel.com>
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
2019-10-23 12:47:08 +08:00
Deb Taylor 3072b6fc6d Doc: Grammar add for config tool doc
Signed-off-by: Deb Taylor <deb.taylor@intel.com>
2019-10-22 19:34:01 -04:00
lirui34 6f5dd2da20 doc: acrn_configuration_tool add one more scenario xml element description
Signed-off-by: lirui34 <ruix.li@intel.com>
2019-10-22 16:30:13 -04:00