All of lore.kernel.org
 help / color / mirror / Atom feed
From: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
To: Stefano Stabellini <stefano.stabellini@amd.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>
Subject: Re: [PATCH v2 1/4] xen/arm: guest_walk: refuse a block descriptor where the granule has none
Date: Wed, 18 Nov 2026 02:04:56 +0000	[thread overview]
Message-ID: <87v75unbco.fsf@epam.com> (raw)
In-Reply-To: <b29ceab6082cae0336e56c6695e661b0c8e12813.1794962603.git.stefano.stabellini@amd.com>

Hello Stefano,

Stefano Stabellini <stefano.stabellini@amd.com> writes:

> guest_walk_ld() accepted a block descriptor at any level. No granule has
> level 0 blocks, and the 16KB and 64KB granules have no level 1 blocks
> (ARM DDI 0487 M.d D8.3.1.2): the translation table walk makes such an
> entry a Translation fault (AArch64.BlockDescSupported()). Refuse it.
>
> The check is only valid without 52-bit support (FEAT_LPA, FEAT_LPA2).
> Note in get_ipa_output_size() that 52-bit support requires updating it.
>
> Fixes: 7d623b358a45 ("arm/mem_access: Add long-descriptor based gpt")
> Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>

Reviewed-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>

> ---
> Cc: Julien Grall <julien@xen.org>
> Cc: Bertrand Marquis <bertrand.marquis@arm.com>
> Cc: Michal Orzel <michal.orzel@amd.com>
> Cc: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
>
> Changes in v2:
> - Cite ARM DDI 0487 M.d instead of A.k.
> - Say in the commit message and the comment that the check is only
>   valid without 52-bit support (FEAT_LPA, FEAT_LPA2), and note in
>   get_ipa_output_size() that 52-bit support requires updating it.
> - Move the Cc list after ---.
> ---
>  xen/arch/arm/guest_walk.c | 14 +++++++++++++-
>  1 file changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/xen/arch/arm/guest_walk.c b/xen/arch/arm/guest_walk.c
> index 09fe486598..151b837541 100644
> --- a/xen/arch/arm/guest_walk.c
> +++ b/xen/arch/arm/guest_walk.c
> @@ -201,7 +201,8 @@ static int get_ipa_output_size(struct domain *d, register_t tcr,
>           * Return an error on reserved IPA output-sizes and if the IPA
>           * output-size is 52bit.
>           *
> -         * XXX: 52 bit output-size is not supported yet.
> +         * XXX: 52 bit output-size is not supported yet. Supporting it also
> +         * requires updating the block descriptor check in guest_walk_ld().
>           */
>          if ( ips > TCR_EL1_IPS_48_BIT )
>              return -EFAULT;
> @@ -533,6 +534,17 @@ static bool guest_walk_ld(const struct vcpu *v,
>      if ( !lpae_is_valid(pte) || !lpae_is_mapping(pte, level) )
>          return false;
>  
> +    /*
> +     * A block descriptor is only supported at level 1 and level 2 with the
> +     * 4KB granule, and only at level 2 with the 16KB and 64KB granules (ARM
> +     * DDI 0487 M.d D8.3.1.2). The block encoding at any other level generates
> +     * a Translation fault (AArch64.BlockDescSupported()).
> +     *
> +     * This is only valid without 52-bit support (FEAT_LPA, FEAT_LPA2).
> +     */
> +    if ( level == 0 || (level == 1 && gran != GRANULE_SIZE_INDEX_4K) )
> +        return false;
> +
>      /* Make sure that the lower bits of the PTE's base address are zero. */
>      mask = GENMASK_ULL(47, grainsizes[gran]);
>      *ipa = (pfn_to_paddr(pte.walk.base) & mask) |

-- 
WBR, Volodymyr

  reply	other threads:[~2026-11-18  2:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1794962603.git.stefano.stabellini@amd.com>
2026-11-18  0:59 ` [PATCH v2 1/4] xen/arm: guest_walk: refuse a block descriptor where the granule has none Stefano Stabellini
2026-11-18  2:04   ` Volodymyr Babchuk [this message]
2026-11-18  0:59 ` [PATCH v2 2/4] xen/arm: guest_walk: refuse an address outside both halves of the range Stefano Stabellini
2026-11-18  2:10   ` Volodymyr Babchuk
2026-11-18  0:59 ` [PATCH v2 3/4] xen/arm: traps: enter the SP_EL0 vector group for an exception at EL1t Stefano Stabellini
2026-11-18  0:59 ` [PATCH v2 4/4] vpci/header: empty the BAR range sets when modify_bars() fails Stefano Stabellini

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=87v75unbco.fsf@epam.com \
    --to=volodymyr_babchuk@epam.com \
    --cc=bertrand.marquis@arm.com \
    --cc=julien@xen.org \
    --cc=michal.orzel@amd.com \
    --cc=stefano.stabellini@amd.com \
    --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.