Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
gsplhtlxg
clone-Linux
提交
569e4f77
C
clone-Linux
项目概览
gsplhtlxg
/
clone-Linux
通知
2
Star
0
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
clone-Linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
569e4f77
编写于
10月 15, 2015
作者:
D
David Woodhouse
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
iommu/vt-d: Implement SVM_FLAG_PRIVATE_PASID to allocate unique PASIDs
Signed-off-by:
N
David Woodhouse
<
David.Woodhouse@intel.com
>
上级
0204a496
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
16 addition
and
2 deletion
+16
-2
drivers/iommu/intel-svm.c
drivers/iommu/intel-svm.c
+4
-2
include/linux/intel-iommu.h
include/linux/intel-iommu.h
+1
-0
include/linux/intel-svm.h
include/linux/intel-svm.h
+11
-0
未找到文件。
drivers/iommu/intel-svm.c
浏览文件 @
569e4f77
...
...
@@ -285,11 +285,12 @@ int intel_svm_bind_mm(struct device *dev, int *pasid, int flags, struct svm_dev_
pasid_max
=
1
<<
20
;
mutex_lock
(
&
pasid_mutex
);
if
(
pasid
)
{
if
(
pasid
&&
!
(
flags
&
SVM_FLAG_PRIVATE_PASID
)
)
{
int
i
;
idr_for_each_entry
(
&
iommu
->
pasid_idr
,
svm
,
i
)
{
if
(
svm
->
mm
!=
current
->
mm
)
if
(
svm
->
mm
!=
current
->
mm
||
(
svm
->
flags
&
SVM_FLAG_PRIVATE_PASID
))
continue
;
if
(
svm
->
pasid
>=
pasid_max
)
{
...
...
@@ -355,6 +356,7 @@ int intel_svm_bind_mm(struct device *dev, int *pasid, int flags, struct svm_dev_
svm
->
pasid
=
ret
;
svm
->
notifier
.
ops
=
&
intel_mmuops
;
svm
->
mm
=
get_task_mm
(
current
);
svm
->
flags
=
flags
;
INIT_LIST_HEAD_RCU
(
&
svm
->
devs
);
ret
=
-
ENOMEM
;
if
(
!
svm
->
mm
||
(
ret
=
mmu_notifier_register
(
&
svm
->
notifier
,
svm
->
mm
)))
{
...
...
include/linux/intel-iommu.h
浏览文件 @
569e4f77
...
...
@@ -489,6 +489,7 @@ struct intel_svm {
struct
mmu_notifier
notifier
;
struct
mm_struct
*
mm
;
struct
intel_iommu
*
iommu
;
int
flags
;
int
pasid
;
struct
list_head
devs
;
};
...
...
include/linux/intel-svm.h
浏览文件 @
569e4f77
...
...
@@ -31,6 +31,17 @@ struct svm_dev_ops {
#define SVM_REQ_EXEC (1<<1)
#define SVM_REQ_PRIV (1<<0)
/*
* The SVM_FLAG_PRIVATE_PASID flag requests a PASID which is *not* the "main"
* PASID for the current process. Even if a PASID already exists, a new one
* will be allocated. And the PASID allocated with SVM_FLAG_PRIVATE_PASID
* will not be given to subsequent callers. This facility allows a driver to
* disambiguate between multiple device contexts which access the same MM,
* if there is no other way to do so. It should be used sparingly, if at all.
*/
#define SVM_FLAG_PRIVATE_PASID (1<<0)
/**
* intel_svm_bind_mm() - Bind the current process to a PASID
* @dev: Device to be granted acccess
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录