hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/include/linux/amd-iommu.h
....@@ -1,20 +1,8 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * Copyright (C) 2007-2010 Advanced Micro Devices, Inc.
34 * Author: Joerg Roedel <joerg.roedel@amd.com>
45 * Leo Duran <leo.duran@amd.com>
5
- *
6
- * This program is free software; you can redistribute it and/or modify it
7
- * under the terms of the GNU General Public License version 2 as published
8
- * by the Free Software Foundation.
9
- *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU General Public License for more details.
14
- *
15
- * You should have received a copy of the GNU General Public License
16
- * along with this program; if not, write to the Free Software
17
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
186 */
197
208 #ifndef _ASM_X86_AMD_IOMMU_H
....@@ -88,7 +76,7 @@
8876 *
8977 * The function returns 0 on success or a negative value on error.
9078 */
91
-extern int amd_iommu_bind_pasid(struct pci_dev *pdev, int pasid,
79
+extern int amd_iommu_bind_pasid(struct pci_dev *pdev, u32 pasid,
9280 struct task_struct *task);
9381
9482 /**
....@@ -100,7 +88,7 @@
10088 * When this function returns the device is no longer using the PASID
10189 * and the PASID is no longer bound to its task.
10290 */
103
-extern void amd_iommu_unbind_pasid(struct pci_dev *pdev, int pasid);
91
+extern void amd_iommu_unbind_pasid(struct pci_dev *pdev, u32 pasid);
10492
10593 /**
10694 * amd_iommu_set_invalid_ppr_cb() - Register a call-back for failed
....@@ -126,7 +114,7 @@
126114 #define AMD_IOMMU_INV_PRI_RSP_FAIL 2
127115
128116 typedef int (*amd_iommu_invalid_ppr_cb)(struct pci_dev *pdev,
129
- int pasid,
117
+ u32 pasid,
130118 unsigned long address,
131119 u16);
132120
....@@ -178,7 +166,7 @@
178166 * @cb: The call-back function
179167 */
180168
181
-typedef void (*amd_iommu_invalidate_ctx)(struct pci_dev *pdev, int pasid);
169
+typedef void (*amd_iommu_invalidate_ctx)(struct pci_dev *pdev, u32 pasid);
182170
183171 extern int amd_iommu_set_invalidate_ctx_cb(struct pci_dev *pdev,
184172 amd_iommu_invalidate_ctx cb);
....@@ -196,6 +184,9 @@
196184 extern int
197185 amd_iommu_update_ga(int cpu, bool is_run, void *data);
198186
187
+extern int amd_iommu_activate_guest_mode(void *data);
188
+extern int amd_iommu_deactivate_guest_mode(void *data);
189
+
199190 #else /* defined(CONFIG_AMD_IOMMU) && defined(CONFIG_IRQ_REMAP) */
200191
201192 static inline int
....@@ -210,6 +201,15 @@
210201 return 0;
211202 }
212203
204
+static inline int amd_iommu_activate_guest_mode(void *data)
205
+{
206
+ return 0;
207
+}
208
+
209
+static inline int amd_iommu_deactivate_guest_mode(void *data)
210
+{
211
+ return 0;
212
+}
213213 #endif /* defined(CONFIG_AMD_IOMMU) && defined(CONFIG_IRQ_REMAP) */
214214
215215 #endif /* _ASM_X86_AMD_IOMMU_H */