2010-10-20 23:00:35 +02:00
|
|
|
Subject: xenpaging: Fix-up xenpaging tool code.
|
|
|
|
|
|
|
|
This isn't directly related to EPT checking, but does some general fix-ups
|
|
|
|
to the xenpaging code (adds some extra frees, etc.)
|
|
|
|
|
2010-10-29 18:37:40 +02:00
|
|
|
(xen-unstable changeset: 21890:3263d0ff9476)
|
2011-01-14 19:24:51 +01:00
|
|
|
|
2010-10-20 23:00:35 +02:00
|
|
|
Already-Signed-off-by: Patrick Colp <pjcolp@cs.ubc.ca>
|
|
|
|
Signed-off-by: Olaf Hering <olaf@aepfle.de>
|
|
|
|
|
|
|
|
---
|
|
|
|
tools/xenpaging/xenpaging.c | 22 ++++++++++++++++++----
|
|
|
|
1 file changed, 18 insertions(+), 4 deletions(-)
|
|
|
|
|
|
|
|
--- xen-4.0.1-testing.orig/tools/xenpaging/xenpaging.c
|
|
|
|
+++ xen-4.0.1-testing/tools/xenpaging/xenpaging.c
|
|
|
|
@@ -100,7 +100,7 @@ xenpaging_t *xenpaging_init(domid_t doma
|
|
|
|
paging->mem_event.ring_page = init_page();
|
|
|
|
if ( paging->mem_event.ring_page == NULL )
|
|
|
|
{
|
|
|
|
- ERROR("Error initialising shared page");
|
|
|
|
+ ERROR("Error initialising ring page");
|
|
|
|
goto err;
|
|
|
|
}
|
|
|
|
|
|
|
|
@@ -198,13 +198,27 @@ xenpaging_t *xenpaging_init(domid_t doma
|
|
|
|
return paging;
|
|
|
|
|
|
|
|
err:
|
|
|
|
- if ( paging->bitmap )
|
|
|
|
+ if ( paging )
|
|
|
|
+ {
|
|
|
|
+ if ( paging->mem_event.shared_page )
|
|
|
|
+ {
|
|
|
|
+ munlock(paging->mem_event.shared_page, PAGE_SIZE);
|
|
|
|
+ free(paging->mem_event.shared_page);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if ( paging->mem_event.ring_page )
|
|
|
|
+ {
|
|
|
|
+ munlock(paging->mem_event.ring_page, PAGE_SIZE);
|
|
|
|
+ free(paging->mem_event.ring_page);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
free(paging->bitmap);
|
|
|
|
- if ( paging->platform_info )
|
|
|
|
free(paging->platform_info);
|
|
|
|
- if ( paging )
|
|
|
|
+ free(paging->domain_info);
|
|
|
|
free(paging);
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ err_iface:
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|