From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xen.org>
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
"Tim Deegan" <tim@xen.org>, "Wei Liu" <wei.liu2@citrix.com>,
"Jan Beulich" <JBeulich@suse.com>,
"Roger Pau Monné" <roger.pau@citrix.com>
Subject: [PATCH 2/6] x86/shadow: Use more appropriate conversion functions
Date: Wed, 15 Aug 2018 19:34:33 +0100 [thread overview]
Message-ID: <1534358077-24700-3-git-send-email-andrew.cooper3@citrix.com> (raw)
In-Reply-To: <1534358077-24700-1-git-send-email-andrew.cooper3@citrix.com>
Replace pfn_to_paddr(mfn_x(...)) with mfn_to_maddr(), and replace an opencoded
gfn_to_gaddr().
No functional change.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Tim Deegan <tim@xen.org>
CC: Wei Liu <wei.liu2@citrix.com>
CC: Roger Pau Monné <roger.pau@citrix.com>
---
xen/arch/x86/mm/shadow/multi.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index 0d74c01..fbdbb7d 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -628,7 +628,7 @@ _sh_propagate(struct vcpu *v,
sflags |= get_pat_flags(v,
gflags,
gfn_to_paddr(target_gfn),
- pfn_to_paddr(mfn_x(target_mfn)),
+ mfn_to_maddr(target_mfn),
MTRR_TYPE_UNCACHABLE);
else if ( iommu_snoop )
sflags |= pat_type_2_pte_flags(PAT_TYPE_WRBACK);
@@ -636,7 +636,7 @@ _sh_propagate(struct vcpu *v,
sflags |= get_pat_flags(v,
gflags,
gfn_to_paddr(target_gfn),
- pfn_to_paddr(mfn_x(target_mfn)),
+ mfn_to_maddr(target_mfn),
NO_HARDCODE_MEM_TYPE);
}
}
@@ -1131,7 +1131,7 @@ static inline void shadow_vram_get_l1e(shadow_l1e_t new_sl1e,
if ( (page->u.inuse.type_info & PGT_count_mask) == 1 )
/* Initial guest reference, record it */
- dirty_vram->sl1ma[i] = pfn_to_paddr(mfn_x(sl1mfn))
+ dirty_vram->sl1ma[i] = mfn_to_maddr(sl1mfn)
| ((unsigned long)sl1e & ~PAGE_MASK);
}
}
@@ -1160,7 +1160,7 @@ static inline void shadow_vram_put_l1e(shadow_l1e_t old_sl1e,
unsigned long i = gfn - dirty_vram->begin_pfn;
struct page_info *page = mfn_to_page(mfn);
int dirty = 0;
- paddr_t sl1ma = pfn_to_paddr(mfn_x(sl1mfn))
+ paddr_t sl1ma = mfn_to_maddr(sl1mfn)
| ((unsigned long)sl1e & ~PAGE_MASK);
if ( (page->u.inuse.type_info & PGT_count_mask) == 1 )
@@ -2931,8 +2931,7 @@ static int sh_page_fault(struct vcpu *v,
{
/* Magic MMIO marker: extract gfn for MMIO address */
ASSERT(sh_l1e_is_mmio(sl1e));
- gpa = (((paddr_t)(gfn_x(sh_l1e_mmio_get_gfn(sl1e))))
- << PAGE_SHIFT)
+ gpa = gfn_to_gaddr(sh_l1e_mmio_get_gfn(sl1e))
| (va & ~PAGE_MASK);
}
perfc_incr(shadow_fault_fast_mmio);
--
2.1.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2018-08-15 18:34 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-15 18:34 [PATCH 0/6] x86/mm: Minor non-functional cleanup Andrew Cooper
2018-08-15 18:34 ` [PATCH 1/6] x86/mm: Use mfn_eq()/mfn_add() rather than opencoded variations Andrew Cooper
2018-08-16 16:07 ` Roger Pau Monné
2018-08-17 12:54 ` Jan Beulich
2018-08-15 18:34 ` Andrew Cooper [this message]
2018-08-16 16:08 ` [PATCH 2/6] x86/shadow: Use more appropriate conversion functions Roger Pau Monné
2018-08-21 10:02 ` Wei Liu
2018-08-15 18:34 ` [PATCH 3/6] x86/shadow: Switch shadow_domain.has_fast_mmio_entries to bool Andrew Cooper
2018-08-16 16:09 ` Roger Pau Monné
2018-08-17 12:57 ` Jan Beulich
2018-08-15 18:34 ` [PATCH 4/6] x86/shadow: Use MASK_* helpers for the MMIO fastpath PTE manipulation Andrew Cooper
2018-08-16 16:12 ` Roger Pau Monné
2018-08-21 10:04 ` Wei Liu
2018-08-15 18:34 ` [PATCH 5/6] x86/shadow: Clean up the MMIO fastpath helpers Andrew Cooper
2018-08-16 16:16 ` Roger Pau Monné
2018-08-21 10:05 ` Wei Liu
2018-08-15 18:34 ` [PATCH 6/6] x86/shadow: Use mfn_t in shadow_track_dirty_vram() Andrew Cooper
2018-08-16 16:18 ` Roger Pau Monné
2018-08-21 10:05 ` Wei Liu
2018-08-16 19:00 ` [PATCH 0/6] x86/mm: Minor non-functional cleanup Tim Deegan
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=1534358077-24700-3-git-send-email-andrew.cooper3@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=JBeulich@suse.com \
--cc=roger.pau@citrix.com \
--cc=tim@xen.org \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xen.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).