Commit Graph

581 Commits

Author SHA1 Message Date
Conghui Chen 3010718d4a dm: cmdline: remove unused parameters
Remove unused parameters for acrn-dm

Tracked-On: #1616
Signed-off-by: Conghui Chen <conghui.chen@intel.com>
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
2018-10-26 13:37:47 +08:00
Xiaoguang Wu 4261ca223e DM USB: xHCI: refine logic of Disable Slot Command
Remove the changing operation for 'xdev->native_ports[].state' in
pci_xhci_cmd_disable_slot. The operation should not be done in this
funciton.

Tracked-On: #1589
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-10-26 13:36:50 +08:00
Xiaoguang Wu e1e0d3047e DM USB: xHCI: refine the USB disconnect logic in DM
On certain SOC, during the system suspend and resume process, connecting
and disconnecting events may happen. In previous implementation, DM didn't
clear PED bit in the xHCI PORTSC register, this will induce many invalid
polling operations in UOS and fail to enumerate one or more USB devices.

Tracked-On: #1589
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-10-26 13:36:50 +08:00
Xiaoguang Wu f799e8fa1c DM USB: xHCI: fix process logic of LINK type TRB
When the LINK type TRB are received, it should not be counted as
valid date block to give libusb. This patch is used to fix it.

Tracked-On: #1567
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-10-26 13:36:50 +08:00
Xiaoguang Wu 08a7227fe6 DM USB: xHCI: fix bug in port unassigning function
The function for port unassigning: pci_xhci_clr_native_port_assigned
should reset the 'info' member to all zero when it is called.

Tracked-On: #1434
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-10-26 13:36:50 +08:00
Xiaoguang Wu d7008408d0 DM USB: xHCI: fix issue: crash when plug device during UOS booting
This issue is result from reporting interrupt when the interrupt ability
of virtual xHCI is disabled.

As Event Ring State Machine showed in Figure 20 of xHCI spec, following
rules should be followed:
1 when RS bit of USBCMD register is zero, Event Ring should not be accessed;
2 when INTE bit of USBCMD register is zero, Interrupt should not be sent.

Tracked-On: #1566
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-10-26 13:36:50 +08:00
Jian Jun Chen 655132fc8e dm: virtio: remove unused vbs_kernel_init
Tracked-On: #1364
Signed-off-by: Jian Jun Chen <jian.jun.chen@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-10-25 15:39:57 +08:00
Yin Fengwei eb265809af DM: multiboot info address in DM for elf loader is wrong.
The () was missed during the patch refine. This patch add it.

Tracked-On: #1465
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-10-25 15:39:40 +08:00
Liang Yang 80e02c9708 DM USB: xHCI: Fix an potential array out of range issue.
When usb device numbers reach up to XHCI_MAX_SLOTS. The slot_allocated
array will get out of range. This patch is used to fix this issue.

Tracked-On: #1479
Signed-off-by: Liang Yang <liang3.yang@intel.com>
Reviewed-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-10-25 13:46:05 +08:00
Liang Yang 84c0c87842 DM USB: xHCI: Fix a potential NULL pointer issue.
After excap pointer is assigned, it should be checked whether it's
possible to get assignment for NULL pointer or not. This patch
fixes this issue.

Tracked-On: #1479
Signed-off-by: Liang Yang <liang3.yang@intel.com>
Reviewed-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Reviewed-by: Liu Shuo <shuo.a.liu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-10-25 13:46:05 +08:00
Yin Fengwei 482a4dcc02 DM: correct the predefine DM option string.
That string was changed by accident and introduced the removed
items.

Tracked-On: #1465
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2018-10-25 13:44:09 +08:00
Zhi Jin ad1ef7ba1b samples: enable pstore via the sos kernel cmdline
Enable pstore via the sos kernel cmdline, as ABL doesn't
reserve memory and pass parameters for pstore.

Tracked-On: #1024
Signed-off-by: Zhi Jin <zhi.jin@intel.com>
Reviewed-by: Binbin Wu <binbin.wu@intel.com>
2018-10-25 13:43:25 +08:00
Binbin Wu 96f8becca6 dm: bios: update vSBL to v1.0
New feature:
	Update vFastboot to v1.0
	Boot time optimization
	Support Crash mode, which uses vFastboot in vSBL as Crash mode target.
	Support Ramooops.

Tracked-On: #968, #1578, #1579, #1580
Signed-off-by: Binbin Wu <binbin.wu@intel.com>
2018-10-25 13:42:12 +08:00
Jason Chen CJ 19abb419c6 launch_uos.sh: make sure cpu offline by retry
if acrnd or acrn_guest service enabled, launch_uos.sh will be called
early time during system boot up, while a pci driver module may be
insmod and disable cpu hotplug in short time, which could make
cpu offline fail, we need check it to make sure cpu offline real happen
before hypercall to disable vcpu.

Tracked-On: https://github.com/projectacrn/acrn-hypervisor/issues/1584
Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
2018-10-25 13:37:43 +08:00
Minggui Cao 4228c81b3f DM: compare unsigned numbers to avoid overflow.
compare the two unsigned numbers to avoid delta calculation overflow.
It could happen during UOS warm root, which can trigger a "fake"
interrupt storm.

Tracked-On: #1476
Signed-off-by: Minggui Cao <minggui.cao@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2018-10-25 13:30:47 +08:00
Jie Deng 7195537a6b dm: virtio-net: replace banned functions
sscanf and strcpy are banned according to the security requirements.
So replace them with their safe alternative.

Tracked-on: #1496
Signed-off-by: Jie Deng <jie.deng@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-10-24 18:16:37 +08:00
Jie Deng 7579678dd6 dm: add const declaration for dm_strto* APIs
These APIs are wrap of standard strto* APIs. The first parameters in
these APIs should be declared as "const" since they have never been
changed so that they can also be used when passing a variable declared
as const char *

Fixes: e1dab512c2 ("dm: add string convert API")
Tracked-on: #1496

Signed-off-by: Jie Deng <jie.deng@intel.com>
Reviewed-by: Conghui Chen <conghui.chen@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-10-24 18:16:37 +08:00
Huang, Yang bd97e5cbe2 dm: rpmb: Support RPMB mode config from launch.sh
physical RPMB is accessed if "phisycal_rpmb" is specified
in launch.sh.
Also it reserves some RPMB area with a fixed size(32KB) for
AttKB and future usage, which is RO for UOS.

Tracked-On: #1544
Signed-off-by: Huang, Yang <yang.huang@intel.com>
Acked-by: Zhu Bing <bing.zhu@intel.com>
2018-10-24 18:15:14 +08:00
Signed-off-by: Aviad Nissel 7ca1a7de7d dm: launch_uos.sh add virtio_mei mediator
Detect if SOS kernel mei drivers supports virtualization,
via driver hbm version 2.2
If yes use virtio_mei mediator for the mei device
otherwise fallback to passthrou mode.
Note that HBM version is not sufficient identification

Tracked-On: #1536
Signed-off-by: Aviad Nissel <aviad.nissel@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2018-10-23 11:40:15 +08:00
Tomas Winkler 201e5cec0a dm: mei: enable virtio_mei compilation
Add virtio_mei to the Makefile

Tracked-On: #1536
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2018-10-23 11:40:15 +08:00
Tomas Winkler d4b9bd599d dm: mei: add module initialization
Register virtio device virtio-mei.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>

Tracked-On: #1536
Signed-off-by: Liu Shuo <shuo.a.liu@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2018-10-23 11:40:15 +08:00
Tomas Winkler f6e6e8584e dm: mei: implement vmei_start/stop()
In vmei_start() the HBM host client is created,
it handles HBM protocol.
The HBM client is a management object and
is not exposed by the mei native driver.
The communication between TX and RX threads
is handed via internal pipe(2).
Second, we connect all fixed address clients as the mei
protocol doesn't provide connection mechanism for them,
they appear always connected.
Last, the hw_ready is set.

Define virtio_mei_ops, ass all the handlers are now available.

Tracked-On: #1536
Signed-off-by: Liu Shuo <shuo.a.liu@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2018-10-23 11:40:15 +08:00
Tomas Winkler 6a1f824229 dm: mei: implement rx flow.
Rx is triggered from epoll event (mevent), a host client
is retrieved from associated event data. P proper mei message header is
attached to the packet and sent to the virtio FE device.

Tracked-On: #1536
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2018-10-23 11:40:15 +08:00
Tomas Winkler 50ecd93b24 dm: mei: implement tx flow
TX from virtio driver is handled firt via
virio tx notify handler vmei_notify_tx(),
placed into host clinet tx circular buffer.
TX thread will then write the data to the device.

Tracked-On: #1536
Signed-off-by: Vitaly Lubart <vitaly.lubart@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2018-10-23 11:40:15 +08:00
Tomas Winkler 483a893e57 dm: mei: implement HBM protocol handler
Implement the FW part of the HBM protocol.
Currently the support version is 2.0.
The HBM protocol handles client management, such
initialization handshake, connection, power management,
and the flow control.

Tracked-On: #1536
Signed-off-by: Vitaly Lubart <vitaly.lubart@intel.com>
Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2018-10-23 11:40:15 +08:00
Tomas Winkler 98c6b7a692 dm: mei: add native io handlers
Add read write and connect handler,
that perform io peration on SOS /dev/meiX
device.

Tracked-On: #1536
Signed-off-by: Vitaly Lubart <vitaly.lubart@intel.com>
Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2018-10-23 11:40:15 +08:00
Tomas Winkler 3abbf10e55 dm: mei: add me clients enumeration
ME client enumeration is received from sysfs attributes
of the native device.

V3: Use bounded functions.

Tracked-On: #1536
Signed-off-by: Vitaly Lubart <vitaly.lubart@intel.com>
Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2018-10-23 11:40:15 +08:00
Tomas Winkler 7cbb3872a2 dm: mei: add virtio cfgread/cfgwrite handlers.
mei mediator perform reset handshake via
the cfgread/write handlers and provide access
to fw status registers.

Tracked-On: #1536
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2018-10-23 11:40:15 +08:00
Signed-off-by: Aviad Nissel f462601b0a dm: mei: add reset handlers
There are multiple types of resets that need to be handled
by the mei device.
The reset may be initiated from both sides host or fw.
The host requests reset on probe and remove,
power state transaction, and errors,
while ME FW may request reset upon error.
If the native device undergo reset the host application
has to be notified.

Tracked-On: #1536
Signed-off-by: Aviad Nissel <aviad.nissel@intel.com>
Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2018-10-23 11:40:15 +08:00
Tomas Winkler a632ac3dae dm: mei: add client management infrastructure
1. virtio_mei structure represents an instance of mei device.
2. vmei_me_client represents an ME application in the MEI FW.
3. vmei_host_client represent a host application talking to the
ME application, ME application can support multiple connections.
4. Add debug helpers

Tracked-On: #1536
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2018-10-23 11:40:15 +08:00
Tomas Winkler 445f419304 dm: mei: add virtio configuration
The virtio has two virtio queues, TX and RX.
TX have two segment buffers one for header and one for data.
The virtio_mei declares host buffer of size 128 slots, each
slot is a 4 bytes value.
For synchronization hw_ready and host_reset configuration flags
are used that emulates mei reset flow.
And last fw status registers must be also readable via virtio
mei device.

Tracked-On: #1536
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2018-10-23 11:40:15 +08:00
Tomas Winkler 0dc7adfbac dm: mei: add sysfs read functions
mei requires reading of u8, u32 and uuid
sysfs files.

Tracked-On: #1536
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Vitaly Lubart <vitaly.lubart@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2018-10-23 11:40:15 +08:00
Tomas Winkler b8d53d17d5 dm: mei: add reference counter functions
mei handles objects on the list, hence reference counting
infrastructure is required for easier multithreading.

Tracked-On: #1536
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2018-10-23 11:40:15 +08:00
Tomas Winkler 6a96878e0b dm: types: add container_of macro
Add standard container_of macro to access
the parent struct pointer.

Tracked-On: #1536
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2018-10-23 11:40:15 +08:00
Alexander Usyskin 4e057c32d2 dm: mei: add guid handling functions
libuuid sports only uuid (big endian encoding),
though mei requires guids (little endian encoding).
The base types are based on <linux/uuid.h> header.

Tracked-On: #1536
Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2018-10-23 11:40:15 +08:00
Tomas Winkler d141aebdcd dm: mei: add mei hbm protocol definitions header.
HBM is a control channel protocol between mei device
driver and mei fw.

Add new ioctl IOCTL_MEI_CONNECT_CLIENT_VTAG

Tracked-On: #1536
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2018-10-23 11:40:15 +08:00
Tomas Winkler 0cc50b1d43 dm: remove virtio_heci
Remove virtio_heci to be replaced with virtio_mei

Tracked-On: #1536
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2018-10-23 11:40:15 +08:00
yuhong.tao@intel.com 2973db7839 DM: VMcfg: generated example header
devicemodel/vmcfg/example.h is a example, it is generated at build
time.

Tracked-On: #1528
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
2018-10-22 16:57:23 +08:00
yuhong.tao@intel.com c86da0034e DM: VMcfg: support --dump options
run 'acrn-dm --dump <index>' to show build-in parameters

Tracked-On: #1528
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
2018-10-22 16:57:23 +08:00
yuhong.tao@intel.com 67d7292081 DM: VMcfg: support --vmcfg options
Enable --vmcfg options for acrn-dm, if --vmcfg <index> is specified,
build-in VM configuration will be used, and override any other
optional parameters.
run 'acrn-dm --vmcfg list' to show all build-in VM configurations.
run 'acrnpdm --vmcfg <index>' to launch UOS with selected config.

Tracked-On: #1528
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
2018-10-22 16:57:23 +08:00
yuhong.tao@intel.com 321021ebaf DM: VMcfg: mrb-env-setup.sh
Script that setup envriment on MRB platform, for UOS with build-in
configuration
For example, you need to run  mrb-env-setup.sh once, to
prepare images, networks and pci-stubs, etc,.

Tracked-On: #1528
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
2018-10-22 16:57:23 +08:00
yuhong.tao@intel.com d2ed9955fd DM: VMcfg: support VM1 on MRB
Add build-in vm1 configuration for MRB platform, this is also an
example about how to add new VM configurations

Tracked-On: #1528
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
2018-10-22 16:57:23 +08:00
yuhong.tao@intel.com ae5b32dcb3 DM: VMcfg: build-in vm configurations
use *args_buildin[] to hold build-in VM configurations

Tracked-On: #1528
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
2018-10-22 16:57:23 +08:00
yuhong.tao@intel.com 646cc8c4b2 DM: VMcfg: Kconfig & Makefile for VM Configuration
VMcfg use Kconfig mechanism to generate a header file
devicemodel/include/vmcfg_config.h, which contains many macro symbols
for conditionally compiling. This feature is disabled by default, to
enable it, You can switch to devicemodel/vmcfg/ and run 'make' with
these options:

'make menuconfig'
run 'make menuconfig' at ./devicemodel/vmcfg/, and configure manually.
When you finished, save your changes to ./devicemode/vmcfg/.config

'make oldconfig'
Overwrite ./devicemodel/vmcfg/.config with your config file, then run
'make oldconfig' at ./devicemodel/vmcfg

'make *_defconfig'
E.g, there is ./devicemodel/vmcfg/config/mrb_defconfig, you can run
'make mrb_defconfig' at ./devicemodel/vmcfg/

Tracked-On: #1528
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
2018-10-22 16:57:23 +08:00
Xiaoguang Wu 6a9a46ac47 DM USB: xHCI: workaround for Stop Endpoint Command handling
This patch is one workaround to resolve a crash issue for certain brand
touch screen (eGalaxTouch EXC7200-7368v1.01). The formal fix should
follow the xHCI spec to stop xfer and generate transfer completed event
trb prior to Stop Endpoint Command complete event trb. It should be a
big change and for short term, do nothing for the stop endpoint command
which is no other side effect be observed so far.

Tracked-On: #1413
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-10-19 22:39:50 +08:00
Xiaoguang Wu ecf0585bf2 DM USB: xHCI: fix incorrect device searching logic
The function pci_xhci_get_native_port_index_by_path didn't
compare the bus number during the process of native USB
device searching. This patch is used to fix it.

Tracked-On: #1434
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-10-19 22:39:50 +08:00
Xiaoguang Wu 6b2a18a866 DM USB: add support for multi-layers hubs
This patch is used to support emulation of multiple layers of hubs
under Flat Mode.

Tracked-On: #1434
Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Signed-off-by: Liang Yang <liang3.yang@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-10-19 22:39:50 +08:00
Liang Yang f533a07af1 DM USB: xHCI: support multiple hubs in single layer
This patch is used to enable multiple hubs in single layer under
Flat Mode.

Tracked-On: #1434
Signed-off-by: Liang Yang <liang3.yang@intel.com>
Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-10-19 22:39:50 +08:00
Xiaoguang Wu 6886d3cdf8 DM USB: xHCI: change port mapping logic for multiple hub support
To support the multiple hubs and multiple layers of hub, the
port_map_tbl should be replaced by native_ports to record all
native devices' state, including assignment state, emulation
state etc.

Tracked-On: #1434
Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Signed-off-by: Liang Yang <liang3.yang@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-10-19 22:39:50 +08:00
Xiaoguang Wu 540ce05f27 DM USB: introduce function usb_get_native_devinfo
There are many places in USB emulation implementation to get
native USB device infomation, and the related codes are long
and repeated many times. This patch introduces function
usb_get_native_devinfo to remove redundent codes for the
purpose mentioned above.

Tracked-On: #1434
Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Signed-off-by: Liang Yang <liang3.yang@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-10-19 22:39:50 +08:00
Liang Yang e8f7b6fa74 DM USB: introduce struct usb_devpath and releted functions
This patch introduce struct usb_devpath to indentify uniquely an USB
device, which is basic element for multiple hub support.

Tracked-On: #1434
Signed-off-by: Liang Yang <liang3.yang@intel.com>
Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-10-19 22:39:50 +08:00
Liang Yang 14bc961f03 DM USB: xHCI: remove old hub support code.
Previous design use bus and port(root hub port) for the identification
to the native USB device. It cannot work properly under the multi-hub
situation due to external USB hub is introduced.

This patch removes old hub implementation code, and subsequent patches
will be add support for mutiple hubs.

Tracked-On: #1434
Signed-off-by: Liang Yang <liang3.yang@intel.com>
Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-10-19 22:39:50 +08:00
Shuo Liu 268a9f1453 [REVERTME] dm: script: disable xHCI runtime PM to WA USB role switch hang issue
When do USB role switch between host and device mode, we hit hang issue.
It might be caused by accessing suspended xHCI during that. This issue
need to be root caused later in xHCI driver.

This is a workaround solution, which will be reverted when got a fix.

Tracked-On: #1516
Signed-off-by: Shuo Liu <shuo.a.liu@intel.com>
Reviewed-by: Binbin Wu <binbin.wu@intel.com>
Reviewed-by: Yu Wang <yu1.wang@intel.com>
2018-10-19 22:34:40 +08:00
Huang, Yang ffcf62982d dm: rpmb: DM customized changes for RPMB mux kernel module
As RPMB mux kernel module is going to be created,
there are two corresponding changes required for DM:
1. The name has been changed to /dev/rpmbmux.
2. DM does NOT check MAC of RPMB result returned by kernel
   module because DM doesn't own the real key.

Tracked-On: #1508
Signed-off-by: Huang, Yang <yang.huang@intel.com>
Acked-by: Zhu Bing <bing.zhu@intel.com>
2018-10-19 22:31:28 +08:00
Victor Sun de10df2693 DM: add MSI and INTR support for i6300esb watchdog
Per i6300esb spec, when WDT_INT_TYPE(bit 0 and 1 of WDT config register)
are set to 00, IRQ feature should be supported.

The WDT_INT_ACTIVE bit is set when the first stage of the 35-bit
down-counter reaches zero. An interrupt will be generated if WDT_INT_TYPE
is configured to do so (See WDT Configuration Register). This is a sticky
bit and is only cleared by writing a 1.

SMI feature(WDT_INT_TYPE are set to 0x10) is not supported.

Tracked-On: #1498
Signed-off-by: Victor Sun <victor.sun@intel.com>
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
2018-10-18 09:30:01 +08:00
Conghui Chen 21458bddff dm: storage: banned functions replace
1. replace sscanf with string API.
2. replace sprintf with snprintf
3. replace strlen with strnlen

Tracked-on: #1496
Signed-off-by: Conghui Chen <conghui.chen@intel.com>
Reviewed-by: Shuo Liu <shuo.a.liu@intel.com>
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
2018-10-17 16:22:00 +08:00
Conghui Chen e1dab512c2 dm: add string convert API
As function sscanf is banned, to get value from parameter buffer,strto*
is recommended. To reduce the inspection code when using strto*, it's
better to use a string convert API.

Usage:
    For virtio-blk, it has parameters:
        range=<start lba>/<subfile size>
    sscanf:
        if (sscanf(cp, "range=%ld/%ld", &sub_file_start_lba,
                &sub_file_size) == 2)
            sub_file_assign = 1;
    string API:
        if (strsep(&cp, "=") &&
                !dm_strtol(cp, &cp, 10, &sub_file_start_lba) &&
                *cp == '/' &&
                !dm_strtol(cp + 1, &cp, 10, &sub_file_size))
            sub_file_assign = 1;

Tracked-on: #1496
Signed-off-by: Conghui Chen <conghui.chen@intel.com>
Reviewed-by: Shuo Liu <shuo.a.liu@intel.com>
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
2018-10-17 16:22:00 +08:00
Yin Fengwei 75b03bef3b dm: add io port 0xF4 writing to force DM exit
This patch addes the debugexit function to DM. If it's enabled
by DM cmdline (by add --debugexit), the guest could write a
32bit value to port 0xF4 to trigger guest shutdown.

Tracked-on: #1465
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-10-17 14:32:33 +08:00
Yin Fengwei 9f7642648b dm: add elf loader to dm
This patch adds a simple 32bit static elf binary loader to acrn DM.
And if the elf binary follow multiboot protocol, only memory info
will be included in multiboot info.

Tracked-On: #1465
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-10-17 14:32:33 +08:00
Victor Sun 0e897c0a6a DM: use acrn_timer api to emulate rtc
Current RTC emulation is based on sigevent mechanism, replace with
acrn_timer API which based on timerfd/epoll mechanism to avoid
potential resource accessing conflict in the async thread.

Tracked-On: #1489
Signed-off-by: Victor Sun <victor.sun@intel.com>
Reviewed-by: Jian Jun Chen <jian.jun.chen@intel.com>
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
2018-10-17 14:31:09 +08:00
Victor Sun 8fdea84a63 DM: use acrn_timer api to emulate wdt
In the current implementation sigev_notify is configured as
SIGEV_THREAD. When wdt expires an async thread is created and
the registered timer callback is called in the context of this
thread, then the watchdog interrupt emulation would require the
thread to assert intr on this pci dev.

There would be a race condition that when the wdt pci device is
freed in pci device deinit and then a timer expires. In this case
the wdt expired thread will access a freed buffer which would cause
problem such as heap corruption and segment fault.

In this patch we replace timer API with acrn_timer which is based
on timerfd/epoll mechanism to avoid the race condition.

Tracked-On: #1489
Signed-off-by: Victor Sun <victor.sun@intel.com>
Reviewed-by: Jian Jun Chen <jian.jun.chen@intel.com>
Reviewed-by: Minggui Cao <minggui.cao@intel.com>
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
2018-10-17 14:31:09 +08:00
Victor Sun 6ffa1aa367 DM: add acrn_timer api for timer emulation
We will use timerfd and epoll mechanism to emulate kinds of timers like
PIT/RTC/WDT/PMTIMER/... in device model under Linux. The api is unified
in this patch.

Compare with sigevent mechanism, timerfd has a advantage that it could
avoid race condition on resource accessing in the async sigev thread.

change log:
	v1 -> v2: add NULL pointer check for function parameter;
	v2 -> v3: rename file name of vtimer.* to timer.*;
		  rename structure name of vtimer to acrn_timer;
		  add read() in timer handler to consume I/O event;
	v3 -> v4: replace bool clock_realtime with int clockid;
		  close acrn_timer->fd properly;

Tracked-On: #1489
Signed-off-by: Victor Sun <victor.sun@intel.com>
Reviewed-by: Jian Jun Chen <jian.jun.chen@intel.com>
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
2018-10-17 14:31:09 +08:00
Binbin Wu 19e0bed593 script: re-enable audio passthru
This reverts partial of commit: 9bf5aafe "script: workarounds for UOS of
4.19-rc kernel", since our fixing patch for kernel crash when audio passthru
is ready.

Tracked-On:#1461
Signed-off-by: Binbin Wu <binbin.wu@intel.com>
Reviewed-by: Yin Fengwei <fengwei.yin@intel.com>
2018-10-16 13:30:07 +08:00
Yuan Liu dc05ffffaa dm: uart: fix acrn-dm crash issue
This patch resolves acrn-dm crash issue when acrnd boots up the acrn-dm.
The rootcause is mevent_enable and mevent_disable have NULL pointer as
its parameter if uart backend is not tty capable, so add check code for
the uart backend before invoking mevent_enable and mevent_disable.

The issue can be reproduced when acrnd boots up the acrn-dm.

Tracked-On: #1466
Signed-off-by: Yuan Liu <yuan1.liu@intel.com>
Reviewed-by: Tomas Winkler <tomas.winkler@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-10-16 10:24:01 +08:00
Wei Liu 909d157630 dm: cleanup the cmd options for acrn-dm
For acrn-dm cmd options, there are some mismatch usage from acrn-dm help
message.
This patch will cleanup them.

Tracked-On: #1469
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Reviewed-by: Jason Chen <jason.cj.chen@intel.com>
Reviewed-by: Eddie Dong <eddie.dong@intel.com>
2018-10-15 22:32:53 +08:00
Peter Fang 2202b7f578 dm: virtio: reject requests that violate the virtio-block spec
VirtIO v1.0 spec 04 5.2.5:
- Protocol unit size is always 512 bytes.
- blk_size (logical block size) and physical_block_exp (physical block
  size) do not affect the units in the protocol, only performance.

VirtIO v1.0 spec 04 5.2.6.1:
- A driver MUST NOT submit a request which would cause a read or write
  beyond capacity.

Reject the requests that violate these terms.

v1 -> v2:
- add more comments for clarity

Tracked-On: #1422
Signed-off-by: Peter Fang <peter.fang@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-10-15 22:20:04 +08:00
Peter Fang ba4e72bd0a dm: virtio: add debugging information in virtio-blk
Output debugging message when virtio-blk completes with error.

v1 -> v2:
- fix coding style
- refine debugging message

Tracked-On: #1422
Signed-off-by: Peter Fang <peter.fang@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-10-15 22:20:04 +08:00
Peter Fang 7101ce87a7 dm: storage: remove GEOM support
There is no GEOM framework in Linux. Remove dead code.

v1 -> v2:
- complete removal of the entire GEOM logic

Tracked-On: #1422
Signed-off-by: Peter Fang <peter.fang@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-10-15 22:20:04 +08:00
Binbin Wu f9a163954d dm: passthru: fix hardcoded nhlt table length
NHLT table contains the settings some audio drivers need.
An ACPI method is used to get NHLT table address & length.
In current DM code, the NHLT talbe length in the ACPI method
is hardcoded, which will cause troubles when the length of the
table changed.
This patch replaces the hardcoded NHLT table length according to
the table length read from SOS.

Tracked-On: #1461
Signed-off-by: Binbin Wu <binbin.wu@intel.com>
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
2018-10-15 13:44:48 +08:00
Yin Fengwei 29190ed219 dm: add call to set BSP init state for UOS S3 and system reset
For UOS, we need to call hypercall to set BSP init state now.
So we can't combint the vm start and vm reset (vm reset will
reset the vcpu context). Remove vm start from reset_vm. DM
needs to start vm after every vm reset.

Update DM to set UOS BSP init state after vm reset and before
vm start.

Tracked-On: #1231
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-10-15 09:04:10 +08:00
Yin Fengwei fc575460a3 dm: update the bzimage loader
to use new interface to set the state of guest BSP (entries, general
registers etc) when DM load bzimage.

Tracked-On: #1231
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-10-15 09:04:10 +08:00
Yin Fengwei 96d999544c dm: update the vsbl loader
to use new interface to set the state of guest BSP (entries, general
registers etc) when DM load vsbl.

Tracked-On: #1231
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-10-15 09:04:10 +08:00
Yin Fengwei 853b1c74cb dm: add API to set vcpu regs of guest
Add ioctl parameter and API to set vcpu regs. The guest software
loader will call this API to set guest vcpu registers.

Tracked-On: #1231
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-10-15 09:04:10 +08:00
Yu Wang 203016b406 dm: passthru: correct the name of xdci dsdt write function
The write_dsdt_xhci function is use for describe the xdci dsdt table.
Correct its name.

Tracked-On: #1444
Signed-off-by: Yu Wang <yu1.wang@intel.com>
Reviewed-by: Binbin Wu <binbin.wu@intel.com>
2018-10-12 16:30:57 +08:00
Jian Jun Chen b2dc13d763 dm: virtio: use the correct register size
movb is used for registers STATUS and CFGGENERATION whose size is 1
byte. Previously hv cannot report the correct MMIO trap size for
movb and virtio hard coded their size to 4 as a workaround. hv fixed
movb instruction emulation and MMIO size can be reported correctly.
This patch removes those workaround.

commit 9df8790ffc ("hv: Fix two minor issues in instruction emulation code")

Tracked-On: #1449
Signed-off-by: Jian Jun Chen <jian.jun.chen@intel.com>
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
2018-10-12 14:41:59 +08:00
Binbin Wu 3c57532598 dm: passthru: add deinit_msix_table
Add a function to do msix table deinit.
 1. call api to reset msix entry in hypervisor
 2. free virtual msix table memory
 3. unmap pba page if any
 4. unmap the pages passhtru to uos in MSIX BAR if any

Tracked-On: #1222
Signed-off-by: Binbin Wu <binbin.wu@intel.com>
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
2018-10-12 13:22:32 +08:00
Binbin Wu 244bce756b dm: passthru: enable pba emulation for msix
Normally, for devices support MSI-X, PBA is passed-through to guest.
However, PBA and MSI-X table share the same bar, and part of PBA and
MSI-X table may share a same page for some devices.
If that is the case, the part of PBA within the page should be emulated
rather than passed-through.
This patch adds PBA emulation support for MSI-X.

Tracked-On: #1222
Signed-off-by: Binbin Wu <binbin.wu@intel.com>
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
2018-10-12 13:22:32 +08:00
Min He 57abc88b15 script: re-enable PVMMIO ppgtt update optimization for GVT-g
This reverts partial of commit: 9bf5aafe "script: workarounds for UOS of
4.19-rc kernel", since our fixing patch for the PVMMIO ppgtt update bug
is ready.
For the remaining audio pass-through workaround, we still need to keep
it until it's fixed.

Tracked-On: #1413
Signed-off-by: Min He <min.he@intel.com>
Reviewed-by: Binbin Wu <binbin.wu@intel.com>
2018-10-12 13:21:37 +08:00
Zhao Yakui 9114fbb318 Revert "DM: Disable plane_restriction on 4.19 kernel"
This reverts commit 072e77e746 so that
plane_restriction can be enabled.

Tracked-on: https://github.com/projectacrn/acrn-hypervisor/issues/1373
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Reviewed-by: He, Min <min.he@intel.com>
2018-10-12 10:58:06 +08:00
Tomas Winkler e913f9e613 dm: mevent: add edge triggered events.
Added edge triggered read and write events.
For mei mediator we need to detect changes in
sysfs files, it's not possible to do it via
level based triggers as the files are always
readable.

Tracked-On: #1417
Change-Id: Ib360ad31f30afa576b2b7b833f9bb139c269a030
Signed-off-by: Aviad Nissel <aviad.nissel@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-10-11 19:06:01 +08:00
Tomas Winkler f649beeb1d dm: mevent: implement enable/disable functions
Current mevent mevent_del/add() implementations are incomplete and buggy.
It's easier to implement  mevent_enable/disable() required for mei
virtualization. Other user of these functions, which were previously
empty stubs is the uart mediator, so far it looks working well.

Add few style issues fix on the way.

Tracked-On: #1416
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-10-11 19:06:01 +08:00
Tomas Winkler 018aba944f dm: mevent: remove useless vmname global variable
The vmname variable is missing 'export',
so it's probably only shadowing the already
exported variable from devicemodel/include/dm.h

Tracked-On: #1415
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-10-11 19:06:01 +08:00
Tomas Winkler 4f1d3c049b dm: inline functions defined in header must be static
An inline function defined in headers must be static
otherwise compilation may fail, depending on gcc optimization level,
particularly if dropping -O2 from the Makefile dm doesn't
compile reporting unresolved symbols.

Tracked-On: #1406
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-10-11 19:04:18 +08:00
Yonghua Huang bacfc9b245 dm: fix use of uninitialized variable in monitor.c
@set_wakeup_timer(), "ack" is not initialized before
passing it to "mngr_send_msg() as input.

Tracked-On: #861
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-10-11 15:14:44 +08:00
Jason Chen CJ 6793eb0604 dm: fix assertion in pci_irq_reserve
atkbdc_init will call pci_irq_reserve to reserve irq 1 & 12, which need
pci_irq_init be called first.

Tracked-On: #1402
Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
2018-10-11 13:48:46 +08:00
Xiaoguang Wu e0728f4b60 DM USB: xHCI: fix a crash issue when usb device is disconnected
This is an issue result from incomplete process logic of commit:
"ba68bd4 DM USB: xHCI: fix enumeration error after rebooting".
This patch is used to fix it.

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>
Tracked-On: #1425
2018-10-10 16:09:56 +08:00
Yuan Liu 25db6b7917 IOC Mediator: Replace strtok with strsep
Replace strtok function with strsep function.

Tracked-On: #1401
Signed-off-by: Yuan Liu <yuan1.liu@intel.com>
Reviewed-by: Shuo Liu <shuo.a.liu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-10-10 10:16:08 +08:00
Yuan Liu 69edccc063 IOC Mediator: Add return value check for snprintf
Return value check for snprintf function.

Tracked-On: #1401
Signed-off-by: Yuan Liu <yuan1.liu@intel.com>
Reviewed-by: Shuo Liu <shuo.a.liu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-10-10 10:16:08 +08:00
Yuan Liu 9fd8781242 IOC Mediator: fix multi-signal parsing issue
The patch resolves a bug that signal SteeringWheelSpeechCtrlBtn can not be
received in UOS. the rootcause is signal SteeringWheelSpeechCtrlBtn and
signal SteeringWheelPauseBtn are combined into one multi-signal message and
signal SteeringWheelPauseBtn is not defined.
To fix this, add SteeringWheelPauseBtn definition.

Tracked-On: #1410
Signed-off-by: Yuan Liu <yuan1.liu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-10-10 09:11:04 +08:00
Jian Jun Chen b1b3f76db9 dm: virtio: use strnlen instead of strlen
Use strnlen instead of strlen to avoid potential security issue.

Tracked-On: #1364
Signed-off-by: Jian Jun Chen <jian.jun.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-10-10 09:10:38 +08:00
Min He 9bf5aafebe script: workarounds for UOS of 4.19-rc kernel
Currently there're two issues which prevent UOS with 4.19-rc kernel from
booting:
1. GVT-g PVMMIO ppgtt update optimization causes GPU hang
2. audio driver causes kernel panic

This patch is a temporary workaround to prelimarily support 4.19-rc UOS.
And it will be reverted after above two issues are fixed.

Tracked-On: #1413
Signed-off-by: Min He <min.he@intel.com>
Reviewed-by: Binbin Wu <binbin.wu@intel.com>
2018-10-09 15:36:23 +08:00
Peter Fang b5f770707e dm: vpit: add vPIT support
vPIT is used as a source of system timer by UEFI (e.g. OVMF).

This is ported from Bhyve, with a few changes:

- move to user space, using POSIX timer
- support timer mode 3
- improve the emulation of OUT and STATUS byte
- improve the emulation of counter behavior
- improve the emulation of CE update in periodic mode
- treat CR == 0 as 0x10000

Origin: FreeBSD
License: BSD-3-Clause
URL: https://svnweb.freebsd.org/
commit: 283291
Purpose: Adding vPIT support.
Maintained-by: External

Tracked-On: #1392
Signed-off-by: Peter Fang <peter.fang@intel.com>
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
2018-10-09 13:24:47 +08:00
Peter Fang 0359bd0f99 dm: vpit: add PIT-related header files
Add the necessary header files for vPIT.

Origin: FreeBSD
License: BSD-3-Clause
URL: https://svnweb.freebsd.org/
commit: 335030
Purpose: Adding vPIT support.
Maintained-by: External

Tracked-On: #1392
Signed-off-by: Peter Fang <peter.fang@intel.com>
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
2018-10-09 13:24:47 +08:00
Yin Fengwei 8787b65fde dm: fix the issue when guest tries to disable memory range access
According to PCI spec 3.0 section 6.2.2 "Device Control", guest
could write the command register to control device response to
io/mem access.

The origial code register/unregister the memory range which is
not suitable because it can't handle the sequence:
  1. disble the device response to specific memory range
  2. reboot guest (DM will try to free the memory range which
     was freed in step 1 already)

Tracked-On: #1277
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-10-08 12:57:00 +08:00
Yin Fengwei be0cde7dec Revert "dm: workaroud for DM crash when doing fastboot reboot"
Remove the workaround and will submit the fixing patch.

Tracked-On: #1277
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-10-08 12:57:00 +08:00
Peter Fang 1657544152 dm: vrtc: add memory configuration in RTC CMOS
Some firmware (e.g. UEFI) uses RTC CMOS to fetch the system's memory
configuration. Put lowmem / highmem info in the designated area.

This is a port of Bhyve vRTC's user-space logic.

v1 -> v2:
* move KB/MB/GB to macros.h
* move nvram offset definitions to rtc.h

Tracked-On: #1390
Signed-off-by: Peter Fang <peter.fang@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2018-10-05 00:33:17 +08:00
Jason Chen CJ ce961e79a5 dm: acpi: set SCI_INT polarity to high active
set SCI_INT default polarity to high active

Tracked-On: #1269
Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
2018-09-30 15:24:59 +08:00
Xiaoguang Wu ba68bd4190 DM USB: xHCI: fix enumeration error after rebooting
When the physical USB device is disconnected before DM's emulation
is ready, the virtual connection state is not cleared properly. This
will cause the DM refuse to do emulation for future physical connection.

This patch clears those states mentioned above and hence fix the issue.

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>
Tracked-On: #1367
2018-09-30 14:59:15 +08:00
Minggui Cao 390861a04c DM: increase UOS memory size for MRB
on MRB, if memory >= 8GB, will allocate 6GB to UOS;
for MRB now just runs one UOS with more workload.

Tracked-On: #1369
Signed-off-by: Minggui Cao <minggui.cao@intel.com>
Reviewed-by: Binbin Wu <binbin.wu@intel.com>
2018-09-30 14:14:08 +08:00
Zhao Yakui 072e77e746 DM: Disable plane_restriction on 4.19 kernel
Now the plane_restriction is not ready on 4.19-rcX kernel. So it will be
disabled temporally.
This change is only used to disable the plane_restriction for UOS when UOS
based on 4.14 kernel is launched in 4.19 sos kernel.

V1->V2: Commit log adds the description that this change is used to disable
the plane_restriction in 4.14 UOS kernel.

Tracked-on: https://github.com/projectacrn/acrn-hypervisor/issues/1373
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Reviewed-by: He, Min <min.he@intel.com>
2018-09-30 10:54:45 +08:00
Zhao Yakui 5a64af2066 DM: Use the pass-through mode for IPU on 4.19 kernel
Now the IPU mediator driver is not ready on 4.19-rcX kernel. So the IPU will
fallback to pass-trhough mode temporally and be assigned to guest directly.
After the IPU mediator driver is ready, the ipu_passthrough flag will be
changed to zero.

V1-V2: Describe the issue clearly in commit log.

Tracked-on: https://github.com/projectacrn/acrn-hypervisor/issues/1373
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Reviewed-by: Wu, Binbin <binbin.wu@intel.com>
2018-09-30 10:54:45 +08:00
Zhao Yakui 38099e4b78 DM: Add the boot option to avoid loading dwc3_pci USB driver
The latest kernel has some issues when unloading dwc3_pci USB driver.
It will cause the kernel panic when unloading dwc3_pci driver in order to
assign USB controller to guest.
So the dwc3_pci won't be loaded.

Tracked-on: https://github.com/projectacrn/acrn-hypervisor/issues/1373
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Reviewed-by: Wu, Binbin <binbin.wu@intel.com>
2018-09-30 10:54:45 +08:00
Xiaoguang Wu 6c9bae6170 DM USB: xHCI: fix USB hub disconnection issue
When USB hub is disconnected, its connection status is not cleared
in the DM, this defect will cause the related assigned port could
not be used any more.

This patch is used fix this issue.

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>
Tracked-On: #1365
2018-09-29 12:44:43 +08:00
Xiaoguang Wu 0d4a88e620 DM USB: xHCI: change logic of binding libusb to native device
Previous implementation binds libusb (in other words: usbfs) with
native device when DM receives the Enable Slot command. But according
to xHCI spec 4.6.5, the binding relationship is decided when the
Address Device command is received, so this implementation is not
consistent with hardware behaviors.

And this incompatible could induce following issue. When two or more
USB devices are connected at the same time, eg, connecting two devices
before Guest OS is booted, the virtual slot id may bind to wrong root
hub port.

This patch will do the binding when Address Device command is received
and related issues will be fixed.

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>
Tracked-On: #1366
2018-09-29 12:44:43 +08:00
Xiaoguang Wu 2d00a99a4c DM USB: xHCI: refine stop endpoint logic
According to xHCI spec, the Stop Endpoint command should execute
no matter the endpoint is in halted state or not, but current
implementation just refuse do the command and return error to
Guest OS. It is wrong and this patch is used to fix it.

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>
Tracked-On: #1366
2018-09-29 12:44:43 +08:00
Jian Jun Chen 7b0b67df72 dm: virtio-net: add vhost net support
One additional command parameter is added for virtio-net to support
vhost net. The command line for vhost net is as follows:
-s n,virtio-net,tap_xxx,vhost

Tracked-On: #1329
Signed-off-by: Jian Jun Chen <jian.jun.chen@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-09-27 16:53:30 +08:00
Jian Jun Chen 3fdfaa3d12 dm: virtio: implement vhost chardev interfaces
vhost proxy interacts with vhost kernel thru vhost char dev. Internal
interfaces are implemented based on ioctls of vhost char dev in this
patch.

Tracked-On: #1329
Signed-off-by: Jian Jun Chen <jian.jun.chen@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-09-27 16:53:30 +08:00
Jian Jun Chen e3f4e34c01 dm: virtio: implement vhost_vq_register_eventfd
There are 2 eventfds for one virtqueue, one is for kick and the other
is for notify. eventfd used for kick is associated with a PIO/MMIO
region. eventfd used for notify is associated with a MSIx/INTx. The
eventfd pair is registered to VHM thru VHM char dev.

VHM irqfd currently only support MSIx. If INTx is used, vhost proxy
uses mevent to poll the call fd from vhost then inject interrupt to
guest.

Tracked-On: #1329
Signed-off-by: Jian Jun Chen <jian.jun.chen@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-09-27 16:53:30 +08:00
Jian Jun Chen 150ad30b09 dm: virtio: implement vhost_set_mem_table
vhost kernel driver needs the information of memory mapping between
GPA and the virtual addresses in device model process. This is
required for virtqueue related operations. This patch gets memory
mapping information from vmctx then conveys to vhost.

Tracked-On: #1329
Signed-off-by: Jian Jun Chen <jian.jun.chen@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-09-27 16:53:30 +08:00
Jian Jun Chen befbc3e924 dm: virtio: implement vhost_vq interfaces
vhost_vq related interfaces are implemented in this patch. They are
vhost_vq_init/vhost_vq_deinit/vhost_vq_start/vhost_vq_stop.

Tracked-On: #1329
Signed-off-by: Jian Jun Chen <jian.jun.chen@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-09-27 16:53:30 +08:00
Jian Jun Chen bb34ffe672 dm: virtio: add vhost support
This patch adds the vhost support to the device model virtio. A vhost
proxy is implemented based on the virtio framework and vhost char dev.
Key data structures and external interfaces are implemented in this
patch.

Tracked-On: #1329
Signed-off-by: Jian Jun Chen <jian.jun.chen@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-09-27 16:53:30 +08:00
Jian Jun Chen 781e7dfb29 dm: virtio: rename virtio ring structures and feature bits
Some virtio ring structures and virtio feature bits are using the
same name/definition as those in kernel header files(linux/
virtio_ring.h, linux/virtio_config.h). Kernel header files must
be included to perform ioctls to support vhost. There are
compiling errors due to duplicated definitions. In this patch
the following renamings are done:

VRING_DESC_F_NEXT -> ACRN_VRING_DESC_F_NEXT
VRING_DESC_F_WRITE -> ACRN_VRING_DESC_F_WRITE
VRING_DESC_F_INDIRECT -> ACRN_VRING_DESC_F_INDIRECT

VRING_AVAIL_F_NO_INTERRUPT -> ACRN_VRING_AVAIL_F_NO_INTERRUPT
VRING_USED_F_NO_NOTIFY -> ACRN_VRING_USED_F_NO_NOTIFY

VIRTIO_F_NOTIFY_ON_EMPTY -> ACRN_VIRTIO_F_NOTIFY_ON_EMPTY
VIRTIO_RING_F_INDIRECT_DESC -> ACRN_VIRTIO_RING_F_INDIRECT_DESC
VIRTIO_RING_F_EVENT_IDX -> ACRN_VIRTIO_RING_F_EVENT_IDX
VIRTIO_F_VERSION_1 -> ACRN_VIRTIO_F_VERSION_1

vring_avail -> virtio_vring_avail
vring_used -> virtio_vring_used
vring_size -> virtio_vring_size

Tracked-On: #1329
Signed-off-by: Jian Jun Chen <jian.jun.chen@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-09-27 16:53:30 +08:00
Shuo Liu 56992c7373 dm: combine VM creating and ioreq shared page setup
This patch depends on a vhm patch merged, "vhm: setup ioreq shared buf
in IC_CREATE_VM ioctl". We intend to combine VM creating and ioreq
shared page setup into one step. For compatibility issue, we need follow
the patch dependency to merge accordingly.

This patch also drops vm_open/vm_close which will be intergrated into
vm_create/vm_destroy.

Tracked-On: #1330
Signed-off-by: Shuo Liu <shuo.a.liu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-09-26 11:33:20 +08:00
Shuo Liu 94513ab724 dm: Add vhm ioeventfd and irqfd interfaces
ioeventfd and irqfd support for vhm was introduced in kernel vhm module.
We provide the interfaces of them for DM users.

Tracked-On: #1329
Signed-off-by: Shuo Liu <shuo.a.liu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-09-26 11:33:20 +08:00
Jie Deng f37588505b dm: virtio_net: remove netmap/vale backend support
Netmap/vale attempts to speed up network communication by bypassing the
TCP/IP network stack, which requires patching the physical NIC driver so
that applications developed based on netmap can interact directly with
the physical NIC driver. It may make sense for some specific scenarios
which requres very high bandwith (10Gb/s or 100Gb/s), we can even put up
with the complexity and compatibility introduced by this techology.
However for ACRN, a virtualization solution for IoT, there is no need to
support this backend. For 1Gb NICs or below, the VBS-U/tap solution
can already achieve near-native bandwidth. To keep simplicity and
improve compatibility, remove the netmap/vale support in dm.

Tracked-On: #1313

Signed-off-by: Jie Deng <jie.deng@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2018-09-25 11:10:28 +08:00
Minggui Cao 99ed5469ab DM: add a thread to monitor UOS ptdev intr status
This patch is for "interrupt storm mitigation", used to reduce
the effect on SOS if an "interrupt storm" happens in UOS.

Add a monitor thread to get UOS pass-through devices interrupt
freqency data; currently, if "interrupt storm" happens, it'll
send a command to delay interrupt injection to UOS for some time.

The parameters: interrupt storm threshold and delay time can be
adjusted according differt HW configure and use case.

Tracked-On: #866
Signed-off-by: Minggui Cao <minggui.cao@intel.com>
Reviewed-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2018-09-25 11:09:35 +08:00
Binbin Wu 53731905d7 dm: passthru: enable NHLT table for audio passthru
CAVS audio driver depends on the NHLT table to get topology info.
Enable NHLT table in DM for audio passthrough.
Also increase the size reserved for NHLT in ACPI table from 2048B to 2560B.

Tracked-On: #1284
Signed-off-by: Binbin Wu <binbin.wu@intel.com>
Reviewed-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
2018-09-20 11:13:32 +08:00
Yin Fengwei 4a038d18b1 dm: workaroud for DM crash when doing fastboot reboot
This is temperory workaround for DM crash when doing fastboot
reboot. In fastboot, it will disable USB host functionality by
disable device respsone to one PCI bar. While DM code just release
the bar in this case. Which break the reboot functionality.

The workaround is to remove the assert to avoid DM abort. This is
safe because reboot will remove all memory range registered.

We will have offiical fixing later.

Tracked-On: #1277
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-09-19 10:47:59 +08:00
Xiaoguang Wu 688cddac6a DM USB: xHCI: enable USB xHCI emulation in LaaG and AaaG.
Change launch_uos.sh to enable USB xHCI full emulation support.

Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Reviewed-by: Liang Yang <liang3.yang@intel.com>
Reviewed-by: Yu Wang <yu1.wang@intel.com>
Tracked-On: #1242
2018-09-19 10:47:10 +08:00
Zhang, wenling f355cdf6f4 Revert "DM USB: xHCI: enable USB xHCI emulation in LaaG and AaaG."
This reverts commit c03ea2d365.
2018-09-17 15:13:05 +08:00
Xiaoguang Wu c03ea2d365 DM USB: xHCI: enable USB xHCI emulation in LaaG and AaaG.
Change launch_uos.sh to enable USB xHCI full emulation support.

Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Reviewed-by: Liang Yang <liang3.yang@intel.com>
Reviewed-by: Yu Wang <yu1.wang@intel.com>
Tracked-On: #1242
2018-09-14 13:32:34 +08:00
Xiaoguang Wu b4755cdc52 DM USB: xHCI: enable 'cold plug' mode
USB device is connected before UOS is booted up, this scenario is
called 'cold plug' for easy to refer.

Under 'cold plug' situation, the libusb will not report 'connect'
event to device model, hence UOS will not discover 'cold plugged'
device.

This patch add support to fix this issue.

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>
Tracked-On: #1242
2018-09-14 13:32:34 +08:00
Liang Yang 612037e138 DM USB: xHCI: enable Flat Mode Hub emulation support.
Flat Mode for hub emulation means DM emulates USB devices under hub but
hide hub itself. Under this design the Guest OS cannot see any emulated
hub. So in the perspective of Guest OS, all the emulated devices are
under root hub.

This patch is used to enable feature as mentioned above. And please NOTE,
it is the initial version of hub flat Mode hub emulation, there are one
limitation: only one physical hub is supported. If second physical hub is
connected, the connect and disconnect behavior in second hub may affect
the function of first emulated hub.

The USB HUB device model should be the final long term solution, but it is
very complex. Use flat mode HUB emulation as the short term solution first
to support some USB touch devices which integrated internal HUB.

Signed-off-by: Liang Yang <liang3.yang@intel.com>
Reviewed-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
Tracked-On: #1243
2018-09-14 13:32:34 +08:00
Binbin Wu 4f20c44ec3 dm: passthru: fix a bug in msix read/write
In current code, when read/write msix table, it first handle the case
the offset is in pba range when msix talbe and pba share the same bar.
But the code didn't add the condition whether pba bar equals msix table
bar. It will cause problems for the passthrugh devices,whose pba and msix
table don't share the same bar.

Tracked-On: #1209
Signed-off-by: Binbin Wu <binbin.wu@intel.com>
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
2018-09-12 11:36:56 +08:00
Yuan Liu ca75d506b7 IOC mediator: add RTC feature
This patch implements RTC feature that UOS can set RTC wakeup timer
to IOC firmware with a specific time before enter S3/S5. IOC mediator
also needs to indicate RTC wakeup reason to UOS after exit S3/S5.

Tracked-On: #1213
Signed-off-by: Yuan Liu <yuan1.liu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-09-12 09:18:44 +08:00
Jian Jun Chen f1e87f60fc dm: vrtc: use signalfd to poll signal from timer
In the current implementation sigev_notify is configured as
SIGEV_THREAD. When timer expires an async thread is created and
the registered timer callback is called in the context of this
thread. vrtc_update_timer will access the global data vrtc. There
is a race condition that vrtc is freed when deinit and then a timer
expires. In this case vrtc_update_timer will access a freed buffer
which causes problem such as heap corruption and segment fault.

In this patch signal model is used when timer is created. The signal
is masked and a signalfd is used to poll on it with mevent. This avoids
the race condition.

Signed-off-by: Jian Jun Chen <jian.jun.chen@intel.com>
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
Tracked-On: #1185
2018-09-11 10:50:16 +08:00
Jiangbo Wu c6b7940bf9 samples: Add AliOS as guest launch option
Add sample script launch option to launch AliOS as a guest. And it reuse launch
android function due to the same configurations.

Tracked-On: projectacrn/acrn-hypervisor#1173
Signed-off-by: Jiangbo Wu <jiangbo.wu@intel.com>
Reviewed-by: Binbin Wu <binbin.wu@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
Signed-off-by: Jiangbo Wu <jiangbo.wu@intel.com>
2018-09-10 11:27:09 +08:00
Jiangbo Wu a7de5a1940 samples: Add tap name as launch function parameter
launch two clearlinux will use the same 'LaaG' as tap interface name. Add tap
name as parameter that will meet two UOS using different tap interface.

Tracked-On: projectacrn/acrn-hypervisor#1194
Signed-off-by: Jiangbo Wu <jiangbo.wu@intel.com>
Reviewed-by: Binbin Wu <binbin.wu@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
Signed-off-by: Jiangbo Wu <jiangbo.wu@intel.com>
2018-09-10 11:27:09 +08:00
Li Zhijian bcfe447f5c DM: deinit initialized pci device when failed
if some pci devices behind gvt got failures when initlizing at init_pci(), gvt
instance have no chance to be destroied even acrn-dm exits.

NOTE: this patch can not work standalone, a following patch to kernel
side(643d40961cf: "vhm: init client->kthread_exit true") is requied as well,
otherwise it will stucks during destroying gvt instance.

Tracked-On: #1141
Signed-off-by: Li Zhijian <zhijianli88@163.com>
2018-09-10 10:14:01 +08:00
Binbin Wu f5ca1896b3 dm: bios: update vsbl to v0.9
vsbl v0.9 change:
- New feature:
	Update vFastboot to v0.9
	Support vRPMB key handover for AaaG.
	Support to append SSDT to ACPI table for First Stage Mount in AaaG.
	Enable to set boot target to CrashOS when panic happens in vSBL debug version, release version is not affected.

Add SHA512SUM file for vsbl binaries.

Tracked-On:#1179, #1180, #1181, #1182
Signed-off-by: Binbin Wu <binbin.wu@intel.com>
2018-09-07 16:56:08 +08:00
Edwin Zhai 30b77aba5d DM: unmap ptdev BAR when deinit
Unmap ptdev BAR when deinit to comply with native system, who zap out
all pre-allocated BARs.

Tracked-On: #1146

Signed-off-by: Edwin Zhai <edwin.zhai@intel.com>
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-09-07 10:21:16 +08:00
Yuan Liu bad8d81ab6 IOC mediator: add new signal for VBUS control
Support VBUS control for USB OTG.

Tracked-On: #1159
Signed-off-by: Yuan Liu <yuan1.liu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-09-06 12:06:09 +08:00
Victor Sun c045442163 DM: watchdog: correct 2 MACRO define
1. In default prescaler, the wdt clock is 1 KHz for a 20-bit counter,
   which means approximate 1 second for 10 bits;

2. the default reset timer in seconds need to left shift 10 bits to
   represent the value that set to i6300esb register;

Tracked-On: #1142
Signed-off-by: Victor Sun <victor.sun@intel.com>
Reviewed-by: Minggui Cao <minggui.cao@intel.com>
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-09-06 11:10:09 +08:00
Li Zhijian 198c6e9216 DM: coding style: replace tab with space
Tracked-On: #1141
Signed-off-by: Li Zhijian <zhijianli88@163.com>
2018-09-06 11:09:20 +08:00
Zhi Jin 96809c4a44 DM NPK: enable the NPK virtualization for AaaG
Enable the NPK virtualization for AaaG if the NPK device/driver
is present.

Tracked-On: #1138
Signed-off-by: Zhi Jin <zhi.jin@intel.com>
Reviewed-by: Chen Gang <gang.c.chen@intel.com>
2018-09-04 10:07:56 +08:00
Zhi Jin 9a276592fb DM NPK: use a slice (8 masters) as the minimal unit for NPK virt
To align with the configuration of the HOST tool, the SW masters
are organized in slices of 8 masters each.
The slice is also the minimal unit to allocate the SW masters for
each UOS.
The patch is to update the parameter checking function.

Tracked-On: #1138
Signed-off-by: Zhi Jin <zhi.jin@intel.com>
Reviewed-by: Chen Gang <gang.c.chen@intel.com>
2018-09-04 10:07:56 +08:00
wenshelx 25dacc5c19 security: Enable '-fpie, -pie' options
To be sure hypervisor and DM are position independent
and executable.

Tracked-On: #1122
Signed-off-by: wenshelx <wenshengx.wang@intel.com>
Acked-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2018-08-31 11:18:26 +08:00
Wei Liu 852f613fe3 samples: remove extra option for dm
remove extra "-l com1,stdio" option for dm

Tracked-On: #1123
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
2018-08-31 09:15:49 +08:00
Yuan Liu dba52baba8 IOC mediator: fix no CBC signals after resuming
This patch fixes an issue that CBC signal channel
is inactive after SOS resuming, it leads to IOC mediator
cannot transfer any signals between UOS and SOS. So IOC
mediator sends the open channel command to activate CBC
signal channel after resuming.

Tracked-On: #1115
Signed-off-by: Yuan Liu <yuan1.liu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-08-31 09:14:24 +08:00
Binbin Wu a8ac452edb dm: cmos: move cmos storage out of vmctx
The whole vmctx will be cleared during cold reset.
cmos data should not be cleared during cold reset.
Move cmos data out of vmctx.

Tracked-On: #1118
Signed-off-by: Binbin Wu <binbin.wu@intel.com>
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
2018-08-30 12:17:23 +08:00
Xiaoguang Wu c5dcb34f39 DM USB: xHCI: fix a potential issue of crash
This patch is used to fix a potential issue resulted from typo.

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-08-24 11:16:56 +08:00
Binbin Wu 0c630d9003 dm: cmos: fix a logic error for read to clear range
Signed-off-by: Binbin Wu <binbin.wu@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2018-08-22 14:04:34 +08:00
Yew, Chang Ching 17ef5076a4 ipu: virtio-ipu4 as default IPU DM
Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
Signed-off-by: Yew, Chang Ching <chang.ching.yew@intel.com>
Reviewed-by: Edwin Zhai <edwin.zhai@intel.com>
Reviewed-by: Minggui Cao <minggui.cao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-08-21 18:53:53 +08:00
Liang Yang 6988a17027 DM USB: xHCI: Change the default USB xHCI support to pass through.
So far, the xHCI mediator does not support USB HUB over usb pmapper. But
there are some USB touch devices integrated internal USB HUB, then
cause such touch models can't be supported. Will consider to re-enable
xHCI mediator by default once HUB support related patches get merged in
the near future.

Signed-off-by: Liang Yang <liang3.yang@intel.com>
Reviewed-by: Yu Wang <yu1.wang@intel.com>
Reviewed-by: Binbin Wu<binbin.wu@intel.com>
2018-08-21 11:59:31 +08:00
Binbin Wu b8c1fd6104 dm: pass vrpmb key via cmos interface
CMOS offset from 0x20 to 0x9F is used to store rpmb key information.
vsbl loader will init vrpmb key in CMOS when boot/reboot.
vsbl loader will not init vrpmb key during S3 resume.
vsbl will read vrpmb key via CMOS interface.
After reading, the key value is cleared in CMOS. So the key can only be
read once until next boot.

Signed-off-by: Binbin Wu <binbin.wu@intel.com>
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
2018-08-20 12:55:37 +08:00
Wei Liu c8c0e10a90 HV: enlarge the CMA size for uos trusty
sometimes, there would be CMA allocate failue when doing cycle rebooting android uos.
as there are different CMA clients, and android trusty need 16M contiguous memory,
32M CMA size may make this failure easy to come out.
This patch is to enlarge the CMA size to 64M, which mitigate the failure.

Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
2018-08-20 11:15:10 +08:00
Jason Chen CJ 10a4c6c7dc samples: let nuc uos only start with 1 cpu
there are only 2 CPUs on UP2 platform, so we can only start 1 cpu for
uos on UP2 platform.

as this is only an example script, user can modify the uos start CPU
number according his requirement.

Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
2018-08-17 14:30:10 +08:00
Liang Yang d82a86e648 DM USB: xHCI: enable USB xHCI emulation in LaaG and AaaG.
Change launch_uos.sh to enable USB xHCI full emulation support.

Signed-off-by: Liang Yang <liang3.yang@intel.com>
Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Reviewed-by: Yu Wang <yu1.wang@intel.com>
Reviewed-by: Binbin Wu<binbin.wu@intel.com>
2018-08-17 11:18:23 +08:00
Zhao Yakui 99e8997504 DM: Add boot option of "i915.enable_guc=0" to disable Guc on UOS new kernel
The guc boot option is refined on the new linux kernel. The boot option of
"i915.enable_guc=0" should be added in order to disable Guc instead of using
"enable_guc_loading/submission". But in order to use the same boot option on
multi kernel, both of them are kept.

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Reviewed-by: Binbin Wu<binbin.wu@intel.com>
2018-08-16 16:28:17 +08:00
Zhao Yakui 36d5fdbf04 DM/Samples: Add the boot option of "i915.enable_guc=0" to disable guc on SOS new kernel
The guc boot option is refined on the new linux kernel. The boot option of
"i915.enable_guc=0" should be added in order to disable Guc instead of using
"enable_guc_loading/submission". But in order to use the same boot option on
multi kernel, both of them are kept.

V1->V2: Add the option on APL-NUC platform

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Reviewed-by: Binbin Wu<binbin.wu@intel.com>
2018-08-16 16:28:17 +08:00