Lines Matching refs:state
43 * (most ICP state fits in the union kvmppc_icp_state)
71 struct ics_irq_state *state;
83 state = &ics->irq_state[src];
84 if (!state->exists)
96 if (!state->lsi && level == 0) /* noop for MSI */
100 pq_old = state->pq_state;
101 if (state->lsi) {
112 } while (cmpxchg(&state->pq_state, pq_old, pq_new) != pq_old);
119 if (state->host_irq)
120 state->intr_cpu = raw_smp_processor_id();
131 struct ics_irq_state *state = &ics->irq_state[i];
132 if (state->resend) {
133 XICS_DBG("resend %#x prio %#x\n", state->number,
134 state->priority);
135 icp_deliver_irq(xics, icp, state->number, true);
141 struct ics_irq_state *state,
150 state->server = server;
151 state->priority = priority;
152 state->saved_priority = saved_priority;
154 if ((state->masked_pending || state->resend) && priority != MASKED) {
155 state->masked_pending = 0;
156 state->resend = 0;
171 struct ics_irq_state *state;
180 state = &ics->irq_state[src];
188 state->masked_pending, state->resend);
190 if (write_xive(xics, ics, state, server, priority, priority))
200 struct ics_irq_state *state;
210 state = &ics->irq_state[src];
214 *server = state->server;
215 *priority = state->priority;
227 struct ics_irq_state *state;
236 state = &ics->irq_state[src];
238 icp = kvmppc_xics_find_server(kvm, state->server);
242 if (write_xive(xics, ics, state, state->server, state->saved_priority,
243 state->saved_priority))
253 struct ics_irq_state *state;
262 state = &ics->irq_state[src];
264 write_xive(xics, ics, state, state->server, MASKED, state->priority);
282 success = cmpxchg64(&icp->state.raw, old.raw, new.raw) == old.raw;
294 * Check for output state update
297 * the state already. This is why we never clear the interrupt output
302 * We also do not try to figure out whether the EE state has changed,
303 * we unconditionally set it if the new state calls for it. The reason
346 old_state = new_state = READ_ONCE(icp->state);
366 * so a subsequent CPPR state change causes us
380 struct ics_irq_state *state;
402 /* Get the ICS state and lock it */
408 state = &ics->irq_state[src];
415 if (!icp || state->server != icp->server_num) {
416 icp = kvmppc_xics_find_server(xics->kvm, state->server);
419 new_irq, state->server);
425 if (!state->resend)
429 state->resend = 0;
446 if (state->priority == MASKED) {
448 state->masked_pending = 1;
468 if (icp_try_to_deliver(icp, new_irq, state->priority, &reject)) {
482 * resend map bit and mark the ICS state as needing a resend
484 state->resend = 1;
500 if (!icp->state.need_resend) {
501 state->resend = 0;
535 * here. In the PAPR, this state will be used for both
537 * changing the MFRR state here so we don't need to handle
549 old_state = new_state = READ_ONCE(icp->state);
579 * state update in HW (ie bus transactions) so we can handle them
603 old_state = new_state = READ_ONCE(icp->state);
641 * ICP state: Set_MFRR
649 * ICP state: Check_IPI
659 * PAPR does not describe this state, but if the MFRR is being
666 * we don't have that state, so we simply trigger a resend
670 old_state = new_state = READ_ONCE(icp->state);
706 union kvmppc_icp_state state;
715 state = READ_ONCE(icp->state);
716 kvmppc_set_gpr(vcpu, 4, ((u32)state.cppr << 24) | state.xisr);
717 kvmppc_set_gpr(vcpu, 5, state.mfrr);
737 if (cppr > icp->state.cppr)
739 else if (cppr == icp->state.cppr)
756 old_state = new_state = READ_ONCE(icp->state);
782 struct ics_irq_state *state;
799 state = &ics->irq_state[src];
801 if (state->lsi)
802 pq_new = state->pq_state;
805 pq_old = state->pq_state;
807 } while (cmpxchg(&state->pq_state, pq_old, pq_new) != pq_old);
853 XICS_DBG("XICS_RM: H_%x completing, act: %x state: %lx tgt: %p\n",
962 seq_printf(m, "=========\nICP state\n=========\n");
966 union kvmppc_icp_state state;
971 state.raw = READ_ONCE(icp->state.raw);
973 icp->server_num, state.xisr,
974 state.pending_pri, state.cppr, state.mfrr,
975 state.out_ee, state.need_resend);
994 seq_printf(m, "=========\nICS state for ICS 0x%x\n=========\n",
1087 icp->state.mfrr = MASKED;
1088 icp->state.pending_pri = MASKED;
1099 union kvmppc_icp_state state;
1103 state = icp->state;
1104 return ((u64)state.cppr << KVM_REG_PPC_ICP_CPPR_SHIFT) |
1105 ((u64)state.xisr << KVM_REG_PPC_ICP_XISR_SHIFT) |
1106 ((u64)state.mfrr << KVM_REG_PPC_ICP_MFRR_SHIFT) |
1107 ((u64)state.pending_pri << KVM_REG_PPC_ICP_PPRI_SHIFT);
1130 /* Require the new state to be internally consistent */
1160 * the state of the interrupt sources to be consistent with
1164 * consistent state in the situation where userspace restores
1168 old_state = READ_ONCE(icp->state);