All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: Julien Grall <julien@xen.org>
Cc: xen-devel@lists.xenproject.org, sstabellini@kernel.org,
	bertrand.marquis@arm.com, michal.orzel@amd.com,
	Volodymyr_Babchuk@epam.com, andrew.cooper3@citrix.com,
	edgar.iglesias@amd.com
Subject: Re: [PATCH v2 2/3] xen/arm: dom0less: Add trap-unmapped-accesses
Date: Thu, 29 May 2025 18:30:26 +0200	[thread overview]
Message-ID: <aDiLosXtgTUHZdSv@zapote> (raw)
In-Reply-To: <8c93db26-fd37-4e37-9822-54986e5ee3cc@xen.org>

On Thu, May 29, 2025 at 05:03:12PM +0100, Julien Grall wrote:
> Hi Edgar,
> 
> On 29/05/2025 16:50, Edgar E. Iglesias wrote:
> > From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>
> > 
> > Add the trap-unmapped-accesses per-domain fdt property.
> > 
> > Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
> > ---
> >   docs/misc/arm/device-tree/booting.txt | 9 +++++++++
> >   xen/arch/arm/dom0less-build.c         | 9 ++++++++-
> >   2 files changed, 17 insertions(+), 1 deletion(-)
> > 
> > diff --git a/docs/misc/arm/device-tree/booting.txt b/docs/misc/arm/device-tree/booting.txt
> > index 59fa96a82e..8a5c40ddf3 100644
> > --- a/docs/misc/arm/device-tree/booting.txt
> > +++ b/docs/misc/arm/device-tree/booting.txt
> > @@ -225,6 +225,15 @@ with the following properties:
> >       option is provided with a non zero value, but the platform doesn't support
> >       SVE.
> > +- trap-unmapped-accesses
> > +
> > +    Optional. An integer that configures handling of accesses to unmapped
> > +    address ranges.
> > +    If set to 0, guest accesses will read 0xFFFFFFFF and writes will be ignored.
> 
> Looking at the code, if I am not mistaken, it will only return this value
> for 32-bit. For 64-bit there will be a few Fs more and for less there will
> be less. So I think this needs to be reworded.
> 
> The rest looks good to me.

Thanks, in v3 I'll change it to:
    If set to 0, guest accesses will read all bits as ones, e.g 0xFFFFFFFF
    for a 32bit access and writes will be ignored.

Cheers,
Edgar

> 
> > +
> > +    This option is only implemented for ARM where the default is 1.
> > +
> >   - xen,enhanced
> >       A string property. Possible property values are:
> > diff --git a/xen/arch/arm/dom0less-build.c b/xen/arch/arm/dom0less-build.c
> > index a4e0a33632..69324aa597 100644
> > --- a/xen/arch/arm/dom0less-build.c
> > +++ b/xen/arch/arm/dom0less-build.c
> > @@ -344,8 +344,15 @@ void __init arch_create_domUs(struct dt_device_node *node,
> >   #endif
> >       }
> > -    /* Trap accesses to unmapped areas. */
> > +    /* Trap unmapped accesses by default. */
> >       d_cfg->flags |= XEN_DOMCTL_CDF_trap_unmapped_accesses;
> > +    if ( dt_property_read_u32(node, "trap-unmapped-accesses", &val) )
> > +    {
> > +        if ( val > 1 )
> > +            panic("trap-unmapped-accesses: supported values are 0 or 1");
> > +        if ( !val )
> > +            d_cfg->flags &= ~XEN_DOMCTL_CDF_trap_unmapped_accesses;
> > +    }
> >   }
> >   int __init init_intc_phandle(struct kernel_info *kinfo, const char *name,
> 
> Cheers,
> 
> -- 
> Julien Grall
> 


  reply	other threads:[~2025-05-29 16:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-29 15:50 [PATCH v2 0/3] xen/arm: Add option to optionally disable trapping on unmapped acceses Edgar E. Iglesias
2025-05-29 15:50 ` [PATCH v2 1/3] xen/arm: Add way to disable traps on accesses to unmapped addresses Edgar E. Iglesias
2025-05-29 15:59   ` Julien Grall
2025-05-29 16:23     ` Edgar E. Iglesias
2025-05-30  9:01       ` Julien Grall
2025-05-30 13:47         ` Edgar E. Iglesias
2025-05-29 15:50 ` [PATCH v2 2/3] xen/arm: dom0less: Add trap-unmapped-accesses Edgar E. Iglesias
2025-05-29 16:03   ` Julien Grall
2025-05-29 16:30     ` Edgar E. Iglesias [this message]
2025-05-29 15:50 ` [PATCH v2 3/3] tools/arm: Add the trap_unmapped_accesses xl config option Edgar E. Iglesias

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=aDiLosXtgTUHZdSv@zapote \
    --to=edgar.iglesias@gmail.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=bertrand.marquis@arm.com \
    --cc=edgar.iglesias@amd.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.