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

powerpc/xive: Remove P9 DD1 flag XIVE_IRQ_FLAG_MASK_FW

This flag was used to support the PHB4 LSIs on P9 DD1 and we have
stopped supporting this CPU when DD2 came out. See skiboot commit:

https://github.com/open-power/skiboot/commit/0b0d15e3c170

Signed-off-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Greg Kurz <groug@kaod.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20201210171450.1933725-10-clg@kaod.org

authored by

Cédric Le Goater and committed by
Michael Ellerman
b5277d18 4cc0e36d

+12 -90
+1 -1
arch/powerpc/include/asm/opal-api.h
··· 1092 1092 OPAL_XIVE_IRQ_STORE_EOI = 0x00000002, 1093 1093 OPAL_XIVE_IRQ_LSI = 0x00000004, 1094 1094 OPAL_XIVE_IRQ_SHIFT_BUG = 0x00000008, /* P9 DD1.0 workaround */ 1095 - OPAL_XIVE_IRQ_MASK_VIA_FW = 0x00000010, 1095 + OPAL_XIVE_IRQ_MASK_VIA_FW = 0x00000010, /* P9 DD1.0 workaround */ 1096 1096 OPAL_XIVE_IRQ_EOI_VIA_FW = 0x00000020, 1097 1097 }; 1098 1098
+1 -1
arch/powerpc/include/asm/xive.h
··· 61 61 #define XIVE_IRQ_FLAG_STORE_EOI 0x01 62 62 #define XIVE_IRQ_FLAG_LSI 0x02 63 63 /* #define XIVE_IRQ_FLAG_SHIFT_BUG 0x04 */ /* P9 DD1.0 workaround */ 64 - #define XIVE_IRQ_FLAG_MASK_FW 0x08 64 + /* #define XIVE_IRQ_FLAG_MASK_FW 0x08 */ /* P9 DD1.0 workaround */ 65 65 #define XIVE_IRQ_FLAG_EOI_FW 0x10 66 66 #define XIVE_IRQ_FLAG_H_INT_ESB 0x20 67 67
+9 -47
arch/powerpc/kvm/book3s_xive.c
··· 419 419 /* Get the right irq */ 420 420 kvmppc_xive_select_irq(state, &hw_num, &xd); 421 421 422 - /* 423 - * If the interrupt is marked as needing masking via 424 - * firmware, we do it here. Firmware masking however 425 - * is "lossy", it won't return the old p and q bits 426 - * and won't set the interrupt to a state where it will 427 - * record queued ones. If this is an issue we should do 428 - * lazy masking instead. 429 - * 430 - * For now, we work around this in unmask by forcing 431 - * an interrupt whenever we unmask a non-LSI via FW 432 - * (if ever). 433 - */ 434 - if (xd->flags & OPAL_XIVE_IRQ_MASK_VIA_FW) { 435 - xive_native_configure_irq(hw_num, 436 - kvmppc_xive_vp(xive, state->act_server), 437 - MASKED, state->number); 438 - /* set old_p so we can track if an H_EOI was done */ 439 - state->old_p = true; 440 - state->old_q = false; 441 - } else { 442 - /* Set PQ to 10, return old P and old Q and remember them */ 443 - val = xive_vm_esb_load(xd, XIVE_ESB_SET_PQ_10); 444 - state->old_p = !!(val & 2); 445 - state->old_q = !!(val & 1); 422 + /* Set PQ to 10, return old P and old Q and remember them */ 423 + val = xive_vm_esb_load(xd, XIVE_ESB_SET_PQ_10); 424 + state->old_p = !!(val & 2); 425 + state->old_q = !!(val & 1); 446 426 447 - /* 448 - * Synchronize hardware to sensure the queues are updated 449 - * when masking 450 - */ 451 - xive_native_sync_source(hw_num); 452 - } 427 + /* 428 + * Synchronize hardware to sensure the queues are updated when 429 + * masking 430 + */ 431 + xive_native_sync_source(hw_num); 453 432 454 433 return old_prio; 455 434 } ··· 461 482 462 483 /* Get the right irq */ 463 484 kvmppc_xive_select_irq(state, &hw_num, &xd); 464 - 465 - /* 466 - * See comment in xive_lock_and_mask() concerning masking 467 - * via firmware. 468 - */ 469 - if (xd->flags & OPAL_XIVE_IRQ_MASK_VIA_FW) { 470 - xive_native_configure_irq(hw_num, 471 - kvmppc_xive_vp(xive, state->act_server), 472 - state->act_priority, state->number); 473 - /* If an EOI is needed, do it here */ 474 - if (!state->old_p) 475 - xive_vm_source_eoi(hw_num, xd); 476 - /* If this is not an LSI, force a trigger */ 477 - if (!(xd->flags & OPAL_XIVE_IRQ_LSI)) 478 - xive_irq_trigger(xd); 479 - goto bail; 480 - } 481 485 482 486 /* Old Q set, set PQ to 11 */ 483 487 if (state->old_q)
+1 -39
arch/powerpc/sysdev/xive/common.c
··· 424 424 } 425 425 426 426 /* 427 - * Helper used to mask and unmask an interrupt source. This 428 - * is only called for normal interrupts that do not require 429 - * masking/unmasking via firmware. 427 + * Helper used to mask and unmask an interrupt source. 430 428 */ 431 429 static void xive_do_source_set_mask(struct xive_irq_data *xd, 432 430 bool mask) ··· 671 673 672 674 pr_devel("xive_irq_unmask: irq %d data @%p\n", d->irq, xd); 673 675 674 - /* 675 - * This is a workaround for PCI LSI problems on P9, for 676 - * these, we call FW to set the mask. The problems might 677 - * be fixed by P9 DD2.0, if that is the case, firmware 678 - * will no longer set that flag. 679 - */ 680 - if (xd->flags & XIVE_IRQ_FLAG_MASK_FW) { 681 - unsigned int hw_irq = (unsigned int)irqd_to_hwirq(d); 682 - xive_ops->configure_irq(hw_irq, 683 - get_hard_smp_processor_id(xd->target), 684 - xive_irq_priority, d->irq); 685 - return; 686 - } 687 - 688 676 xive_do_source_set_mask(xd, false); 689 677 } 690 678 ··· 679 695 struct xive_irq_data *xd = irq_data_get_irq_handler_data(d); 680 696 681 697 pr_devel("xive_irq_mask: irq %d data @%p\n", d->irq, xd); 682 - 683 - /* 684 - * This is a workaround for PCI LSI problems on P9, for 685 - * these, we call OPAL to set the mask. The problems might 686 - * be fixed by P9 DD2.0, if that is the case, firmware 687 - * will no longer set that flag. 688 - */ 689 - if (xd->flags & XIVE_IRQ_FLAG_MASK_FW) { 690 - unsigned int hw_irq = (unsigned int)irqd_to_hwirq(d); 691 - xive_ops->configure_irq(hw_irq, 692 - get_hard_smp_processor_id(xd->target), 693 - 0xff, d->irq); 694 - return; 695 - } 696 698 697 699 xive_do_source_set_mask(xd, true); 698 700 } ··· 821 851 unsigned int hw_irq = (unsigned int)irqd_to_hwirq(d); 822 852 int rc; 823 853 u8 pq; 824 - 825 - /* 826 - * We only support this on interrupts that do not require 827 - * firmware calls for masking and unmasking 828 - */ 829 - if (xd->flags & XIVE_IRQ_FLAG_MASK_FW) 830 - return -EIO; 831 854 832 855 /* 833 856 * This is called by KVM with state non-NULL for enabling ··· 1267 1304 } xive_irq_flags[] = { 1268 1305 { XIVE_IRQ_FLAG_STORE_EOI, "STORE_EOI" }, 1269 1306 { XIVE_IRQ_FLAG_LSI, "LSI" }, 1270 - { XIVE_IRQ_FLAG_MASK_FW, "MASK_FW" }, 1271 1307 { XIVE_IRQ_FLAG_EOI_FW, "EOI_FW" }, 1272 1308 { XIVE_IRQ_FLAG_H_INT_ESB, "H_INT_ESB" }, 1273 1309 { XIVE_IRQ_FLAG_NO_EOI, "NO_EOI" },
-2
arch/powerpc/sysdev/xive/native.c
··· 64 64 data->flags |= XIVE_IRQ_FLAG_STORE_EOI; 65 65 if (opal_flags & OPAL_XIVE_IRQ_LSI) 66 66 data->flags |= XIVE_IRQ_FLAG_LSI; 67 - if (opal_flags & OPAL_XIVE_IRQ_MASK_VIA_FW) 68 - data->flags |= XIVE_IRQ_FLAG_MASK_FW; 69 67 if (opal_flags & OPAL_XIVE_IRQ_EOI_VIA_FW) 70 68 data->flags |= XIVE_IRQ_FLAG_EOI_FW; 71 69 data->eoi_page = be64_to_cpu(eoi_page);