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
nexedi
linux
Commits
04b18e65
Commit
04b18e65
authored
Jun 27, 2009
by
David Woodhouse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
intel-iommu: Make dma_pte_clear_range() use pfns
Signed-off-by:
David Woodhouse
<
David.Woodhouse@intel.com
>
parent
66eae846
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
13 deletions
+9
-13
drivers/pci/intel-iommu.c
drivers/pci/intel-iommu.c
+9
-13
No files found.
drivers/pci/intel-iommu.c
View file @
04b18e65
...
...
@@ -779,21 +779,17 @@ static void dma_pte_clear_one(struct dmar_domain *domain, unsigned long pfn)
/* clear last level pte, a tlb flush should be followed */
static
void
dma_pte_clear_range
(
struct
dmar_domain
*
domain
,
u64
start
,
u64
end
)
{
int
addr_width
=
agaw_to_width
(
domain
->
agaw
);
int
npages
;
BUG_ON
(
start
>>
addr_width
);
BUG_ON
((
end
-
1
)
>>
addr_width
);
unsigned
long
start_pfn
=
IOVA_PFN
(
start
);
unsigned
long
end_pfn
=
IOVA_PFN
(
end
-
1
);
int
addr_width
=
agaw_to_width
(
domain
->
agaw
)
-
VTD_PAGE_SHIFT
;
/* in case it's partial page */
start
&=
PAGE_MASK
;
end
=
PAGE_ALIGN
(
end
);
npages
=
(
end
-
start
)
/
VTD_PAGE_SIZE
;
BUG_ON
(
addr_width
<
BITS_PER_LONG
&&
start_pfn
>>
addr_width
);
BUG_ON
(
addr_width
<
BITS_PER_LONG
&&
end_pfn
>>
addr_width
);
/* we don't need lock here
,
nobody else touches the iova range */
while
(
npages
--
)
{
dma_pte_clear_one
(
domain
,
start
>>
VTD_PAGE_SHIFT
);
start
+=
VTD_PAGE_SIZE
;
/* we don't need lock here
;
nobody else touches the iova range */
while
(
start_pfn
<=
end_pfn
)
{
dma_pte_clear_one
(
domain
,
start
_pfn
);
start
_pfn
++
;
}
}
...
...
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