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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
The array index of 'vm_list' may be out of bound.
Updated size of profiling_vm_info_list
Bug: ACRN-2544
Tracked-On: #2385
Signed-off-by: Manisha Chinthapally <manisha.chinthapally@intel.com>
In write_trampoline_stack_sym(), when do relocation for pcpu's stack,
it wrongly adds an offset. As a result, during booting, when non-BSP
CPU (APs) tries to run trampoline code once they are waken up by BSP
via SIPI, system hangs.
Tracked-On: #2035
Signed-off-by: Chaohong guo <chaohong.guo@intel.com>
when relocation is enabled, the calcuation of HV size in init_paging
routine is not right. As a result, it doesn't enable NX bit for many
pages which don't belong to hypervisor text section.
Tracked-On: #2035
Signed-off-by: Chaohong guo <chaohong.guo@intel.com>
In init_paging(), when modify page table, it does a round up to 2M on
the starting address of HV memory. If the address is not 2M aligned,
memory overwrite occurs, or memory attribute(cache, u/s) may be not
right. Besides, trusty memory (uos_sworld_memory) in .bss section is 2M
aligned during compiling, after enabling HV memroy 2M alignment, when
relocation is enabled, EFI stub or other loaders just needs to find a
2M-aligned starting addr for HV memory.
Tracked-On: #2035
Signed-off-by: Chaohong guo <chaohong.guo@intel.com>
efi_ctx is passed by EFI stub to hypervisor. The memory was allocated
right after HV binary and marked as Efireserved. But HV is doing a 2MB
alignment in init_paging() and might overwrite the efi_ctx struct or
change the page table attribute. Now, EFI STUB uses Efiloaderdata type
memory and the memory can be re-use by hypervisor/sos after boot time
done. HV should save itself a copy if the content is still needed after
init_paging().
Tracked-On: #2035
Signed-off-by: Chaohong guo <chaohong.guo@intel.com>
Current EFI boot related structs are allocated right after HV binary, and
marked as EfiResered. In fact, the memory should be reclaimed and
managed by HV once EFI boot is done, Moreover, HV is doing 2M alignment,
which is overwriting this allocated memory. This patch is to allocate EFI
info from EFI allocation pool and marked as EFiloaderdata, so that the
memory is used by HV, also, it will reduce the fragmentation.
Tracked-On: #2035
Signed-off-by: Chaohong guo <chaohong.guo@intel.com>
Reviewed-by: Eddie Dong <eddie.dong@intel.com>
Hypervisor does memory alignment during initializing paging(init_paging)
although the starting address allocated by EFI stub doesn't meet the
requirement. As a result, HV might overwrite some memory belong to UEFI
BIOS. The patch introduces a new routine to fix the issue.
Tracked-On: #2035
Signed-off-by: Chaohong guo <chaohong.guo@intel.com>
When do IPC with mngr_send_msg(), and ack is required but failed to
get ack, mngr_send_msg() still return 0, that is not correct.
Tracked-On: #2398
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
/sys/class/gpio/gpio460 is a directory,
should use -d instead of -f to check its existence.
Tracked-On: #2328
Signed-off-by: Binbin Wu <binbin.wu@intel.com>
Collect the dm log to dmesg for profiing.
These mesage will be easy to profile when dm booting.
Tracked-On: #2336
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Reviewed-by: Yin Fengwei <fengwei.yin@intel.com>
The current xHCI mediator doesn't well support disable endpoint command.
This patch is one workaround for disable endpoint command to avoid
xHCI mediator to continue handle already dropped data.
Tracked-On: #2325
Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
This patch is one xDCI passthrough workaround. To support DRD in Guest,
the xDCI does VT-d pass through, and DRD be emulated in xHCI mediator.
With Guest S3 stress test, ramdonly the xDCI can't be emuerated by USB
host even the DRD is already switch to device mode. When this issue
reproduce, does DRD switch to host then switch back can resuce this
issue.
Besides, the virtual drd regiters need to be set to reset value during
Guest warm reset flow.
Tracked-On: #2326
Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>y
During UOS reboot, sometime the wifi firmware status is wrong and can't
handled by UOS driver, this patch add gpio reset for the wifi chip to avoid
such error.
Tracked-On: #2328
Signed-off-by: Binbin Wu <binbin.wu@intel.com>
GPIO460 is used to reset wifi chip on apl-mab.
Export the GPIO pin to userspace so that it can be used in device model.
Tracked-On: #2328
Signed-off-by: Binbin Wu <binbin.wu@intel.com>
1. reduce the time once offline cpu failed.
2. remove the passthru of sd card for GP2.0.
Tracked-On: #2331
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Adding this parameter so that it could provide more info when
kernel panic happens. And this has almost no overhead as it only
uses several existing kernel APIs.
The 0x1f is a bitmask for type of info to be dumped, and it means
it will print task/memory/timer/lock/ftrace info when panic happens.
Tracked-On: #2309
Signed-off-by: Feng Tang <feng.tang@intel.com>
Reviewed-by: Binbin Wu <binbin.wu@intel.com>
When acrnd_vm_timer_func() launch UOS, it need fork() and run, so
that do not block the main process.
Tracked-On: #2306
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
For a running or suspended VM, its state is updated in 2 steps.
It is first set to VM_CREATED, then set to VM_STARTED/VM_PAUSED. IF
one thread check a running/suspend VM, it may get wrong state VM_CREATED,
while another thread is updating the VMs state.
Tracked-On: #2306
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
Print more information at acrnd_add_work(), query_state()
try_do_works() and handle_acrnd_resume()
Tracked-On: #2306
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
Acked-by: Yan, Like <like.yan@intel.com>
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: #2282
Signed-off-by: Yuan Liu <yuan1.liu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
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: #2300
Signed-off-by: Yuan Liu <yuan1.liu@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
This is to align the types used in hypervisor core and profiling.
That cleans up unnecessary type conversions. It also fixes inconsistent
tab/space in data structures.
Tracked-On: #2257
Signed-off-by: Min Lim <min.yeol.lim@intel.com>
Profiling tools are broken, which cause page faults during collection.
The issue happens by enabling SMAP recently. Therefore,
stac() and clac() are used to allow access to buffers allocated
by guest.
Tracked-On: #2157
Signed-off-by: Min Lim <min.yeol.lim@intel.com>
BOARD&FIRMWARE are wrong When 'make sbl-hypervisor-install' w/o parameters
due to default platform is uefi. So set them clearly.
Tracked-On: #1995
Signed-off-by: Tw <wei.tan@intel.com>
Reviewed-by: Binbin Wu <binbin.wu@intel.com>
Currently whether audio works in virtio mediator or pass-through mode can be determined
by checking the device file of vbs_k_audio
But before the completion of loading audio virtio-BE module, the device file of /dev/vbs_k_audio
doesn't exist. In such case in course of loading UOS, the incorrect work mode is selected
for audio device (passthru instead of mediator). This is incorrect
Tracked-On: projectacrn/acrn-hypervisor#2247
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Alek Du <alek.du@intel.com>
1. use RELEASE to control ./tools install target.
Tracked-On: #2168
Signed-off-by: Miguel Bernal Marin <miguel.bernal.marin@linux.intel.com>
Signed-off-by: Minggui Cao <minggui.cao@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
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>
Expose a new ACPI table PSDS to UOS.
This PSDS table show the security capability of the VM.
Only enable this table in UOS when PSDS presented in SOS.
Tracked-On: #2241
Signed-off-by: Binbin Wu <binbin.wu@intel.com>
Reviewed-by: Eddie Dong <eddie.dong@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
Array index of "vbdp_devs" may be out of bounds if
"i >= XHCI_MAX_VIRT_PORTS", so index checking is necessary.
Tracked-On: #1252
Signed-off-by: Tianhua Sun <tianhuax.s.sun@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
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: #2219
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>
We will mark ioreq as COMPLETE in VHM via IC_NOTIFY_REQUEST_FINISH
ioctl. vm_notify_request_done can do it. So remove this one.
Tracked-On: #1821
Signed-off-by: Shuo Liu <shuo.a.liu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
VHM will provide a ioctl to clear all IO requests' status. This is
useful to handle ioreqs in VM normal reboot and emergency reboot.
Tracked-On: #1821
Signed-off-by: Shuo Liu <shuo.a.liu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>