hv: Remove separate interrupt routine for pre-launched VMs

As vector re-mapping is enabled for pre-launched/partition mode VMs,
there is no more need for separate interrupt routine i.e.
partition_mode_dispatch_interrupt.

Tracked-On: #2879
Signed-off-by: Sainath Grandhi <sainath.grandhi@intel.com>
Reviewed-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Sainath Grandhi
2019-04-02 22:53:58 -07:00
committed by Eddie Dong
parent 5b795a3312
commit f22347346e
7 changed files with 9 additions and 36 deletions

View File

@@ -579,8 +579,8 @@ void ptirq_intx_ack(struct acrn_vm *vm, uint32_t virt_pin, uint32_t vpin_src)
* entry_nr = 0 means first vector
* user must provide bdf and entry_nr
*/
int32_t ptirq_msix_remap(struct acrn_vm *vm, uint16_t virt_bdf,
uint16_t entry_nr, struct ptirq_msi_info *info)
int32_t ptirq_msix_remap(struct acrn_vm *vm, uint16_t virt_bdf, uint16_t phys_bdf,
uint16_t entry_nr, struct ptirq_msi_info *info)
{
struct ptirq_remapping_info *entry;
DEFINE_MSI_SID(virt_sid, virt_bdf, entry_nr);
@@ -597,8 +597,8 @@ int32_t ptirq_msix_remap(struct acrn_vm *vm, uint16_t virt_bdf,
entry = ptirq_lookup_entry_by_sid(PTDEV_INTR_MSI, &virt_sid, vm);
if (entry == NULL) {
/* SOS_VM we add mapping dynamically */
if (is_sos_vm(vm)) {
entry = add_msix_remapping(vm, virt_bdf, virt_bdf, entry_nr);
if (is_sos_vm(vm) || is_prelaunched_vm(vm)) {
entry = add_msix_remapping(vm, virt_bdf, phys_bdf, entry_nr);
if (entry == NULL) {
pr_err("dev-assign: msi entry exist in others");
}

View File

@@ -414,11 +414,7 @@ int32_t external_interrupt_vmexit_handler(struct acrn_vcpu *vcpu)
ctx.rflags = vcpu_get_rflags(vcpu);
ctx.cs = exec_vmread32(VMX_GUEST_CS_SEL);
#ifdef CONFIG_PARTITION_MODE
partition_mode_dispatch_interrupt(&ctx);
#else
dispatch_interrupt(&ctx);
#endif
vcpu_retain_rip(vcpu);
TRACE_2L(TRACE_VMEXIT_EXTERNAL_INTERRUPT, ctx.vector, 0UL);

View File

@@ -380,28 +380,6 @@ void dispatch_exception(struct intr_excp_ctx *ctx)
cpu_dead();
}
#ifdef CONFIG_PARTITION_MODE
void partition_mode_dispatch_interrupt(struct intr_excp_ctx *ctx)
{
uint8_t vr = ctx->vector;
struct acrn_vcpu *vcpu;
/*
* There is no vector and APIC ID remapping for VMs in
* ACRN partition mode. Device interrupts are injected with the same
* vector into vLAPIC of vCPU running on the pCPU. Vectors used for
* HV services are handled by HV using dispatch_interrupt.
*/
vcpu = per_cpu(vcpu, get_cpu_id());
if (vr < VECTOR_FIXED_START) {
send_lapic_eoi();
vlapic_set_intr(vcpu, vr, LAPIC_TRIG_EDGE);
} else {
dispatch_interrupt(ctx);
}
}
#endif
static void init_irq_descs(void)
{
uint32_t i;