/xen/xen/arch/x86/x86_64/ |
A D | pci.c | 11 #define PCI_CONF_ADDRESS(sbdf, reg) \ argument 18 if ( sbdf.seg || reg > 255 ) in pci_conf_read8() 20 pci_mmcfg_read(sbdf.seg, sbdf.bus, sbdf.devfn, reg, 1, &value); in pci_conf_read8() 29 if ( sbdf.seg || reg > 255 ) in pci_conf_read16() 33 pci_mmcfg_read(sbdf.seg, sbdf.bus, sbdf.devfn, reg, 2, &value); in pci_conf_read16() 42 if ( sbdf.seg || reg > 255 ) in pci_conf_read32() 46 pci_mmcfg_read(sbdf.seg, sbdf.bus, sbdf.devfn, reg, 4, &value); in pci_conf_read32() 55 if ( sbdf.seg || reg > 255 ) in pci_conf_write8() 56 pci_mmcfg_write(sbdf.seg, sbdf.bus, sbdf.devfn, reg, 1, data); in pci_conf_write8() 64 pci_mmcfg_write(sbdf.seg, sbdf.bus, sbdf.devfn, reg, 2, data); in pci_conf_write16() [all …]
|
/xen/xen/drivers/vpci/ |
A D | vpci.c | 117 return pci_conf_read16(pdev->sbdf, reg); in vpci_hw_read16() 123 return pci_conf_read32(pdev->sbdf, reg); in vpci_hw_read32() 213 data = pci_conf_read32(sbdf, reg); in vpci_read_hw() 223 data = pci_conf_read8(sbdf, reg); in vpci_read_hw() 234 data = pci_conf_read16(sbdf, reg); in vpci_read_hw() 238 data = pci_conf_read8(sbdf, reg); in vpci_read_hw() 256 pci_conf_write32(sbdf, reg, data); in vpci_write_hw() 277 pci_conf_write16(sbdf, reg, data); in vpci_write_hw() 281 pci_conf_write8(sbdf, reg, data); in vpci_write_hw() 320 pdev = pci_get_pdev_by_domain(d, sbdf.seg, sbdf.bus, sbdf.devfn); in vpci_read() [all …]
|
A D | header.c | 115 pci_conf_write32(pdev->sbdf, rom_pos, val); in modify_decoding() 125 pci_conf_write16(pdev->sbdf, PCI_COMMAND, cmd); in modify_decoding() 336 uint16_t current_cmd = pci_conf_read16(pdev->sbdf, reg); in cmd_write() 351 pci_conf_write16(pdev->sbdf, reg, cmd); in cmd_write() 397 pci_conf_write32(pdev->sbdf, reg, val); in bar_write() 406 uint16_t cmd = pci_conf_read16(pdev->sbdf, PCI_COMMAND); in rom_write() 428 pci_conf_write32(pdev->sbdf, reg, val); in rom_write() 484 cmd = pci_conf_read16(pdev->sbdf, PCI_COMMAND); in init_bars() 507 val = pci_conf_read32(pdev->sbdf, reg); in init_bars() 523 pci_conf_write16(pdev->sbdf, PCI_COMMAND, cmd); in init_bars() [all …]
|
A D | msix.c | 149 pci_conf_write16(pdev->sbdf, reg, val); in control_write() 460 control = pci_conf_read16(pdev->sbdf, msix_control_reg(msix_offset)); in init_msix() 472 pci_conf_read32(pdev->sbdf, msix_table_offset_reg(msix_offset)); in init_msix() 474 pci_conf_read32(pdev->sbdf, msix_pba_offset_reg(msix_offset)); in init_msix()
|
A D | msi.c | 80 pci_conf_write16(pdev->sbdf, reg, control_read(pdev, reg, data)); in control_write() 212 control = pci_conf_read16(pdev->sbdf, msi_control_reg(pos)); in init_msi()
|
/xen/xen/include/xen/ |
A D | pci.h | 29 #define PCI_SEG(sbdf) (((sbdf) >> 16) & 0xffff) argument 38 ((pci_sbdf_t){ .sbdf = (((s) & 0xffff) << 16) | PCI_BDF(b, d, f) }) 40 ((pci_sbdf_t){ .sbdf = (((s) & 0xffff) << 16) | ((bdf) & 0xffff) }) 42 ((pci_sbdf_t){ .sbdf = (((s) & 0xffff) << 16) | PCI_BDF2(b, df) }) 45 uint32_t sbdf; member 94 pci_sbdf_t sbdf; member 179 uint8_t pci_conf_read8(pci_sbdf_t sbdf, unsigned int reg); 180 uint16_t pci_conf_read16(pci_sbdf_t sbdf, unsigned int reg); 181 uint32_t pci_conf_read32(pci_sbdf_t sbdf, unsigned int reg); 182 void pci_conf_write8(pci_sbdf_t sbdf, unsigned int reg, uint8_t data); [all …]
|
A D | vpci.h | 42 uint32_t vpci_read(pci_sbdf_t sbdf, unsigned int reg, unsigned int size); 43 void vpci_write(pci_sbdf_t sbdf, unsigned int reg, unsigned int size, 224 static inline uint32_t vpci_read(pci_sbdf_t sbdf, unsigned int reg, in vpci_read() argument 231 static inline void vpci_write(pci_sbdf_t sbdf, unsigned int reg, in vpci_write() argument
|
/xen/xen/arch/x86/hvm/ |
A D | io.c | 268 sbdf->bdf = CF8_BDF(cf8); in hvm_pci_decode_addr() 269 sbdf->seg = 0; in hvm_pci_decode_addr() 303 pci_sbdf_t sbdf; in vpci_portio_read() local 325 *data = vpci_read(sbdf, reg, size); in vpci_portio_read() 335 pci_sbdf_t sbdf; in vpci_portio_write() local 355 vpci_write(sbdf, reg, size, data); in vpci_portio_write() 411 sbdf->bdf = MMCFG_BDF(addr); in vpci_mmcfg_decode_addr() 412 sbdf->bus += mmcfg->start_bus; in vpci_mmcfg_decode_addr() 413 sbdf->seg = mmcfg->segment; in vpci_mmcfg_decode_addr() 436 pci_sbdf_t sbdf; in vpci_mmcfg_read() local [all …]
|
A D | ioreq.c | 1274 pci_sbdf_t sbdf; in hvm_select_ioreq_server() local 1277 reg = hvm_pci_decode_addr(cf8, p->addr, &sbdf); in hvm_select_ioreq_server() 1281 addr = ((uint64_t)sbdf.sbdf << 32) | reg; in hvm_select_ioreq_server()
|
/xen/xen/drivers/passthrough/vtd/ |
A D | quirks.c | 428 switch ( pci_conf_read16(pdev->sbdf, PCI_DEVICE_ID) ) in pci_vtd_quirk() 439 val = pci_conf_read32(pdev->sbdf, 0x1AC); in pci_vtd_quirk() 440 pci_conf_write32(pdev->sbdf, 0x1AC, val | (1 << 31)); in pci_vtd_quirk() 482 val = pci_conf_read32(pdev->sbdf, pos + PCI_ERR_UNCOR_MASK); in pci_vtd_quirk() 483 val2 = pci_conf_read32(pdev->sbdf, pos + PCI_ERR_COR_MASK); in pci_vtd_quirk() 488 pci_conf_write32(pdev->sbdf, pos + PCI_ERR_UNCOR_MASK, in pci_vtd_quirk() 490 pci_conf_write32(pdev->sbdf, pos + PCI_ERR_COR_MASK, in pci_vtd_quirk() 498 val = pci_conf_read32(pdev->sbdf, 0x20c); in pci_vtd_quirk() 499 pci_conf_write32(pdev->sbdf, 0x20c, val | (1 << 4)); in pci_vtd_quirk() 515 bar = pci_conf_read32(pdev->sbdf, 0x6c); in pci_vtd_quirk() [all …]
|
A D | dmar.c | 843 u32 sbdf[MAX_USER_RMRR_DEV]; member 930 rmrr->scope.devices[idx] = user_rmrrs[i].sbdf[idx]; in add_user_rmrr() 931 seg |= PCI_SEG(user_rmrrs[i].sbdf[idx]); in add_user_rmrr() 933 if ( seg != PCI_SEG(user_rmrrs[i].sbdf[0]) ) in add_user_rmrr() 1051 PCI_SBDF2(rmrr->segment, bdf).sbdf, ctxt); in intel_iommu_get_reserved_device_memory() 1115 seg = PCI_SEG(user_rmrrs[nr_rmrr].sbdf[0]); in parse_rmrr_param() 1119 user_rmrrs[nr_rmrr].sbdf[dev_count] = in parse_rmrr_param() 1120 PCI_SBDF(seg, bus, dev, func).sbdf; in parse_rmrr_param()
|
/xen/xen/arch/x86/ |
A D | msi.c | 129 pci_sbdf_t sbdf = dev->sbdf; in memory_decoded() local 133 sbdf.bus = dev->info.physfn.bus; in memory_decoded() 134 sbdf.devfn = dev->info.physfn.devfn; in memory_decoded() 350 control = pci_conf_read16(pdev->sbdf, in msi_set_mask_bit() 355 pci_conf_write16(pdev->sbdf, in msi_set_mask_bit() 389 pci_conf_write16(pdev->sbdf, in msi_set_mask_bit() 522 control = pci_conf_read16(pdev->sbdf, cpos); in setup_msi_irq() 524 pci_conf_write16(pdev->sbdf, cpos, in setup_msi_irq() 534 pci_conf_write16(pdev->sbdf, cpos, control); in setup_msi_irq() 658 maskbits = pci_conf_read32(dev->sbdf, mpos); in msi_capability_init() [all …]
|
/xen/xen/drivers/passthrough/x86/ |
A D | ats.c | 38 value = pci_conf_read16(pdev->sbdf, pos + ATS_REG_CTL); in enable_ats_device() 54 pci_conf_write16(pdev->sbdf, pos + ATS_REG_CTL, value); in enable_ats_device() 60 value = pci_conf_read16(pdev->sbdf, pos + ATS_REG_CAP); in enable_ats_device() 82 value = pci_conf_read16(pdev->sbdf, pdev->ats.cap_pos + ATS_REG_CTL); in disable_ats_device() 84 pci_conf_write16(pdev->sbdf, pdev->ats.cap_pos + ATS_REG_CTL, value); in disable_ats_device()
|
/xen/xen/drivers/passthrough/ |
A D | pci.c | 250 val = pci_conf_read16(pdev->sbdf, PCI_COMMAND); in check_pdev() 253 val = pci_conf_read16(pdev->sbdf, PCI_STATUS); in check_pdev() 657 pci_conf_write32(sbdf, pos, ~0); in pci_size_mem_bar() 664 (flags & PCI_BAR_VF) ? "SR-IOV " : "", sbdf.seg, sbdf.bus, in pci_size_mem_bar() 665 sbdf.dev, sbdf.fn, (flags & PCI_BAR_VF) ? "vf " : ""); in pci_size_mem_bar() 669 hi = pci_conf_read32(sbdf, pos + 4); in pci_size_mem_bar() 670 pci_conf_write32(sbdf, pos + 4, ~0); in pci_size_mem_bar() 672 size = pci_conf_read32(sbdf, pos) & mask; in pci_size_mem_bar() 676 pci_conf_write32(sbdf, pos + 4, hi); in pci_size_mem_bar() 680 pci_conf_write32(sbdf, pos, bar); in pci_size_mem_bar() [all …]
|
/xen/tools/flask/utils/ |
A D | label-pci.c | 40 uint32_t sbdf; in main() local 58 sbdf = (seg << 16) | (bus << 8) | (dev << 3) | fn; in main() 71 ret = xc_flask_add_device(xch, sbdf, argv[2]); in main() 74 argv[1], sbdf, argv[2], ret); in main()
|
/xen/tools/python/xen/lowlevel/xc/ |
A D | xc.c | 538 int32_t sbdf = 0; in pyxc_test_assign_device() local 548 sbdf = seg << 16; in pyxc_test_assign_device() 559 sbdf = 0; in pyxc_test_assign_device() 571 int32_t sbdf = 0; in pyxc_assign_device() local 581 sbdf = seg << 16; in pyxc_assign_device() 592 sbdf = 0; in pyxc_assign_device() 604 int32_t sbdf = 0; in pyxc_deassign_device() local 614 sbdf = seg << 16; in pyxc_deassign_device() 625 sbdf = 0; in pyxc_deassign_device() 634 uint32_t sbdf; in pyxc_get_device_group() local [all …]
|
/xen/xen/drivers/pci/ |
A D | pci.c | 119 uint16_t cmd = pci_conf_read16(pdev->sbdf, PCI_COMMAND); in pci_intx() 125 pci_conf_write16(pdev->sbdf, PCI_COMMAND, cmd); in pci_intx()
|
/xen/xen/arch/x86/cpu/ |
A D | amd.c | 571 #define PCI_ECS_ADDRESS(sbdf, reg) \ in amd_log_freq() argument 572 (0x80000000 | ((sbdf).bdf << 8) | ((reg) & 0xfc) | (((reg) & 0xf00) << 16)) in amd_log_freq() 575 pci_sbdf_t sbdf = PCI_SBDF(0, 0, 0x18 | node, 4); in amd_log_freq() local 577 switch (pci_conf_read32(sbdf, PCI_VENDOR_ID)) { in amd_log_freq() 603 idx &= pci_conf_read(PCI_ECS_ADDRESS(sbdf, in amd_log_freq()
|
/xen/tools/ocaml/libs/xc/ |
A D | xenctrl_stubs.c | 1098 uint32_t sbdf; in stub_xc_domain_test_assign_device() local 1104 sbdf = encode_sbdf(domain, bus, dev, func); in stub_xc_domain_test_assign_device() 1106 ret = xc_test_assign_device(_H(xch), _D(domid), sbdf); in stub_xc_domain_test_assign_device() 1121 uint32_t sbdf, flag; in stub_xc_domain_assign_device() local 1127 sbdf = encode_sbdf(domain, bus, dev, func); in stub_xc_domain_assign_device() 1132 ret = xc_assign_device(_H(xch), _D(domid), sbdf, flag); in stub_xc_domain_assign_device() 1144 uint32_t sbdf; in stub_xc_domain_deassign_device() local 1150 sbdf = encode_sbdf(domain, bus, dev, func); in stub_xc_domain_deassign_device() 1152 ret = xc_deassign_device(_H(xch), _D(domid), sbdf); in stub_xc_domain_deassign_device()
|
/xen/tools/tests/vpci/ |
A D | main.c | 74 data = vpci_read((pci_sbdf_t){ .sbdf = 0 }, reg, size); \ 85 vpci_write((pci_sbdf_t){ .sbdf = 0 }, reg, size, data); \
|
A D | emul.h | 64 uint32_t sbdf; member
|
/xen/xen/include/asm-x86/hvm/ |
A D | io.h | 166 pci_sbdf_t *sbdf);
|
/xen/xen/common/compat/ |
A D | memory.c | 30 uint32_t sbdf = PCI_SBDF3(grdm->map.dev.pci.seg, grdm->map.dev.pci.bus, in get_reserved_device_memory() local 31 grdm->map.dev.pci.devfn).sbdf; in get_reserved_device_memory() 33 if ( !(grdm->map.flags & XENMEM_RDM_ALL) && (sbdf != id) ) in get_reserved_device_memory()
|
/xen/xen/common/ |
A D | memory.c | 1012 uint32_t sbdf = PCI_SBDF3(grdm->map.dev.pci.seg, grdm->map.dev.pci.bus, in get_reserved_device_memory() local 1013 grdm->map.dev.pci.devfn).sbdf; in get_reserved_device_memory() 1015 if ( !(grdm->map.flags & XENMEM_RDM_ALL) && (sbdf != id) ) in get_reserved_device_memory()
|
/xen/xen/xsm/flask/ |
A D | hooks.c | 122 u32 sbdf = (dev->seg << 16) | (dev->bus << 8) | dev->devfn; in get_irq_sid() local 125 ad->device = sbdf; in get_irq_sid() 127 return security_device_sid(sbdf, sid); in get_irq_sid()
|