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: stash associated GISA designation

For passthrough devices, we will need to know the GISA designation of the
guest if interpretation facilities are to be used. Setup to stash this in
the zdev and set a default of 0 (no GISA designation) for now; a subsequent
patch will set a valid GISA designation for passthrough devices.
Also, extend mpcific routines to specify this stashed designation as part
of the mpcific command.

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

authored by

Matthew Rosato and committed by
Christian Borntraeger
c68468ed 062f0024

+19 -1
+1
arch/s390/include/asm/pci.h
··· 123 123 enum zpci_state state; 124 124 u32 fid; /* function ID, used by sclp */ 125 125 u32 fh; /* function handle, used by insn's */ 126 + u32 gisa; /* GISA designation for passthrough */ 126 127 u16 vfn; /* virtual function number */ 127 128 u16 pchid; /* physical channel ID */ 128 129 u8 pfgid; /* function group ID */
+2 -1
arch/s390/include/asm/pci_clp.h
··· 173 173 u16 reserved2; 174 174 u8 oc; /* operation controls */ 175 175 u8 ndas; /* number of dma spaces */ 176 - u64 reserved3; 176 + u32 reserved3; 177 + u32 gisa; /* GISA designation */ 177 178 } __packed; 178 179 179 180 /* Set PCI function response */
+6
arch/s390/pci/pci.c
··· 120 120 fib.pba = base; 121 121 fib.pal = limit; 122 122 fib.iota = iota | ZPCI_IOTA_RTTO_FLAG; 123 + fib.gd = zdev->gisa; 123 124 cc = zpci_mod_fc(req, &fib, &status); 124 125 if (cc) 125 126 zpci_dbg(3, "reg ioat fid:%x, cc:%d, status:%d\n", zdev->fid, cc, status); ··· 133 132 u64 req = ZPCI_CREATE_REQ(zdev->fh, dmaas, ZPCI_MOD_FC_DEREG_IOAT); 134 133 struct zpci_fib fib = {0}; 135 134 u8 cc, status; 135 + 136 + fib.gd = zdev->gisa; 136 137 137 138 cc = zpci_mod_fc(req, &fib, &status); 138 139 if (cc) ··· 163 160 atomic64_set(&zdev->unmapped_pages, 0); 164 161 165 162 fib.fmb_addr = virt_to_phys(zdev->fmb); 163 + fib.gd = zdev->gisa; 166 164 cc = zpci_mod_fc(req, &fib, &status); 167 165 if (cc) { 168 166 kmem_cache_free(zdev_fmb_cache, zdev->fmb); ··· 181 177 182 178 if (!zdev->fmb) 183 179 return -EINVAL; 180 + 181 + fib.gd = zdev->gisa; 184 182 185 183 /* Function measurement is disabled if fmb address is zero */ 186 184 cc = zpci_mod_fc(req, &fib, &status);
+5
arch/s390/pci/pci_clp.c
··· 229 229 { 230 230 struct clp_req_rsp_set_pci *rrb; 231 231 int rc, retries = 100; 232 + u32 gisa = 0; 232 233 233 234 *fh = 0; 234 235 rrb = clp_alloc_block(GFP_KERNEL); 235 236 if (!rrb) 236 237 return -ENOMEM; 238 + 239 + if (command != CLP_SET_DISABLE_PCI_FN) 240 + gisa = zdev->gisa; 237 241 238 242 do { 239 243 memset(rrb, 0, sizeof(*rrb)); ··· 247 243 rrb->request.fh = zdev->fh; 248 244 rrb->request.oc = command; 249 245 rrb->request.ndas = nr_dma_as; 246 + rrb->request.gisa = gisa; 250 247 251 248 rc = clp_req(rrb, CLP_LPS_PCI); 252 249 if (rrb->response.hdr.rsp == CLP_RC_SETPCIFN_BUSY) {
+5
arch/s390/pci/pci_irq.c
··· 43 43 fib.fmt0.aibvo = 0; /* each zdev has its own interrupt vector */ 44 44 fib.fmt0.aisb = virt_to_phys(zpci_sbv->vector) + (zdev->aisb / 64) * 8; 45 45 fib.fmt0.aisbo = zdev->aisb & 63; 46 + fib.gd = zdev->gisa; 46 47 47 48 return zpci_mod_fc(req, &fib, &status) ? -EIO : 0; 48 49 } ··· 54 53 u64 req = ZPCI_CREATE_REQ(zdev->fh, 0, ZPCI_MOD_FC_DEREG_INT); 55 54 struct zpci_fib fib = {0}; 56 55 u8 cc, status; 56 + 57 + fib.gd = zdev->gisa; 57 58 58 59 cc = zpci_mod_fc(req, &fib, &status); 59 60 if (cc == 3 || (cc == 1 && status == 24)) ··· 75 72 fib.fmt = 1; 76 73 fib.fmt1.noi = zdev->msi_nr_irqs; 77 74 fib.fmt1.dibvo = zdev->msi_first_bit; 75 + fib.gd = zdev->gisa; 78 76 79 77 return zpci_mod_fc(req, &fib, &status) ? -EIO : 0; 80 78 } ··· 88 84 u8 cc, status; 89 85 90 86 fib.fmt = 1; 87 + fib.gd = zdev->gisa; 91 88 cc = zpci_mod_fc(req, &fib, &status); 92 89 if (cc == 3 || (cc == 1 && status == 24)) 93 90 /* Function already gone or IRQs already deregistered. */