Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci
Commits
0ab36de2
Commit
0ab36de2
authored
Jun 28, 2009
by
David Woodhouse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
intel-iommu: Use domain_pfn_mapping() in __intel_map_single()
Signed-off-by:
David Woodhouse
<
David.Woodhouse@intel.com
>
parent
61df7443
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
10 deletions
+8
-10
drivers/pci/intel-iommu.c
drivers/pci/intel-iommu.c
+8
-10
No files found.
drivers/pci/intel-iommu.c
View file @
0ab36de2
...
...
@@ -2477,14 +2477,12 @@ static dma_addr_t __intel_map_single(struct device *hwdev, phys_addr_t paddr,
return
0
;
iommu
=
domain_get_iommu
(
domain
);
size
=
aligned_size
(
(
u64
)
paddr
,
size
)
;
size
=
aligned_size
(
paddr
,
size
)
>>
VTD_PAGE_SHIFT
;
iova
=
__intel_alloc_iova
(
hwdev
,
domain
,
size
,
pdev
->
dma_mask
);
iova
=
__intel_alloc_iova
(
hwdev
,
domain
,
size
<<
VTD_PAGE_SHIFT
,
pdev
->
dma_mask
);
if
(
!
iova
)
goto
error
;
start_paddr
=
(
phys_addr_t
)
iova
->
pfn_lo
<<
PAGE_SHIFT
;
/*
* Check if DMAR supports zero-length reads on write only
* mappings..
...
...
@@ -2500,20 +2498,20 @@ static dma_addr_t __intel_map_single(struct device *hwdev, phys_addr_t paddr,
* might have two guest_addr mapping to the same host paddr, but this
* is not a big problem
*/
ret
=
domain_page_mapping
(
domain
,
start_paddr
,
((
u64
)
paddr
)
&
PHYSICAL_PAGE_MASK
,
size
,
prot
);
ret
=
domain_pfn_mapping
(
domain
,
mm_to_dma_pfn
(
iova
->
pfn_lo
),
paddr
>>
VTD_PAGE_SHIFT
,
size
,
prot
);
if
(
ret
)
goto
error
;
start_paddr
=
(
phys_addr_t
)
iova
->
pfn_lo
<<
PAGE_SHIFT
;
/* it's a non-present to present mapping. Only flush if caching mode */
if
(
cap_caching_mode
(
iommu
->
cap
))
iommu_flush_iotlb_psi
(
iommu
,
0
,
start_paddr
,
size
>>
VTD_PAGE_SHIFT
);
iommu_flush_iotlb_psi
(
iommu
,
0
,
start_paddr
,
size
);
else
iommu_flush_write_buffer
(
iommu
);
return
start_paddr
+
(
(
u64
)
paddr
&
(
~
PAGE_MASK
));
return
start_paddr
+
(
paddr
&
(
~
PAGE_MASK
));
error:
if
(
iova
)
...
...
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