[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 06/19] xen: arm: add minimum exception level argument to trap handler helpers



Hi Ian,

On 31/03/2015 12:07, Ian Campbell wrote:
Removes a load of boiler plate.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
  xen/arch/arm/traps.c |   65 +++++++++++++++++++++++++-------------------------
  1 file changed, 32 insertions(+), 33 deletions(-)

diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index ebc09f9..c9c98d3 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -1578,8 +1578,12 @@ static void advance_pc(struct cpu_user_regs *regs, const 
union hsr hsr)
  static void handle_raz_wi(struct cpu_user_regs *regs,
                            register_t *reg,
                            bool_t read,
-                          const union hsr hsr)
+                          const union hsr hsr,
+                          int min_el)
  {

I would add an ASSERT((min_el == 0) || (min_el == 1)) in order to make clear that min_el should be either EL0 or EL1.

+    if ( min_el > 0 && psr_mode_is_user(regs) )
+        return inject_undef_exception(regs, hsr);
+
      if ( read )
          *reg = 0;
      /* else: write ignored */
@@ -1591,8 +1595,12 @@ static void handle_raz_wi(struct cpu_user_regs *regs,
  static void handle_wo_wi(struct cpu_user_regs *regs,
                           register_t *reg,
                           bool_t read,
-                         const union hsr hsr)
+                         const union hsr hsr,
+                         int min_el)
  {

Ditto

+    if ( min_el > 0 && psr_mode_is_user(regs) )
+        return inject_undef_exception(regs, hsr);
+
      if ( read )
          return inject_undef_exception(regs, hsr);
      /* else: ignore */
@@ -1604,8 +1612,12 @@ static void handle_wo_wi(struct cpu_user_regs *regs,
  static void handle_ro_raz(struct cpu_user_regs *regs,
                            register_t *reg,
                            bool_t read,
-                          const union hsr hsr)
+                          const union hsr hsr,
+                          int min_el)
  {

Ditto

+    if ( min_el > 0 && psr_mode_is_user(regs) )
+        return inject_undef_exception(regs, hsr);
+
      if ( !read )
          return inject_undef_exception(regs, hsr);
      /* else: raz */

Regards,

--
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.