search for: pfn_to_mfn

Displaying 20 results from an estimated 109 matches for "pfn_to_mfn".

2008 Mar 19
10
Illegal PV kernel pfm/pfn translations on PROT_NONE ioremaps
...86_64 in end_pfn: maddr.h: static inline unsigned long mfn_to_pfn(unsigned long mfn) { ... if (unlikely((mfn >> machine_to_phys_order) != 0)) return end_pfn; and when we do mprotect(PROT_READ) later on on the same ptes, this end_pfn value is illegal: maddr.h: static inline unsigned long pfn_to_mfn(unsigned long pfn) { BUG_ON(end_pfn && pfn >= end_pfn); so we BUG(). It needs both an updated X and an updated kernel to show the bug, but given that, this results in an instant, completely repeatable kernel panic on starting X on both 32- and 64-bits on some hardware. Any suggestio...
2013 Aug 27
1
[PATCH] xen/balloon: don't set P2M entry for auto translated guest
...n.c +++ b/drivers/xen/balloon.c @@ -430,8 +430,13 @@ static enum bp_state decrease_reservation(unsigned long nr_pages, gfp_t gfp) /* No more mappings: invalidate P2M and add to balloon. */ for (i = 0; i < nr_pages; i++) { pfn = mfn_to_pfn(frame_list[i]); - __set_phys_to_machine(pfn, - pfn_to_mfn(page_to_pfn(__get_cpu_var(balloon_scratch_page)))); + if (!xen_feature(XENFEAT_auto_translated_physmap)) { + unsigned long p; + struct page *pg; + pg = __get_cpu_var(balloon_scratch_page); + p = page_to_pfn(pg); + __set_phys_to_machine(pfn, pfn_to_mfn(p)); + } balloon_append(pfn_to_p...
2011 Oct 05
0
[PATCH 3/8] xen: netfront: convert to SKB paged frag API.
...q = RING_GET_REQUEST(&np->rx, req_prod + i); gnttab_grant_foreign_access_ref(ref, @@ -461,7 +461,7 @@ static void xennet_make_frags(struct sk_buff *skb, struct net_device *dev, ref = gnttab_claim_grant_reference(&np->gref_tx_head); BUG_ON((signed short)ref < 0); - mfn = pfn_to_mfn(page_to_pfn(frag->page)); + mfn = pfn_to_mfn(page_to_pfn(skb_frag_page(frag))); gnttab_grant_foreign_access_ref(ref, np->xbdev->otherend_id, mfn, GNTMAP_readonly); @@ -762,23 +762,22 @@ static RING_IDX xennet_fill_frags(struct netfront_info *np, struct skb_shared_info *shinf...
2005 Dec 07
5
[PATCH] Arch-neutral balloon driver
Attached patch makes the balloon driver arch-neutral (compiles on ia64... look ma, no #ifdef''s!). Please apply to xen-unstable. One change should be eyeballed, line 257 in balloon.c, because phys_to_machine_mapping[pfn] is not identical to pfn_to_mfn (different by sign bit, should be OK?) Signed-off by: Dan Magenheimer <dan.magenheimer@hp.com> diff -r 0255f48b757f linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c --- a/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c Sun Dec 4 19:12:00 2005 +++ b/linux-2.6-xen-sparse/drivers/xen/ball...
2013 Feb 28
0
[PATCH RFC 05/12] xen-blkfront: remove frame list from blk_shadow
...te_data; - unsigned long buffer_mfn; struct blkif_request *ring_req; unsigned long id; unsigned int fsect, lsect; @@ -434,7 +432,6 @@ static int blkif_queue_request(struct request *req) gnt_list_entry = get_grant(&gref_head, info); ref = gnt_list_entry->gref; - buffer_mfn = pfn_to_mfn(gnt_list_entry->pfn); info->shadow[id].grants_used[i] = gnt_list_entry; @@ -465,7 +462,6 @@ static int blkif_queue_request(struct request *req) kunmap_atomic(shared_data); } - info->shadow[id].frame[i] = mfn_to_pfn(buffer_mfn); ring_req->u.rw.seg[i] = (str...
2008 Oct 27
0
[PATCH 4/4] linux/i386: utilize hypervisor highmem handling helpers
...@@ struct page *kmap_atomic_to_page(void *p return pte_page(*pte); } +void clear_highpage(struct page *page) +{ + void *kaddr; + + if (likely(xen_feature(XENFEAT_highmem_assist)) + && PageHighMem(page)) { + struct mmuext_op meo; + + meo.cmd = MMUEXT_CLEAR_PAGE; + meo.arg1.mfn = pfn_to_mfn(page_to_pfn(page)); + if (HYPERVISOR_mmuext_op(&meo, 1, NULL, DOMID_SELF) == 0) + return; + } + + kaddr = kmap_atomic(page, KM_USER0); + clear_page(kaddr); + kunmap_atomic(kaddr, KM_USER0); +} + +void copy_highpage(struct page *to, struct page *from) +{ + void *vfrom, *vto; + + if (likely(xe...
2008 Sep 28
2
is_mapped() in xc_domain_save()
...ave a pretty good grasp on domain save/migration code in xc_domain_save() in Xen 3.2.x, except for the what the is_mapped() macro is doing in following: /* Hypercall interfaces operate in PFNs for HVM guests * and MFNs for PV guests */ if ( hvm ) pfn_type[batch] = n; else pfn_type[batch] = pfn_to_mfn(n); if ( !is_mapped(pfn_type[batch]) ) { /* ** not currently in psuedo-physical map -- set bit ** in to_fix since we must send this page in last_iter ** unless its sent sooner anyhow, or it never enters ** pseudo-physical map (e.g. for ballooned down doms) */ set_bit(n,...
2007 Oct 12
10
[PATCH 00/10] REVIEW: Xen patches for 2.6.24
This is my current set of updates to Xen for 2.6.24. This is largely a bugfix set, and a couple of them are also relevent to 2.6.23. These are in the pre-x86 merge form; I'll update them once the merge goes into git. Quick overview: - remove some dead code in arch/i386/mm/init.c - clean up some duplicate includes - when sending an IPI, yield the vcpu if the destination doesn't have
2007 Oct 12
10
[PATCH 00/10] REVIEW: Xen patches for 2.6.24
This is my current set of updates to Xen for 2.6.24. This is largely a bugfix set, and a couple of them are also relevent to 2.6.23. These are in the pre-x86 merge form; I'll update them once the merge goes into git. Quick overview: - remove some dead code in arch/i386/mm/init.c - clean up some duplicate includes - when sending an IPI, yield the vcpu if the destination doesn't have
2007 Oct 12
10
[PATCH 00/10] REVIEW: Xen patches for 2.6.24
This is my current set of updates to Xen for 2.6.24. This is largely a bugfix set, and a couple of them are also relevent to 2.6.23. These are in the pre-x86 merge form; I'll update them once the merge goes into git. Quick overview: - remove some dead code in arch/i386/mm/init.c - clean up some duplicate includes - when sending an IPI, yield the vcpu if the destination doesn't have
2007 Jan 10
1
[PATCH] linux/i386: allow CONFIG_HIGHPTE on i386 (take 2)
...-238,23 +238,41 @@ struct page *pte_alloc_one(struct mm_str #ifdef CONFIG_HIGHPTE pte = alloc_pages(GFP_KERNEL|__GFP_HIGHMEM|__GFP_REPEAT|__GFP_ZERO, 0); + if (pte && PageHighMem(pte)) { + struct mmuext_op op; + + kmap_flush_unused(); + op.cmd = MMUEXT_PIN_L1_TABLE; + op.arg1.mfn = pfn_to_mfn(page_to_pfn(pte)); + BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0); + } #else pte = alloc_pages(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO, 0); +#endif if (pte) { SetPageForeign(pte, pte_free); set_page_count(pte, 1); } -#endif return pte; } void pte_free(struct page...
2011 Sep 01
9
[PATCH V4 0/3] xen-blkfront/blkback discard support
Dear list, This is the V4 of the trim support for xen-blkfront/blkback, Now we move BLKIF_OP_TRIM to BLKIF_OP_DISCARD, and dropped all "trim" stuffs in the patches, and use "discard" instead. Also we updated the helpers of blkif_x86_{32|64}_request or we will meet problems using a non-native protocol. And this patch has been tested with both SSD and raw file, with SSD we will
2013 Sep 19
3
[PATCH] xen/balloon: don't alloc page while non-preemptible
...- flush_tlb_all(); - - /* No more mappings: invalidate P2M and add to balloon. */ - for (i = 0; i < nr_pages; i++) { - pfn = mfn_to_pfn(frame_list[i]); if (!xen_feature(XENFEAT_auto_translated_physmap)) { unsigned long p; p = page_to_pfn(scratch_page); __set_phys_to_machine(pfn, pfn_to_mfn(p)); } + put_balloon_scratch_page(); + balloon_append(pfn_to_page(pfn)); } - put_balloon_scratch_page(); + /* Ensure that ballooned highmem pages don''t have kmaps. */ + kmap_flush_unused(); + flush_tlb_all(); set_xen_guest_handle(reservation.extent_start, frame_list); rese...
2008 Jan 18
0
[PATCH] minios: support COW for a zero page
...ion; - xen_pfn_t mfns[] = { virt_to_mfn(0), virt_to_mfn(&shared_info) }; + xen_pfn_t mfns[] = { virt_to_mfn(&shared_info) }; int n = sizeof(mfns)/sizeof(*mfns); pte_t nullpte = { }; + /* Use page 0 as the CoW zero page */ + memset(NULL, 0, PAGE_SIZE); + mfn_zero = pfn_to_mfn(0); if (HYPERVISOR_update_va_mapping(0, nullpte, UVMF_INVLPG)) printk("Unable to unmap page 0\n"); diff -r 27ad7ed41be2 extras/mini-os/arch/x86/traps.c --- a/extras/mini-os/arch/x86/traps.c Fri Jan 18 15:55:13 2008 +0000 +++ b/extras/mini-os/arch/x86/traps.c Fri Jan 18 16:02:32 2...
2007 Nov 15
0
[patch 12/19] xen: deal with stale cr3 values when unpinning pagetables
...unsigned long xen_read_cr3(void) return x86_read_percpu(xen_cr3); } +static void set_current_cr3(void *v) +{ + x86_write_percpu(xen_current_cr3, (unsigned long)v); +} + static void xen_write_cr3(unsigned long cr3) { + struct mmuext_op *op; + struct multicall_space mcs; + unsigned long mfn = pfn_to_mfn(PFN_DOWN(cr3)); + BUG_ON(preemptible()); - if (cr3 == x86_read_percpu(xen_cr3)) { - /* just a simple tlb flush */ - xen_flush_tlb(); - return; - } + mcs = xen_mc_entry(sizeof(*op)); /* disables interrupts */ + /* Update while interrupts are disabled, so its atomic with + respect to ipi...
2007 Nov 15
0
[patch 12/19] xen: deal with stale cr3 values when unpinning pagetables
...unsigned long xen_read_cr3(void) return x86_read_percpu(xen_cr3); } +static void set_current_cr3(void *v) +{ + x86_write_percpu(xen_current_cr3, (unsigned long)v); +} + static void xen_write_cr3(unsigned long cr3) { + struct mmuext_op *op; + struct multicall_space mcs; + unsigned long mfn = pfn_to_mfn(PFN_DOWN(cr3)); + BUG_ON(preemptible()); - if (cr3 == x86_read_percpu(xen_cr3)) { - /* just a simple tlb flush */ - xen_flush_tlb(); - return; - } + mcs = xen_mc_entry(sizeof(*op)); /* disables interrupts */ + /* Update while interrupts are disabled, so its atomic with + respect to ipi...
2010 Dec 08
2
[PATCH] xen: gntdev: move use of GNTMAP_contains_pte next to the map_op
...diff --git a/drivers/xen/gntdev.c b/drivers/xen/gntdev.c index a33e443..295254b 100644 --- a/drivers/xen/gntdev.c +++ b/drivers/xen/gntdev.c @@ -204,7 +204,8 @@ static int find_grant_ptes(pte_t *pte, pgtable_t token, unsigned long addr, void BUG_ON(pgnr >= map->count); pte_maddr = (u64)pfn_to_mfn(page_to_pfn(token)) << PAGE_SHIFT; pte_maddr += (unsigned long)pte & ~PAGE_MASK; - gnttab_set_map_op(&map->map_ops[pgnr], pte_maddr, map->flags, + gnttab_set_map_op(&map->map_ops[pgnr], pte_maddr, + GNTMAP_contains_pte | map->flags, map->grants[pgnr].ref...
2014 Feb 27
3
[PATCH] xen/grant-table: Refactor gnttab_[un]map_refs to avoid m2p_override
...ddr)) + + (map_ops[i].host_addr & ~PAGE_MASK)); + mfn = pte_mfn(*pte); + } else { + mfn = PFN_DOWN(map_ops[i].dev_bus_addr); + } + pfn = page_to_pfn(pages[i]); + + WARN_ON(PagePrivate(pages[i])); + SetPagePrivate(pages[i]); + set_page_private(pages[i], mfn); + pages[i]->index = pfn_to_mfn(pfn); + + if (unlikely(!set_phys_to_machine(pfn, FOREIGN_FRAME(mfn)))) { + ret = -ENOMEM; + goto out; + } + + if (kmap_ops) { + ret = m2p_add_override(mfn, pages[i], &kmap_ops[i]); + if (ret) + goto out; + } + } + +out: + if (lazy) + arch_leave_lazy_mmu_mode(); + + return ret; +...
2014 Feb 27
3
[PATCH] xen/grant-table: Refactor gnttab_[un]map_refs to avoid m2p_override
...ddr)) + + (map_ops[i].host_addr & ~PAGE_MASK)); + mfn = pte_mfn(*pte); + } else { + mfn = PFN_DOWN(map_ops[i].dev_bus_addr); + } + pfn = page_to_pfn(pages[i]); + + WARN_ON(PagePrivate(pages[i])); + SetPagePrivate(pages[i]); + set_page_private(pages[i], mfn); + pages[i]->index = pfn_to_mfn(pfn); + + if (unlikely(!set_phys_to_machine(pfn, FOREIGN_FRAME(mfn)))) { + ret = -ENOMEM; + goto out; + } + + if (kmap_ops) { + ret = m2p_add_override(mfn, pages[i], &kmap_ops[i]); + if (ret) + goto out; + } + } + +out: + if (lazy) + arch_leave_lazy_mmu_mode(); + + return ret; +...
2013 Jun 17
1
Kernel panic in pin_pagetable_pfn
...is when the kernel (64-bit) boots up in EC2 ( a large instance with 7.5 GB memory), the kernel crashes when hitting the BUG in enlighten.c:pin_pagetable_pfn(): static void pin_pagetable_pfn(unsigned cmd, unsigned long pfn) { struct mmuext_op op; op.cmd = cmd; op.arg1.mfn = pfn_to_mfn(pfn); if (HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF)) BUG(); } The complete kernel log is attached below. We noticed we don''t see this panic with 2.6.32 kernel. But we''d like to keep with the 2.6.27 kernel if possible. Does anyone know if there&...