[PATCH v2 14/15] arm64: drtm: Call UNPROTECT_MEMORY

Jason Gunthorpe jgg at nvidia.com
Wed Oct 21 10:50:10 PDT 2026


On Wed, Oct 21, 2026 at 10:47:26AM -0700, Jonathan Cameron wrote:
> On Fri,  2 Oct 2026 20:31:51 -0300
> Jason Gunthorpe <jgg at nvidia.com> wrote:
> 
> > The stub always requests ARM_DRTM_LAUNCH_DMA_COMPLETE. On a system
> > with an SMMU the COMPLETE option is sanely implemented using the SMMU
> > global abort register. DMA_COMPLETE should be mostly a no-op. It
> > seems to be designed for the region protection mode that Linux does
> > not use.
> > 
> > However, the FW can still do something interesting under it and we
> > should call it. Choose late_initcall as we know the SMMU drivers are
> > loaded by then. If some platform does actually block DMA beyond the
> > SMMU, then this would result in a noisy failure of built-in driver
> > DMA, not a silent security gap.
> > 
> > The platforms I'm aware of are OK with this placement, and it is a
> > reasonable place to start.
> > 
> > Signed-off-by: Jason Gunthorpe <jgg at nvidia.com>
> > ---
> >  arch/arm64/kernel/drtm.c | 39 +++++++++++++++++++++++++++++++++++++++
> >  1 file changed, 39 insertions(+)
> > 
> > diff --git a/arch/arm64/kernel/drtm.c b/arch/arm64/kernel/drtm.c
> > index 14493948a27f0d..6062980a5d9e53 100644
> > --- a/arch/arm64/kernel/drtm.c
> > +++ b/arch/arm64/kernel/drtm.c
> > @@ -3,8 +3,47 @@
> >   *
> >   * Support functions for ARM DEN 0113 "DRTM Architecture for Arm"
> >   */
> > +#include <linux/bug.h>
> >  #include <linux/efi.h>
> > +#include <linux/init.h>
> > +#include <linux/printk.h>
> >  
> >  #include <asm/drtm.h>
> >  
> >  struct arm64_drtm_handoff arm64_drtm_handoff __efi_data_handoff;
> > +
> > +static int __init arm64_drtm_unprotect_memory(void)
> > +{
> > +	s64 status;
> > +
> > +	if (!arm64_drtm_handoff.drtm_enabled)
> > +		return 0;
> > +
> > +	/*
> > +	 * Currently Linux can only fully support a DRTM implementation that
> > +	 * relies only the SMMU.
> 
> That sentence doesn't parse.  relies on maybe?

Yes

Jason



More information about the linux-riscv mailing list