• Home
  • Raw
  • Download

Lines Matching refs:state

479 			     struct kvmppc_xive_irq_state *state)  in xive_lock_and_mask()  argument
492 old_prio = state->guest_priority; in xive_lock_and_mask()
493 state->guest_priority = MASKED; in xive_lock_and_mask()
495 if (!state->in_eoi) in xive_lock_and_mask()
497 state->guest_priority = old_prio; in xive_lock_and_mask()
506 kvmppc_xive_select_irq(state, &hw_num, &xd); in xive_lock_and_mask()
510 state->old_p = !!(val & 2); in xive_lock_and_mask()
511 state->old_q = !!(val & 1); in xive_lock_and_mask()
523 struct kvmppc_xive_irq_state *state) in xive_lock_for_unmask() argument
530 if (!state->in_eoi) in xive_lock_for_unmask()
538 struct kvmppc_xive_irq_state *state, in xive_finish_unmask() argument
545 if (state->guest_priority != MASKED) in xive_finish_unmask()
549 kvmppc_xive_select_irq(state, &hw_num, &xd); in xive_finish_unmask()
552 if (state->old_q) in xive_finish_unmask()
560 if (!state->old_p) in xive_finish_unmask()
566 state->guest_priority = prio; in xive_finish_unmask()
577 struct kvmppc_xive_irq_state *state, in xive_target_interrupt() argument
603 if (state->act_priority != MASKED) in xive_target_interrupt()
605 state->act_server, in xive_target_interrupt()
606 state->act_priority); in xive_target_interrupt()
610 state->act_priority = prio; in xive_target_interrupt()
611 state->act_server = server; in xive_target_interrupt()
614 kvmppc_xive_select_irq(state, &hw_num, NULL); in xive_target_interrupt()
618 prio, state->number); in xive_target_interrupt()
666 struct kvmppc_xive_irq_state *state; in kvmppc_xive_set_xive() local
692 state = &sb->irq_state[idx]; in kvmppc_xive_set_xive()
709 xive_lock_and_mask(xive, sb, state); in kvmppc_xive_set_xive()
711 xive_lock_for_unmask(sb, state); in kvmppc_xive_set_xive()
719 new_act_prio = state->act_priority; in kvmppc_xive_set_xive()
724 new_act_prio, state->act_server, state->act_priority); in kvmppc_xive_set_xive()
741 (state->act_server != server || in kvmppc_xive_set_xive()
742 state->act_priority != new_act_prio)) in kvmppc_xive_set_xive()
743 rc = xive_target_interrupt(kvm, state, server, new_act_prio); in kvmppc_xive_set_xive()
750 xive_finish_unmask(xive, sb, state, priority); in kvmppc_xive_set_xive()
756 state->saved_priority = priority; in kvmppc_xive_set_xive()
767 struct kvmppc_xive_irq_state *state; in kvmppc_xive_get_xive() local
776 state = &sb->irq_state[idx]; in kvmppc_xive_get_xive()
778 *server = state->act_server; in kvmppc_xive_get_xive()
779 *priority = state->guest_priority; in kvmppc_xive_get_xive()
789 struct kvmppc_xive_irq_state *state; in kvmppc_xive_int_on() local
798 state = &sb->irq_state[idx]; in kvmppc_xive_int_on()
805 if (state->act_priority == MASKED) { in kvmppc_xive_int_on()
811 if (state->saved_priority == MASKED) in kvmppc_xive_int_on()
817 xive_lock_for_unmask(sb, state); in kvmppc_xive_int_on()
818 xive_finish_unmask(xive, sb, state, state->saved_priority); in kvmppc_xive_int_on()
828 struct kvmppc_xive_irq_state *state; in kvmppc_xive_int_off() local
837 state = &sb->irq_state[idx]; in kvmppc_xive_int_off()
844 state->saved_priority = xive_lock_and_mask(xive, sb, state); in kvmppc_xive_int_off()
853 struct kvmppc_xive_irq_state *state; in xive_restore_pending_irq() local
859 state = &sb->irq_state[idx]; in xive_restore_pending_irq()
860 if (!state->valid) in xive_restore_pending_irq()
867 xive_irq_trigger(&state->ipi_data); in xive_restore_pending_irq()
949 struct kvmppc_xive_irq_state *state; in kvmppc_xive_set_mapped() local
966 state = &sb->irq_state[idx]; in kvmppc_xive_set_mapped()
981 rc = irq_set_vcpu_affinity(host_irq, state); in kvmppc_xive_set_mapped()
992 prio = xive_lock_and_mask(xive, sb, state); in kvmppc_xive_set_mapped()
994 state->old_p, state->old_q); in kvmppc_xive_set_mapped()
997 xive_vm_esb_load(&state->ipi_data, XIVE_ESB_SET_PQ_01); in kvmppc_xive_set_mapped()
1007 state->pt_number = hw_irq; in kvmppc_xive_set_mapped()
1008 state->pt_data = irq_data_get_irq_handler_data(host_data); in kvmppc_xive_set_mapped()
1017 kvmppc_xive_vp(xive, state->act_server), in kvmppc_xive_set_mapped()
1018 state->act_priority, state->number); in kvmppc_xive_set_mapped()
1027 if (prio != MASKED && !state->old_p) in kvmppc_xive_set_mapped()
1028 xive_vm_source_eoi(hw_irq, state->pt_data); in kvmppc_xive_set_mapped()
1031 state->old_p = state->old_q = false; in kvmppc_xive_set_mapped()
1035 state->guest_priority = prio; in kvmppc_xive_set_mapped()
1047 struct kvmppc_xive_irq_state *state; in kvmppc_xive_clr_mapped() local
1060 state = &sb->irq_state[idx]; in kvmppc_xive_clr_mapped()
1067 prio = xive_lock_and_mask(xive, sb, state); in kvmppc_xive_clr_mapped()
1069 state->old_p, state->old_q); in kvmppc_xive_clr_mapped()
1076 if (state->old_p) in kvmppc_xive_clr_mapped()
1077 xive_vm_esb_load(state->pt_data, XIVE_ESB_SET_PQ_11); in kvmppc_xive_clr_mapped()
1087 state->pt_number = 0; in kvmppc_xive_clr_mapped()
1088 state->pt_data = NULL; in kvmppc_xive_clr_mapped()
1099 xive_native_configure_irq(state->ipi_number, in kvmppc_xive_clr_mapped()
1100 kvmppc_xive_vp(xive, state->act_server), in kvmppc_xive_clr_mapped()
1101 state->act_priority, state->number); in kvmppc_xive_clr_mapped()
1108 if (prio == MASKED || state->old_p) in kvmppc_xive_clr_mapped()
1109 xive_vm_esb_load(&state->ipi_data, XIVE_ESB_SET_PQ_10); in kvmppc_xive_clr_mapped()
1111 xive_vm_esb_load(&state->ipi_data, XIVE_ESB_SET_PQ_00); in kvmppc_xive_clr_mapped()
1115 state->guest_priority = prio; in kvmppc_xive_clr_mapped()
1135 struct kvmppc_xive_irq_state *state = &sb->irq_state[j]; in kvmppc_xive_disable_vcpu_interrupts() local
1137 if (!state->valid) in kvmppc_xive_disable_vcpu_interrupts()
1139 if (state->act_priority == MASKED) in kvmppc_xive_disable_vcpu_interrupts()
1141 if (state->act_server != xc->server_num) in kvmppc_xive_disable_vcpu_interrupts()
1146 state->act_priority = MASKED; in kvmppc_xive_disable_vcpu_interrupts()
1147 xive_vm_esb_load(&state->ipi_data, XIVE_ESB_SET_PQ_01); in kvmppc_xive_disable_vcpu_interrupts()
1148 xive_native_configure_irq(state->ipi_number, 0, MASKED, 0); in kvmppc_xive_disable_vcpu_interrupts()
1149 if (state->pt_number) { in kvmppc_xive_disable_vcpu_interrupts()
1150 xive_vm_esb_load(state->pt_data, XIVE_ESB_SET_PQ_01); in kvmppc_xive_disable_vcpu_interrupts()
1151 xive_native_configure_irq(state->pt_number, 0, MASKED, 0); in kvmppc_xive_disable_vcpu_interrupts()
1435 struct kvmppc_xive_irq_state *state; in xive_pre_save_set_queued() local
1442 state = &sb->irq_state[idx]; in xive_pre_save_set_queued()
1445 if (!state->valid) { in xive_pre_save_set_queued()
1455 if (!state->saved_p) in xive_pre_save_set_queued()
1459 state->in_queue = true; in xive_pre_save_set_queued()
1466 struct kvmppc_xive_irq_state *state = &sb->irq_state[irq]; in xive_pre_save_mask_irq() local
1468 if (!state->valid) in xive_pre_save_mask_irq()
1472 state->saved_scan_prio = xive_lock_and_mask(xive, sb, state); in xive_pre_save_mask_irq()
1475 state->saved_p = state->old_p; in xive_pre_save_mask_irq()
1476 state->saved_q = state->old_q; in xive_pre_save_mask_irq()
1486 struct kvmppc_xive_irq_state *state = &sb->irq_state[irq]; in xive_pre_save_unmask_irq() local
1488 if (!state->valid) in xive_pre_save_unmask_irq()
1496 xive_lock_for_unmask(sb, state); in xive_pre_save_unmask_irq()
1499 if (state->saved_scan_prio != MASKED) in xive_pre_save_unmask_irq()
1500 xive_finish_unmask(xive, sb, state, state->saved_scan_prio); in xive_pre_save_unmask_irq()
1580 struct kvmppc_xive_irq_state *state; in xive_get_source() local
1589 state = &sb->irq_state[idx]; in xive_get_source()
1591 if (!state->valid) in xive_get_source()
1617 val = state->act_server; in xive_get_source()
1618 prio = state->saved_scan_prio; in xive_get_source()
1622 prio = state->saved_priority; in xive_get_source()
1625 if (state->lsi) { in xive_get_source()
1627 if (state->saved_p) in xive_get_source()
1630 if (state->saved_p) in xive_get_source()
1633 if (state->saved_q) in xive_get_source()
1642 if (state->in_queue || (prio == MASKED && state->saved_q)) in xive_get_source()
1723 struct kvmppc_xive_irq_state *state; in xive_set_source() local
1746 state = &sb->irq_state[idx]; in xive_set_source()
1764 if (!state->ipi_number) { in xive_set_source()
1765 state->ipi_number = xive_native_alloc_irq(); in xive_set_source()
1766 if (state->ipi_number == 0) { in xive_set_source()
1770 xive_native_populate_irq_data(state->ipi_number, &state->ipi_data); in xive_set_source()
1771 pr_devel(" src_ipi=0x%x\n", state->ipi_number); in xive_set_source()
1781 state->guest_priority = 0; in xive_set_source()
1782 xive_lock_and_mask(xive, sb, state); in xive_set_source()
1793 state->act_priority = MASKED; in xive_set_source()
1811 rc = xive_target_interrupt(xive->kvm, state, in xive_set_source()
1830 state->old_p = false; in xive_set_source()
1831 state->old_q = false; in xive_set_source()
1832 state->lsi = false; in xive_set_source()
1833 state->asserted = false; in xive_set_source()
1837 state->lsi = true; in xive_set_source()
1839 state->asserted = true; in xive_set_source()
1840 pr_devel(" LSI ! Asserted=%d\n", state->asserted); in xive_set_source()
1854 state->old_p = true; in xive_set_source()
1856 state->old_q = true; in xive_set_source()
1858 pr_devel(" P=%d, Q=%d\n", state->old_p, state->old_q); in xive_set_source()
1867 state->guest_priority = MASKED; in xive_set_source()
1868 state->saved_priority = guest_prio; in xive_set_source()
1871 xive_finish_unmask(xive, sb, state, guest_prio); in xive_set_source()
1872 state->saved_priority = guest_prio; in xive_set_source()
1876 if (!state->valid) in xive_set_source()
1878 state->valid = true; in xive_set_source()
1888 struct kvmppc_xive_irq_state *state; in kvmppc_xive_set_irq() local
1899 state = &sb->irq_state[idx]; in kvmppc_xive_set_irq()
1900 if (!state->valid) in kvmppc_xive_set_irq()
1904 if (state->pt_number) in kvmppc_xive_set_irq()
1907 if ((level == 1 && state->lsi) || level == KVM_INTERRUPT_SET_LEVEL) in kvmppc_xive_set_irq()
1908 state->asserted = true; in kvmppc_xive_set_irq()
1910 state->asserted = false; in kvmppc_xive_set_irq()
1915 xive_irq_trigger(&state->ipi_data); in kvmppc_xive_set_irq()
2015 struct kvmppc_xive_irq_state *state = &sb->irq_state[i]; in kvmppc_xive_free_sources() local
2017 if (!state->valid) in kvmppc_xive_free_sources()
2020 kvmppc_xive_cleanup_irq(state->ipi_number, &state->ipi_data); in kvmppc_xive_free_sources()
2021 xive_cleanup_irq_data(&state->ipi_data); in kvmppc_xive_free_sources()
2022 xive_native_free_irq(state->ipi_number); in kvmppc_xive_free_sources()
2025 if (state->pt_number) in kvmppc_xive_free_sources()
2026 kvmppc_xive_cleanup_irq(state->pt_number, state->pt_data); in kvmppc_xive_free_sources()
2028 state->valid = false; in kvmppc_xive_free_sources()
2249 struct kvmppc_xive_irq_state *state = &sb->irq_state[i]; in kvmppc_xive_debug_show_sources() local
2254 if (!state->valid) in kvmppc_xive_debug_show_sources()
2257 kvmppc_xive_select_irq(state, &hw_num, &xd); in kvmppc_xive_debug_show_sources()
2261 seq_printf(m, "%08x %08x/%02x", state->number, hw_num, in kvmppc_xive_debug_show_sources()
2263 if (state->lsi) in kvmppc_xive_debug_show_sources()
2264 seq_printf(m, " %cLSI", state->asserted ? '^' : ' '); in kvmppc_xive_debug_show_sources()
2269 state->ipi_number == hw_num ? "IPI" : " PT", in kvmppc_xive_debug_show_sources()
2272 state->eisn, state->act_server, in kvmppc_xive_debug_show_sources()
2273 state->act_priority); in kvmppc_xive_debug_show_sources()