All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
To: <sstabellini@kernel.org>, <bertrand.marquis@arm.com>,
	<michal.orzel@amd.com>, <ayan.kumar.halder@amd.com>,
	<Volodymyr_Babchuk@epam.com>, <julien@xen.org>,
	<jbeulich@suse.com>
Cc: <xen-devel@lists.xenproject.org>
Subject: [PATCH v3 4/4] xen: arm: Enclose access to EL2 MMU specific registers under CONFIG_MMU
Date: Tue, 13 Aug 2024 18:13:56 +0100	[thread overview]
Message-ID: <20240813171356.46760-5-ayan.kumar.halder@amd.com> (raw)
In-Reply-To: <20240813171356.46760-1-ayan.kumar.halder@amd.com>

All the EL2 MMU specific registers are enclosed within CONFIG_MMU.

Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
---
Changes from :

v1 -
1. 'vttbr_el2' field is enclosed with ifdef.
2. No movement of code.

v2 -
1. Enclosed 'vttbr_el2' access in show_registers() and vcpu_show_registers().

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

diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index aac6c599f8..737f4d65e3 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -720,8 +720,10 @@ struct reg_ctxt {
     uint32_t ifsr32_el2;
 #endif
 
+#ifdef CONFIG_MMU
     /* Hypervisor-side state */
     uint64_t vttbr_el2;
+#endif
 };
 
 static const char *mode_string(register_t cpsr)
@@ -919,12 +921,16 @@ static void _show_registers(const struct cpu_user_regs *regs,
 #endif
     }
     printk("  VTCR_EL2: %"PRIregister"\n", READ_SYSREG(VTCR_EL2));
+#ifdef CONFIG_MMU
     printk(" VTTBR_EL2: %016"PRIx64"\n", ctxt->vttbr_el2);
+#endif
     printk("\n");
 
     printk(" SCTLR_EL2: %"PRIregister"\n", READ_SYSREG(SCTLR_EL2));
     printk("   HCR_EL2: %"PRIregister"\n", READ_SYSREG(HCR_EL2));
+#ifdef CONFIG_MMU
     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 +962,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);
 }
@@ -979,7 +987,9 @@ void vcpu_show_registers(const struct vcpu *v)
     ctxt.ifsr32_el2 = v->arch.ifsr;
 #endif
 
+#ifdef CONFIG_MMU
     ctxt.vttbr_el2 = v->domain->arch.p2m.vttbr;
+#endif
 
     _show_registers(&v->arch.cpu_info->guest_cpu_user_regs, &ctxt, 1, v);
 }
-- 
2.25.1



  parent reply	other threads:[~2024-08-13 17:14 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-13 17:13 [PATCH v3 0/4] xen: arm: Split MMU code in preparation for MPU work (part 2) Ayan Kumar Halder
2024-08-13 17:13 ` [PATCH v3 1/4] xen: arm: Add a new helper update_boot_mapping() Ayan Kumar Halder
2024-08-14 12:50   ` Michal Orzel
2024-08-20 11:27     ` Ayan Kumar Halder
2024-08-13 17:13 ` [PATCH v3 2/4] xen: make VMAP only support in MMU system Ayan Kumar Halder
2024-08-14  6:37   ` Jan Beulich
2024-08-14 10:55     ` Ayan Kumar Halder
2024-08-14 11:35       ` Jan Beulich
2024-08-14 12:33         ` Ayan Kumar Halder
2024-08-14 13:04           ` Jan Beulich
2024-08-16  9:28           ` Michal Orzel
2024-08-16 16:00             ` Ayan Kumar Halder
2024-08-16 16:40           ` Julien Grall
2024-08-19  9:45             ` Ayan Kumar Halder
2024-08-19  9:55               ` Julien Grall
2024-08-19  9:58                 ` Julien Grall
2024-08-20 11:48                   ` Ayan Kumar Halder
2024-08-20 12:51                     ` Jan Beulich
2024-08-19 11:39               ` Jan Beulich
2024-08-19 12:12                 ` Julien Grall
2024-08-19 12:24                   ` Jan Beulich
2024-08-19 13:01                     ` Julien Grall
2024-08-13 17:13 ` [PATCH v3 3/4] xen: arm: Move the functions of domain_page to MMU specific Ayan Kumar Halder
2024-08-14 12:59   ` Michal Orzel
2024-08-13 17:13 ` Ayan Kumar Halder [this message]
2024-08-14 13:07   ` [PATCH v3 4/4] xen: arm: Enclose access to EL2 MMU specific registers under CONFIG_MMU Michal Orzel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240813171356.46760-5-ayan.kumar.halder@amd.com \
    --to=ayan.kumar.halder@amd.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=bertrand.marquis@arm.com \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=michal.orzel@amd.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.