diff options
author | Tim Deegan <Tim.Deegan@citrix.com> | 2011-06-02 13:16:52 +0100 |
---|---|---|
committer | Tim Deegan <Tim.Deegan@citrix.com> | 2011-06-02 13:16:52 +0100 |
commit | 4ce6c4a45536f7e8094ef3f1cebfa048f23028f0 (patch) | |
tree | 93a99593392617e3cd4a608bf414ea15569e564a /xen/common/grant_table.c | |
parent | 8c7d0b26207932a07061b03e1873dc3c8987f568 (diff) | |
download | xen-4ce6c4a45536f7e8094ef3f1cebfa048f23028f0.tar.gz xen-4ce6c4a45536f7e8094ef3f1cebfa048f23028f0.tar.bz2 xen-4ce6c4a45536f7e8094ef3f1cebfa048f23028f0.zip |
x86/mm/p2m: Make p2m interfaces take struct domain arguments.
As part of the nested HVM patch series, many p2m functions were changed
to take pointers to p2m tables rather than to domains. This patch
reverses that for almost all of them, which:
- gets rid of a lot of "p2m_get_hostp2m(d)" in code which really
shouldn't have to know anything about how gfns become mfns.
- ties sharing and paging interfaces to a domain, which is
what they actually act on, rather than a particular p2m table.
In developing this patch it became clear that memory-sharing and nested
HVM are unlikely to work well together. I haven't tried to fix that
here beyond adding some assertions around suspect paths (as this patch
is big enough with just the interface changes)
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Diffstat (limited to 'xen/common/grant_table.c')
-rw-r--r-- | xen/common/grant_table.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c index ba32a358a5..0b533dfaad 100644 --- a/xen/common/grant_table.c +++ b/xen/common/grant_table.c @@ -110,7 +110,7 @@ static unsigned inline int max_nr_maptrack_frames(void) #define gfn_to_mfn_private(_d, _gfn) ({ \ p2m_type_t __p2mt; \ unsigned long __x; \ - __x = mfn_x(gfn_to_mfn_unshare(p2m_get_hostp2m(_d), _gfn, &__p2mt)); \ + __x = mfn_x(gfn_to_mfn_unshare((_d), (_gfn), &__p2mt)); \ BUG_ON(p2m_is_shared(__p2mt)); /* XXX fixme */ \ if ( !p2m_is_valid(__p2mt) ) \ __x = INVALID_MFN; \ @@ -146,16 +146,14 @@ static int __get_paged_frame(unsigned long gfn, unsigned long *frame, int readon { int rc = GNTST_okay; #if defined(P2M_PAGED_TYPES) || defined(P2M_SHARED_TYPES) - struct p2m_domain *p2m; p2m_type_t p2mt; mfn_t mfn; - p2m = p2m_get_hostp2m(rd); if ( readonly ) - mfn = gfn_to_mfn(p2m, gfn, &p2mt); + mfn = gfn_to_mfn(rd, gfn, &p2mt); else { - mfn = gfn_to_mfn_unshare(p2m, gfn, &p2mt); + mfn = gfn_to_mfn_unshare(rd, gfn, &p2mt); BUG_ON(p2m_is_shared(p2mt)); /* XXX Here, and above in gfn_to_mfn_private, need to handle * XXX failure to unshare. */ @@ -165,7 +163,7 @@ static int __get_paged_frame(unsigned long gfn, unsigned long *frame, int readon *frame = mfn_x(mfn); if ( p2m_is_paging(p2mt) ) { - p2m_mem_paging_populate(p2m, gfn); + p2m_mem_paging_populate(rd, gfn); rc = GNTST_eagain; } } else { |