Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
4c5478c9
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
4c5478c9
编写于
12月 03, 2008
作者:
J
Joerg Roedel
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
VT-d: adapt device attach and detach functions for IOMMU API
Signed-off-by:
N
Joerg Roedel
<
joerg.roedel@amd.com
>
上级
5d450806
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
15 addition
and
16 deletion
+15
-16
drivers/pci/intel-iommu.c
drivers/pci/intel-iommu.c
+15
-12
include/linux/intel-iommu.h
include/linux/intel-iommu.h
+0
-4
未找到文件。
drivers/pci/intel-iommu.c
浏览文件 @
4c5478c9
...
...
@@ -2992,9 +2992,11 @@ static void intel_iommu_domain_destroy(struct iommu_domain *domain)
vm_domain_exit
(
dmar_domain
);
}
int
intel_iommu_attach_device
(
struct
dmar
_domain
*
domain
,
struct
pci_dev
*
p
dev
)
static
int
intel_iommu_attach_device
(
struct
iommu
_domain
*
domain
,
struct
device
*
dev
)
{
struct
dmar_domain
*
dmar_domain
=
domain
->
priv
;
struct
pci_dev
*
pdev
=
to_pci_dev
(
dev
);
struct
intel_iommu
*
iommu
;
int
addr_width
;
u64
end
;
...
...
@@ -3006,7 +3008,7 @@ int intel_iommu_attach_device(struct dmar_domain *domain,
old_domain
=
find_domain
(
pdev
);
if
(
old_domain
)
{
if
(
domain
->
flags
&
DOMAIN_FLAG_VIRTUAL_MACHINE
)
if
(
d
mar_d
omain
->
flags
&
DOMAIN_FLAG_VIRTUAL_MACHINE
)
vm_domain_remove_one_dev_info
(
old_domain
,
pdev
);
else
domain_remove_dev_info
(
old_domain
);
...
...
@@ -3021,28 +3023,29 @@ int intel_iommu_attach_device(struct dmar_domain *domain,
addr_width
=
agaw_to_width
(
iommu
->
agaw
);
end
=
DOMAIN_MAX_ADDR
(
addr_width
);
end
=
end
&
VTD_PAGE_MASK
;
if
(
end
<
domain
->
max_addr
)
{
if
(
end
<
d
mar_d
omain
->
max_addr
)
{
printk
(
KERN_ERR
"%s: iommu agaw (%d) is not "
"sufficient for the mapped address (%llx)
\n
"
,
__func__
,
iommu
->
agaw
,
domain
->
max_addr
);
__func__
,
iommu
->
agaw
,
d
mar_d
omain
->
max_addr
);
return
-
EFAULT
;
}
ret
=
domain_context_mapping
(
domain
,
pdev
);
ret
=
domain_context_mapping
(
d
mar_d
omain
,
pdev
);
if
(
ret
)
return
ret
;
ret
=
vm_domain_add_dev_info
(
domain
,
pdev
);
ret
=
vm_domain_add_dev_info
(
d
mar_d
omain
,
pdev
);
return
ret
;
}
EXPORT_SYMBOL_GPL
(
intel_iommu_attach_device
);
void
intel_iommu_detach_device
(
struct
dmar
_domain
*
domain
,
struct
pci_dev
*
p
dev
)
static
void
intel_iommu_detach_device
(
struct
iommu
_domain
*
domain
,
struct
device
*
dev
)
{
vm_domain_remove_one_dev_info
(
domain
,
pdev
);
struct
dmar_domain
*
dmar_domain
=
domain
->
priv
;
struct
pci_dev
*
pdev
=
to_pci_dev
(
dev
);
vm_domain_remove_one_dev_info
(
dmar_domain
,
pdev
);
}
EXPORT_SYMBOL_GPL
(
intel_iommu_detach_device
);
int
intel_iommu_map_address
(
struct
dmar_domain
*
domain
,
dma_addr_t
iova
,
u64
hpa
,
size_t
size
,
int
prot
)
...
...
include/linux/intel-iommu.h
浏览文件 @
4c5478c9
...
...
@@ -330,10 +330,6 @@ extern int qi_flush_iotlb(struct intel_iommu *iommu, u16 did, u64 addr,
extern
void
qi_submit_sync
(
struct
qi_desc
*
desc
,
struct
intel_iommu
*
iommu
);
int
intel_iommu_attach_device
(
struct
dmar_domain
*
domain
,
struct
pci_dev
*
pdev
);
void
intel_iommu_detach_device
(
struct
dmar_domain
*
domain
,
struct
pci_dev
*
pdev
);
int
intel_iommu_map_address
(
struct
dmar_domain
*
domain
,
dma_addr_t
iova
,
u64
hpa
,
size_t
size
,
int
prot
);
void
intel_iommu_unmap_address
(
struct
dmar_domain
*
domain
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录