[PATCH v1 0/3] xen/arm: Add option to optionally disable trapping on unmapped mmio

Edgar E. Iglesias posted 3 patches 5 months ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/20250527195616.874614-1-edgar.iglesias@gmail.com
docs/man/xl.cfg.5.pod.in              |  6 +++++
docs/misc/arm/device-tree/booting.txt |  7 ++++++
tools/golang/xenlight/helpers.gen.go  |  3 ++-
tools/golang/xenlight/types.gen.go    |  1 +
tools/libs/light/libxl_arm.c          |  7 ++++++
tools/libs/light/libxl_types.idl      |  1 +
tools/xl/xl_parse.c                   |  3 +++
xen/arch/arm/dom0less-build.c         |  4 ++++
xen/arch/arm/domain.c                 |  2 ++
xen/arch/arm/domain_build.c           |  3 +++
xen/arch/arm/include/asm/domain.h     |  2 ++
xen/arch/arm/io.c                     | 33 +++++++++++++++++++++++++--
xen/include/public/arch-arm.h         |  9 ++++++++
13 files changed, 78 insertions(+), 3 deletions(-)
[PATCH v1 0/3] xen/arm: Add option to optionally disable trapping on unmapped mmio
Posted by Edgar E. Iglesias 5 months ago
From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>

This follows up on the virtio-pci discussion and adds a per-domain
option to select the behaviour of accesses to unmapped mmio ranges.
The new option is trap-unmapped-mmio. For dom0less I negated it to
be able to use a boolean prop and keep existing behaviour, i.e
trap-unmapped-mmio-disabled.

I'm happy with any name though so if you have better ideas please
suggest them!

For the domain config i followed the example of x86 flags
and XEN_X86_MSR_RELXED, creating a flags field for ARM.

Thanks,
Edgar

Edgar E. Iglesias (3):
  xen/arm: Add a way to disable traps on unmapped MMIO
  xen/arm: dom0less: Add trap-unmapped-mmio-disabled
  tools/arm: Add the trap_unmapped_mmio xl config option

 docs/man/xl.cfg.5.pod.in              |  6 +++++
 docs/misc/arm/device-tree/booting.txt |  7 ++++++
 tools/golang/xenlight/helpers.gen.go  |  3 ++-
 tools/golang/xenlight/types.gen.go    |  1 +
 tools/libs/light/libxl_arm.c          |  7 ++++++
 tools/libs/light/libxl_types.idl      |  1 +
 tools/xl/xl_parse.c                   |  3 +++
 xen/arch/arm/dom0less-build.c         |  4 ++++
 xen/arch/arm/domain.c                 |  2 ++
 xen/arch/arm/domain_build.c           |  3 +++
 xen/arch/arm/include/asm/domain.h     |  2 ++
 xen/arch/arm/io.c                     | 33 +++++++++++++++++++++++++--
 xen/include/public/arch-arm.h         |  9 ++++++++
 13 files changed, 78 insertions(+), 3 deletions(-)

-- 
2.43.0
Re: [PATCH v1 0/3] xen/arm: Add option to optionally disable trapping on unmapped mmio
Posted by Andrew Cooper 5 months ago
On 27/05/2025 8:56 pm, Edgar E. Iglesias wrote:
> From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>
>
> This follows up on the virtio-pci discussion and adds a per-domain
> option to select the behaviour of accesses to unmapped mmio ranges.
> The new option is trap-unmapped-mmio. For dom0less I negated it to
> be able to use a boolean prop and keep existing behaviour, i.e
> trap-unmapped-mmio-disabled.
>
> I'm happy with any name though so if you have better ideas please
> suggest them!
>
> For the domain config i followed the example of x86 flags
> and XEN_X86_MSR_RELXED, creating a flags field for ARM.
>
> Thanks,
> Edgar

I think this should be common, rather than ARM specific.

Traditionally on x86, access to unimplemented address space was ignored
(write discard, read ~0), but these days you do get a machine check on
certain ranges, which is for all intents and purposes the same as a data
abort.

So even if x86 requires it to be false in the short term, I think the
control ought to be common, so x86 and others can opt in at a later point.

I don't have a good suggestion for the name, but it's not really about
MMIO space; it's about address space generally.

~Andrew
Re: [PATCH v1 0/3] xen/arm: Add option to optionally disable trapping on unmapped mmio
Posted by Edgar E. Iglesias 5 months ago
On Tue, May 27, 2025 at 09:03:11PM +0100, Andrew Cooper wrote:
> On 27/05/2025 8:56 pm, Edgar E. Iglesias wrote:
> > From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>
> >
> > This follows up on the virtio-pci discussion and adds a per-domain
> > option to select the behaviour of accesses to unmapped mmio ranges.
> > The new option is trap-unmapped-mmio. For dom0less I negated it to
> > be able to use a boolean prop and keep existing behaviour, i.e
> > trap-unmapped-mmio-disabled.
> >
> > I'm happy with any name though so if you have better ideas please
> > suggest them!
> >
> > For the domain config i followed the example of x86 flags
> > and XEN_X86_MSR_RELXED, creating a flags field for ARM.
> >
> > Thanks,
> > Edgar
> 
> I think this should be common, rather than ARM specific.
> 
> Traditionally on x86, access to unimplemented address space was ignored
> (write discard, read ~0), but these days you do get a machine check on
> certain ranges, which is for all intents and purposes the same as a data
> abort.
> 
> So even if x86 requires it to be false in the short term, I think the
> control ought to be common, so x86 and others can opt in at a later point.

We can do that, we'd need to have different default values though since
x86 wants default false and ARM default true.

> 
> I don't have a good suggestion for the name, but it's not really about
> MMIO space; it's about address space generally.

What about trap-unmapped-access ?

Cheers,
Edgar