xref: /freebsd/sys/amd64/vmm/amd/amdv.c (revision ff0ba87247820afbdfdc1b307c803f7923d0e4d3)
1 /*-
2  * Copyright (c) 2011 NetApp, Inc.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  *    notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  *    notice, this list of conditions and the following disclaimer in the
12  *    documentation and/or other materials provided with the distribution.
13  *
14  * THIS SOFTWARE IS PROVIDED BY NETAPP, INC ``AS IS'' AND
15  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17  * ARE DISCLAIMED.  IN NO EVENT SHALL NETAPP, INC OR CONTRIBUTORS BE LIABLE
18  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24  * SUCH DAMAGE.
25  *
26  * $FreeBSD$
27  */
28 
29 #include <sys/cdefs.h>
30 __FBSDID("$FreeBSD$");
31 
32 #include <sys/param.h>
33 #include <sys/systm.h>
34 #include <sys/errno.h>
35 #include <sys/smp.h>
36 
37 #include <machine/vmm.h>
38 #include "io/iommu.h"
39 
40 static int
41 amd_iommu_init(void)
42 {
43 
44 	printf("amd_iommu_init: not implemented\n");
45 	return (ENXIO);
46 }
47 
48 static void
49 amd_iommu_cleanup(void)
50 {
51 
52 	printf("amd_iommu_cleanup: not implemented\n");
53 }
54 
55 static void
56 amd_iommu_enable(void)
57 {
58 
59 	printf("amd_iommu_enable: not implemented\n");
60 }
61 
62 static void
63 amd_iommu_disable(void)
64 {
65 
66 	printf("amd_iommu_disable: not implemented\n");
67 }
68 
69 static void *
70 amd_iommu_create_domain(vm_paddr_t maxaddr)
71 {
72 
73 	printf("amd_iommu_create_domain: not implemented\n");
74 	return (NULL);
75 }
76 
77 static void
78 amd_iommu_destroy_domain(void *domain)
79 {
80 
81 	printf("amd_iommu_destroy_domain: not implemented\n");
82 }
83 
84 static uint64_t
85 amd_iommu_create_mapping(void *domain, vm_paddr_t gpa, vm_paddr_t hpa,
86 			 uint64_t len)
87 {
88 
89 	printf("amd_iommu_create_mapping: not implemented\n");
90 	return (0);
91 }
92 
93 static uint64_t
94 amd_iommu_remove_mapping(void *domain, vm_paddr_t gpa, uint64_t len)
95 {
96 
97 	printf("amd_iommu_remove_mapping: not implemented\n");
98 	return (0);
99 }
100 
101 static void
102 amd_iommu_add_device(void *domain, uint16_t rid)
103 {
104 
105 	printf("amd_iommu_add_device: not implemented\n");
106 }
107 
108 static void
109 amd_iommu_remove_device(void *domain, uint16_t rid)
110 {
111 
112 	printf("amd_iommu_remove_device: not implemented\n");
113 }
114 
115 static void
116 amd_iommu_invalidate_tlb(void *domain)
117 {
118 
119 	printf("amd_iommu_invalidate_tlb: not implemented\n");
120 }
121 
122 struct iommu_ops iommu_ops_amd = {
123 	amd_iommu_init,
124 	amd_iommu_cleanup,
125 	amd_iommu_enable,
126 	amd_iommu_disable,
127 	amd_iommu_create_domain,
128 	amd_iommu_destroy_domain,
129 	amd_iommu_create_mapping,
130 	amd_iommu_remove_mapping,
131 	amd_iommu_add_device,
132 	amd_iommu_remove_device,
133 	amd_iommu_invalidate_tlb,
134 };
135