uefi: remove old interrupt injection method

we added uefi stub for hv, and want vm0 continue running under uefi env to
boot other uefi payload (osloader or bzImage).

during this, the uefi timer irq need be handled elegantly.

there are 3 types for uefi timer:
1. 8254 based on IRQ0 of PIC
2. HPET based on IOAPIC
3. HPET based on MSI

currently, we only support type 3 (HPET+MSI). But we are following a
in-correct flow to handle this timer interrupt:
- we set VMX_ENTRY_INT_INFO_FIELD directly if a timer interrupt happened
  before vcpu launching, this will make its vlapic mess up, which finally
  cause hpet timer stop.

this patch remove this in-correct approach, the new approach patch will
be followed by next patch.

Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
This commit is contained in:
Jason Chen CJ
2018-03-20 00:27:50 +08:00
committed by Jack Ren
parent 23efb5a0e9
commit a87757d602
5 changed files with 18 additions and 46 deletions

View File

@@ -270,9 +270,10 @@ int external_interrupt_handler(struct vcpu *vcpu)
struct intr_ctx ctx;
ctx.vector = vector;
/* do not RETAIN RIP for spurious interrupt */
if (dispatch_interrupt(&ctx) == 0)
VCPU_RETAIN_RIP(vcpu);
dispatch_interrupt(&ctx);
VCPU_RETAIN_RIP(vcpu);
TRACE_2L(TRC_VMEXIT_EXTERNAL_INTERRUPT, vector, 0);

View File

@@ -443,7 +443,7 @@ void dispatch_exception(struct intr_ctx *ctx)
cpu_halt(cpu_id);
}
int handle_spurious_interrupt(int vector)
void handle_spurious_interrupt(int vector)
{
send_lapic_eoi();
@@ -452,13 +452,11 @@ int handle_spurious_interrupt(int vector)
pr_warn("Spurious vector: 0x%x.", vector);
if (spurious_handler)
return spurious_handler(vector);
else
return 0;
spurious_handler(vector);
}
/* do_IRQ() */
int dispatch_interrupt(struct intr_ctx *ctx)
void dispatch_interrupt(struct intr_ctx *ctx)
{
int vr = ctx->vector;
int irq = vector_to_irq[vr];
@@ -479,9 +477,10 @@ int dispatch_interrupt(struct intr_ctx *ctx)
}
desc->irq_handler(desc, desc->handler_data);
return 0;
return;
ERR:
return handle_spurious_interrupt(vr);
handle_spurious_interrupt(vr);
return;
}
int handle_level_interrupt_common(struct irq_desc *desc,

View File

@@ -36,7 +36,6 @@
#ifdef CONFIG_EFI_STUB
#include <acrn_efi.h>
extern struct efi_ctx* efi_ctx;
extern int efi_launch_vector;
#endif
#define PAT_POWER_ON_VALUE (PAT_MEM_TYPE_WB + \
@@ -1282,16 +1281,10 @@ static void override_uefi_vmcs(struct vcpu *vcpu)
}
/* Interrupt */
if (efi_launch_vector > 0) {
field = VMX_GUEST_RFLAGS;
cur_context->rflags = 0x2;
cur_context->rflags |= 1 << 9; /* enable intr for efi stub */
exec_vmwrite(field, cur_context->rflags);
exec_vmwrite(VMX_ENTRY_INT_INFO_FIELD,
VMX_INT_INFO_VALID |
(efi_launch_vector & 0xFF));
efi_launch_vector = -1;
}
field = VMX_GUEST_RFLAGS;
cur_context->rflags = 0x2;
cur_context->rflags |= 1 << 9; /* enable intr for efi stub */
exec_vmwrite(field, cur_context->rflags);
}
#endif