xref: /freebsd/sys/amd64/vmm/amd/amdv.c (revision c49761dd572ca667babda4253e14498c7161e21a)
1366f6083SPeter Grehan /*-
2*c49761ddSPedro F. Giffuni  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3*c49761ddSPedro 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  * $FreeBSD$
29366f6083SPeter Grehan  */
30366f6083SPeter Grehan 
31366f6083SPeter Grehan #include <sys/cdefs.h>
32366f6083SPeter Grehan __FBSDID("$FreeBSD$");
33366f6083SPeter Grehan 
34366f6083SPeter Grehan #include <sys/param.h>
35366f6083SPeter Grehan #include <sys/systm.h>
36366f6083SPeter Grehan #include <sys/errno.h>
37366f6083SPeter Grehan 
38366f6083SPeter Grehan #include <machine/vmm.h>
39366f6083SPeter Grehan #include "io/iommu.h"
40366f6083SPeter Grehan 
41366f6083SPeter Grehan static int
42366f6083SPeter Grehan amd_iommu_init(void)
43366f6083SPeter Grehan {
44366f6083SPeter Grehan 
45366f6083SPeter Grehan 	printf("amd_iommu_init: not implemented\n");
46366f6083SPeter Grehan 	return (ENXIO);
47366f6083SPeter Grehan }
48366f6083SPeter Grehan 
49366f6083SPeter Grehan static void
50366f6083SPeter Grehan amd_iommu_cleanup(void)
51366f6083SPeter Grehan {
52366f6083SPeter Grehan 
53366f6083SPeter Grehan 	printf("amd_iommu_cleanup: not implemented\n");
54366f6083SPeter Grehan }
55366f6083SPeter Grehan 
56366f6083SPeter Grehan static void
57366f6083SPeter Grehan amd_iommu_enable(void)
58366f6083SPeter Grehan {
59366f6083SPeter Grehan 
60366f6083SPeter Grehan 	printf("amd_iommu_enable: not implemented\n");
61366f6083SPeter Grehan }
62366f6083SPeter Grehan 
63366f6083SPeter Grehan static void
64366f6083SPeter Grehan amd_iommu_disable(void)
65366f6083SPeter Grehan {
66366f6083SPeter Grehan 
67366f6083SPeter Grehan 	printf("amd_iommu_disable: not implemented\n");
68366f6083SPeter Grehan }
69366f6083SPeter Grehan 
70366f6083SPeter Grehan static void *
71366f6083SPeter Grehan amd_iommu_create_domain(vm_paddr_t maxaddr)
72366f6083SPeter Grehan {
73366f6083SPeter Grehan 
74366f6083SPeter Grehan 	printf("amd_iommu_create_domain: not implemented\n");
75366f6083SPeter Grehan 	return (NULL);
76366f6083SPeter Grehan }
77366f6083SPeter Grehan 
78366f6083SPeter Grehan static void
79366f6083SPeter Grehan amd_iommu_destroy_domain(void *domain)
80366f6083SPeter Grehan {
81366f6083SPeter Grehan 
82366f6083SPeter Grehan 	printf("amd_iommu_destroy_domain: not implemented\n");
83366f6083SPeter Grehan }
84366f6083SPeter Grehan 
85366f6083SPeter Grehan static uint64_t
86366f6083SPeter Grehan amd_iommu_create_mapping(void *domain, vm_paddr_t gpa, vm_paddr_t hpa,
87366f6083SPeter Grehan 			 uint64_t len)
88366f6083SPeter Grehan {
89366f6083SPeter Grehan 
90366f6083SPeter Grehan 	printf("amd_iommu_create_mapping: not implemented\n");
91366f6083SPeter Grehan 	return (0);
92366f6083SPeter Grehan }
93366f6083SPeter Grehan 
947ce04d0aSNeel Natu static uint64_t
957ce04d0aSNeel Natu amd_iommu_remove_mapping(void *domain, vm_paddr_t gpa, uint64_t len)
967ce04d0aSNeel Natu {
977ce04d0aSNeel Natu 
987ce04d0aSNeel Natu 	printf("amd_iommu_remove_mapping: not implemented\n");
997ce04d0aSNeel Natu 	return (0);
1007ce04d0aSNeel Natu }
1017ce04d0aSNeel Natu 
102366f6083SPeter Grehan static void
103a8667250SRyan Stone amd_iommu_add_device(void *domain, uint16_t rid)
104366f6083SPeter Grehan {
105366f6083SPeter Grehan 
106366f6083SPeter Grehan 	printf("amd_iommu_add_device: not implemented\n");
107366f6083SPeter Grehan }
108366f6083SPeter Grehan 
109366f6083SPeter Grehan static void
110a8667250SRyan Stone amd_iommu_remove_device(void *domain, uint16_t rid)
111366f6083SPeter Grehan {
112366f6083SPeter Grehan 
113366f6083SPeter Grehan 	printf("amd_iommu_remove_device: not implemented\n");
114366f6083SPeter Grehan }
115366f6083SPeter Grehan 
1167ce04d0aSNeel Natu static void
1177ce04d0aSNeel Natu amd_iommu_invalidate_tlb(void *domain)
1187ce04d0aSNeel Natu {
1197ce04d0aSNeel Natu 
1207ce04d0aSNeel Natu 	printf("amd_iommu_invalidate_tlb: not implemented\n");
1217ce04d0aSNeel Natu }
1227ce04d0aSNeel Natu 
123366f6083SPeter Grehan struct iommu_ops iommu_ops_amd = {
124366f6083SPeter Grehan 	amd_iommu_init,
125366f6083SPeter Grehan 	amd_iommu_cleanup,
126366f6083SPeter Grehan 	amd_iommu_enable,
127366f6083SPeter Grehan 	amd_iommu_disable,
128366f6083SPeter Grehan 	amd_iommu_create_domain,
129366f6083SPeter Grehan 	amd_iommu_destroy_domain,
130366f6083SPeter Grehan 	amd_iommu_create_mapping,
1317ce04d0aSNeel Natu 	amd_iommu_remove_mapping,
132366f6083SPeter Grehan 	amd_iommu_add_device,
133366f6083SPeter Grehan 	amd_iommu_remove_device,
1347ce04d0aSNeel Natu 	amd_iommu_invalidate_tlb,
135366f6083SPeter Grehan };
136