Commit Graph

124 Commits

Author SHA1 Message Date
Jian Jun Chen 919aa3d374 dm: virtio-input: implement virtio_input_deinit
All related resources are freed in virtio_input_deinit.

Signed-off-by: Jian Jun Chen <jian.jun.chen@intel.com>
Reviewed-by: Yin Fengwei <fengwei.yin@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Reviewed-by: Hao Li <hao.l.li@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-05-15 17:25:58 +08:00
Jian Jun Chen 181ff20bcb dm: virtio-input: implement virtio_input_get_config
The implementation of virtio_input_get_config is based on ioctl of
evdev fd. The following properties of input device are got by ioctl
to service configuation request from FE driver:
- name and devids
- propbit
- evbit: keybit/relbit/absbit/mscbit/swbit
- absbit

Signed-off-by: Jian Jun Chen <jian.jun.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-05-15 17:25:58 +08:00
Jian Jun Chen 772a43ac50 dm: virtio-input: implement input event tx/rx
Input events are read from host evdev fd and cached into a local queue.
When SYN_REPORT is read, the cached input events are sent to guest via
EVENT virtqueue. Guest input events are read from STATUS virtqueue then
written to host evdev fd.

Signed-off-by: Jian Jun Chen <jian.jun.chen@intel.com>
Reviewed-by: Hao Li <hao.l.li@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-05-15 17:25:58 +08:00
Jian Jun Chen 25fe5634d3 dm: virtio-input: implement callbacks of virtio_input_ops
This patch implements the callbacks required by virtio_input_ops:
reset/cfgread/cfgwrite/apply_features/set_status.

Signed-off-by: Jian Jun Chen <jian.jun.chen@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Reviewed-by: Hao Li <hao.l.li@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-05-15 17:25:58 +08:00
Jian Jun Chen 9741e1ab2c dm: virtio-input: implement virtio_input_init
The following are done in virtio_input_init:
- parse the command line to get the path of host evdev
- parse the command line to get the optional serial string
- calloc struct virtio_input and initialize it
- call virtio framework APIs to initialize virtio PCI

Signed-off-by: Jian Jun Chen <jian.jun.chen@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Reviewed-by: Hao Li <hao.l.li@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-05-15 17:25:58 +08:00
Jian Jun Chen 8123483ae1 dm: virtio-input: add virtio-input data structures
This patch adds the data structures and macros used to implement
virtio-input.

Signed-off-by: Jian Jun Chen <jian.jun.chen@intel.com>
Reviewed-by: Hao Li <hao.l.li@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-05-15 17:25:58 +08:00
Victor Sun 3fc5ebcd50 DM Cx: build DSDT with cx data
With this patch, UOS would be capable of guest Cx controling.

Signed-off-by: Victor Sun <victor.sun@intel.com>
Acked-by: Kevin Tian <kevin.tian@intel.com>
2018-05-15 17:25:57 +08:00
Victor Sun 5e7e816981 DM Cx: add function to write Cx data to DSDT
The function would write CST objects which needed to enable Cx control
to UOS DSDT table.

Signed-off-by: Victor Sun <victor.sun@intel.com>
Acked-by: Kevin Tian <kevin.tian@intel.com>
2018-05-15 17:25:57 +08:00
Victor Sun a042538565 DM Cx: add function to get cx cnt and cx data
DM will use these functions to get cx entry cnt and cx data then inject
_CST objects to UOS DSDT table.

Signed-off-by: Victor Sun <victor.sun@intel.com>
Acked-by: Kevin Tian <kevin.tian@intel.com>
2018-05-15 17:25:57 +08:00
Victor Sun bdd90e6597 DM Cx: code cleanup for getting cpu state cnt
Then we could use a common interface to get cx count.

Signed-off-by: Victor Sun <victor.sun@intel.com>
Acked-by: Kevin Tian <kevin.tian@intel.com>
2018-05-15 17:25:57 +08:00
Yin Fengwei 81cf3e19f8 DM: main loop cleanup
Move all virtual devices init/deinit to function to simplify the
failure path of main loop. In the future, new virtual device will
not touch main loop.

Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
Acked-by: Eddie Dong <Eddie.dong@intel.com>
2018-05-15 17:25:57 +08:00
Yin Fengwei edc584611a DM: ioc code cleanup
- make ioc_init/ioc_deinit take struct vmctx as argument
- ioc_init return int instead of pointer to struct ioc_dev
- add ioc_dev in vmctx to track ioc_dev
- remove the atkbdc.h included in vmmapi.h

Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Reviewed-by: Liu, Yuan1 <yuan1.liu@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
Reviewed-by: Wang Yu <yu1.wang@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
Acked-by: Eddie Dong <Eddie.dong@intel.com>
2018-05-15 17:25:57 +08:00
Yin Fengwei 4fcdebc434 DM: vrtc code cleanup
- Move the variable local_time from main.c to rtc.c
- Change vrtc_init to return int instead of pointer to vrtc. We do
  track vrtc in struct vmctx.

Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2018-05-15 17:25:57 +08:00
Icarus Sparry 7073173ec3 Use exit instead of assert when checking images
Print an error message and exit rather than using assert, so it is
more obvious what the problem is and no core files are produced.

Fixes #61

Signed-off-by: Icarus Sparry <icarus.w.sparry@intel.com>
2018-05-15 17:25:57 +08:00
Jie Deng d63b9002dd dm: code clean up
Following functions have never been used anywhere.
Let's remove them.

fbsdrun_muxed()
fbsdrun_vmexit_on_hlt()
fbsdrun_vmexit_on_pause()
fbsdrun_disable_x2apic()

Remove weird prefix "fbsdrun" from following functions' name.

fbsdrun_virtio_msix()  -->  virtio_uses_msix()
fbsdrun_start_thread() -->  start_thread()

Signed-off-by: Jie Deng <jie.deng@intel.com>
Reviewed-by: Hao Li <hao.l.li@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-05-15 17:25:57 +08:00
Jie Deng d1a17a6401 dm: rename fbsdrun_addcpu and fbsdrun_deletecpu
Remove weird prefix "fbsdrun" from the function name.
Since "fbsdrun_addcpu" has never been called by external
functions, Let's remove its declaration from "dm.h" and
make it as a static function to keep consistency with
"fbsdrun_deletecpu".

Signed-off-by: Jie Deng <jie.deng@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-05-15 17:25:57 +08:00
yuhong.tao@intel.com 15e15c9a86 Bugfix: DM:tools:acrnctl launch script output is binary file
The launch script can output log messages, that should be text.
But it is not always true. E.g. "launch_UOS.sh -U 2" echo message
contain '\0', The 'grep' command will show "Binary file (xxxxxx)
matches", thus acrnctl can't get the vmname. We can use 'grep -a'
instead.

Acked-by: Xu Anthony <anthony.xu@intel.com>
Reviewed-by: Yan Like <like.yan@intel.com>
Reported-by: Chen ChengX <chengx.chen@intel.com>
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
2018-05-15 17:25:56 +08:00
Yin Fengwei d2945e757e DM: fix virtio_net tx_thread block issue
If guest doesn't initialize the net device, the tx thread will
block at the first tx_cond wait. When virtio_net_tx_stop is
invoked, the tx_thread will block on second tx_cond then.

Check whether we should exit tx_thread after first tx_cond
waiting

Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Reviewed-by: Hao Li <hao.l.li@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-05-15 17:25:56 +08:00
Liu Yuan cb41210104 IOC mediator: update signal whitelist
Add AmbientTemperature signal into the whitelist,
instead of TemperatureSensorEnvironment signal.

Signed-off-by: Liu Yuan <yuan1.liu@intel.com>
Reviewed-by: Wang Yu <yu1.wang@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-05-15 17:25:56 +08:00
Liu Yuan 10c3a98577 IOC mediator: update signal whitelist
Remove some useless signals from the whitelist and add new three signals into
the whitelist based on requirement.

Signed-off-by: Liu Yuan <yuan1.liu@intel.com>
Reviewed-by: Wang Yu <yu1.wang@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-05-15 17:25:56 +08:00
Edwin Zhai 3648a0cd6f VTd: bluetooth passthrough support
Adds ACPI tables for 0:18.0(UART) device

Signed-off-by: Edwin Zhai <edwin.zhai@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
2018-05-15 17:25:56 +08:00
Jason Chen CJ 4f6bdee0c5 DM: change VM_SYSMEM/VM_MMIO to VM_MEMMAP_SYSMEM/VM_MEMMAP_MMIO
these MACROs are only for MEMMAP

Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
2018-05-15 17:25:56 +08:00
Jason Chen CJ 25ef14edac hugetlb: add ept map memseg support
adding API vm_map_memseg_vma() which using ioctl IC_SET_MEMSEG call
into VHM for futher mem(ept) mapping, based on user vma information.

Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
Acked-by: Xu, Anthony <anthony.xu@intel.com>
2018-05-15 17:25:55 +08:00
Jason Chen CJ 4cad694be2 dm: add hugetlb memory management support
Type '-T' in DM cmdline to enable hugetlb memory allocation.
It enabled 2 level of huge page:
Level 1: size 2M, path: /run/hugepage/acrn/huge_lv1/guid
Level 2: size 1G, path: /run/hugepage/acrn/huge_lv2/guid

NOTE:
before running, please make sure system already have enough hugepages
reserved under:
/sys/kernel/mm/hugepages/hugepages-xxxxkB/nr_hugepages

Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
Acked-by: Xu, Anthony <anthony.xu@intel.com>
2018-05-15 17:25:55 +08:00
Minggui Cao fdfb71e075 delete watchdog timer when deinit is called
to avoid system resource/memory leaked when guest os reboot.

Signed-off-by: Minggui Cao <minggui.cao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-05-15 17:25:55 +08:00
Jian Jun Chen a3316241d4 dm: virtio-console: Fix the bug that ports cannot work
If multiple ports are defined in the command line, is_console is
not set to a correct value for non-console ports when the definition
of this non-console port is following the definition of a console port.
For example in below definition, the second port is configured as
console port which is not correct:

-s 5,virtio-console,@pty:pty_port,file:file_port=/home/root/test1

Signed-off-by: Jian Jun Chen <jian.jun.chen@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2018-05-15 17:25:55 +08:00
Yin Fengwei 96085d960f DM: release mem range allocated in init_pci
Two memory ranges are allocated:
  - PCI ECFG
  - PCI hole
They should be released when deinit_pci. Old code mark
this two ranges not unregistered. Which is wrong for
warm reboot case. Make them could be unregistered.

Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2018-05-15 17:25:55 +08:00
Yin Fengwei 097aee76bf DM: release mevent when doing virtual device deinit
When doing warm reboot, the mevent module will not be deinitialized.
We need to delete all mevent registered while deinit virutal device.

Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2018-05-15 17:25:55 +08:00
Yin Fengwei e65b98bf36 DM: lpc_deinit doesn't release all resources allocated.
Also refine the failure path of lpc_init to make sure all
resources allocated get release.

Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2018-05-15 17:25:55 +08:00
Yin Fengwei 1a2a07476b DM: cleanup resource for uart.
Add deinit function for uart.
Another work is add resource cleanup functions which is called
by other components when they are using uart.

Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2018-05-15 17:25:55 +08:00
Yin Fengwei c8585a22e3 DM: add deinit function for bvmcons
Move the bvmcons enable flag from main.c to consport.c.
So we don't need the flag in main.c for bvmcons.

Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2018-05-15 17:25:55 +08:00
Liu Yuan 5b06d17fb1 IOC mediator: boot IOC device from the main entry
Add "-i" in the DM boot command line for booting IOC mediator.

NOTE: currently only ioc_init will be called in the main entry, ioc_deinit
hasn't be called so far. The DM plans to add one virtual devices list inside
of struct vmctx in the near furture, and virtual devices data structure will
add one common deinit callbacks which will be called during VM exits.

Will support ioc_deinit once that patch merged.

Signed-off-by: Liu Yuan <yuan1.liu@intel.com>
Reviewed-by: Wang Yu <yu1.wang@intel.com>
Reviewed-by: Liu Shuo <shuo.a.liu@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-05-15 17:25:54 +08:00
Liu Yuan fd5472b421 IOC mediator: DEBUG: add dummy channels
Add three PTY devices as dummy native channels. They are used for emulating
native lifecycle channel, native signal channel and native OEM raw channel
for IOC debugging.

Signed-off-by: Liu Yuan <yuan1.liu@intel.com>
Reviewed-by: Wang Yu <yu1.wang@intel.com>
Reviewed-by: Liu Shuo <shuo.a.liu@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-05-15 17:25:54 +08:00
Liu Yuan 75b5e670d5 IOC mediator: DEBUG: support IOC log file
This patch is used for IOC mediator debugging. Due to IOC message logs are
too much, need to save into one file instead of output stdout directly.
By default, the debug log is disabled.

Signed-off-by: Liu Yuan <yuan1.liu@intel.com>
Reviewed-by: Wang Yu <yu1.wang@intel.com>
Reviewed-by: Liu Shuo <shuo.a.liu@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-05-15 17:25:54 +08:00
Liu Yuan 746d437642 IOC mediator: support IOC signal whitelist
This patch implements the signal whitelist feature.
All the signal messages will be discarded if they are not existed in whitelist.

Signed-off-by: Liu Yuan <yuan1.liu@intel.com>
Reviewed-by: Wang Yu <yu1.wang@intel.com>
Reviewed-by: Liu Shuo <shuo.a.liu@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-05-15 17:25:54 +08:00
Liu Yuan 76e74b0cf8 IOC mediator: support CBC signal services
This patch implements the IOC CBC signal serivces including single signal,
multi-signal and group signal. All of them are used for CAN devices
communication and IOC on-board peripherals control.

Signed-off-by: Liu Yuan <yuan1.liu@intel.com>
Reviewed-by: Wang Yu <yu1.wang@intel.com>
Reviewed-by: Liu Shuo <shuo.a.liu@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-05-15 17:25:54 +08:00
Liu Yuan 61db2c78cc IOC mediator: support IOC lifecycle
This patch implements the IOC lifecycle virtualization.

In native environment, lifecycle is uesed for SoC system power control,
likes enter/exit S3/S5. So these related messages can not forward directly
between physical IOC and Guest OS, they need to be mapped to VM pause, exit
and launch.

Signed-off-by: Liu Yuan <yuan1.liu@intel.com>
Reviewed-by: Wang Yu <yu1.wang@intel.com>
Reviewed-by: Liu Shuo <shuo.a.liu@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-05-15 17:25:54 +08:00
Liu Yuan a1d7cae148 IOC mediator: IOC signal and group definitions
This patch adds the IOC signal identities and signal group identities,
that will be used by subsequent signal support patches.

Signed-off-by: Liu Yuan <yuan1.liu@intel.com>
Reviewed-by: Wang Yu <yu1.wang@intel.com>
Reviewed-by: Liu Shuo <shuo.a.liu@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-05-15 17:25:54 +08:00
Liu Yuan 4eff8d10a1 IOC mediator: implement CBC protocol stack
Carrier Board Communication(CBC) protocol is a duplex protocol for IOC data
transfer, including physical layer, link layer, address layer and service layer.

Signed-off-by: Liu Yuan <yuan1.liu@intel.com>
Reviewed-by: Wang Yu <yu1.wang@intel.com>
Reviewed-by: Liu Shuo <shuo.a.liu@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-05-15 17:25:54 +08:00
Liu Yuan c9d7643462 IOC mediator: add IOC channel operations
IOC mediator communicates with native IOC HW through several native channels of
CBC protocol. And IOC mediator communicates with virtual UART through one virtual
channel.

This patch implements channel operations including open/close/read/write.

Signed-off-by: Liu Yuan <yuan1.liu@intel.com>
Reviewed-by: Wang Yu <yu1.wang@intel.com>
Reviewed-by: Liu Shuo <shuo.a.liu@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-05-15 17:25:54 +08:00
Liu Yuan cfa6481bc9 IOC mediator: initialize IOC mediator
IOC mediator main functionality is transfer data between native CBC char
devices and virtual UART, it is implemented as full virtualization, Guest
OS can reuse native CBC driver directly.

Signed-off-by: Liu Yuan <yuan1.liu@intel.com>
Reviewed-by: Wang Yu <yu1.wang@intel.com>
Reviewed-by: Liu Shuo <shuo.a.liu@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-05-15 17:25:54 +08:00
Liu Yuan 45758be573 IOC mediator: add IOC mediator definition
Add Automotive IOC mediator data structure definitions.

Signed-off-by: Liu Yuan <yuan1.liu@intel.com>
Reviewed-by: Wang Yu <yu1.wang@intel.com>
Reviewed-by: Liu Shuo <shuo.a.liu@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-05-15 17:25:54 +08:00
Jack Ren f3db18b981 version: v0.1-rc4
Signed-off-by: Jack Ren <jack.ren@intel.com>
2018-05-15 17:25:50 +08:00
Yin Fengwei c6bf67543c DM: mevent_add/del refine for Linux
Unlike kqueue/kevent of BSD, the epoll of Linux could be
add/del by using different API on the fly.

This patch drops the notify used by mevent_add/del and
call epoll_ctl to add/delete target fd. Only keeps
global_head to track mevent added and makes the code
logic in mevent_dispatch() a littel bit simpler.

Another thing is related with epoll_ctl. If the target
fd is regular fd which doesn't support epoll, epoll_ctl
will return -1. When DM is start by systemd, the STDIO
is not mapped to terminal, epoll_ctl on STDIO could
return -1. Which block UOS boot. We only call mevent_add
after confirm STDIO is mapped to terminal.

Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2018-05-15 17:25:27 +08:00
Yin Fengwei db46df940e DM: add init/deinit function for mevent
Current, mevent cleanup path has issue. There are possible
following calling sequence happen when reboot/poweroff UOS:
 1. mevent_dispatch() calls mevent_destroy
 2. do_close_post calls some virtual device deinit to delete
    mevent.

This patch introduce mevent init/deinit to make sure:
 1. mevent init
 2. mevent_add is called when init virtual device
 3. mevent_del is called when deinit virtual device
 4. mevent deinit

Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2018-05-15 17:25:27 +08:00
Yin Fengwei d3a640da92 DM: add add_e820_entry to update e820 table.
For vSBL boot path, we need to mark the memory vSBL is using
as reserved in e820 table. The add_e820_entry is added to
update the e820 table dynamically.

To simplify the code logic, we assume:
  - vSBL is put the middle of one entry of default e820 table
  - That entry has orignal RAM type in e820 table
  - The e820 table has enough space to hold two more new entries.

If there is more complicated case in the future, we could extend
add_e820_entry to handle it.

Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2018-05-15 17:25:26 +08:00
Yin Fengwei 223efeb986 DM: Update the default e820 table to reserve 0xF0000~0x100000
The region of MPtable/ACPI table/SMBios resides in
0xF0000 ~ 0x100000. They should be marked as RESERVED instead of
RAM type in e820 table.

Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2018-05-15 17:25:26 +08:00
Liu Shuo ee43f23b0e dm: release host memory after devices de-init
Devices' de-init process might access some mapped memory space, such as
virtio virtqueues. Access after unmap will cause a fault.

Release the memory map after de-init processes can avoid it. Reading
more code, there are many error handling lost to unmap the memory.
Refined the code to do it.

Signed-off-by: Liu Shuo <shuo.a.liu@intel.com>
Reviewed-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2018-05-15 17:25:26 +08:00
Yin Fengwei cee499f867 DM: fix build issue with gcc 4.8.4 on ubuntu 14.04
There are two build issues:
- add -fno-strict-aliasing to address
  error: dereferencing type-punned pointer will break strict-aliasing rules

- initialize tfd to zero to address
  error: ‘tfd’ may be used uninitialized in this function

Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
2018-05-15 17:25:26 +08:00
Qi Yadong e86b01f57e Revert "Fix compilation on Ubuntu 14.04"
This reverts commit bc0579d0ff.

The commit bc0579d makes acrn-dm crashed when launch UOS.
Crash log:
./launch_UOS.sh: line 112:   377 Segmentation fault (core dumped) acrn-dm ...
dmesg log:
acrn-dm[1264]: segfault at 1f0 ip 0000000000412257 sp 00007fffc1af9920 error 6 in acrn-dm[400000+3d000]

After this patch reverted, UOS launched successfully.
2018-05-15 17:25:26 +08:00