Commit Graph

936 Commits

Author SHA1 Message Date
Binbin Wu dea2e25f41 dm: hw: fix the license of cmos_io.c
Fix the license of cmos_io.c to BSD-3-Clause

Tracked-On: #4032
Signed-off-by: Binbin Wu <binbin.wu@intel.com>
2019-11-08 16:42:54 +08:00
Gao Junhao 90cf27aa5f dm: remove cfc/cf8 pio handler
The acrn vhm driver will convert all PCI configure space access to
PCI_CFG type, so the pci_emul_cfgaddr and pci_emul_cfgdata will nerver
be invoked. Remove these useless functions.

Tracked-On: #3999
Signed-off-by: Gao Junhao <junhao.gao@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2019-11-05 16:07:38 +08:00
wenlingz 18d5dd2fe9 Revert "OVMF release v1.4"
This reverts commit 84e5a8e894.
2019-11-04 11:15:00 +08:00
Jian Jun Chen 46b157008c dm: file lock should be held till all mmap is done
Lock should be held till all the mmap operations are done. This is to
avoid the mmap failure when multiple guests are created concurrently.
For example consider the following case in which vm1 and vm2 are
created by acrnd concurrently:
- vm1 is created with 4G+2M memory.
- 4G+2M memory is reserved in hugetlb now and vm1 continues to
  allocate memory for the lowmem without lock held.
- 2G memory is allocated by vm1 for its lowmem, and 2G+2M memory
  is available in hugetlb.
- At this time vm2 is created with 1G+2M memory. It finds that enough
  memory is reserved (2G+2M), so it does not try to reserve more
  memory.
- vm2 allocates some memory for its lowmem/highmem/ovmf.
- vm1 tries to allocate memory for its highmem/ovmf, the allocation
  will fail. vm1 creation failed in this case.

Tracked-On: #3947
Signed-off-by: Jian Jun Chen <jian.jun.chen@intel.com>
Reviewed-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2019-10-30 11:37:44 +08:00
Gao Junhao 9143e56336 dm: update ACPI with latest ASL standard
The device model generating ACPI table use the old ASL
standard(version:20190816), then the iasl in clearlinux(version:31360)
is 20191018, it can't disassemble the ACPI table compiled by old
standard.

Tracked-On: #3933
Signed-off-by: Gao Junhao <junhao.gao@intel.com>
Reviewed-by: Fengwei Yin <fengwei.yin@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2019-10-25 15:12:00 +08:00
Peter Fang 84e5a8e894 OVMF release v1.4
- Add back USB keyboard support

Tracked-On: #3927
Signed-off-by: Peter Fang <peter.fang@intel.com>
2019-10-25 11:01:04 +08:00
Yonghua Huang e7ef57a9f1 dm: fix mutex lock issue in tpm_rbc.c
In function crb_reg_write() in tpm_rbc.c
 'tpm_vdev->request_mutex' will potentially kept
 in locked state after crb_reg_write() returns.

Tracked-On: #3825
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Reviewed-by: Yadong Qi <yadong.qi@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2019-10-18 15:36:18 +08:00
fuzhongl 98dc755ef1 dm: NVME bdf info update on KBLNUC7i7DNH
Wrong NVMe bdf info of KBLNUC7i7DNH is modified by mistake; so change it back.

Tracked-On: #3827
Reviewed-by: binbin.wu@intel.com

Signed-off-by: fuzhongl <fuzhong.liu@intel.com>
2019-10-18 15:33:46 +08:00
Yonghua Huang d8deaa4b16 dm: close filepointer before exiting acrn_load_elf()
In acrn_load_elf(), file pointer 'fp' is kept in
 open state before exiting if 'load_elf32()' is executed,
 this patch is to fix this bug.

Tracked-On: #3817
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
2019-10-17 13:13:06 +08:00
Gao Junhao 43b2327eb8 dm: validation for input to public functions
slot value should be checked in range before used to access
bi->slotinfo[].

Tracked-On: #3822
Signed-off-by: Gao Junhao <junhao.gao@intel.com>
Reviewed-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2019-10-16 10:26:50 +08:00
Gao Junhao 477f8331eb dm: modify DIR handler reference postion
DIR handler is referenced after release, need to be adjusted before
released.

Tracked-On: #3821
Signed-off-by: Gao Junhao <junhao.gao@intel.com>
Reviewed-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2019-10-16 10:26:23 +08:00
Junhao Gao 72232daafe dm: reduce potential crash caused by LIST_FOREACH
When removing node in list, list_foreach_safe will be safer than
LIST_FOREACH.

Tracked-On: #3778
Signed-off-by: Junhao Gao <junhao.gao@intel.com>
Reviewed-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2019-10-15 14:37:39 +08:00
Gao Junhao e6e0e27788 dm: refine the check of return value of snprintf
int snprintf(char *str, size_t size, const char *format, ...)
The functions snprintf() write at most size bytes (including the
terminating null byte('\0')) to str.
only when returned value of snprintf is non-negative and less than size,
the string has been completely written.

Tracked-On: #3789
Signed-off-by: Junhao Gao <junhao.gao@intel.com>
Reviewed-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2019-10-15 13:53:58 +08:00
fuzhongl c3eb0d7fad dm: switch to launch RT_LaaG with OVMF by default
The default script is for nvme passthrough to RT_LaaG; you can change it
to sata or using virtio_blk

Tracked-On: #3575
Signed-off-by: fuzhongl <fuzhong.liu@intel.com>
Reviewed-by: binbin.wu@intel.com; kaige.fu@intel.com
2019-10-12 15:54:26 +08:00
Yuan Liu a4d562daa0 dm: Add Oracle subsystem vendor ID
After Windows 10, version 1607, the cross-signed drivers are forbiden
to load when secure boot is enabled.

Details please refer to
https://docs.microsoft.com/en-us/windows-hardware/drivers/install/kernel-mode-code-signing-policy--windows-vista-and-later-

That means the kvm-guest-drivers-windows can't work when secure boot enabled.
So we found another windows virtio FE drivers from Oracle to resolve this issue
but have to change another subsystem vendor ID for the virtio BE services.

This patch introduces a new DM CMD line "--windows" to launch WaaG with Oracle virtio devices including
virtio-blk, virtio-net, virtio-input instead Redhat. It can make virtio-blk, virtio-net and virtio-input
devices work when WaaG enabling secure boot.

Tracked-On: #3583
Signed-off-by: Yuan Liu <yuan1.liu@intel.com>
Reviewed-by: Eddie Dong <eddie.dong@intel.com>
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
2019-10-11 13:20:19 +08:00
Yin Fengwei 9456d91b76 dm: hugetlb: add file lock to make sure huge page reserve atomic
Currently, DM only access /sys/kernel/mm/hugepages/hugepages-2048kB/
entries according to its own huge page requirement. So it could have
following race issue:

         DM1                                   DM2
      read nr pages
                                            read nr pages
                                            write DM2 nr pages
      write DM1 nr pages

Suppose we should write DM1 + DM2 nr page to kernel sysfs interface
to reserve enough huge page (DM1 + DM2). But actually only reserve
huge page requested by DM1.  Which could trigger one VM can't boot.
We can easily hit this issue if we enable multiple UOS auto boot
because more than one VM are started at almost same time.

We add file lock to make sure huge page reserving in DM atomic.

Tracked-On: #3729
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Wang Yu <yu1.wang@intel.com>
2019-09-27 15:12:36 +08:00
Peter Fang c9c02785cb OVMF release v1.3
- GvtGopDxe: Fix crash if failed to get a valid mode
- GvtGopDxe: Enable GOP with parameters from vgt interface
- OvmfPkg/GvtGopDxe: Add GvtGopDxe skeleton driver
- Add back NVME support
- Update Readme.md

Tracked-On: #3700
Signed-off-by: Peter Fang <peter.fang@intel.com>
2019-09-26 11:33:43 +08:00
Xiaoguang Wu 11f4a7267b DM USB: xHCI: support multiple ERST
This patch is used to support multiple Event Ring Segment Table (ERST).

Tracked-On: #3628
Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2019-09-26 11:29:22 +08:00
Xiaoguang Wu 52c17d634a DM USB: xHCI: rename some variables about ERST
This patch only changes some names of varaibles about Event Ring Segement
Table (ERST), and doesn't modify any code logic.

Tracked-On: #3628
Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2019-09-26 11:29:22 +08:00
Xiaoguang Wu e9211514e7 DM USB: modify disconnecting logic to support Windows 10
The Windows 10 feeds back quicker than Linux OS when error occured
due to device disconnecting, it will quickly reset the xHCI controller
before the DM starts to emulate disconnect event and it may cause some
unexpected errors such as crash.

This patch will do one more check when error happens, if the error
is induced by device disconnecting, the DM will not report error and
just wait until the disconnect event is reported to the guest. This
change could produce the correct hehavior as we expected.

Tracked-On: #3628
Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2019-09-26 11:29:22 +08:00
Xiaoguang Wu 06781b37e9 DM USB: dynamically allocate block count for struct usb_xfer
The block count of the struct usb_xfer is hard coded by the macro
USB_MAX_XFER_BLOCKS (1024), it wastes memory if 1024 blocks are
allocated for low speed transfer such as control transfer or interrupt
transfer. This patch introduces a new method to allocate different
number of blocks according to different endpoint type.

Tracked-On: #3628
Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2019-09-26 11:29:22 +08:00
Xiaoguang Wu f1b142e6e0 DM USB: xHCI: implement the emulation for overrun and underrun event
The overrun and underrun event are used in the timing control machanism,
this patch is used to implement this feature.

Tracked-On: #3628
Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2019-09-26 11:29:22 +08:00
Xiaoguang Wu 7cb45bc968 DM USB: xHCI: refine the emulation logic for BEI bit in the TRB
The Block Event Interrupt (BEI) bit in the TRB descriptor could
delay the triggering of interrupt. For most OSes, the native
driver for xHCI will use this bit to optimize the IO performence,
due to reduction of number of interrupts.

But in Linux, the native xHCI driver for Intel brand controller
doesn't use this bit. It is fine for the native scenario due to
most work is completed by hardware. But in virtualization scenario,
it is almost impossible to support heavy data IO such as high
resolution video recording (ISOC transfer).

Hence, this issue is solved by a 'quirk' when the intel hardware is
emulated (when vendor id is set as 0x8086). For other cases, a
virtal hardware called 'ACRN xHCI' is emulated, and both Linux and
Windows will use BEI bit by default.

Tracked-On: #3628
Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2019-09-26 11:29:22 +08:00
Xiaoguang Wu 685b1a7b66 DM USB: xHCI: fix emulation code for MFINDEX register
The old logic to emulate MFINDEX register is not right, this patch
is used to fix it.

Tracked-On: #3628
Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2019-09-26 11:29:22 +08:00
Xiaoguang Wu bda43ee352 DM USB: xHCI: rename the variable mf_prev_time
Just changed the name of the variable and didn't change any emulation
code logic.

Tracked-On: #3628
Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2019-09-26 11:29:22 +08:00
Xiaoguang Wu 8949a5802a DM USB: introduce struct xhci_block for xHCI emulation
In the struct usb_block, there are some fields such as 'ccs',
'streamid', which should not be seen in the USB layer. This
patch intruduces new struct xhci_block to include the variables
for xHCI emulation.

Tracked-On: #3628
Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2019-09-26 11:29:22 +08:00
Xiaoguang Wu 0110465416 DM USB: code clean: remove redundent code
When control transfer is detected and an unnecessary reset of
struct usb_xfer is conducted. This behavior is not necessary
and this patch is used to remove it.

Tracked-On: #3628
Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2019-09-26 11:29:22 +08:00
Xiaoguang Wu 1352eca224 DM USB: introduce helper functions: index_inc and index_valid
Introduce helper functions to make code shorter and cleaner.

Tracked-On: #3628
Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2019-09-26 11:29:22 +08:00
Xiaoguang Wu d58a766556 DM USB: re-implement the data block process logic
In Windows OS, there are many non-data blocks (EVENT DATA) during the USB
data transfer process, which is very different from the Linux conterpart.
To support both OS, the data processing logic is changed with the help of
newly introduced enum usb_block_type.

Tracked-On: #3628
Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2019-09-26 11:29:22 +08:00
Xiaoguang Wu 236c23e418 DM USB: introduce enum type usb_block_type
In the process of USB data transfer, there three kinds of data blocks:
a. Non data block, which contains some control information;
b. Partial data block, which contains part of a large data chunk;
c. Full data block, which contains a complete data chunk.

In previous implementation, the differences mentioned above are described
by the usb_block::chained. But the 'chained' is concept in the xHCI area
and should not appear in the USB layer. This patch introduces enum type
usb_block_type to replace the 'chained' field in struct usb_block.

Tracked-On: #3628
Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2019-09-26 11:29:22 +08:00
Xiaoguang Wu 7445e404a8 DM USB: code clean: change some names of functions and variables
Some names of functions and variables are long and not exact, this
patch is used to change them, no logic code are affected. The
changing included:

usb_data_xfer -> usb_xfer
usb_data_xfer_block -> usb_block
usb_xfer_blk_stat -> usb_block_stat
usb_data_xfer_append -> usb_block_append
USB_XFER_BLK_* -> USB_BLOCK_*

Tracked-On: #3628
Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2019-09-26 11:29:22 +08:00
Conghui Chen 0ea12a45d4 dm: script: remove guest cpu number
Remove the '-c' option from all scripts as it has been removed from
dm code.

Tracked-On: #3663
Signed-off-by: Conghui Chen <conghui.chen@intel.com>
Reviewed-by: Yin Fengwei <fengwei.yin@intel.com>
Reviewed-by: Binbin Wu <binbin.wu@intel.com>
2019-09-24 11:58:45 +08:00
Conghui Chen 16ad062d1a dm: remove guest cpu number option
Remove the guest cpu number option '-c', as the guest cpu number is
defined in hypervisor vm configuration file, and the number can be
return by vm_create().

Tracked-On: #3663
Signed-off-by: Conghui Chen <conghui.chen@intel.com>
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-09-24 11:58:45 +08:00
Shuo A Liu d8acff1f44 dm: get vcpu num from hypervisor when create VM
Now, we pre-define VM configuration statically in HV. So HV can create
vcpus instead of DM when VM create.

This patch get the created vcpu_num from HV. vm_create_vcpu can be
removed later if kernel can get vcpu_num correctly without
IC_CREATE_VCPU ioctl.

v4: Keep vm_create_vcpu in DM for compatbility. We might remove it when
kernel is ready.

Tracked-On: #3663
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
2019-09-24 11:58:45 +08:00
Geoffroy Van Cutsem f5c8fbb281 DM: update launch scripts to use OVMF.fd directly from the rootfs
* Update the launch scripts provided as examples on how to launch a Zephyr,
VxWorks or Windows User VM to directly use the 'OVMF.fd' bios file installed
by default in '/usr/share/acrn/bios/'
* Remove the OVMF.fd that was kept under 'doc/tutorials' (no longer needed)
* Adapt the tutorials to reflect this change

Tracked-On: #3673
Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2019-09-18 09:10:32 +08:00
Geoffroy Van Cutsem d3e564334a DM: make LaaG launch script use the OVMF.fd from the Service VM
Adjust the 'launch_uos.sh' script used to start a LaaG User VM to user the
OVMF.fd bios file installed under /usr/share/acrn/bios. It currently points
at a file in the local folder but neither our instructions nor our installation
script file puts it in this location. That results in an error when you try
to launch it.

Tracked-On: #3673
Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2019-09-17 09:45:12 +08:00
Minggui Cao 3d23c90a8e DM: to avoid RTVM shutdown forcely by acrn-dm
if RTVM, now we assume it can't be shutdown forcely by SOS, so
add check condition to avoid that.

Tracked-On: #3564
Signed-off-by: Minggui Cao <minggui.cao@intel.com>
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
2019-09-11 16:43:22 +08:00
Minggui Cao 8578125fed DM: add power off by vuart setting to launch script
1. for post-launch general VM, like LaaG, the vUART is emulated in DM,
so the power off control channel is:
  acrn-dm:pty[master <-> salve] <--> acrn-dm:vUART <--> UOS:vUART

2. for RTVM, like RT-Linux, the vUART is emulated in hypervisor layer,
so the control channel is:
   acrn-dm <--> SOS:/dev/ttyS1 <--> Hypervisor <--> UOS:vUART.

So the settings in launch script are different.

Tracked-On: #3564
Signed-off-by: Minggui Cao <minggui.cao@intel.com>
Reviewed-by: Binbin Wu <binbin.wu@intel.com>
2019-09-11 16:43:22 +08:00
Minggui Cao eb5a57b780 DM: add guest vm power manager by vuart
vuart can be used as communication channel between VMs;
here vuart used to control vm's power off flow; control command
is from SOS to UOS

Tracked-On: #3564
Signed-off-by: Minggui Cao <minggui.cao@intel.com>
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
2019-09-11 16:43:22 +08:00
Minggui Cao 00401a1e78 DM: separate pty vuart operation from IOC
for pty vuart operation will be commonly used by other module,
like pm-vuart: control UOS power off through vuart.

Tracked-On: #3564
Signed-off-by: Minggui Cao <minggui.cao@intel.com>
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
2019-09-11 16:43:22 +08:00
Yin Fengwei e38e026332 script: launch_uos: Give right pm notify channel
We seperate the guest power event notify channel out. And now
it's required to give the guest power event notify channel
explicitly. Update the sample launch script to have correct
parameters.

Tracked-On: #3564
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
2019-09-11 13:27:10 +08:00
Yin Fengwei b36d80ea0c dm: pm: add dm option to select guest notify method
Now, we have two ways to notify guest about power managment
event:
  - ioc on MRB platforms
  - ACPI power button on other platforms
And we hardcode which one is used now.

In coming change, we will add UART based guest notify method.
We add dm command option to select which method will be used
when launch UOS.

Tracked-On: #3564
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Reviewed-by: Yuan Liu <yuan1.liu@intel.com>
Acked-by: Wang Yu <yu1.wang@intel.com>
2019-09-11 13:27:10 +08:00
Yin Fengwei 1041384993 dm: pm: move host power button related code out of pm.c
For the code which forwards the native power button event to
guest, they are not related with guest pm related operation
emulation. Move this part of code out of pm.c. And will make
the power button as one possible method to notify guest about
the shutdown operation.

Tracked-On: #3564
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Reviewed-by: Yuan Liu <yuan1.liu@intel.com>
Acked-by: Wang Yu <yu1.wang@intel.com>
2019-09-11 13:27:10 +08:00
Geoffroy Van Cutsem 9bb21aca64 dm: remove '-p' option from the embedded help
Remove the '-p' ("pincpu" option) from the help displayed when calling 'acrn-dm
-h'.

Tracked-On: #3600
Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2019-09-10 15:28:56 +08:00
Liu Xinyun 639c698626 dm: reserve 16M hole for gvt in e820 table
Add 16M@0xDF000000 for GVT usage as below. Currently, use 8M for GOP
framebuf, it satisfies display resolution of 1920x1080@32bpp

start         end          size    Note
[0x 00000000, 0x 000A0000] 640K
[0x 000A0000, 0x 00100000] 384K
[0x 00100000, 0x 7ff00000] 2G-1M   lowmem-1M
[0x 80000000, 0x 88000000] 128M    [lowmem, +128M]
[0x DF000000, 0x E0000000] 16M     *gvt*
[0x e0000000, 0x100000000] 512M
[0x100000000, 0x140000000] 1G

*gvt*:
[0xDF000000, 0xDF800000] 8M      GOP FB
[0xDFFFD000, 0XE0000000] 12K     opregion

Tracked-On: #3624

Signed-off-by: Liu Xinyun <xinyun.liu@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-09-10 09:50:39 +08:00
Xiaoguang Wu be0a4b692b DM USB: fix enumeration related issues
The patch fixes enumeration related issues introduced by commit 'fc3d19'.

Tracked-On: #3612
Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2019-09-03 12:22:46 +08:00
Shuo A Liu e7179aa7a0 dm: support VM running with more than 4 vcpus
Change hardcode of vcpu number to the real value when process VM's IO
request in DM, so we can handle all requests from different vcpus.

Tracked-On: #3425
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2019-09-03 08:50:40 +08:00
Conghui Chen 2d57c5feb7 dm: virtio-console: add subclass
Add subclass for virtio-console pci device. Without the subclass, the
device may be probed by 8250_pci serial driver,  and lead to segment
fault in acrn-dm. This issue appears when running debian as Guest OS.

But there is a potential issue, if a new serial driver, which use class
and subclass same as virtio-console, the problem may still trigger. Need
to fix it case by case.

Tracked-On: #3615
Signed-off-by: Conghui Chen <conghui.chen@intel.com>
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
2019-08-27 09:47:00 +08:00
Yin Fengwei 66056c1acb dm: bzimage loader: get linux bzimage setup_sects from header
According to $(LINUX_SRC)/Documentation/x86/boot.txt, the header
of bzimage has setup sector number in offset 0x1f1. We don't
need to scan the SETUP_SIG and detect the setup sector number
actually which is not documented in x86 boot protocol.

Tracked-On: #3619
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2019-08-27 09:46:23 +08:00
Xiaoguang Wu fc3d19bee4 DM USB: fix potential crash risk due to null pointer
Fix potential risk to crash due to null pointer.

Tracked-On: #3612
Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2019-08-26 14:17:49 +08:00