Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'stable/for-linus-3.10-rc0-tag-two' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen

Pull Xen bug-fixes from Konrad Rzeszutek Wilk:
- More fixes in the vCPU PVHVM hotplug path.
- Add more documentation.
- Fix various ARM related issues in the Xen generic drivers.
- Updates in the xen-pciback driver per Bjorn's updates.
- Mask the x2APIC feature for PV guests.

* tag 'stable/for-linus-3.10-rc0-tag-two' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
xen/pci: Used cached MSI-X capability offset
xen/pci: Use PCI_MSIX_TABLE_BIR, not PCI_MSIX_FLAGS_BIRMASK
xen: clear IRQ_NOAUTOEN and IRQ_NOREQUEST
xen: mask x2APIC feature in PV
xen: SWIOTLB is only used on x86
xen/spinlock: Fix check from greater than to be also be greater or equal to.
xen/smp/pvhvm: Don't point per_cpu(xen_vpcu, 33 and larger) to shared_info
xen/vcpu: Document the xen_vcpu_info and xen_vcpu
xen/vcpu/pvhvm: Fix vcpu hotplugging hanging.

+55 -7
+2 -3
arch/x86/pci/xen.c
··· 295 295 int pos; 296 296 u32 table_offset, bir; 297 297 298 - pos = pci_find_capability(dev, PCI_CAP_ID_MSIX); 299 - 298 + pos = dev->msix_cap; 300 299 pci_read_config_dword(dev, pos + PCI_MSIX_TABLE, 301 300 &table_offset); 302 - bir = (u8)(table_offset & PCI_MSIX_FLAGS_BIRMASK); 301 + bir = (u8)(table_offset & PCI_MSIX_TABLE_BIR); 303 302 304 303 map_irq.table_base = pci_resource_start(dev, bir); 305 304 map_irq.entry_nr = msidesc->msi_attrib.entry_nr;
+49 -1
arch/x86/xen/enlighten.c
··· 85 85 86 86 EXPORT_SYMBOL_GPL(hypercall_page); 87 87 88 + /* 89 + * Pointer to the xen_vcpu_info structure or 90 + * &HYPERVISOR_shared_info->vcpu_info[cpu]. See xen_hvm_init_shared_info 91 + * and xen_vcpu_setup for details. By default it points to share_info->vcpu_info 92 + * but if the hypervisor supports VCPUOP_register_vcpu_info then it can point 93 + * to xen_vcpu_info. The pointer is used in __xen_evtchn_do_upcall to 94 + * acknowledge pending events. 95 + * Also more subtly it is used by the patched version of irq enable/disable 96 + * e.g. xen_irq_enable_direct and xen_iret in PV mode. 97 + * 98 + * The desire to be able to do those mask/unmask operations as a single 99 + * instruction by using the per-cpu offset held in %gs is the real reason 100 + * vcpu info is in a per-cpu pointer and the original reason for this 101 + * hypercall. 102 + * 103 + */ 88 104 DEFINE_PER_CPU(struct vcpu_info *, xen_vcpu); 105 + 106 + /* 107 + * Per CPU pages used if hypervisor supports VCPUOP_register_vcpu_info 108 + * hypercall. This can be used both in PV and PVHVM mode. The structure 109 + * overrides the default per_cpu(xen_vcpu, cpu) value. 110 + */ 89 111 DEFINE_PER_CPU(struct vcpu_info, xen_vcpu_info); 90 112 91 113 enum xen_domain_type xen_domain_type = XEN_NATIVE; ··· 179 157 180 158 BUG_ON(HYPERVISOR_shared_info == &xen_dummy_shared_info); 181 159 160 + /* 161 + * This path is called twice on PVHVM - first during bootup via 162 + * smp_init -> xen_hvm_cpu_notify, and then if the VCPU is being 163 + * hotplugged: cpu_up -> xen_hvm_cpu_notify. 164 + * As we can only do the VCPUOP_register_vcpu_info once lets 165 + * not over-write its result. 166 + * 167 + * For PV it is called during restore (xen_vcpu_restore) and bootup 168 + * (xen_setup_vcpu_info_placement). The hotplug mechanism does not 169 + * use this function. 170 + */ 171 + if (xen_hvm_domain()) { 172 + if (per_cpu(xen_vcpu, cpu) == &per_cpu(xen_vcpu_info, cpu)) 173 + return; 174 + } 182 175 if (cpu < MAX_VIRT_CPUS) 183 176 per_cpu(xen_vcpu,cpu) = &HYPERVISOR_shared_info->vcpu_info[cpu]; 184 177 ··· 209 172 210 173 /* Check to see if the hypervisor will put the vcpu_info 211 174 structure where we want it, which allows direct access via 212 - a percpu-variable. */ 175 + a percpu-variable. 176 + N.B. This hypercall can _only_ be called once per CPU. Subsequent 177 + calls will error out with -EINVAL. This is due to the fact that 178 + hypervisor has no unregister variant and this hypercall does not 179 + allow to over-write info.mfn and info.offset. 180 + */ 213 181 err = HYPERVISOR_vcpu_op(VCPUOP_register_vcpu_info, cpu, &info); 214 182 215 183 if (err) { ··· 429 387 cpuid_leaf1_edx_mask &= 430 388 ~((1 << X86_FEATURE_APIC) | /* disable local APIC */ 431 389 (1 << X86_FEATURE_ACPI)); /* disable ACPI */ 390 + 391 + cpuid_leaf1_ecx_mask &= ~(1 << (X86_FEATURE_X2APIC % 32)); 392 + 432 393 ax = 1; 433 394 cx = 0; 434 395 xen_cpuid(&ax, &bx, &cx, &dx); ··· 1648 1603 * online but xen_hvm_init_shared_info is run at resume time too and 1649 1604 * in that case multiple vcpus might be online. */ 1650 1605 for_each_online_cpu(cpu) { 1606 + /* Leave it to be NULL. */ 1607 + if (cpu >= MAX_VIRT_CPUS) 1608 + continue; 1651 1609 per_cpu(xen_vcpu, cpu) = &HYPERVISOR_shared_info->vcpu_info[cpu]; 1652 1610 } 1653 1611 }
+1 -1
arch/x86/xen/spinlock.c
··· 364 364 int irq; 365 365 const char *name; 366 366 367 - WARN(per_cpu(lock_kicker_irq, cpu) > 0, "spinlock on CPU%d exists on IRQ%d!\n", 367 + WARN(per_cpu(lock_kicker_irq, cpu) >= 0, "spinlock on CPU%d exists on IRQ%d!\n", 368 368 cpu, per_cpu(lock_kicker_irq, cpu)); 369 369 370 370 /*
+1 -1
drivers/xen/Kconfig
··· 141 141 142 142 config SWIOTLB_XEN 143 143 def_bool y 144 - depends on PCI 144 + depends on PCI && X86 145 145 select SWIOTLB 146 146 147 147 config XEN_TMEM
+2 -1
drivers/xen/events.c
··· 167 167 info->cpu = cpu; 168 168 169 169 evtchn_to_irq[evtchn] = irq; 170 + 171 + irq_clear_status_flags(irq, IRQ_NOREQUEST|IRQ_NOAUTOEN); 170 172 } 171 173 172 174 static void xen_irq_info_evtchn_init(unsigned irq, ··· 876 874 struct irq_info *info = info_for_irq(irq); 877 875 WARN_ON(info == NULL || info->type != IRQT_EVTCHN); 878 876 } 879 - irq_clear_status_flags(irq, IRQ_NOREQUEST|IRQ_NOAUTOEN); 880 877 881 878 out: 882 879 mutex_unlock(&irq_mapping_update_lock);