acrn-hypervisor/devicemodel/include
Shuo Liu e8296dce05 hv: Add IO request completion polling feature
This patch introduce a new mode of IO request completion, polling mode.

Now, the sketch of ioreq process can be,
  A. UOS vcpu0 generate PIO/MMIO ->
   B. pcpu1(vcpu0 of UOS) trap into HV ->
    C. pcpu1 build ioreq, send IPI and enter idle ->
     D.1 pcpu0(vcpu0 of SOS) response IPI,
     D.2 pcpu0 handle the ioreq in HV, kernel, DM,
     D.3 pcpu0 mark ioreq as complete,
     D.4 pcpu0 hypercall to enter HV ->
       E.1 pcpu0 send IPI to wake pcpu1 up
       E.2 UOS vcpu0 continue running

With this change, it skips D.4, E.1 steps. In step C, pcpu1 will enter a
polling ioreq state idle after send out the IPI.
It can save about ~5000 cpu cycles.

In polling mode, we do the polling in idle instead of pause cpu all the
time. It will consume more power. A better way is to use monitor/mwait
instructions which can put cpu into a sleep state with monitoring a
memory address. Unfortunately, APL has bug with monitor. We can gather
all ioreqs state into one monitorable memory and take advantage of
monitor/mwait for future platform.

The way polling or notification is per VM. We can config VMs in
different mode. By default, IO request completion will use notification
mode for all VMs. We can switch it by Kconfig.

Tracked-On: #1821
Signed-off-by: Shuo Liu <shuo.a.liu@intel.com>
Reviewed-by: Eddie Dong <eddie.dong@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2018-11-21 14:35:12 +08:00
..
public hv: Add IO request completion polling feature 2018-11-21 14:35:12 +08:00
acpi.h DM: Add funciton to update PM_WAK_STS 2018-08-02 13:14:03 +08:00
ahci.h initial import 2018-05-11 14:44:28 +08:00
ata.h initial import 2018-05-11 14:44:28 +08:00
atkbdc.h DM: add deinit function to virtual keyboard device 2018-05-15 17:25:24 +08:00
atomic.h DM: add wrappers to gcc built-in atomic operations 2018-08-08 15:53:07 +08:00
block_if.h dm: storage: support cache mode toggling 2018-08-10 10:33:21 +08:00
console.h DM: add deinit function for ps2kbd and ps2mouse 2018-05-15 17:25:24 +08:00
cpuset.h initial import 2018-05-11 14:44:28 +08:00
dm.h doc: update virtio related functions doc comments 2018-11-04 20:32:50 -08:00
dm_string.h dm: add const declaration for dm_strto* APIs 2018-10-24 18:16:37 +08:00
gc.h initial import 2018-05-11 14:44:28 +08:00
i8253reg.h dm: vpit: add PIT-related header files 2018-10-09 13:24:47 +08:00
inout.h dm: cmdline: remove unused parameters 2018-10-26 13:37:47 +08:00
ioapic.h DM: increase vioapic pin count 2018-05-16 15:09:48 +08:00
ioc.h IOC mediator: add RTC feature 2018-09-12 09:18:44 +08:00
iodev.h initial import 2018-05-11 14:44:28 +08:00
irq.h initial import 2018-05-11 14:44:28 +08:00
lpc.h initial import 2018-05-11 14:44:28 +08:00
macros.h dm: vpit: add vPIT support 2018-10-09 13:24:47 +08:00
mc146818rtc.h initial import 2018-05-11 14:44:28 +08:00
mei.h dm: mei: add mei hbm protocol definitions header. 2018-10-23 11:40:15 +08:00
mem.h dm: fix the issue when guest tries to disable memory range access 2018-10-08 12:57:00 +08:00
mevent.h dm: mevent: add edge triggered events. 2018-10-11 19:06:01 +08:00
monitor.h DM: add interface to set intr storm monitor params 2018-11-08 14:43:05 +08:00
mptable.h initial import 2018-05-11 14:44:28 +08:00
mptbl.h initial import 2018-05-11 14:44:28 +08:00
netmap.h initial import 2018-05-11 14:44:28 +08:00
netmap_user.h initial import 2018-05-11 14:44:28 +08:00
npk.h DM: implement emulated npk pci device 2018-06-07 16:11:49 +08:00
ns16550.h initial import 2018-05-11 14:44:28 +08:00
pci_core.h doc: update virtio related functions doc comments 2018-11-04 20:32:50 -08:00
pciio.h initial import 2018-05-11 14:44:28 +08:00
pcireg.h dm: Disable stolen memory for passthru graphics 2018-06-29 00:50:01 +08:00
pit.h dm: vpit: add PIT-related header files 2018-10-09 13:24:47 +08:00
pm.h DM: register pm ops to monitor 2018-08-02 13:14:03 +08:00
ps2kbd.h DM: add deinit function for ps2kbd and ps2mouse 2018-05-15 17:25:24 +08:00
ps2mouse.h DM: add deinit function for ps2kbd and ps2mouse 2018-05-15 17:25:24 +08:00
rpmb.h dm: rpmb: DM customized changes for RPMB mux kernel module 2018-10-19 22:31:28 +08:00
rpmb_backend.h DM: RPMB virtualization 2018-05-25 10:45:24 +08:00
rpmb_sim.h dm: inline functions defined in header must be static 2018-10-11 19:04:18 +08:00
rtc.h dm: vrtc: add memory configuration in RTC CMOS 2018-10-05 00:33:17 +08:00
segments.h initial import 2018-05-11 14:44:28 +08:00
smbiostbl.h initial import 2018-05-11 14:44:28 +08:00
specialreg.h initial import 2018-05-11 14:44:28 +08:00
sw_load.h dm: add elf loader to dm 2018-10-17 14:32:33 +08:00
timer.h DM: add acrn_timer api for timer emulation 2018-10-17 14:31:09 +08:00
tree.h initial import 2018-05-11 14:44:28 +08:00
types.h dm: types: add container_of macro 2018-10-23 11:40:15 +08:00
uart_core.h DM: cleanup resource for uart. 2018-05-15 17:25:55 +08:00
usb.h DM USB: move the UREQ macro into common header 2018-05-29 10:35:05 +08:00
usb_core.h DM USB: xHCI: workaround for Stop Endpoint Command handling 2018-10-19 22:39:50 +08:00
usb_pmapper.h DM USB: xHCI: support multiple hubs in single layer 2018-10-19 22:39:50 +08:00
usbdi.h initial import 2018-05-11 14:44:28 +08:00
vbs_common_if.h dm: virtio: add support for VBS-K device reset 2018-08-16 16:22:43 +08:00
vhost.h doc: update virtio related functions doc comments 2018-11-04 20:32:50 -08:00
virtio.h doc: update virtio related functions doc comments 2018-11-04 20:32:50 -08:00
virtio_kernel.h doc: update virtio related functions doc comments 2018-11-04 20:32:50 -08:00
vmcfg.h DM: VMcfg: support --dump options 2018-10-22 16:57:23 +08:00
vmm.h DM: adapt to the new VHM request state transitions 2018-08-08 15:53:07 +08:00
vmmapi.h DM: wrap ASSERT/DEASSERT IRQ line with Set/Clear IRQ line 2018-10-29 09:26:23 +08:00
vrpmb.h DM: Generate vRPMB key when creating UOS 2018-05-25 10:45:24 +08:00
xhci.h DM USB: xHCI: change port mapping logic for multiple hub support 2018-10-19 22:39:50 +08:00
xhcireg.h DM USB: xHCI: Update the native DRD interfaces. 2018-07-10 13:42:17 +08:00