linux-efi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas@arm.com>
To: Mark Salter <msalter@redhat.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-efi@vger.kernel.org" <linux-efi@vger.kernel.org>,
	Will Deacon <Will.Deacon@arm.com>,
	"matt.fleming@intel.com" <matt.fleming@intel.com>,
	Leif Lindholm <leif.lindholm@linaro.org>,
	"roy.franz@linaro.org" <roy.franz@linaro.org>,
	"patches@linaro.org" <patches@linaro.org>,
	Grant Likely <grant.likely@secretlab.ca>
Subject: Re: [PATCH 2/6] arm64: Add function to create identity mappings
Date: Wed, 22 Jan 2014 17:39:28 +0000	[thread overview]
Message-ID: <20140122173927.GE8065@arm.com> (raw)
In-Reply-To: <1389392950-22457-3-git-send-email-msalter@redhat.com>

On Fri, Jan 10, 2014 at 10:29:06PM +0000, Mark Salter wrote:
> +void __init create_id_mapping(phys_addr_t addr, phys_addr_t size)
> +{
> +	pgd_t *pgd = &idmap_pg_dir[pgd_index(addr)];
> +
> +	if (pgd >= &idmap_pg_dir[ARRAY_SIZE(idmap_pg_dir)]) {
> +		pr_warn("BUG: not creating id mapping for 0x%016llx\n", addr);
> +		return;
> +	}

The condition above is always false since pgd_index() already ands the
index with (PTRS_PER_PGD - 1). Better check addr against something like
(PTRS_PER_PGD * PGDIR_SIZE) (for clarity, you could do other shifts,
doesn't really matter).

-- 
Catalin

  reply	other threads:[~2014-01-22 17:39 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-10 22:29 [PATCH 0/6] arm64: Add EFI stub and runtime services support Mark Salter
2014-01-10 22:29 ` [PATCH 2/6] arm64: Add function to create identity mappings Mark Salter
2014-01-22 17:39   ` Catalin Marinas [this message]
2014-01-10 22:29 ` [PATCH 4/6] arm64: add EFI stub Mark Salter
     [not found]   ` <1389392950-22457-5-git-send-email-msalter-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-01-13 18:49     ` Arnd Bergmann
     [not found]       ` <201401131949.39358.arnd-r2nGTMty4D4@public.gmane.org>
2014-01-14 14:44         ` Mark Salter
2014-01-14 19:26           ` Roy Franz
2014-01-22 18:04   ` Catalin Marinas
     [not found] ` <1389392950-22457-1-git-send-email-msalter-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-01-10 22:29   ` [PATCH 1/6] efi: create memory map iteration helper Mark Salter
     [not found]     ` <1389392950-22457-2-git-send-email-msalter-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-01-13 15:17       ` Matt Fleming
     [not found]         ` <20140113151759.GG3256-HNK1S37rvNbeXh+fF434Mdi2O/JbrIOy@public.gmane.org>
2014-01-13 17:53           ` Mark Salter
2014-01-10 22:29   ` [PATCH 3/6] efi: add helper function to get UEFI params from FDT Mark Salter
2014-01-10 22:29   ` [PATCH 5/6] doc: arm64: add description of EFI stub support Mark Salter
2014-01-10 22:29 ` [PATCH 6/6] arm64: add EFI runtime services Mark Salter
     [not found]   ` <1389392950-22457-7-git-send-email-msalter-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-01-23 11:24     ` Catalin Marinas

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=20140122173927.GE8065@arm.com \
    --to=catalin.marinas@arm.com \
    --cc=Will.Deacon@arm.com \
    --cc=grant.likely@secretlab.ca \
    --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=matt.fleming@intel.com \
    --cc=msalter@redhat.com \
    --cc=patches@linaro.org \
    --cc=roy.franz@linaro.org \
    /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).