diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/include/asm/xen/interface.h | 1 | ||||
-rw-r--r-- | arch/arm/xen/enlighten.c | 124 | ||||
-rw-r--r-- | arch/x86/include/asm/xen/interface.h | 1 | ||||
-rw-r--r-- | arch/x86/xen/Kconfig | 1 | ||||
-rw-r--r-- | arch/x86/xen/enlighten.c | 109 | ||||
-rw-r--r-- | arch/x86/xen/mmu.c | 17 | ||||
-rw-r--r-- | arch/x86/xen/smp.c | 2 | ||||
-rw-r--r-- | arch/x86/xen/suspend.c | 2 | ||||
-rw-r--r-- | arch/x86/xen/xen-ops.h | 2 |
9 files changed, 205 insertions, 54 deletions
diff --git a/arch/arm/include/asm/xen/interface.h b/arch/arm/include/asm/xen/interface.h index 5000397134b4..1151188bcd83 100644 --- a/arch/arm/include/asm/xen/interface.h +++ b/arch/arm/include/asm/xen/interface.h | |||
@@ -49,6 +49,7 @@ DEFINE_GUEST_HANDLE(void); | |||
49 | DEFINE_GUEST_HANDLE(uint64_t); | 49 | DEFINE_GUEST_HANDLE(uint64_t); |
50 | DEFINE_GUEST_HANDLE(uint32_t); | 50 | DEFINE_GUEST_HANDLE(uint32_t); |
51 | DEFINE_GUEST_HANDLE(xen_pfn_t); | 51 | DEFINE_GUEST_HANDLE(xen_pfn_t); |
52 | DEFINE_GUEST_HANDLE(xen_ulong_t); | ||
52 | 53 | ||
53 | /* Maximum number of virtual CPUs in multi-processor guests. */ | 54 | /* Maximum number of virtual CPUs in multi-processor guests. */ |
54 | #define MAX_VIRT_CPUS 1 | 55 | #define MAX_VIRT_CPUS 1 |
diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c index f57609275449..41a6a27128a2 100644 --- a/arch/arm/xen/enlighten.c +++ b/arch/arm/xen/enlighten.c | |||
@@ -8,6 +8,8 @@ | |||
8 | #include <xen/features.h> | 8 | #include <xen/features.h> |
9 | #include <xen/platform_pci.h> | 9 | #include <xen/platform_pci.h> |
10 | #include <xen/xenbus.h> | 10 | #include <xen/xenbus.h> |
11 | #include <xen/page.h> | ||
12 | #include <xen/xen-ops.h> | ||
11 | #include <asm/xen/hypervisor.h> | 13 | #include <asm/xen/hypervisor.h> |
12 | #include <asm/xen/hypercall.h> | 14 | #include <asm/xen/hypercall.h> |
13 | #include <linux/interrupt.h> | 15 | #include <linux/interrupt.h> |
@@ -17,6 +19,8 @@ | |||
17 | #include <linux/of_irq.h> | 19 | #include <linux/of_irq.h> |
18 | #include <linux/of_address.h> | 20 | #include <linux/of_address.h> |
19 | 21 | ||
22 | #include <linux/mm.h> | ||
23 | |||
20 | struct start_info _xen_start_info; | 24 | struct start_info _xen_start_info; |
21 | struct start_info *xen_start_info = &_xen_start_info; | 25 | struct start_info *xen_start_info = &_xen_start_info; |
22 | EXPORT_SYMBOL_GPL(xen_start_info); | 26 | EXPORT_SYMBOL_GPL(xen_start_info); |
@@ -29,6 +33,10 @@ struct shared_info *HYPERVISOR_shared_info = (void *)&xen_dummy_shared_info; | |||
29 | 33 | ||
30 | DEFINE_PER_CPU(struct vcpu_info *, xen_vcpu); | 34 | DEFINE_PER_CPU(struct vcpu_info *, xen_vcpu); |
31 | 35 | ||
36 | /* These are unused until we support booting "pre-ballooned" */ | ||
37 | unsigned long xen_released_pages; | ||
38 | struct xen_memory_region xen_extra_mem[XEN_EXTRA_MEM_MAX_REGIONS] __initdata; | ||
39 | |||
32 | /* TODO: to be removed */ | 40 | /* TODO: to be removed */ |
33 | __read_mostly int xen_have_vector_callback; | 41 | __read_mostly int xen_have_vector_callback; |
34 | EXPORT_SYMBOL_GPL(xen_have_vector_callback); | 42 | EXPORT_SYMBOL_GPL(xen_have_vector_callback); |
@@ -38,15 +46,106 @@ EXPORT_SYMBOL_GPL(xen_platform_pci_unplug); | |||
38 | 46 | ||
39 | static __read_mostly int xen_events_irq = -1; | 47 | static __read_mostly int xen_events_irq = -1; |
40 | 48 | ||
49 | /* map fgmfn of domid to lpfn in the current domain */ | ||
50 | static int map_foreign_page(unsigned long lpfn, unsigned long fgmfn, | ||
51 | unsigned int domid) | ||
52 | { | ||
53 | int rc; | ||
54 | struct xen_add_to_physmap_range xatp = { | ||
55 | .domid = DOMID_SELF, | ||
56 | .foreign_domid = domid, | ||
57 | .size = 1, | ||
58 | .space = XENMAPSPACE_gmfn_foreign, | ||
59 | }; | ||
60 | xen_ulong_t idx = fgmfn; | ||
61 | xen_pfn_t gpfn = lpfn; | ||
62 | |||
63 | set_xen_guest_handle(xatp.idxs, &idx); | ||
64 | set_xen_guest_handle(xatp.gpfns, &gpfn); | ||
65 | |||
66 | rc = HYPERVISOR_memory_op(XENMEM_add_to_physmap_range, &xatp); | ||
67 | if (rc) { | ||
68 | pr_warn("Failed to map pfn to mfn rc:%d pfn:%lx mfn:%lx\n", | ||
69 | rc, lpfn, fgmfn); | ||
70 | return 1; | ||
71 | } | ||
72 | return 0; | ||
73 | } | ||
74 | |||
75 | struct remap_data { | ||
76 | xen_pfn_t fgmfn; /* foreign domain's gmfn */ | ||
77 | pgprot_t prot; | ||
78 | domid_t domid; | ||
79 | struct vm_area_struct *vma; | ||
80 | int index; | ||
81 | struct page **pages; | ||
82 | struct xen_remap_mfn_info *info; | ||
83 | }; | ||
84 | |||
85 | static int remap_pte_fn(pte_t *ptep, pgtable_t token, unsigned long addr, | ||
86 | void *data) | ||
87 | { | ||
88 | struct remap_data *info = data; | ||
89 | struct page *page = info->pages[info->index++]; | ||
90 | unsigned long pfn = page_to_pfn(page); | ||
91 | pte_t pte = pfn_pte(pfn, info->prot); | ||
92 | |||
93 | if (map_foreign_page(pfn, info->fgmfn, info->domid)) | ||
94 | return -EFAULT; | ||
95 | set_pte_at(info->vma->vm_mm, addr, ptep, pte); | ||
96 | |||
97 | return 0; | ||
98 | } | ||
99 | |||
41 | int xen_remap_domain_mfn_range(struct vm_area_struct *vma, | 100 | int xen_remap_domain_mfn_range(struct vm_area_struct *vma, |
42 | unsigned long addr, | 101 | unsigned long addr, |
43 | unsigned long mfn, int nr, | 102 | xen_pfn_t mfn, int nr, |
44 | pgprot_t prot, unsigned domid) | 103 | pgprot_t prot, unsigned domid, |
104 | struct page **pages) | ||
45 | { | 105 | { |
46 | return -ENOSYS; | 106 | int err; |
107 | struct remap_data data; | ||
108 | |||
109 | /* TBD: Batching, current sole caller only does page at a time */ | ||
110 | if (nr > 1) | ||
111 | return -EINVAL; | ||
112 | |||
113 | data.fgmfn = mfn; | ||
114 | data.prot = prot; | ||
115 | data.domid = domid; | ||
116 | data.vma = vma; | ||
117 | data.index = 0; | ||
118 | data.pages = pages; | ||
119 | err = apply_to_page_range(vma->vm_mm, addr, nr << PAGE_SHIFT, | ||
120 | remap_pte_fn, &data); | ||
121 | return err; | ||
47 | } | 122 | } |
48 | EXPORT_SYMBOL_GPL(xen_remap_domain_mfn_range); | 123 | EXPORT_SYMBOL_GPL(xen_remap_domain_mfn_range); |
49 | 124 | ||
125 | int xen_unmap_domain_mfn_range(struct vm_area_struct *vma, | ||
126 | int nr, struct page **pages) | ||
127 | { | ||
128 | int i; | ||
129 | |||
130 | for (i = 0; i < nr; i++) { | ||
131 | struct xen_remove_from_physmap xrp; | ||
132 | unsigned long rc, pfn; | ||
133 | |||
134 | pfn = page_to_pfn(pages[i]); | ||
135 | |||
136 | xrp.domid = DOMID_SELF; | ||
137 | xrp.gpfn = pfn; | ||
138 | rc = HYPERVISOR_memory_op(XENMEM_remove_from_physmap, &xrp); | ||
139 | if (rc) { | ||
140 | pr_warn("Failed to unmap pfn:%lx rc:%ld\n", | ||
141 | pfn, rc); | ||
142 | return rc; | ||
143 | } | ||
144 | } | ||
145 | return 0; | ||
146 | } | ||
147 | EXPORT_SYMBOL_GPL(xen_unmap_domain_mfn_range); | ||
148 | |||
50 | /* | 149 | /* |
51 | * see Documentation/devicetree/bindings/arm/xen.txt for the | 150 | * see Documentation/devicetree/bindings/arm/xen.txt for the |
52 | * documentation of the Xen Device Tree format. | 151 | * documentation of the Xen Device Tree format. |
@@ -149,23 +248,6 @@ static int __init xen_init_events(void) | |||
149 | } | 248 | } |
150 | postcore_initcall(xen_init_events); | 249 | postcore_initcall(xen_init_events); |
151 | 250 | ||
152 | /* XXX: only until balloon is properly working */ | ||
153 | int alloc_xenballooned_pages(int nr_pages, struct page **pages, bool highmem) | ||
154 | { | ||
155 | *pages = alloc_pages(highmem ? GFP_HIGHUSER : GFP_KERNEL, | ||
156 | get_order(nr_pages)); | ||
157 | if (*pages == NULL) | ||
158 | return -ENOMEM; | ||
159 | return 0; | ||
160 | } | ||
161 | EXPORT_SYMBOL_GPL(alloc_xenballooned_pages); | ||
162 | |||
163 | void free_xenballooned_pages(int nr_pages, struct page **pages) | ||
164 | { | ||
165 | kfree(*pages); | ||
166 | *pages = NULL; | ||
167 | } | ||
168 | EXPORT_SYMBOL_GPL(free_xenballooned_pages); | ||
169 | 251 | ||
170 | /* In the hypervisor.S file. */ | 252 | /* In the hypervisor.S file. */ |
171 | EXPORT_SYMBOL_GPL(HYPERVISOR_event_channel_op); | 253 | EXPORT_SYMBOL_GPL(HYPERVISOR_event_channel_op); |
@@ -176,4 +258,4 @@ EXPORT_SYMBOL_GPL(HYPERVISOR_sched_op); | |||
176 | EXPORT_SYMBOL_GPL(HYPERVISOR_hvm_op); | 258 | EXPORT_SYMBOL_GPL(HYPERVISOR_hvm_op); |
177 | EXPORT_SYMBOL_GPL(HYPERVISOR_memory_op); | 259 | EXPORT_SYMBOL_GPL(HYPERVISOR_memory_op); |
178 | EXPORT_SYMBOL_GPL(HYPERVISOR_physdev_op); | 260 | EXPORT_SYMBOL_GPL(HYPERVISOR_physdev_op); |
179 | EXPORT_SYMBOL_GPL(privcmd_call); | 261 | EXPORT_SYMBOL_GPL(privcmd_call); \ No newline at end of file |
diff --git a/arch/x86/include/asm/xen/interface.h b/arch/x86/include/asm/xen/interface.h index 54d52ff1304a..fd9cb7695b5f 100644 --- a/arch/x86/include/asm/xen/interface.h +++ b/arch/x86/include/asm/xen/interface.h | |||
@@ -63,6 +63,7 @@ DEFINE_GUEST_HANDLE(void); | |||
63 | DEFINE_GUEST_HANDLE(uint64_t); | 63 | DEFINE_GUEST_HANDLE(uint64_t); |
64 | DEFINE_GUEST_HANDLE(uint32_t); | 64 | DEFINE_GUEST_HANDLE(uint32_t); |
65 | DEFINE_GUEST_HANDLE(xen_pfn_t); | 65 | DEFINE_GUEST_HANDLE(xen_pfn_t); |
66 | DEFINE_GUEST_HANDLE(xen_ulong_t); | ||
66 | #endif | 67 | #endif |
67 | 68 | ||
68 | #ifndef HYPERVISOR_VIRT_START | 69 | #ifndef HYPERVISOR_VIRT_START |
diff --git a/arch/x86/xen/Kconfig b/arch/x86/xen/Kconfig index fdce49c7aff6..c31ee77e1ec1 100644 --- a/arch/x86/xen/Kconfig +++ b/arch/x86/xen/Kconfig | |||
@@ -6,6 +6,7 @@ config XEN | |||
6 | bool "Xen guest support" | 6 | bool "Xen guest support" |
7 | select PARAVIRT | 7 | select PARAVIRT |
8 | select PARAVIRT_CLOCK | 8 | select PARAVIRT_CLOCK |
9 | select XEN_HAVE_PVMMU | ||
9 | depends on X86_64 || (X86_32 && X86_PAE && !X86_VISWS) | 10 | depends on X86_64 || (X86_32 && X86_PAE && !X86_VISWS) |
10 | depends on X86_CMPXCHG && X86_TSC | 11 | depends on X86_CMPXCHG && X86_TSC |
11 | help | 12 | help |
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index 586d83812b67..138e5667409a 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c | |||
@@ -193,10 +193,11 @@ void xen_vcpu_restore(void) | |||
193 | { | 193 | { |
194 | int cpu; | 194 | int cpu; |
195 | 195 | ||
196 | for_each_online_cpu(cpu) { | 196 | for_each_possible_cpu(cpu) { |
197 | bool other_cpu = (cpu != smp_processor_id()); | 197 | bool other_cpu = (cpu != smp_processor_id()); |
198 | bool is_up = HYPERVISOR_vcpu_op(VCPUOP_is_up, cpu, NULL); | ||
198 | 199 | ||
199 | if (other_cpu && | 200 | if (other_cpu && is_up && |
200 | HYPERVISOR_vcpu_op(VCPUOP_down, cpu, NULL)) | 201 | HYPERVISOR_vcpu_op(VCPUOP_down, cpu, NULL)) |
201 | BUG(); | 202 | BUG(); |
202 | 203 | ||
@@ -205,7 +206,7 @@ void xen_vcpu_restore(void) | |||
205 | if (have_vcpu_info_placement) | 206 | if (have_vcpu_info_placement) |
206 | xen_vcpu_setup(cpu); | 207 | xen_vcpu_setup(cpu); |
207 | 208 | ||
208 | if (other_cpu && | 209 | if (other_cpu && is_up && |
209 | HYPERVISOR_vcpu_op(VCPUOP_up, cpu, NULL)) | 210 | HYPERVISOR_vcpu_op(VCPUOP_up, cpu, NULL)) |
210 | BUG(); | 211 | BUG(); |
211 | } | 212 | } |
@@ -223,6 +224,21 @@ static void __init xen_banner(void) | |||
223 | version >> 16, version & 0xffff, extra.extraversion, | 224 | version >> 16, version & 0xffff, extra.extraversion, |
224 | xen_feature(XENFEAT_mmu_pt_update_preserve_ad) ? " (preserve-AD)" : ""); | 225 | xen_feature(XENFEAT_mmu_pt_update_preserve_ad) ? " (preserve-AD)" : ""); |
225 | } | 226 | } |
227 | /* Check if running on Xen version (major, minor) or later */ | ||
228 | bool | ||
229 | xen_running_on_version_or_later(unsigned int major, unsigned int minor) | ||
230 | { | ||
231 | unsigned int version; | ||
232 | |||
233 | if (!xen_domain()) | ||
234 | return false; | ||
235 | |||
236 | version = HYPERVISOR_xen_version(XENVER_version, NULL); | ||
237 | if ((((version >> 16) == major) && ((version & 0xffff) >= minor)) || | ||
238 | ((version >> 16) > major)) | ||
239 | return true; | ||
240 | return false; | ||
241 | } | ||
226 | 242 | ||
227 | #define CPUID_THERM_POWER_LEAF 6 | 243 | #define CPUID_THERM_POWER_LEAF 6 |
228 | #define APERFMPERF_PRESENT 0 | 244 | #define APERFMPERF_PRESENT 0 |
@@ -287,8 +303,7 @@ static void xen_cpuid(unsigned int *ax, unsigned int *bx, | |||
287 | 303 | ||
288 | static bool __init xen_check_mwait(void) | 304 | static bool __init xen_check_mwait(void) |
289 | { | 305 | { |
290 | #if defined(CONFIG_ACPI) && !defined(CONFIG_ACPI_PROCESSOR_AGGREGATOR) && \ | 306 | #ifdef CONFIG_ACPI |
291 | !defined(CONFIG_ACPI_PROCESSOR_AGGREGATOR_MODULE) | ||
292 | struct xen_platform_op op = { | 307 | struct xen_platform_op op = { |
293 | .cmd = XENPF_set_processor_pminfo, | 308 | .cmd = XENPF_set_processor_pminfo, |
294 | .u.set_pminfo.id = -1, | 309 | .u.set_pminfo.id = -1, |
@@ -309,6 +324,13 @@ static bool __init xen_check_mwait(void) | |||
309 | if (!xen_initial_domain()) | 324 | if (!xen_initial_domain()) |
310 | return false; | 325 | return false; |
311 | 326 | ||
327 | /* | ||
328 | * When running under platform earlier than Xen4.2, do not expose | ||
329 | * mwait, to avoid the risk of loading native acpi pad driver | ||
330 | */ | ||
331 | if (!xen_running_on_version_or_later(4, 2)) | ||
332 | return false; | ||
333 | |||
312 | ax = 1; | 334 | ax = 1; |
313 | cx = 0; | 335 | cx = 0; |
314 | 336 | ||
@@ -1495,51 +1517,72 @@ asmlinkage void __init xen_start_kernel(void) | |||
1495 | #endif | 1517 | #endif |
1496 | } | 1518 | } |
1497 | 1519 | ||
1498 | void __ref xen_hvm_init_shared_info(void) | 1520 | #ifdef CONFIG_XEN_PVHVM |
1521 | #define HVM_SHARED_INFO_ADDR 0xFE700000UL | ||
1522 | static struct shared_info *xen_hvm_shared_info; | ||
1523 | static unsigned long xen_hvm_sip_phys; | ||
1524 | static int xen_major, xen_minor; | ||
1525 | |||
1526 | static void xen_hvm_connect_shared_info(unsigned long pfn) | ||
1499 | { | 1527 | { |
1500 | int cpu; | ||
1501 | struct xen_add_to_physmap xatp; | 1528 | struct xen_add_to_physmap xatp; |
1502 | static struct shared_info *shared_info_page = 0; | ||
1503 | 1529 | ||
1504 | if (!shared_info_page) | ||
1505 | shared_info_page = (struct shared_info *) | ||
1506 | extend_brk(PAGE_SIZE, PAGE_SIZE); | ||
1507 | xatp.domid = DOMID_SELF; | 1530 | xatp.domid = DOMID_SELF; |
1508 | xatp.idx = 0; | 1531 | xatp.idx = 0; |
1509 | xatp.space = XENMAPSPACE_shared_info; | 1532 | xatp.space = XENMAPSPACE_shared_info; |
1510 | xatp.gpfn = __pa(shared_info_page) >> PAGE_SHIFT; | 1533 | xatp.gpfn = pfn; |
1511 | if (HYPERVISOR_memory_op(XENMEM_add_to_physmap, &xatp)) | 1534 | if (HYPERVISOR_memory_op(XENMEM_add_to_physmap, &xatp)) |
1512 | BUG(); | 1535 | BUG(); |
1513 | 1536 | ||
1514 | HYPERVISOR_shared_info = (struct shared_info *)shared_info_page; | 1537 | } |
1538 | static void __init xen_hvm_set_shared_info(struct shared_info *sip) | ||
1539 | { | ||
1540 | int cpu; | ||
1541 | |||
1542 | HYPERVISOR_shared_info = sip; | ||
1515 | 1543 | ||
1516 | /* xen_vcpu is a pointer to the vcpu_info struct in the shared_info | 1544 | /* xen_vcpu is a pointer to the vcpu_info struct in the shared_info |
1517 | * page, we use it in the event channel upcall and in some pvclock | 1545 | * page, we use it in the event channel upcall and in some pvclock |
1518 | * related functions. We don't need the vcpu_info placement | 1546 | * related functions. We don't need the vcpu_info placement |
1519 | * optimizations because we don't use any pv_mmu or pv_irq op on | 1547 | * optimizations because we don't use any pv_mmu or pv_irq op on |
1520 | * HVM. | 1548 | * HVM. */ |
1521 | * When xen_hvm_init_shared_info is run at boot time only vcpu 0 is | 1549 | for_each_online_cpu(cpu) |
1522 | * online but xen_hvm_init_shared_info is run at resume time too and | ||
1523 | * in that case multiple vcpus might be online. */ | ||
1524 | for_each_online_cpu(cpu) { | ||
1525 | per_cpu(xen_vcpu, cpu) = &HYPERVISOR_shared_info->vcpu_info[cpu]; | 1550 | per_cpu(xen_vcpu, cpu) = &HYPERVISOR_shared_info->vcpu_info[cpu]; |
1551 | } | ||
1552 | |||
1553 | /* Reconnect the shared_info pfn to a (new) mfn */ | ||
1554 | void xen_hvm_resume_shared_info(void) | ||
1555 | { | ||
1556 | xen_hvm_connect_shared_info(xen_hvm_sip_phys >> PAGE_SHIFT); | ||
1557 | } | ||
1558 | |||
1559 | /* Xen tools prior to Xen 4 do not provide a E820_Reserved area for guest usage. | ||
1560 | * On these old tools the shared info page will be placed in E820_Ram. | ||
1561 | * Xen 4 provides a E820_Reserved area at 0xFC000000, and this code expects | ||
1562 | * that nothing is mapped up to HVM_SHARED_INFO_ADDR. | ||
1563 | * Xen 4.3+ provides an explicit 1MB area at HVM_SHARED_INFO_ADDR which is used | ||
1564 | * here for the shared info page. */ | ||
1565 | static void __init xen_hvm_init_shared_info(void) | ||
1566 | { | ||
1567 | if (xen_major < 4) { | ||
1568 | xen_hvm_shared_info = extend_brk(PAGE_SIZE, PAGE_SIZE); | ||
1569 | xen_hvm_sip_phys = __pa(xen_hvm_shared_info); | ||
1570 | } else { | ||
1571 | xen_hvm_sip_phys = HVM_SHARED_INFO_ADDR; | ||
1572 | set_fixmap(FIX_PARAVIRT_BOOTMAP, xen_hvm_sip_phys); | ||
1573 | xen_hvm_shared_info = | ||
1574 | (struct shared_info *)fix_to_virt(FIX_PARAVIRT_BOOTMAP); | ||
1526 | } | 1575 | } |
1576 | xen_hvm_connect_shared_info(xen_hvm_sip_phys >> PAGE_SHIFT); | ||
1577 | xen_hvm_set_shared_info(xen_hvm_shared_info); | ||
1527 | } | 1578 | } |
1528 | 1579 | ||
1529 | #ifdef CONFIG_XEN_PVHVM | ||
1530 | static void __init init_hvm_pv_info(void) | 1580 | static void __init init_hvm_pv_info(void) |
1531 | { | 1581 | { |
1532 | int major, minor; | 1582 | uint32_t ecx, edx, pages, msr, base; |
1533 | uint32_t eax, ebx, ecx, edx, pages, msr, base; | ||
1534 | u64 pfn; | 1583 | u64 pfn; |
1535 | 1584 | ||
1536 | base = xen_cpuid_base(); | 1585 | base = xen_cpuid_base(); |
1537 | cpuid(base + 1, &eax, &ebx, &ecx, &edx); | ||
1538 | |||
1539 | major = eax >> 16; | ||
1540 | minor = eax & 0xffff; | ||
1541 | printk(KERN_INFO "Xen version %d.%d.\n", major, minor); | ||
1542 | |||
1543 | cpuid(base + 2, &pages, &msr, &ecx, &edx); | 1586 | cpuid(base + 2, &pages, &msr, &ecx, &edx); |
1544 | 1587 | ||
1545 | pfn = __pa(hypercall_page); | 1588 | pfn = __pa(hypercall_page); |
@@ -1590,12 +1633,22 @@ static void __init xen_hvm_guest_init(void) | |||
1590 | 1633 | ||
1591 | static bool __init xen_hvm_platform(void) | 1634 | static bool __init xen_hvm_platform(void) |
1592 | { | 1635 | { |
1636 | uint32_t eax, ebx, ecx, edx, base; | ||
1637 | |||
1593 | if (xen_pv_domain()) | 1638 | if (xen_pv_domain()) |
1594 | return false; | 1639 | return false; |
1595 | 1640 | ||
1596 | if (!xen_cpuid_base()) | 1641 | base = xen_cpuid_base(); |
1642 | if (!base) | ||
1597 | return false; | 1643 | return false; |
1598 | 1644 | ||
1645 | cpuid(base + 1, &eax, &ebx, &ecx, &edx); | ||
1646 | |||
1647 | xen_major = eax >> 16; | ||
1648 | xen_minor = eax & 0xffff; | ||
1649 | |||
1650 | printk(KERN_INFO "Xen version %d.%d.\n", xen_major, xen_minor); | ||
1651 | |||
1599 | return true; | 1652 | return true; |
1600 | } | 1653 | } |
1601 | 1654 | ||
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c index dcf5f2dd91ec..01de35c77221 100644 --- a/arch/x86/xen/mmu.c +++ b/arch/x86/xen/mmu.c | |||
@@ -2497,8 +2497,10 @@ static int remap_area_mfn_pte_fn(pte_t *ptep, pgtable_t token, | |||
2497 | 2497 | ||
2498 | int xen_remap_domain_mfn_range(struct vm_area_struct *vma, | 2498 | int xen_remap_domain_mfn_range(struct vm_area_struct *vma, |
2499 | unsigned long addr, | 2499 | unsigned long addr, |
2500 | unsigned long mfn, int nr, | 2500 | xen_pfn_t mfn, int nr, |
2501 | pgprot_t prot, unsigned domid) | 2501 | pgprot_t prot, unsigned domid, |
2502 | struct page **pages) | ||
2503 | |||
2502 | { | 2504 | { |
2503 | struct remap_data rmd; | 2505 | struct remap_data rmd; |
2504 | struct mmu_update mmu_update[REMAP_BATCH_SIZE]; | 2506 | struct mmu_update mmu_update[REMAP_BATCH_SIZE]; |
@@ -2542,3 +2544,14 @@ out: | |||
2542 | return err; | 2544 | return err; |
2543 | } | 2545 | } |
2544 | EXPORT_SYMBOL_GPL(xen_remap_domain_mfn_range); | 2546 | EXPORT_SYMBOL_GPL(xen_remap_domain_mfn_range); |
2547 | |||
2548 | /* Returns: 0 success */ | ||
2549 | int xen_unmap_domain_mfn_range(struct vm_area_struct *vma, | ||
2550 | int numpgs, struct page **pages) | ||
2551 | { | ||
2552 | if (!pages || !xen_feature(XENFEAT_auto_translated_physmap)) | ||
2553 | return 0; | ||
2554 | |||
2555 | return -EINVAL; | ||
2556 | } | ||
2557 | EXPORT_SYMBOL_GPL(xen_unmap_domain_mfn_range); | ||
diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c index 353c50f18702..4f7d2599b484 100644 --- a/arch/x86/xen/smp.c +++ b/arch/x86/xen/smp.c | |||
@@ -254,7 +254,7 @@ static void __init xen_smp_prepare_cpus(unsigned int max_cpus) | |||
254 | } | 254 | } |
255 | xen_init_lock_cpu(0); | 255 | xen_init_lock_cpu(0); |
256 | 256 | ||
257 | smp_store_cpu_info(0); | 257 | smp_store_boot_cpu_info(); |
258 | cpu_data(0).x86_max_cores = 1; | 258 | cpu_data(0).x86_max_cores = 1; |
259 | 259 | ||
260 | for_each_possible_cpu(i) { | 260 | for_each_possible_cpu(i) { |
diff --git a/arch/x86/xen/suspend.c b/arch/x86/xen/suspend.c index 45329c8c226e..ae8a00c39de4 100644 --- a/arch/x86/xen/suspend.c +++ b/arch/x86/xen/suspend.c | |||
@@ -30,7 +30,7 @@ void xen_arch_hvm_post_suspend(int suspend_cancelled) | |||
30 | { | 30 | { |
31 | #ifdef CONFIG_XEN_PVHVM | 31 | #ifdef CONFIG_XEN_PVHVM |
32 | int cpu; | 32 | int cpu; |
33 | xen_hvm_init_shared_info(); | 33 | xen_hvm_resume_shared_info(); |
34 | xen_callback_vector(); | 34 | xen_callback_vector(); |
35 | xen_unplug_emulated_devices(); | 35 | xen_unplug_emulated_devices(); |
36 | if (xen_feature(XENFEAT_hvm_safe_pvclock)) { | 36 | if (xen_feature(XENFEAT_hvm_safe_pvclock)) { |
diff --git a/arch/x86/xen/xen-ops.h b/arch/x86/xen/xen-ops.h index a95b41744ad0..d2e73d19d366 100644 --- a/arch/x86/xen/xen-ops.h +++ b/arch/x86/xen/xen-ops.h | |||
@@ -40,7 +40,7 @@ void xen_enable_syscall(void); | |||
40 | void xen_vcpu_restore(void); | 40 | void xen_vcpu_restore(void); |
41 | 41 | ||
42 | void xen_callback_vector(void); | 42 | void xen_callback_vector(void); |
43 | void xen_hvm_init_shared_info(void); | 43 | void xen_hvm_resume_shared_info(void); |
44 | void xen_unplug_emulated_devices(void); | 44 | void xen_unplug_emulated_devices(void); |
45 | 45 | ||
46 | void __init xen_build_dynamic_phys_to_machine(void); | 46 | void __init xen_build_dynamic_phys_to_machine(void); |