debuggers.hg

view xen/drivers/passthrough/vtd/extern.h @ 22795:93e7bf0e1845

vt-d: quirks for Sandybridge errata workaround, WLAN, VT-d fault escalation

Adding errata workaround for newly released Sandybridge processor
graphics, additional WLAN device ID's for WLAN quirk, a quirk for
masking VT-d fault escalation to IOH HW that can cause system hangs on
some OEM hardware where the BIOS erroneously escalates VT-d faults to
the platform.

Signed-off-by: Allen Kay <allen.m.kay@intel.com>
author Allen Kay <allen.m.kay@intel.com>
date Fri Jan 14 08:11:46 2011 +0000 (2011-01-14)
parents e8acb9753ff1
children
line source
1 /*
2 * Copyright (c) 2006, Intel Corporation.
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License,
6 * version 2, as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License along with
14 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
15 * Place - Suite 330, Boston, MA 02111-1307 USA.
16 *
17 * Copyright (C) Allen Kay <allen.m.kay@intel.com>
18 * Copyright (C) Weidong Han <weidong.han@intel.com>
19 */
21 #ifndef _VTD_EXTERN_H_
22 #define _VTD_EXTERN_H_
24 #include "dmar.h"
25 #include <xen/keyhandler.h>
27 extern bool_t ats_enabled;
28 extern bool_t rwbf_quirk;
30 void print_iommu_regs(struct acpi_drhd_unit *drhd);
31 void print_vtd_entries(struct iommu *iommu, int bus, int devfn, u64 gmfn);
32 extern struct keyhandler dump_iommu_info_keyhandler;
34 int enable_qinval(struct iommu *iommu);
35 void disable_qinval(struct iommu *iommu);
36 int enable_intremap(struct iommu *iommu, int eim);
37 void disable_intremap(struct iommu *iommu);
39 void iommu_flush_cache_entry(void *addr, unsigned int size);
40 void iommu_flush_cache_page(void *addr, unsigned long npages);
41 int iommu_alloc(struct acpi_drhd_unit *drhd);
42 void iommu_free(struct acpi_drhd_unit *drhd);
44 int queue_invalidate_context(struct iommu *iommu,
45 u16 did, u16 source_id, u8 function_mask, u8 granu);
46 int queue_invalidate_iotlb(struct iommu *iommu,
47 u8 granu, u8 dr, u8 dw, u16 did, u8 am, u8 ih, u64 addr);
48 int queue_invalidate_iec(struct iommu *iommu,
49 u8 granu, u8 im, u16 iidx);
50 int invalidate_sync(struct iommu *iommu);
51 int iommu_flush_iec_global(struct iommu *iommu);
52 int iommu_flush_iec_index(struct iommu *iommu, u8 im, u16 iidx);
53 void clear_fault_bits(struct iommu *iommu);
55 struct iommu * ioapic_to_iommu(unsigned int apic_id);
56 struct acpi_drhd_unit * ioapic_to_drhd(unsigned int apic_id);
57 struct acpi_drhd_unit * iommu_to_drhd(struct iommu *iommu);
58 struct acpi_rhsa_unit * drhd_to_rhsa(struct acpi_drhd_unit *drhd);
59 struct acpi_drhd_unit * find_ats_dev_drhd(struct iommu *iommu);
61 int ats_device(int seg, int bus, int devfn);
62 int enable_ats_device(int seg, int bus, int devfn);
63 int disable_ats_device(int seg, int bus, int devfn);
64 int invalidate_ats_tcs(struct iommu *iommu);
66 int qinval_device_iotlb(struct iommu *iommu,
67 u32 max_invs_pend, u16 sid, u16 size, u64 addr);
68 int dev_invalidate_iotlb(struct iommu *iommu, u16 did,
69 u64 addr, unsigned int size_order, u64 type);
71 unsigned int get_cache_line_size(void);
72 void cacheline_flush(char *);
73 void flush_all_cache(void);
75 u64 alloc_pgtable_maddr(struct acpi_drhd_unit *drhd, unsigned long npages);
76 void free_pgtable_maddr(u64 maddr);
77 void *map_vtd_domain_page(u64 maddr);
78 void unmap_vtd_domain_page(void *va);
79 int domain_context_mapping_one(struct domain *domain, struct iommu *iommu,
80 u8 bus, u8 devfn);
81 int domain_context_unmap_one(struct domain *domain, struct iommu *iommu,
82 u8 bus, u8 devfn);
84 int is_igd_vt_enabled_quirk(void);
85 void __init platform_quirks_init(void);
86 void vtd_ops_preamble_quirk(struct iommu* iommu);
87 void vtd_ops_postamble_quirk(struct iommu* iommu);
88 void me_wifi_quirk(struct domain *domain, u8 bus, u8 devfn, int map);
89 void pci_vtd_quirk(struct pci_dev *pdev);
91 #endif // _VTD_EXTERN_H_