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

Re: [Xen-devel] [PATCH 8/9] xen/arm: traps: Avoid unnecessary VA -> IPA translation in abort handlers





On 14/07/16 16:27, Stefano Stabellini wrote:
On Wed, 22 Jun 2016, Julien Grall wrote:
diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index 591de3c..0edc2cc 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -2383,13 +2383,28 @@ static inline paddr_t get_faulting_ipa(vaddr_t gva)

[..]

  static void do_trap_instr_abort_guest(struct cpu_user_regs *regs,
                                        const union hsr hsr)
  {
      int rc;
      register_t gva = READ_SYSREG(FAR_EL2);
+    uint8_t fsc = hsr.iabt.ifsc & ~FSC_LL_MASK;

-    switch ( hsr.iabt.ifsc & ~FSC_LL_MASK )
+    switch ( fsc )
      {
      case FSC_FLT_PERM:
      {
@@ -2400,7 +2415,7 @@ static void do_trap_instr_abort_guest(struct 
cpu_user_regs *regs,
              .kind = hsr.iabt.s1ptw ? npfec_kind_in_gpt : npfec_kind_with_gla
          };

-        if ( hsr.iabt.s1ptw )
+        if ( hpfar_is_valid(hsr.iabt.s1ptw, fsc) )
              gpa = get_faulting_ipa(gva);
          else
          {
@@ -2435,6 +2450,7 @@ static void do_trap_data_abort_guest(struct cpu_user_regs 
*regs,
      const struct hsr_dabt dabt = hsr.dabt;
      int rc;
      mmio_info_t info;
+    uint8_t fsc = hsr.dabt.dfsc & ~FSC_LL_MASK;

You should be able to modify the switch in this case too, right?

Correct. I am thinking to pull the changes in patch #4 to avoid extra-changes in this patch.

Regards,

--
Julien Grall

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

 


Rackspace

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