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

Re: [PATCH v1 4/4] xen: arm: Enclose access to EL2 MMU specific registers under CONFIG_MMU



Hi,

On 02/08/2024 13:14, Ayan Kumar Halder wrote:
All the EL2 MMU specific registers are enclosed within CONFIG_MMU.

Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>
---
  xen/arch/arm/traps.c | 6 +++++-
  1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index aac6c599f8..766aacee77 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -919,12 +919,14 @@ static void _show_registers(const struct cpu_user_regs 
*regs,
  #endif
      }
      printk("  VTCR_EL2: %"PRIregister"\n", READ_SYSREG(VTCR_EL2));
-    printk(" VTTBR_EL2: %016"PRIx64"\n", ctxt->vttbr_el2);

Can you #ifdef the field vttrb_el2 if it is not meant to be used?

      printk("\n");
printk(" SCTLR_EL2: %"PRIregister"\n", READ_SYSREG(SCTLR_EL2));
      printk("   HCR_EL2: %"PRIregister"\n", READ_SYSREG(HCR_EL2));
+#ifdef CONFIG_MMU
+    printk(" VTTBR_EL2: %016"PRIx64"\n", ctxt->vttbr_el2);

VTCR_EL2 and VTTBR_EL2 needs to be read together. So I would prefer the printk is not moved.

      printk(" TTBR0_EL2: %016"PRIx64"\n", READ_SYSREG64(TTBR0_EL2));
+#endif
> printk("\n");> printk(" ESR_EL2: %"PRIregister"\n", regs->hsr);
      printk(" HPFAR_EL2: %"PRIregister"\n", READ_SYSREG(HPFAR_EL2));
@@ -956,7 +958,9 @@ void show_registers(const struct cpu_user_regs *regs)
      if ( guest_mode(regs) && is_32bit_domain(current->domain) )
          ctxt.ifsr32_el2 = READ_SYSREG(IFSR32_EL2);
  #endif
+#ifdef CONFIG_MMU
      ctxt.vttbr_el2 = READ_SYSREG64(VTTBR_EL2);
+#endif
_show_registers(regs, &ctxt, guest_mode(regs), current);
  }

Cheers,

--
Julien Grall




 


Rackspace

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