diff mbox

[v3,20/38] arm/p2m: Add p2m_get_active_p2m macro

Message ID 20160816221714.22041-21-proskurin@sec.in.tum.de (mailing list archive)
State New, archived
Headers show

Commit Message

Sergej Proskurin Aug. 16, 2016, 10:16 p.m. UTC
This commit introduces the macro "p2m_get_active_p2m" returning the
currently active (alt)p2m. The need for this macro will be shown in the
following commits.

Signed-off-by: Sergej Proskurin <proskurin@sec.in.tum.de>
---
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Julien Grall <julien.grall@arm.com>
---
 xen/arch/arm/p2m.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Julien Grall Sept. 12, 2016, 8:50 a.m. UTC | #1
Hello Sergej,

On 16/08/2016 23:16, Sergej Proskurin wrote:
> This commit introduces the macro "p2m_get_active_p2m" returning the
> currently active (alt)p2m. The need for this macro will be shown in the
> following commits.
>
> Signed-off-by: Sergej Proskurin <proskurin@sec.in.tum.de>

Acked-by: Julien Grall <julien.grall@arm.com>

Regards,

> ---
> Cc: Stefano Stabellini <sstabellini@kernel.org>
> Cc: Julien Grall <julien.grall@arm.com>
> ---
>  xen/arch/arm/p2m.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
> index 63c0df0..12b3dcc 100644
> --- a/xen/arch/arm/p2m.c
> +++ b/xen/arch/arm/p2m.c
> @@ -29,6 +29,9 @@ static unsigned int __read_mostly p2m_root_level;
>
>  #define P2M_ROOT_PAGES    (1<<P2M_ROOT_ORDER)
>
> +#define p2m_get_active_p2m(v) unlikely(altp2m_active(v->domain)) ?  \
> +                              altp2m_get_altp2m(v) : p2m_get_hostp2m(v->domain);
> +
>  #define p2m_switch_vttbr_and_get_flags(ovttbr, nvttbr, flags)       \
>  ({                                                                  \
>      if ( ovttbr != nvttbr )                                         \
>
diff mbox

Patch

diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index 63c0df0..12b3dcc 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -29,6 +29,9 @@  static unsigned int __read_mostly p2m_root_level;
 
 #define P2M_ROOT_PAGES    (1<<P2M_ROOT_ORDER)
 
+#define p2m_get_active_p2m(v) unlikely(altp2m_active(v->domain)) ?  \
+                              altp2m_get_altp2m(v) : p2m_get_hostp2m(v->domain);
+
 #define p2m_switch_vttbr_and_get_flags(ovttbr, nvttbr, flags)       \
 ({                                                                  \
     if ( ovttbr != nvttbr )                                         \