Commit Graph

2650 Commits

Author SHA1 Message Date
Alek Du 31487e829c Makefile: keep files used for debug target
1. keep symbols files for debug usage
2. they are saved when build for rootfs.

Tracked-On: #2168
Signed-off-by: Alek Du <alek.du@intel.com>
Signed-off-by: Minggui Cao <minggui.cao@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2018-12-24 22:24:27 +08:00
Sainath Grandhi ef03385f42 hv: Write Buffer Flush - VT-d
This patch does the following changes
According to VT-d spec Section 6.8 "Write Buffer Flushing" DRAM write buffers
are flushed implicitly upon Remapping Hardware Caches Invalidation even on
platforms that set RWBF to 1 in capability register. So removed write buffer
flushing as current ACRN issues cache invalidation commands in all cases.

Tracked-On: #1855
Signed-off-by: Sainath Grandhi <sainath.grandhi@intel.com>
2018-12-24 22:18:30 +08:00
Shiqing Gao a5113d922d hv: remove duplicated `is_vmx_disabled`
This patch fixes the duplicated functions introduced by cpu caps
modularization.

In cpu caps modularization, function `is_vmx_disabled` was supposed
to be moved from `arch/x86/vmcs.c` to`arch/x86/cpu_caps.c`,
but the original one was not removed.

Tracked-On: #861
Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-12-24 14:04:55 +08:00
Huihuang Shi 1b37ed50d8 hv: vmcall: fix "goto detected" violations
Remove the goto by split the function into two,
dispatch_hypercall and vmcall_vmexit_handler.

Tracked-On: #861
Signed-off-by: Huihuang Shi <huihuang.shi@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-12-24 09:57:43 +08:00
Yin Fengwei f6ae835137 dm: flush the input/output during tty open.
Discard the input/output data when open tty file. To avoid the
mevent callback is triggered immediately when the fd is added to
epoll.

Also update the uart_drain only read the data from tty file when
fifo has available space.

Tracked-On: #2159
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2018-12-23 22:35:09 +08:00
yuhong.tao@intel.com 88a7d8b2cc hv: virq: refine vcpu_inject_hi_exception()
The MISRA-C Standards suggests use brackets to clarify the precedence
order of logical conjunctions.

Tracked-On: #861
Acked-by: Eddie Dong <eddie.dong@intel.com>
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
2018-12-23 22:32:51 +08:00
yuhong.tao@intel.com 3bfa695565 hv: virq: refine vcpu_inject_vlapic_int() has more than one exit point
The MISRA-C Standards suggests procedures to be single exit.

Tracked-On: #861
Acked-by: Eddie Dong <eddie.dong@intel.com>
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
2018-12-23 22:32:51 +08:00
Geoffroy Van Cutsem 9c97f6bec5 Documentation: split the build instructions into its own guide
Split the build instructions, and the hypervisor configuration instructions
into its own separate document.

Tracked-On: #2154
Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2018-12-21 10:01:13 -08:00
David B. Kinder c358d29c89 doc: fix vhm_request doxygen comment
Table contents weren't rendered correctly in
developer-guides/hld/hv-io-emulation.html, so
fix the doxygen comments.

Tracked-on: #1684

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-12-21 08:50:53 -08:00
Geoffroy Van Cutsem 01bc8e56f2 Documentation: fix formatting in partition mode tutorial
Fix the indentation to make a line part of the correct
paragraph (instead of having it erroneously displayed as
part of the previous code-block)

Tracked-On: #2031
Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2018-12-21 08:46:27 -08:00
Binbin Wu c3250030aa hv: vcpuid: remove unnecessary check code
The removed check code is not necessary.

Tracked-On: #861
Signed-off-by: Binbin Wu <binbin.wu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-12-21 19:44:20 +08:00
Binbin Wu 83f32c93f0 hv: vcpuid: leaf 02h has no subleaf, delete un-needed code.
According to SDM Vol. 2A 3-191 & Vol. 2A 3-213, leaf 02h has no subleaf.
This patch removes the un-needed code.

Tracked-On: #861
Signed-off-by: Binbin Wu <binbin.wu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-12-21 19:44:20 +08:00
Conghui Chen 44bee5168e dm: virtio: fix compile issue on ubuntu
As VIRTIO_CONFIG_S_NEEDS_RESET is not defined in standard virtio header
file on ubuntu, there will be compile issue. so add
VIRTIO_CONFIG_S_NEEDS_RESET to fix it.

Tracked-On: #2145
Signed-off-by: Conghui Chen <conghui.chen@intel.com>
Reviewed-by: Jian Jun Chen <jian.jun.chen@intel.com>
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
2018-12-21 19:43:16 +08:00
Li, Fei1 9fe282f080 hv: Makefile: remove unused MACRO
Remove unused MACRO in version.h

Tracked-On: #861
Signed-off-by: Li, Fei1 <fei1.li@intel.com>
2018-12-21 19:39:56 +08:00
Li, Fei1 cf47f6cff8 hv: coding style: refine the remaining functions to one exit point
Refine the remaining functions in the head file to one exit point

Tracked-On: #861
Signed-off-by: Li, Fei1 <fei1.li@intel.com>
2018-12-21 19:39:56 +08:00
Li, Fei1 36dcb0f605 hv: lib: refine inline assembly use in bitmap operation
Try to minimize the C code in inline assembly function. Now only
construct data structure and return a value is permitted.

Tracked-On: #861
Signed-off-by: Li, Fei1 <fei1.li@intel.com>
2018-12-21 19:39:56 +08:00
Shiqing Gao ddd07b955b hv: cpu_state_tbl: fix multiple exits
This patch fixes the MISRA-C violations in arch/x86/cpu_state_tbl.c
 * make the function have only one exit point

Tracked-On: #861
Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-12-21 16:19:09 +08:00
Shiqing Gao eb77e25ff9 hv: ept: fix MISRA-C violations
This patch fixes the MISRA-C violations in arch/x86/ept.c
* add local variable if the input parameter passed by value
  is changed in function definition
* remove the duplicated semi colon

Tracked-On: #861
Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-12-21 15:27:46 +08:00
Conghui Chen 5253ac7af5 dm: virtio: refine header file
Reuse linux common virtio header file and remove the repetitive
definition.

Tracked-On: #2145
Signed-off-by: Conghui Chen <conghui.chen@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-12-21 15:27:01 +08:00
Li, Fei1 738f2536fe hv: coding style: refine cpu related function to one exit
2) Fix procedure has more than one exit point.

Tracked-On: #861
Signed-off-by: Li, Fei1 <fei1.li@intel.com>
2018-12-21 13:34:01 +08:00
Jason Chen CJ 9672538c85 init: move init_scheduler into cpu.c
now init_scheduler should belong to and move to hwmgmt module

Tracked-On: #1842
Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
Acked-by: Eddie Dong <edide.dong@intel.com>
2018-12-21 10:34:15 +08:00
Jason Chen CJ ff0703dd40 scheduler: make scheduling based on struct sched_object
use struct sched_object as the main interface of scheduling, then
make scheduler as an independent module to vcpu:
- add struct sched_object as one field in struct vcpu
- define sched_object.thread for switch_to thread
- define sched_object.prepare_switch_out/in for prepare_switch before
  switch_to
- move context_switch_out/context_switch_in into vcpu.c as
  vcpu.sched_obj.prepare_switch_out/in
- make default_idle as global idle.thread for idle_thread
- make vcpu_thread as vcpu.sched_obj.thread for each vcpu thread
- simplify switch_to based on sched_object

Tracked-On: #1842
Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
Acked-by: Eddie Dong <edide.dong@intel.com>
2018-12-21 10:34:15 +08:00
Jason Chen CJ 8aae0dff87 scheduler: refine make_reschedule_request
just use pcpu_id for make_reschedule_request is enough

Tracked-On: #1842
Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
Acked-by: Eddie Dong <edide.dong@intel.com>
2018-12-21 10:34:15 +08:00
Jason Chen CJ 6d67364881 scheduler: refine runqueue related functions
add struct sched_object, and use it as input param instead of vcpu for
below functions:
- add_to_cpu_runqueue renamed from add_vcpu_to_runqueue
- remove_from_cpu_runqueue renamed from remove_vcpu_from_runqueue
- get_next_sched_obj added to get next sched object

Tracked-On: #1842
Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
Acked-by: Eddie Dong <edide.dong@intel.com>
2018-12-21 10:34:15 +08:00
Huihuang Shi 93e588bc7e hv: fix e820.c violations
fix e820.c violations related misra c.

Tracked-On: #861
Signed-off-by: Huihuang Shi <huihuang.shi@intel.com>
2018-12-21 10:33:32 +08:00
Tw 60f78e1e70 hv:vtd: fix MISRA-C violations on procedure has more than one exit point
This patch fix MISRA-C violations in arch/x86/vtd.c
on Procedure has more than one exit point.

Tracked-On: #861
Signed-off-by: Tw <wei.tan@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2018-12-21 10:32:53 +08:00
Tw a98a1a690c hv:vtd: fix MISRA-C violations on pointer not checked for null before use
This patch fix MISRA-C violations in arch/x86/vtd.c
on Pointer not checked for null before use.

Tracked-On: #861
Signed-off-by: Tw <wei.tan@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2018-12-21 10:32:53 +08:00
Tw 725e1921e5 hv:vtd: fix MISRA-C violations on comment possibly contains code
This patch fix MISRA-C violations in arch/x86/vtd.c
on Comment possibly contains code.

Tracked-On: #861
Signed-off-by: Tw <wei.tan@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2018-12-21 10:32:53 +08:00
Tw 897ffa2739 hv:vtd: fix MISRA-C violations on logical conjunctions need brackets
This patch fix MISRA-C violations in arch/x86/vtd.c
on logical conjunctions need brackets.

Tracked-On: #861
Signed-off-by: Tw <wei.tan@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2018-12-21 10:32:53 +08:00
Tw 80b392a854 hv:vtd: fix MISRA-C violations on pointer param should be declared pointer to const
This patch fix MISRA-C violations in arch/x86/vtd.c
on pointer param should be declared pointer to const.

Tracked-On: #861
Signed-off-by: Tw <wei.tan@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2018-12-21 10:32:53 +08:00
Tw 5282fa899d hv:vtd: fix MISRA-C violations on scope of variable could be reduced
This patch fix the MISRA-C violations in arch/x86/vtd.c
on scope of variable could be reduced.

Tracked-On: #861
Signed-off-by: Tw <wei.tan@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2018-12-21 10:32:53 +08:00
Arindam Roy bec21d147b Patch for modularising ioapic.[c/h] and related files.
This adds few functions to access the daata structures
defined inside ioapic.c. Removes the same data structures
from ioapic.h
Also this modifies some of the names of existing APIs to
conform to the ioapic module name.
Modified gsi_table identifier to gs_table_data, to avoid
a MISRA C Violation.

Tracked-On: #1842
Signed-off-by: Arindam Roy <arindam.roy@intel.com>
2018-12-21 09:58:25 +08:00
David B. Kinder af9b747629 doc: fix formatting in NUC GSG
A stray empty code block is removed, along with trailing spaces

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-12-20 12:08:56 -08:00
Minggui Cao 61f03dae81 DOC: change PCI uart description from mmio to bdf
HV code changed to configure PCI uart mmio@ to bdf@,
so change its description to match it.

Tracked-On: #2031
Signed-off-by: Minggui Cao <minggui.cao@intel.com>
2018-12-20 11:53:13 -08:00
Shiqing Gao 50f5b0f6bb hv: vmexit: fix MISRA-C violations related to multiple exits
This patch fixes the MISRA-C violations in arch/x86/vmexit.c
 * make the function have only one exit point

Tracked-On: #861
Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-12-20 23:05:13 +08:00
Li, Fei1 0a713e6fbc hv: coding style: refine set_vcpuid_entries to one exit
Fix procedure has more than one exit point.

Tracked-On: #861
Signed-off-by: Li, Fei1 <fei1.li@intel.com>
2018-12-20 22:07:53 +08:00
Li, Fei1 a56abee9ff hv: coding style: refine find_vcpuid_entry
1) add local_find_vcpuid_entry to find whether a cpuid leaf exist
in vcpuid cache entries.
2) find_vcpuid_entry will return the found entry if local_find_vcpuid_entry
return is not null. Otherwise, call local_find_vcpuid_entry again
when necessary.
In this case, there could eliminate recursion in find_vcpuid_entry.

Tracked-On: #861
Signed-off-by: Li, Fei1 <fei1.li@intel.com>
2018-12-20 22:07:53 +08:00
Minggui Cao 58d2a418d5 HV: fix pm code for multi-exits & unsigned const
1. change multi "return" to one exit.
2. add "U" to unsigned const as postfix.

Tracked-On: #861
Signed-off-by: Minggui Cao <minggui.cao@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2018-12-20 21:56:48 +08:00
totoroow 97a7395183 dm: pass mac seed not to use vm name on UP2
Physical NIC mac address is used for generate UOS mac address.
This patch uses a new parameters to pass this information
instead of vm name.

Tracked-On: #1987
Signed-off-by: Tw <wei.tan@intel.com>
Reviewed-by: Jie Deng <jie.deng@intel.com>
Reviewed-by: Binbin Wu <binbin.wu@intel.com>
2018-12-20 21:55:28 +08:00
Li, Fei1 1c99a975ea hv: coding style: refine trusty
Refine the reminding part: fix procedure has more than one exit point.

Tracked-On: #2120
Signed-off-by: Li, Fei1 <fei1.li@intel.com>
2018-12-20 21:53:51 +08:00
Li, Fei1 1dca17cd29 hv: coding style: refine initialize_trusty to one exit
1) Move data copy out of initialize_trusty
2) Fix procedure has more than one exit point

Tracked-On: #2120
Signed-off-by: Li, Fei1 <fei1.li@intel.com>
2018-12-20 21:53:51 +08:00
Li, Fei1 8a55f03823 hv: coding style: refine hcall_initialize_trusty to one exit
Fix procedure has more than one exit point.

Tracked-On: #2120
Signed-off-by: Li, Fei1 <fei1.li@intel.com>
2018-12-20 21:53:51 +08:00
Xiaoguang Wu 1d1d24345f DM USB: xHCI: change log level of some logs for S3 online debugging
S3 emulation is complicated and greatly dependent on system timing,
hence this patch changes log level for some important logs to help
online debugging (could output log by modifing launch_uos.sh and
without re-compiling)

Tracked-On: #1893
Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Reviewed-by: Liang Yang <liang3.yang@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-12-20 20:22:25 +08:00
Li, Fei1 5f0c093e57 hv: coding style: remove no real declaration for external variable
There is no no real declaration for these external variables. So just
remove them.

Tracked-On: #861
Signed-off-by: Li, Fei1 <fei1.li@intel.com>
2018-12-20 20:20:08 +08:00
Kaige Fu 1e3358fd92 Debug: Add one hypercall to quary hardware info
acrntrace/log kernel modules will use this hypercall to fetch
pcpu num of hardware platform. Then, initialize driver accordingly.

Tracked-On: #1775;#1776
Signed-off-by: Kaige Fu <kaige.fu@intel.com>
Reviewed-by: Yan, Like <like.yan@intel.com>
2018-12-20 18:48:38 +08:00
Mingqiang Chi 81a9de6067 hv:fix MISRA-C violations in create_vm
-- fix "more than one exit point" and "goto detected" violations
-- change prepare_vm0_memmap to void type
-- Add free_vm_id when create vm failed

Tracked-On: #861
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2018-12-20 18:47:57 +08:00
Zide Chen bb47184f3c hv: fix enable_msr_interception() function
Fixed three MISRA-C violations:
11S: No brackets to loop body
7C: Procedure has more than one exit point.
8D: DD data flow anomalies found.
  initialize read_map and write_map in the declaration statements.

Fixed one bug:
Use "msr <= 0x1FFFU" instead of "msr < 0x1FFFU" because 0x1FFF is a valid MSR
bitmap address.

Tracked-On: #861
Signed-off-by: Zide Chen <zide.chen@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2018-12-20 18:46:19 +08:00
Shiqing Gao 56af4332e3 hv: io: fix MISRA-C violations related to multiple exits
This patch fixes the MISRA-C violations in arch/x86/io.c.
 * make the function have only one exit point

v1 -> v2:
 * replace `ASSERT` with `pr_err`

Tracked-On: #861
Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-12-20 18:45:21 +08:00
Shiqing Gao c03bad1fef hv: io: fix MISRA-C violations related to style
This patch fixes the MISRA-C violations in arch/x86/io.c.
 * add the required brackets for logical conjunctions
 * add the required 'else' for 'if ... else if' case

Tracked-On: #861
Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-12-20 18:45:21 +08:00
Li, Fei1 f27aa70fb5 hv: coding style: refine page related
1) Fix procedure has more than one exit point.
2) Add some brackets to make logical conjunctions more readable.

Tracked-On: #861
Signed-off-by: Li, Fei1 <fei1.li@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2018-12-20 15:44:08 +08:00