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
c5395d5c
Commit
c5395d5c
authored
Jun 28, 2009
by
David Woodhouse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
intel-iommu: Clean up iommu_domain_identity_map()
Signed-off-by:
David Woodhouse
<
David.Woodhouse@intel.com
>
parent
1a4a4551
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
15 deletions
+9
-15
drivers/pci/intel-iommu.c
drivers/pci/intel-iommu.c
+9
-15
No files found.
drivers/pci/intel-iommu.c
View file @
c5395d5c
...
...
@@ -1861,31 +1861,25 @@ static int iommu_domain_identity_map(struct dmar_domain *domain,
unsigned
long
long
start
,
unsigned
long
long
end
)
{
unsigned
long
size
;
unsigned
long
l
ong
base
;
unsigned
long
first_vpfn
=
start
>>
VTD_PAGE_SHIFT
;
unsigned
long
l
ast_vpfn
=
end
>>
VTD_PAGE_SHIFT
;
/* The address might not be aligned */
base
=
start
&
PAGE_MASK
;
size
=
end
-
base
;
size
=
PAGE_ALIGN
(
size
);
if
(
!
reserve_iova
(
&
domain
->
iovad
,
IOVA_PFN
(
base
),
IOVA_PFN
(
base
+
size
)
-
1
))
{
if
(
!
reserve_iova
(
&
domain
->
iovad
,
dma_to_mm_pfn
(
first_vpfn
),
dma_to_mm_pfn
(
last_vpfn
)))
{
printk
(
KERN_ERR
"IOMMU: reserve iova failed
\n
"
);
return
-
ENOMEM
;
}
pr_debug
(
"Mapping reserved region %l
x@
%llx for domain %d
\n
"
,
s
ize
,
base
,
domain
->
id
);
pr_debug
(
"Mapping reserved region %l
lx-
%llx for domain %d
\n
"
,
s
tart
,
end
,
domain
->
id
);
/*
* RMRR range might have overlap with physical memory range,
* clear it first
*/
dma_pte_clear_range
(
domain
,
base
>>
VTD_PAGE_SHIFT
,
(
base
+
size
-
1
)
>>
VTD_PAGE_SHIFT
);
dma_pte_clear_range
(
domain
,
first_vpfn
,
last_vpfn
);
return
domain_pfn_mapping
(
domain
,
base
>>
VTD_PAGE_SHIFT
,
base
>>
VTD_PAGE_SHIFT
,
size
>>
VTD_PAGE_SHIFT
,
return
domain_pfn_mapping
(
domain
,
first_vpfn
,
first_vpfn
,
last_vpfn
-
first_vpfn
+
1
,
DMA_PTE_READ
|
DMA_PTE_WRITE
);
}
...
...
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