* xc_ptrace fix
@ 2005-04-29 2:08 Kip Macy
2005-04-30 0:04 ` resend Fwd: " Kip Macy
0 siblings, 1 reply; 4+ messages in thread
From: Kip Macy @ 2005-04-29 2:08 UTC (permalink / raw)
To: xen-devel
Make work for paravirtualized guest
# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
# 2005/04/28 15:22:26-07:00 kmacy@curly.lab.netapp.com
# Fix xc_ptrace
# Signed-off-by: Kip Macy <kmacy@fsmware.com>
#
# BitKeeper/etc/logging_ok
# 2005/04/28 15:22:26-07:00 kmacy@curly.lab.netapp.com +1 -0
# Logging to logging@openlogging.org accepted
#
# tools/libxc/xc_ptrace.c
# 2005/04/28 15:22:15-07:00 kmacy@curly.lab.netapp.com +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;
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: xc_ptrace fix
@ 2005-04-29 3:30 Leendert van Doorn
2005-04-29 4:24 ` Kip Macy
0 siblings, 1 reply; 4+ messages in thread
From: Leendert van Doorn @ 2005-04-29 3:30 UTC (permalink / raw)
To: Kip Macy; +Cc: xen-devel
# Make work for paravirtualized guest
So it does not return an indentity map for paravirtualized guests?
Sorry about that, I'll make sure my fixes are programmed more defensive
next time.
Leendert
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: xc_ptrace fix
2005-04-29 3:30 Leendert van Doorn
@ 2005-04-29 4:24 ` Kip Macy
0 siblings, 0 replies; 4+ messages in thread
From: Kip Macy @ 2005-04-29 4:24 UTC (permalink / raw)
To: Leendert van Doorn; +Cc: xen-devel
What you're doing could work in principle, but the page array would
have to be equal to the number of pages on the machine not the number
of "physical" pages in the guest. In the paravirtualized case you are
reading from the hardware page tables, so although the guest may only
be using 64MB its pages may reside at the edge of 4GB. The
segmentation fault I sent earlier was caused by the inevitable
indexing off the edge of the array.
Looking at the code in DOM0_GETMEMINFO:
for ( i = 0; (i < max_pfns) && (list_ent != &d->page_list); i++ )
{
pfn = list_entry(list_ent, struct pfn_info, list) -
frame_table;
if ( put_user(pfn, buffer) )
It only adds an entry for each page in use, which I assume means it is
just the p2m mapping of page frames.
> So it does not return an indentity map for paravirtualized guests?
>
> Sorry about that, I'll make sure my fixes are programmed more defensive
> next time.
Thanks.
-Kip
^ permalink raw reply [flat|nested] 4+ messages in thread
* resend Fwd: xc_ptrace fix
2005-04-29 2:08 xc_ptrace fix Kip Macy
@ 2005-04-30 0:04 ` Kip Macy
0 siblings, 0 replies; 4+ messages in thread
From: Kip Macy @ 2005-04-30 0:04 UTC (permalink / raw)
To: xen-devel
Please apply. Paravirtualized guest debugging does not work without
this change.
---------- Forwarded message ----------
From: Kip Macy <kip.macy@gmail.com>
Date: Apr 28, 2005 7:08 PM
Subject: xc_ptrace fix
To: xen-devel <xen-devel@lists.xensource.com>
Make work for paravirtualized guest
# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
# 2005/04/28 15:22:26-07:00 kmacy@curly.lab.netapp.com
# Fix xc_ptrace
# Signed-off-by: Kip Macy <kmacy@fsmware.com>
#
# BitKeeper/etc/logging_ok
# 2005/04/28 15:22:26-07:00 kmacy@curly.lab.netapp.com +1 -0
# Logging to logging@openlogging.org accepted
#
# tools/libxc/xc_ptrace.c
# 2005/04/28 15:22:15-07:00 kmacy@curly.lab.netapp.com +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;
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2005-04-30 0:04 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-29 2:08 xc_ptrace fix Kip Macy
2005-04-30 0:04 ` resend Fwd: " Kip Macy
-- strict thread matches above, loose matches on Subject: below --
2005-04-29 3:30 Leendert van Doorn
2005-04-29 4:24 ` Kip Macy
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.