mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-01-05 23:57:10 +00:00
hv && config-tool: Add compilation option to disable all interrupts in HV
This patch adds an option CONFIG_KEEP_IRQ_DISABLED to hv (default n) and config-tool so that when this option is 'y', all interrupts in hv root mode will be permanently disabled. With this option to be 'y', all interrupts received in root mode will be handled in external interrupt vmexit after next VM entry. The postpone latency is negligible. This new configuration is a requirement from x86 TEE's secure/non-secure interrupt flow support. Many race conditions can be avoided when keeping IRQ off. v5: Rename CONFIG_ACRN_KEEP_IRQ_DISABLED to CONFIG_KEEP_IRQ_DISABLED v4: Change CPU_IRQ_ENABLE/DISABLE to CPU_IRQ_ENABLE_ON_CONFIG/DISABLE_ON_CONFIG and guard them using CONFIG_ACRN_KEEP_IRQ_DISABLED v3: CONFIG_ACRN_DISABLE_INTERRUPT -> CONFIG_ACRN_KEEP_IRQ_DISABLED Add more comment in commit message Tracked-On: #6571 Signed-off-by: Yifan Liu <yifan1.liu@intel.com> Reviewed-by: Wang, Yu1 <yu1.wang@intel.com> Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
@@ -22,7 +22,7 @@ void vcpu_thread(struct thread_object *obj)
|
||||
|
||||
do {
|
||||
if (!is_lapic_pt_enabled(vcpu)) {
|
||||
CPU_IRQ_DISABLE();
|
||||
CPU_IRQ_DISABLE_ON_CONFIG();
|
||||
}
|
||||
|
||||
/* Don't open interrupt window between here and vmentry */
|
||||
@@ -59,7 +59,7 @@ void vcpu_thread(struct thread_object *obj)
|
||||
profiling_pre_vmexit_handler(vcpu);
|
||||
|
||||
if (!is_lapic_pt_enabled(vcpu)) {
|
||||
CPU_IRQ_ENABLE();
|
||||
CPU_IRQ_ENABLE_ON_CONFIG();
|
||||
}
|
||||
/* Dispatch handler */
|
||||
ret = vmexit_handler(vcpu);
|
||||
@@ -86,9 +86,9 @@ void default_idle(__unused struct thread_object *obj)
|
||||
} else if (need_shutdown_vm(pcpu_id)) {
|
||||
shutdown_vm_from_idle(pcpu_id);
|
||||
} else {
|
||||
CPU_IRQ_ENABLE();
|
||||
CPU_IRQ_ENABLE_ON_CONFIG();
|
||||
cpu_do_idle();
|
||||
CPU_IRQ_DISABLE();
|
||||
CPU_IRQ_DISABLE_ON_CONFIG();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -227,5 +227,5 @@ void init_interrupt(uint16_t pcpu_id)
|
||||
init_softirq();
|
||||
}
|
||||
|
||||
CPU_IRQ_ENABLE();
|
||||
CPU_IRQ_ENABLE_ON_CONFIG();
|
||||
}
|
||||
|
||||
@@ -55,9 +55,9 @@ void do_softirq(void)
|
||||
if (per_cpu(softirq_servicing, cpu_id) == 0U) {
|
||||
per_cpu(softirq_servicing, cpu_id) = 1U;
|
||||
|
||||
CPU_IRQ_ENABLE();
|
||||
CPU_IRQ_ENABLE_ON_CONFIG();
|
||||
do_softirq_internal(cpu_id);
|
||||
CPU_IRQ_DISABLE();
|
||||
CPU_IRQ_DISABLE_ON_CONFIG();
|
||||
|
||||
do_softirq_internal(cpu_id);
|
||||
per_cpu(softirq_servicing, cpu_id) = 0U;
|
||||
|
||||
Reference in New Issue
Block a user