PCI multi-seg: config space accessor adjustments
RFC PATCH 7/7 PCI multi-seg: config space accessor adjustments
Signed-off-by Jan Beulich <[email protected]>
xen/arch/x86/cpu/amd.c +3 -3
@@ -262,15 +262,15 @@ static void disable_c1_ramping(void)int node, nr_nodes;/* Read the number of nodes from the first Northbridge. */ - nr_nodes = ((pci_conf_read32 (0 ,0x18 ,0x0 ,0x60 )>>4 )&0x07 )+1 ; + nr_nodes = ((pci_conf_read32 (0 ,0 ,0x18 ,0x0 ,0x60 )>>4 )&0x07 )+1 ;for (node =0 ; node < nr_nodes; node++) {/* PMM7: bus=0, dev=0x18+node, function=0x3, register=0x87. */ - pmm7 =pci_conf_read8 (0 ,0x18 +node,0x3 ,0x87 ); + pmm7 =pci_conf_read8 (0 ,0 ,0x18 +node,0x3 ,0x87 );/* Invalid read means we've updated every Northbridge. */ if (pmm7 ==0xFF )break ; pmm7 &=0xFC ;/* clear pmm7[1:0] */ -pci_conf_write8 (0 ,0x18 +node,0x3 ,0x87 , pmm7); +pci_conf_write8 (0 ,0 ,0x18 +node,0x3 ,0x87 , pmm7);printk ("AMD: Disabling C1 Clock Ramping Node #%x\n" , node); } }
xen/arch/x86/dmi_scan.c +3 -3
@@ -284,15 +284,15 @@ static int __init ich10_bios_quirk(struc {u32 port, smictl; -if (pci_conf_read16 (0 ,0x1f ,0 ,PCI_VENDOR_ID ) !=0x8086 ) +if (pci_conf_read16 (0 ,0 ,0x1f ,0 ,PCI_VENDOR_ID ) !=0x8086 )return 0 ; -switch (pci_conf_read16 (0 ,0x1f ,0 ,PCI_DEVICE_ID ) ) { +switch (pci_conf_read16 (0 ,0 ,0x1f ,0 ,PCI_DEVICE_ID ) ) {case 0x3a14 :case 0x3a16 :case 0x3a18 :case 0x3a1a : - port = (pci_conf_read16 (0 ,0x1f ,0 ,0x40 ) &0xff80 ) +0x30 ; + port = (pci_conf_read16 (0 ,0 ,0x1f ,0 ,0x40 ) &0xff80 ) +0x30 ; smictl =inl (port);/* turn off LEGACY_USB{,2}_EN if enabled */ if ( smictl &0x20008 )
xen/arch/x86/msi.c +64 -52
336 lines not on this page · raw message
xen/arch/x86/oprofile/op_model_athlon.c +3 -3
@@ -470,7 +470,7 @@ static int __init init_ibs_nmi(void)for (bus =0 ; bus <256 ; bus++) {for (dev =0 ; dev <32 ; dev++) {for (func =0 ; func <8 ; func++) { - id =pci_conf_read32 (bus, dev, func,PCI_VENDOR_ID ); + id =pci_conf_read32 (0 , bus, dev, func,PCI_VENDOR_ID ); vendor_id = id &0xffff ; dev_id = (id >>16 ) &0xffff ;
@@ -478,10 +478,10 @@ static int __init init_ibs_nmi(void)if ((vendor_id ==PCI_VENDOR_ID_AMD ) && (dev_id ==PCI_DEVICE_ID_AMD_10H_NB_MISC )) { -pci_conf_write32 (bus, dev, func,IBSCTL , +pci_conf_write32 (0 , bus, dev, func,IBSCTL ,IBSCTL_LVTOFFSETVAL |APIC_EILVT_LVTOFF_IBS ); - value =pci_conf_read32 (bus, dev, func,IBSCTL ); + value =pci_conf_read32 (0 , bus, dev, func,IBSCTL );if (value != (IBSCTL_LVTOFFSETVAL |APIC_EILVT_LVTOFF_IBS )) {
xen/arch/x86/x86_32/pci.c +24 -9
@@ -12,46 +12,61 @@ (0x80000000 | (bus << 16) | (dev << 11) | (func << 8) | (reg & ~3))uint8_t pci_conf_read8 ( -unsigned int bus,unsigned int dev,unsigned int func,unsigned int reg) +unsigned int seg,unsigned int bus,unsigned int dev,unsigned int func, +unsigned int reg) { +if ( seg ) +return ~0 ;BUG_ON ((bus >255 ) || (dev >31 ) || (func >7 ) || (reg >255 ));return pci_conf_read (PCI_CONF_ADDRESS (bus, dev, func, reg), reg &3 ,1 ); }uint16_t pci_conf_read16 ( -unsigned int bus,unsigned int dev,unsigned int func,unsigned int reg) +unsigned int seg,unsigned int bus,unsigned int dev,unsigned int func, +unsigned int reg) { +if ( seg ) +return ~0 ;BUG_ON ((bus >255 ) || (dev >31 ) || (func >7 ) || (reg >255 ));return pci_conf_read (PCI_CONF_ADDRESS (bus, dev, func, reg), reg &2 ,2 ); }uint32_t pci_conf_read32 ( -unsigned int bus,unsigned int dev,unsigned int func,unsigned int reg) +unsigned int seg,unsigned int bus,unsigned int dev,unsigned int func, +unsigned int reg) { +if ( seg ) +return ~0 ;BUG_ON ((bus >255 ) || (dev >31 ) || (func >7 ) || (reg >255 ));return pci_conf_read (PCI_CONF_ADDRESS (bus, dev, func, reg),0 ,4 ); }void pci_conf_write8 ( -unsigned int bus,unsigned int dev,unsigned int func,unsigned int reg, -uint8_t data) +unsigned int seg,unsigned int bus,unsigned int dev,unsigned int func, +unsigned int reg,uint8_t data) { +if ( seg ) +return ;BUG_ON ((bus >255 ) || (dev >31 ) || (func >7 ) || (reg >255 ));pci_conf_write (PCI_CONF_ADDRESS (bus, dev, func, reg), reg &3 ,1 , data); }void pci_conf_write16 ( -unsigned int bus,unsigned int dev,unsigned int func,unsigned int reg, -uint16_t data) +unsigned int seg,unsigned int bus,unsigned int dev,unsigned int func, +unsigned int reg,uint16_t data) { +if ( seg ) +return ;BUG_ON ((bus >255 ) || (dev >31 ) || (func >7 ) || (reg >255 ));pci_conf_write (PCI_CONF_ADDRESS (bus, dev, func, reg), reg &2 ,2 , data); }void pci_conf_write32 ( -unsigned int bus,unsigned int dev,unsigned int func,unsigned int reg, -uint32_t data) +unsigned int seg,unsigned int bus,unsigned int dev,unsigned int func, +unsigned int reg,uint32_t data) { +if ( seg ) +return ;BUG_ON ((bus >255 ) || (dev >31 ) || (func >7 ) || (reg >255 ));pci_conf_write (PCI_CONF_ADDRESS (bus, dev, func, reg),0 ,4 , data); }
xen/arch/x86/x86_64/mmconf-fam10h.c +3 -3
@@ -51,7 +51,7 @@ static void __init get_fam10h_pci_mmconf bus = pci_probes[i].bus; slot = pci_probes[i].slot; - id =pci_conf_read32 (bus, slot,0 ,PCI_VENDOR_ID ); + id =pci_conf_read32 (0 , bus, slot,0 ,PCI_VENDOR_ID ); vendor = id &0xffff ; device = (id>>16 ) &0xffff ;
@@ -82,12 +82,12 @@ static void __init get_fam10h_pci_mmconf* above 4G */ for (hi_mmio_num = i =0 ; i <8 ; i++) { - val =pci_conf_read32 (bus, slot,1 ,0x80 + (i <<3 )); + val =pci_conf_read32 (0 , bus, slot,1 ,0x80 + (i <<3 ));if (!(val &3 ))continue ; start = (val &0xffffff00 ) <<8 ;/* 39:16 on 31:8*/ - val =pci_conf_read32 (bus, slot,1 ,0x84 + (i <<3 )); + val =pci_conf_read32 (0 , bus, slot,1 ,0x84 + (i <<3 )); end = ((val &0xffffff00 ) <<8 ) |0xffff ;/* 39:16 on 31:8*/ if (end < tom2)
xen/arch/x86/x86_64/mmconfig-shared.c +9 -9
@@ -50,7 +50,7 @@ custom_param("mmcfg", parse_mmcfg);static const char __init *pci_mmcfg_e7520 (void ) {u32 win; - win =pci_conf_read16 (0 ,0 ,0 ,0xce ); + win =pci_conf_read16 (0 ,0 ,0 ,0 ,0xce ); win = win &0xf000 ;if (win ==0x0000 || win ==0xf000 )
@@ -76,7 +76,7 @@ static const char __init *pci_mmcfg_inte pci_mmcfg_config_num =1 ; - pciexbar =pci_conf_read32 (0 ,0 ,0 ,0x48 ); + pciexbar =pci_conf_read32 (0 ,0 ,0 ,0 ,0x48 );/* Enable bit */ if (!(pciexbar &1 ))
@@ -201,14 +201,14 @@ static const char __init *pci_mmcfg_nvidu32 l, extcfg;u16 vendor, device; - l =pci_conf_read32 (bus,0 ,0 ,0 ); + l =pci_conf_read32 (0 , bus,0 ,0 ,0 ); vendor = l &0xffff ; device = (l >>16 ) &0xffff ;if (PCI_VENDOR_ID_NVIDIA != vendor ||0x0369 != device)continue ; - extcfg =pci_conf_read32 (bus,0 ,0 , extcfg_regnum); + extcfg =pci_conf_read32 (0 , bus,0 ,0 , extcfg_regnum);if (extcfg & extcfg_enable_mask) i++;
@@ -227,14 +227,14 @@ static const char __init *pci_mmcfg_nvidu16 vendor, device;int size_index; - l =pci_conf_read32 (bus,0 ,0 ,0 ); + l =pci_conf_read32 (0 , bus,0 ,0 ,0 ); vendor = l &0xffff ; device = (l >>16 ) &0xffff ;if (PCI_VENDOR_ID_NVIDIA != vendor ||0x0369 != device)continue ; - extcfg =pci_conf_read32 (bus,0 ,0 , extcfg_regnum); + extcfg =pci_conf_read32 (0 , bus,0 ,0 , extcfg_regnum);if (!(extcfg & extcfg_enable_mask))continue ;
@@ -300,7 +300,7 @@ static int __init pci_mmcfg_check_hostbrfor (i =0 ; !name && i <ARRAY_SIZE (pci_mmcfg_probes); i++) { bus = pci_mmcfg_probes[i].bus; devfn = pci_mmcfg_probes[i].devfn; - l =pci_conf_read32 (bus,PCI_SLOT (devfn),PCI_FUNC (devfn),0 ); + l =pci_conf_read32 (0 , bus,PCI_SLOT (devfn),PCI_FUNC (devfn),0 ); vendor = l &0xffff ; device = (l >>16 ) &0xffff ;
@@ -473,7 +473,7 @@ int pci_find_ext_capability(int seg, intint ttl =480 ;/* 3840 bytes, minimum 8 bytes per capability */ int pos =0x100 ; - header =pci_conf_read32 (bus,PCI_SLOT (devfn),PCI_FUNC (devfn), pos); + header =pci_conf_read32 (seg, bus,PCI_SLOT (devfn),PCI_FUNC (devfn), pos);/* * If we have no capabilities, this is indicated by cap ID,
@@ -488,7 +488,7 @@ int pci_find_ext_capability(int seg, int pos =PCI_EXT_CAP_NEXT (header);if ( pos <0x100 )break ; - header =pci_conf_read32 (bus,PCI_SLOT (devfn),PCI_FUNC (devfn), pos); + header =pci_conf_read32 (seg, bus,PCI_SLOT (devfn),PCI_FUNC (devfn), pos); }return 0 ; }
xen/arch/x86/x86_64/pci.c +24 -21
96 lines not on this page · raw message
xen/drivers/acpi/reboot.c +1 -1
@@ -24,7 +24,7 @@ void acpi_reboot(void)case ACPI_ADR_SPACE_PCI_CONFIG :printk ("Resetting with ACPI PCI RESET_REG.\n" );/* Write the value that resets us. */ - pci_conf_write8(0, + pci_conf_write8(0, 0, (rr->address >> 32) & 31, (rr->address >> 16) & 7, (rr->address & 255),
xen/drivers/char/ns16550.c +13 -12
@@ -221,12 +221,12 @@ static void pci_serial_early_init(structreturn ;if ( uart->pb_bdf_enable ) -pci_conf_write16 (uart->pb_bdf[0 ], uart->pb_bdf[1 ], uart->pb_bdf[2 ], +pci_conf_write16 (0 , uart->pb_bdf[0 ], uart->pb_bdf[1 ], uart->pb_bdf[2 ],0x1c , (uart->io_base &0xF000 ) | ((uart->io_base &0xF000 ) >>8 )); -pci_conf_write32 (uart->ps_bdf[0 ], uart->ps_bdf[1 ], uart->ps_bdf[2 ], +pci_conf_write32 (0 , uart->ps_bdf[0 ], uart->ps_bdf[1 ], uart->ps_bdf[2 ],0x10 , uart->io_base |0x1 ); -pci_conf_write16 (uart->ps_bdf[0 ], uart->ps_bdf[1 ], uart->ps_bdf[2 ], +pci_conf_write16 (0 , uart->ps_bdf[0 ], uart->ps_bdf[1 ], uart->ps_bdf[2 ],0x4 ,0x1 ); }
@@ -341,10 +341,10 @@ static void ns16550_suspend(struct seriaif ( uart->bar ) { uart->bar =pci_conf_read32 ( - uart->pb_bdf[0 ], uart->pb_bdf[1 ], uart->pb_bdf[2 ], +0 , uart->pb_bdf[0 ], uart->pb_bdf[1 ], uart->pb_bdf[2 ],PCI_BASE_ADDRESS_0 + uart->bar_idx*4 ); uart->cr =pci_conf_read32 ( - uart->pb_bdf[0 ], uart->pb_bdf[1 ], uart->pb_bdf[2 ], +0 , uart->pb_bdf[0 ], uart->pb_bdf[1 ], uart->pb_bdf[2 ],PCI_COMMAND ); } }
@@ -358,9 +358,9 @@ static void ns16550_resume(struct serialif ( uart->bar ) { -pci_conf_write32 (uart->pb_bdf[0 ], uart->pb_bdf[1 ], uart->pb_bdf[2 ], +pci_conf_write32 (0 , uart->pb_bdf[0 ], uart->pb_bdf[1 ], uart->pb_bdf[2 ],PCI_BASE_ADDRESS_0 + uart->bar_idx*4 , uart->bar); -pci_conf_write32 (uart->pb_bdf[0 ], uart->pb_bdf[1 ], uart->pb_bdf[2 ], +pci_conf_write32 (0 , uart->pb_bdf[0 ], uart->pb_bdf[1 ], uart->pb_bdf[2 ],PCI_COMMAND , uart->cr); } }
@@ -479,19 +479,20 @@ pci_uart_config (struct ns16550 *uart, i {for ( f =0 ; f <0x8 ; f++ ) { - class =pci_conf_read16 (b, d, f,PCI_CLASS_DEVICE ); + class =pci_conf_read16 (0 , b, d, f,PCI_CLASS_DEVICE );if ( class !=0x700 )continue ; - bar =pci_conf_read32 (b, d, f,PCI_BASE_ADDRESS_0 + bar_idx*4 ); + bar =pci_conf_read32 (0 , b, d, f, +PCI_BASE_ADDRESS_0 + bar_idx*4 );/* Not IO */ if ( !(bar &1 ) )continue ; -pci_conf_write32 (b, d, f,PCI_BASE_ADDRESS_0 , ~0u ); - len =pci_conf_read32 (b, d, f,PCI_BASE_ADDRESS_0 ); -pci_conf_write32 (b, d, f,PCI_BASE_ADDRESS_0 + bar_idx*4 , bar); +pci_conf_write32 (0 , b, d, f,PCI_BASE_ADDRESS_0 , ~0u ); + len =pci_conf_read32 (0 , b, d, f,PCI_BASE_ADDRESS_0 ); +pci_conf_write32 (0 , b, d, f,PCI_BASE_ADDRESS_0 + bar_idx*4 , bar);/* Not 8 bytes */ if ( (len &0xffff ) !=0xfff9 )
xen/drivers/passthrough/amd/iommu_detect.c +6 -6
@@ -35,14 +35,14 @@ static int __init get_iommu_msi_capabiliu16 control;int count =0 ; - cap_ptr =pci_conf_read8 (bus, dev, func, + cap_ptr =pci_conf_read8 (seg, bus, dev, func,PCI_CAPABILITY_LIST );while ( cap_ptr >=PCI_MIN_CAP_OFFSET && count <PCI_MAX_CAP_BLOCKS ) { cap_ptr &=PCI_CAP_PTR_MASK ; - cap_header =pci_conf_read32 (bus, dev, func, cap_ptr); + cap_header =pci_conf_read32 (seg, bus, dev, func, cap_ptr); cap_id =get_field_from_reg_u32 (cap_header,PCI_CAP_ID_MASK ,PCI_CAP_ID_SHIFT );
@@ -60,7 +60,7 @@ static int __init get_iommu_msi_capabilireturn -ENODEV ;AMD_IOMMU_DEBUG ("Found MSI capability block \n" ); - control =pci_conf_read16 (bus, dev, func, + control =pci_conf_read16 (seg, bus, dev, func, iommu->msi_cap +PCI_MSI_FLAGS ); iommu->maskbit = control &PCI_MSI_FLAGS_MASKBIT ;return 0 ;
@@ -71,18 +71,18 @@ static int __init get_iommu_capabilities {u32 cap_header, cap_range, misc_info; - cap_header =pci_conf_read32 (bus, dev, func, cap_ptr); + cap_header =pci_conf_read32 (seg, bus, dev, func, cap_ptr); iommu->revision =get_field_from_reg_u32 ( cap_header,PCI_CAP_REV_MASK ,PCI_CAP_REV_SHIFT ); iommu->pte_not_present_cached =get_field_from_reg_u32 ( cap_header,PCI_CAP_NP_CACHE_MASK ,PCI_CAP_NP_CACHE_SHIFT ); - cap_range =pci_conf_read32 (bus, dev, func, + cap_range =pci_conf_read32 (seg, bus, dev, func, cap_ptr +PCI_CAP_RANGE_OFFSET ); iommu->unit_id =get_field_from_reg_u32 ( cap_range,PCI_CAP_UNIT_ID_MASK ,PCI_CAP_UNIT_ID_SHIFT ); - misc_info =pci_conf_read32 (bus, dev, func, + misc_info =pci_conf_read32 (seg, bus, dev, func, cap_ptr +PCI_MISC_INFO_OFFSET ); iommu->msi_number =get_field_from_reg_u32 ( misc_info,PCI_CAP_MSI_NUMBER_MASK ,PCI_CAP_MSI_NUMBER_SHIFT );
xen/drivers/passthrough/amd/iommu_init.c +14 -12
@@ -269,7 +269,7 @@ static void set_iommu_event_log_control(writel (entry, iommu->mmio_base +IOMMU_CONTROL_MMIO_OFFSET ); } -static void parse_event_log_entry (u32 entry[]); +static void parse_event_log_entry (struct amd_iommu *,u32 entry[]);static int amd_iommu_read_event_log (struct amd_iommu *iommu) {
@@ -290,7 +290,7 @@ static int amd_iommu_read_event_log(stru (iommu->event_log_head * IOMMU_EVENT_LOG_ENTRY_SIZE)); -parse_event_log_entry (event_log); +parse_event_log_entry (iommu, event_log);if ( ++iommu->event_log_head == iommu->event_log.entries ) iommu->event_log_head =0 ;
@@ -351,6 +351,7 @@ static void iommu_msi_set_affinity(unsigstruct amd_iommu *iommu = irq_to_iommu[irq];struct irq_desc *desc =irq_to_desc (irq);struct irq_cfg *cfg = desc->chip_data; +u16 seg = iommu->seg;u8 bus = (iommu->bdf >>8 ) &0xff ;u8 dev =PCI_SLOT (iommu->bdf &0xff );u8 func =PCI_FUNC (iommu->bdf &0xff );
@@ -379,11 +380,11 @@ static void iommu_msi_set_affinity(unsigMSI_ADDR_REDIRECTION_LOWPRI ; msg.address_lo |=MSI_ADDR_DEST_ID (dest &0xff ); -pci_conf_write32 (bus, dev, func, +pci_conf_write32 (seg, bus, dev, func, iommu->msi_cap +PCI_MSI_DATA_64 , msg.data); -pci_conf_write32 (bus, dev, func, +pci_conf_write32 (seg, bus, dev, func, iommu->msi_cap +PCI_MSI_ADDRESS_LO , msg.address_lo); -pci_conf_write32 (bus, dev, func, +pci_conf_write32 (seg, bus, dev, func, iommu->msi_cap +PCI_MSI_ADDRESS_HI , msg.address_hi); }
@@ -395,12 +396,12 @@ static void amd_iommu_msi_enable(structint dev =PCI_SLOT (iommu->bdf &0xff );int func =PCI_FUNC (iommu->bdf &0xff ); - control =pci_conf_read16 (bus, dev, func, + control =pci_conf_read16 (iommu->seg, bus, dev, func, iommu->msi_cap +PCI_MSI_FLAGS ); control &= ~(1 );if ( flag ) control |= flag; -pci_conf_write16 (bus, dev, func, +pci_conf_write16 (iommu->seg, bus, dev, func, iommu->msi_cap +PCI_MSI_FLAGS , control); }
@@ -459,7 +460,7 @@ static hw_irq_controller iommu_msi_type .set_affinity = iommu_msi_set_affinity, }; -static void parse_event_log_entry (u32 entry[]) +static void parse_event_log_entry (struct amd_iommu *iommu,u32 entry[]) {u16 domain_id, device_id, bdf, cword;u32 code;
@@ -500,11 +501,12 @@ static void parse_event_log_entry(u32 en/* Tell the device to stop DMAing; we can't rely on the guest to * control it for us. */ for ( bdf =0 ; bdf < ivrs_bdf_entries; bdf++ ) -if (get_dma_requestor_id (bdf) == device_id ) +if (get_dma_requestor_id (iommu->seg, bdf) == device_id ) { - cword =pci_conf_read16 (PCI_BUS (bdf),PCI_SLOT (bdf), -PCI_FUNC (bdf),PCI_COMMAND ); -pci_conf_write16 (PCI_BUS (bdf),PCI_SLOT (bdf), + cword =pci_conf_read16 (iommu->seg,PCI_BUS (bdf), +PCI_SLOT (bdf),PCI_FUNC (bdf), +PCI_COMMAND ); +pci_conf_write16 (iommu->seg,PCI_BUS (bdf),PCI_SLOT (bdf),PCI_FUNC (bdf),PCI_COMMAND , cword & ~PCI_COMMAND_MASTER ); }
xen/drivers/passthrough/pci.c +24 -22
134 lines not on this page · raw message
xen/drivers/passthrough/vtd/dmar.c +6 -5
@@ -307,17 +307,18 @@ static int __init acpi_parse_dev_scope(while ( --depth >0 ) { - bus =pci_conf_read8 (bus, path->dev, path->fn,PCI_SECONDARY_BUS ); + bus =pci_conf_read8 (seg, bus, path->dev, path->fn, +PCI_SECONDARY_BUS ); path++; }switch ( acpi_scope->dev_type ) {case ACPI_DEV_P2PBRIDGE : - sec_bus =pci_conf_read8 ( - bus, path->dev, path->fn,PCI_SECONDARY_BUS ); - sub_bus =pci_conf_read8 ( - bus, path->dev, path->fn,PCI_SUBORDINATE_BUS ); + sec_bus =pci_conf_read8 (seg, bus, path->dev, path->fn, +PCI_SECONDARY_BUS ); + sub_bus =pci_conf_read8 (seg, bus, path->dev, path->fn, +PCI_SUBORDINATE_BUS );if ( iommu_verbose ) dprintk(VTDPREFIX, " bridge: %04x:%02x:%02x.%u start=%x sec=%x sub=%x\n",
xen/drivers/passthrough/vtd/iommu.c +5 -4
@@ -920,11 +920,12 @@ static void iommu_page_fault(int irq, vo/* Tell the device to stop DMAing; we can't rely on the guest to * control it for us. */ - cword =pci_conf_read16 (PCI_BUS (source_id),PCI_SLOT (source_id), + cword =pci_conf_read16 (iommu->intel->drhd->segment, +PCI_BUS (source_id),PCI_SLOT (source_id),PCI_FUNC (source_id),PCI_COMMAND ); -pci_conf_write16 (PCI_BUS (source_id),PCI_SLOT (source_id), -PCI_FUNC (source_id),PCI_COMMAND , - cword & ~PCI_COMMAND_MASTER ); +pci_conf_write16 (iommu->intel->drhd->segment,PCI_BUS (source_id), +PCI_SLOT (source_id),PCI_FUNC (source_id), +PCI_COMMAND , cword & ~PCI_COMMAND_MASTER ); fault_index++;if ( fault_index >cap_num_fault_regs (iommu->cap) )
xen/drivers/passthrough/vtd/quirks.c +17 -16
@@ -70,7 +70,7 @@ int is_igd_vt_enabled_quirk(void)return 1 ;/* integrated graphics on Intel platforms is located at 0:2.0 */ - ggc =pci_conf_read16 (0 ,IGD_DEV ,0 ,GGC ); + ggc =pci_conf_read16 (0 ,0 ,IGD_DEV ,0 ,GGC );return ( ggc &GGC_MEMORY_VT_ENABLED ?1 :0 ); }
@@ -84,12 +84,12 @@ static void __init cantiga_b3_errata_iniu16 vid;u8 did_hi, rid; - vid =pci_conf_read16 (0 ,IGD_DEV ,0 ,0 ); + vid =pci_conf_read16 (0 ,0 ,IGD_DEV ,0 ,0 );if ( vid !=0x8086 )return ; - did_hi =pci_conf_read8 (0 ,IGD_DEV ,0 ,3 ); - rid =pci_conf_read8 (0 ,IGD_DEV ,0 ,8 ); + did_hi =pci_conf_read8 (0 ,0 ,IGD_DEV ,0 ,3 ); + rid =pci_conf_read8 (0 ,0 ,IGD_DEV ,0 ,8 );if ( (did_hi ==0x2A ) && (rid ==0x7 ) ) is_cantiga_b3 =1 ;
@@ -125,8 +125,8 @@ static void __init map_igd_reg(void)return ;/* get IGD mmio address in PCI BAR */ - igd_mmio = ((u64 )pci_conf_read32 (0 ,IGD_DEV ,0 ,0x14 ) <<32 ) + -pci_conf_read32 (0 ,IGD_DEV ,0 ,0x10 ); + igd_mmio = ((u64 )pci_conf_read32 (0 ,0 ,IGD_DEV ,0 ,0x14 ) <<32 ) + +pci_conf_read32 (0 ,0 ,IGD_DEV ,0 ,0x10 );/* offset of IGD regster we want to access is in 0x2000 range */ igd_reg = (igd_mmio &IGD_BAR_MASK ) +0x2000 ;
@@ -251,8 +251,8 @@ void vtd_ops_postamble_quirk(struct iomm/* initialize platform identification flags */ void __init platform_quirks_init (void ) { - ioh_id =pci_conf_read32 (0 ,IOH_DEV ,0 ,0 ); - igd_id =pci_conf_read32 (0 ,IGD_DEV ,0 ,0 ); + ioh_id =pci_conf_read32 (0 ,0 ,IOH_DEV ,0 ,0 ); + igd_id =pci_conf_read32 (0 ,0 ,IGD_DEV ,0 ,0 );/* Mobile 4 Series Chipset neglects to set RWBF capability. */ if ( ioh_id ==0x2a408086 )
@@ -302,15 +302,15 @@ void me_wifi_quirk(struct domain *domain {u32 id; - id =pci_conf_read32 (0 ,0 ,0 ,0 ); + id =pci_conf_read32 (0 ,0 ,0 ,0 ,0 );if (IS_CTG (id) ) {/* quit if ME does not exist */ -if (pci_conf_read32 (0 ,3 ,0 ,0 ) ==0xffffffff ) +if (pci_conf_read32 (0 ,0 ,3 ,0 ,0 ) ==0xffffffff )return ;/* if device is WLAN device, map ME phantom device 0:3.7 */ - id =pci_conf_read32 (bus,PCI_SLOT (devfn),PCI_FUNC (devfn),0 ); + id =pci_conf_read32 (0 , bus,PCI_SLOT (devfn),PCI_FUNC (devfn),0 );switch (id) {case 0x42328086 :
@@ -330,11 +330,11 @@ void me_wifi_quirk(struct domain *domainelse if (IS_ILK (id) ||IS_CPT (id) ) {/* quit if ME does not exist */ -if (pci_conf_read32 (0 ,22 ,0 ,0 ) ==0xffffffff ) +if (pci_conf_read32 (0 ,0 ,22 ,0 ,0 ) ==0xffffffff )return ;/* if device is WLAN device, map ME phantom device 0:22.7 */ - id =pci_conf_read32 (bus,PCI_SLOT (devfn),PCI_FUNC (devfn),0 ); + id =pci_conf_read32 (0 , bus,PCI_SLOT (devfn),PCI_FUNC (devfn),0 );switch (id) {case 0x00878086 :/* Kilmer Peak */
@@ -364,16 +364,17 @@ void me_wifi_quirk(struct domain *domainvoid __init pci_vtd_quirk (struct pci_dev *pdev) {#ifdef CONFIG_X86_64 +int seg = pdev->seg;int bus = pdev->bus;int dev =PCI_SLOT (pdev->devfn);int func =PCI_FUNC (pdev->devfn);int id, val; - id =pci_conf_read32 (bus, dev, func,0 ); + id =pci_conf_read32 (seg, bus, dev, func,0 );if ( id ==0x342e8086 || id ==0x3c288086 ) { - val =pci_conf_read32 (bus, dev, func,0x1AC ); -pci_conf_write32 (bus, dev, func,0x1AC , val | (1 <<31 )); + val =pci_conf_read32 (seg, bus, dev, func,0x1AC ); +pci_conf_write32 (seg, bus, dev, func,0x1AC , val | (1 <<31 )); }#endif }
xen/drivers/passthrough/vtd/utils.c +1 -1
@@ -34,7 +34,7 @@int is_usb_device (u16 seg,u8 bus,u8 devfn) { -u16 class =pci_conf_read16 (bus,PCI_SLOT (devfn),PCI_FUNC (devfn), +u16 class =pci_conf_read16 (seg, bus,PCI_SLOT (devfn),PCI_FUNC (devfn),PCI_CLASS_DEVICE );return (class ==0xc03 ); }
xen/drivers/passthrough/vtd/x86/ats.c +5 -7
@@ -135,8 +135,7 @@ int enable_ats_device(int seg, int bus,"%04x:%02x:%02x.%u: ATS capability found\n" , seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn)); -/* BUGBUG: add back seg when multi-seg platform support is enabled */ - value =pci_conf_read16 (bus,PCI_SLOT (devfn), + value =pci_conf_read16 (seg, bus,PCI_SLOT (devfn),PCI_FUNC (devfn), pos +ATS_REG_CTL );if ( value &ATS_ENABLE ) {
@@ -157,7 +156,7 @@ int enable_ats_device(int seg, int bus,if ( !(value &ATS_ENABLE ) ) { value |=ATS_ENABLE ; -pci_conf_write16 (bus,PCI_SLOT (devfn),PCI_FUNC (devfn), +pci_conf_write16 (seg, bus,PCI_SLOT (devfn),PCI_FUNC (devfn), pos +ATS_REG_CTL , value); }
@@ -166,7 +165,7 @@ int enable_ats_device(int seg, int bus, pdev->seg = seg; pdev->bus = bus; pdev->devfn = devfn; - value =pci_conf_read16 (bus,PCI_SLOT (devfn), + value =pci_conf_read16 (seg, bus,PCI_SLOT (devfn),PCI_FUNC (devfn), pos +ATS_REG_CAP ); pdev->ats_queue_depth = value &ATS_QUEUE_DEPTH_MASK ;list_add (&pdev->list, &ats_devices);
@@ -190,11 +189,10 @@ void disable_ats_device(int seg, int bus pos =pci_find_ext_capability (seg, bus, devfn,PCI_EXT_CAP_ID_ATS );BUG_ON (!pos); -/* BUGBUG: add back seg when multi-seg platform support is enabled */ - value =pci_conf_read16 (bus,PCI_SLOT (devfn), + value =pci_conf_read16 (seg, bus,PCI_SLOT (devfn),PCI_FUNC (devfn), pos +ATS_REG_CTL ); value &= ~ATS_ENABLE ; -pci_conf_write16 (bus,PCI_SLOT (devfn),PCI_FUNC (devfn), +pci_conf_write16 (seg, bus,PCI_SLOT (devfn),PCI_FUNC (devfn), pos +ATS_REG_CTL , value);list_for_each_entry ( pdev, &ats_devices, list )
xen/drivers/pci/pci.c +7 -7
@@ -7,25 +7,25 @@#include <xen/pci.h> #include <xen/pci_regs.h> -int pci_find_cap_offset (u8 bus,u8 dev,u8 func,u8 cap) +int pci_find_cap_offset (u16 seg,u8 bus,u8 dev,u8 func,u8 cap) {u8 id;int max_cap =48 ;u8 pos =PCI_CAPABILITY_LIST ;u16 status; - status =pci_conf_read16 (bus, dev, func,PCI_STATUS ); + status =pci_conf_read16 (seg, bus, dev, func,PCI_STATUS );if ( (status &PCI_STATUS_CAP_LIST ) ==0 )return 0 ;while ( max_cap-- ) { - pos =pci_conf_read8 (bus, dev, func, pos); + pos =pci_conf_read8 (seg, bus, dev, func, pos);if ( pos <0x40 )break ; pos &= ~3 ; - id =pci_conf_read8 (bus, dev, func, pos +PCI_CAP_LIST_ID ); + id =pci_conf_read8 (seg, bus, dev, func, pos +PCI_CAP_LIST_ID );if ( id ==0xff )break ;
@@ -38,19 +38,19 @@ int pci_find_cap_offset(u8 bus, u8 dev,return 0 ; } -int pci_find_next_cap (u8 bus,unsigned int devfn,u8 pos,int cap) +int pci_find_next_cap (u16 seg,u8 bus,unsigned int devfn,u8 pos,int cap) {u8 id;int ttl =48 ;while ( ttl-- ) { - pos =pci_conf_read8 (bus,PCI_SLOT (devfn),PCI_FUNC (devfn), pos); + pos =pci_conf_read8 (seg, bus,PCI_SLOT (devfn),PCI_FUNC (devfn), pos);if ( pos <0x40 )break ; pos &= ~3 ; - id =pci_conf_read8 (bus,PCI_SLOT (devfn),PCI_FUNC (devfn), + id =pci_conf_read8 (seg, bus,PCI_SLOT (devfn),PCI_FUNC (devfn), pos +PCI_CAP_LIST_ID );if ( id ==0xff )
xen/include/xen/pci.h +14 -11
@@ -102,28 +102,31 @@ struct pci_dev *pci_get_pdev_by_domain(void disconnect_pci_devices (void );uint8_t pci_conf_read8 ( -unsigned int bus,unsigned int dev,unsigned int func,unsigned int reg); +unsigned int seg,unsigned int bus,unsigned int dev,unsigned int func, +unsigned int reg);uint16_t pci_conf_read16 ( -unsigned int bus,unsigned int dev,unsigned int func,unsigned int reg); +unsigned int seg,unsigned int bus,unsigned int dev,unsigned int func, +unsigned int reg);uint32_t pci_conf_read32 ( -unsigned int bus,unsigned int dev,unsigned int func,unsigned int reg); +unsigned int seg,unsigned int bus,unsigned int dev,unsigned int func, +unsigned int reg);void pci_conf_write8 ( -unsigned int bus,unsigned int dev,unsigned int func,unsigned int reg, -uint8_t data); +unsigned int seg,unsigned int bus,unsigned int dev,unsigned int func, +unsigned int reg,uint8_t data);void pci_conf_write16 ( -unsigned int bus,unsigned int dev,unsigned int func,unsigned int reg, -uint16_t data); +unsigned int seg,unsigned int bus,unsigned int dev,unsigned int func, +unsigned int reg,uint16_t data);void pci_conf_write32 ( -unsigned int bus,unsigned int dev,unsigned int func,unsigned int reg, -uint32_t data); +unsigned int seg,unsigned int bus,unsigned int dev,unsigned int func, +unsigned int reg,uint32_t data);uint32_t pci_conf_read (uint32_t cf8,uint8_t offset,uint8_t bytes);void pci_conf_write (uint32_t cf8,uint8_t offset,uint8_t bytes,uint32_t data);int pci_mmcfg_read (unsigned int seg,unsigned int bus,unsigned int devfn,int reg,int len,u32 *value);int pci_mmcfg_write (unsigned int seg,unsigned int bus,unsigned int devfn,int reg,int len,u32 value); -int pci_find_cap_offset (u8 bus,u8 dev,u8 func,u8 cap); -int pci_find_next_cap (u8 bus,unsigned int devfn,u8 pos,int cap); +int pci_find_cap_offset (u16 seg,u8 bus,u8 dev,u8 func,u8 cap); +int pci_find_next_cap (u16 seg,u8 bus,unsigned int devfn,u8 pos,int cap);int pci_find_ext_capability (int seg,int bus,int devfn,int cap);struct pirq ;
Signed-off-by Jan Beulich <[email protected]>
xen/arch/x86/cpu/amd.c +3 -3
@@ -262,15 +262,15 @@ static void disable_c1_ramping(void)int node, nr_nodes;/* Read the number of nodes from the first Northbridge. */ - nr_nodes = ((pci_conf_read32 (0 ,0x18 ,0x0 ,0x60 )>>4 )&0x07 )+1 ; + nr_nodes = ((pci_conf_read32 (0 ,0 ,0x18 ,0x0 ,0x60 )>>4 )&0x07 )+1 ;for (node =0 ; node < nr_nodes; node++) {/* PMM7: bus=0, dev=0x18+node, function=0x3, register=0x87. */ - pmm7 =pci_conf_read8 (0 ,0x18 +node,0x3 ,0x87 ); + pmm7 =pci_conf_read8 (0 ,0 ,0x18 +node,0x3 ,0x87 );/* Invalid read means we've updated every Northbridge. */ if (pmm7 ==0xFF )break ; pmm7 &=0xFC ;/* clear pmm7[1:0] */ -pci_conf_write8 (0 ,0x18 +node,0x3 ,0x87 , pmm7); +pci_conf_write8 (0 ,0 ,0x18 +node,0x3 ,0x87 , pmm7);printk ("AMD: Disabling C1 Clock Ramping Node #%x\n" , node); } }
xen/arch/x86/dmi_scan.c +3 -3
@@ -284,15 +284,15 @@ static int __init ich10_bios_quirk(struc {u32 port, smictl; -if (pci_conf_read16 (0 ,0x1f ,0 ,PCI_VENDOR_ID ) !=0x8086 ) +if (pci_conf_read16 (0 ,0 ,0x1f ,0 ,PCI_VENDOR_ID ) !=0x8086 )return 0 ; -switch (pci_conf_read16 (0 ,0x1f ,0 ,PCI_DEVICE_ID ) ) { +switch (pci_conf_read16 (0 ,0 ,0x1f ,0 ,PCI_DEVICE_ID ) ) {case 0x3a14 :case 0x3a16 :case 0x3a18 :case 0x3a1a : - port = (pci_conf_read16 (0 ,0x1f ,0 ,0x40 ) &0xff80 ) +0x30 ; + port = (pci_conf_read16 (0 ,0 ,0x1f ,0 ,0x40 ) &0xff80 ) +0x30 ; smictl =inl (port);/* turn off LEGACY_USB{,2}_EN if enabled */ if ( smictl &0x20008 )
xen/arch/x86/msi.c +64 -52
336 lines not on this page · raw message
xen/arch/x86/oprofile/op_model_athlon.c +3 -3
@@ -470,7 +470,7 @@ static int __init init_ibs_nmi(void)for (bus =0 ; bus <256 ; bus++) {for (dev =0 ; dev <32 ; dev++) {for (func =0 ; func <8 ; func++) { - id =pci_conf_read32 (bus, dev, func,PCI_VENDOR_ID ); + id =pci_conf_read32 (0 , bus, dev, func,PCI_VENDOR_ID ); vendor_id = id &0xffff ; dev_id = (id >>16 ) &0xffff ;
@@ -478,10 +478,10 @@ static int __init init_ibs_nmi(void)if ((vendor_id ==PCI_VENDOR_ID_AMD ) && (dev_id ==PCI_DEVICE_ID_AMD_10H_NB_MISC )) { -pci_conf_write32 (bus, dev, func,IBSCTL , +pci_conf_write32 (0 , bus, dev, func,IBSCTL ,IBSCTL_LVTOFFSETVAL |APIC_EILVT_LVTOFF_IBS ); - value =pci_conf_read32 (bus, dev, func,IBSCTL ); + value =pci_conf_read32 (0 , bus, dev, func,IBSCTL );if (value != (IBSCTL_LVTOFFSETVAL |APIC_EILVT_LVTOFF_IBS )) {
xen/arch/x86/x86_32/pci.c +24 -9
@@ -12,46 +12,61 @@ (0x80000000 | (bus << 16) | (dev << 11) | (func << 8) | (reg & ~3))uint8_t pci_conf_read8 ( -unsigned int bus,unsigned int dev,unsigned int func,unsigned int reg) +unsigned int seg,unsigned int bus,unsigned int dev,unsigned int func, +unsigned int reg) { +if ( seg ) +return ~0 ;BUG_ON ((bus >255 ) || (dev >31 ) || (func >7 ) || (reg >255 ));return pci_conf_read (PCI_CONF_ADDRESS (bus, dev, func, reg), reg &3 ,1 ); }uint16_t pci_conf_read16 ( -unsigned int bus,unsigned int dev,unsigned int func,unsigned int reg) +unsigned int seg,unsigned int bus,unsigned int dev,unsigned int func, +unsigned int reg) { +if ( seg ) +return ~0 ;BUG_ON ((bus >255 ) || (dev >31 ) || (func >7 ) || (reg >255 ));return pci_conf_read (PCI_CONF_ADDRESS (bus, dev, func, reg), reg &2 ,2 ); }uint32_t pci_conf_read32 ( -unsigned int bus,unsigned int dev,unsigned int func,unsigned int reg) +unsigned int seg,unsigned int bus,unsigned int dev,unsigned int func, +unsigned int reg) { +if ( seg ) +return ~0 ;BUG_ON ((bus >255 ) || (dev >31 ) || (func >7 ) || (reg >255 ));return pci_conf_read (PCI_CONF_ADDRESS (bus, dev, func, reg),0 ,4 ); }void pci_conf_write8 ( -unsigned int bus,unsigned int dev,unsigned int func,unsigned int reg, -uint8_t data) +unsigned int seg,unsigned int bus,unsigned int dev,unsigned int func, +unsigned int reg,uint8_t data) { +if ( seg ) +return ;BUG_ON ((bus >255 ) || (dev >31 ) || (func >7 ) || (reg >255 ));pci_conf_write (PCI_CONF_ADDRESS (bus, dev, func, reg), reg &3 ,1 , data); }void pci_conf_write16 ( -unsigned int bus,unsigned int dev,unsigned int func,unsigned int reg, -uint16_t data) +unsigned int seg,unsigned int bus,unsigned int dev,unsigned int func, +unsigned int reg,uint16_t data) { +if ( seg ) +return ;BUG_ON ((bus >255 ) || (dev >31 ) || (func >7 ) || (reg >255 ));pci_conf_write (PCI_CONF_ADDRESS (bus, dev, func, reg), reg &2 ,2 , data); }void pci_conf_write32 ( -unsigned int bus,unsigned int dev,unsigned int func,unsigned int reg, -uint32_t data) +unsigned int seg,unsigned int bus,unsigned int dev,unsigned int func, +unsigned int reg,uint32_t data) { +if ( seg ) +return ;BUG_ON ((bus >255 ) || (dev >31 ) || (func >7 ) || (reg >255 ));pci_conf_write (PCI_CONF_ADDRESS (bus, dev, func, reg),0 ,4 , data); }
xen/arch/x86/x86_64/mmconf-fam10h.c +3 -3
@@ -51,7 +51,7 @@ static void __init get_fam10h_pci_mmconf bus = pci_probes[i].bus; slot = pci_probes[i].slot; - id =pci_conf_read32 (bus, slot,0 ,PCI_VENDOR_ID ); + id =pci_conf_read32 (0 , bus, slot,0 ,PCI_VENDOR_ID ); vendor = id &0xffff ; device = (id>>16 ) &0xffff ;
@@ -82,12 +82,12 @@ static void __init get_fam10h_pci_mmconf* above 4G */ for (hi_mmio_num = i =0 ; i <8 ; i++) { - val =pci_conf_read32 (bus, slot,1 ,0x80 + (i <<3 )); + val =pci_conf_read32 (0 , bus, slot,1 ,0x80 + (i <<3 ));if (!(val &3 ))continue ; start = (val &0xffffff00 ) <<8 ;/* 39:16 on 31:8*/ - val =pci_conf_read32 (bus, slot,1 ,0x84 + (i <<3 )); + val =pci_conf_read32 (0 , bus, slot,1 ,0x84 + (i <<3 )); end = ((val &0xffffff00 ) <<8 ) |0xffff ;/* 39:16 on 31:8*/ if (end < tom2)
xen/arch/x86/x86_64/mmconfig-shared.c +9 -9
@@ -50,7 +50,7 @@ custom_param("mmcfg", parse_mmcfg);static const char __init *pci_mmcfg_e7520 (void ) {u32 win; - win =pci_conf_read16 (0 ,0 ,0 ,0xce ); + win =pci_conf_read16 (0 ,0 ,0 ,0 ,0xce ); win = win &0xf000 ;if (win ==0x0000 || win ==0xf000 )
@@ -76,7 +76,7 @@ static const char __init *pci_mmcfg_inte pci_mmcfg_config_num =1 ; - pciexbar =pci_conf_read32 (0 ,0 ,0 ,0x48 ); + pciexbar =pci_conf_read32 (0 ,0 ,0 ,0 ,0x48 );/* Enable bit */ if (!(pciexbar &1 ))
@@ -201,14 +201,14 @@ static const char __init *pci_mmcfg_nvidu32 l, extcfg;u16 vendor, device; - l =pci_conf_read32 (bus,0 ,0 ,0 ); + l =pci_conf_read32 (0 , bus,0 ,0 ,0 ); vendor = l &0xffff ; device = (l >>16 ) &0xffff ;if (PCI_VENDOR_ID_NVIDIA != vendor ||0x0369 != device)continue ; - extcfg =pci_conf_read32 (bus,0 ,0 , extcfg_regnum); + extcfg =pci_conf_read32 (0 , bus,0 ,0 , extcfg_regnum);if (extcfg & extcfg_enable_mask) i++;
@@ -227,14 +227,14 @@ static const char __init *pci_mmcfg_nvidu16 vendor, device;int size_index; - l =pci_conf_read32 (bus,0 ,0 ,0 ); + l =pci_conf_read32 (0 , bus,0 ,0 ,0 ); vendor = l &0xffff ; device = (l >>16 ) &0xffff ;if (PCI_VENDOR_ID_NVIDIA != vendor ||0x0369 != device)continue ; - extcfg =pci_conf_read32 (bus,0 ,0 , extcfg_regnum); + extcfg =pci_conf_read32 (0 , bus,0 ,0 , extcfg_regnum);if (!(extcfg & extcfg_enable_mask))continue ;
@@ -300,7 +300,7 @@ static int __init pci_mmcfg_check_hostbrfor (i =0 ; !name && i <ARRAY_SIZE (pci_mmcfg_probes); i++) { bus = pci_mmcfg_probes[i].bus; devfn = pci_mmcfg_probes[i].devfn; - l =pci_conf_read32 (bus,PCI_SLOT (devfn),PCI_FUNC (devfn),0 ); + l =pci_conf_read32 (0 , bus,PCI_SLOT (devfn),PCI_FUNC (devfn),0 ); vendor = l &0xffff ; device = (l >>16 ) &0xffff ;
@@ -473,7 +473,7 @@ int pci_find_ext_capability(int seg, intint ttl =480 ;/* 3840 bytes, minimum 8 bytes per capability */ int pos =0x100 ; - header =pci_conf_read32 (bus,PCI_SLOT (devfn),PCI_FUNC (devfn), pos); + header =pci_conf_read32 (seg, bus,PCI_SLOT (devfn),PCI_FUNC (devfn), pos);/* * If we have no capabilities, this is indicated by cap ID,
@@ -488,7 +488,7 @@ int pci_find_ext_capability(int seg, int pos =PCI_EXT_CAP_NEXT (header);if ( pos <0x100 )break ; - header =pci_conf_read32 (bus,PCI_SLOT (devfn),PCI_FUNC (devfn), pos); + header =pci_conf_read32 (seg, bus,PCI_SLOT (devfn),PCI_FUNC (devfn), pos); }return 0 ; }
xen/arch/x86/x86_64/pci.c +24 -21
96 lines not on this page · raw message
xen/drivers/acpi/reboot.c +1 -1
@@ -24,7 +24,7 @@ void acpi_reboot(void)case ACPI_ADR_SPACE_PCI_CONFIG :printk ("Resetting with ACPI PCI RESET_REG.\n" );/* Write the value that resets us. */ - pci_conf_write8(0, + pci_conf_write8(0, 0, (rr->address >> 32) & 31, (rr->address >> 16) & 7, (rr->address & 255),
xen/drivers/char/ns16550.c +13 -12
@@ -221,12 +221,12 @@ static void pci_serial_early_init(structreturn ;if ( uart->pb_bdf_enable ) -pci_conf_write16 (uart->pb_bdf[0 ], uart->pb_bdf[1 ], uart->pb_bdf[2 ], +pci_conf_write16 (0 , uart->pb_bdf[0 ], uart->pb_bdf[1 ], uart->pb_bdf[2 ],0x1c , (uart->io_base &0xF000 ) | ((uart->io_base &0xF000 ) >>8 )); -pci_conf_write32 (uart->ps_bdf[0 ], uart->ps_bdf[1 ], uart->ps_bdf[2 ], +pci_conf_write32 (0 , uart->ps_bdf[0 ], uart->ps_bdf[1 ], uart->ps_bdf[2 ],0x10 , uart->io_base |0x1 ); -pci_conf_write16 (uart->ps_bdf[0 ], uart->ps_bdf[1 ], uart->ps_bdf[2 ], +pci_conf_write16 (0 , uart->ps_bdf[0 ], uart->ps_bdf[1 ], uart->ps_bdf[2 ],0x4 ,0x1 ); }
@@ -341,10 +341,10 @@ static void ns16550_suspend(struct seriaif ( uart->bar ) { uart->bar =pci_conf_read32 ( - uart->pb_bdf[0 ], uart->pb_bdf[1 ], uart->pb_bdf[2 ], +0 , uart->pb_bdf[0 ], uart->pb_bdf[1 ], uart->pb_bdf[2 ],PCI_BASE_ADDRESS_0 + uart->bar_idx*4 ); uart->cr =pci_conf_read32 ( - uart->pb_bdf[0 ], uart->pb_bdf[1 ], uart->pb_bdf[2 ], +0 , uart->pb_bdf[0 ], uart->pb_bdf[1 ], uart->pb_bdf[2 ],PCI_COMMAND ); } }
@@ -358,9 +358,9 @@ static void ns16550_resume(struct serialif ( uart->bar ) { -pci_conf_write32 (uart->pb_bdf[0 ], uart->pb_bdf[1 ], uart->pb_bdf[2 ], +pci_conf_write32 (0 , uart->pb_bdf[0 ], uart->pb_bdf[1 ], uart->pb_bdf[2 ],PCI_BASE_ADDRESS_0 + uart->bar_idx*4 , uart->bar); -pci_conf_write32 (uart->pb_bdf[0 ], uart->pb_bdf[1 ], uart->pb_bdf[2 ], +pci_conf_write32 (0 , uart->pb_bdf[0 ], uart->pb_bdf[1 ], uart->pb_bdf[2 ],PCI_COMMAND , uart->cr); } }
@@ -479,19 +479,20 @@ pci_uart_config (struct ns16550 *uart, i {for ( f =0 ; f <0x8 ; f++ ) { - class =pci_conf_read16 (b, d, f,PCI_CLASS_DEVICE ); + class =pci_conf_read16 (0 , b, d, f,PCI_CLASS_DEVICE );if ( class !=0x700 )continue ; - bar =pci_conf_read32 (b, d, f,PCI_BASE_ADDRESS_0 + bar_idx*4 ); + bar =pci_conf_read32 (0 , b, d, f, +PCI_BASE_ADDRESS_0 + bar_idx*4 );/* Not IO */ if ( !(bar &1 ) )continue ; -pci_conf_write32 (b, d, f,PCI_BASE_ADDRESS_0 , ~0u ); - len =pci_conf_read32 (b, d, f,PCI_BASE_ADDRESS_0 ); -pci_conf_write32 (b, d, f,PCI_BASE_ADDRESS_0 + bar_idx*4 , bar); +pci_conf_write32 (0 , b, d, f,PCI_BASE_ADDRESS_0 , ~0u ); + len =pci_conf_read32 (0 , b, d, f,PCI_BASE_ADDRESS_0 ); +pci_conf_write32 (0 , b, d, f,PCI_BASE_ADDRESS_0 + bar_idx*4 , bar);/* Not 8 bytes */ if ( (len &0xffff ) !=0xfff9 )
xen/drivers/passthrough/amd/iommu_detect.c +6 -6
@@ -35,14 +35,14 @@ static int __init get_iommu_msi_capabiliu16 control;int count =0 ; - cap_ptr =pci_conf_read8 (bus, dev, func, + cap_ptr =pci_conf_read8 (seg, bus, dev, func,PCI_CAPABILITY_LIST );while ( cap_ptr >=PCI_MIN_CAP_OFFSET && count <PCI_MAX_CAP_BLOCKS ) { cap_ptr &=PCI_CAP_PTR_MASK ; - cap_header =pci_conf_read32 (bus, dev, func, cap_ptr); + cap_header =pci_conf_read32 (seg, bus, dev, func, cap_ptr); cap_id =get_field_from_reg_u32 (cap_header,PCI_CAP_ID_MASK ,PCI_CAP_ID_SHIFT );
@@ -60,7 +60,7 @@ static int __init get_iommu_msi_capabilireturn -ENODEV ;AMD_IOMMU_DEBUG ("Found MSI capability block \n" ); - control =pci_conf_read16 (bus, dev, func, + control =pci_conf_read16 (seg, bus, dev, func, iommu->msi_cap +PCI_MSI_FLAGS ); iommu->maskbit = control &PCI_MSI_FLAGS_MASKBIT ;return 0 ;
@@ -71,18 +71,18 @@ static int __init get_iommu_capabilities {u32 cap_header, cap_range, misc_info; - cap_header =pci_conf_read32 (bus, dev, func, cap_ptr); + cap_header =pci_conf_read32 (seg, bus, dev, func, cap_ptr); iommu->revision =get_field_from_reg_u32 ( cap_header,PCI_CAP_REV_MASK ,PCI_CAP_REV_SHIFT ); iommu->pte_not_present_cached =get_field_from_reg_u32 ( cap_header,PCI_CAP_NP_CACHE_MASK ,PCI_CAP_NP_CACHE_SHIFT ); - cap_range =pci_conf_read32 (bus, dev, func, + cap_range =pci_conf_read32 (seg, bus, dev, func, cap_ptr +PCI_CAP_RANGE_OFFSET ); iommu->unit_id =get_field_from_reg_u32 ( cap_range,PCI_CAP_UNIT_ID_MASK ,PCI_CAP_UNIT_ID_SHIFT ); - misc_info =pci_conf_read32 (bus, dev, func, + misc_info =pci_conf_read32 (seg, bus, dev, func, cap_ptr +PCI_MISC_INFO_OFFSET ); iommu->msi_number =get_field_from_reg_u32 ( misc_info,PCI_CAP_MSI_NUMBER_MASK ,PCI_CAP_MSI_NUMBER_SHIFT );
xen/drivers/passthrough/amd/iommu_init.c +14 -12
@@ -269,7 +269,7 @@ static void set_iommu_event_log_control(writel (entry, iommu->mmio_base +IOMMU_CONTROL_MMIO_OFFSET ); } -static void parse_event_log_entry (u32 entry[]); +static void parse_event_log_entry (struct amd_iommu *,u32 entry[]);static int amd_iommu_read_event_log (struct amd_iommu *iommu) {
@@ -290,7 +290,7 @@ static int amd_iommu_read_event_log(stru (iommu->event_log_head * IOMMU_EVENT_LOG_ENTRY_SIZE)); -parse_event_log_entry (event_log); +parse_event_log_entry (iommu, event_log);if ( ++iommu->event_log_head == iommu->event_log.entries ) iommu->event_log_head =0 ;
@@ -351,6 +351,7 @@ static void iommu_msi_set_affinity(unsigstruct amd_iommu *iommu = irq_to_iommu[irq];struct irq_desc *desc =irq_to_desc (irq);struct irq_cfg *cfg = desc->chip_data; +u16 seg = iommu->seg;u8 bus = (iommu->bdf >>8 ) &0xff ;u8 dev =PCI_SLOT (iommu->bdf &0xff );u8 func =PCI_FUNC (iommu->bdf &0xff );
@@ -379,11 +380,11 @@ static void iommu_msi_set_affinity(unsigMSI_ADDR_REDIRECTION_LOWPRI ; msg.address_lo |=MSI_ADDR_DEST_ID (dest &0xff ); -pci_conf_write32 (bus, dev, func, +pci_conf_write32 (seg, bus, dev, func, iommu->msi_cap +PCI_MSI_DATA_64 , msg.data); -pci_conf_write32 (bus, dev, func, +pci_conf_write32 (seg, bus, dev, func, iommu->msi_cap +PCI_MSI_ADDRESS_LO , msg.address_lo); -pci_conf_write32 (bus, dev, func, +pci_conf_write32 (seg, bus, dev, func, iommu->msi_cap +PCI_MSI_ADDRESS_HI , msg.address_hi); }
@@ -395,12 +396,12 @@ static void amd_iommu_msi_enable(structint dev =PCI_SLOT (iommu->bdf &0xff );int func =PCI_FUNC (iommu->bdf &0xff ); - control =pci_conf_read16 (bus, dev, func, + control =pci_conf_read16 (iommu->seg, bus, dev, func, iommu->msi_cap +PCI_MSI_FLAGS ); control &= ~(1 );if ( flag ) control |= flag; -pci_conf_write16 (bus, dev, func, +pci_conf_write16 (iommu->seg, bus, dev, func, iommu->msi_cap +PCI_MSI_FLAGS , control); }
@@ -459,7 +460,7 @@ static hw_irq_controller iommu_msi_type .set_affinity = iommu_msi_set_affinity, }; -static void parse_event_log_entry (u32 entry[]) +static void parse_event_log_entry (struct amd_iommu *iommu,u32 entry[]) {u16 domain_id, device_id, bdf, cword;u32 code;
@@ -500,11 +501,12 @@ static void parse_event_log_entry(u32 en/* Tell the device to stop DMAing; we can't rely on the guest to * control it for us. */ for ( bdf =0 ; bdf < ivrs_bdf_entries; bdf++ ) -if (get_dma_requestor_id (bdf) == device_id ) +if (get_dma_requestor_id (iommu->seg, bdf) == device_id ) { - cword =pci_conf_read16 (PCI_BUS (bdf),PCI_SLOT (bdf), -PCI_FUNC (bdf),PCI_COMMAND ); -pci_conf_write16 (PCI_BUS (bdf),PCI_SLOT (bdf), + cword =pci_conf_read16 (iommu->seg,PCI_BUS (bdf), +PCI_SLOT (bdf),PCI_FUNC (bdf), +PCI_COMMAND ); +pci_conf_write16 (iommu->seg,PCI_BUS (bdf),PCI_SLOT (bdf),PCI_FUNC (bdf),PCI_COMMAND , cword & ~PCI_COMMAND_MASTER ); }
xen/drivers/passthrough/pci.c +24 -22
134 lines not on this page · raw message
xen/drivers/passthrough/vtd/dmar.c +6 -5
@@ -307,17 +307,18 @@ static int __init acpi_parse_dev_scope(while ( --depth >0 ) { - bus =pci_conf_read8 (bus, path->dev, path->fn,PCI_SECONDARY_BUS ); + bus =pci_conf_read8 (seg, bus, path->dev, path->fn, +PCI_SECONDARY_BUS ); path++; }switch ( acpi_scope->dev_type ) {case ACPI_DEV_P2PBRIDGE : - sec_bus =pci_conf_read8 ( - bus, path->dev, path->fn,PCI_SECONDARY_BUS ); - sub_bus =pci_conf_read8 ( - bus, path->dev, path->fn,PCI_SUBORDINATE_BUS ); + sec_bus =pci_conf_read8 (seg, bus, path->dev, path->fn, +PCI_SECONDARY_BUS ); + sub_bus =pci_conf_read8 (seg, bus, path->dev, path->fn, +PCI_SUBORDINATE_BUS );if ( iommu_verbose ) dprintk(VTDPREFIX, " bridge: %04x:%02x:%02x.%u start=%x sec=%x sub=%x\n",
xen/drivers/passthrough/vtd/iommu.c +5 -4
@@ -920,11 +920,12 @@ static void iommu_page_fault(int irq, vo/* Tell the device to stop DMAing; we can't rely on the guest to * control it for us. */ - cword =pci_conf_read16 (PCI_BUS (source_id),PCI_SLOT (source_id), + cword =pci_conf_read16 (iommu->intel->drhd->segment, +PCI_BUS (source_id),PCI_SLOT (source_id),PCI_FUNC (source_id),PCI_COMMAND ); -pci_conf_write16 (PCI_BUS (source_id),PCI_SLOT (source_id), -PCI_FUNC (source_id),PCI_COMMAND , - cword & ~PCI_COMMAND_MASTER ); +pci_conf_write16 (iommu->intel->drhd->segment,PCI_BUS (source_id), +PCI_SLOT (source_id),PCI_FUNC (source_id), +PCI_COMMAND , cword & ~PCI_COMMAND_MASTER ); fault_index++;if ( fault_index >cap_num_fault_regs (iommu->cap) )
xen/drivers/passthrough/vtd/quirks.c +17 -16
@@ -70,7 +70,7 @@ int is_igd_vt_enabled_quirk(void)return 1 ;/* integrated graphics on Intel platforms is located at 0:2.0 */ - ggc =pci_conf_read16 (0 ,IGD_DEV ,0 ,GGC ); + ggc =pci_conf_read16 (0 ,0 ,IGD_DEV ,0 ,GGC );return ( ggc &GGC_MEMORY_VT_ENABLED ?1 :0 ); }
@@ -84,12 +84,12 @@ static void __init cantiga_b3_errata_iniu16 vid;u8 did_hi, rid; - vid =pci_conf_read16 (0 ,IGD_DEV ,0 ,0 ); + vid =pci_conf_read16 (0 ,0 ,IGD_DEV ,0 ,0 );if ( vid !=0x8086 )return ; - did_hi =pci_conf_read8 (0 ,IGD_DEV ,0 ,3 ); - rid =pci_conf_read8 (0 ,IGD_DEV ,0 ,8 ); + did_hi =pci_conf_read8 (0 ,0 ,IGD_DEV ,0 ,3 ); + rid =pci_conf_read8 (0 ,0 ,IGD_DEV ,0 ,8 );if ( (did_hi ==0x2A ) && (rid ==0x7 ) ) is_cantiga_b3 =1 ;
@@ -125,8 +125,8 @@ static void __init map_igd_reg(void)return ;/* get IGD mmio address in PCI BAR */ - igd_mmio = ((u64 )pci_conf_read32 (0 ,IGD_DEV ,0 ,0x14 ) <<32 ) + -pci_conf_read32 (0 ,IGD_DEV ,0 ,0x10 ); + igd_mmio = ((u64 )pci_conf_read32 (0 ,0 ,IGD_DEV ,0 ,0x14 ) <<32 ) + +pci_conf_read32 (0 ,0 ,IGD_DEV ,0 ,0x10 );/* offset of IGD regster we want to access is in 0x2000 range */ igd_reg = (igd_mmio &IGD_BAR_MASK ) +0x2000 ;
@@ -251,8 +251,8 @@ void vtd_ops_postamble_quirk(struct iomm/* initialize platform identification flags */ void __init platform_quirks_init (void ) { - ioh_id =pci_conf_read32 (0 ,IOH_DEV ,0 ,0 ); - igd_id =pci_conf_read32 (0 ,IGD_DEV ,0 ,0 ); + ioh_id =pci_conf_read32 (0 ,0 ,IOH_DEV ,0 ,0 ); + igd_id =pci_conf_read32 (0 ,0 ,IGD_DEV ,0 ,0 );/* Mobile 4 Series Chipset neglects to set RWBF capability. */ if ( ioh_id ==0x2a408086 )
@@ -302,15 +302,15 @@ void me_wifi_quirk(struct domain *domain {u32 id; - id =pci_conf_read32 (0 ,0 ,0 ,0 ); + id =pci_conf_read32 (0 ,0 ,0 ,0 ,0 );if (IS_CTG (id) ) {/* quit if ME does not exist */ -if (pci_conf_read32 (0 ,3 ,0 ,0 ) ==0xffffffff ) +if (pci_conf_read32 (0 ,0 ,3 ,0 ,0 ) ==0xffffffff )return ;/* if device is WLAN device, map ME phantom device 0:3.7 */ - id =pci_conf_read32 (bus,PCI_SLOT (devfn),PCI_FUNC (devfn),0 ); + id =pci_conf_read32 (0 , bus,PCI_SLOT (devfn),PCI_FUNC (devfn),0 );switch (id) {case 0x42328086 :
@@ -330,11 +330,11 @@ void me_wifi_quirk(struct domain *domainelse if (IS_ILK (id) ||IS_CPT (id) ) {/* quit if ME does not exist */ -if (pci_conf_read32 (0 ,22 ,0 ,0 ) ==0xffffffff ) +if (pci_conf_read32 (0 ,0 ,22 ,0 ,0 ) ==0xffffffff )return ;/* if device is WLAN device, map ME phantom device 0:22.7 */ - id =pci_conf_read32 (bus,PCI_SLOT (devfn),PCI_FUNC (devfn),0 ); + id =pci_conf_read32 (0 , bus,PCI_SLOT (devfn),PCI_FUNC (devfn),0 );switch (id) {case 0x00878086 :/* Kilmer Peak */
@@ -364,16 +364,17 @@ void me_wifi_quirk(struct domain *domainvoid __init pci_vtd_quirk (struct pci_dev *pdev) {#ifdef CONFIG_X86_64 +int seg = pdev->seg;int bus = pdev->bus;int dev =PCI_SLOT (pdev->devfn);int func =PCI_FUNC (pdev->devfn);int id, val; - id =pci_conf_read32 (bus, dev, func,0 ); + id =pci_conf_read32 (seg, bus, dev, func,0 );if ( id ==0x342e8086 || id ==0x3c288086 ) { - val =pci_conf_read32 (bus, dev, func,0x1AC ); -pci_conf_write32 (bus, dev, func,0x1AC , val | (1 <<31 )); + val =pci_conf_read32 (seg, bus, dev, func,0x1AC ); +pci_conf_write32 (seg, bus, dev, func,0x1AC , val | (1 <<31 )); }#endif }
xen/drivers/passthrough/vtd/utils.c +1 -1
@@ -34,7 +34,7 @@int is_usb_device (u16 seg,u8 bus,u8 devfn) { -u16 class =pci_conf_read16 (bus,PCI_SLOT (devfn),PCI_FUNC (devfn), +u16 class =pci_conf_read16 (seg, bus,PCI_SLOT (devfn),PCI_FUNC (devfn),PCI_CLASS_DEVICE );return (class ==0xc03 ); }
xen/drivers/passthrough/vtd/x86/ats.c +5 -7
@@ -135,8 +135,7 @@ int enable_ats_device(int seg, int bus,"%04x:%02x:%02x.%u: ATS capability found\n" , seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn)); -/* BUGBUG: add back seg when multi-seg platform support is enabled */ - value =pci_conf_read16 (bus,PCI_SLOT (devfn), + value =pci_conf_read16 (seg, bus,PCI_SLOT (devfn),PCI_FUNC (devfn), pos +ATS_REG_CTL );if ( value &ATS_ENABLE ) {
@@ -157,7 +156,7 @@ int enable_ats_device(int seg, int bus,if ( !(value &ATS_ENABLE ) ) { value |=ATS_ENABLE ; -pci_conf_write16 (bus,PCI_SLOT (devfn),PCI_FUNC (devfn), +pci_conf_write16 (seg, bus,PCI_SLOT (devfn),PCI_FUNC (devfn), pos +ATS_REG_CTL , value); }
@@ -166,7 +165,7 @@ int enable_ats_device(int seg, int bus, pdev->seg = seg; pdev->bus = bus; pdev->devfn = devfn; - value =pci_conf_read16 (bus,PCI_SLOT (devfn), + value =pci_conf_read16 (seg, bus,PCI_SLOT (devfn),PCI_FUNC (devfn), pos +ATS_REG_CAP ); pdev->ats_queue_depth = value &ATS_QUEUE_DEPTH_MASK ;list_add (&pdev->list, &ats_devices);
@@ -190,11 +189,10 @@ void disable_ats_device(int seg, int bus pos =pci_find_ext_capability (seg, bus, devfn,PCI_EXT_CAP_ID_ATS );BUG_ON (!pos); -/* BUGBUG: add back seg when multi-seg platform support is enabled */ - value =pci_conf_read16 (bus,PCI_SLOT (devfn), + value =pci_conf_read16 (seg, bus,PCI_SLOT (devfn),PCI_FUNC (devfn), pos +ATS_REG_CTL ); value &= ~ATS_ENABLE ; -pci_conf_write16 (bus,PCI_SLOT (devfn),PCI_FUNC (devfn), +pci_conf_write16 (seg, bus,PCI_SLOT (devfn),PCI_FUNC (devfn), pos +ATS_REG_CTL , value);list_for_each_entry ( pdev, &ats_devices, list )
xen/drivers/pci/pci.c +7 -7
@@ -7,25 +7,25 @@#include <xen/pci.h> #include <xen/pci_regs.h> -int pci_find_cap_offset (u8 bus,u8 dev,u8 func,u8 cap) +int pci_find_cap_offset (u16 seg,u8 bus,u8 dev,u8 func,u8 cap) {u8 id;int max_cap =48 ;u8 pos =PCI_CAPABILITY_LIST ;u16 status; - status =pci_conf_read16 (bus, dev, func,PCI_STATUS ); + status =pci_conf_read16 (seg, bus, dev, func,PCI_STATUS );if ( (status &PCI_STATUS_CAP_LIST ) ==0 )return 0 ;while ( max_cap-- ) { - pos =pci_conf_read8 (bus, dev, func, pos); + pos =pci_conf_read8 (seg, bus, dev, func, pos);if ( pos <0x40 )break ; pos &= ~3 ; - id =pci_conf_read8 (bus, dev, func, pos +PCI_CAP_LIST_ID ); + id =pci_conf_read8 (seg, bus, dev, func, pos +PCI_CAP_LIST_ID );if ( id ==0xff )break ;
@@ -38,19 +38,19 @@ int pci_find_cap_offset(u8 bus, u8 dev,return 0 ; } -int pci_find_next_cap (u8 bus,unsigned int devfn,u8 pos,int cap) +int pci_find_next_cap (u16 seg,u8 bus,unsigned int devfn,u8 pos,int cap) {u8 id;int ttl =48 ;while ( ttl-- ) { - pos =pci_conf_read8 (bus,PCI_SLOT (devfn),PCI_FUNC (devfn), pos); + pos =pci_conf_read8 (seg, bus,PCI_SLOT (devfn),PCI_FUNC (devfn), pos);if ( pos <0x40 )break ; pos &= ~3 ; - id =pci_conf_read8 (bus,PCI_SLOT (devfn),PCI_FUNC (devfn), + id =pci_conf_read8 (seg, bus,PCI_SLOT (devfn),PCI_FUNC (devfn), pos +PCI_CAP_LIST_ID );if ( id ==0xff )
xen/include/xen/pci.h +14 -11
@@ -102,28 +102,31 @@ struct pci_dev *pci_get_pdev_by_domain(void disconnect_pci_devices (void );uint8_t pci_conf_read8 ( -unsigned int bus,unsigned int dev,unsigned int func,unsigned int reg); +unsigned int seg,unsigned int bus,unsigned int dev,unsigned int func, +unsigned int reg);uint16_t pci_conf_read16 ( -unsigned int bus,unsigned int dev,unsigned int func,unsigned int reg); +unsigned int seg,unsigned int bus,unsigned int dev,unsigned int func, +unsigned int reg);uint32_t pci_conf_read32 ( -unsigned int bus,unsigned int dev,unsigned int func,unsigned int reg); +unsigned int seg,unsigned int bus,unsigned int dev,unsigned int func, +unsigned int reg);void pci_conf_write8 ( -unsigned int bus,unsigned int dev,unsigned int func,unsigned int reg, -uint8_t data); +unsigned int seg,unsigned int bus,unsigned int dev,unsigned int func, +unsigned int reg,uint8_t data);void pci_conf_write16 ( -unsigned int bus,unsigned int dev,unsigned int func,unsigned int reg, -uint16_t data); +unsigned int seg,unsigned int bus,unsigned int dev,unsigned int func, +unsigned int reg,uint16_t data);void pci_conf_write32 ( -unsigned int bus,unsigned int dev,unsigned int func,unsigned int reg, -uint32_t data); +unsigned int seg,unsigned int bus,unsigned int dev,unsigned int func, +unsigned int reg,uint32_t data);uint32_t pci_conf_read (uint32_t cf8,uint8_t offset,uint8_t bytes);void pci_conf_write (uint32_t cf8,uint8_t offset,uint8_t bytes,uint32_t data);int pci_mmcfg_read (unsigned int seg,unsigned int bus,unsigned int devfn,int reg,int len,u32 *value);int pci_mmcfg_write (unsigned int seg,unsigned int bus,unsigned int devfn,int reg,int len,u32 value); -int pci_find_cap_offset (u8 bus,u8 dev,u8 func,u8 cap); -int pci_find_next_cap (u8 bus,unsigned int devfn,u8 pos,int cap); +int pci_find_cap_offset (u16 seg,u8 bus,u8 dev,u8 func,u8 cap); +int pci_find_next_cap (u16 seg,u8 bus,unsigned int devfn,u8 pos,int cap);int pci_find_ext_capability (int seg,int bus,int devfn,int cap);struct pirq ;
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel