Commit Graph

3398 Commits

Author SHA1 Message Date
wenlingz
f879e34ef8 releasenote for release_1.0.2
Signed-off-by: wenlingz <wenling.zhang@intel.com>
2019-11-22 09:23:40 +08:00
David B. Kinder
40721fb6cd doc: update v1.0.1 release notes
Fix some wording, table formatting, and links to issues and commits from
the original PR #3515

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-11-22 09:22:49 +08:00
lirui34
94d1cfbc25 doc: release notes v1.0.1
Add release notes v1.0.1

Signed-off-by: lirui34 <ruix.li@intel.com>
2019-11-22 09:22:22 +08:00
Binbin Wu
a94b2a533e hv: ept: disable execute right on large pages
Issue description:
-----------------
Machine Check Error on Page Size Change
Instruction fetch may cause machine check error if page size
and memory type was changed without invalidation on some
processors[1][2]. Malicious guest kernel could trigger this issue.

This issue applies to both primary page table and extended page
tables (EPT), however the primary page table is controlled by
hypervisor only. This patch mitigates the situation in EPT.

Mitigation details:
------------------
Implement non-execute huge pages in EPT.
This patch series clears the execute permission (bit 2) in the
EPT entries for large pages. When EPT violation is triggered by
guest instruction fetch, hypervisor converts the large page to
smaller 4 KB pages and restore the execute permission, and then
re-execute the guest instruction.

The current patch turns on the mitigation by default.
The follow-up patches will conditionally turn on/off the feature
per processor model.

[1] Refer to erratum KBL002 in "7th Generation Intel Processor
Family and 8th Generation Intel Processor Family for U Quad Core
Platforms Specification Update"
https://www.intel.com/content/dam/www/public/us/en/documents/specification-updates/7th-gen-core-family-spec-update.pdf
[2] Refer to erratum SKL002 in "6th Generation Intel Processor
Family Specification Update"
https://www.intel.com/content/www/us/en/products/docs/processors/core/desktop-6th-gen-core-family-spec-update.html

Tracked-On: #4120
Signed-off-by: Binbin Wu <binbin.wu@intel.com>
Reviewed-by: Eddie Dong <eddie.dong@intel.com>
2019-11-19 09:06:21 +08:00
Binbin Wu
1a99288d64 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: #4120
Signed-off-by: Binbin Wu <binbin.wu@intel.com>
Reviewed-by: Anthony Xu <anthony.xu@intel.com>
2019-11-19 09:06:21 +08:00
Binbin Wu
2d55b49ea1 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: #4120
Signed-off-by: Binbin Wu <binbin.wu@intel.com>
Reviewed-by: Anthony Xu <anthony.xu@intel.com>
2019-11-19 09:06:21 +08:00
Binbin Wu
a6944fe620 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: #4120
Signed-off-by: Binbin Wu <binbin.wu@intel.com>
Reviewed-by: Anthony Xu <anthony.xu@intel.com>
2019-11-19 09:06:21 +08:00
Yonghua Huang
30a773f7b0 hv:unmap AP trampoline region from service VM's EPT
AP trampoline code should be accessile to hypervisor only,
 Unmap this memory region from service VM's EPT mapping
 for security reason..

Tracked-On: #4091
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
2019-11-18 10:40:02 +08:00
Yonghua Huang
0b6447ad3d hv:refine modify_or_del_pte/pde/pdpte()function
1. Print warning message instead of panic when
     the caller try to modify the attribute for
     memory region or delete memory region that
     are not present.
  2. To avoid above warning  message for memory region
     below 1M,its attribute may be updated by Service
     VM when updating MTTR setting.

Tracked-On: #4091
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Reviewed-by: Fei Li <fei1.li@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-11-18 10:40:02 +08:00
fuyanX
b1951490e3 acrn-hv: code review fix lib/string.c
In lib/string.c, strncmp doesn't consider condition "n_arg=0",
just add a process to "n_arg=0".

Tracked-On: #4093
Tracked-On: projectacrn/acrn-hypervisor#3466
Signed-off-by: YanX Fu <yanx.fu@intel.com>
Reviewed-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-11-18 10:40:02 +08:00
xiaojin2
6730660a91 tools: acrn-crashlog: refine crash complete code
This patch is to remove unused info in server.c

Tracked-On: #4089
Signed-off-by: xiaojin2 <xiaojing.liu@intel.com>
Reviewed-by: Liu, Xinwu <xinwu.liu@intel.com>
Acked-by: CHEN Gang <gang.c.chen@intel.com>
2019-11-18 10:40:02 +08:00
Yonghua Huang
aba91a81e4 vm-manager: fix improper return value check for "strtol()"
The return value of 'strtol()' is not checked properly
 in _get_vmname_pid() @acrn_vm_ops.c and parse_opt()@acnrd.c,
 the return type of 'strtol' is 'long int', but it is assigned
 to a variable with type of 'int' and compared to "LONG_MAX"
 and "LONG_MIN", which is always false.

 This patch is to fix above error case.

Tracked-On: #4088
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Reviewed-by: Yan, Like <like.yan@intel.com>
Acked-by: Yan, Like <like.yan@intel.com>
2019-11-18 10:40:02 +08:00
Gao Junhao
995efc1b6f dm: refine the check of return value of snprintf
int snprintf(char *str, size_t size, const char *format, ...)
The functions snprintf() write at most size bytes (including the
terminating null byte('\0')) to str.
only when returned value of snprintf is non-negative and less than size,
the string has been completely written.

Tracked-On: #4087
Signed-off-by: Gao Junhao <junhao.gao@intel.com>
Reviewed-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2019-11-18 10:40:02 +08:00
Yonghua Huang
720a77c190 dm: fix mutex lock issue in tpm_rbc.c
In function crb_reg_write() in tpm_rbc.c
 'tpm_vdev->request_mutex' will potentially kept
 in locked state after crb_reg_write() returns.

Tracked-On: #4086
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Reviewed-by: Yadong Qi <yadong.qi@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2019-11-18 10:40:02 +08:00
Yonghua Huang
b51b89807f dm: close filepointer before exiting acrn_load_elf()
In acrn_load_elf(), file pointer 'fp' is kept in
 open state before exiting if 'load_elf32()' is executed,
 this patch is to fix this bug.

Tracked-On: #4085
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
2019-11-18 10:40:02 +08:00
Gao Junhao
84c3ee21e4 dm: modify DIR handler reference postion
DIR handler is referenced after release, need to be adjusted before
released.

Tracked-On: #4084
Signed-off-by: Gao Junhao <junhao.gao@intel.com>
Reviewed-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2019-11-18 10:40:02 +08:00
Junhao Gao
4baccdcebd dm: reduce potential crash caused by LIST_FOREACH
When removing node in list, list_foreach_safe will be safer than
LIST_FOREACH.

Tracked-On: #4083
Signed-off-by: Junhao Gao <junhao.gao@intel.com>
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Reviewed-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2019-11-18 10:40:02 +08:00
Yonghua Huang
2e054f6c48 hv: fix error debug message in hcall_set_callback_vector
this patch is to fix error debug message
 for invalid 'param' case, there is no string
 variable for '%s' output, which will potenially
 trigger hypervisor crash as it may access random
 memroy address and trigger SMAP violation.

Tracked-On: #4092
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
2019-11-18 10:40:02 +08:00
Yonghua Huang
6199e65341 dm: validate the input in 'pci_emul_mem_handler()'
checking the inputs explicitly instead of using Assert.

Tracked-On: #4003
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Reviewed-by: Shuo Liu <shuo.a.liu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2019-11-06 16:33:25 +08:00
Tianhua Sun
749556ef12 hv: fix symbols not stripped from release binaries
In release environment, binary files must be stripped in
order to remove debugging code sections and symbol information
that aid attackers in the process of disassembly and reverse
engineering.
Use '-s' linking option to remove symbol table and relocation
information from release binaries.

Tracked-On: #3427
Signed-off-by: Tianhua Sun <tianhuax.s.sun@intel.com>
Reviewed-by: Yonghua Huang <yonghua.huang@intel.com>
2019-07-19 16:39:36 +08:00
Tianhua Sun
5530fc8f36 efi-stub: update string operation in efi-stub
Remove unsafe API in efi-stub
1, use Strnlen instead of StrLen except the parameter
   is a static string.
2, strlen() only work on static strings.

Tracked-On: #3276
Signed-off-by: Tianhua Sun <tianhuax.s.sun@intel.com>
Reviewed-by: Yonghua Huang <yonghua.huang@intel.com>
2019-07-19 16:39:20 +08:00
Tianhua Sun
d6f7288580 hv: fix some potential array overflow risk
'pcpu_id' should be less than CONFIG_MAX_PCPU_NUM,
else 'per_cpu_data' will overflow. This commit fixes
this potential overflow issue.

Tracked-On: #3397
Signed-off-by: Tianhua Sun <tianhuax.s.sun@intel.com>
Reviewed-by: Yonghua Huang <yonghua.huang@intel.com>
2019-07-19 16:39:01 +08:00
Tianhua Sun
2e7171d616 dm: fix variable argument list read without ending with va_end
va_end() was not getting called under certain condition
after the va_start() function call taking the va_list.

Tracked-On: #3396
Signed-off-by: Tianhua Sun <tianhuax.s.sun@intel.com>
Reviewed-by: Yonghua Huang <yonghua.huang@intel.com>
2019-07-19 16:38:42 +08:00
Tianhua Sun
1394758d69 tools: fix variable argument list read without ending with va_end
va_end() was not getting called under certain condition
after the va_start() function call taking the va_list

Tracked-On: #3396
Signed-off-by: Tianhua Sun <tianhuax.s.sun@intel.com>
Acked-by: Gang Chen <gang.c.chen@intel.com>
2019-07-19 16:38:24 +08:00
Tianhua Sun
bc90db46fc dm: fix some possible memory leak
free memory allocated by strdup()

Tracked-On: #3395
Signed-off-by: Tianhua Sun <tianhuax.s.sun@intel.com>
Reviewed-by: Yonghua Huang <yonghua.huang@intel.com>
2019-07-19 16:37:52 +08:00
Tianhua Sun
0c0371fc9e dm: fix some potential memory leaks
This patch is to fix some potential memory leak issues

1, free mrp if the mmio_rb_lookup() function return 0;
2, free memory allocated by strdup in some error case handling.

Tracked-On: #3277
Signed-off-by: Tianhua Sun <tianhuax.s.sun@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2019-07-19 16:37:33 +08:00
Tianhua Sun
b65489c27d dm: use strnlen to replace strlen
Replace strlen function with strnlen function in DM

Tracked-On: #3276
Signed-off-by: Tianhua Sun <tianhuax.s.sun@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2019-07-19 16:37:16 +08:00
Tianhua Sun
5ced5fe77f dm: use strncpy to replace strcpy
Use strncpy instead of strcpy to avoid buf overflow.
Fix strncpy null-terminated issues.

Tracked-On: #3245
Signed-off-by: Tianhua Sun <tianhuax.s.sun@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2019-07-19 16:36:59 +08:00
Jack Ren
3f2dde4ee5 version: v1.0
Signed-off-by: Jack Ren <jack.ren@intel.com>
2019-05-09 13:28:18 +08:00
ruix.li
9cdb5e959c doc: release note v1.0, correct some words.
Signed-off-by: ruix.li <ruix.li@intel.com>
2019-05-09 13:14:46 +08:00
David B. Kinder
7a275f6740 doc: Update intro to 1.0 release notes
Update the high-level summary.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-05-09 09:10:47 +08:00
David B. Kinder
11c9e27636 doc: Update 1.0 release notes
Fix release intro description, misspellings, remove trailing blanks,
trademark use.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-05-08 14:27:30 +08:00
David B. Kinder
5dbeb87fb3 doc: update APL NUC GSG
APL NUC Getting started guide has some obsolete information (such as
saying the user had to build ACRN as part of the installation process
and changed instructions because the Clear Linux installer changed),
along with some spelling and grammar issues.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-05-08 14:27:17 +08:00
root
9c21472f40 doc: Update the diagram of KBL NUC serial port rework
Update the connection of serial port rework for KBL NUC

Signed off by: Xie, Zhengtian<zhengtian.xie@intel.com>
2019-05-08 14:21:42 +08:00
David B. Kinder
13e780dd8d doc: update APL GSG details
Add additional edits to APL NUC GSG.
Also update corrupt PNG image

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-05-08 14:21:26 +08:00
ruix.li
c97cdc0da4 Setting up KBL serial console on the GSG
Signed-off-by: ruix.li <ruix.li@intel.com>
2019-05-08 14:21:00 +08:00
ruix.li
1bc3d83519 doc: Add v1.0 release note
v1.0 release note

Signed-off-by: ruix.li <ruix.li@intel.com>
2019-05-07 16:40:28 +08:00
Shiqing Gao
72d79a5fee doc: initial draft of Assembly coding guidelines
This patch creates initial draft of Assembly coding guidelines.

Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
2019-05-07 16:40:00 +08:00
David B. Kinder
dd1830b823 doc: Fix references to be Wi-Fi
Correct spelling of the trademarked name is Wi-Fi

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-05-07 16:39:24 +08:00
ruix.li
aced3f43d7 doc: Add instruction for gsg_quick_setup.sh script.
An instruction is needed from gsg so that user could know where
to get the script and also how to use it to setup SOS, UOS automatically.

Signed-off-by: ruix.li <ruix.li@intel.com>
2019-05-07 16:25:04 +08:00
Li, Wilson
b0adc2dd0f Updated GSG of using RT Linux as RTVM in accordance with acrn-kernel v4.19.28
Signed-off-by: Li, Wilson <wilson.li@intel.com>
2019-05-07 16:22:03 +08:00
Geoffroy Van Cutsem
65d877b809 doc: update "Using PREEMPT_RT-Linux for real-time UOS" to use RTVM term
Update the architectural diagram in the "Using PREEMPT_RT-Linux for
real-time UOS" tutorial to reflect the new name given to that type of
VM, i.e. from "Privileged VM" to "RTVM".

Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2019-05-07 16:21:12 +08:00
zhangyun
31776e0eca doc: How to build ACRN on Fedora 29
Update FAQ about compilation issue workaround on Fedora 29

Tracked-On: #2457
Signed-off-by: zhangyun <yunxzhang@intel.com>
2019-05-07 16:20:12 +08:00
Shiqing Gao
42baefd392 doc: add rules in C coding guidelines
This patch adds rules in C coding guidelines.

Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
2019-05-07 16:19:33 +08:00
Geoffroy Van Cutsem
8543486462 doc: update instructions for building ACRN on Ubuntu 16.04
Update the instructions on how to build ACRN on Ubuntu 16.04,
specifically:
* Add 'pkg-config' package
* Upgrade 'binutils' to 2.27

Note: there is still an issue with regards to the GPIO header
(linux/gpio.h) which needs to be resolved.

Tracked-On: #2737
Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2019-05-07 16:18:27 +08:00
Conghui Chen
1f8dcd2203 DOC: change hv shell cmd sos_console to vm_console
Change shell command 'sos_console' to 'vm_console' as it is not only
used to switch console to SOS.

Tracked-On: #2987
Signed-off-by: Conghui Chen <conghui.chen@intel.com>
2019-05-07 16:16:39 +08:00
Shiqing Gao
ce255fa003 doc: rename rules ID in C coding guidelines
This patch renames rules ID to reflect the language, in order
to support multiple programming languages.

Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
2019-05-07 16:14:30 +08:00
Shiqing Gao
5146830542 doc: re-organize coding guidelines
This patch re-organizes ACRN coding guidelines to support
language-specific guidelines.

Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
2019-05-07 16:10:50 +08:00
Shiqing Gao
292e510e06 doc: update coding guidelines
This patch updates some rules in coding guidelines.

Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
2019-05-07 16:10:33 +08:00
Yin Fengwei
6ce32a3579 Makefile: add gcc option to workaround build issue with latest gcc
With latest gcc, there are build error with current ACRN code.
Fixing could involve many code changes. We use gcc option to
remove build error as temperary workaround. And will fix the
build error one by one.

Tracked-On: #3010
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
2019-04-25 21:25:55 +08:00