From: Tamas K Lengyel <tamas.lengyel@zentific.com>
To: Julien Grall <julien.grall@arm.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
Ian Jackson <ian.jackson@eu.citrix.com>
Subject: Re: [PATCH v8 6/6] tools/xen-access: add test-case for ARM SMC
Date: Thu, 7 Jul 2016 09:54:21 -0600 [thread overview]
Message-ID: <CAErYnsjwHX1CWOyWTHF_MPA_XVyUk0Dh173gPAgTdEEbYFzLUA@mail.gmail.com> (raw)
In-Reply-To: <577E297D.5020100@arm.com>
On Thu, Jul 7, 2016 at 4:05 AM, Julien Grall <julien.grall@arm.com> wrote:
>
>
> On 05/07/16 19:37, Tamas K Lengyel wrote:
>>
>> +#if defined(__arm__) || defined(__aarch64__)
>> + case VM_EVENT_REASON_PRIVILEGED_CALL:
>> + {
>> + const struct vm_event_regs_arm *in_regs =
>> &req.data.regs.arm;
>> + struct vm_event_regs_arm *out_regs =
>> &rsp.data.regs.arm;
>> + bool is32bit = !!(in_regs->cpsr & PSR_MODE_BIT);
>> + uint64_t pc;
>> +
>> + *out_regs = *in_regs;
>> +
>> + if ( is32bit ) {
>
>
> The open-bracket should be on a separate line.
>
>> + pc = in_regs->arch.arm32.pc;
>> + out_regs->arch.arm32.pc += 4;
>
>
> I suspect you will have to update the CSPR if the SMC instruction is part of
> an IT block (see advance_pc code in arch/arm/traps.c).
>
>> + } else {
>
>
> The open-bracket should be on a separate line.
>
>> + pc = in_regs->arch.arm64.pc;
>> + out_regs->arch.arm64.pc += 8;
>
>
> SMC instruction length is 4 bytes not 8 (see encoding in C6.2.165 in DDI
> 0487A.j).
>
>> + }
>> +
>> + printf("Privileged call: pc=%016"PRIx64" (vcpu
>> %d)\n",
>> + pc, req.vcpu_id);
>> +
>> + rsp.flags |= VM_EVENT_FLAG_SET_REGISTERS;
>> + }
>> + break;
>> +#endif
>> default:
>> fprintf(stderr, "UNKNOWN REASON CODE %d\n", req.reason);
>> }
>>
>
> Regards,
>
> --
> Julien Grall
Good points, thanks!
Tamas
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-07-07 15:54 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-05 18:37 [PATCH v8 1/6] monitor: rename and relocate vm_event_monitor_traps Tamas K Lengyel
2016-07-05 18:37 ` [PATCH v8 2/6] arm: filter SMC exceptions with failed condition checks Tamas K Lengyel
2016-07-06 17:31 ` Julien Grall
2016-07-06 18:52 ` Tamas K Lengyel
2016-07-05 18:37 ` [PATCH v8 3/6] monitor: ARM SMC events Tamas K Lengyel
2016-07-05 18:37 ` [PATCH v8 4/6] arm/vm_event: get/set registers Tamas K Lengyel
2016-07-06 7:43 ` Jan Beulich
2016-07-06 7:59 ` Razvan Cojocaru
2016-07-06 17:39 ` Julien Grall
2016-07-06 19:23 ` Tamas K Lengyel
2016-07-06 21:12 ` Julien Grall
2016-07-06 22:01 ` Tamas K Lengyel
2016-07-06 18:04 ` Julien Grall
2016-07-06 19:12 ` Tamas K Lengyel
2016-07-07 8:23 ` Jan Beulich
2016-07-07 9:46 ` Julien Grall
2016-07-07 9:57 ` Jan Beulich
2016-07-07 10:09 ` Julien Grall
2016-07-07 15:53 ` Tamas K Lengyel
2016-07-05 18:37 ` [PATCH v8 5/6] tools/libxc: add xc_monitor_privileged_call Tamas K Lengyel
2016-07-05 18:37 ` [PATCH v8 6/6] tools/xen-access: add test-case for ARM SMC Tamas K Lengyel
2016-07-07 10:05 ` Julien Grall
2016-07-07 15:54 ` Tamas K Lengyel [this message]
2016-07-05 19:15 ` [PATCH v8 1/6] monitor: rename and relocate vm_event_monitor_traps Razvan Cojocaru
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAErYnsjwHX1CWOyWTHF_MPA_XVyUk0Dh173gPAgTdEEbYFzLUA@mail.gmail.com \
--to=tamas.lengyel@zentific.com \
--cc=ian.jackson@eu.citrix.com \
--cc=julien.grall@arm.com \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).