From: Gerd Knorr <kraxel@bytesex.org>
To: Chris Wright <chrisw@osdl.org>
Cc: xen-devel@lists.xensource.com
Subject: Re: [patch] pagetable cleanups, next version
Date: Fri, 15 Apr 2005 18:46:54 +0200 [thread overview]
Message-ID: <20050415164654.GA9516@bytesex> (raw)
In-Reply-To: <20050415162338.GQ493@shell0.pdx.osdl.net>
> > - unsigned long *pt = map_domain_mem(pt_mfn << PAGE_SHIFT);
> > - unsigned long match =
> > - (readonly_gmfn << PAGE_SHIFT) | _PAGE_RW | _PAGE_PRESENT;
> > - unsigned long mask = PAGE_MASK | _PAGE_RW | _PAGE_PRESENT;
> > + l1_pgentry_t *pt = map_domain_mem(pt_mfn << PAGE_SHIFT);
> > + l1_pgentry_t match;
>
> I don't quite understand how this is equivalent.
Well, I admit it's a bit confusing because multiple things are changed
at the same time ...
> How does the match work now?
I quote a few more lines important lines from the patch:
> > + unsigned long flags = _PAGE_RW | _PAGE_PRESENT;
> > + match = l1e_create_pfn(readonly_gmfn, flags);
> > -#define MATCH_ENTRY(_i) (((pt[_i] ^ match) & mask) == 0)
> > - if ( MATCH_ENTRY(readonly_gpfn & (L1_PAGETABLE_ENTRIES - 1)) &&
> > - fix_entry(readonly_gpfn & (L1_PAGETABLE_ENTRIES - 1)) )
> > + i = readonly_gpfn & (L1_PAGETABLE_ENTRIES - 1);
> > + if ( !l1e_has_changed(&pt[i], &match, flags) && fix_entry(i) )
There is the new l?e_has_changed() function which can be used to compare
two page table entries. It takes ptr's to two page table entries and a
bitmask with the page flags it should care about. The function will
also deal with PAGE_MASK, so this is gone from the functions calling
into l?e_has_changed().
In that particular function I also ditched the MATCH_ENTRY() macro which
did something simliar to l?e_has_changed() in a less generic way. That
makes the code look even more different, although it _should_ be the
same logic and it IMHO is also more readable. I admit that I havn't
tested shadow mode though ...
CC'ing xen-devel again so others can have a look as well.
> Looks like create plus has changed is the new way?
Huh? I lost you here ...
Gerd
--
#define printk(args...) fprintf(stderr, ## args)
next prev parent reply other threads:[~2005-04-15 16:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-15 12:56 [patch] pagetable cleanups, next version Gerd Knorr
[not found] ` <20050415162338.GQ493@shell0.pdx.osdl.net>
2005-04-15 16:46 ` Gerd Knorr [this message]
2005-04-15 17:20 ` Chris Wright
2005-04-20 11:16 ` Michael A Fetterman
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=20050415164654.GA9516@bytesex \
--to=kraxel@bytesex.org \
--cc=chrisw@osdl.org \
--cc=xen-devel@lists.xensource.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.