linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Matt Fleming <matt@console-pimps.org>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: linux-arm-kernel@lists.infradead.org, linux-efi@vger.kernel.org,
	leif.lindholm@linaro.org, roy.franz@linaro.org,
	mark.rutland@arm.com, catalin.marinas@arm.com,
	will.deacon@arm.com, matt.fleming@intel.com, bp@alien8.de,
	dyoung@redhat.com, msalter@redhat.com, grant.likely@linaro.org,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/8] memblock: introduce memblock_add_phys() and memblock_is_physmem()
Date: Tue, 6 Jan 2015 09:19:18 +0000	[thread overview]
Message-ID: <20150106091918.GI3163@console-pimps.org> (raw)
In-Reply-To: <1419275322-29811-5-git-send-email-ard.biesheuvel@linaro.org>

(Moar reviewers)

On Mon, 22 Dec, at 07:08:38PM, Ard Biesheuvel wrote:
> This introduces the following functions:
> - memblock_add_phys(), that registers regions in the 'physmem' memblock map if
>   CONFIG_HAVE_MEMBLOCK_PHYS_MAP is set; otherwise, it is a nop
> - memblock_is_physmem(), returns whether a physical address is classified as
>   physical memory.
> 
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> ---
>  include/linux/memblock.h | 10 ++++++++++
>  mm/memblock.c            | 15 +++++++++++++++
>  2 files changed, 25 insertions(+)
> 
> diff --git a/include/linux/memblock.h b/include/linux/memblock.h
> index e8cc45307f8f..d32fe838c6ca 100644
> --- a/include/linux/memblock.h
> +++ b/include/linux/memblock.h
> @@ -365,6 +365,16 @@ static inline unsigned long memblock_region_reserved_end_pfn(const struct memblo
>  #define __initdata_memblock
>  #endif
>  
> +#ifdef CONFIG_HAVE_MEMBLOCK_PHYS_MAP
> +int memblock_add_phys(phys_addr_t base, phys_addr_t size);
> +int memblock_is_physmem(phys_addr_t addr);
> +#else
> +static inline int memblock_add_phys(phys_addr_t base, phys_addr_t size)
> +{
> +	return 0;
> +}
> +#endif /* CONFIG_HAVE_MEMBLOCK_PHYS_MAP */
> +
>  #else
>  static inline phys_addr_t memblock_alloc(phys_addr_t size, phys_addr_t align)
>  {
> diff --git a/mm/memblock.c b/mm/memblock.c
> index c27353beb260..107aa5ee2d7b 100644
> --- a/mm/memblock.c
> +++ b/mm/memblock.c
> @@ -586,6 +586,14 @@ int __init_memblock memblock_add(phys_addr_t base, phys_addr_t size)
>  				   MAX_NUMNODES, 0);
>  }
>  
> +#ifdef CONFIG_HAVE_MEMBLOCK_PHYS_MAP
> +int __init_memblock memblock_add_phys(phys_addr_t base, phys_addr_t size)
> +{
> +	return memblock_add_range(&memblock.physmem, base, size,
> +				  MAX_NUMNODES, 0);
> +}
> +#endif
> +
>  /**
>   * memblock_isolate_range - isolate given range into disjoint memblocks
>   * @type: memblock type to isolate range for
> @@ -1398,6 +1406,13 @@ int __init_memblock memblock_is_memory(phys_addr_t addr)
>  	return memblock_search(&memblock.memory, addr) != -1;
>  }
>  
> +#ifdef CONFIG_HAVE_MEMBLOCK_PHYS_MAP
> +int __init_memblock memblock_is_physmem(phys_addr_t addr)
> +{
> +	return memblock_search(&memblock.physmem, addr) != -1;
> +}
> +#endif
> +
>  #ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
>  int __init_memblock memblock_search_pfn_nid(unsigned long pfn,
>  			 unsigned long *start_pfn, unsigned long *end_pfn)
> -- 
> 1.8.3.2
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-efi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Matt Fleming, Intel Open Source Technology Center

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

      parent reply	other threads:[~2015-01-06  9:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1419275322-29811-1-git-send-email-ard.biesheuvel@linaro.org>
     [not found] ` <1419275322-29811-4-git-send-email-ard.biesheuvel@linaro.org>
2015-01-06  9:15   ` [PATCH 3/8] memblock: add physmem to memblock_dump_all() output Matt Fleming
     [not found] ` <1419275322-29811-5-git-send-email-ard.biesheuvel@linaro.org>
2015-01-06  9:19   ` Matt Fleming [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=20150106091918.GI3163@console-pimps.org \
    --to=matt@console-pimps.org \
    --cc=akpm@linux-foundation.org \
    --cc=ard.biesheuvel@linaro.org \
    --cc=bp@alien8.de \
    --cc=catalin.marinas@arm.com \
    --cc=dyoung@redhat.com \
    --cc=grant.likely@linaro.org \
    --cc=leif.lindholm@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mark.rutland@arm.com \
    --cc=matt.fleming@intel.com \
    --cc=msalter@redhat.com \
    --cc=roy.franz@linaro.org \
    --cc=will.deacon@arm.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;
as well as URLs for NNTP newsgroup(s).