ia64/xen-unstable

view xen/arch/x86/hvm/vmx/vtd/extern.h @ 16875:74a9bfccddba

vt-d: Do FLR of assigned devices with VT-d

Currently there is a pdev_flr() function to do FLR before device
assignment in qemu, but most of devices don't have FLR capability.
What's more, should do FLR before assignment and deassignment for
keeping correct device status. If the device doesn't have FLR
capablility, this patch implemented to enter D3hot and return to D0 to
do FLR. And exposed pdev_flr() in VT-d utils, then it can be invoked
by assignment and deassignment functions.

Signed-off-by: Weidong Han <weidong.han@intel.com>
Signed-off-by: Anthony Xu <anthony.xu@intel.com>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Jan 24 14:39:38 2008 +0000 (2008-01-24)
parents cc5bb500df5f
children faefbf2c4840
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"
26 extern int iommu_setup_done;
27 extern int vtd2_thurley_enabled;
28 extern int vtd2_qinval_enabled;
30 extern spinlock_t ioapic_lock;
31 extern struct qi_ctrl *qi_ctrl;
32 extern struct ir_ctrl *ir_ctrl;
34 void print_iommu_regs(struct acpi_drhd_unit *drhd);
35 void print_vtd_entries(struct domain *d, struct iommu *iommu,
36 int bus, int devfn, unsigned long gmfn);
37 void pdev_flr(u8 bus, u8 devfn);
39 int qinval_setup(struct iommu *iommu);
40 int queue_invalidate_context(struct iommu *iommu,
41 u16 did, u16 source_id, u8 function_mask, u8 granu);
42 int queue_invalidate_iotlb(struct iommu *iommu,
43 u8 granu, u8 dr, u8 dw, u16 did, u8 am, u8 ih, u64 addr);
44 int queue_invalidate_iec(struct iommu *iommu,
45 u8 granu, u8 im, u16 iidx);
46 int invalidate_sync(struct iommu *iommu);
47 int iommu_flush_iec_global(struct iommu *iommu);
48 int iommu_flush_iec_index(struct iommu *iommu, u8 im, u16 iidx);
49 void gsi_remapping(unsigned int gsi);
50 void print_iommu_regs(struct acpi_drhd_unit *drhd);
51 int vtd_hw_check(void);
52 struct iommu * ioapic_to_iommu(unsigned int apic_id);
53 struct acpi_drhd_unit * ioapic_to_drhd(unsigned int apic_id);
54 void clear_fault_bits(struct iommu *iommu);
56 #endif // _VTD_EXTERN_H_