Commit Graph

2546 Commits

Author SHA1 Message Date
Tianhua Sun 5d19962d73 security: remove cflag _FORTIFY_SOURCE in hypervisor
_FORTIFY_SOURCE is a Glibc feature which adds memory
and string function protection, this flag is only for
Glibc. The _FORTIFY_SOURCE is not used by hypervisor
because hypervisor is not include Glibc.

Tracked-On: #1122
Signed-off-by: Tianhua Sun <tianhuax.s.sun@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2018-12-05 13:16:49 +08:00
Kaige Fu d737d6e63f tools: acrnlog: give user hint when acrn hvlog devices not found
If module acrn_hvlog is configured as "m" and we don't insert it before
launching acrnlog tool, acrnlog will run normally instead of throw
out an error in current implementation. And no log files are generated.
It will cause confusing here.

So, this patch throw out an error massage to user about the absence of acrn
hvlog devices.

BTW, this patch replaces cpuid/num related concept to devid/cnt which is more
suitable for /dev/acrn_hvlog_xxx.

Tracked-On: #1975
Signed-off-by: Kaige Fu <kaige.fu@intel.com>
Acked-by: Yan, Like <like.yan@intel.com>
2018-12-05 13:16:20 +08:00
Kaige Fu d85a0b70ed tools: acrntrace: give user hint when acrn trace devices not found
If module acrn_trace is configured as "m" and we don't insert it before
launching acrntrace tool, acrntrace will run normally instead of throw
out an error in current implementation. And no trace files are generated.
It will cause confusing here.

So, this patch throw out an error massage to user about the absence of acrn
trace devices.

BTW, this patch replaces cpuid/num related concept to devid/cnt which is more
suitable for /dev/acrn_trace_xxx.

Tracked-On: #1975
Signed-off-by: Kaige Fu <kaige.fu@intel.com>
Acked-by: Yan, Like <like.yan@intel.com>
2018-12-05 13:16:20 +08:00
Sainath Grandhi 9ea93ce620 hv: x2APICv support on platforms without support for APICv reg virtualization
On platforms, that do not support APICv register virtualization, all the
x2APIC MSRs need to intercepted by ACRN for emulation.

Tracked-On: #1973
Signed-off-by: Sainath Grandhi <sainath.grandhi@intel.com>
2018-12-05 09:21:27 +08:00
Xiaoguang Wu 9d4b5d7e1b DM USB: add some preparing time for xHCI emulation before resuming.
If the USB kernel drives and devices of SOS are not available and
functional ready after UOS is resumed from frozen state, the comming
USB command from UOS will cause a disaster because the DM has no
resourse to to emulation.

This patch add a dynamic time span (could change according to number
of native USB devices attached) to give USB drivers and devices of
SOS an opportunity to be ready.

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-04 19:59:00 +08:00
Xiaoguang Wu b159d66fb3 DM USB: refine the polling thread for libusb events
The thread function usb_dev_sys_thread is the source of libusb events,
which is also the basis of USB/xHCI emulation. During S3 process,
function libusb_handle_events_timeout may fail and return -1, which
could result of exit of the thread (BTW, this failure is resulted from
USB native reseting behavior during S3). Under this situation, the emulation
of USB/xHCI could never continue.

This patch fix this issue by continuing to call libusb_handle_events_timeout
even it reture -1. The return value will be finally ok after S3 process is
completed.

This patch will continue poll after failure and hence fix this issue.

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-04 19:59:00 +08:00
Xiaoguang Wu 966c587260 DM USB: xHCI: fix potential NULL pointer issue.
During S3 process, the dev in the function pci_xhci_device_doorbell
may be set to NULL when disconnection is detected by DM. This patch
is used to remove this risk.

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-04 19:59:00 +08:00
Xiaoguang Wu 5b39fd0ed3 DM USB: xHCI: fix error logic of allocating xHCI slot
The 'slot_allocated[]' field of pci_xhci_vdev is used as flag of
slot allocation. In current design, this variable is not set to
false in disconnection callback 'pci_xhci_native_usb_dev_disconn_cb'.
This patch is used to fix it.

Tracked-On: #1894
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-04 19:59:00 +08:00
Xiaoguang Wu 32c4ce9b9a DM USB: xHCI: refine the xHCI S3 process
In the old implementation, function vm_get_suspend_mode is used
as the interface to check whether the UOS is in the S3, That is
not saft way.

This patch use Port Link State (PLS) to substitute the old logic.
According to xHCI spec 5.4.8, the PLS should be U3 during the
UOS is in the S3 state.

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-04 19:59:00 +08:00
Xiaoguang Wu 9e471d7258 DM USB: xHCI: refine the PLC bit emulation logic during S3
According to xHCI 5.4.8, the Port Link State Change (PLC) bit
should not be set to 1 during suspend process. This patch is used
to fix it.

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-04 19:59:00 +08:00
Xiaoguang Wu 29e81501c5 DM USB: xHCI: refine error handling logic for ctrl transfer
Under current implementation, when USB control transfer failed
with Endpoint Stall error, there is no response reporting to UOS.
This logic will result of timeout in UOS kernel and hence a longer
enumeration process.

This patch reports the Stall Error to UOS by xHCI Completion Event,
which will fix this issue.

Tracked-On: #1895
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-04 19:59:00 +08:00
Shiqing Gao f73cf21187 hv: fix 'Unused procedure parameter'
remove the unused procedure parameter

Tracked-On: #861
Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-12-04 18:28:32 +08:00
Jie Deng b261e74dd5 dm: virtio poll mode support for RT
Device trap has great impact on latency of real time (RT) tasks.
This patch provide a virtio poll mode to avoid trap.

According to the virtio spec, backend devices can declare the
notification is not needed so that frontend will never trap.
This means the backends make commitment to the frontends they have a
poll mechanism which don’t need any frontends notification.

This patch uses a periodic timer to give backends pseudo notifications
so that drive them processing data in their virtqueues. People should
choose a appropriate notification peroid interval to use this poll
mode. Too big interval may cause virtqueue processing latency while
too small interval may cause high SOS CPU usage. The suggested interval
is between 100us to 1ms.

The poll mode is not enabled by default and traditional trap
notification mode will be used. To use poll mode for RT with interval
1ms. You can add following acrn-dm parameter.

	--virtio_poll 1000000

Tracked-On: #1956
Signed-off-by: Jie Deng <jie.deng@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-12-04 18:27:53 +08:00
Shiqing Gao 7cc8566d37 hv: fixes related to unused API and uninitialized variable
This patch does:
- remove the unused API declaration
- fix use of uninitialized variable in instr_emul.c

Tracked-On: #861
Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-12-04 16:49:49 +08:00
Chen Gang G f0d3f1c984 HV: Remove some comments for crypto library
The code in comments was removed from md_wrap.c, so modify comments
to avoid confusion

Tracked-On: #1966
Signed-off-by: Chen Gang G <gang.g.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-12-04 16:48:22 +08:00
Li, Fei1 d7232ebb57 hv: trusty: refine struct trusty_mem
Since "uint8_t page[CPU_PAGE_SIZE]" wants to ensure the first_page only
took PAGE_SIZE memory space and aligned to PAGE_SIZE. However, it couldn't.
So just make it simpler.

Tracked-On: #861
Signed-off-by: Li, Fei1 <fei1.li@intel.com>
Reviewed-by: Qi, Yadong <yadong.qi@intel.com>
2018-12-04 15:14:36 +08:00
Li, Fei1 5fd6021dee doc: hv: add comments to timer APIs for documentation
This patch adds more comment to describe functions that are
interfaces to the other modules in the hypervisor. The comments
are in doxygen-style for document generation.

Tracked-On: #1595
Signed-off-by: Li, Fei1 <fei1.li@intel.com>
2018-12-04 15:09:47 +08:00
David B. Kinder 2dbb0cbafc doc: fix citation references in modularity doc
Modularity Design doc had replicated references to citatation docs.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-12-03 21:04:23 -08:00
Junjie Mao e2a8989ff4 doc: add a document on considerations and current status of hypervisor modularization
To kick off the efforts on modularization, this patch introduces a document
describing the goals and general principles of modular design as well as a brief
introduction on the current status of component/module decomposition.

A detailed assignment of source files to components will be added in the future.

v2 -> v3:

* Expand mailing list address in the doc

v1 -> v2:

* Add more description on complexity measures, cyclic dependency avoidance, and
  the reverse dependency of boot on hypervisor initialzation.
* Fix typos.

Tracked-On: #1842
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2018-12-03 20:49:28 -08:00
Xie Zhengtian 3b54dd2abd doc: add some "sudo" for code 2018-12-03 20:48:10 -08:00
Xie Zhengtian 945fdd8a4a doc: update the directory to "~/" 2018-12-03 20:48:10 -08:00
Xie Zhengtian 0ff74b1367 doc: delete "install build tool" about 2018-12-03 20:48:10 -08:00
Xie Zhengtian 1a959d0f54 doc: Update note for the directory of UOS image 2018-12-03 20:48:10 -08:00
Xie Zhengtian e2e9a3e9b9 doc: Add the note for the directory of UOS image 2018-12-03 20:48:10 -08:00
Xie Zhengtian 1052242319 doc: add note for the directory of UOS image 2018-12-03 20:48:10 -08:00
Xie Zhengtian 099c605eda doc: Modify to "/boot/efi"
1. No more mount needed, use the directory "/boot/efi"
2. The kernel of UOS stored in "~/uos-kernel-build"
3. (Pending) the image of UOS stored in "~/" or "/root"
2018-12-03 20:48:10 -08:00
Xie Zhengtian ceed310661 Update using_ubuntu_as_sos.rst 2018-12-03 20:48:10 -08:00
Xie Zhengtian b1db77eb81 doc: Update the grub part and add code for NVMe 2018-12-03 20:48:10 -08:00
Xie Zhengtian 4b2e7f1123 Delete AGL about 2018-12-03 20:48:10 -08:00
Xie Zhengtian be70145f4c Delete AGL about 2018-12-03 20:48:10 -08:00
Xie Zhengtian 96a2946d72 Delete AGL about 2018-12-03 20:48:10 -08:00
Xie Zhengtian 6c8c46af8f delete AGL about 2018-12-03 20:48:10 -08:00
Xie Zhengtian ce89d26e76 Delete using_AGL_as_uos.rst 2018-12-03 20:48:10 -08:00
Xie Zhengtian 3d96e35643 Rename using_AGL_as_uos to using_AGL_as_uos.rst 2018-12-03 20:48:10 -08:00
Xie Zhengtian 90c27157e4 Create using AGL as UOS 2018-12-03 20:48:10 -08:00
Xie Zhengtian 2bc24f8789 Upload the images for "using_AGL_as_uos" 2018-12-03 20:48:10 -08:00
coneypo 12e66b989a Update using_ubuntu_as_sos.rst 2018-12-03 20:48:10 -08:00
coneypo ecff0bf9e8 Update the layout of packages 2018-12-03 20:48:10 -08:00
coneypo 50f1783200 Update using_ubuntu_as_sos.rst 2018-12-03 20:48:10 -08:00
coneypo 1afb0f13c4 Update using_ubuntu_as_sos.rst 2018-12-03 20:48:10 -08:00
coneypo 06b2ab55e3 Update using_ubuntu_as_sos.rst 2018-12-03 20:48:10 -08:00
coneypo e4941b2225 Update using_ubuntu_as_sos.rst 2018-12-03 20:48:10 -08:00
coneypo 65f21a77e2 Update the version of Ubuntu to 18.04 2018-12-03 20:48:10 -08:00
coneypo abfa1c1644 update the length of * 2018-12-03 20:48:10 -08:00
coneypo 1664ba5fa7 Update using_ubuntu_as_sos.rst 2018-12-03 20:48:10 -08:00
coneypo f3527c638c Update using_ubuntu_as_sos.rst 2018-12-03 20:48:10 -08:00
coneypo e4b616d5fd Update using_ubuntu_as_sos.rst 2018-12-03 20:48:10 -08:00
coneypo ab005bc8a8 Update using_ubuntu_as_sos.rst 2018-12-03 20:48:10 -08:00
coneypo 2d685a13ee Update with Clear Linux 26440 2018-12-03 20:48:10 -08:00
Shiqing Gao b38629b85e hv: fix 'Space missing before or after binary operator'
This patch adds the necessary space before or after binary operator.

v1 -> v2:
 * minor fix related to integer
   [i - 1] ====> [i - 1U]

Tracked-On: #861
Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
2018-12-04 09:16:04 +08:00