Commit Graph

2665 Commits

Author SHA1 Message Date
Yuan Liu
7a07dfb9c7 dm: usb: fix SWWDT_UNHANDLED issue
add a delay for usb in launch_uos.sh

Tracked-On: #2633
Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2019-03-11 11:34:32 +08:00
Xiaoguang Wu
b8017080b3 DM USB: xHCI: fix an logic error during USB reset
Should not set hci_address to zero during USB reset.

Tracked-On: #2633
Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2019-03-11 11:34:32 +08:00
Yin Fengwei
8144f6218c acrn-dm: set realtime sched policy for vcpu thread
To reduce the io emulation impact to audio FE which could
trigger audio glitch.

Tracked-On: #2717
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
2019-03-11 11:11:25 +08:00
Yonghua Huang
80d3584b07 dm: fix possible memory leak in 'load_elf32()'
Dynamic memory stored in 'elf32_phdr' allocated
through 'calloc' be lost.

Tracked-On: #2705
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Signed-off-by: Tianhua Sun <tianhuax.s.sun@intel.com>
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
2019-03-11 10:11:31 +08:00
Binbin Wu
8cd892a4f0 dm: passthru: fix potential memory leak
Fix potential memory leakage in some error case handling.

Tracked-On: #2705
Signed-off-by: Binbin Wu <binbin.wu@intel.com>
2019-03-11 10:11:11 +08:00
Wei Liu
92d75f0dc2 dm: replace string function api for acrn-dm
String function of strlen()/vsnprintf() shuould be replaced.
This patch remove the strlen(). And vsnprintf() replaced by vasprintf().

Tracked-On: #2687
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Reviewed-by: Yonghua Huang <yonghua.huang@intel.com>
Reviewed-by: Tianhua Sun <tianhuax.s.sun@intel.com>
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
2019-03-07 12:21:23 +08:00
Min He
4fa293c402 hv: refined the pmu passthru irq handling
This patch refined the pmu passthru irq handling, which will re-enable
the PMC interrupt in the vlapic handler. So that can avoid some
interrupt storm situation happens.

This patch can fix the remaining Android perf CTS failure.

Tracked-On: #2598
Signed-off-by: Min He <min.he@intel.com>
2019-03-07 11:27:45 +08:00
Binbin Wu
9d4b18dc2e dm: bios: update vsbl to v1.3
Update vFastboot to v1.3
Pass secureboot status to guest.

Tracked-On: #2681
Signed-off-by: Binbin Wu <binbin.wu@intel.com>
2019-03-06 11:15:19 +08:00
wenlingz
b3962b229a Script: Fix snd_soc_skl typo in launch script
Tracked-On: #2666
2019-03-05 15:32:12 +08:00
Yuan Liu
36a243ddaa Change machine driver used
snd_soc_sst_bxt_sos_tdf8532 machine driver should be used on SOS

Tracked-On: #2652
Signed-off-by: Marcin Pietraszko <marcin.pietraszko@intel.com>
2019-02-28 18:49:13 +08:00
Yuan Liu
2199fc85b2 Domain id and name added to launch_uos.sh
For multiple guest os and particular audio features support domain id
and name is required.

Tracked-On: #2652
reviewed-by: Yu Wang <yu1.wang@intel.com>
reviewed-by: Yakui zhao <yakui.zhao@intel.com>
reviewed-by: Binbin Wu <binbin.wu@intel.com>
Signed-off-by: Marcin Pietraszko <marcin.pietraszko@intel.com>
2019-02-28 18:49:13 +08:00
wenlingz
aa7938577d Revert "sos-bootargs: change i915 initial mode setting to 0"
This reverts commit f750311005.
2019-02-28 13:40:54 +08:00
wenlingz
f750311005 sos-bootargs: change i915 initial mode setting to 0
Tracked-On: #2638
2019-02-27 17:45:32 +08:00
Conghui Chen
1d7c69a69f Revert "dm: script: enable discard feature for virtio-blk"
This reverts commit 5df9cbe36a.
As DISCARD support will cause kernel hung in stability test of warm
reset, so not enable this feature in launch script.

Tracked-On: #2633
Signed-off-by: Conghui Chen <conghui.chen@intel.com>
2019-02-27 11:09:20 +08:00
Huang Yang
1a59fa26fe DM: Attestation Keybox support in SOS DM
Retrieve the encrypted attestation Keybox from CSE
and provision it to RPMB storage.

Tracked-On: #2625
Signed-off-by: Huang Yang <yang.huang@intel.com>
Signed-off-by: Wei Xinghai <xinghaix.wei@intel.com>
Signed-off-by: Chen Gang <gang.g.chen@intel.com>
Acked-by: Zhu Bing <bing.zhu@intel.com>
2019-02-27 10:00:12 +08:00
Conghui Chen
0066171468 dm: virtio: add memory barrier before notify FE
Without memory barrier, the change of used ring index could not
immediately detected by FE, this would bring some problems.

For virtio-blk FE driver, when it receives an interrupt, and confirms the
used ring index has changed, it will first set ring flags with
VRING_AVAIL_F_NO_INTERRUPT, then get buffer from virtqueue, after
process this request, it will mask VRING_AVAIL_F_NO_INTERRUPT, and get
used ring index again before return. If used ring changes, it will
process it. At the same time, BE will read this flags before each notify,
if VRING_AVAIL_F_NO_INTERRUPT was set, BE will not inject interrupt.

Without memory barrier, before FE mask VRING_AVAIL_F_NO_INTERRUPT, BE
has finished notify without interrupt, then FE mask
VRING_AVAIL_F_NO_INTERRUPT, and get used ring index but failed (index
has changed from BE side). FE will return from interrupt handler
function, and wait for next interrupt which was not injected by BE. Thus,
this will cause kernel hung.

Tracked-On: #2628
Signed-off-by: Conghui Chen <conghui.chen@intel.com>
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
2019-02-27 09:54:57 +08:00
Min He
fd61d626b3 Makefile: adding profiling option in Makefile
This patch added a option to control profiling on/off, by default,
profiling is on, so that VTune can be used to capture perf data from
SOS.
When running: make PROFILING=0, it will disable profiling and pmu will
be pass-thru and perf tools can be run directly inside UOS.

Signed-off-by: Min He <min.he@intel.com>
2019-02-26 13:46:21 +08:00
Min He
328c276152 hv: pass-thru PMU registers when no PROFILING_ON
Signed-off-by: Min He <min.he@intel.com>
2019-02-26 13:46:21 +08:00
Min He
d9d6ab05f0 hv: fix an issue in vlapic_trigger_lvt
In commit e24899d9c9 ("fix "Recursion in procedure calls found""), it
added a check if vector < 16U in vlapic_trigger_lvt() by a mistake, since
the vector variable in vlapic_trigger_lvt() is not the interrupt vector.

This patch fixed the issue mentioned above.

Tracked-On:#2598
Signed-off-by: Min He <min.he@intel.com>
2019-02-26 13:46:21 +08:00
Qi Yadong
46c72d963d hv: fix possibility of using uninitialized params
'len' and 'arg' might be used uninitialized in abl_seed_parse().
Fix them by setting initial value.

 Tracked-On: #2618
Signed-off-by: Qi Yadong <yadong.qi@intel.com>
2019-02-26 13:30:02 +08:00
Minggui Cao
e3f1947744 DM: rm console in release args for security reuest
as security request, release build can't inlcude console
configure, so remove it.

Tracked-On: #2613
Signed-off-by: Minggui Cao <minggui.cao@intel.com>
2019-02-25 20:25:07 +08:00
Xiaoguang Wu
ecedf31bd1 DM USB: xHCI: delay 2s for enumeration in resuming process
During UOS S3 resume, the UOS will handle USB disconnect flow then
re-enumeration flow due to vbus drop be emulted for UOS S3 case. The
re-enumeration flow will impact UOS S3 resume latency, this patch
delayed the re-enumeration 2s as the workaround for this issue. Need to
do performance optimization in future.

This 2s can be tune which is depend on how fast UOS S3 resume, it should
be as short as possible to make virtual USB device ready immediately
after UOS screen turn on.

Tracked-On: #2576
Signed-off-by: Conghui Chen <conghui.chen@intel.com>
Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2019-02-25 16:43:18 +08:00
Xiaoguang Wu
9844ff0266 DM USB: xHCI: re-design the S3 logic to speed up resuming process
This patch unbinds the kernel driver usbfs with device before suspending
is completed and binds them again during resuming process, this could
avoid a busy loop in SOS due to VBUS drop. This patch could save ~200ms
for resuming process.

Tracked-On: #2576
Signed-off-by: Conghui Chen <conghui.chen@intel.com>
Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2019-02-25 16:43:18 +08:00
Xiaoguang Wu
b77755cd58 DM USB: xHCI: refine the de-init logic of xHCI vdevice
Add 'full' and 'non-full' de-initialize support for xHCI virtual
device. The non-full de-initialization mainly release usb_dev
structure and unbind the usbfs with native device. And the full
de-initialize will release all the resources allocated for xHCI
virtual device including the unbinding operation mentioned above

Tracked-On: #2576
Signed-off-by: Conghui Chen <conghui.chen@intel.com>
Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2019-02-25 16:43:18 +08:00
Xiaoguang Wu
76a5131b37 DM USB: xHCI: fix PORTSC error in 'pci_xhci_cmd_disable_slot'
The disable slot command is used for forcing a device slot to enter into
disconnect state, a typical usage would be to free a Device Slot when an
USB device is disconnected. But it should not impact the portsc value.

Tracked-On: #2576
Signed-off-by: Conghui Chen <conghui.chen@intel.com>
Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2019-02-25 16:43:18 +08:00
Xiaoguang Wu
c9d85cfaea DM USB: xHCI: fix a logic error in 'pci_xhci_portregs_write'
The function 'pci_xhci_portregs_write' always set CCS bit in
Port Status and Control (PORTSC) register when there is
pci_xhci_dev_emu instance existed. This is not right and this
patch is used to fix it.

Tracked-On: #2576
Signed-off-by: Conghui Chen <conghui.chen@intel.com>
Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2019-02-25 16:43:18 +08:00
Xiaoguang Wu
5f36580190 DM USB: xHCI: introduce get/set function for PORTSC register
Port Status and Control (PORTSC) register is one of the most frequently
accessed regiseter according the xHCI spec. This patch implement a pair
of set/get function to access PORTS and it gives a clear code structure
and help a lot for debugging work.

Tracked-On: #2576
Signed-off-by: Conghui Chen <conghui.chen@intel.com>
Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2019-02-25 16:43:18 +08:00
Qi Yadong
b7f5614387 hv: search additional argument when parsing seed from ABL
Due to ABL design change, it will reword the "dev_sec_info.param_addr="
to "ABL.svnseed" in command line.

Tracked-On: #2605
Signed-off-by: Qi Yadong <yadong.qi@intel.com>
Acked-by: Zhu Bing <bing.zhu@intel.com>
2019-02-25 16:03:21 +08:00
Victor Sun
3c16a5ebc2 HV: code style change for abl_seed_parse.c
- remove goto;

- make sure procedure has one exit point;

Tracked-On: #861
Signed-off-by: Victor Sun <victor.sun@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-02-25 16:03:21 +08:00
Zhi Jin
2fa810076b hv: debug: mark the mmio address for npk log as hv owned
Otherwise, page fault will be triggered when writing npk log
to these mmio addresses.

Tracked-On: #2589
Signed-off-by: Zhi Jin <zhi.jin@intel.com>
Reviewed-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-02-22 13:50:13 +08:00
Binbin Wu
1de4450e9f dm: bios: update vsbl to v1.2
Update vFastboot to v1.2
Newly changed:
	Optimize fastboot erase for virtual IO block medium.
	Update openssl to version 1.0.2q.

Tracked-On: #2595
Signed-off-by: Binbin Wu <binbin.wu@intel.com>
2019-02-22 13:49:50 +08:00
Xiaoguang Wu
be7b034763 DM USB: xHCI: fix an issue during BULK transfer
When LINK type TRB are received among multiple BULK TRBs, the copying
logic in DM will miss one or more TRBs. This patch is used to fix it.

Tracked-On: #2581
Signed-off-by: Conghui Chen <conghui.chen@intel.com>
Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2019-02-22 13:48:21 +08:00
Xiaoguang Wu
7aabea6b06 DM USB: xHCI: fix an error logic in DRD logic
The patch (commit id: b39524e) didn't achieve its purpose completely.
This patch is used to fix it.

Tracked-On: #2557
Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2019-02-22 13:48:10 +08:00
Yan, Like
1b58076191 tools: do not include unnecessary files in release build
This commit removes the unnecessary tool files in release build, including:
- entire acrnlog module
- entire acrntrace module
- acrnctl binary in acrn-manager

Tracked-On: #2575
Signed-off-by: Yan, Like <like.yan@intel.com>
Reviewed-by: Huang, Yonghua <yonghua.huang@intel.com>
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
2019-02-22 11:28:38 +08:00
Minggui Cao
d251afa8f3 DM: modify acpi for IASL to support ACPI6.3
patch is from Alex Du for IASL tool updated to support
ACPI 6.3 version.

Tracked-On: #2565
Signed-off-by: Alek Du <alek.du@intel.com>
Signed-off-by: Minggui Cao <minggui.cao@intel.com>
2019-02-20 14:18:33 +08:00
Yin Fengwei
870688e67b hv: isrvec_stk_top could be zero once we enable APICv
With APICv enabled, it's possible that the interrupt is not
injected through VMX_ENTRY_INT_INFO_FIELD. In that case, the
isrvec_stk_top will not be increased.

Tracked-On: #2558
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
2019-02-20 11:00:37 +08:00
Yu Wang
b39524e989 DM USB: xHCI: do not reset DRD role during S3 process
To reset USB DRD role is one workaround for adb lost issue with xDCI
passthrough which reproduced in S3 stress test.

This workaround will involve the system global reset if xDCI working in
SuperSpeed mode. This is maybe caused by PMC firmware can't graceful
power gate the xDCI during S3 suspend. The current USB DRD driver will
set STATIC switch bits which will cause ungraceful DRD switch, it may
make the xDCI enter a unknown state, then involved this global reset
issue.

BTW, base on latest code base, the adb lost issue can't reproduce even
remove this workaround. So remove the old workaround for above reasons.

Tracked-On: #2557
Signed-off-by: Yu Wang <yu1.wang@intel.com>
Reviewed-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
Signed-off-by: Yu Wang <yu1.wang@intel.com>
2019-02-19 13:53:11 +08:00
Qi Yadong
22df0249b5 dm: vtpm: disable Virtual TPM feature
There is no requirement for Virual TPM feature on GP2.0 branch.

Tracked-On:#2553
Signed-off-by: Qi Yadong <yadong.qi@intel.com>
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
2019-02-19 13:41:58 +08:00
Wei Liu
e40927ca35 dm: add specify log for starting uos
add log for uos when to begin

Tracked-On: #2552
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Reviewed-by: Yin Fengwei <fengwei.yin@intel.com>
2019-02-19 13:20:56 +08:00
Conghui Chen
5df9cbe36a dm: script: enable discard feature for virtio-blk
To support discard for virtio-blk, the backend file should also located
in a filesystem which support discard. So, mount /data partition with '
-o discard'.
Then, add 'discard' to virtio-blk to enable this feature.

1. Erase operations on UOS will trigger the discard on SOS instead of
writing zero, which will save erase time.

2. Discard in storage firmware will move the mapped host address range to
the unmapped host address range. So, when delete a file in UOS, discard
will trigger the space collection on storage, so that in the next write
operation, it need not to do erase first.

Tracked-On: #2547
Signed-off-by: Conghui Chen <conghui.chen@intel.com>
Reviewed-by: Yu Wang <yu1.wang@intel.com>
Acked-by: Binbin Wu <binbin.wu@intel.com>
2019-02-18 18:28:55 +08:00
Conghui Chen
a82cafe92d dm: storage: change DISCARD to synchronous mode
For virtio-blk, when the backend is a regular file, the discard
and
is implemented by fallocate(), but this function will not wait for
the discard command handled by disk.
So, add fdatasync to make sure the DISCARD is executed
synchronously.

Tracked-On: #2547
Signed-off-by: Conghui Chen <conghui.chen@intel.com>
Acked-by: Wang Yu <yu1.wang@intel.com>
2019-02-18 18:28:55 +08:00
Conghui Chen
b595abcc23 dm: storage: support discard command
Support DISCARD command is meaningful when eMMC usage is high or
there are lots of remove operations. For example, when Guest
Android is running, there will be lots of files being created and
removed. However, virtio-blk BE does not support DISCARD command,
data remove operation in UOS will not trigger erase in eMMC. After
period of time, the eMMC will be consumed out, and erase must be
done by eMMC firmware before writing any new data. This causes the
eMMC performance decrease in the whole system (SOS and UOS).
To solve the problem, DISCARD should be supported in virtio-blk BE.

Tracked-On: #2547
Signed-off-by: Conghui Chen <conghui.chen@intel.com>
Reviewed-by: Shuo A Liu <shuo.a.liu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2019-02-18 18:28:55 +08:00
Conghui Chen
c96e33ca64 dm: storage: rename delete to discard
To keep consistent with kernal code, change delete to discard.

Tracked-On: #2547
Signed-off-by: Conghui Chen <conghui.chen@intel.com>
Reviewed-by: Shuo A Liu <shuo.a.liu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2019-02-18 18:28:55 +08:00
Wei Liu
0cdc13fa0e hv: extend the AC bit of rflags operations for smap
For apl_sdc_stable branch, we now have stac and clac to set and
clear AC bit of rflags. But it can't handle following sequence:
     stac
       stac
       clac
       user mode address access here will trigger page fault
     clac

This patch introduce two more functions:
     - stac_save: Save the rflags and set AC bit
     - ac_restore: Restore the AC bit saved to rflags

Now, only sbuf_put/get are using these new APIs.

Tracked-On: #2525
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
2019-02-15 14:38:53 +08:00
Min Lim
9f9750051d profiling: enable to capture dropped samples while buffering
Since the profiling utilizes the limited size of buffer to capture
sample data, dropping samples could happen while collecting data
if data is generated faster than flushing by consumer. Capturing
the dropped sample info is critical to understand how much the data
is reliable to use.

To capture the information, the new hypercall "PROFILING_GET_STATUS"
is introduced.

Tracked-On: #2474
Signed-off-by: Manisha Chinthapally <manisha.chinthapally@intel.com>
Signed-off-by: Min Lim <min.yeol.lim@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
Signed-off-by: Min Lim <min.yeol.lim@intel.com>
2019-02-15 08:47:49 +08:00
Min Lim
ff48cb0778 profiling: simplify the handling of vmexit loading list
The patch simplifies the way to merge the msr vmexit loading list with HV,
which was already merged to master.

Tracked-On: #2422
Signed-off-by: Min Lim <min.yeol.lim@intel.com>
2019-02-03 14:18:12 +08:00
Yin Fengwei
135ed80f51 watchdog: map the watchdog reset to warm reset
Per debugging requirement, map the watchdog reset to warm reset.
So the ramconsole could be used to capture the kernel log of UOS
before watchdog is hit.

Tracked-On: #2471
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
2019-02-01 11:41:51 +08:00
Min Lim
1de5feb7bb profiling: fix the system freeze issue when running profiling
tool

The msr load/restore during vmexit/vmenty is enabled in HV by
default. The profiling has assumption that it's only user for this
feature, which could overwrite of HV default setting.

This fix combines the msr load list for vmexit when profiling.

Tracked-On: #2422
Signed-off-by: Min Lim <min.yeol.lim@intel.com>
2019-01-30 11:47:36 +08:00
Minggui Cao
b963bd571d HV: check to avoid interrupt delay timer add twice
to edge interrupt, like eth device, it can triger the interrupt again
when its IRQ in softirq entry queue or in timer list.

in current design, for sofrirq entry, it calls "list_del" before
"list_add_tail", to avoid the entry added twice.

so for interrupt delay timer, add to check if it is started
then just drop the next one; to avoid it enqueue twice.

Tracked-On: #2365
Signed-off-by: Minggui Cao <minggui.cao@intel.com>
Reviewed-by: Li, Fei1 <fei1.li@intel.com>
2019-01-30 10:23:34 +08:00
yuhong.tao@intel.com
01bd5ac8dd tools: acrnd: fix wait_for_stop() return wrong vm state
The wait_for_stop() first check if all VM are stopped or suspended.
It first check if VMs are stopped, then check if they are suspend.

If the VMs change state from running to stoped, after check VMs
stopped fail, before start check suspend state. wait_for_stop() will
mistake resopnse 'All vms have entered S3 state successfully'

To fix that, wait_for_stop() must only update VMs's state once, and
see if they are stopped, or suspended.

Tracked-On: #2398
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
2019-01-28 10:02:17 +08:00