debuggers.hg
changeset 16582:d7a0a73e5dca
xc ptrace: Fix a couple of bugs in page-table walking.
Signed-off-by: John Zulauf <john.zulauf@intel.com>
Signed-off-by: John Zulauf <john.zulauf@intel.com>
author | Keir Fraser <keir.fraser@citrix.com> |
---|---|
date | Thu Dec 06 11:29:18 2007 +0000 (2007-12-06) |
parents | 46776e65e679 |
children | 0f9b5ab59579 |
files | tools/libxc/xc_ptrace.c |
line diff
1.1 --- a/tools/libxc/xc_ptrace.c Thu Dec 06 11:24:02 2007 +0000 1.2 +++ b/tools/libxc/xc_ptrace.c Thu Dec 06 11:29:18 2007 +0000 1.3 @@ -156,21 +156,8 @@ online_vcpus_changed(uint64_t cpumap) 1.4 static long nr_pages = 0; 1.5 static uint64_t *page_array = NULL; 1.6 1.7 - 1.8 -/* 1.9 - * Translates physical addresses to machine addresses for HVM 1.10 - * guests. For paravirtual domains the function will just return the 1.11 - * given address. 1.12 - * 1.13 - * This function should be used when reading page directories/page 1.14 - * tables. 1.15 - * 1.16 - */ 1.17 -static uint64_t 1.18 -to_ma(int cpu, uint64_t maddr) 1.19 +static uint64_t to_ma(int cpu, uint64_t maddr) 1.20 { 1.21 - if ( current_is_hvm && paging_enabled(&ctxt[cpu]) ) 1.22 - maddr = page_array[maddr >> PAGE_SHIFT] << PAGE_SHIFT; 1.23 return maddr; 1.24 } 1.25 1.26 @@ -310,7 +297,7 @@ map_domain_va_64( 1.27 return NULL; 1.28 l1p = to_ma(cpu, l2e); 1.29 if (l2e & 0x80) { /* 2M pages */ 1.30 - p = to_ma(cpu, (l1p + l1_table_offset(va)) << PAGE_SHIFT); 1.31 + p = to_ma(cpu, l1p + (l1_table_offset(va) << PAGE_SHIFT)); 1.32 } else { /* 4K pages */ 1.33 l1 = xc_map_foreign_range(xc_handle, current_domid, PAGE_SIZE, PROT_READ, l1p >> PAGE_SHIFT); 1.34 if ( l1 == NULL )