.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
---|
1 | 2 | /* |
---|
2 | 3 | * Copyright (C) 2007-2010 Advanced Micro Devices, Inc. |
---|
3 | 4 | * Author: Joerg Roedel <joerg.roedel@amd.com> |
---|
4 | 5 | * 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 |
---|
18 | 6 | */ |
---|
19 | 7 | |
---|
20 | 8 | #ifndef _ASM_X86_AMD_IOMMU_H |
---|
.. | .. |
---|
88 | 76 | * |
---|
89 | 77 | * The function returns 0 on success or a negative value on error. |
---|
90 | 78 | */ |
---|
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, |
---|
92 | 80 | struct task_struct *task); |
---|
93 | 81 | |
---|
94 | 82 | /** |
---|
.. | .. |
---|
100 | 88 | * When this function returns the device is no longer using the PASID |
---|
101 | 89 | * and the PASID is no longer bound to its task. |
---|
102 | 90 | */ |
---|
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); |
---|
104 | 92 | |
---|
105 | 93 | /** |
---|
106 | 94 | * amd_iommu_set_invalid_ppr_cb() - Register a call-back for failed |
---|
.. | .. |
---|
126 | 114 | #define AMD_IOMMU_INV_PRI_RSP_FAIL 2 |
---|
127 | 115 | |
---|
128 | 116 | typedef int (*amd_iommu_invalid_ppr_cb)(struct pci_dev *pdev, |
---|
129 | | - int pasid, |
---|
| 117 | + u32 pasid, |
---|
130 | 118 | unsigned long address, |
---|
131 | 119 | u16); |
---|
132 | 120 | |
---|
.. | .. |
---|
178 | 166 | * @cb: The call-back function |
---|
179 | 167 | */ |
---|
180 | 168 | |
---|
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); |
---|
182 | 170 | |
---|
183 | 171 | extern int amd_iommu_set_invalidate_ctx_cb(struct pci_dev *pdev, |
---|
184 | 172 | amd_iommu_invalidate_ctx cb); |
---|
.. | .. |
---|
196 | 184 | extern int |
---|
197 | 185 | amd_iommu_update_ga(int cpu, bool is_run, void *data); |
---|
198 | 186 | |
---|
| 187 | +extern int amd_iommu_activate_guest_mode(void *data); |
---|
| 188 | +extern int amd_iommu_deactivate_guest_mode(void *data); |
---|
| 189 | + |
---|
199 | 190 | #else /* defined(CONFIG_AMD_IOMMU) && defined(CONFIG_IRQ_REMAP) */ |
---|
200 | 191 | |
---|
201 | 192 | static inline int |
---|
.. | .. |
---|
210 | 201 | return 0; |
---|
211 | 202 | } |
---|
212 | 203 | |
---|
| 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 | +} |
---|
213 | 213 | #endif /* defined(CONFIG_AMD_IOMMU) && defined(CONFIG_IRQ_REMAP) */ |
---|
214 | 214 | |
---|
215 | 215 | #endif /* _ASM_X86_AMD_IOMMU_H */ |
---|