acrn-hypervisor/hypervisor/arch/x86
dongshen a07c3da3da hv: define posted interrupt IRQs/vectors
This is a preparation patch for adding support for VT-d PI
related vCPU scheduling.

ACRN does not support vCPU migration, one vCPU always runs on
the same pCPU, so PI's ndst is never changed after startup.

VCPUs of a VM won’t share same pCPU. So the maximum possible number
of VCPUs that can run on a pCPU is CONFIG_MAX_VM_NUM.

Allocate unique Activation Notification Vectors (ANV) for each vCPU
that belongs to the same pCPU, the ANVs need only be unique within each
pCPU, not across all vCPUs. This reduces # of pre-allocated ANVs for
posted interrupts to CONFIG_MAX_VM_NUM, and enables ACRN to avoid
switching between active and wake-up vector values in the posted
interrupt descriptor on vCPU scheduling state changes.

A total of CONFIG_MAX_VM_NUM consecutive IRQs/vectors are reserved
for posted interrupts use.

The code first initializes vcpu->arch.pid.control.bits.nv dynamically
(will be added in subsequent patch), the other code shall use
vcpu->arch.pid.control.bits.nv instead of the hard-coded notification vectors.

Rename some functions:
  apicv_post_intr --> apicv_trigger_pi_anv
  posted_intr_notification --> handle_pi_notification
  setup_posted_intr_notification --> setup_pi_notification

Tracked-On: #4506
Signed-off-by: dongshen <dongsheng.x.zhang@intel.com>
Reviewed-by: Eddie Dong <eddie.dong@Intel.com>
2020-04-16 13:47:23 +08:00
..
boot hv: update the hypervisor 64-bit entry address for efi-stub 2020-03-06 08:27:46 +08:00
configs hv: Add HI_MMIO_START and HI_MMIO_END macros to board files 2020-04-15 10:54:39 +08:00
guest hv: define posted interrupt IRQs/vectors 2020-04-16 13:47:23 +08:00
lib hv: refine retpoline speculation barriers 2020-02-26 09:24:54 +08:00
seed HV: init and sanitize acrn multiboot info 2020-02-26 09:24:16 +08:00
cpu_caps.c hv:enable gpu iommu except APL platforms 2020-02-24 11:47:10 +08:00
cpu_state_tbl.c HV: add board specific cpu state table to support Px Cx 2019-07-29 20:25:16 +08:00
cpu.c hv: define posted interrupt IRQs/vectors 2020-04-16 13:47:23 +08:00
e820.c hv: Reserve space for VMs' EPT 4k pages after boot 2020-04-13 11:39:58 +08:00
gdt.c hv:cleanup header files for arch folder 2019-02-22 13:14:36 +08:00
idt.S HV: Install a NMI handler in acrn IDT 2019-12-13 10:13:09 +08:00
init.c HV: init and sanitize acrn multiboot info 2020-02-26 09:24:16 +08:00
ioapic.c hv: vioapic init for SOS VM on platforms with multiple IO-APICs 2020-04-13 11:39:58 +08:00
irq.c hv: define posted interrupt IRQs/vectors 2020-04-16 13:47:23 +08:00
Kconfig hv: Server platforms can have more than 8 IO-APICs 2020-04-13 11:39:58 +08:00
lapic.c HV: clean up redundant macro in lapic.h 2019-12-27 12:27:08 +08:00
mmu.c hv: Hypervisor access to PCI devices with 64-bit MMIO BARs 2020-04-15 10:54:39 +08:00
notify.c hv: define posted interrupt IRQs/vectors 2020-04-16 13:47:23 +08:00
page.c hv: Hypervisor access to PCI devices with 64-bit MMIO BARs 2020-04-15 10:54:39 +08:00
pagetable.c hv: mmu: minor fix about add_pte 2020-03-09 10:03:01 +08:00
platform_caps.c hv: add function to check if using posted interrupt is possible for vm 2020-04-16 13:47:23 +08:00
pm.c pm: S5: update the system shutdown logical in ACRN 2019-12-23 15:15:09 +08:00
rdt.c HV: Add MBA support in ACRN 2020-03-04 17:33:50 +08:00
sched.S hv: sched: rename schedule related structs and vars 2019-10-16 10:25:53 +08:00
security.c hv: config: add an option to disable mce on psc workaround 2019-12-03 09:17:04 +08:00
sgx.c hv: sgx: add basic support to init sgx resource for vm 2019-05-29 11:24:13 +08:00
timer.c hv: rename BOOT_CPU_ID to BSP_CPU_ID 2020-02-25 09:08:14 +08:00
trampoline.c hv: refine 'uint64_t' string print format in x86 moudle 2019-11-09 11:42:38 +08:00
vmx.c hv:fix "no prototype for non-static function" 2019-07-09 10:36:03 +08:00
vtd.c hv: enable VT-d PI for ptdev if intr_src->pid_addr is non-zero 2020-04-16 13:47:23 +08:00
wakeup.S hv: pm: correct the function name 2019-09-11 17:30:24 +08:00