~ubuntu-branches/ubuntu/utopic/xen/utopic

« back to all changes in this revision

Viewing changes to xen/include/asm-x86/amd-iommu.h

  • Committer: Bazaar Package Importer
  • Author(s): Bastian Blank
  • Date: 2010-05-06 15:47:38 UTC
  • mto: (1.3.1) (15.1.1 sid) (4.1.1 experimental)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20100506154738-agoz0rlafrh1fnq7
Tags: upstream-4.0.0
ImportĀ upstreamĀ versionĀ 4.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
22
 
 
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>
 
28
 
 
29
#define iommu_found()           (!list_empty(&amd_iommu_head))
 
30
 
 
31
extern struct list_head amd_iommu_head;
 
32
 
 
33
struct table_struct {
 
34
    void *buffer;
 
35
    unsigned long entries;
 
36
    unsigned long alloc_size;
 
37
};
 
38
 
 
39
struct amd_iommu {
 
40
    struct list_head list;
 
41
    spinlock_t lock; /* protect iommu */
 
42
 
 
43
    u16 bdf;
 
44
    u8  cap_offset;
 
45
    u8  revision;
 
46
    u8  unit_id;
 
47
    u8  msi_number;
 
48
 
 
49
    u8 pte_not_present_cached;
 
50
    u8 ht_tunnel_support;
 
51
    u8 iotlb_support;
 
52
 
 
53
    u8 isochronous;
 
54
    u8 coherent;
 
55
    u8 res_pass_pw;
 
56
    u8 pass_pw;
 
57
    u8 ht_tunnel_enable;
 
58
 
 
59
    void *mmio_base;
 
60
    unsigned long mmio_base_phys;
 
61
 
 
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;
 
67
 
 
68
    int exclusion_enable;
 
69
    int exclusion_allow_all;
 
70
    uint64_t exclusion_base;
 
71
    uint64_t exclusion_limit;
 
72
 
 
73
    int msi_cap;
 
74
    int maskbit;
 
75
 
 
76
    int enabled;
 
77
    int irq;
 
78
};
 
79
 
 
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;
 
90
 
 
91
    /* per device interrupt remapping table */
 
92
    void *intremap_table;
 
93
    spinlock_t intremap_lock;
 
94
 
 
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 */