diff mbox

xenaccess: minor fixes and extra printouts

Message ID 1461199165-20427-1-git-send-email-tamas@tklengyel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Tamas K Lengyel April 21, 2016, 12:39 a.m. UTC
Without specifying the altp2m flag on the response the view never got switched.
Also, add extra information printouts that can be useful during debugging.

Signed-off-by: Tamas K Lengyel <tamas@tklengyel.com>
---
Cc: Razvan Cojocaru <rcojocaru@bitdefender.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
---
 tools/tests/xen-access/xen-access.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

Comments

Razvan Cojocaru April 21, 2016, 4:22 a.m. UTC | #1
On 04/21/16 03:39, Tamas K Lengyel wrote:
> Without specifying the altp2m flag on the response the view never got switched.
> Also, add extra information printouts that can be useful during debugging.
> 
> Signed-off-by: Tamas K Lengyel <tamas@tklengyel.com>
> ---
> Cc: Razvan Cojocaru <rcojocaru@bitdefender.com>
> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> Cc: Wei Liu <wei.liu2@citrix.com>
> ---
>  tools/tests/xen-access/xen-access.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)

Acked-by: Razvan Cojocaru <rcojocaru@bitdefender.com>
Wei Liu April 21, 2016, 1:55 p.m. UTC | #2
On Thu, Apr 21, 2016 at 07:22:25AM +0300, Razvan Cojocaru wrote:
> On 04/21/16 03:39, Tamas K Lengyel wrote:
> > Without specifying the altp2m flag on the response the view never got switched.
> > Also, add extra information printouts that can be useful during debugging.
> > 
> > Signed-off-by: Tamas K Lengyel <tamas@tklengyel.com>
> > ---
> > Cc: Razvan Cojocaru <rcojocaru@bitdefender.com>
> > Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> > Cc: Wei Liu <wei.liu2@citrix.com>
> > ---
> >  tools/tests/xen-access/xen-access.c | 10 ++++++----
> >  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> Acked-by: Razvan Cojocaru <rcojocaru@bitdefender.com>
> 

Release-acked-by: Wei Liu <wei.liu2@citrix.com>
Ian Jackson April 22, 2016, 4:49 p.m. UTC | #3
Wei Liu writes ("Re: [PATCH] xenaccess: minor fixes and extra printouts"):
> On Thu, Apr 21, 2016 at 07:22:25AM +0300, Razvan Cojocaru wrote:
> > Acked-by: Razvan Cojocaru <rcojocaru@bitdefender.com>
> > 
> 
> Release-acked-by: Wei Liu <wei.liu2@citrix.com>

Queued for commit, thanks.

Ian.
diff mbox

Patch

diff --git a/tools/tests/xen-access/xen-access.c b/tools/tests/xen-access/xen-access.c
index ef89246..f26e723 100644
--- a/tools/tests/xen-access/xen-access.c
+++ b/tools/tests/xen-access/xen-access.c
@@ -598,7 +598,7 @@  int main(int argc, char *argv[])
                 }
 
                 printf("PAGE ACCESS: %c%c%c for GFN %"PRIx64" (offset %06"
-                       PRIx64") gla %016"PRIx64" (valid: %c; fault in gpt: %c; fault with gla: %c) (vcpu %u, altp2m view %u)\n",
+                       PRIx64") gla %016"PRIx64" (valid: %c; fault in gpt: %c; fault with gla: %c) (vcpu %u [%c], altp2m view %u)\n",
                        (req.u.mem_access.flags & MEM_ACCESS_R) ? 'r' : '-',
                        (req.u.mem_access.flags & MEM_ACCESS_W) ? 'w' : '-',
                        (req.u.mem_access.flags & MEM_ACCESS_X) ? 'x' : '-',
@@ -609,13 +609,14 @@  int main(int argc, char *argv[])
                        (req.u.mem_access.flags & MEM_ACCESS_FAULT_IN_GPT) ? 'y' : 'n',
                        (req.u.mem_access.flags & MEM_ACCESS_FAULT_WITH_GLA) ? 'y': 'n',
                        req.vcpu_id,
+                       (req.flags & VM_EVENT_FLAG_VCPU_PAUSED) ? 'p' : 'r',
                        req.altp2m_idx);
 
                 if ( altp2m && req.flags & VM_EVENT_FLAG_ALTERNATE_P2M)
                 {
                     DPRINTF("\tSwitching back to default view!\n");
 
-                    rsp.flags |= VM_EVENT_FLAG_TOGGLE_SINGLESTEP;
+                    rsp.flags |= (VM_EVENT_FLAG_ALTERNATE_P2M | VM_EVENT_FLAG_TOGGLE_SINGLESTEP);
                     rsp.altp2m_idx = 0;
                 }
                 else if ( default_access != after_first_access )
@@ -652,9 +653,10 @@  int main(int argc, char *argv[])
 
                 break;
             case VM_EVENT_REASON_SINGLESTEP:
-                printf("Singlestep: rip=%016"PRIx64", vcpu %d\n",
+                printf("Singlestep: rip=%016"PRIx64", vcpu %d, altp2m %u\n",
                        req.data.regs.x86.rip,
-                       req.vcpu_id);
+                       req.vcpu_id,
+                       req.altp2m_idx);
 
                 if ( altp2m )
                 {