Message ID | 1473938919-31976-10-git-send-email-julien.grall@arm.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Thu, 15 Sep 2016, Julien Grall wrote: > The level shift can be encoded with 8-bit. So it is not necessary to > use paddr_t (i.e 64-bit). > > Signed-off-by: Julien Grall <julien.grall@arm.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org> > --- > Changes in v2: > - Use uint8_t rather than unsigned int > - Replaced paddr_t by uint8_t in p2m_shatter_page > --- > xen/arch/arm/p2m.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c > index b53d4cf..b4f75e8 100644 > --- a/xen/arch/arm/p2m.c > +++ b/xen/arch/arm/p2m.c > @@ -687,14 +687,14 @@ static const paddr_t level_sizes[] = > { ZEROETH_SIZE, FIRST_SIZE, SECOND_SIZE, THIRD_SIZE }; > static const paddr_t level_masks[] = > { ZEROETH_MASK, FIRST_MASK, SECOND_MASK, THIRD_MASK }; > -static const paddr_t level_shifts[] = > +static const uint8_t level_shifts[] = > { ZEROETH_SHIFT, FIRST_SHIFT, SECOND_SHIFT, THIRD_SHIFT }; > > static int p2m_shatter_page(struct p2m_domain *p2m, > lpae_t *entry, > unsigned int level) > { > - const paddr_t level_shift = level_shifts[level]; > + const uint8_t level_shift = level_shifts[level]; > int rc = p2m_create_table(p2m, entry, level_shift - PAGE_SHIFT); > > if ( !rc ) > -- > 1.9.1 >
diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c index b53d4cf..b4f75e8 100644 --- a/xen/arch/arm/p2m.c +++ b/xen/arch/arm/p2m.c @@ -687,14 +687,14 @@ static const paddr_t level_sizes[] = { ZEROETH_SIZE, FIRST_SIZE, SECOND_SIZE, THIRD_SIZE }; static const paddr_t level_masks[] = { ZEROETH_MASK, FIRST_MASK, SECOND_MASK, THIRD_MASK }; -static const paddr_t level_shifts[] = +static const uint8_t level_shifts[] = { ZEROETH_SHIFT, FIRST_SHIFT, SECOND_SHIFT, THIRD_SHIFT }; static int p2m_shatter_page(struct p2m_domain *p2m, lpae_t *entry, unsigned int level) { - const paddr_t level_shift = level_shifts[level]; + const uint8_t level_shift = level_shifts[level]; int rc = p2m_create_table(p2m, entry, level_shift - PAGE_SHIFT); if ( !rc )
The level shift can be encoded with 8-bit. So it is not necessary to use paddr_t (i.e 64-bit). Signed-off-by: Julien Grall <julien.grall@arm.com> --- Changes in v2: - Use uint8_t rather than unsigned int - Replaced paddr_t by uint8_t in p2m_shatter_page --- xen/arch/arm/p2m.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)