Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mshv: adjust interrupt control structure for ARM64

Interrupt control structure (union hv_interupt_control) has different
fields when it comes to x86 vs ARM64. Bring in the correct structure
from HyperV header files and adjust the existing interrupt routing
code accordingly.

Signed-off-by: Jinank Jain <jinankjain@microsoft.com>
Signed-off-by: Anirudh Rayabharam (Microsoft) <anirudh@anirudhrb.com>
Signed-off-by: Wei Liu <wei.liu@kernel.org>

authored by

Jinank Jain and committed by
Wei Liu
9d70ef7a b5110eaf

+22
+6
drivers/hv/mshv_eventfd.c
··· 163 163 if (hv_scheduler_type != HV_SCHEDULER_TYPE_ROOT) 164 164 return -EOPNOTSUPP; 165 165 166 + #if IS_ENABLED(CONFIG_X86) 166 167 if (irq->lapic_control.logical_dest_mode) 167 168 return -EOPNOTSUPP; 169 + #endif 168 170 169 171 vp = partition->pt_vp_array[irq->lapic_apic_id]; 170 172 ··· 198 196 unsigned int seq; 199 197 int idx; 200 198 199 + #if IS_ENABLED(CONFIG_X86) 201 200 WARN_ON(irqfd->irqfd_resampler && 202 201 !irq->lapic_control.level_triggered); 202 + #endif 203 203 204 204 idx = srcu_read_lock(&partition->pt_irq_srcu); 205 205 if (irqfd->irqfd_girq_ent.guest_irq_num) { ··· 473 469 init_poll_funcptr(&irqfd->irqfd_polltbl, mshv_irqfd_queue_proc); 474 470 475 471 spin_lock_irq(&pt->pt_irqfds_lock); 472 + #if IS_ENABLED(CONFIG_X86) 476 473 if (args->flags & BIT(MSHV_IRQFD_BIT_RESAMPLE) && 477 474 !irqfd->irqfd_lapic_irq.lapic_control.level_triggered) { 478 475 /* ··· 484 479 ret = -EINVAL; 485 480 goto fail; 486 481 } 482 + #endif 487 483 ret = 0; 488 484 hlist_for_each_entry(tmp, &pt->pt_irqfds_list, irqfd_hnode) { 489 485 if (irqfd->irqfd_eventfd_ctx != tmp->irqfd_eventfd_ctx)
+4
drivers/hv/mshv_irq.c
··· 119 119 lirq->lapic_vector = ent->girq_irq_data & 0xFF; 120 120 lirq->lapic_apic_id = (ent->girq_addr_lo >> 12) & 0xFF; 121 121 lirq->lapic_control.interrupt_type = (ent->girq_irq_data & 0x700) >> 8; 122 + #if IS_ENABLED(CONFIG_X86) 122 123 lirq->lapic_control.level_triggered = (ent->girq_irq_data >> 15) & 0x1; 123 124 lirq->lapic_control.logical_dest_mode = (ent->girq_addr_lo >> 2) & 0x1; 125 + #elif IS_ENABLED(CONFIG_ARM64) 126 + lirq->lapic_control.asserted = 1; 127 + #endif 124 128 }
+6
drivers/hv/mshv_root_hv_call.c
··· 388 388 memset(input, 0, sizeof(*input)); 389 389 input->partition_id = partition_id; 390 390 input->vector = vector; 391 + /* 392 + * NOTE: dest_addr only needs to be provided while asserting an 393 + * interrupt on x86 platform 394 + */ 395 + #if IS_ENABLED(CONFIG_X86) 391 396 input->dest_addr = dest_addr; 397 + #endif 392 398 input->control = control; 393 399 status = hv_do_hypercall(HVCALL_ASSERT_VIRTUAL_INTERRUPT, input, NULL); 394 400 local_irq_restore(flags);
+6
include/hyperv/hvhdk.h
··· 579 579 u64 as_uint64; 580 580 struct { 581 581 u32 interrupt_type; /* enum hv_interrupt_type */ 582 + #if IS_ENABLED(CONFIG_X86) 582 583 u32 level_triggered : 1; 583 584 u32 logical_dest_mode : 1; 584 585 u32 rsvd : 30; 586 + #elif IS_ENABLED(CONFIG_ARM64) 587 + u32 rsvd1 : 2; 588 + u32 asserted : 1; 589 + u32 rsvd2 : 29; 590 + #endif 585 591 } __packed; 586 592 }; 587 593