History

Merge tag 'for-linus-6.7a-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip

Pull xen fixes from Juergen Gross: - A fix for the Xen event driver setting the correct return value when experiencing an allocation failure - A fix for allocating space for a struct in the percpu area to not cross page boundaries (this one is for x86, a similar one for Arm was already in the pull request for rc3) * tag 'for-linus-6.7a-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: xen/events: fix error code in xen_bind_pirq_msi_to_irq() x86/xen: fix percpu vcpu_info allocation

Linus Torvalds committed 2 years ago

Commit deb4b9d2 parents 669fc83 7f3da4b3 files · +9 −3Browse files

Unified · Split

3 files
  1. arch/x86/xen/enlighten.c +5 −1
  2. arch/x86/xen/xen-ops.h +1 −1
  3. drivers/xen/events/events_base.c +3 −1
arch/x86/xen/enlighten.c+5−1
@@ -33,9 +33,12 @@ EXPORT_SYMBOL_GPL(hypercall_page); · 32 unmodified lines
33 * and xen_vcpu_setup for details. By default it points to share_info->vcpu_info33 * and xen_vcpu_setup for details. By default it points to share_info->vcpu_info
34 * but during boot it is switched to point to xen_vcpu_info.34 * but during boot it is switched to point to xen_vcpu_info.
35 * The pointer is used in xen_evtchn_do_upcall to acknowledge pending events.35 * The pointer is used in xen_evtchn_do_upcall to acknowledge pending events.
36 * Make sure that xen_vcpu_info doesn't cross a page boundary by making it
37 * cache-line aligned (the struct is guaranteed to have a size of 64 bytes,
38 * which matches the cache line size of 64-bit x86 processors).
36 */39 */
37DEFINE_PER_CPU(struct vcpu_info *, xen_vcpu);40DEFINE_PER_CPU(struct vcpu_info *, xen_vcpu);
38DEFINE_PER_CPU(struct vcpu_info, xen_vcpu_info);41DEFINE_PER_CPU_ALIGNED(struct vcpu_info, xen_vcpu_info);
39 42
40/* Linux <-> Xen vCPU id mapping */43/* Linux <-> Xen vCPU id mapping */
41DEFINE_PER_CPU(uint32_t, xen_vcpu_id);44DEFINE_PER_CPU(uint32_t, xen_vcpu_id);
@@ -160,6 +163,7 @@ void xen_vcpu_setup(int cpu) · 118 unmodified lines
160 int err;163 int err;
161 struct vcpu_info *vcpup;164 struct vcpu_info *vcpup;
162 165
166 BUILD_BUG_ON(sizeof(*vcpup) > SMP_CACHE_BYTES);
163 BUG_ON(HYPERVISOR_shared_info == &xen_dummy_shared_info);167 BUG_ON(HYPERVISOR_shared_info == &xen_dummy_shared_info);
164 168
165 /*169 /*
arch/x86/xen/xen-ops.h+1−1
@@ -21,7 +21,7 @@ extern void *xen_initial_gdt; · 20 unmodified lines
21struct trap_info;21struct trap_info;
22void xen_copy_trap_info(struct trap_info *traps);22void xen_copy_trap_info(struct trap_info *traps);
23 23
24DECLARE_PER_CPU(struct vcpu_info, xen_vcpu_info);24DECLARE_PER_CPU_ALIGNED(struct vcpu_info, xen_vcpu_info);
25DECLARE_PER_CPU(unsigned long, xen_cr3);25DECLARE_PER_CPU(unsigned long, xen_cr3);
26DECLARE_PER_CPU(unsigned long, xen_current_cr3);26DECLARE_PER_CPU(unsigned long, xen_current_cr3);
27 27
drivers/xen/events/events_base.c+3−1
@@ -1110,8 +1110,10 @@ int xen_bind_pirq_msi_to_irq(struct pci_dev *dev, struct msi_desc *msidesc, · 1109 unmodified lines
1110 1110
1111 for (i = 0; i < nvec; i++) {1111 for (i = 0; i < nvec; i++) {
1112 info = xen_irq_init(irq + i);1112 info = xen_irq_init(irq + i);
1113 if (!info)1113 if (!info) {
1114 ret = -ENOMEM;
1114 goto error_irq;1115 goto error_irq;
1116 }
1115 1117
1116 irq_set_chip_and_handler_name(irq + i, &xen_pirq_chip, handle_edge_irq, name);1118 irq_set_chip_and_handler_name(irq + i, &xen_pirq_chip, handle_edge_irq, name);
1117 1119