ia64/xen-unstable

view xen/drivers/passthrough/vtd/vtd.h @ 19810:aa472909b39c

vtd: IO NUMA support

This patch adds VT-d RHSA processing for IO NUMA support. The basic
idea is to parse ACPI RHSA structure to obtain VT-d HW to proximity
domain mapping. This mapping is then used when allocating pages for
Vt-d HW data structures.

Signed-off-by: Allen Kay <allen.m.kay@intel.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Jun 23 11:14:24 2009 +0100 (2009-06-23)
parents 1eb6afcad849
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_H_
22 #define _VTD_H_
24 #include <xen/iommu.h>
26 /* Accomodate both IOAPIC and IOSAPIC. */
27 struct IO_xAPIC_route_entry {
28 __u32 vector : 8,
29 delivery_mode : 3, /* 000: FIXED
30 * 001: lowest prio
31 * 111: ExtINT
32 */
33 dest_mode : 1, /* 0: physical, 1: logical */
34 delivery_status : 1,
35 polarity : 1,
36 irr : 1,
37 trigger : 1, /* 0: edge, 1: level */
38 mask : 1, /* 0: enabled, 1: disabled */
39 __reserved_2 : 15;
41 union {
42 struct { __u32
43 __reserved_1 : 24,
44 physical_dest : 4,
45 __reserved_2 : 4;
46 } physical;
48 struct { __u32
49 __reserved_1 : 24,
50 logical_dest : 8;
51 } logical;
53 #ifdef __ia64__
54 struct { __u32
55 __reserved_1 : 16,
56 dest_id : 16;
57 };
58 #endif
59 } dest;
61 } __attribute__ ((packed));
63 struct IO_APIC_route_remap_entry {
64 union {
65 u64 val;
66 struct {
67 u64 vector:8,
68 delivery_mode:3,
69 index_15:1,
70 delivery_status:1,
71 polarity:1,
72 irr:1,
73 trigger:1,
74 mask:1,
75 reserved:31,
76 format:1,
77 index_0_14:15;
78 };
79 };
80 };
82 struct msi_msg_remap_entry {
83 union {
84 u32 val;
85 struct {
86 u32 dontcare:2,
87 index_15:1,
88 SHV:1,
89 format:1,
90 index_0_14:15,
91 addr_id_val:12; /* Interrupt address identifier value,
92 must be 0FEEh */
93 };
94 } address_lo; /* low 32 bits of msi message address */
96 u32 address_hi; /* high 32 bits of msi message address */
97 u32 data; /* msi message data */
98 };
100 unsigned int get_cache_line_size(void);
101 void cacheline_flush(char *);
102 void flush_all_cache(void);
103 void *map_to_nocache_virt(int nr_iommus, u64 maddr);
104 u64 alloc_pgtable_maddr(struct acpi_drhd_unit *drhd, unsigned long npages);
105 void free_pgtable_maddr(u64 maddr);
106 void *map_vtd_domain_page(u64 maddr);
107 void unmap_vtd_domain_page(void *va);
109 void iommu_flush_cache_entry(void *addr);
110 void iommu_flush_cache_page(void *addr, unsigned long npages);
112 #endif // _VTD_H_