Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
X
xen
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
Raptor Engineering Public Development
xen
Commits
b3512414
Commit
b3512414
authored
Sep 20, 2007
by
Keir Fraser
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vtd: Fix init/destroy domain hooks.
Signed-off-by:
Keir Fraser
<
keir@xensource.com
>
parent
5b9d7e48
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
18 deletions
+15
-18
xen/arch/x86/domain.c
xen/arch/x86/domain.c
+9
-0
xen/arch/x86/hvm/hvm.c
xen/arch/x86/hvm/hvm.c
+1
-11
xen/arch/x86/hvm/vmx/vtd/intel-iommu.c
xen/arch/x86/hvm/vmx/vtd/intel-iommu.c
+1
-1
xen/arch/x86/hvm/vmx/vtd/io.c
xen/arch/x86/hvm/vmx/vtd/io.c
+3
-5
xen/include/asm-x86/iommu.h
xen/include/asm-x86/iommu.h
+1
-1
No files found.
xen/arch/x86/domain.c
View file @
b3512414
...
...
@@ -44,6 +44,7 @@
#include <asm/hvm/support.h>
#include <asm/msr.h>
#include <asm/nmi.h>
#include <asm/iommu.h>
#ifdef CONFIG_COMPAT
#include <compat/vcpu.h>
#endif
...
...
@@ -505,10 +506,16 @@ int arch_domain_create(struct domain *d)
virt_to_page
(
d
->
shared_info
),
d
,
XENSHARE_writable
);
}
if
(
(
rc
=
iommu_domain_init
(
d
))
!=
0
)
goto
fail
;
if
(
is_hvm_domain
(
d
)
)
{
if
(
(
rc
=
hvm_domain_initialise
(
d
))
!=
0
)
{
iommu_domain_destroy
(
d
);
goto
fail
;
}
}
else
{
...
...
@@ -538,6 +545,8 @@ void arch_domain_destroy(struct domain *d)
if
(
is_hvm_domain
(
d
)
)
hvm_domain_destroy
(
d
);
iommu_domain_destroy
(
d
);
paging_final_teardown
(
d
);
free_xenheap_pages
(
...
...
xen/arch/x86/hvm/hvm.c
View file @
b3512414
...
...
@@ -48,7 +48,6 @@
#include <public/hvm/ioreq.h>
#include <public/version.h>
#include <public/memory.h>
#include <asm/iommu.h>
int
hvm_enabled
__read_mostly
;
...
...
@@ -220,21 +219,13 @@ int hvm_domain_initialise(struct domain *d)
if
(
rc
!=
0
)
return
rc
;
rc
=
iommu_domain_init
(
d
);
if
(
rc
!=
0
)
return
rc
;
vpic_init
(
d
);
vioapic_init
(
d
);
hvm_init_ioreq_page
(
d
,
&
d
->
arch
.
hvm_domain
.
ioreq
);
hvm_init_ioreq_page
(
d
,
&
d
->
arch
.
hvm_domain
.
buf_ioreq
);
rc
=
hvm_funcs
.
domain_initialise
(
d
);
if
(
rc
!=
0
)
release_devices
(
d
);
return
rc
;
return
hvm_funcs
.
domain_initialise
(
d
);
}
void
hvm_domain_relinquish_resources
(
struct
domain
*
d
)
...
...
@@ -250,7 +241,6 @@ void hvm_domain_relinquish_resources(struct domain *d)
void
hvm_domain_destroy
(
struct
domain
*
d
)
{
release_devices
(
d
);
hvm_funcs
.
domain_destroy
(
d
);
}
...
...
xen/arch/x86/hvm/vmx/vtd/intel-iommu.c
View file @
b3512414
...
...
@@ -972,7 +972,7 @@ int iommu_domain_init(struct domain *domain)
gdprintk
(
XENLOG_ERR
VTDPREFIX
,
"IOMMU: hardware doesn't support the agaw
\n
"
);
agaw
=
find_next_bit
(
&
sagaw
,
5
,
agaw
);
if
(
agaw
>=
5
)
if
(
agaw
>=
5
)
return
-
ENODEV
;
}
hd
->
agaw
=
agaw
;
...
...
xen/arch/x86/hvm/vmx/vtd/io.c
View file @
b3512414
...
...
@@ -134,19 +134,17 @@ void hvm_dpci_eoi(unsigned int guest_gsi, union vioapic_redir_entry *ent)
}
}
int
release_devices
(
struct
domain
*
d
)
void
iommu_domain_destroy
(
struct
domain
*
d
)
{
struct
hvm_domain
*
hd
=
&
d
->
arch
.
hvm_domain
;
uint32_t
i
;
int
ret
=
0
;
if
(
!
vtd_enabled
)
return
ret
;
return
;
for
(
i
=
0
;
i
<
NR_IRQS
;
i
++
)
if
(
hd
->
irq
.
mirq
[
i
].
valid
)
ret
=
pirq_guest_unbind
(
d
,
i
);
pirq_guest_unbind
(
d
,
i
);
iommu_domain_teardown
(
d
);
return
ret
;
}
xen/include/asm-x86/iommu.h
View file @
b3512414
...
...
@@ -68,8 +68,8 @@ struct iommu {
int
iommu_setup
(
void
);
int
iommu_domain_init
(
struct
domain
*
d
);
void
iommu_domain_destroy
(
struct
domain
*
d
);
int
assign_device
(
struct
domain
*
d
,
u8
bus
,
u8
devfn
);
int
release_devices
(
struct
domain
*
d
);
int
iommu_map_page
(
struct
domain
*
d
,
dma_addr_t
gfn
,
dma_addr_t
mfn
);
int
iommu_unmap_page
(
struct
domain
*
d
,
dma_addr_t
gfn
);
void
iommu_flush
(
struct
domain
*
d
,
dma_addr_t
gfn
,
u64
*
p2m_entry
);
...
...
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