[Xen-devel,07/13] xen/arm: vgic: Clean-up the sysreg emulation

Message ID 1481114033-11024-8-git-send-email-julien.grall@arm.com
State New
Headers show

Commit Message

Julien Grall Dec. 7, 2016, 12:33 p.m.
Couple of clean-up for the vgic sysreg emulation:
    - Reference the public documentation rather than a non-public one
    - Let the vgic emulation decides whether a register needs to be
    emulated
    - Drop unnecessary debug printk. They don't bring much information
    and can be misleading (vGICv2 does not support thoses registers)

Signed-off-by: Julien Grall <julien.grall@arm.com>
---
 xen/arch/arm/traps.c | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

Comments

Stefano Stabellini Dec. 7, 2016, 10:08 p.m. | #1
On Wed, 7 Dec 2016, Julien Grall wrote:
> Couple of clean-up for the vgic sysreg emulation:
>     - Reference the public documentation rather than a non-public one
>     - Let the vgic emulation decides whether a register needs to be
>     emulated
>     - Drop unnecessary debug printk. They don't bring much information
>     and can be misleading (vGICv2 does not support thoses registers)
> 
> Signed-off-by: Julien Grall <julien.grall@arm.com>

Aside from a couple of typos in the commit message that I'll fix.

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


>  xen/arch/arm/traps.c | 16 ++++------------
>  1 file changed, 4 insertions(+), 12 deletions(-)
> 
> diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
> index fb07ae1..1fe02cb 100644
> --- a/xen/arch/arm/traps.c
> +++ b/xen/arch/arm/traps.c
> @@ -2261,23 +2261,15 @@ static void do_sysreg(struct cpu_user_regs *regs,
>      /*
>       * HCR_EL2.FMO or HCR_EL2.IMO
>       *
> -     * ARMv8: GIC Architecture Specification (PRD03-GENC-010745 24.0)
> -     *        Section 4.6.8.
> +     * GIC Architecture Specification (IHI 0069C): Section 4.6.3
>       */
>      case HSR_SYSREG_ICC_SGI1R_EL1:
> +    case HSR_SYSREG_ICC_ASGI1R_EL1:
> +    case HSR_SYSREG_ICC_SGI0R_EL1:
> +
>          if ( !vgic_emulate(regs, hsr) )
> -        {
> -            dprintk(XENLOG_WARNING,
> -                    "failed emulation of sysreg ICC_SGI1R_EL1 access\n");
>              return inject_undef64_exception(regs, hsr.len);
> -        }
>          break;
> -    case HSR_SYSREG_ICC_SGI0R_EL1:
> -    case HSR_SYSREG_ICC_ASGI1R_EL1:
> -        /* TBD: Implement to support secure grp0/1 SGI forwarding */
> -        dprintk(XENLOG_WARNING,
> -                "Emulation of sysreg ICC_SGI0R_EL1/ASGI1R_EL1 not supported\n");
> -        return inject_undef64_exception(regs, hsr.len);
>  
>      /*
>       *  ICC_SRE_EL2.Enable = 0
> -- 
> 1.9.1
>

Patch hide | download patch | download mbox

diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index fb07ae1..1fe02cb 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -2261,23 +2261,15 @@  static void do_sysreg(struct cpu_user_regs *regs,
     /*
      * HCR_EL2.FMO or HCR_EL2.IMO
      *
-     * ARMv8: GIC Architecture Specification (PRD03-GENC-010745 24.0)
-     *        Section 4.6.8.
+     * GIC Architecture Specification (IHI 0069C): Section 4.6.3
      */
     case HSR_SYSREG_ICC_SGI1R_EL1:
+    case HSR_SYSREG_ICC_ASGI1R_EL1:
+    case HSR_SYSREG_ICC_SGI0R_EL1:
+
         if ( !vgic_emulate(regs, hsr) )
-        {
-            dprintk(XENLOG_WARNING,
-                    "failed emulation of sysreg ICC_SGI1R_EL1 access\n");
             return inject_undef64_exception(regs, hsr.len);
-        }
         break;
-    case HSR_SYSREG_ICC_SGI0R_EL1:
-    case HSR_SYSREG_ICC_ASGI1R_EL1:
-        /* TBD: Implement to support secure grp0/1 SGI forwarding */
-        dprintk(XENLOG_WARNING,
-                "Emulation of sysreg ICC_SGI0R_EL1/ASGI1R_EL1 not supported\n");
-        return inject_undef64_exception(regs, hsr.len);
 
     /*
      *  ICC_SRE_EL2.Enable = 0