search for: pfn_down

Displaying 20 results from an estimated 99 matches for "pfn_down".

2012 Nov 16
1
[PATCH v4] x86/xen: Use __pa_symbol instead of __pa on C visible symbols
...4_pgt)); xen_mc_issue(PARAVIRT_LAZY_CPU); } /* We can't that easily rip out L3 and L2, as the Xen pagetables are @@ -1984,10 +1985,10 @@ static RESERVE_BRK_ARRAY(pmd_t, swapper_kernel_pmd, PTRS_PER_PMD); static void __init xen_write_cr3_init(unsigned long cr3) { - unsigned long pfn = PFN_DOWN(__pa(swapper_pg_dir)); + unsigned long pfn = PFN_DOWN(__pa_symbol(swapper_pg_dir)); - BUG_ON(read_cr3() != __pa(initial_page_table)); - BUG_ON(cr3 != __pa(swapper_pg_dir)); + BUG_ON(read_cr3() != __pa_symbol(initial_page_table)); + BUG_ON(cr3 != __pa_symbol(swapper_pg_dir)); /* * We are sw...
2012 Nov 16
1
[PATCH v4] x86/xen: Use __pa_symbol instead of __pa on C visible symbols
...4_pgt)); xen_mc_issue(PARAVIRT_LAZY_CPU); } /* We can't that easily rip out L3 and L2, as the Xen pagetables are @@ -1984,10 +1985,10 @@ static RESERVE_BRK_ARRAY(pmd_t, swapper_kernel_pmd, PTRS_PER_PMD); static void __init xen_write_cr3_init(unsigned long cr3) { - unsigned long pfn = PFN_DOWN(__pa(swapper_pg_dir)); + unsigned long pfn = PFN_DOWN(__pa_symbol(swapper_pg_dir)); - BUG_ON(read_cr3() != __pa(initial_page_table)); - BUG_ON(cr3 != __pa(swapper_pg_dir)); + BUG_ON(read_cr3() != __pa_symbol(initial_page_table)); + BUG_ON(cr3 != __pa_symbol(swapper_pg_dir)); /* * We are sw...
2023 May 19
1
[PATCH 2/4] x86: always initialize xen-swiotlb when xen-pcifront is enabling
On Fri, May 19, 2023 at 01:49:46PM +0100, Andrew Cooper wrote: > > The alternative would be to finally merge swiotlb-xen into swiotlb, in > > which case we might be able to do this later. Let me see what I can > > do there. > > If that is an option, it would be great to reduce the special-cashing. I think it's doable, and I've been wanting it for a while. I just
2020 Mar 10
2
[PATCH v1 07/11] virtio-mem: Allow to offline partially unplugged memory blocks
On Mon 02-03-20 14:49:37, David Hildenbrand wrote: [...] > +static void virtio_mem_notify_going_offline(struct virtio_mem *vm, > + unsigned long mb_id) > +{ > + const unsigned long nr_pages = PFN_DOWN(vm->subblock_size); > + unsigned long pfn; > + int sb_id, i; > + > + for (sb_id = 0; sb_id < vm->nb_sb_per_mb; sb_id++) { > + if (virtio_mem_mb_test_sb_plugged(vm, mb_id, sb_id, 1)) > + continue; > + /* > + * Drop our reference to the pages so the memory can g...
2020 Mar 10
2
[PATCH v1 07/11] virtio-mem: Allow to offline partially unplugged memory blocks
On Mon 02-03-20 14:49:37, David Hildenbrand wrote: [...] > +static void virtio_mem_notify_going_offline(struct virtio_mem *vm, > + unsigned long mb_id) > +{ > + const unsigned long nr_pages = PFN_DOWN(vm->subblock_size); > + unsigned long pfn; > + int sb_id, i; > + > + for (sb_id = 0; sb_id < vm->nb_sb_per_mb; sb_id++) { > + if (virtio_mem_mb_test_sb_plugged(vm, mb_id, sb_id, 1)) > + continue; > + /* > + * Drop our reference to the pages so the memory can g...
2015 Dec 07
0
[PATCH RFC 1/3] xen: export xen_phys_to_bus, xen_bus_to_phys and xen_virt_to_bus
.../* - * Both of these functions should avoid PFN_PHYS because phys_addr_t - * can be 32bit when dma_addr_t is 64bit leading to a loss in - * information if the shift is done before casting to 64bit. - */ -static inline dma_addr_t xen_phys_to_bus(phys_addr_t paddr) -{ - unsigned long bfn = pfn_to_bfn(PFN_DOWN(paddr)); - dma_addr_t dma = (dma_addr_t)bfn << PAGE_SHIFT; - - dma |= paddr & ~PAGE_MASK; - - return dma; -} - -static inline phys_addr_t xen_bus_to_phys(dma_addr_t baddr) -{ - unsigned long pfn = bfn_to_pfn(PFN_DOWN(baddr)); - dma_addr_t dma = (dma_addr_t)pfn << PAGE_SHIFT; - phys_...
2020 Mar 10
1
[PATCH v1 07/11] virtio-mem: Allow to offline partially unplugged memory blocks
...3.20 12:43, Michal Hocko wrote: > > On Mon 02-03-20 14:49:37, David Hildenbrand wrote: > > [...] > >> +static void virtio_mem_notify_going_offline(struct virtio_mem *vm, > >> + unsigned long mb_id) > >> +{ > >> + const unsigned long nr_pages = PFN_DOWN(vm->subblock_size); > >> + unsigned long pfn; > >> + int sb_id, i; > >> + > >> + for (sb_id = 0; sb_id < vm->nb_sb_per_mb; sb_id++) { > >> + if (virtio_mem_mb_test_sb_plugged(vm, mb_id, sb_id, 1)) > >> + continue; > >> + /*...
2012 Jul 04
3
[PATCH] xen: populate correct number of pages when across mem boundary
...long credits = credits_left; unsigned long s_pfn; unsigned long e_pfn; unsigned long pfns; long capacity; - if (credits <= 0) + if (credits_left <= 0) break; if (entry->type != E820_RAM) continue; - e_pfn = PFN_UP(entry->addr + entry->size); + e_pfn = PFN_DOWN(entry->addr + entry->size); /* We only care about E820 after the xen_start_info->nr_pages */ if (e_pfn <= max_pfn) continue; - s_pfn = PFN_DOWN(entry->addr); + s_pfn = PFN_UP(entry->addr); /* If the E820 falls within the nr_pages, we want to start * at the n...
2012 Jul 04
3
[PATCH] xen: populate correct number of pages when across mem boundary
...long credits = credits_left; unsigned long s_pfn; unsigned long e_pfn; unsigned long pfns; long capacity; - if (credits <= 0) + if (credits_left <= 0) break; if (entry->type != E820_RAM) continue; - e_pfn = PFN_UP(entry->addr + entry->size); + e_pfn = PFN_DOWN(entry->addr + entry->size); /* We only care about E820 after the xen_start_info->nr_pages */ if (e_pfn <= max_pfn) continue; - s_pfn = PFN_DOWN(entry->addr); + s_pfn = PFN_UP(entry->addr); /* If the E820 falls within the nr_pages, we want to start * at the n...
2020 Mar 02
0
[PATCH v1 07/11] virtio-mem: Allow to offline partially unplugged memory blocks
...++ b/drivers/virtio/virtio_mem.c @@ -570,6 +570,53 @@ static void virtio_mem_notify_online(struct virtio_mem *vm, unsigned long mb_id, virtio_mem_retry(vm); } +static void virtio_mem_notify_going_offline(struct virtio_mem *vm, + unsigned long mb_id) +{ + const unsigned long nr_pages = PFN_DOWN(vm->subblock_size); + unsigned long pfn; + int sb_id, i; + + for (sb_id = 0; sb_id < vm->nb_sb_per_mb; sb_id++) { + if (virtio_mem_mb_test_sb_plugged(vm, mb_id, sb_id, 1)) + continue; + /* + * Drop our reference to the pages so the memory can get + * offlined and add the unplugged...
2010 Aug 06
5
[PATCH] GSoC 2010 - Memory hotplug support for Xen guests - second fully working version - once again
...ats.target_pages - balloon_stats.current_pages) << PAGE_SHIFT; + + rc = allocate_resource(&iomem_resource, r, r_size, r_min, + ULONG_MAX, PAGE_SIZE, NULL, NULL); + + if (rc < 0) { + kfree(r); + goto out; + } + + balloon_stats.hotplug_start_paddr = r->start; + } + + pfn = PFN_DOWN(balloon_stats.hotplug_start_paddr + balloon_stats.hotplug_size); + + for (i = 0; i < nr_pages; ++i, ++pfn) + frame_list[i] = pfn; + + set_xen_guest_handle(reservation.extent_start, frame_list); + reservation.nr_extents = nr_pages; + + rc = HYPERVISOR_memory_op(XENMEM_populate_physmap, &rese...
2014 Feb 27
3
[PATCH] xen/grant-table: Refactor gnttab_[un]map_refs to avoid m2p_override
...) { + arch_enter_lazy_mmu_mode(); + lazy = true; + } + + for (i = 0; i < count; i++) { + unsigned long mfn, pfn; + + /* Do not add to override if the map failed. */ + if (map_ops[i].status) + continue; + + if (map_ops[i].flags & GNTMAP_contains_pte) { + pte = (pte_t *) (mfn_to_virt(PFN_DOWN(map_ops[i].host_addr)) + + (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); + pag...
2014 Feb 27
3
[PATCH] xen/grant-table: Refactor gnttab_[un]map_refs to avoid m2p_override
...) { + arch_enter_lazy_mmu_mode(); + lazy = true; + } + + for (i = 0; i < count; i++) { + unsigned long mfn, pfn; + + /* Do not add to override if the map failed. */ + if (map_ops[i].status) + continue; + + if (map_ops[i].flags & GNTMAP_contains_pte) { + pte = (pte_t *) (mfn_to_virt(PFN_DOWN(map_ops[i].host_addr)) + + (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); + pag...
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
2020 Mar 10
0
[PATCH v1 07/11] virtio-mem: Allow to offline partially unplugged memory blocks
On 10.03.20 12:43, Michal Hocko wrote: > On Mon 02-03-20 14:49:37, David Hildenbrand wrote: > [...] >> +static void virtio_mem_notify_going_offline(struct virtio_mem *vm, >> + unsigned long mb_id) >> +{ >> + const unsigned long nr_pages = PFN_DOWN(vm->subblock_size); >> + unsigned long pfn; >> + int sb_id, i; >> + >> + for (sb_id = 0; sb_id < vm->nb_sb_per_mb; sb_id++) { >> + if (virtio_mem_mb_test_sb_plugged(vm, mb_id, sb_id, 1)) >> + continue; >> + /* >> + * Drop our reference...
2012 Jul 18
0
[Xen-devel] [PATCH -v2] xen: populate correct number of pages when across mem boundary
...long credits = credits_left; unsigned long s_pfn; unsigned long e_pfn; unsigned long pfns; long capacity; - if (credits <= 0) + if (credits_left <= 0) break; if (entry->type != E820_RAM) continue; - e_pfn = PFN_UP(entry->addr + entry->size); + e_pfn = PFN_DOWN(entry->addr + entry->size); /* We only care about E820 after the xen_start_info->nr_pages */ if (e_pfn <= max_pfn) continue; - s_pfn = PFN_DOWN(entry->addr); + s_pfn = PFN_UP(entry->addr); /* If the E820 falls within the nr_pages, we want to start * at the n...
2012 Jul 18
0
[Xen-devel] [PATCH -v2] xen: populate correct number of pages when across mem boundary
...long credits = credits_left; unsigned long s_pfn; unsigned long e_pfn; unsigned long pfns; long capacity; - if (credits <= 0) + if (credits_left <= 0) break; if (entry->type != E820_RAM) continue; - e_pfn = PFN_UP(entry->addr + entry->size); + e_pfn = PFN_DOWN(entry->addr + entry->size); /* We only care about E820 after the xen_start_info->nr_pages */ if (e_pfn <= max_pfn) continue; - s_pfn = PFN_DOWN(entry->addr); + s_pfn = PFN_UP(entry->addr); /* If the E820 falls within the nr_pages, we want to start * at the n...
2015 Dec 07
6
[PATCH RFC 0/3] Xen on Virtio
Hi all, this patch series introduces support for running Linux on top of Xen inside a virtual machine with virtio devices (nested virt scenario). The problem is that Linux virtio drivers use virt_to_phys to get the guest pseudo-physical addresses to pass to the backend, which doesn't work as expected on Xen. Switching the virtio drivers to the dma APIs (dma_alloc_coherent,