Revision 3d7746bea92530e8695258a3cf3ddec7a135edd6 authored by David Woodhouse on 06 January 2021, 15:39:58 UTC, committed by Juergen Gross on 13 January 2021, 15:12:09 UTC
Only the IPI-related functions in the smp_ops should be conditional
on the vector callback being available. The rest should still happen:

 • xen_hvm_smp_prepare_boot_cpu()

   This function does two things, both of which should still happen if
   there is no vector callback support.

   The call to xen_vcpu_setup() for vCPU0 should still happen as it just
   sets up the vcpu_info for CPU0. That does happen for the secondary
   vCPUs too, from xen_cpu_up_prepare_hvm().

   The second thing it does is call xen_init_spinlocks(), which perhaps
   counter-intuitively should *also* still be happening in the case
   without vector callbacks, so that it can clear its local xen_pvspin
   flag and disable the virt_spin_lock_key accordingly.

   Checking xen_have_vector_callback in xen_init_spinlocks() itself
   would affect PV guests, so set the global nopvspin flag in
   xen_hvm_smp_init() instead, when vector callbacks aren't available.

 • xen_hvm_smp_prepare_cpus()

   This does some IPI-related setup by calling xen_smp_intr_init() and
   xen_init_lock_cpu(), which can be made conditional. And it sets the
   xen_vcpu_id to XEN_VCPU_ID_INVALID for all possible CPUS, which does
   need to happen.

 • xen_smp_cpus_done()

   This offlines any vCPUs which doesn't fit in the global shared_info
   page, if separate vcpu_info placement isn't available. That part also
   needs to happen regardless of vector callback support.

 • xen_hvm_cpu_die()

   This doesn't actually do anything other than commin_cpu_die() right
   right now in the !vector_callback case; all three teardown functions
   it calls should be no-ops. But to guard against future regressions
   it's useful to call it anyway, and for it to explicitly check for
   xen_have_vector_callback before calling those additional functions.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Link: https://lore.kernel.org/r/20210106153958.584169-6-dwmw2@infradead.org
Signed-off-by: Juergen Gross <jgross@suse.com>
1 parent 4621dc6
History
File Mode Size
kasan
Kconfig -rw-r--r-- 27.5 KB
Kconfig.debug -rw-r--r-- 6.2 KB
Makefile -rw-r--r-- 4.3 KB
backing-dev.c -rw-r--r-- 25.2 KB
balloon_compaction.c -rw-r--r-- 8.2 KB
cleancache.c -rw-r--r-- 9.8 KB
cma.c -rw-r--r-- 14.3 KB
cma.h -rw-r--r-- 646 bytes
cma_debug.c -rw-r--r-- 4.5 KB
compaction.c -rw-r--r-- 80.4 KB
debug.c -rw-r--r-- 8.5 KB
debug_page_ref.c -rw-r--r-- 1.4 KB
debug_vm_pgtable.c -rw-r--r-- 29.0 KB
dmapool.c -rw-r--r-- 13.7 KB
early_ioremap.c -rw-r--r-- 6.8 KB
fadvise.c -rw-r--r-- 5.3 KB
failslab.c -rw-r--r-- 1.4 KB
filemap.c -rw-r--r-- 98.3 KB
frame_vector.c -rw-r--r-- 6.4 KB
frontswap.c -rw-r--r-- 14.2 KB
gup.c -rw-r--r-- 84.6 KB
gup_benchmark.c -rw-r--r-- 4.5 KB
highmem.c -rw-r--r-- 11.7 KB
hmm.c -rw-r--r-- 16.6 KB
huge_memory.c -rw-r--r-- 82.1 KB
hugetlb.c -rw-r--r-- 154.5 KB
hugetlb_cgroup.c -rw-r--r-- 21.4 KB
hwpoison-inject.c -rw-r--r-- 2.6 KB
init-mm.c -rw-r--r-- 1.2 KB
internal.h -rw-r--r-- 19.1 KB
interval_tree.c -rw-r--r-- 3.1 KB
ioremap.c -rw-r--r-- 6.5 KB
khugepaged.c -rw-r--r-- 58.3 KB
kmemleak.c -rw-r--r-- 56.2 KB
ksm.c -rw-r--r-- 88.8 KB
list_lru.c -rw-r--r-- 14.3 KB
maccess.c -rw-r--r-- 8.7 KB
madvise.c -rw-r--r-- 30.9 KB
mapping_dirty_helpers.c -rw-r--r-- 10.3 KB
memblock.c -rw-r--r-- 58.0 KB
memcontrol.c -rw-r--r-- 191.8 KB
memfd.c -rw-r--r-- 7.9 KB
memory-failure.c -rw-r--r-- 51.8 KB
memory.c -rw-r--r-- 141.8 KB
memory_hotplug.c -rw-r--r-- 49.0 KB
mempolicy.c -rw-r--r-- 76.1 KB
mempool.c -rw-r--r-- 15.8 KB
memremap.c -rw-r--r-- 14.0 KB
memtest.c -rw-r--r-- 2.8 KB
migrate.c -rw-r--r-- 80.8 KB
mincore.c -rw-r--r-- 7.0 KB
mlock.c -rw-r--r-- 22.9 KB
mm_init.c -rw-r--r-- 5.3 KB
mmap.c -rw-r--r-- 102.6 KB
mmu_gather.c -rw-r--r-- 8.4 KB
mmu_notifier.c -rw-r--r-- 34.6 KB
mmzone.c -rw-r--r-- 2.4 KB
mprotect.c -rw-r--r-- 17.1 KB
mremap.c -rw-r--r-- 22.1 KB
msync.c -rw-r--r-- 2.6 KB
nommu.c -rw-r--r-- 44.9 KB
oom_kill.c -rw-r--r-- 30.3 KB
page-writeback.c -rw-r--r-- 84.6 KB
page_alloc.c -rw-r--r-- 245.0 KB
page_counter.c -rw-r--r-- 6.6 KB
page_ext.c -rw-r--r-- 10.8 KB
page_idle.c -rw-r--r-- 5.5 KB
page_io.c -rw-r--r-- 11.5 KB
page_isolation.c -rw-r--r-- 9.2 KB
page_owner.c -rw-r--r-- 16.0 KB
page_poison.c -rw-r--r-- 3.1 KB
page_reporting.c -rw-r--r-- 9.9 KB
page_reporting.h -rw-r--r-- 1.6 KB
page_vma_mapped.c -rw-r--r-- 7.7 KB
pagewalk.c -rw-r--r-- 14.2 KB
percpu-internal.h -rw-r--r-- 7.7 KB
percpu-km.c -rw-r--r-- 3.0 KB
percpu-stats.c -rw-r--r-- 6.0 KB
percpu-vm.c -rw-r--r-- 10.3 KB
percpu.c -rw-r--r-- 95.4 KB
pgalloc-track.h -rw-r--r-- 1.3 KB
pgtable-generic.c -rw-r--r-- 5.6 KB
process_vm_access.c -rw-r--r-- 8.2 KB
ptdump.c -rw-r--r-- 3.8 KB
readahead.c -rw-r--r-- 17.3 KB
rmap.c -rw-r--r-- 55.5 KB
rodata_test.c -rw-r--r-- 1.3 KB
shmem.c -rw-r--r-- 110.9 KB
shuffle.c -rw-r--r-- 4.7 KB
shuffle.h -rw-r--r-- 1.1 KB
slab.c -rw-r--r-- 105.1 KB
slab.h -rw-r--r-- 17.0 KB
slab_common.c -rw-r--r-- 29.3 KB
slob.c -rw-r--r-- 18.1 KB
slub.c -rw-r--r-- 140.3 KB
sparse-vmemmap.c -rw-r--r-- 6.8 KB
sparse.c -rw-r--r-- 26.4 KB
swap.c -rw-r--r-- 33.8 KB
swap_cgroup.c -rw-r--r-- 5.1 KB
swap_slots.c -rw-r--r-- 9.3 KB
swap_state.c -rw-r--r-- 24.9 KB
swapfile.c -rw-r--r-- 96.9 KB
truncate.c -rw-r--r-- 27.3 KB
usercopy.c -rw-r--r-- 9.5 KB
userfaultfd.c -rw-r--r-- 17.6 KB
util.c -rw-r--r-- 23.9 KB
vmacache.c -rw-r--r-- 2.7 KB
vmalloc.c -rw-r--r-- 91.0 KB
vmpressure.c -rw-r--r-- 13.9 KB
vmscan.c -rw-r--r-- 123.4 KB
vmstat.c -rw-r--r-- 53.0 KB
workingset.c -rw-r--r-- 21.4 KB
z3fold.c -rw-r--r-- 46.7 KB
zbud.c -rw-r--r-- 18.2 KB
zpool.c -rw-r--r-- 11.2 KB
zsmalloc.c -rw-r--r-- 61.1 KB
zswap.c -rw-r--r-- 35.1 KB

back to top