xref: /freebsd/sys/amd64/vmm/amd/amdv.c (revision fdafd315ad0d0f28a11b9fb4476a9ab059c62b92)
1366f6083SPeter Grehan /*-
2*4d846d26SWarner Losh  * SPDX-License-Identifier: BSD-2-Clause
3c49761ddSPedro F. Giffuni  *
4366f6083SPeter Grehan  * Copyright (c) 2011 NetApp, Inc.
5366f6083SPeter Grehan  * All rights reserved.
6366f6083SPeter Grehan  *
7366f6083SPeter Grehan  * Redistribution and use in source and binary forms, with or without
8366f6083SPeter Grehan  * modification, are permitted provided that the following conditions
9366f6083SPeter Grehan  * are met:
10366f6083SPeter Grehan  * 1. Redistributions of source code must retain the above copyright
11366f6083SPeter Grehan  *    notice, this list of conditions and the following disclaimer.
12366f6083SPeter Grehan  * 2. Redistributions in binary form must reproduce the above copyright
13366f6083SPeter Grehan  *    notice, this list of conditions and the following disclaimer in the
14366f6083SPeter Grehan  *    documentation and/or other materials provided with the distribution.
15366f6083SPeter Grehan  *
16366f6083SPeter Grehan  * THIS SOFTWARE IS PROVIDED BY NETAPP, INC ``AS IS'' AND
17366f6083SPeter Grehan  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18366f6083SPeter Grehan  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19366f6083SPeter Grehan  * ARE DISCLAIMED.  IN NO EVENT SHALL NETAPP, INC OR CONTRIBUTORS BE LIABLE
20366f6083SPeter Grehan  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21366f6083SPeter Grehan  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22366f6083SPeter Grehan  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23366f6083SPeter Grehan  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24366f6083SPeter Grehan  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25366f6083SPeter Grehan  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26366f6083SPeter Grehan  * SUCH DAMAGE.
27366f6083SPeter Grehan  */
28366f6083SPeter Grehan 
29366f6083SPeter Grehan #include <sys/param.h>
30366f6083SPeter Grehan #include <sys/systm.h>
31366f6083SPeter Grehan #include <sys/errno.h>
32366f6083SPeter Grehan 
33366f6083SPeter Grehan #include <machine/vmm.h>
34366f6083SPeter Grehan #include "io/iommu.h"
35366f6083SPeter Grehan 
36366f6083SPeter Grehan static int
amd_iommu_init(void)37366f6083SPeter Grehan amd_iommu_init(void)
38366f6083SPeter Grehan {
39366f6083SPeter Grehan 
40366f6083SPeter Grehan 	printf("amd_iommu_init: not implemented\n");
41366f6083SPeter Grehan 	return (ENXIO);
42366f6083SPeter Grehan }
43366f6083SPeter Grehan 
44366f6083SPeter Grehan static void
amd_iommu_cleanup(void)45366f6083SPeter Grehan amd_iommu_cleanup(void)
46366f6083SPeter Grehan {
47366f6083SPeter Grehan 
48366f6083SPeter Grehan 	printf("amd_iommu_cleanup: not implemented\n");
49366f6083SPeter Grehan }
50366f6083SPeter Grehan 
51366f6083SPeter Grehan static void
amd_iommu_enable(void)52366f6083SPeter Grehan amd_iommu_enable(void)
53366f6083SPeter Grehan {
54366f6083SPeter Grehan 
55366f6083SPeter Grehan 	printf("amd_iommu_enable: not implemented\n");
56366f6083SPeter Grehan }
57366f6083SPeter Grehan 
58366f6083SPeter Grehan static void
amd_iommu_disable(void)59366f6083SPeter Grehan amd_iommu_disable(void)
60366f6083SPeter Grehan {
61366f6083SPeter Grehan 
62366f6083SPeter Grehan 	printf("amd_iommu_disable: not implemented\n");
63366f6083SPeter Grehan }
64366f6083SPeter Grehan 
65366f6083SPeter Grehan static void *
amd_iommu_create_domain(vm_paddr_t maxaddr)66366f6083SPeter Grehan amd_iommu_create_domain(vm_paddr_t maxaddr)
67366f6083SPeter Grehan {
68366f6083SPeter Grehan 
69366f6083SPeter Grehan 	printf("amd_iommu_create_domain: not implemented\n");
70366f6083SPeter Grehan 	return (NULL);
71366f6083SPeter Grehan }
72366f6083SPeter Grehan 
73366f6083SPeter Grehan static void
amd_iommu_destroy_domain(void * domain)74366f6083SPeter Grehan amd_iommu_destroy_domain(void *domain)
75366f6083SPeter Grehan {
76366f6083SPeter Grehan 
77366f6083SPeter Grehan 	printf("amd_iommu_destroy_domain: not implemented\n");
78366f6083SPeter Grehan }
79366f6083SPeter Grehan 
80366f6083SPeter Grehan static uint64_t
amd_iommu_create_mapping(void * domain,vm_paddr_t gpa,vm_paddr_t hpa,uint64_t len)81366f6083SPeter Grehan amd_iommu_create_mapping(void *domain, vm_paddr_t gpa, vm_paddr_t hpa,
82366f6083SPeter Grehan 			 uint64_t len)
83366f6083SPeter Grehan {
84366f6083SPeter Grehan 
85366f6083SPeter Grehan 	printf("amd_iommu_create_mapping: not implemented\n");
86366f6083SPeter Grehan 	return (0);
87366f6083SPeter Grehan }
88366f6083SPeter Grehan 
897ce04d0aSNeel Natu static uint64_t
amd_iommu_remove_mapping(void * domain,vm_paddr_t gpa,uint64_t len)907ce04d0aSNeel Natu amd_iommu_remove_mapping(void *domain, vm_paddr_t gpa, uint64_t len)
917ce04d0aSNeel Natu {
927ce04d0aSNeel Natu 
937ce04d0aSNeel Natu 	printf("amd_iommu_remove_mapping: not implemented\n");
947ce04d0aSNeel Natu 	return (0);
957ce04d0aSNeel Natu }
967ce04d0aSNeel Natu 
97366f6083SPeter Grehan static void
amd_iommu_add_device(void * domain,uint16_t rid)98a8667250SRyan Stone amd_iommu_add_device(void *domain, uint16_t rid)
99366f6083SPeter Grehan {
100366f6083SPeter Grehan 
101366f6083SPeter Grehan 	printf("amd_iommu_add_device: not implemented\n");
102366f6083SPeter Grehan }
103366f6083SPeter Grehan 
104366f6083SPeter Grehan static void
amd_iommu_remove_device(void * domain,uint16_t rid)105a8667250SRyan Stone amd_iommu_remove_device(void *domain, uint16_t rid)
106366f6083SPeter Grehan {
107366f6083SPeter Grehan 
108366f6083SPeter Grehan 	printf("amd_iommu_remove_device: not implemented\n");
109366f6083SPeter Grehan }
110366f6083SPeter Grehan 
1117ce04d0aSNeel Natu static void
amd_iommu_invalidate_tlb(void * domain)1127ce04d0aSNeel Natu amd_iommu_invalidate_tlb(void *domain)
1137ce04d0aSNeel Natu {
1147ce04d0aSNeel Natu 
1157ce04d0aSNeel Natu 	printf("amd_iommu_invalidate_tlb: not implemented\n");
1167ce04d0aSNeel Natu }
1177ce04d0aSNeel Natu 
118366f6083SPeter Grehan struct iommu_ops iommu_ops_amd = {
119366f6083SPeter Grehan 	amd_iommu_init,
120366f6083SPeter Grehan 	amd_iommu_cleanup,
121366f6083SPeter Grehan 	amd_iommu_enable,
122366f6083SPeter Grehan 	amd_iommu_disable,
123366f6083SPeter Grehan 	amd_iommu_create_domain,
124366f6083SPeter Grehan 	amd_iommu_destroy_domain,
125366f6083SPeter Grehan 	amd_iommu_create_mapping,
1267ce04d0aSNeel Natu 	amd_iommu_remove_mapping,
127366f6083SPeter Grehan 	amd_iommu_add_device,
128366f6083SPeter Grehan 	amd_iommu_remove_device,
1297ce04d0aSNeel Natu 	amd_iommu_invalidate_tlb,
130366f6083SPeter Grehan };
131