Commit Graph

3003 Commits

Author SHA1 Message Date
Li, Fei1 0c27c9586b hv: security: remove superfluous prototype
An external object or function shall be declared once in one and only one file.
Since it already declared in include/arch/x86/security.h, we shall remove it.

Tracked-On: #861
Signed-off-by: Li, Fei1 <fei1.li@intel.com>
2019-01-14 15:33:05 +08:00
Shiqing Gao d5052abff9 hv: string: rename `s1` and `s2`
Commit 005546 introduces some functions like s0, s1, s2.
This patch renames `s1` and `s2` in string.c to avoid the name conflict.

Tracked-On: #861
Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
2019-01-14 15:08:44 +08:00
Geoffroy Van Cutsem c11090215d Update doc/developer-guides/GVT-g-kernel-options.rst
Co-Authored-By: dbkinder <david.b.kinder@intel.com>
2019-01-13 22:56:58 -08:00
Geoffroy Van Cutsem d998170f17 Update doc/developer-guides/GVT-g-kernel-options.rst
Co-Authored-By: dbkinder <david.b.kinder@intel.com>
2019-01-13 22:56:58 -08:00
David B. Kinder a6cef1095f doc: add GVT-g kernel options doc
Update developer docs with a new GVT-g kernel options document. Update
existing docs with referenced labels.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-01-13 22:56:58 -08:00
yuhong.tao@intel.com 270d2d2727 hv: virq: fix attempt to change parameter passed by value
The MISRA C stardand do not allow change parameter passed by value

Tracked-On: #861
Acked-by: Eddie Dong <eddie.dong@intel.com>
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
2019-01-14 10:34:12 +08:00
Mingqiang Chi dbd5c1415e hv:fix MISRA-C violation in multiboot.c
fix this violation "Value is not of appropriate type"
in get_kernel_load_addr()

Tracked-On: #861
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
2019-01-14 08:56:32 +08:00
Zide Chen 92d7018249 hv: fix 2 minor MISRA-C violations in inst_emul.c
Signed integral type cast to unsigned. :  (unsigned long and long)

Tracked-On: #861
Signed-off-by: Zide Chen <zide.chen@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2019-01-12 10:04:51 +08:00
Zide Chen 3a5b5b084f hv: fix MISRA-C violations in vpic.c and vioapic.c
120D: Pointer param should be declared pointer to const.
  add 'const' qualifier to function signatures when it's possible.
  - vioapic_set_irqline_nolock()
  - vioapic_set_irqline_lock()
  - master_pic()
  - vpic_ocw2()
  - vpic_ocw3()
  - vpic_set_irqline()
  - vpic_get_irqline_trigger_mode()
  - vm_pic()
  - vm_ioapic

93S: Value is not of appropriate type.
  change '0' to '0U' in function vpic_icw1().

Tracked-On: #861
Signed-off-by: Zide Chen <zide.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-01-11 23:04:54 +08:00
Li, Fei1 f582556865 hv: instr_emul: add `const` qualifier for some function
Add `const` qualifier for is_desc_valid and vie_calculate_gla

Tracked-On: #861
Signed-off-by: Li, Fei1 <fei1.li@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-01-11 21:53:41 +08:00
Li, Fei1 5e38e0ffd6 hv: instr_emul: refine decode_prefixes to one exit point
Misra C requires Function must have only one return entry.

Tracked-On: #861
Signed-off-by: Li, Fei1 <fei1.li@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-01-11 21:53:41 +08:00
Li, Fei1 433a492a4e hv: instr_emul: remove goto in get_gva_di_check
remove goto statement in get_gva_di_check() routine

Tracked-On: #861
Signed-off-by: Li, Fei1 <fei1.li@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-01-11 21:53:41 +08:00
Li, Fei1 cd85115ec9 hv: instr_emul: refine vie_calculate_gla to void
It always return zero, so there is no need to check the return vaule from it.
Just refine it to void.

Tracked-On: #861
Signed-off-by: Li, Fei1 <fei1.li@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-01-11 21:53:41 +08:00
Shiqing Gao 4b7fe2e215 hv: init: minor fix related to header file
Header file shall not be included multiple times.
The following prototype shall be used.

        #ifndef INIT_H
        #define INIT_H

        /* body */

        #endif /* INIT_H*/

Tracked-On: #861
Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
2019-01-11 21:53:09 +08:00
Chen Gang G 0055462237 hv: fix MISRAC violations for crypto lib
-Remove upper case
 -Modify/fix code style violations
 -fix value need U suffix
 -Assignment operation in expression
 -remove function like macros

 v1->v2 fix assignment operation in expression
 v2->v3 fix function like macros

Tracked-On: #861
Signed-off-by: Chen Gang G <gang.g.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-01-11 21:52:31 +08:00
Huihuang Shi 11f0f72627 hv:fix violations
fix
1."Value is not of appropriate type."
2."Function prototype/defn param type mismatch"

Tracked-On: #861
Signed-off-by: Huihuang Shi <huihuang.shi@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-01-11 16:52:28 +08:00
Xie, nanlin a943e56e0b Doc: Add release note for v0.5 release.
Signed-off-by: Xie, nanlin <nanlin.xie@intel.com>
2019-01-10 22:58:00 -08:00
Zide Chen 12211fb67b hv: fix MISRA-C violations in dm/vpci
120D: Pointer param should be declared pointer to const.
  Add 'const' qualifier to function parameters whenever it's possible:
    alloc_pci_vdev()
    enumerate_pci_dev()
    pci_scan_bus()
    pci_enumeration_cb()
    partition_mode_vpci_init()
    partition_mode_vpci_deinit()
    sharing_mode_vpci_init()
    sharing_mode_vpci_deinit()
    vpci_cleanup()

45D: Pointer not checked for null before use.
  Check pointer vm in vpci_reset_ptdev_intr_info() before using it.

Tracked-On: #861
Signed-off-by: Zide Chen <zide.chen@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2019-01-11 14:28:45 +08:00
Xie Zhengtian 4cfc259792 doc: update some statements 2019-01-10 21:16:55 -08:00
root 1e1db99753 doc: supported KBL NUC added 2019-01-10 21:16:55 -08:00
Shiqing Gao fae6cbf194 doc: add more rules in coding guidelines
This patch adds more rules in coding guidelines.

Tracked-On: #861
Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
2019-01-10 21:03:51 -08:00
Yuan Liu 62e058a001 DM: mei: solving the issue of closing the fd
The issue leads that the IOC mediator's fd is turned off
incorrectly, causing the IOC mediator to fail.

The root cause is because after closing fd is not set
to an invalid fd.

The issue can be reproduced by the S3 stress test.

Tracked-On: #2301
Signed-off-by: Yuan Liu <yuan1.liu@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2019-01-11 11:26:42 +08:00
Victor Sun 404fd9c935 HV: rename cb2_dnv to dnv_cb2
This will be consistent with naming of apl-mrb/kbl-nuc ...

Tracked-On: #2291

Signed-off-by: Victor Sun <victor.sun@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-01-11 10:55:14 +08:00
Victor Sun 8ad48ff488 HV: refine vmptable for partition mode
Merge separated mptable.c of BOARDs to unified vmptable.c;

Tracked-On: #2291

Signed-off-by: Victor Sun <victor.sun@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-01-11 10:55:14 +08:00
Min Lim f574d5926b profiling: code cleanup
This is the profiling code cleanup to avoid type conversion
and align tab/space in data structure definition

Tracked-On: #2257
Signed-off-by: Min Lim <min.yeol.lim@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-01-11 10:54:38 +08:00
Shiqing Gao e2971ebc98 hv: vlapic: code clean-up
* rename `vlapic_set_intr_ready` to `vlapic_accept_intr`
 * replace calling of `vlapic_intr_edge` with `vlapic_set_intr`
 * remove `vlapic_intr_level` and `vlapic_intr_edge`

Tracked-On: #861
Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-01-11 09:44:10 +08:00
Yuan Liu 1049053e2e IOC mediator: fix the issue of abnormally missing tx package
The issue will result in the loss of wakeup reason and signal
data, because the CBC header was not added when generating the
tx package.

Tracked-On: #2283
Signed-off-by: Yuan Liu <yuan1.liu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2019-01-11 09:21:35 +08:00
David B. Kinder 16667e4c78 doc: add menu option for 0.5 docs
Add option in side-bar menu for 0.5 doc version

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-01-10 17:17:36 -08:00
Xie Zhengtian 623a91e58f doc: update the statement of "tag" 2019-01-10 17:09:17 -08:00
root 3bb791a633 doc: add 'checkout to release v0.5' 2019-01-10 17:09:17 -08:00
Xie Zhengtian 6d306c30d1 doc: modify the directories of files needed 2019-01-10 17:09:17 -08:00
root f0f943bd9e doc: Update the steps for generating 'partition_desc.bin' 2019-01-10 17:09:17 -08:00
Mingqiang Chi 1fc10d514c hv:Unify the MACRO name for invalid interrupt pin
There are the following definitions in hypervisor,
  define IOAPIC_INVALID_PIN      0xffU
  define VPIC_INVALID_PIN        0xffU
  define PTDEV_INVALID_PIN       0xffU
this patch unify them to:
  define INVALID_INTERRUPT_PIN   0xffffffffU

Tracked-On: #861
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
2019-01-10 23:52:25 +08:00
Mingqiang Chi 7725fe3b50 hv: shell & vuart: Change interrupt pin to uint32_t
Change the type from uint8_t to uint32_t for shell and vuart

Tracked-On: #861
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-01-10 23:52:25 +08:00
Mingqiang Chi 49166fc3ac hv: passthrough: Change interrupt pin to uint32_t
-- Change the type from uint8_t to uint32_t
-- Remove some typecast
-- Change union source_id

Tracked-On: #861
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-01-10 23:52:25 +08:00
Mingqiang Chi 87afe65f86 hv: vioapici: Change interrupt pin to uint32_t
-- Change the type from uint8_t to uint32_t
-- Remove some typecast

Tracked-On: #861
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-01-10 23:52:25 +08:00
Mingqiang Chi 50deda8819 hv: vpic: Change interrupt pin to uint32_t
-- Change the type from uint8_t to uint32_t
-- Remove some typecast

Tracked-On: #861
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-01-10 23:52:25 +08:00
Mingqiang Chi 196912fb6d hv: ioapic: Change interrupt pin to uint32_t
Change the type from uint8_t to uint32_t for interrupt pin

Tracked-On: #861
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-01-10 23:52:25 +08:00
Zide Chen 10db11b00a hv: emulate IA32_FEATURE_CONTROL MSR
All features controlled by IA32_FEATURE_CONTROL are disabled from guests,
so set the Lock bit to prevent it from writing by guests.

Also hide the MSR_IA32_FEATURE_CONTROL_VMX_NO_SMX bit from guest.

Tracked-On: #1867
Signed-off-by: Zide Chen <zide.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-01-10 12:23:44 +08:00
Liu, Xinwu d5b578fd84 tools: acrn-crashlog: Limit the log size of kmsg
Dmesg collects too much log when kernel meets log storm.
This patch reads kernel log from "/dev/kmsg" intead of dmesg and limits
the generated log size.

Tracked-On: #1024
Signed-off-by: Liu, Xinwu <xinwu.liu@intel.com>
Reviewed-by: Zhi Jin <zhi.jin@intel.com>
Acked-by: Chen, Gang <gang.c.chen@intel.com>
2019-01-10 12:22:28 +08:00
Liu, Xinwu 156ea70821 tools: acrn-crashlog: Reboot system to cold after collecting reserve log
After panic, kernel will do warm boot to reserve memory for log collecting.
Need to cold reboot system as the original behaviour.

Tracked-On:#1024
Signed-off-by: Liu, Xinwu <xinwu.liu@intel.com>
Acked-by: Chen, Gang <gang.c.chen@intel.com>
2019-01-10 11:01:40 +08:00
Min He e3b33a9871 script: remove DP-x:d parameters for UP2 board
There's a DP port on UP2 board, so we cannot add video=DP-x:d paramter,
otherwise, DP monitors will not be able to be detected on UP2 boards.

Tracked-On: #2268
Signed-off-by: Min He <min.he@intel.com>
Reviewed-by: Binbin Wu <binbin.wu@intel.com>
2019-01-10 10:08:56 +08:00
Li, Fei1 40c5139ea3 hv: inst_emul: clean the "Procedure has more than one exit point"
Misra C requires Function must have only 1 return entry.

Tracked-On: #861
Signed-off-by: Li, Fei1 <fei1.li@intel.com>
2019-01-10 09:16:54 +08:00
David B. Kinder 5c24f8bb66 doc: tweak dm-parameter doc
Remove trailing blanks, and change one last reviewer comment.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-01-09 16:25:09 -08:00
Shuang Zheng 79f40a569b Update and complete `acrn-dm` parameters description
Update and complete `acrn-dm` parameters description in the user guide and HLD

Tracked-On: #2036
Signed-off-by: Shuang Zheng shuang.zheng@intel.com
2019-01-09 16:19:35 -08:00
David B. Kinder 158ba62c33 doc: update SKL NUC patch download instructions
Include a line of script that download and untars the patch files

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-01-09 10:50:59 -08:00
Geoffroy Van Cutsem 80cdf7cd82 Documentation: fix highlights in launch_uos.sh script
The couple of lines highlighted in the launch_uos.sh script are off
since the latest modifications made to that script. Fix them both
to highlight the correct script lines that require attention.

Tracked-On: #2270
Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2019-01-09 09:48:52 -08:00
David B. Kinder 7f9779b736 doc: add skylake NUC w/GPU passthrough doc
Document a community reference release for the Skylake NUC with GPU
passthrough as a one-time snapshot release, not supported or
maintained.  Includes a tar patch file.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-01-09 09:45:06 -08:00
Huihuang Shi 625e51d18a fix "goto detected:exception_inject"
V1->V2:
    rename is_exception_inject to has_exception.
V2->V3:
    remove the else statement and add new if statement to check
has_exception.

Misra C requires not allowed to use goto.

Tracked-On: #861
Signed-off-by: Huihuang Shi <huihuang.shi@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-01-09 23:06:25 +08:00
Zide Chen 86526cddc5 hv: disable more features from guest CPUID
Silicon Debug Feature: CPUID.01H.ECX[11]
- We can't allow guests to have direct access to silicon wide resources.

Machine Check Exception: CPUID.01H.EDX[5]
- Need HV support before exposing it to the guests.

Perfmon and Debug: CPUID.01H.ECX[15]
Debug Store: CPUID.01H.EDX[21], CPUID.01H.ECX[2], CPUID.01H.ECX[4]
- HV emulation is needed to separate host and guest monitoring data.
- guest CPUID.0AH is forced to all-zero in ACRN so it makes sense to clear
  these bits as well.

Tracked-On: #1867
Signed-off-by: Zide Chen <zide.chen@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2019-01-09 23:04:41 +08:00