Message ID | 1462373480-20206-6-git-send-email-tamas@tklengyel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
>>> On 04.05.16 at 16:51, <tamas@tklengyel.com> wrote: > --- a/tools/tests/xen-access/xen-access.c > +++ b/tools/tests/xen-access/xen-access.c > @@ -1,4 +1,3 @@ > -/* > * xen-access.c > * > * Exercises the basic per-page access mechanisms Are you saying this still builds with such a change? Jan
On May 4, 2016 09:35, "Jan Beulich" <JBeulich@suse.com> wrote: > > >>> On 04.05.16 at 16:51, <tamas@tklengyel.com> wrote: > > --- a/tools/tests/xen-access/xen-access.c > > +++ b/tools/tests/xen-access/xen-access.c > > @@ -1,4 +1,3 @@ > > -/* > > * xen-access.c > > * > > * Exercises the basic per-page access mechanisms > > Are you saying this still builds with such a change? > It builds fine, so not sure what you mean. Tamas
On Wed, May 04, 2016 at 11:16:24AM -0600, Tamas K Lengyel wrote: > On May 4, 2016 09:35, "Jan Beulich" <JBeulich@suse.com> wrote: > > > > >>> On 04.05.16 at 16:51, <tamas@tklengyel.com> wrote: > > > --- a/tools/tests/xen-access/xen-access.c > > > +++ b/tools/tests/xen-access/xen-access.c > > > @@ -1,4 +1,3 @@ > > > -/* This line -- you seemed to have removed "/*". I think that's what Jan meant. Wei. > > > * xen-access.c > > > * > > > * Exercises the basic per-page access mechanisms > > > > Are you saying this still builds with such a change? > > > > It builds fine, so not sure what you mean. > > Tamas
On May 4, 2016 11:34, "Wei Liu" <wei.liu2@citrix.com> wrote: > > On Wed, May 04, 2016 at 11:16:24AM -0600, Tamas K Lengyel wrote: > > On May 4, 2016 09:35, "Jan Beulich" <JBeulich@suse.com> wrote: > > > > > > >>> On 04.05.16 at 16:51, <tamas@tklengyel.com> wrote: > > > > --- a/tools/tests/xen-access/xen-access.c > > > > +++ b/tools/tests/xen-access/xen-access.c > > > > @@ -1,4 +1,3 @@ > > > > -/* > > This line -- you seemed to have removed "/*". I think that's what Jan > meant. > Oops, that must be a typo from --annotate. Tamas
On 05/04/2016 05:51 PM, Tamas K Lengyel wrote: > 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 | 32 ++++++++++++++++++++++++++++++-- > 1 file changed, 30 insertions(+), 2 deletions(-) > > diff --git a/tools/tests/xen-access/xen-access.c b/tools/tests/xen-access/xen-access.c > index f26e723..db65846 100644 > --- a/tools/tests/xen-access/xen-access.c > +++ b/tools/tests/xen-access/xen-access.c > @@ -1,4 +1,3 @@ > -/* > * xen-access.c With the above fixed as per Jan's comment: Acked-by: Razvan Cojocaru <rcojocaru@bitdefender.com>
i.A. Jan Beulich Software Engineering Consultant Attachmate Group Nördlicher Zubringer 9-11 40470 Düsseldorf jbeulich@suse.com SUSE SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg) >>> Tamas K Lengyel <tamas@tklengyel.com> 05/04/16 7:18 PM >>> >On May 4, 2016 09:35, "Jan Beulich" <JBeulich@suse.com> wrote: >> >> >>> On 04.05.16 at 16:51, <tamas@tklengyel.com> wrote: >> > --- a/tools/tests/xen-access/xen-access.c >> > +++ b/tools/tests/xen-access/xen-access.c >> > @@ -1,4 +1,3 @@ >> > -/* >> > * xen-access.c >> > * >> > * Exercises the basic per-page access mechanisms >> >> Are you saying this still builds with such a change? > >It builds fine, so not sure what you mean. Perhaps the patch here isn't what you test? I can't see how a file with the beginning of a comment removed can build. Jan
On May 5, 2016 10:29, "Jan Beulich" <jbeulich@suse.com> wrote: > > > i.A. Jan Beulich > Software Engineering Consultant > Attachmate Group > Nördlicher Zubringer 9-11 > 40470 Düsseldorf > jbeulich@suse.com > SUSE > > SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg) > > >>> Tamas K Lengyel <tamas@tklengyel.com> 05/04/16 7:18 PM >>> > >On May 4, 2016 09:35, "Jan Beulich" <JBeulich@suse.com> wrote: > >> > >> >>> On 04.05.16 at 16:51, <tamas@tklengyel.com> wrote: > >> > --- a/tools/tests/xen-access/xen-access.c > >> > +++ b/tools/tests/xen-access/xen-access.c > >> > @@ -1,4 +1,3 @@ > >> > -/* > >> > * xen-access.c > >> > * > >> > * Exercises the basic per-page access mechanisms > >> > >> Are you saying this still builds with such a change? > > > >It builds fine, so not sure what you mean. > > Perhaps the patch here isn't what you test? I can't see how a file with the > beginning of a comment removed can build. > > Jan Yea, the typo was introduced somewhere midway in the process.. Oh well, will resend. Tamas
diff --git a/tools/tests/xen-access/xen-access.c b/tools/tests/xen-access/xen-access.c index f26e723..db65846 100644 --- a/tools/tests/xen-access/xen-access.c +++ b/tools/tests/xen-access/xen-access.c @@ -1,4 +1,3 @@ -/* * xen-access.c * * Exercises the basic per-page access mechanisms @@ -334,6 +333,8 @@ void usage(char* progname) fprintf(stderr, "Usage: %s [-m] <domain_id> write|exec", progname); #if defined(__i386__) || defined(__x86_64__) fprintf(stderr, "|breakpoint|altp2m_write|altp2m_exec"); +#elif defined(__arm__) || defined(__aarch64__) + fprintf(stderr, "|privcall"); #endif fprintf(stderr, "\n" @@ -357,6 +358,7 @@ int main(int argc, char *argv[]) int required = 0; int breakpoint = 0; int shutting_down = 0; + int privcall = 0; int altp2m = 0; uint16_t altp2m_view_id = 0; @@ -412,6 +414,11 @@ int main(int argc, char *argv[]) default_access = XENMEM_access_rw; altp2m = 1; } +#elif defined(__arm__) || defined(__aarch64__) + else if ( !strcmp(argv[0], "privcall") ) + { + privcall = 1; + } #endif else { @@ -524,6 +531,16 @@ int main(int argc, char *argv[]) } } + if ( privcall ) + { + rc = xc_monitor_privileged_call(xch, domain_id, 1); + if ( rc < 0 ) + { + ERROR("Error %d setting privileged call trapping with vm_event\n", rc); + goto exit; + } + } + /* Wait for access */ for (;;) { @@ -535,6 +552,9 @@ int main(int argc, char *argv[]) if ( breakpoint ) rc = xc_monitor_software_breakpoint(xch, domain_id, 0); + if ( privcall ) + rc = xc_monitor_privileged_call(xch, domain_id, 0); + if ( altp2m ) { rc = xc_altp2m_switch_to_view( xch, domain_id, 0 ); @@ -635,7 +655,7 @@ int main(int argc, char *argv[]) rsp.u.mem_access = req.u.mem_access; break; case VM_EVENT_REASON_SOFTWARE_BREAKPOINT: - printf("Breakpoint: rip=%016"PRIx64", gfn=%"PRIx64" (vcpu %d)\n", + printf("Breakpoint: rip=%"PRIx64" gfn=%"PRIx64" (vcpu %d)\n", req.data.regs.x86.rip, req.u.software_breakpoint.gfn, req.vcpu_id); @@ -650,7 +670,15 @@ int main(int argc, char *argv[]) interrupted = -1; continue; } + break; + case VM_EVENT_REASON_PRIVILEGED_CALL: + printf("Privileged call: pc=%"PRIx32" (vcpu %d)\n", + req.data.regs.arm32.pc, + req.vcpu_id); + rsp.data.regs.arm32 = req.data.regs.arm32; + rsp.data.regs.arm32.pc += 4; + rsp.flags |= VM_EVENT_FLAG_SET_REGISTERS; break; case VM_EVENT_REASON_SINGLESTEP: printf("Singlestep: rip=%016"PRIx64", vcpu %d, altp2m %u\n",
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 | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-)