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.

s390/pci: externalize the SIC operation controls and routine

A subsequent patch will be issuing SIC from KVM -- export the necessary
routine and make the operation control definitions available from a header.
Because the routine will now be exported, let's rename __zpci_set_irq_ctrl
to zpci_set_irq_ctrl and get rid of the zero'd iib wrapper function of
the same name.

Reviewed-by: Niklas Schnelle <schnelle@linux.ibm.com>
Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Reviewed-by: Pierre Morel <pmorel@linux.ibm.com>
Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com>
Link: https://lore.kernel.org/r/20220606203325.110625-8-mjrosato@linux.ibm.com
Signed-off-by: Christian Borntraeger <borntraeger@linux.ibm.com>

authored by

Matthew Rosato and committed by
Christian Borntraeger
062f0024 932b6467

+23 -23
+9 -8
arch/s390/include/asm/pci_insn.h
··· 98 98 u32 gd; 99 99 } __packed __aligned(8); 100 100 101 + /* Set Interruption Controls Operation Controls */ 102 + #define SIC_IRQ_MODE_ALL 0 103 + #define SIC_IRQ_MODE_SINGLE 1 104 + #define SIC_IRQ_MODE_DIRECT 4 105 + #define SIC_IRQ_MODE_D_ALL 16 106 + #define SIC_IRQ_MODE_D_SINGLE 17 107 + #define SIC_IRQ_MODE_SET_CPU 18 108 + 101 109 /* directed interruption information block */ 102 110 struct zpci_diib { 103 111 u32 : 1; ··· 142 134 int zpci_store(const volatile void __iomem *addr, u64 data, unsigned long len); 143 135 int __zpci_store_block(const u64 *data, u64 req, u64 offset); 144 136 void zpci_barrier(void); 145 - int __zpci_set_irq_ctrl(u16 ctl, u8 isc, union zpci_sic_iib *iib); 146 - 147 - static inline int zpci_set_irq_ctrl(u16 ctl, u8 isc) 148 - { 149 - union zpci_sic_iib iib = {{0}}; 150 - 151 - return __zpci_set_irq_ctrl(ctl, isc, &iib); 152 - } 137 + int zpci_set_irq_ctrl(u16 ctl, u8 isc, union zpci_sic_iib *iib); 153 138 154 139 #endif
+2 -1
arch/s390/pci/pci_insn.c
··· 138 138 } 139 139 140 140 /* Set Interruption Controls */ 141 - int __zpci_set_irq_ctrl(u16 ctl, u8 isc, union zpci_sic_iib *iib) 141 + int zpci_set_irq_ctrl(u16 ctl, u8 isc, union zpci_sic_iib *iib) 142 142 { 143 143 if (!test_facility(72)) 144 144 return -EIO; ··· 149 149 150 150 return 0; 151 151 } 152 + EXPORT_SYMBOL_GPL(zpci_set_irq_ctrl); 152 153 153 154 /* PCI Load */ 154 155 static inline int ____pcilg(u64 *data, u64 req, u64 offset, u8 *status)
+12 -14
arch/s390/pci/pci_irq.c
··· 15 15 16 16 static enum {FLOATING, DIRECTED} irq_delivery; 17 17 18 - #define SIC_IRQ_MODE_ALL 0 19 - #define SIC_IRQ_MODE_SINGLE 1 20 - #define SIC_IRQ_MODE_DIRECT 4 21 - #define SIC_IRQ_MODE_D_ALL 16 22 - #define SIC_IRQ_MODE_D_SINGLE 17 23 - #define SIC_IRQ_MODE_SET_CPU 18 24 - 25 18 /* 26 19 * summary bit vector 27 20 * FLOATING - summary bit per function ··· 147 154 static void zpci_handle_cpu_local_irq(bool rescan) 148 155 { 149 156 struct airq_iv *dibv = zpci_ibv[smp_processor_id()]; 157 + union zpci_sic_iib iib = {{0}}; 150 158 unsigned long bit; 151 159 int irqs_on = 0; 152 160 ··· 159 165 /* End of second scan with interrupts on. */ 160 166 break; 161 167 /* First scan complete, reenable interrupts. */ 162 - if (zpci_set_irq_ctrl(SIC_IRQ_MODE_D_SINGLE, PCI_ISC)) 168 + if (zpci_set_irq_ctrl(SIC_IRQ_MODE_D_SINGLE, PCI_ISC, &iib)) 163 169 break; 164 170 bit = 0; 165 171 continue; ··· 187 193 static void zpci_handle_fallback_irq(void) 188 194 { 189 195 struct cpu_irq_data *cpu_data; 196 + union zpci_sic_iib iib = {{0}}; 190 197 unsigned long cpu; 191 198 int irqs_on = 0; 192 199 ··· 198 203 /* End of second scan with interrupts on. */ 199 204 break; 200 205 /* First scan complete, reenable interrupts. */ 201 - if (zpci_set_irq_ctrl(SIC_IRQ_MODE_SINGLE, PCI_ISC)) 206 + if (zpci_set_irq_ctrl(SIC_IRQ_MODE_SINGLE, PCI_ISC, &iib)) 202 207 break; 203 208 cpu = 0; 204 209 continue; ··· 229 234 static void zpci_floating_irq_handler(struct airq_struct *airq, 230 235 struct tpi_info *tpi_info) 231 236 { 237 + union zpci_sic_iib iib = {{0}}; 232 238 unsigned long si, ai; 233 239 struct airq_iv *aibv; 234 240 int irqs_on = 0; ··· 243 247 /* End of second scan with interrupts on. */ 244 248 break; 245 249 /* First scan complete, reenable interrupts. */ 246 - if (zpci_set_irq_ctrl(SIC_IRQ_MODE_SINGLE, PCI_ISC)) 250 + if (zpci_set_irq_ctrl(SIC_IRQ_MODE_SINGLE, PCI_ISC, &iib)) 247 251 break; 248 252 si = 0; 249 253 continue; ··· 403 407 static void __init cpu_enable_directed_irq(void *unused) 404 408 { 405 409 union zpci_sic_iib iib = {{0}}; 410 + union zpci_sic_iib ziib = {{0}}; 406 411 407 412 iib.cdiib.dibv_addr = (u64) zpci_ibv[smp_processor_id()]->vector; 408 413 409 - __zpci_set_irq_ctrl(SIC_IRQ_MODE_SET_CPU, 0, &iib); 410 - zpci_set_irq_ctrl(SIC_IRQ_MODE_D_SINGLE, PCI_ISC); 414 + zpci_set_irq_ctrl(SIC_IRQ_MODE_SET_CPU, 0, &iib); 415 + zpci_set_irq_ctrl(SIC_IRQ_MODE_D_SINGLE, PCI_ISC, &ziib); 411 416 } 412 417 413 418 static int __init zpci_directed_irq_init(void) ··· 423 426 iib.diib.isc = PCI_ISC; 424 427 iib.diib.nr_cpus = num_possible_cpus(); 425 428 iib.diib.disb_addr = virt_to_phys(zpci_sbv->vector); 426 - __zpci_set_irq_ctrl(SIC_IRQ_MODE_DIRECT, 0, &iib); 429 + zpci_set_irq_ctrl(SIC_IRQ_MODE_DIRECT, 0, &iib); 427 430 428 431 zpci_ibv = kcalloc(num_possible_cpus(), sizeof(*zpci_ibv), 429 432 GFP_KERNEL); ··· 468 471 469 472 int __init zpci_irq_init(void) 470 473 { 474 + union zpci_sic_iib iib = {{0}}; 471 475 int rc; 472 476 473 477 irq_delivery = sclp.has_dirq ? DIRECTED : FLOATING; ··· 500 502 * Enable floating IRQs (with suppression after one IRQ). When using 501 503 * directed IRQs this enables the fallback path. 502 504 */ 503 - zpci_set_irq_ctrl(SIC_IRQ_MODE_SINGLE, PCI_ISC); 505 + zpci_set_irq_ctrl(SIC_IRQ_MODE_SINGLE, PCI_ISC, &iib); 504 506 505 507 return 0; 506 508 out_airq: