debuggers.hg

view xen/include/asm-x86/amd-iommu.h @ 22855:1d1eec7e1fb4

xl: Perform minimal validation of virtual disk file while parsing config file

This patch performs some very basic validation on the virtual disk
file passed through the config file. This validation ensures that we
don't go too far with the initialization like spawn qemu and more
while there could be some potentially fundamental issues.

[ Patch fixed up to work with PHYSTYPE_EMPTY 22808:6ec61438713a -iwj ]

Signed-off-by: Kamala Narasimhan <kamala.narasimhan@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
author Kamala Narasimhan <kamala.narasimhan@gmail.com>
date Tue Jan 25 18:09:49 2011 +0000 (2011-01-25)
parents 30bfa1d8895d
children
line source
1 /*
2 * Copyright (C) 2007 Advanced Micro Devices, Inc.
3 * Author: Leo Duran <leo.duran@amd.com>
4 * Author: Wei Wang <wei.wang2@amd.com> - adapted to xen
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20 #ifndef _ASM_X86_64_AMD_IOMMU_H
21 #define _ASM_X86_64_AMD_IOMMU_H
23 #include <xen/init.h>
24 #include <xen/types.h>
25 #include <xen/list.h>
26 #include <xen/spinlock.h>
27 #include <asm/hvm/svm/amd-iommu-defs.h>
29 #define iommu_found() (!list_empty(&amd_iommu_head))
31 extern struct list_head amd_iommu_head;
33 struct table_struct {
34 void *buffer;
35 unsigned long entries;
36 unsigned long alloc_size;
37 };
39 struct amd_iommu {
40 struct list_head list;
41 spinlock_t lock; /* protect iommu */
43 u16 bdf;
44 u8 cap_offset;
45 u8 revision;
46 u8 unit_id;
47 u8 msi_number;
49 u8 pte_not_present_cached;
50 u8 ht_tunnel_support;
51 u8 iotlb_support;
53 u8 isochronous;
54 u8 coherent;
55 u8 res_pass_pw;
56 u8 pass_pw;
57 u8 ht_tunnel_enable;
59 void *mmio_base;
60 unsigned long mmio_base_phys;
62 struct table_struct dev_table;
63 struct table_struct cmd_buffer;
64 u32 cmd_buffer_tail;
65 struct table_struct event_log;
66 u32 event_log_head;
68 int exclusion_enable;
69 int exclusion_allow_all;
70 uint64_t exclusion_base;
71 uint64_t exclusion_limit;
73 int msi_cap;
74 int maskbit;
76 int enabled;
77 int irq;
78 };
80 struct ivrs_mappings {
81 u16 dte_requestor_id;
82 u8 dte_sys_mgt_enable;
83 u8 dte_allow_exclusion;
84 u8 unity_map_enable;
85 u8 write_permission;
86 u8 read_permission;
87 unsigned long addr_range_start;
88 unsigned long addr_range_length;
89 struct amd_iommu *iommu;
91 /* per device interrupt remapping table */
92 void *intremap_table;
93 spinlock_t intremap_lock;
95 /* interrupt remapping settings */
96 u8 dte_lint1_pass;
97 u8 dte_lint0_pass;
98 u8 dte_nmi_pass;
99 u8 dte_ext_int_pass;
100 u8 dte_init_pass;
101 };
102 #endif /* _ASM_X86_64_AMD_IOMMU_H */