public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Yong Wu <yong.wu@mediatek.com>
To: Robin Murphy <robin.murphy@arm.com>
Cc: youlin.pei@mediatek.com, Nicolas Boichat <drinkcat@chromium.org>,
	srv_heupstream@mediatek.com, Joerg Roedel <joro@8bytes.org>,
	Will Deacon <will.deacon@arm.com>,
	linux-kernel@vger.kernel.org, Stephen Boyd <swboyd@chromium.org>,
	Tomasz Figa <tfiga@google.com>,
	iommu@lists.linux-foundation.org, CK Hu <ck.hu@mediatek.com>,
	linux-mediatek@lists.infradead.org,
	Matthias Brugger <matthias.bgg@gmail.com>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] iommu/io-pgtable-arm-v7s: Don't check PHYS_OFFSET if RAMDOMIZE_BASE is enabled
Date: Thu, 13 Dec 2018 10:24:15 +0800	[thread overview]
Message-ID: <1544667855.8755.7.camel@mhfsdcap03> (raw)
In-Reply-To: <50292758-47b1-1d08-5827-f7bdb3c33e1c@arm.com>

On Wed, 2018-12-12 at 13:39 +0000, Robin Murphy wrote:
> On 12/12/2018 13:02, Yong Wu wrote:
> > If CONFIG_RANDOMIZE_BASE is enabled, the "memstart_addr" will be updated
> > randomly, then the PHYS_OFFSET may be random.
> 
> Oh, I hadn't ever realised that, good catch. However, since 29859aeb8a6e 
> I think we should probably just remove this check altogether.

Thanks the hint. It looks that I only need revert 82db33dc5e49.

> 
> > Fixes: 82db33dc5e49 ("iommu/io-pgtable-arm: Check for v7s-incapable
> > systems")
> 
> Note that this alone wouldn't be sufficient for stable prior to 4.18, 
> since CONFIG_RANDOMIZE_BASE would then allow the original crash to 
> happen again.

Yes. the problem always exist. Nicolas is fixing this. I will delete the
tag here.

> 
> Robin.
> 
> > Reported-by: CK Hu <ck.hu@mediatek.com>
> > Signed-off-by: Yong Wu <yong.wu@mediatek.com>
> > ---
> >   drivers/iommu/io-pgtable-arm-v7s.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/iommu/io-pgtable-arm-v7s.c b/drivers/iommu/io-pgtable-arm-v7s.c
> > index 445c3bd..70941e6 100644
> > --- a/drivers/iommu/io-pgtable-arm-v7s.c
> > +++ b/drivers/iommu/io-pgtable-arm-v7s.c
> > @@ -709,7 +709,7 @@ static struct io_pgtable *arm_v7s_alloc_pgtable(struct io_pgtable_cfg *cfg,
> >   {
> >   	struct arm_v7s_io_pgtable *data;
> >   
> > -#ifdef PHYS_OFFSET
> > +#if defined(PHYS_OFFSET) && !defined(CONFIG_RANDOMIZE_BASE)
> >   	if (upper_32_bits(PHYS_OFFSET))
> >   		return NULL;
> >   #endif
> > 
> 
> _______________________________________________
> Linux-mediatek mailing list
> Linux-mediatek@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-mediatek



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

      reply	other threads:[~2018-12-13  2:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-12 13:02 [PATCH] iommu/io-pgtable-arm-v7s: Don't check PHYS_OFFSET if RAMDOMIZE_BASE is enabled Yong Wu
2018-12-12 13:39 ` Robin Murphy
2018-12-13  2:24   ` Yong Wu [this message]

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=1544667855.8755.7.camel@mhfsdcap03 \
    --to=yong.wu@mediatek.com \
    --cc=ck.hu@mediatek.com \
    --cc=drinkcat@chromium.org \
    --cc=iommu@lists.linux-foundation.org \
    --cc=joro@8bytes.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=robin.murphy@arm.com \
    --cc=srv_heupstream@mediatek.com \
    --cc=swboyd@chromium.org \
    --cc=tfiga@google.com \
    --cc=will.deacon@arm.com \
    --cc=youlin.pei@mediatek.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox