qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Nathan Whitehorn <nwhitehorn@freebsd.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] PPC: Fix large page support in TCG
Date: Fri, 9 Mar 2012 14:42:55 +1100	[thread overview]
Message-ID: <20120309034255.GQ10735@truffala.fritz.box> (raw)
In-Reply-To: <A9F59E29-0B1B-4A8A-8D1C-BC26661FE918@freebsd.org>

On Thu, Mar 08, 2012 at 09:24:53AM -0600, Nathan Whitehorn wrote:
> 
> On Mar 7, 2012, at 7:25 PM, David Gibson wrote:
> 
> >On Sat, Mar 03, 2012 at 10:39:34AM -0600, Nathan Whitehorn wrote:
> >>Fix large page support in TCG. The old code would overwrite the
> >>large page table entry with the fake 4 KB
> >>one generated here whenever the ref/change bits were updated,
> >>causing it to point to the wrong area of memory. Instead of creating
> >>a fake PTE, just update the real address at the end.
> >>
> >>Signed-off-by: Nathan Whitehorn <nwhitehorn@freebsd.org>
> >
> >Hrm.  This looks like a cleaner way of handling things, but I don't
> >really follow what exactly was going wrong in the old way.  Can you
> >spell out in more detail where the modified pte1 value caused
> >problems?
> 
> The problem was that pte1 would get extra bits added into it in
> _find_pte() to produce a new, fake 4KB page table entry. When the
> ref/change bits were updated, pte1 would be written back to the page
> table -- *including* the bits added to make a fake 4K page. At the
> next access, since this function does not clear the low bits of
> large pages (which is probably itself a bug) when it interprets
> them, the generated address would be the large page base, ored with
> the large page remainder for this access, ored with the large page
> remainder from the *previous* access, etc. and you would get a
> progressively more bogus address in the end.

Ah, yes, I see it now.  Good catch.

Acked-by: David Gibson <david@gibson.drobpear.id.au>

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

  reply	other threads:[~2012-03-09  3:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-03 16:39 [Qemu-devel] [PATCH] PPC: Fix large page support in TCG Nathan Whitehorn
2012-03-03 18:07 ` Andreas Färber
2012-03-07 15:41   ` Alexander Graf
2012-03-08  1:25 ` David Gibson
2012-03-08 15:24   ` Nathan Whitehorn
2012-03-09  3:42     ` David Gibson [this message]
2012-03-09 13:13       ` Alexander Graf
2012-03-09 14:30         ` Nathan Whitehorn
2012-03-09 18:32           ` Alexander Graf

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=20120309034255.GQ10735@truffala.fritz.box \
    --to=david@gibson.dropbear.id.au \
    --cc=nwhitehorn@freebsd.org \
    --cc=qemu-devel@nongnu.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).