Commit Graph

1003 Commits

Author SHA1 Message Date
Long Liu 1672eca2b9 DM USB: xHCI: Drop commands if slot is disabled
From xHCI spec 4.5.3.2, the only command that software is
allowed to issue for the slot in disabled state is the Enable
Slot Command. Drop other commands in command handle function.

Tracked-On: #4711
Signed-off-by: Long Liu <long.liu@intel.com>
Reviewed-by: Yuan Liu <yuan1.liu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2020-06-05 15:31:05 +08:00
Naveen Saini b919122c34 use variables for installation directories.
Don't hardcode install paths. Instead of hardcoding where binaries are
installed, add variables that installer can override.

Tracked-On: #4864

Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
2020-06-05 15:25:12 +08:00
Peter Fang e41c17653f OVMF release v2.0
- Add Platform GOP Policy
- Add MemoryFence to AcrnEmuVariableFvbRuntimeDxe
- UefiCpuPkg/CpuExceptionHandlerLib: Fix split lock
- OvmfPkg/SataControllerDxe: Calculate ChannelCount based on PI value

Tracked-On: #4866
Signed-off-by: Peter Fang <peter.fang@intel.com>
2020-06-02 15:09:30 +08:00
Vijay Dhanraj a81f6e2c62 doc: Enabling ACRN on top of QEMU/KVM
Tracked-On: #3198
Signed-off-by: Vijay Dhanraj <vijay.dhanraj@intel.com>
2020-05-29 09:10:42 -07:00
Zide Chen f6a7206200 acrn-dm: fix corner cases in acrn_parse_cpu_affinity()
- re-arange the code to make static code analysis tool happy.

- If no valid conversion could be performed, a zero value is returned
  (0L) from strtol(), so add a sanity check "isdigit(cp[0])" to ensure
  that it won't unexpectedly parse CPU 0 if the string starts or ends
  with the valid delimiters ',' or '-', for example:

  -- cpu_affinity 1,
  -- cpu_affinity ,1

Tracked-On: #4616
Signed-off-by: Zide Chen <zide.chen@intel.com>
2020-05-29 11:51:09 +08:00
Yuan Liu aeae464980 Implement creation and removal of inter-vm shared memory
The shared memory will be created when a post-launched VM which
specified ivshmem v1 device starts, the same shared memory name
will only create a shared memory region.

The shared memory will be removed when all post-launched VMs
that opened it close the shared memory object.

v2: Support one post-launched VM can configure multiple ivshmem
    devices

Tracked-On: #4853
Signed-off-by: Yuan Liu <yuan1.liu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2020-05-29 09:28:24 +08:00
Yuan Liu cb816f7f65 Introduce ACRN Inter-VM Virtualization
Support shared memory based inter-vm communication for ACRN
post-launched VMs. The ivshmem mediator emulates one standard
PCI device which expose the shared memory region through its BAR2.
The shared memory region is allocated through Linux shm mechanism and
post-launched VM needs to specify the shm name and size as the acrn-dm
parameter, the VMs have same shm name parameter can communicate over
the shared memory.

For first stage, only support shared memory. Consider to support
notification(interrupt) in future.

To add a ivshmem device in device model, the usage as below
-s N,ivshmem,shm_name,shm_size

v2: Implement the ivshmem MMIO registers emulation

v3: Refine code style
    Add ivshmem device usage
    Refine MMIO register return value

v4: Refine comments
    Use logger interfaces to print logs

Tracked-On: #4853
Signed-off-by: Yuan Liu <yuan1.liu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2020-05-29 09:28:24 +08:00
Helmut Buchsbaum 884e9fc911 Revert "dm: acpi: add PSDS table in ACPI table"
This reverts commit 59e2de4805.

Since PSDS table format does not meet the expectations on all boards
providing a PSDS, such as e.g. Kontron COMe-mAL10 based boards, remove
exposure of PSDS table for now.

Tracked-On: #4846
Signed-off-by: Helmut Buchsbaum <helmut.buchsbaum@opensource.tttech-industrial.com>
2020-05-29 09:03:52 +08:00
Helmut Buchsbaum ccbabb4ce8 dm: bzimage: dynamically adapt to ramdisk size
To remove the limit of 4MB ramdisk size simply adjust layout
dynamically according to ramdisk size rounded up to a 4K boundary.
This enables ramdisk based virtual machines which tend to have
large ramdisk memory requirements (128MB and above).

Tracked-On: #4840
Signed-off-by: Helmut Buchsbaum <helmut.buchsbaum@opensource.tttech-industrial.com>
2020-05-28 08:49:47 +08:00
Helmut Buchsbaum b7f667a3ba dm: Do not link to zlib
Since zlib is not used, remove linking to it. This reduces build
dependencies.

Tracked-On: #4838
Signed-off-by: Helmut Buchsbaum <helmut.buchsbaum@opensource.tttech-industrial.com>
2020-05-26 14:01:54 +08:00
Zhao Yakui 6c02a8d5ed ACRN/DM: Initialize the igd_lpc bridge to ISA_BRIDGE to make Linux guest happy
Currently the class type of igd_lpc bridge PCI device is not initialized.
In such case the guest driver doesn't detect the platform correctly when it
is in GVT-d mode. Then the linux i915 driver can't work.

Tracked-On: #4745
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Reviewed-by: Binbin Wu <binbin.wu@intel.com>
2020-05-25 11:08:25 +08:00
Zhao Yakui bca83efee8 ACRN/DM: Reset the passthrough device to fix garbage display issue
Currently the DM will return the passthrough device to SOS when the DM
needs to be terminated. But the device is not reset. In such case it
will cause the garbage display issue when the GPU passthrough device
is returned.

Tracked-On: #4719
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Reviewed-by: Binbin Wu <binbin.wu@intel.com>
2020-05-25 11:08:25 +08:00
Minggui Cao a335679ce9 Makefile: remove 'clean' when building HV/DM
1. not need 'clean' when building ACRN-HV/DM each time
2. correct efi-stub wrong dependency

Tracked-On: #2412
Signed-off-by: Minggui Cao <minggui.cao@intel.com>
Reviewed-by: Binbin Wu <binbin.wu@intel.com>
2020-05-21 15:12:21 +08:00
Mingqiang Chi 4d3221a7f3 acrn-dm: add some logs for vm state transition
add logs for vm state transition to help
analyze some problems.

Tracked-On: #4098
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Reviewed-by: Yin Fengwei <fengwei.yin@intel.com>
2020-05-15 10:06:23 +08:00
yuhong.tao@intel.com bc14dfb0bd DM: cleanup devicemodel monitor handle pause/continue msg request
The 'pause/continue' acrnctl cmd is never used and their action are not
defined for ACRN VMs. Devicemodel minitor doesn't need to handle these 2
msg, should be removed.

Tracked-On: #4790
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
Reviewed-by: Yan, Like <like.yan@intel.com>
2020-05-14 12:52:59 +08:00
Geoffroy Van Cutsem bf5d187539 devicemodel: remove obsolete argument from list of options
Remove the 'p' argument from the list as it is now obsolete and there is no
implementation for it in the code.

Tracked-On: #4732
Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2020-05-06 13:43:35 +08:00
Tw 01802e9134 sample: add log support when launching Xenomai
Add log related stuff for more debug information.

Tracked-On: #4514
Signed-off-by: Tw <wei.tan@intel.com>
2020-04-27 10:04:00 +08:00
Tw e69690111a sample: don't restore passthrough devices on exit by default on Xenomai
Passthroughed devices won't be restored back to SOS once launch
script exits by default. However you could revert this behavior
by specifying '-r' parameter if you want.

Tracked-On: #4514
Signed-off-by: Tw <wei.tan@intel.com>
2020-04-27 10:04:00 +08:00
Zide Chen 2c9c681e6d acrn-dm: change command option name from "pcpu_list" to "cpu_affinity"
commit 71bdc27a0f ("acrn-dm: implement cpu_affinity command line argument")
doesn't use correct name.

Tracked-On: #4616
Signed-off-by: Zide Chen <zide.chen@intel.com>
2020-04-24 13:18:10 +08:00
Junming Liu 1da7e4145f dm:refine graphics data stolen memory passthru for EHL platform
EHL graphics data stolen memory(DSM) info has diff with KBL/WHL,
which includes two parts:
(1) DSM register location in pci config: on KBL/WHL, the register
locates on 0X5C, while on EHL, the register locates on 0xC0.
(2) DSM address length: On KBL/WHL,
DSM addr has 32 bits, while on EHL,DSM addr has 64 bits.

Here, refine graphics data stolen memory passthru to enable GVT-d on EHL platforms.

v3 -> v4:
        * add MICRO INTEL_ELKHARTLAKE
v2 -> v3:
	* refine discription,MICRO name
	* refine code style
v1 -> v2:
	* add callback functions for scalability

Tracked-On: projectacrn#4700

Signed-off-by: Junming Liu <junming.liu@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Reviewed-by: Liu XinYun <xinyun.liu@intel.com>
Reviewed-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2020-04-24 12:54:50 +08:00
Junming Liu 795225d55e dm:add function passthru_gpu_dsm_opregion for passthru_init
Pack GPU DSM(Data Stolen Memory) and Opregion related operations
into function passthru_gpu_dsm_opregion to avoid passthru_init too mess.

Tracked-On: #4700

Signed-off-by: Junming Liu <junming.liu@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Reviewed-by: Liu XinYun <xinyun.liu@intel.com>
Reviewed-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2020-04-24 12:54:50 +08:00
Junming Liu b45c24b062 dm:refine comments and variables name about data stolen memory
"gsm" term is not precise to describe GPU stolen memory,
It should be "dsm", which acronyms for data stolen memory.

Tracked-On: #4700

Signed-off-by: Junming Liu <junming.liu@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Reviewed-by: Liu XinYun <xinyun.liu@intel.com>
Reviewed-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2020-04-24 12:54:50 +08:00
Zide Chen 71bdc27a0f acrn-dm: implement cpu_affinity command line argument
User has a chance to specify VCPU affinity through acrn-dm command line
argument. Examples of the command line:

3 PCPUs: 1/2/3
--cpu_affinity 1-3

5 PCPUs: 2/3/6/7/8
--cpu_affinity 2,3,6-8

8 PCPUs: 2/3/6/7/9/10/11/12
--cpu_affinity 2,3,6-7,9,10-12

The specified pCPUs must be included in the guest VM's statically
defined vm_config[].cpu_affinity_bitmap.

Tracked-On: #4616
Signed-off-by: Zide Chen <zide.chen@intel.com>
2020-04-23 09:38:54 +08:00
Minggui Cao 9f036cff6a DM: add wall time info into disk log file
1. add wall time info into disk log file, to make it easier to
   sync with other log

2. improve the log path creating operation, call system to make
   dir to avoid the first and second level path not existed.

Tracked-On: #4633
Signed-off-by: Minggui Cao <minggui.cao@intel.com>
Reviewed-by: Yin Fengwei <fengwei.yin@intel.com>
2020-04-22 08:39:25 +08:00
Mingqiang Chi 2d3c60ccd3 dm: add vm_pause before vm_destroy
now VM state transition only allows VM_PAUSED to
VM_POWERED_OFF, this patch call vm_pause before vm_destroy
in some vm failure cases.

Tracked-On: #4320
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
2020-04-16 22:09:04 +08:00
Mingqiang Chi 90b8d844d0 dm:refine pm_vuart code
1) remove state machine
2) remove retry mechanism
3) pm thread only use to transmit data,not parse detailed message.

v1-->v2:
   remove delay in pm_monitor_loop
Tracked-On: #4446
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Reviewed-by: Shuo A Liu <shuo.a.liu@intel.com>
Reviewed-by: Minggui Cao <minggui.cao@intel.com>
Reviewed-by: Yuhong Tao <yuhong.tao@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2020-04-16 22:01:54 +08:00
Tw e51d12d8cb sample: add sample script for launching xenomai RTVM
Add a launch script for xenomai RTVM.

Tracked-On: #4514
Signed-off-by: Tw <wei.tan@intel.com>
Reviewed-by: Binbin Wu <binbin.wu@intel.com>
2020-04-08 11:49:27 +08:00
Junming Liu 86aa338a5f dm: correct PCI configures of igd-lpc
previous patch fails to align SUBVID, SUBDID of igd-lpc with physical one.
this patch corrects the errors and refine the code.

Tracked-On: #4405

Signed-off-by: Junming Liu <junming.liu@intel.com>
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2020-03-30 10:06:20 +08:00
Li Fei1 e99ddf28c3 hv: vpci: handle the quirk part for pass through pci device cfg access in dm
There're some PCI devices need special handler for vendor-specical feature or
capability CFG access. The Intel GPU is one of them. In order to keep the ACRN-HV
clean, we want to throw the qurik part of PCI CFG asccess to DM to handle.

To achieve this, we implement per-device policy base on whether it needs quirk handler
for a VM: each device could configure as "quirk pass through device" or not. For a
"quirk pass through device", we will handle the general part in HV and the quirk part
in DM. For a non "quirk pass through device",  we will handle all the part in HV.

Tracked-On: #4371
Signed-off-by: Li Fei1 <fei1.li@intel.com>
2020-03-20 10:08:43 +08:00
Peter Fang 05dc6c5336 OVMF release v1.6
- Enable fstack-protector-strong for OVMF x64 and gcc5

Tracked-On: #4490
Signed-off-by: Peter Fang <peter.fang@intel.com>
2020-03-16 08:37:22 +08:00
Mingqiang Chi 910ac9f917 dm:send shutdown to life_mngr on SOS
it will send shutdown command to life_mngr on SOS
after the UOS has poweroff itself

Tracked-On: #4446
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Reviewed-by: Minggui Cao <minggui.cao@intel.com>
Reviewed-by: Shuo A Liu <shuo.a.liu@intel.com>
Reviewed-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2020-03-11 15:43:29 +08:00
Mingqiang Chi f78558a4fd dm: add one api for sending shutdown to life_mngr on SOS
when acrn-dm received shutdown command, it will call this api
to send shutdown command to life_mngr running on SOS via socket.

Tracked-On: #4446
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Reviewed-by: Minggui Cao <minggui.cao@intel.com>
Reviewed-by: Shuo A Liu <shuo.a.liu@intel.com>
Reviewed-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2020-03-11 15:43:29 +08:00
Mingqiang Chi 8733abef6b dm:handle shutdown command from UOS
it will send "acked" message to UOS if it receives
"shutdown" command from UOS, then wait UOS poweroff itself,
it will send shutdown to life_mngr running on SOS to
shutdown system.

Tracked-On: #4446
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Reviewed-by: Shuo A Liu <shuo.a.liu@intel.com>
Reviewed-by: Minggui Cao <minggui.cao@intel.com>
Reviewed-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2020-03-11 15:43:29 +08:00
Mingqiang Chi 4fdc2be129 dm:replace shutdown_uos_thread with a new one
Change shutdown_uos_thread to pm_monitor thread,
the shutdown_uos_thread can do:
 --send shutdown request to UOS
 --receive acked message from UOS
the pm_monitor can do:
 --send shutdown request to UOS
 --receive acked message from UOS
 --receive shutdown request from UOS

Tracked-On: #4446
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Reviewed-by: Minggui Cao <minggui.cao@intel.com>
Reviewed-by: Shuo A Liu <shuo.a.liu@intel.com>
Reviewed-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2020-03-11 15:43:29 +08:00
Mingqiang Chi 7e9b7a8c34 dm:set pm-vuart attritutes
set the attributes during pm-vuart initialization
to avoid the pm-vuart in an indefinite state.

Currently we have implemented S5 triggered by SOS,
these patch series both support S5 triggered by SOS and RTVM.

the fully steps for S5 triggered by SOS:
1) S5-Trigger: it initiates the  platform shutdown actions;
   it calls “acrnctl stop vmX” to do that,
   and check the VM's status, power-off SOS itself.
2) acrnctl will send “stop” to “acrn-dm”
3) acrn-dm will send “shutdown” command to VMx by v-UART.
4) when life-cycle manager in VMx receives the “shutdown” command,
   it will give an “acked” to acrn-dm, and then poweroff itself.

the fully steps for S5 triggered by RTVM:
1) S5-Trigger in RTVM:  it initiates the  platform shutdown actions;
   it’ll send shutdown command for platform shutdown to
   life-cycle manager
2) when life-cycle manager in RTVM receive the message,
   it will send “shutdown” command to acrn-dm in SOS by v-UART.
3) when acrn-dm receives the “shutdown” command from RTVM,
   it will give an “acked” to RTVM, RTVM’s life-cycle manager can
   power off itself
4) acrn-dm will send  “shutdown” command to its own life-cycle manager
   by socket.
5) when life-cycle manager in SOS receives the “shutdown” command,
   it can call “s5_trigger” script to shutdown platform.

Tracked-On: #4446
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Reviewed-by: Yin Fengwei <fengwei.yin@intel.com>
Reviewed-by: Minggui Cao <minggui.cao@intel.com>
Reviewed-by: Shuo A Liu <shuo.a.liu@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2020-03-11 15:43:29 +08:00
Li Fei1 fa74bf401d hv: vpci: pass through stolen memory and opregion memory for GVT-D
In order to add GVT-D support, we need pass through stolen memory and opregion memroy
to the post-launched VM. To implement this, we first reserve the GPA for stolen memory
and opregion memory through post-launched VM e820 table. Then we would build EPT mapping
between the GPA and the stolen memory and opregion memory real HPA. The last, we need to
return the GPA to post-launched VM if it wants to read the stolen memory and opregion
memory address and prevent post-launched VM to write the stolen memory and opregion memory
address register for now.
We do the GPA reserve and GPA to HPA EPT mapping in ACRN-DM and the stolen memory and
opregion memory CFG space register access emulation in ACRN-HV.

Tracked-On: #4371
Signed-off-by: Li Fei1 <fei1.li@intel.com>
2020-03-11 10:59:23 +08:00
Li Fei1 64bf4fb8f4 dm: don't deassign pass through PCIe device in DM
Let the ACRN HV to do this in shutdown sequence. In this case, the RTVM could be
still alive if something wrong happened to cause the DM died.

Tracked-On: #4428
Signed-off-by: Li Fei1 <fei1.li@intel.com>
2020-03-06 08:30:59 +08:00
Yin Fengwei a63f81097d dm: avoid clear guest memory content if guest is RTVM
If the guest is RTVM, dm process exit doesn't mean RTVM is
shutdown. Only shutdown_vm in hypervisor guarantee RTVM is
shutodwn. So we should avoid touch guest memory content
from DM if the guest is RTVM.

Tracked-On: #4428
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2020-03-02 16:44:26 +08:00
Li Fei1 be1e3acb01 dm: remove vdev_update_bar_map callback for PCIe device
Since this callback is only useful for pass through PCIe device and now pass through
PCIe device emulation has splited from DM to HV. we could remove this callback now.

Tracked-On: #4371
Signed-off-by: Li Fei1 <fei1.li@intel.com>
2020-03-02 16:42:17 +08:00
Li Fei1 9d3d9c3d1e dm: vpci: restrict SOS access assigned PCI device
SOS should not access the physical PCI device which is assigned to other guest.

Tracked-On: #4371
Signed-off-by: Li Fei1 <fei1.li@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2020-02-24 16:17:38 +08:00
Li Fei1 9fa6eff3c5 dm: vPCI: remove passthrough PCI device unused code
Now we split passthrough PCI device from DM to HV, we could remove all the passthrough
PCI device unused code.

Tracked-On: #4371
Signed-off-by: Li Fei1 <fei1.li@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2020-02-24 16:17:38 +08:00
Li Fei1 dafa3da693 vPCI: split passthrough PCI device from DM to HV
In this case, we could handle all the passthrough PCI devices in ACRN hypervisor.
But we still need DM to initialize BAR resources and Intx for passthrough PCI
device for post-launched VM since these informations should been filled into
ACPI tables. So
1. we add a HC vm_assign_pcidev to pass the extra informations to replace the old
vm_assign_ptdev.
2. we saso remove HC vm_set_ptdev_msix_info since it could been setted by the post-launched
VM now same as SOS.
3. remove vm_map_ptdev_mmio call for PTDev in DM since ACRN hypervisor will handle these
BAR access.
4. the most important thing is to trap PCI configure space access for PTDev in HV for
post-launched VM and bypass the virtual PCI device configure space access to DM.

This patch doesn't do the clean work. Will do it in the next patch.

Tracked-On: #4371
Signed-off-by: Li Fei1 <fei1.li@intel.com>
2020-02-24 16:17:38 +08:00
Li Fei1 aa38ed5b69 dm: vPCI: add assign/deassign PCI device IC APIs
Add assign/deassign PCI device ioctl APIs assign a PCI device from SOS to
post-launched VM or deassign a PCI device from post-launched VM to SOS. This patch
is prepared for spliting passthrough PCI device from DM to HV.
The old assign/deassign ptdev APIs will be discarded.

Tracked-On: #4371
Signed-off-by: Li Fei1 <fei1.li@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2020-02-24 16:17:38 +08:00
Junming Liu 0829edee4c dm:add an extra lpc bridge when enabling gvt-d
Intel Graphics Device(IGD) passthrough on Windows guest
has the restriction that it need a lpc bridge device
located in 00:1f.0 PCI slot.

This patch add a 'gpu' option for 'passthrou' type device,
which will create the dedicated "igd-lpc" for IGD passthrough.

Tracked-On: #4405

v2 -> v3:
        * refine the commit message and comments.

Signed-off-by: Junming Liu <junming.liu@intel.com>
Reviewed-by: Shuo A Liu <shuo.a.liu@intel.com>
Reviewed-by: Wu Binbin <binbin.wu@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2020-02-24 11:47:10 +08:00
Junming Liu da2ed57ac4 dm:add igd-lpc class for Windows guest when enabling gvt-d
Intel Graphics Device(IGD) passthrough on Windows guest
has the restriction that it need a lpc bridge device
located in 00:1f.0 PCI slot.
This patch add an extra lpc class for this restriction,
the lpc class will be used to create a dummy lpc bridge.

To enable gvt-d GOP driver work,
the VID, DID, REVID, SUBVID, SUBDID of igd-lpc
need aligned with physical one.

Tracked-On: #4405

v2 -> v3:
        * refine the comment message and comments.

Signed-off-by: Junming Liu <junming.liu@intel.com>
Reviewed-by: Shuo A Liu <shuo.a.liu@intel.com>
Reviewed-by: Wu Binbin <binbin.wu@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2020-02-24 11:47:10 +08:00
fangfang.shen 7f57e64e10 Delete pass-through audio to WaaG in default.
For "Split Device Model", pass-through PCI will be implemented in HV,
"reset" param is added into DM cmdline to ensure PCI device's status before launching VM.
WaaG will fail to boot if adding pass-through audio in default,
because current audio card's reset function isn't supported on WHL platform.

Tracked-On: #4397

Signed-off-by: fangfang.shen <fangfang.shen@intel.com>
2020-02-12 13:08:23 +08:00
Junming Liu 1b3754aaee dm:passthrough opregion to uos gpu
uos IGD driver need opregion when enable GVT-d.

This patch pass-thru opregion to uos gpu.
Here is the steps:
(1) set opregion gpa(guest physical addrress) 0xDFFFD000;
(2) get opregion hpa(host physical addrress);
(3) build EPT mapping for opregion.

v1 -> v2:
        * initialize the EPT mapping for passthrough GPU opregion region
        in passthru_init instead of reading the ASLS config space

v2 -> v3:
        * add EPT unmap when deinit
        * change some micro name

Tracked-On: #4360

Signed-off-by: Junming Liu <junming.liu@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Reviewed-by: Liu XinYun <xinyun.liu@intel.com>
Reviewed-by: Shuo A Liu <shuo.a.liu@intel.com>
Reviewed-by: Wu Binbin <binbin.wu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2020-01-17 09:23:13 +08:00
Junming Liu 4d882731ce dm:passthrough graphics stolen memory to uos gpu
gop driver and uos IGD driver will use
graphics stolen memory(gsm) when enable GVT-d.

This patch pass-thru gsm to uos gpu.

After set physical GPU gsm size 64MB in host BIOS:
Here is the steps:
(1) set gsm gpa(guest physical addrress) 0xDB000000;
(2) get gsm hpa(host physical addrress);
(3) build EPT mapping for gsm.

v1 -> v2:
        * initialize the EPT mapping for passthrough GPU gsm region
        in passthru_init instead of reading the BDSM config space

v2 -> v3:
        * add EPT unmap when deinit
	* change some micro name

Tracked-On: #4360

Signed-off-by: Junming Liu <junming.liu@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Reviewed-by: Liu XinYun <xinyun.liu@intel.com>
Reviewed-by: Shuo A Liu <shuo.a.liu@intel.com>
Reviewed-by: Wu Binbin <binbin.wu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2020-01-17 09:23:13 +08:00
Junming Liu f9f64d356f dm:reserve 64M hole for graphics stolen memory in e820 table
Add 64M@0xDB000000 for GVT-d usage as below.
Currently, use 64M for graphics stolen memory,
gop driver and uos IGD driver will use this memory region.

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 DB000000, 0x DF000000] 64MB     graphics stolen memory for GVT-d
[0x DF000000, 0x E0000000] 16M 	    gvt
[0x e0000000, 0x100000000] 512M
[0x100000000, 0x140000000] 1G

Tracked-On: #4360

Signed-off-by: Junming Liu <junming.liu@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Reviewed-by: Liu XinYun <xinyun.liu@intel.com>
Reviewed-by: Shuo A Liu <shuo.a.liu@intel.com>
Reviewed-by: Wu Binbin <binbin.wu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2020-01-17 09:23:13 +08:00
Junming Liu 03f5c639a0 dm:derive the prefetch property of PCI bar for pass-through device
Now the PCI bar uses the hardcoded prefetch property
for the pass-through device.
This doesn't work when trying to load windows GPU driver
for the pass-through GPU device.

For pass-through devices,
set the bar prefetchable property the same as physical bar.

Tracked-On: #4282

Signed-off-by: Junming Liu <junming.liu@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Reviewed-by: Shuo A Liu <shuo.a.liu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2020-01-13 16:47:25 +08:00