acrn-hypervisor/hypervisor/arch/x86
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
..
configs HV: For MRB, use 0x3E8/IRQ6 as the vuart port base address/IRQ. 2018-11-16 10:24:48 +08:00
guest hv: Add IO request completion polling feature 2018-11-21 14:35:12 +08:00
assign.c HV: handle adding ptdev entry failure cases 2018-11-21 12:40:23 +08:00
cpu_primary.S hv: fix 'User name starts with underscore' 2018-09-30 14:45:37 +08:00
cpu_save_boot_ctx.S HV: save the cs limit field for SOS 2018-11-01 13:11:40 +08:00
cpu_state_tbl.c HV: add px cx data of bxt n3350 SOC 2018-11-09 13:07:53 +08:00
cpu.c hv: fix '(void) missing for discarded return value' 2018-11-15 10:54:42 +08:00
cpuid.c HV:treewide:rename vm data structure 2018-11-05 15:35:49 +08:00
ept.c hv: ept: set snp control when modify 2018-11-09 13:00:51 +08:00
gdt.c fix "Procedure is not pure assembler" 2018-11-13 16:28:58 +08:00
idt.S hv: Leave interrupts disabled during vmexit - ACRN partition mode 2018-08-31 08:48:47 +08:00
io.c hv: PIO emulation handler is attached to I/O port number only 2018-11-19 09:34:34 +08:00
ioapic.c HV: add size check for shell log buffer usage 2018-11-02 09:13:57 +08:00
irq.c hv: fix integer violations 2018-11-14 12:46:34 +08:00
Kconfig hv: Add IO request completion polling feature 2018-11-21 14:35:12 +08:00
lapic.c HV:fix "Pointer param should be declared pointer to const" 2018-10-25 13:45:14 +08:00
mmu.c hv: fix 'Expression is not Boolean' 2018-11-08 13:04:11 +08:00
mtrr.c hv: fix integer violations 2018-11-14 12:46:34 +08:00
notify.c Fix to kernel hang in smp_call_function 2018-10-26 13:44:18 +08:00
page.c HV:treewide:rename vm data structure 2018-11-05 15:35:49 +08:00
pagetable.c hv: mmu: replace dynamic memory allocation in memory 2018-11-02 13:15:48 +08:00
pm.c hv: fix '(void) missing for discarded return value' 2018-11-15 10:54:42 +08:00
retpoline-thunk.S license: Replace license text with SPDX tag 2018-06-01 10:43:06 +08:00
static_checks.c hv: fix a minor bug of static checks 2018-11-08 09:26:56 +08:00
timer.c fix "Procedure is not pure assembler" 2018-11-13 16:28:58 +08:00
trampoline.S hv: fix branch addressing syntax warning 2018-11-09 13:16:13 +08:00
trusty.c hv: Derive decryption key from Seed for Trusty to decrypt attestation keybox 2018-11-20 09:22:37 +08:00
virq.c HV:treewide:rename vm data structure 2018-11-05 15:35:49 +08:00
vmexit.c hypervisor: use "wbinvd" carefully in RT environment 2018-11-16 10:24:23 +08:00
vmx_asm.S fix spec_ctrl msr save/restore 2018-08-16 16:24:13 +08:00
vmx.c vmx: tiny fix for MACRO name and print format 2018-11-16 15:30:20 +08:00
vtd.c hv: vtd: error handling revisit 2018-11-20 13:30:13 +08:00
wakeup.S hv: fix 'User name starts with underscore' 2018-09-30 14:45:37 +08:00