xc_ptrace fix
Make work for paravirtualized guest
# This is a BitKeeper generated diff -Nru style patch. #
# ChangeSet
# 2005/04/28 15:22:26-07:00 [email protected] # Fix xc_ptrace # Signed-off-by: Kip Macy <[email protected]>
#
# BitKeeper/etc/logging_ok
# 2005/04/28 15:22:26-07:00 [email protected] +1 -0
# Logging to [email protected] accepted
#
# tools/libxc/xc_ptrace.c # 2005/04/28 15:22:15-07:00 [email protected] +4 -2 # don't reference page_array in the paravirtualized case # diff -Nru a/tools/libxc/xc_ptrace.c b/tools/libxc/xc_ptrace.c --- a/tools/libxc/xc_ptrace.c 2005-04-27 19:11:24 -07:00 +++ b/tools/libxc/xc_ptrace.c 2005-04-27 19:11:24 -07:00 @@ -181,7 +181,8 @@ } if ((pde = cr3_virt[cpu][vtopdi(va)]) == 0) /* logical address */ goto error_out; - pde = page_array[pde >> PAGE_SHIFT] << PAGE_SHIFT; + if (ctxt[cpu].flags & VGCF_VMX_GUEST) + pde = page_array[pde >> PAGE_SHIFT] << PAGE_SHIFT; if (pde != pde_phys[cpu]) { pde_phys[cpu] = pde; @@ -194,7 +195,8 @@ } if ((page = pde_virt[cpu][vtopti(va)]) == 0) /* logical address */ goto error_out; - page = page_array[page >> PAGE_SHIFT] << PAGE_SHIFT; + if (ctxt[cpu].flags & VGCF_VMX_GUEST) + page = page_array[page >> PAGE_SHIFT] << PAGE_SHIFT; if (page != page_phys[cpu] || perm != prev_perm[cpu]) { page_phys[cpu] = page;
resend Fwd: xc_ptrace fix
Please apply. Paravirtualized guest debugging does not work without this change.
---------- Forwarded message ----------
From: Kip Macy <[email protected]>
Date: Apr 28, 2005 7:08 PM
Subject: xc_ptrace fix
To: xen-devel <[email protected]>
Make work for paravirtualized guest
# This is a BitKeeper generated diff -Nru style patch. #
# ChangeSet
# 2005/04/28 15:22:26-07:00 [email protected] # Fix xc_ptrace # Signed-off-by: Kip Macy <[email protected]>
#
# BitKeeper/etc/logging_ok
# 2005/04/28 15:22:26-07:00 [email protected] +1 -0
# Logging to [email protected] accepted
#
# tools/libxc/xc_ptrace.c # 2005/04/28 15:22:15-07:00 [email protected] +4 -2 # don't reference page_array in the paravirtualized case # diff -Nru a/tools/libxc/xc_ptrace.c b/tools/libxc/xc_ptrace.c --- a/tools/libxc/xc_ptrace.c 2005-04-27 19:11:24 -07:00 +++ b/tools/libxc/xc_ptrace.c 2005-04-27 19:11:24 -07:00 @@ -181,7 +181,8 @@ } if ((pde = cr3_virt[cpu][vtopdi(va)]) == 0) /* logical address */ goto error_out; - pde = page_array[pde >> PAGE_SHIFT] << PAGE_SHIFT; + if (ctxt[cpu].flags & VGCF_VMX_GUEST) + pde = page_array[pde >> PAGE_SHIFT] << PAGE_SHIFT; if (pde != pde_phys[cpu]) { pde_phys[cpu] = pde; @@ -194,7 +195,8 @@ } if ((page = pde_virt[cpu][vtopti(va)]) == 0) /* logical address */ goto error_out; - page = page_array[page >> PAGE_SHIFT] << PAGE_SHIFT; + if (ctxt[cpu].flags & VGCF_VMX_GUEST) + page = page_array[page >> PAGE_SHIFT] << PAGE_SHIFT; if (page != page_phys[cpu] || perm != prev_perm[cpu]) { page_phys[cpu] = page;