Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
ed40356b
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
ed40356b
编写于
3月 07, 2014
作者:
D
David Woodhouse
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
iommu/vt-d: Add ACPI devices into dmaru->devices[] array
Signed-off-by:
N
David Woodhouse
<
David.Woodhouse@intel.com
>
上级
832bd858
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
75 addition
and
0 deletion
+75
-0
drivers/iommu/dmar.c
drivers/iommu/dmar.c
+75
-0
未找到文件。
drivers/iommu/dmar.c
浏览文件 @
ed40356b
...
...
@@ -612,6 +612,79 @@ dmar_find_matched_drhd_unit(struct pci_dev *dev)
return
dmaru
;
}
static
void
__init
dmar_acpi_insert_dev_scope
(
u8
device_number
,
struct
acpi_device
*
adev
)
{
struct
dmar_drhd_unit
*
dmaru
;
struct
acpi_dmar_hardware_unit
*
drhd
;
struct
acpi_dmar_device_scope
*
scope
;
struct
device
*
tmp
;
int
i
;
struct
acpi_dmar_pci_path
*
path
;
for_each_drhd_unit
(
dmaru
)
{
drhd
=
container_of
(
dmaru
->
hdr
,
struct
acpi_dmar_hardware_unit
,
header
);
for
(
scope
=
(
void
*
)(
drhd
+
1
);
(
unsigned
long
)
scope
<
((
unsigned
long
)
drhd
)
+
drhd
->
header
.
length
;
scope
=
((
void
*
)
scope
)
+
scope
->
length
)
{
if
(
scope
->
entry_type
!=
ACPI_DMAR_SCOPE_TYPE_ACPI
)
continue
;
if
(
scope
->
enumeration_id
!=
device_number
)
continue
;
path
=
(
void
*
)(
scope
+
1
);
pr_info
(
"ACPI device
\"
%s
\"
under DMAR at %llx as %02x:%02x.%d
\n
"
,
dev_name
(
&
adev
->
dev
),
dmaru
->
reg_base_addr
,
scope
->
bus
,
path
->
device
,
path
->
function
);
for_each_dev_scope
(
dmaru
->
devices
,
dmaru
->
devices_cnt
,
i
,
tmp
)
if
(
tmp
==
NULL
)
{
dmaru
->
devices
[
i
].
bus
=
scope
->
bus
;
dmaru
->
devices
[
i
].
devfn
=
PCI_DEVFN
(
path
->
device
,
path
->
function
);
rcu_assign_pointer
(
dmaru
->
devices
[
i
].
dev
,
get_device
(
&
adev
->
dev
));
return
;
}
BUG_ON
(
i
>=
dmaru
->
devices_cnt
);
}
}
pr_warn
(
"No IOMMU scope found for ANDD enumeration ID %d (%s)
\n
"
,
device_number
,
dev_name
(
&
adev
->
dev
));
}
static
int
__init
dmar_acpi_dev_scope_init
(
void
)
{
struct
acpi_dmar_andd
*
andd
=
(
void
*
)
dmar_tbl
+
sizeof
(
struct
acpi_table_dmar
);
while
(((
unsigned
long
)
andd
)
<
((
unsigned
long
)
dmar_tbl
)
+
dmar_tbl
->
length
)
{
if
(
andd
->
header
.
type
==
ACPI_DMAR_TYPE_ANDD
)
{
acpi_handle
h
;
struct
acpi_device
*
adev
;
if
(
!
ACPI_SUCCESS
(
acpi_get_handle
(
ACPI_ROOT_OBJECT
,
andd
->
object_name
,
&
h
)))
{
pr_err
(
"Failed to find handle for ACPI object %s
\n
"
,
andd
->
object_name
);
continue
;
}
acpi_bus_get_device
(
h
,
&
adev
);
if
(
!
adev
)
{
pr_err
(
"Failed to get device for ACPI object %s
\n
"
,
andd
->
object_name
);
continue
;
}
dmar_acpi_insert_dev_scope
(
andd
->
device_number
,
adev
);
}
andd
=
((
void
*
)
andd
)
+
andd
->
header
.
length
;
}
return
0
;
}
int
__init
dmar_dev_scope_init
(
void
)
{
struct
pci_dev
*
dev
=
NULL
;
...
...
@@ -620,6 +693,8 @@ int __init dmar_dev_scope_init(void)
if
(
dmar_dev_scope_status
!=
1
)
return
dmar_dev_scope_status
;
dmar_acpi_dev_scope_init
();
if
(
list_empty
(
&
dmar_drhd_units
))
{
dmar_dev_scope_status
=
-
ENODEV
;
}
else
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录