Skip to contentSkip to conversation

mmotm 2018-10-30-16-08 uploaded

PATCH In review [email protected] 6 participants 9 messages Oct 30, 2018 – Nov 1, 2018

Subsystems (4)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The mm-of-the-moment snapshot 2018-10-30-16-08 has been uploaded to

http://www.ozlabs.org/~akpm/mmotm/

mmotm-readme.txt says

README for mm-of-the-moment:

http://www.ozlabs.org/~akpm/mmotm/

This is a snapshot of my -mm patch queue. Uploaded at random hopefully more than once a week.

You will need quilt to apply these patches to the latest Linus release (4.x or 4.x-rcY). The series file is in broken-out.tar.gz and is duplicated in
http://ozlabs.org/~akpm/mmotm/series

The file broken-out.tar.gz contains two datestamp files: .DATE and .DATE-yyyy-mm-dd-hh-mm-ss. Both contain the string yyyy-mm-dd-hh-mm-ss, followed by the base kernel version against which this patch series is to be applied.

This tree is partially included in linux-next. To see which patches are included in linux-next, consult the `series' file. Only the patches within the #NEXT_PATCHES_START/#NEXT_PATCHES_END markers are included in linux-next.

A git tree which contains the memory management portion of this tree is maintained at git://git.kernel.org/pub/scm/linux/kernel/git/mhocko/mm.git
by Michal Hocko. It contains the patches which are between the "#NEXT_PATCHES_START mm" and "#NEXT_PATCHES_END" markers, from the series file, http://www.ozlabs.org/~akpm/mmotm/series.

A full copy of the full kernel tree with the linux-next and mmotm patches already applied is available through git within an hour of the mmotm release. Individual mmotm releases are tagged. The master branch always points to the latest release, so it's constantly rebasing.

http://git.cmpxchg.org/cgit.cgi/linux-mmotm.git/

To develop on top of mmotm git:

  $ git remote add mmotm git://git.kernel.org/pub/scm/linux/kernel/git/mhocko/mm.git
  $ git remote update mmotm
  $ git checkout -b topic mmotm/master
  <make changes, commit>
  $ git send-email mmotm/master.. [...]

To rebase a branch with older patches to a new mmotm release:

  $ git remote update mmotm
  $ git rebase --onto mmotm/master <topic base> topic

The directory http://www.ozlabs.org/~akpm/mmots/ (mm-of-the-second) contains daily snapshots of the -mm tree. It is updated more frequently than mmotm, and is untested.

A git copy of this tree is available at

http://git.cmpxchg.org/cgit.cgi/linux-mmots.git/

and use of this tree is similar to
http://git.cmpxchg.org/cgit.cgi/linux-mmotm.git/, described above.

This mmotm tree contains the following patches against 4.19:
(patches marked "*" will be included in linux-next)

origin.patch
* mm-hmm-fix-utf8.patch
* mm-rmap-map_pte-was-not-handling-private-zone_device-page-properly-v3.patch
* mm-hmm-fix-race-between-hmm_mirror_unregister-and-mmu_notifier-callback.patch
* mm-hmm-properly-handle-migration-pmd-v3.patch
* mm-hmm-use-a-structure-for-update-callback-parameters-v2.patch
* mm-hmm-invalidate-device-page-table-at-start-of-invalidation.patch
* mm-gup_benchmark-prevent-integer-overflow-in-ioctl.patch
* fs-proc-vmcorec-convert-to-use-vmf_error.patch
* include-linux-compilerh-add-version-detection-to-asm_volatile_goto.patch
* add-oleksij-rempel-to-mailmap.patch
* treewide-remove-current_text_addr.patch
* error-injection-remove-meaningless-null-pointer-check-before-debugfs_remove_recursive.patch
* lib-bitmapc-remove-wrong-documentation.patch
* linux-bitmaph-handle-constant-zero-size-bitmaps-correctly.patch
* linux-bitmaph-remove-redundant-uses-of-small_const_nbits.patch
* linux-bitmaph-fix-type-of-nbits-in-bitmap_shift_right.patch
* linux-bitmaph-relax-comment-on-compile-time-constant-nbits.patch
* lib-bitmapc-fix-remaining-space-computation-in-bitmap_print_to_pagebuf.patch
* lib-bitmapc-simplify-bitmap_print_to_pagebuf.patch
* lib-parserc-switch-match_strdup-over-to-use-kmemdup_nul.patch
* lib-parserc-switch-match_u64int-over-to-use-match_strdup.patch
* lib-parserc-switch-match_number-over-to-use-match_strdup.patch
* zlib-remove-fall-through-warnings.patch
* lib-sg_pool-remove-unnecessary-null-check-when-free-the-object.patch
* lib-rbtreec-fix-typo-in-comment-of-rb_insert_augmented.patch
* kstrtox-delete-unnecessary-casts.patch
* compat-mark-expected-switch-fall-throughs.patch
* checkpatch-remove-gcc_binary_constant-warning.patch
* init-do_mountsc-add-root=partlabel=name-support.patch
* hfsplus-prevent-btree-data-loss-on-root-split.patch
* hfsplus-fix-bug-on-bnode-parent-update.patch
* hfs-prevent-btree-data-loss-on-root-split.patch
* hfs-fix-bug-on-bnode-parent-update.patch
* hfsplus-prevent-btree-data-loss-on-enospc.patch
* hfs-prevent-btree-data-loss-on-enospc.patch
* hfsplus-fix-return-value-of-hfsplus_get_block.patch
* hfs-fix-return-value-of-hfs_get_block.patch
* hfsplus-update-timestamps-on-truncate.patch
* hfs-update-timestamp-on-truncate.patch
* hfs-fix-array-out-of-bounds-read-of-array-extent.patch
* reiserfs-propagate-errors-from-fill_with_dentries-properly.patch
* reiserfs-remove-workaround-code-for-gcc-3x.patch
* fat-expand-a-slightly-out-of-date-comment.patch
* fat-create-a-function-to-calculate-the-timezone-offest.patch
* fat-add-functions-to-update-and-truncate-timestamps-appropriately.patch
* fat-change-timestamp-updates-to-use-fat_truncate_time.patch
* fat-truncate-inode-timestamp-updates-in-setattr.patch
* kernel-fix-a-comment-error.patch
* signal-mark-expected-switch-fall-throughs.patch
* kernel-panic-do-not-append-newline-to-the-stack-protector-panic-string.patch
* kernel-panic-filter-out-a-potential-trailing-newline.patch
* ipc-ipcmni-limit-check-for-msgmni-and-shmmni.patch
* ipc-ipcmni-limit-check-for-semmni.patch
* lib-lz4-update-lz4-decompressor-module.patch
* kbuild-fix-kernel-boundsc-w=1-warning.patch
* percpu-cleanup-per_cpu_def_attributes-macro.patch
* mm-remove-config_no_bootmem.patch
* mm-remove-config_have_memblock.patch
* mm-remove-bootmem-allocator-implementation.patch
* mm-nobootmem-remove-dead-code.patch
* memblock-rename-memblock_alloc_nid_try_nid-to-memblock_phys_alloc.patch
* memblock-remove-_virt-from-apis-returning-virtual-address.patch
* memblock-replace-alloc_bootmem_align-with-memblock_alloc.patch
* memblock-replace-alloc_bootmem_low-with-memblock_alloc_low.patch
* memblock-replace-__alloc_bootmem_node_nopanic-with-memblock_alloc_try_nid_nopanic.patch
* memblock-replace-alloc_bootmem_pages_nopanic-with-memblock_alloc_nopanic.patch
* memblock-replace-alloc_bootmem_low-with-memblock_alloc_low-2.patch
* memblock-replace-__alloc_bootmem_nopanic-with-memblock_alloc_from_nopanic.patch
* memblock-add-align-parameter-to-memblock_alloc_node.patch
* memblock-replace-alloc_bootmem_pages_node-with-memblock_alloc_node.patch
* memblock-replace-__alloc_bootmem_node-with-appropriate-memblock_-api.patch
* memblock-replace-alloc_bootmem_node-with-memblock_alloc_node.patch
* memblock-replace-alloc_bootmem_low_pages-with-memblock_alloc_low.patch
* memblock-replace-alloc_bootmem_pages-with-memblock_alloc.patch
* memblock-replace-__alloc_bootmem-with-memblock_alloc_from.patch
* memblock-replace-alloc_bootmem-with-memblock_alloc.patch
* mm-nobootmem-remove-bootmem-allocation-apis.patch
* memblock-replace-free_bootmem_node-with-memblock_free.patch
* memblock-replace-free_bootmem_late-with-memblock_free_late.patch
* memblock-rename-free_all_bootmem-to-memblock_free_all.patch
* memblock-rename-__free_pages_bootmem-to-memblock_free_pages.patch
* mm-remove-nobootmem.patch
* memblock-replace-bootmem_alloc_-with-memblock-variants.patch
* mm-remove-include-linux-bootmemh.patch
* docs-boot-time-mm-remove-bootmem-documentation.patch
* memblock-stop-using-implicit-alignement-to-smp_cache_bytes.patch
* memblock-warn-if-zero-alignment-was-requested.patch
* android-binder-replace-vm_insert_page-with-vmf_insert_page.patch
* mm-memory_hotplug-make-remove_memory-take-the-device_hotplug_lock.patch
* mm-memory_hotplug-make-add_memory-take-the-device_hotplug_lock.patch
* mm-memory_hotplug-fix-online-offline_pages-called-wo-mem_hotplug_lock.patch
* powerpc-powernv-hold-device_hotplug_lock-when-calling-device_online.patch
* powerpc-powernv-hold-device_hotplug_lock-when-calling-memtrace_offline_pages.patch
* memory-hotplugtxt-add-some-details-about-locking-internals.patch
* mm-fix-warning-in-insert_pfn.patch
* mm-fix-__get_user_pages_fast-comment.patch
* mm-handle-no-memcg-case-in-memcg_kmem_charge-properly.patch
* kernel-srcu-fix-ctags.patch
* mm-dont-reclaim-inodes-with-many-attached-pages.patch
* mm-thp-always-specify-disabled-vmas-as-nh-in-smaps.patch
* mm-thp-relax-__gfp_thisnode-for-madv_hugepage-mappings.patch
* arm-arch-arm-include-asm-pageh-needs-personalityh.patch
* ocfs2-get-rid-of-ocfs2_is_o2cb_active-function.patch
* ocfs2-without-quota-support-try-to-avoid-calling-quota-recovery.patch
* ocfs2-dont-use-iocb-when-eiocbqueued-returns.patch
* ocfs2-fix-a-misuse-a-of-brelse-after-failing-ocfs2_check_dir_entry.patch
* ocfs2-dont-put-and-assigning-null-to-bh-allocated-outside.patch
* ocfs2-dlmglue-clean-up-timestamp-handling.patch
* fix-dead-lock-caused-by-ocfs2_defrag_extent.patch
* ocfs2-fix-dead-lock-caused-by-ocfs2_defrag_extent.patch
* fix-clusters-leak-in-ocfs2_defrag_extent.patch
* fix-clusters-leak-in-ocfs2_defrag_extent-fix.patch
* block-restore-proc-partitions-to-not-display-non-partitionable-removable-devices.patch
* vfs-allow-dedupe-of-user-owned-read-only-files.patch
* vfs-dedupe-should-return-eperm-if-permission-is-not-granted.patch
mm.patch
* mm-thp-consolidate-thp-gfp-handling-into-alloc_hugepage_direct_gfpmask.patch
* memory_hotplug-free-pages-as-higher-order.patch
* memory_hotplug-free-pages-as-higher-order-fix.patch
* mm-page_alloc-remove-software-prefetching-in-__free_pages_core.patch
* z3fold-fix-wrong-handling-of-headless-pages.patch
* mm-swap-fix-race-between-swapoff-and-some-swap-operations.patch
* mm-swap-fix-race-between-swapoff-and-some-swap-operations-v6.patch
* mm-fix-race-between-swapoff-and-mincore.patch
* list_lru-prefetch-neighboring-list-entries-before-acquiring-lock.patch
* list_lru-prefetch-neighboring-list-entries-before-acquiring-lock-fix.patch
* mm-add-strictlimit-knob-v2.patch
* mm-dont-expose-page-to-fast-gup-before-its-ready.patch
* mm-page_owner-align-with-pageblock_nr_pages.patch
* mm-page_owner-align-with-pageblock_nr-pages.patch
* info-task-hung-in-generic_file_write_iter.patch
* kernel-kexec_file-remove-some-duplicated-include-file.patch
* kernel-sysctlc-remove-duplicated-include.patch
* bfs-add-sanity-check-at-bfs_fill_super.patch
* ipc-allow-boot-time-extension-of-ipcmni-from-32k-to-8m.patch
* ipc-allow-boot-time-extension-of-ipcmni-from-32k-to-8m-checkpatch-fixes.patch
* ipc-conserve-sequence-numbers-in-extended-ipcmni-mode.patch
linux-next.patch
linux-next-rejects.patch
* vfs-replace-current_kernel_time64-with-ktime-equivalent.patch
* fix-read-buffer-overflow-in-delta-ipc.patch make-sure-nobodys-leaking-resources.patch releasing-resources-with-children.patch mutex-subsystem-synchro-test-module.patch kernel-forkc-export-kernel_thread-to-modules.patch slab-leaks3-default-y.patch
workaround-for-a-pci-restoring-bug.patch

#1 lore raw

Re: mmotm 2018-10-30-16-08 uploaded (arch/x86/kernel/vsmp_64.c)

Quoted 4 lines · On 10/30/18 4:09 PM, [email protected] wrote:

The mm-of-the-moment snapshot 2018-10-30-16-08 has been uploaded to

   http://www.ozlabs.org/~akpm/mmotm/
Quoted 8 lines

mmotm-readme.txt says

README for mm-of-the-moment:

http://www.ozlabs.org/~akpm/mmotm/

This is a snapshot of my -mm patch queue. Uploaded at random hopefully more than once a week.

Build error on x86_64 from origin.patch (i.e., not mmotm) when CONFIG_PCI is not enabled:
Oh: CONFIG_X86_VSMP is also not enabled, but arch/x86/kernel/Makefile always tries to build vsmp_64.o.

ld: arch/x86/kernel/vsmp_64.o: in function `vsmp_cap_cpus':
vsmp_64.c:(.init.text+0x1e): undefined reference to `read_pci_config'

Signature · 1 line
~Randy
#2 lore raw

PATCH 1/1 x86/build: Build VSMP support only if selected

VSMP support is built even if CONFIG_X86_VSMP is not set. This leads to a build breakage when CONFIG_PCI is disabled as well.

Build VSMP code only when selected.

---

arch/x86/include/asm/setup.h +1 -1
index ae13bc974416..b6b911c4c7f3 100644
@@ -33,7 +33,7 @@
 extern u64 relocated_ramdisk;
 
 /* Interrupt control for vSMPowered x86_64 systems */
-#ifdef CONFIG_X86_64
+#if defined(CONFIG_X86_64) && defined(CONFIG_X86_VSMP)
 void vsmp_init(void);
 #else
 static inline void vsmp_init(void) { }
arch/x86/kernel/Makefile +1 -1
index 8824d01c0c35..647ce52b17d5 100644
@@ -148,5 +148,5 @@ ifeq ($(CONFIG_X86_64),y)
 	obj-$(CONFIG_CALGARY_IOMMU)	+= pci-calgary_64.o tce_64.o
 
 	obj-$(CONFIG_MMCONF_FAM10H)	+= mmconf-fam10h_64.o
-	obj-y				+= vsmp_64.o
+	obj-$(CONFIG_X86_VSMP)		+= vsmp_64.o
 endif
#3 lore raw

RE: [PATCH] x86/build: Build VSMP support only if selected

Quoted 4 lines · Thomas Gleixner

VSMP support is built even if CONFIG_X86_VSMP is not set. This leads to a build breakage when CONFIG_PCI is disabled as well.

Build VSMP code only when selected.

This patch disables detect_vsmp_box() on systems without CONFIG_X86_VSMP, due to the recent 6da63eb241a05b0e676d68975e793c0521387141. This is significant regression that will affect significant number of deployments.

We will reply shortly with an updated patch that fix the dependency on pv_irq_ops, and revert to CONFIG_PARAVIRT, with proper protection for CONFIG_PCI.

Acked-by Shai Fultheim
#4 lore raw

Re: [PATCH] x86/build: Build VSMP support only if selected

Greetings,

Quoted 5 lines · Shai Fultheim
Quoted 3 lines · Thomas Gleixner

VSMP support is built even if CONFIG_X86_VSMP is not set. This leads to a build breakage when CONFIG_PCI is disabled as well.

Quoted 9 lines
Quoted 1 line

Build VSMP code only when selected.

This patch disables detect_vsmp_box() on systems without CONFIG_X86_VSMP, due to the recent 6da63eb241a05b0e676d68975e793c0521387141. This is significant regression that will affect significant number of deployments.

We will reply shortly with an updated patch that fix the dependency on pv_irq_ops, and revert to CONFIG_PARAVIRT, with proper protection for CONFIG_PCI.

here is the proper patch which fixes the issue on hand:

Quoted 1 line

From ebff534f8cfa55d7c3ab798c44abe879f3fbe2b8 Mon Sep 17 00:00:00 2001

From: Eial Czerwacki <[email protected]>
Date: Thu, 1 Nov 2018 15:08:32 +0200
Subject: [PATCH] x86/build: Build VSMP support only if CONFIG_PCI is selected

vsmp dependency of pv_irq_ops removed some years ago, so now let's clean it up from vsmp_64.c.

In short, "cap & ctl & (1 << 4)" was always returning 0, as such we can remove all the PARAVIRT/PARAVIRT_XXL code handling that.

However, the rest of the code depends on CONFIG_PCI, so fix it accordingly.

---
 arch/x86/Kconfig          |  1 -
 arch/x86/kernel/vsmp_64.c | 80
+++--------------------------------------------
 2 files changed, 5 insertions(+), 76 deletions(-)
arch/x86/Kconfig +0 -1
index c51c989..4b187ca 100644
@@ -524,7 +524,6 @@ config X86_VSMP
        bool "ScaleMP vSMP"
        select HYPERVISOR_GUEST
        select PARAVIRT
-       select PARAVIRT_XXL
        depends on X86_64 && PCI
        depends on X86_EXTENDED_PLATFORM
        depends on SMP
arch/x86/kernel/vsmp_64.c +5 -75

108 lines not on this page · raw message

Signature · 1 line
2.7.4
#5 lore raw

Re: [PATCH] x86/build: Build VSMP support only if selected

Quoted 28 lines · Eial Czerwacki

Greetings,

Quoted 5 lines · Shai Fultheim
Quoted 3 lines · Thomas Gleixner

VSMP support is built even if CONFIG_X86_VSMP is not set. This leads to a build breakage when CONFIG_PCI is disabled as well.

Quoted 9 lines
Quoted 1 line

Build VSMP code only when selected.

This patch disables detect_vsmp_box() on systems without CONFIG_X86_VSMP, due to the recent 6da63eb241a05b0e676d68975e793c0521387141. This is significant regression that will affect significant number of deployments.

We will reply shortly with an updated patch that fix the dependency on pv_irq_ops, and revert to CONFIG_PARAVIRT, with proper protection for CONFIG_PCI.

here is the proper patch which fixes the issue on hand:

Quoted 1 line

From ebff534f8cfa55d7c3ab798c44abe879f3fbe2b8 Mon Sep 17 00:00:00 2001

From: Eial Czerwacki <[email protected]>
Date: Thu, 1 Nov 2018 15:08:32 +0200
Subject: [PATCH] x86/build: Build VSMP support only if CONFIG_PCI is selected

vsmp dependency of pv_irq_ops removed some years ago, so now let's clean it up from vsmp_64.c.

Quoted 7 lines

In short, "cap & ctl & (1 << 4)" was always returning 0, as such we can remove all the PARAVIRT/PARAVIRT_XXL code handling that.

However, the rest of the code depends on CONFIG_PCI, so fix it accordingly.

Nice cleanup!

#6 lore raw

Re: [PATCH] x86/build: Build VSMP support only if selected

In reply to Eial Czerwacki
Quoted 46 lines · Eial Czerwacki

Greetings,

Quoted 5 lines · Shai Fultheim
Quoted 3 lines · Thomas Gleixner

VSMP support is built even if CONFIG_X86_VSMP is not set. This leads to a build breakage when CONFIG_PCI is disabled as well.

Quoted 9 lines
Quoted 1 line

Build VSMP code only when selected.

This patch disables detect_vsmp_box() on systems without CONFIG_X86_VSMP, due to the recent 6da63eb241a05b0e676d68975e793c0521387141. This is significant regression that will affect significant number of deployments.

We will reply shortly with an updated patch that fix the dependency on pv_irq_ops, and revert to CONFIG_PARAVIRT, with proper protection for CONFIG_PCI.

here is the proper patch which fixes the issue on hand:
From ebff534f8cfa55d7c3ab798c44abe879f3fbe2b8 Mon Sep 17 00:00:00 2001
From: Eial Czerwacki <[email protected]>
Date: Thu, 1 Nov 2018 15:08:32 +0200
Subject: [PATCH] x86/build: Build VSMP support only if CONFIG_PCI is selected

vsmp dependency of pv_irq_ops removed some years ago, so now let's clean it up from vsmp_64.c.

In short, "cap & ctl & (1 << 4)" was always returning 0, as such we can remove all the PARAVIRT/PARAVIRT_XXL code handling that.

However, the rest of the code depends on CONFIG_PCI, so fix it accordingly.

---
 arch/x86/Kconfig          |  1 -
 arch/x86/kernel/vsmp_64.c | 80
+++--------------------------------------------
 2 files changed, 5 insertions(+), 76 deletions(-)
arch/x86/Kconfig +0 -0
index c51c989..4b187ca 100644

arch/x86/Kconfig config X86_VSMP · line 526

Quoted 3 lines
arch/x86/Kconfig +0 -0
@@ -524,7 +524,6 @@ config X86_VSMP
        bool "ScaleMP vSMP"
        select HYPERVISOR_GUEST
        select PARAVIRT

Do you really still need PARAVIRT and HYPERVISOR_GUEST? Maybe you want IRQ_REMAP instead?

Quoted 62 lines
arch/x86/Kconfig +0 -1
-       select PARAVIRT_XXL
        depends on X86_64 && PCI
        depends on X86_EXTENDED_PLATFORM
        depends on SMP
arch/x86/kernel/vsmp_64.c +0 -50
index 1eae5af..c6d2b76 100644
@@ -26,64 +26,7 @@
 
 #define TOPOLOGY_REGISTER_OFFSET 0x10
 
-#if defined CONFIG_PCI && defined CONFIG_PARAVIRT_XXL
-/*
- * Interrupt control on vSMPowered systems:
- * ~AC is a shadow of IF.  If IF is 'on' AC should be 'off'
- * and vice versa.
- */
-
-asmlinkage __visible unsigned long vsmp_save_fl(void)
-{
-       unsigned long flags = native_save_fl();
-
-       if (!(flags & X86_EFLAGS_IF) || (flags & X86_EFLAGS_AC))
-               flags &= ~X86_EFLAGS_IF;
-       return flags;
-}
-PV_CALLEE_SAVE_REGS_THUNK(vsmp_save_fl);
-
-__visible void vsmp_restore_fl(unsigned long flags)
-{
-       if (flags & X86_EFLAGS_IF)
-               flags &= ~X86_EFLAGS_AC;
-       else
-               flags |= X86_EFLAGS_AC;
-       native_restore_fl(flags);
-}
-PV_CALLEE_SAVE_REGS_THUNK(vsmp_restore_fl);
-
-asmlinkage __visible void vsmp_irq_disable(void)
-{
-       unsigned long flags = native_save_fl();
-
-       native_restore_fl((flags & ~X86_EFLAGS_IF) | X86_EFLAGS_AC);
-}
-PV_CALLEE_SAVE_REGS_THUNK(vsmp_irq_disable);
-
-asmlinkage __visible void vsmp_irq_enable(void)
-{
-       unsigned long flags = native_save_fl();
-
-       native_restore_fl((flags | X86_EFLAGS_IF) & (~X86_EFLAGS_AC));
-}
-PV_CALLEE_SAVE_REGS_THUNK(vsmp_irq_enable);
-
-static unsigned __init vsmp_patch(u8 type, void *ibuf,
-                                 unsigned long addr, unsigned len)
-{
-       switch (type) {
-       case PARAVIRT_PATCH(irq.irq_enable):
-       case PARAVIRT_PATCH(irq.irq_disable):
-       case PARAVIRT_PATCH(irq.save_fl):

arch/x86/kernel/vsmp_64.c line 30

Quoted 10 lines
arch/x86/kernel/vsmp_64.c +1 -8
-       case PARAVIRT_PATCH(irq.restore_fl):
-               return paravirt_patch_default(type, ibuf, addr, len);
-       default:
-               return native_patch(type, ibuf, addr, len);
-       }
-
-}
-
+#if defined CONFIG_PCI
 static void __init set_vsmp_pv_ops(void)

Wouldn't be a rename of the function be appropriate now?

Juergen

#7 lore raw

Re: [PATCH] x86/build: Build VSMP support only if selected

Greetings,

Quoted 42 lines · Juergen Gross
Quoted 41 lines · Eial Czerwacki

Greetings,

Quoted 5 lines · Shai Fultheim
Quoted 3 lines · Thomas Gleixner

VSMP support is built even if CONFIG_X86_VSMP is not set. This leads to a build breakage when CONFIG_PCI is disabled as well.

Quoted 9 lines
Quoted 1 line

Build VSMP code only when selected.

This patch disables detect_vsmp_box() on systems without CONFIG_X86_VSMP, due to the recent 6da63eb241a05b0e676d68975e793c0521387141. This is significant regression that will affect significant number of deployments.

We will reply shortly with an updated patch that fix the dependency on pv_irq_ops, and revert to CONFIG_PARAVIRT, with proper protection for CONFIG_PCI.

here is the proper patch which fixes the issue on hand:
From ebff534f8cfa55d7c3ab798c44abe879f3fbe2b8 Mon Sep 17 00:00:00 2001
From: Eial Czerwacki <[email protected]>
Date: Thu, 1 Nov 2018 15:08:32 +0200
Subject: [PATCH] x86/build: Build VSMP support only if CONFIG_PCI is selected

vsmp dependency of pv_irq_ops removed some years ago, so now let's clean it up from vsmp_64.c.

In short, "cap & ctl & (1 << 4)" was always returning 0, as such we can remove all the PARAVIRT/PARAVIRT_XXL code handling that.

However, the rest of the code depends on CONFIG_PCI, so fix it accordingly.

---
 arch/x86/Kconfig          |  1 -
 arch/x86/kernel/vsmp_64.c | 80
+++--------------------------------------------
 2 files changed, 5 insertions(+), 76 deletions(-)
Quoted 12 lines

arch/x86/Kconfig config X86_VSMP · line 526

Quoted 8 lines
arch/x86/Kconfig +0 -0
index c51c989..4b187ca 100644
@@ -524,7 +524,6 @@ config X86_VSMP
        bool "ScaleMP vSMP"
        select HYPERVISOR_GUEST
        select PARAVIRT

Do you really still need PARAVIRT and HYPERVISOR_GUEST? Maybe you want IRQ_REMAP instead?

Better performance is achieved with PARAVIRTed kernel. Hence we keep
them both in.

Quoted 66 lines
Quoted 66 lines
arch/x86/Kconfig +0 -1
-       select PARAVIRT_XXL
        depends on X86_64 && PCI
        depends on X86_EXTENDED_PLATFORM
        depends on SMP
arch/x86/kernel/vsmp_64.c +0 -54
index 1eae5af..c6d2b76 100644
@@ -26,64 +26,7 @@
 
 #define TOPOLOGY_REGISTER_OFFSET 0x10
 
-#if defined CONFIG_PCI && defined CONFIG_PARAVIRT_XXL
-/*
- * Interrupt control on vSMPowered systems:
- * ~AC is a shadow of IF.  If IF is 'on' AC should be 'off'
- * and vice versa.
- */
-
-asmlinkage __visible unsigned long vsmp_save_fl(void)
-{
-       unsigned long flags = native_save_fl();
-
-       if (!(flags & X86_EFLAGS_IF) || (flags & X86_EFLAGS_AC))
-               flags &= ~X86_EFLAGS_IF;
-       return flags;
-}
-PV_CALLEE_SAVE_REGS_THUNK(vsmp_save_fl);
-
-__visible void vsmp_restore_fl(unsigned long flags)
-{
-       if (flags & X86_EFLAGS_IF)
-               flags &= ~X86_EFLAGS_AC;
-       else
-               flags |= X86_EFLAGS_AC;
-       native_restore_fl(flags);
-}
-PV_CALLEE_SAVE_REGS_THUNK(vsmp_restore_fl);
-
-asmlinkage __visible void vsmp_irq_disable(void)
-{
-       unsigned long flags = native_save_fl();
-
-       native_restore_fl((flags & ~X86_EFLAGS_IF) | X86_EFLAGS_AC);
-}
-PV_CALLEE_SAVE_REGS_THUNK(vsmp_irq_disable);
-
-asmlinkage __visible void vsmp_irq_enable(void)
-{
-       unsigned long flags = native_save_fl();
-
-       native_restore_fl((flags | X86_EFLAGS_IF) & (~X86_EFLAGS_AC));
-}
-PV_CALLEE_SAVE_REGS_THUNK(vsmp_irq_enable);
-
-static unsigned __init vsmp_patch(u8 type, void *ibuf,
-                                 unsigned long addr, unsigned len)
-{
-       switch (type) {
-       case PARAVIRT_PATCH(irq.irq_enable):
-       case PARAVIRT_PATCH(irq.irq_disable):
-       case PARAVIRT_PATCH(irq.save_fl):
-       case PARAVIRT_PATCH(irq.restore_fl):
-               return paravirt_patch_default(type, ibuf, addr, len);
-       default:
-               return native_patch(type, ibuf, addr, len);
Quoted 8 lines

arch/x86/kernel/vsmp_64.c line 30

Quoted 6 lines
arch/x86/kernel/vsmp_64.c +1 -4
-       }
-
-}
-
+#if defined CONFIG_PCI
 static void __init set_vsmp_pv_ops(void)

Wouldn't be a rename of the function be appropriate now?

you are correct, I'll fix and resend the patch.

Quoted 4 lines

Juergen

#8 lore raw

Re: [PATCH] x86/build: Build VSMP support only if selected

Quoted 57 lines · Eial Czerwacki

Greetings,

Quoted 42 lines · Juergen Gross
Quoted 41 lines · Eial Czerwacki

Greetings,

Quoted 5 lines · Shai Fultheim
Quoted 3 lines · Thomas Gleixner

VSMP support is built even if CONFIG_X86_VSMP is not set. This leads to a build breakage when CONFIG_PCI is disabled as well.

Quoted 9 lines
Quoted 1 line

Build VSMP code only when selected.

This patch disables detect_vsmp_box() on systems without CONFIG_X86_VSMP, due to the recent 6da63eb241a05b0e676d68975e793c0521387141. This is significant regression that will affect significant number of deployments.

We will reply shortly with an updated patch that fix the dependency on pv_irq_ops, and revert to CONFIG_PARAVIRT, with proper protection for CONFIG_PCI.

here is the proper patch which fixes the issue on hand:
From ebff534f8cfa55d7c3ab798c44abe879f3fbe2b8 Mon Sep 17 00:00:00 2001
From: Eial Czerwacki <[email protected]>
Date: Thu, 1 Nov 2018 15:08:32 +0200
Subject: [PATCH] x86/build: Build VSMP support only if CONFIG_PCI is selected

vsmp dependency of pv_irq_ops removed some years ago, so now let's clean it up from vsmp_64.c.

In short, "cap & ctl & (1 << 4)" was always returning 0, as such we can remove all the PARAVIRT/PARAVIRT_XXL code handling that.

However, the rest of the code depends on CONFIG_PCI, so fix it accordingly.

---
 arch/x86/Kconfig          |  1 -
 arch/x86/kernel/vsmp_64.c | 80
+++--------------------------------------------
 2 files changed, 5 insertions(+), 76 deletions(-)
Quoted 12 lines

arch/x86/Kconfig config X86_VSMP · line 526

Quoted 8 lines
arch/x86/Kconfig +0 -0
index c51c989..4b187ca 100644
@@ -524,7 +524,6 @@ config X86_VSMP
        bool "ScaleMP vSMP"
        select HYPERVISOR_GUEST
        select PARAVIRT

Do you really still need PARAVIRT and HYPERVISOR_GUEST? Maybe you want IRQ_REMAP instead?

Quoted 2 lines

Better performance is achieved with PARAVIRTed kernel. Hence we keep
them both in.

Do you have an explanation for that? Normally PARAVIRT is expected to have a small negative impact on performance.

Juergen