All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Raslan, KarimAllah" <karahmed@amazon.de>
To: "will@kernel.org" <will@kernel.org>
Cc: "mark.rutland@arm.com" <mark.rutland@arm.com>,
	"anders.roxell@linaro.org" <anders.roxell@linaro.org>,
	"yuzhao@google.com" <yuzhao@google.com>,
	"ard.biesheuvel@linaro.org" <ard.biesheuvel@linaro.org>,
	"info@metux.net" <info@metux.net>,
	"anshuman.khandual@arm.com" <anshuman.khandual@arm.com>,
	"linux@armlinux.org.uk" <linux@armlinux.org.uk>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"yaojun8558363@gmail.com" <yaojun8558363@gmail.com>,
	"james.morse@arm.com" <james.morse@arm.com>,
	"catalin.marinas@arm.com" <catalin.marinas@arm.com>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	"rppt@linux.ibm.com" <rppt@linux.ibm.com>,
	"robin.murphy@arm.com" <robin.murphy@arm.com>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH] arm: Extend the check for RAM in /dev/mem
Date: Fri, 12 Jul 2019 15:13:38 +0000	[thread overview]
Message-ID: <1562944417.1345.17.camel@amazon.de> (raw)
In-Reply-To: <20190712145711.mxmnuyn6kpv2dr7u@willie-the-truck>

On Fri, 2019-07-12 at 15:57 +0100, Will Deacon wrote:
> On Fri, Jul 12, 2019 at 12:21:21AM +0200, KarimAllah Ahmed wrote:
> > 
> > diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c
> > index 3645f29..cdc3e8e 100644
> > --- a/arch/arm64/mm/mmu.c
> > +++ b/arch/arm64/mm/mmu.c
> > @@ -78,7 +78,7 @@ void set_swapper_pgd(pgd_t *pgdp, pgd_t pgd)
> >  pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
> >  			      unsigned long size, pgprot_t vma_prot)
> >  {
> > -	if (!pfn_valid(pfn))
> > +	if (!memblock_is_memory(__pfn_to_phys(pfn)))
> 
> This looks broken to me, since it will end up returning 'true' for nomap
> memory and we really don't want to map that using writeback attributes.

True, I will fix this by using memblock_is_map_memory instead. That said, do
you have any concerns about this approach in general?

> 
> Will



Amazon Development Center Germany GmbH
Krausenstr. 38
10117 Berlin
Geschaeftsfuehrung: Christian Schlaeger, Ralf Herbrich
Eingetragen am Amtsgericht Charlottenburg unter HRB 149173 B
Sitz: Berlin
Ust-ID: DE 289 237 879


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

WARNING: multiple messages have this Message-ID (diff)
From: "Raslan, KarimAllah" <karahmed@amazon.de>
To: "will@kernel.org" <will@kernel.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"yaojun8558363@gmail.com" <yaojun8558363@gmail.com>,
	"ard.biesheuvel@linaro.org" <ard.biesheuvel@linaro.org>,
	"linux@armlinux.org.uk" <linux@armlinux.org.uk>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	"james.morse@arm.com" <james.morse@arm.com>,
	"robin.murphy@arm.com" <robin.murphy@arm.com>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"mark.rutland@arm.com" <mark.rutland@arm.com>,
	"info@metux.net" <info@metux.net>,
	"catalin.marinas@arm.com" <catalin.marinas@arm.com>,
	"yuzhao@google.com" <yuzhao@google.com>,
	"rppt@linux.ibm.com" <rppt@linux.ibm.com>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"anders.roxell@linaro.org" <anders.roxell@linaro.org>,
	"anshuman.khandual@arm.com" <anshuman.khandual@arm.com>
Subject: Re: [PATCH] arm: Extend the check for RAM in /dev/mem
Date: Fri, 12 Jul 2019 15:13:38 +0000	[thread overview]
Message-ID: <1562944417.1345.17.camel@amazon.de> (raw)
In-Reply-To: <20190712145711.mxmnuyn6kpv2dr7u@willie-the-truck>

On Fri, 2019-07-12 at 15:57 +0100, Will Deacon wrote:
> On Fri, Jul 12, 2019 at 12:21:21AM +0200, KarimAllah Ahmed wrote:
> > 
> > diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c
> > index 3645f29..cdc3e8e 100644
> > --- a/arch/arm64/mm/mmu.c
> > +++ b/arch/arm64/mm/mmu.c
> > @@ -78,7 +78,7 @@ void set_swapper_pgd(pgd_t *pgdp, pgd_t pgd)
> >  pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
> >  			      unsigned long size, pgprot_t vma_prot)
> >  {
> > -	if (!pfn_valid(pfn))
> > +	if (!memblock_is_memory(__pfn_to_phys(pfn)))
> 
> This looks broken to me, since it will end up returning 'true' for nomap
> memory and we really don't want to map that using writeback attributes.

True, I will fix this by using memblock_is_map_memory instead. That said, do
you have any concerns about this approach in general?

> 
> Will



Amazon Development Center Germany GmbH
Krausenstr. 38
10117 Berlin
Geschaeftsfuehrung: Christian Schlaeger, Ralf Herbrich
Eingetragen am Amtsgericht Charlottenburg unter HRB 149173 B
Sitz: Berlin
Ust-ID: DE 289 237 879



  reply	other threads:[~2019-07-12 15:13 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-11 22:21 [PATCH] arm: Extend the check for RAM in /dev/mem KarimAllah Ahmed
2019-07-11 22:21 ` KarimAllah Ahmed
2019-07-12  2:36 ` Anshuman Khandual
2019-07-12  2:36   ` Anshuman Khandual
2019-07-12  2:58   ` Raslan, KarimAllah
2019-07-12  2:58     ` Raslan, KarimAllah
2019-07-12  8:56     ` Russell King - ARM Linux admin
2019-07-12  8:56       ` Russell King - ARM Linux admin
2019-07-12  8:59       ` Raslan, KarimAllah
2019-07-12  8:59         ` Raslan, KarimAllah
2019-07-12 14:57 ` Will Deacon
2019-07-12 14:57   ` Will Deacon
2019-07-12 15:13   ` Raslan, KarimAllah [this message]
2019-07-12 15:13     ` Raslan, KarimAllah
2019-07-12 15:34     ` Will Deacon
2019-07-12 15:34       ` Will Deacon
2019-07-12 15:46       ` Raslan, KarimAllah
2019-07-12 15:46         ` Raslan, KarimAllah

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=1562944417.1345.17.camel@amazon.de \
    --to=karahmed@amazon.de \
    --cc=akpm@linux-foundation.org \
    --cc=anders.roxell@linaro.org \
    --cc=anshuman.khandual@arm.com \
    --cc=ard.biesheuvel@linaro.org \
    --cc=catalin.marinas@arm.com \
    --cc=info@metux.net \
    --cc=james.morse@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=mark.rutland@arm.com \
    --cc=robin.murphy@arm.com \
    --cc=rppt@linux.ibm.com \
    --cc=tglx@linutronix.de \
    --cc=will@kernel.org \
    --cc=yaojun8558363@gmail.com \
    --cc=yuzhao@google.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 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.