Skip to content

Commit d801ff7

Browse files
ozbenhstewartsmith
authored andcommitted
xive: Always reset queue state in opal_xive_set_queue_info()
We used to require an enable/disable transition, however that doesn't work well with how KVM does "upgrade" a queue so instead just always reset the queue state (queue pointer and generation) whenever a queue is reconfigured. Escalations are reset to "masked" when the queue is disabled. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
1 parent 4010f5e commit d801ff7

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

hw/xive.c

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3599,16 +3599,22 @@ static int64_t opal_xive_set_queue_info(uint64_t vp, uint32_t prio,
35993599
if (qflags & OPAL_XIVE_EQ_ESCALATE)
36003600
eq.w0 |= EQ_W0_ESCALATE_CTL;
36013601

3602-
/* Check enable transition. On any transition we clear PQ,
3603-
* set the generation bit, clear the offset and mask the
3604-
* escalation interrupt
3602+
/* Unconditionally clear the current queue pointer, set
3603+
* generation to 1 and disable escalation interrupts.
36053604
*/
3606-
if ((qflags & OPAL_XIVE_EQ_ENABLED) && !(eq.w0 & EQ_W0_VALID)) {
3605+
eq.w1 = EQ_W1_GENERATION |
3606+
(old_eq->w1 & (EQ_W1_ESe_P | EQ_W1_ESe_Q |
3607+
EQ_W1_ESn_P | EQ_W1_ESn_Q));
3608+
3609+
/* Enable or disable. We always enable backlog for an
3610+
* enable queue otherwise escalations won't work.
3611+
*/
3612+
if (qflags & OPAL_XIVE_EQ_ENABLED)
36073613
eq.w0 |= EQ_W0_VALID | EQ_W0_BACKLOG;
3608-
eq.w1 = EQ_W1_GENERATION | EQ_W1_ESe_Q;
3609-
} else if (!(qflags & OPAL_XIVE_EQ_ENABLED)) {
3614+
else {
36103615
eq.w0 &= ~EQ_W0_VALID;
3611-
eq.w1 = EQ_W1_GENERATION | EQ_W1_ESe_Q;
3616+
eq.w1 &= ~(EQ_W1_ESe_P | EQ_W1_ESn_P);
3617+
eq.w1 |= EQ_W1_ESe_Q | EQ_W1_ESn_Q;
36123618
}
36133619

36143620
/* Update EQ, non-synchronous */

0 commit comments

Comments
 (0)