xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: David Vrabel <dvrabel@cantab.net>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [GIT PULL] xen: bug fixes for 4.7-rc0
Date: Wed, 22 Jun 2016 14:25:09 -0700	[thread overview]
Message-ID: <CA+55aFw2RMNbo9TLYYiSVvLoiX5S7JCh6s9UzNuMBWZEXzthqA__15209.1492819183$1466630803$gmane$org@mail.gmail.com> (raw)
In-Reply-To: <57446B82.7040609@cantab.net>

Having upgraded one of my machines to F24, I get a few new warnings
during the kernel compile due to a new compiler.

Some of them are just annoying and wrong, but one of them points to a
real Xen bug:

  arch/x86/xen/mmu.c:1116:57: warning: array subscript is above array
bounds [-Warray-bounds]
    for (; vaddr <= vaddr_end && (pmd < (level2_kernel_pgt + PAGE_SIZE));
                                        ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~

because that is definitely completely wrong.

Yes, level2_kernel_pgt is one page in size, but it only has 512
entries, because each entry is 8 bytes.

So that "+ PAGE_SIZE" is entirely bogus. Either it should be

  (level2_kernel_pgt + 512)

or it should be

  ((void *)level2_kernel_pgt + PAGE_SIZE)

but as it stands now it's a bug.

This harkens back to 2012, commit 7f9140626c757 ("xen/mmu: Copy and
revector the P2M tree").

It may be that we end up never actually crossing the pmd boundary
anyway due to vaddr limit - I didn't check. But please fix the code
regardless.

           Linus

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

       reply	other threads:[~2016-06-22 21:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <57446B82.7040609@cantab.net>
2016-06-22 21:25 ` Linus Torvalds [this message]
2016-05-24 14:56 [GIT PULL] xen: bug fixes for 4.7-rc0 David Vrabel

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='CA+55aFw2RMNbo9TLYYiSVvLoiX5S7JCh6s9UzNuMBWZEXzthqA__15209.1492819183$1466630803$gmane$org@mail.gmail.com' \
    --to=torvalds@linux-foundation.org \
    --cc=dvrabel@cantab.net \
    --cc=konrad.wilk@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xen-devel@lists.xenproject.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).