diff mbox

[3/7] arm: traps: check if SMC was conditional before handling it

Message ID 1502222922-25821-4-git-send-email-volodymyr_babchuk@epam.com (mailing list archive)
State New, archived
Headers show

Commit Message

Volodymyr Babchuk Aug. 8, 2017, 8:08 p.m. UTC
On certain ARM arhcitectures SMC instruction can be conditional
(ARM DDI 0487A.k page D7-1949) and we need to check if that
conditional was meet.

Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
---
This patch was separated from the next one

---
 xen/arch/arm/traps.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Julien Grall Aug. 9, 2017, 9:56 a.m. UTC | #1
Hi,

On 08/08/17 21:08, Volodymyr Babchuk wrote:
> On certain ARM arhcitectures SMC instruction can be conditional
> (ARM DDI 0487A.k page D7-1949) and we need to check if that
> conditional was meet.
>
> Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> ---
> This patch was separated from the next one

Nowhere in this series you mention the dependencies on your other series 
[1]. This patch should not be merged until [1] has been merged.

Cheers,

>
> ---
>  xen/arch/arm/traps.c | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
> index 0171c1c..e14e7c0 100644
> --- a/xen/arch/arm/traps.c
> +++ b/xen/arch/arm/traps.c
> @@ -2773,6 +2773,12 @@ static void do_trap_smc(struct cpu_user_regs *regs, const union hsr hsr)
>  {
>      int rc = 0;
>
> +    if ( !check_conditional_instr(regs, hsr) )
> +    {
> +        advance_pc(regs, hsr);
> +        return;
> +    }
> +
>      if ( current->domain->arch.monitor.privileged_call_enabled )
>          rc = monitor_smc();
>
>

[1] 
https://lists.xenproject.org/archives/html/xen-devel/2017-07/msg02988.html
diff mbox

Patch

diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index 0171c1c..e14e7c0 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -2773,6 +2773,12 @@  static void do_trap_smc(struct cpu_user_regs *regs, const union hsr hsr)
 {
     int rc = 0;
 
+    if ( !check_conditional_instr(regs, hsr) )
+    {
+        advance_pc(regs, hsr);
+        return;
+    }
+
     if ( current->domain->arch.monitor.privileged_call_enabled )
         rc = monitor_smc();