diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-04-16 15:01:03 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-04-16 15:01:03 -0400 |
| commit | 497a5df7bf6ffd136ae21c49d1a01292930d7ca2 (patch) | |
| tree | 774215d43cdc9fbd8660086d1801400163dcbd52 | |
| parent | 714d8e7e27197dd39b2550e762a6a6fcf397a471 (diff) | |
| parent | 0b97b03d88b40bfbd7ff0e069186a137d9786d43 (diff) | |
Merge tag 'stable/for-linus-4.1-rc0-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip
Pull xen features and fixes from David Vrabel:
- use a single source list of hypercalls, generating other tables etc.
at build time.
- add a "Xen PV" APIC driver to support >255 VCPUs in PV guests.
- significant performance improve to guest save/restore/migration.
- scsiback/front save/restore support.
- infrastructure for multi-page xenbus rings.
- misc fixes.
* tag 'stable/for-linus-4.1-rc0-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
xen/pci: Try harder to get PXM information for Xen
xenbus_client: Extend interface to support multi-page ring
xen-pciback: also support disabling of bus-mastering and memory-write-invalidate
xen: support suspend/resume in pvscsi frontend
xen: scsiback: add LUN of restored domain
xen-scsiback: define a pr_fmt macro with xen-pvscsi
xen/mce: fix up xen_late_init_mcelog() error handling
xen/privcmd: improve performance of MMAPBATCH_V2
xen: unify foreign GFN map/unmap for auto-xlated physmap guests
x86/xen/apic: WARN with details.
x86/xen: Provide a "Xen PV" APIC driver to support >255 VCPUs
xen/pciback: Don't print scary messages when unsupported by hypervisor.
xen: use generated hypercall symbols in arch/x86/xen/xen-head.S
xen: use generated hypervisor symbols in arch/x86/xen/trace.c
xen: synchronize include/xen/interface/xen.h with xen
xen: build infrastructure for generating hypercall depending symbols
xen: balloon: Use static attribute groups for sysfs entries
xen: pcpu: Use static attribute groups for sysfs entry
31 files changed, 1246 insertions, 694 deletions
diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c index 263a2044c65b..224081ccc92f 100644 --- a/arch/arm/xen/enlighten.c +++ b/arch/arm/xen/enlighten.c | |||
| @@ -53,105 +53,33 @@ EXPORT_SYMBOL_GPL(xen_platform_pci_unplug); | |||
| 53 | 53 | ||
| 54 | static __read_mostly int xen_events_irq = -1; | 54 | static __read_mostly int xen_events_irq = -1; |
| 55 | 55 | ||
| 56 | /* map fgmfn of domid to lpfn in the current domain */ | 56 | int xen_remap_domain_mfn_array(struct vm_area_struct *vma, |
| 57 | static int map_foreign_page(unsigned long lpfn, unsigned long fgmfn, | 57 | unsigned long addr, |
| 58 | unsigned int domid) | 58 | xen_pfn_t *mfn, int nr, |
| 59 | int *err_ptr, pgprot_t prot, | ||
| 60 | unsigned domid, | ||
| 61 | struct page **pages) | ||
| 59 | { | 62 | { |
| 60 | int rc; | 63 | return xen_xlate_remap_gfn_array(vma, addr, mfn, nr, err_ptr, |
| 61 | struct xen_add_to_physmap_range xatp = { | 64 | prot, domid, pages); |
| 62 | .domid = DOMID_SELF, | ||
| 63 | .foreign_domid = domid, | ||
| 64 | .size = 1, | ||
| 65 | .space = XENMAPSPACE_gmfn_foreign, | ||
| 66 | }; | ||
| 67 | xen_ulong_t idx = fgmfn; | ||
| 68 | xen_pfn_t gpfn = lpfn; | ||
| 69 | int err = 0; | ||
| 70 | |||
| 71 | set_xen_guest_handle(xatp.idxs, &idx); | ||
| 72 | set_xen_guest_handle(xatp.gpfns, &gpfn); | ||
| 73 | set_xen_guest_handle(xatp.errs, &err); | ||
| 74 | |||
| 75 | rc = HYPERVISOR_memory_op(XENMEM_add_to_physmap_range, &xatp); | ||
| 76 | if (rc || err) { | ||
| 77 | pr_warn("Failed to map pfn to mfn rc:%d:%d pfn:%lx mfn:%lx\n", | ||
| 78 | rc, err, lpfn, fgmfn); | ||
| 79 | return 1; | ||
| 80 | } | ||
| 81 | return 0; | ||
| 82 | } | ||
| 83 | |||
| 84 | struct remap_data { | ||
| 85 | xen_pfn_t fgmfn; /* foreign domain's gmfn */ | ||
| 86 | pgprot_t prot; | ||
| 87 | domid_t domid; | ||
| 88 | struct vm_area_struct *vma; | ||
| 89 | int index; | ||
| 90 | struct page **pages; | ||
| 91 | struct xen_remap_mfn_info *info; | ||
| 92 | }; | ||
| 93 | |||
| 94 | static int remap_pte_fn(pte_t *ptep, pgtable_t token, unsigned long addr, | ||
| 95 | void *data) | ||
| 96 | { | ||
| 97 | struct remap_data *info = data; | ||
| 98 | struct page *page = info->pages[info->index++]; | ||
| 99 | unsigned long pfn = page_to_pfn(page); | ||
| 100 | pte_t pte = pte_mkspecial(pfn_pte(pfn, info->prot)); | ||
| 101 | |||
| 102 | if (map_foreign_page(pfn, info->fgmfn, info->domid)) | ||
| 103 | return -EFAULT; | ||
| 104 | set_pte_at(info->vma->vm_mm, addr, ptep, pte); | ||
| 105 | |||
| 106 | return 0; | ||
| 107 | } | 65 | } |
| 66 | EXPORT_SYMBOL_GPL(xen_remap_domain_mfn_array); | ||
| 108 | 67 | ||
| 68 | /* Not used by XENFEAT_auto_translated guests. */ | ||
| 109 | int xen_remap_domain_mfn_range(struct vm_area_struct *vma, | 69 | int xen_remap_domain_mfn_range(struct vm_area_struct *vma, |
| 110 | unsigned long addr, | 70 | unsigned long addr, |
| 111 | xen_pfn_t mfn, int nr, | 71 | xen_pfn_t mfn, int nr, |
| 112 | pgprot_t prot, unsigned domid, | 72 | pgprot_t prot, unsigned domid, |
| 113 | struct page **pages) | 73 | struct page **pages) |
| 114 | { | 74 | { |
| 115 | int err; | 75 | return -ENOSYS; |
| 116 | struct remap_data data; | ||
| 117 | |||
| 118 | /* TBD: Batching, current sole caller only does page at a time */ | ||
| 119 | if (nr > 1) | ||
| 120 | return -EINVAL; | ||
| 121 | |||
| 122 | data.fgmfn = mfn; | ||
| 123 | data.prot = prot; | ||
| 124 | data.domid = domid; | ||
| 125 | data.vma = vma; | ||
| 126 | data.index = 0; | ||
| 127 | data.pages = pages; | ||
| 128 | err = apply_to_page_range(vma->vm_mm, addr, nr << PAGE_SHIFT, | ||
| 129 | remap_pte_fn, &data); | ||
| 130 | return err; | ||
| 131 | } | 76 | } |
| 132 | EXPORT_SYMBOL_GPL(xen_remap_domain_mfn_range); | 77 | EXPORT_SYMBOL_GPL(xen_remap_domain_mfn_range); |
| 133 | 78 | ||
| 134 | int xen_unmap_domain_mfn_range(struct vm_area_struct *vma, | 79 | int xen_unmap_domain_mfn_range(struct vm_area_struct *vma, |
| 135 | int nr, struct page **pages) | 80 | int nr, struct page **pages) |
| 136 | { | 81 | { |
| 137 | int i; | 82 | return xen_xlate_unmap_gfn_range(vma, nr, pages); |
| 138 | |||
| 139 | for (i = 0; i < nr; i++) { | ||
| 140 | struct xen_remove_from_physmap xrp; | ||
| 141 | unsigned long rc, pfn; | ||
| 142 | |||
| 143 | pfn = page_to_pfn(pages[i]); | ||
| 144 | |||
| 145 | xrp.domid = DOMID_SELF; | ||
| 146 | xrp.gpfn = pfn; | ||
| 147 | rc = HYPERVISOR_memory_op(XENMEM_remove_from_physmap, &xrp); | ||
| 148 | if (rc) { | ||
| 149 | pr_warn("Failed to unmap pfn:%lx rc:%ld\n", | ||
| 150 | pfn, rc); | ||
| 151 | return rc; | ||
| 152 | } | ||
| 153 | } | ||
| 154 | return 0; | ||
| 155 | } | 83 | } |
| 156 | EXPORT_SYMBOL_GPL(xen_unmap_domain_mfn_range); | 84 | EXPORT_SYMBOL_GPL(xen_unmap_domain_mfn_range); |
| 157 | 85 | ||
diff --git a/arch/x86/syscalls/Makefile b/arch/x86/syscalls/Makefile index 3323c2745248..a55abb9f6c5e 100644 --- a/arch/x86/syscalls/Makefile +++ b/arch/x86/syscalls/Makefile | |||
| @@ -19,6 +19,9 @@ quiet_cmd_syshdr = SYSHDR $@ | |||
| 19 | quiet_cmd_systbl = SYSTBL $@ | 19 | quiet_cmd_systbl = SYSTBL $@ |
| 20 | cmd_systbl = $(CONFIG_SHELL) '$(systbl)' $< $@ | 20 | cmd_systbl = $(CONFIG_SHELL) '$(systbl)' $< $@ |
| 21 | 21 | ||
| 22 | quiet_cmd_hypercalls = HYPERCALLS $@ | ||
| 23 | cmd_hypercalls = $(CONFIG_SHELL) '$<' $@ $(filter-out $<,$^) | ||
| 24 | |||
| 22 | syshdr_abi_unistd_32 := i386 | 25 | syshdr_abi_unistd_32 := i386 |
| 23 | $(uapi)/unistd_32.h: $(syscall32) $(syshdr) | 26 | $(uapi)/unistd_32.h: $(syscall32) $(syshdr) |
| 24 | $(call if_changed,syshdr) | 27 | $(call if_changed,syshdr) |
| @@ -47,10 +50,16 @@ $ | |||
