Skip to contentSkip to conversation

Tools: Make xen-access test compile in 32 bits mode

PATCH In review Andres Lagar-Cavilla 2 participants 3 messages Feb 9, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Tools: Make xen-access test compile in 32 bits mode

 tools/tests/Makefile                |   2 --
 tools/tests/xen-access/xen-access.c |  12 +++++++-----
 2 files changed, 7 insertions(+), 7 deletions(-)
tools/tests/Makefile +0 -2
diff -r 78ff0c8a944f -r 5c7986918883 tools/tests/Makefile
@@ -11,9 +11,7 @@ ifeq ($(XEN_TARGET_ARCH),__fixme__)
 SUBDIRS-y += regression
 endif
 SUBDIRS-y += x86_emulator
-ifneq ($(XEN_TARGET_ARCH),x86_32)
 SUBDIRS-y += xen-access
-endif
 
 .PHONY: all clean install distclean
 all clean distclean: %: subdirs-%
tools/tests/xen-access/xen-access.c +7 -5
diff -r 78ff0c8a944f -r 5c7986918883 tools/tests/xen-access/xen-access.c
@@ -600,13 +600,13 @@ int main(int argc, char *argv[])
             case MEM_EVENT_REASON_VIOLATION:
                 rc = xc_hvm_get_mem_access(xch, domain_id, req.gfn, &access);
 
-                printf("PAGE ACCESS: %c%c%c for GFN %lx (offset %06lx) gla %016lx (vcpu %d)\n",
+                printf("PAGE ACCESS: %c%c%c for GFN %llx (offset %06llx) gla %016llx (vcpu %d)\n",
                         req.access_r ? 'r' : '-',
                         req.access_w ? 'w' : '-',
                         req.access_x ? 'x' : '-',
-                        req.gfn,
-                        req.offset,
-                        req.gla,
+                        (unsigned long long) req.gfn,
+                        (unsigned long long) req.offset,
+                        (unsigned long long) req.gla,
                         req.vcpu_id);
 
                 if ( default_access != after_first_access )
@@ -617,7 +617,9 @@ int main(int argc, char *argv[])
                 rsp.p2mt = req.p2mt;
                 break;
             case MEM_EVENT_REASON_INT3:
-                printf("INT3: rip=%016lx, gfn=%lx (vcpu %d)\n", req.gla, req.gfn,
+                printf("INT3: rip=%016llx, gfn=%llx (vcpu %d)\n", 
+                        (unsigned long long) req.gla, 
+                        (unsigned long long) req.gfn,
                         req.vcpu_id);
 
                 /* Reinject */
#1 lore raw
Quoted 6 lines · Andres Lagar-Cavilla
 tools/tests/Makefile                |   2 --
 tools/tests/xen-access/xen-access.c |  12 +++++++-----
 2 files changed, 7 insertions(+), 7 deletions(-)

Please use the proper format macros in inttypes.h rather than casting. I fixed this up in this case, and have applied the resulting patch.

-- Keir

Quoted 53 lines

diff -r 78ff0c8a944f -r 5c7986918883 tools/tests/Makefile

tools/tests/Makefile +0 -2
@@ -11,9 +11,7 @@ ifeq ($(XEN_TARGET_ARCH),__fixme__)
 SUBDIRS-y += regression
 endif
 SUBDIRS-y += x86_emulator
-ifneq ($(XEN_TARGET_ARCH),x86_32)
 SUBDIRS-y += xen-access
-endif
 
 .PHONY: all clean install distclean
 all clean distclean: %: subdirs-%

diff -r 78ff0c8a944f -r 5c7986918883 tools/tests/xen-access/xen-access.c

tools/tests/xen-access/xen-access.c +4 -4
@@ -600,13 +600,13 @@ int main(int argc, char *argv[])
             case MEM_EVENT_REASON_VIOLATION:
                 rc = xc_hvm_get_mem_access(xch, domain_id, req.gfn, &access);
 
-                printf("PAGE ACCESS: %c%c%c for GFN %lx (offset %06lx) gla
 %016lx (vcpu %d)\n",
+                printf("PAGE ACCESS: %c%c%c for GFN %llx (offset %06llx) gla
 %016llx (vcpu %d)\n",
                         req.access_r ? 'r' : '-',
                         req.access_w ? 'w' : '-',
                         req.access_x ? 'x' : '-',
-                        req.gfn,
-                        req.offset,
-                        req.gla,
+                        (unsigned long long) req.gfn,
+                        (unsigned long long) req.offset,
+                        (unsigned long long) req.gla,
                         req.vcpu_id);
 
                 if ( default_access != after_first_access )
tools/tests/xen-access/xen-access.c +3 -1
@@ -617,7 +617,9 @@ int main(int argc, char *argv[])
                 rsp.p2mt = req.p2mt;
                 break;
             case MEM_EVENT_REASON_INT3:
-                printf("INT3: rip=%016lx, gfn=%lx (vcpu %d)\n", req.gla,
 req.gfn,
+                printf("INT3: rip=%016llx, gfn=%llx (vcpu %d)\n",
+                        (unsigned long long) req.gla,
+                        (unsigned long long) req.gfn,
                         req.vcpu_id);
 
                 /* Reinject */

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#2 lore raw
Quoted 8 lines
Quoted 5 lines · Andres Lagar-Cavilla
 tools/tests/Makefile                |   2 --
 tools/tests/xen-access/xen-access.c |  12 +++++++-----
 2 files changed, 7 insertions(+), 7 deletions(-)
Quoted 4 lines
Quoted 1 line

Please use the proper format macros in inttypes.h rather than casting. I fixed this up in this case, and have applied the resulting patch.

Ok, thanks!
Andres

Quoted 63 lines

-- Keir

Quoted 57 lines

diff -r 78ff0c8a944f -r 5c7986918883 tools/tests/Makefile

tools/tests/Makefile +0 -2
@@ -11,9 +11,7 @@ ifeq ($(XEN_TARGET_ARCH),__fixme__)
 SUBDIRS-y += regression
 endif
 SUBDIRS-y += x86_emulator
-ifneq ($(XEN_TARGET_ARCH),x86_32)
 SUBDIRS-y += xen-access
-endif
 
 .PHONY: all clean install distclean
 all clean distclean: %: subdirs-%

diff -r 78ff0c8a944f -r 5c7986918883 tools/tests/xen-access/xen-access.c

tools/tests/xen-access/xen-access.c +0 -1
@@ -600,13 +600,13 @@ int main(int argc, char *argv[])
             case MEM_EVENT_REASON_VIOLATION:
                 rc = xc_hvm_get_mem_access(xch, domain_id, req.gfn,
 &access);
 
-                printf("PAGE ACCESS: %c%c%c for GFN %lx (offset %06lx)

gla
%016lx (vcpu %d)\n",
+ printf("PAGE ACCESS: %c%c%c for GFN %llx (offset
%06llx) gla
%016llx (vcpu %d)\n",

                         req.access_r ? 'r' : '-',
                         req.access_w ? 'w' : '-',
                         req.access_x ? 'x' : '-',
tools/tests/xen-access/xen-access.c +6 -4
-                        req.gfn,
-                        req.offset,
-                        req.gla,
+                        (unsigned long long) req.gfn,
+                        (unsigned long long) req.offset,
+                        (unsigned long long) req.gla,
                         req.vcpu_id);
 
                 if ( default_access != after_first_access )
@@ -617,7 +617,9 @@ int main(int argc, char *argv[])
                 rsp.p2mt = req.p2mt;
                 break;
             case MEM_EVENT_REASON_INT3:
-                printf("INT3: rip=%016lx, gfn=%lx (vcpu %d)\n",
 req.gla,
 req.gfn,
+                printf("INT3: rip=%016llx, gfn=%llx (vcpu %d)\n",
+                        (unsigned long long) req.gla,
+                        (unsigned long long) req.gfn,
                         req.vcpu_id);
                 /* Reinject */

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel