Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
cf04eee8
Commit
cf04eee8
authored
Mar 21, 2014
by
David Woodhouse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
iommu/vt-d: Include ACPI devices in iommu=pt
Signed-off-by:
David Woodhouse
<
David.Woodhouse@intel.com
>
parent
66077edc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
13 deletions
+48
-13
drivers/iommu/intel-iommu.c
drivers/iommu/intel-iommu.c
+48
-13
No files found.
drivers/iommu/intel-iommu.c
View file @
cf04eee8
...
...
@@ -2595,30 +2595,65 @@ static int iommu_should_identity_map(struct device *dev, int startup)
return
1
;
}
static
int
__init
dev_prepare_static_identity_mapping
(
struct
device
*
dev
,
int
hw
)
{
int
ret
;
if
(
!
iommu_should_identity_map
(
dev
,
1
))
return
0
;
ret
=
domain_add_dev_info
(
si_domain
,
dev
,
hw
?
CONTEXT_TT_PASS_THROUGH
:
CONTEXT_TT_MULTI_LEVEL
);
if
(
!
ret
)
pr_info
(
"IOMMU: %s identity mapping for device %s
\n
"
,
hw
?
"hardware"
:
"software"
,
dev_name
(
dev
));
else
if
(
ret
==
-
ENODEV
)
/* device not associated with an iommu */
ret
=
0
;
return
ret
;
}
static
int
__init
iommu_prepare_static_identity_mapping
(
int
hw
)
{
struct
pci_dev
*
pdev
=
NULL
;
int
ret
;
struct
dmar_drhd_unit
*
drhd
;
struct
intel_iommu
*
iommu
;
struct
device
*
dev
;
int
i
;
int
ret
=
0
;
ret
=
si_domain_init
(
hw
);
if
(
ret
)
return
-
EFAULT
;
for_each_pci_dev
(
pdev
)
{
if
(
iommu_should_identity_map
(
&
pdev
->
dev
,
1
))
{
ret
=
domain_add_dev_info
(
si_domain
,
&
pdev
->
dev
,
hw
?
CONTEXT_TT_PASS_THROUGH
:
CONTEXT_TT_MULTI_LEVEL
);
if
(
ret
)
{
/* device not associated with an iommu */
if
(
ret
==
-
ENODEV
)
continue
;
return
ret
;
ret
=
dev_prepare_static_identity_mapping
(
&
pdev
->
dev
,
hw
);
if
(
ret
)
return
ret
;
}
for_each_active_iommu
(
iommu
,
drhd
)
for_each_active_dev_scope
(
drhd
->
devices
,
drhd
->
devices_cnt
,
i
,
dev
)
{
struct
acpi_device_physical_node
*
pn
;
struct
acpi_device
*
adev
;
if
(
dev
->
bus
!=
&
acpi_bus_type
)
continue
;
adev
=
to_acpi_device
(
dev
);
mutex_lock
(
&
adev
->
physical_node_lock
);
list_for_each_entry
(
pn
,
&
adev
->
physical_node_list
,
node
)
{
ret
=
dev_prepare_static_identity_mapping
(
pn
->
dev
,
hw
);
if
(
ret
)
break
;
}
pr_info
(
"IOMMU: %s identity mapping for device %s
\n
"
,
hw
?
"hardware"
:
"software"
,
pci_name
(
pdev
));
mutex_unlock
(
&
adev
->
physical_node_lock
);
if
(
ret
)
return
ret
;
}
}
return
0
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment