1. 10 Jun, 2020 2 commits
    • Rafael J. Wysocki's avatar
      Merge branches 'pm-cpufreq' and 'pm-acpi' · 50dd154e
      Rafael J. Wysocki authored
      * pm-cpufreq:
        cpufreq: CPPC: add SW BOOST support
        cpufreq: change '.set_boost' to act on one policy
        cpufreq: tegra186: add CPUFREQ_NEED_INITIAL_FREQ_CHECK flag
      
      * pm-acpi:
        ACPI: PM: Avoid using power resources if there are none for D0
      50dd154e
    • Rafael J. Wysocki's avatar
      Merge branch 'pm-opp' · 4c277e2f
      Rafael J. Wysocki authored
      * pm-opp:
        opp: Don't parse icc paths unnecessarily
        opp: Remove bandwidth votes when target_freq is zero
        opp: core: add regulators enable and disable
        opp: Reorder the code for !target_freq case
        opp: Expose bandwidth information via debugfs
        cpufreq: dt: Add support for interconnect bandwidth scaling
        opp: Update the bandwidth on OPP frequency changes
        opp: Add sanity checks in _read_opp_key()
        opp: Add support for parsing interconnect bandwidth
        interconnect: Remove unused module exit code from core
        interconnect: Disallow interconnect core to be built as a module
        interconnect: Add of_icc_get_by_index() helper function
        OPP: Add helpers for reading the binding properties
        dt-bindings: opp: Introduce opp-peak-kBps and opp-avg-kBps bindings
      4c277e2f
  2. 08 Jun, 2020 1 commit
    • Rafael J. Wysocki's avatar
      ACPI: PM: Avoid using power resources if there are none for D0 · 956ad9d9
      Rafael J. Wysocki authored
      As recently reported, some platforms provide a list of power
      resources for device power state D3hot, through the _PR3 object,
      but they do not provide a list of power resources for device power
      state D0.
      
      Among other things, this causes acpi_device_get_power() to return
      D3hot as the current state of the device in question if all of the
      D3hot power resources are "on", because it sees the power_resources
      flag set and calls acpi_power_get_inferred_state() which finds that
      D3hot is the shallowest power state with all of the associated power
      resources turned "on", so that's what it returns.  Moreover, that
      value takes precedence over the acpi_dev_pm_explicit_get() return
      value, because it means a deeper power state.  The device may very
      well be in D0 physically at that point, however.
      
      Moreover, the presence of _PR3 without _PR0 for a given device
      means that only one D3-level power state can be supported by it.
      Namely, because there are no power resources to turn "off" when
      transitioning the device from D0 into D3cold (which should be
      supported since _PR3 is present), the evaluation of _PS3 should
      be sufficient to put it straight into D3cold, but this means that
      the effect of turning "on" the _PR3 power resources is unclear,
      so it is better to avoid doing that altogether.  Consequently,
      there is no practical way do distinguish D3cold from D3hot for
      the device in question and the power states of it can be labeled
      so that D3hot is the deepest supported one (and Linux assumes
      that putting a device into D3hot via ACPI may cause power to be
      removed from it anyway, for legacy reasons).
      
      To work around the problem described above modify the ACPI
      enumeration of devices so that power resources are only used
      for device power management if the list of D0 power resources
      is not empty and make it mart D3cold as supported only if that
      is the case and the D3hot list of power resources is not empty
      too.
      
      Fixes: ef85bdbe ("ACPI / scan: Consolidate extraction of power resources lists")
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=205057
      Link: https://lore.kernel.org/linux-acpi/20200603194659.185757-1-hdegoede@redhat.com/Reported-by: default avatarHans de Goede <hdegoede@redhat.com>
      Tested-by: default avatarHans de Goede <hdegoede@redhat.com>
      Tested-by: youling257@gmail.com
      Cc: 3.10+ <stable@vger.kernel.org> # 3.10+
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
      956ad9d9
  3. 05 Jun, 2020 3 commits
    • Xiongfeng Wang's avatar
      cpufreq: CPPC: add SW BOOST support · 54e74df5
      Xiongfeng Wang authored
      To add SW BOOST support for CPPC, we need to get the max frequency of
      boost mode and non-boost mode. ACPI spec 6.2 section 8.4.7.1 describes
      the following two CPC registers.
      
      "Highest performance is the absolute maximum performance an individual
      processor may reach, assuming ideal conditions. This performance level
      may not be sustainable for long durations, and may only be achievable if
      other platform components are in a specific state; for example, it may
      require other processors be in an idle state.
      
      Nominal Performance is the maximum sustained performance level of the
      processor, assuming ideal operating conditions. In absence of an
      external constraint (power, thermal, etc.) this is the performance level
      the platform is expected to be able to maintain continuously. All
      processors are expected to be able to sustain their nominal performance
      state simultaneously."
      
      To add SW BOOST support for CPPC, we can use Highest Performance as the
      max performance in boost mode and Nominal Performance as the max
      performance in non-boost mode. If the Highest Performance is greater
      than the Nominal Performance, we assume SW BOOST is supported.
      
      The current CPPC driver does not support SW BOOST and use 'Highest
      Performance' as the max performance the CPU can achieve. 'Nominal
      Performance' is used to convert 'performance' to 'frequency'. That
      means, if firmware enable boost and provide a value for Highest
      Performance which is greater than Nominal Performance, boost feature is
      enabled by default.
      
      Because SW BOOST is disabled by default, so, after this patch, boost
      feature is disabled by default even if boost is enabled by firmware.
      Signed-off-by: default avatarXiongfeng Wang <wangxiongfeng2@huawei.com>
      Suggested-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      [ rjw: Subject ]
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      54e74df5
    • Xiongfeng Wang's avatar
      cpufreq: change '.set_boost' to act on one policy · cf6fada7
      Xiongfeng Wang authored
      Macro 'for_each_active_policy()' is defined internally. To avoid some
      cpufreq driver needing this macro to iterate over all the policies in
      '.set_boost' callback, we redefine '.set_boost' to act on only one
      policy and pass the policy as an argument.
      
      'cpufreq_boost_trigger_state()' iterates over all the policies to set
      boost for the system.
      
      This is preparation for adding SW BOOST support for CPPC.
      
      To protect Boost enable/disable by sysfs from CPU online/offline,
      add 'cpu_hotplug_lock' before calling '.set_boost' for each CPU.
      
      Also move the lock from 'set_boost()' to 'store_cpb()' in
      acpi_cpufreq.
      Signed-off-by: default avatarXiongfeng Wang <wangxiongfeng2@huawei.com>
      Suggested-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      [ rjw: Subject & changelog ]
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      cf6fada7
    • Christophe JAILLET's avatar
      PM: hibernate: Add __init annotation to swsusp_header_init() · afd8d7c7
      Christophe JAILLET authored
      'swsusp_header_init()' is only called via 'core_initcall'.
      It can be marked as __init to save a few bytes of memory.
      Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
      [ rjw: Subject ]
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      afd8d7c7
  4. 02 Jun, 2020 34 commits
    • Linus Torvalds's avatar
      Merge tag 'pm-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 355ba37d
      Linus Torvalds authored
      Pull power management updates from Rafael Wysocki:
       "These rework the system-wide PM driver flags, make runtime switching
        of cpuidle governors easier, improve the user space hibernation
        interface code, add intel-speed-select interface documentation, add
        more debug messages to the ACPI code handling suspend to idle, update
        the cpufreq core and drivers, fix a minor issue in the cpuidle core
        and update two cpuidle drivers, improve the PM-runtime framework,
        update the Intel RAPL power capping driver, update devfreq core and
        drivers, and clean up the cpupower utility.
      
        Specifics:
      
         - Rework the system-wide PM driver flags to make them easier to
           understand and use and update their documentation (Rafael Wysocki,
           Alan Stern).
      
         - Allow cpuidle governors to be switched at run time regardless of
           the kernel configuration and update the related documentation
           accordingly (Hanjun Guo).
      
         - Improve the resume device handling in the user space hibernarion
           interface code (Domenico Andreoli).
      
         - Document the intel-speed-select sysfs interface (Srinivas
           Pandruvada).
      
         - Make the ACPI code handing suspend to idle print more debug
           messages to help diagnose issues with it (Rafael Wysocki).
      
         - Fix a helper routine in the cpufreq core and correct a typo in the
           struct cpufreq_driver kerneldoc comment (Rafael Wysocki, Wang
           Wenhu).
      
         - Update cpufreq drivers:
      
            - Make the intel_pstate driver start in the passive mode by
              default on systems without HWP (Rafael Wysocki).
      
            - Add i.MX7ULP support to the imx-cpufreq-dt driver and add
              i.MX7ULP to the cpufreq-dt-platdev blacklist (Peng Fan).
      
            - Convert the qoriq cpufreq driver to a platform one, make the
              platform code create a suitable device object for it and add
              platform dependencies to it (Mian Yousaf Kaukab, Geert
              Uytterhoeven).
      
            - Fix wrong compatible binding in the qcom driver (Ansuel Smith).
      
            - Build the omap driver by default for ARCH_OMAP2PLUS (Anders
              Roxell).
      
            - Add r8a7742 SoC support to the dt cpufreq driver (Lad
              Prabhakar).
      
         - Update cpuidle core and drivers:
      
            - Fix three reference count leaks in error code paths in the
              cpuidle core (Qiushi Wu).
      
            - Convert Qualcomm SPM to a generic cpuidle driver (Stephan
              Gerhold).
      
            - Fix up the execution order when entering a domain idle state in
              the PSCI driver (Ulf Hansson).
      
         - Fix a reference counting issue related to clock management and
           clean up two oddities in the PM-runtime framework (Rafael Wysocki,
           Andy Shevchenko).
      
         - Add ElkhartLake support to the Intel RAPL power capping driver and
           remove an unused local MSR definition from it (Jacob Pan, Sumeet
           Pawnikar).
      
         - Update devfreq core and drivers:
      
            - Replace strncpy() with strscpy() in the devfreq core and use
              lockdep asserts instead of manual checks for a locked mutex in
              it (Dmitry Osipenko, Krzysztof Kozlowski).
      
            - Add a generic imx bus scaling driver and make it register an
              interconnect device (Leonard Crestez, Gustavo A. R. Silva).
      
            - Make the cpufreq notifier in the tegra30 driver take boosting
              into account and delete an unuseful error message from that
              driver (Dmitry Osipenko, Markus Elfring).
      
         - Remove unneeded semicolon from the cpupower code (Zou Wei)"
      
      * tag 'pm-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (51 commits)
        cpuidle: Fix three reference count leaks
        PM: runtime: Replace pm_runtime_callbacks_present()
        PM / devfreq: Use lockdep asserts instead of manual checks for locked mutex
        PM / devfreq: imx-bus: Fix inconsistent IS_ERR and PTR_ERR
        PM / devfreq: Replace strncpy with strscpy
        PM / devfreq: imx: Register interconnect device
        PM / devfreq: Add generic imx bus scaling driver
        PM / devfreq: tegra30: Delete an error message in tegra_devfreq_probe()
        PM / devfreq: tegra30: Make CPUFreq notifier to take into account boosting
        PM: hibernate: Restrict writes to the resume device
        PM: runtime: clk: Fix clk_pm_runtime_get() error path
        cpuidle: Convert Qualcomm SPM driver to a generic CPUidle driver
        ACPI: EC: PM: s2idle: Extend GPE dispatching debug message
        ACPI: PM: s2idle: Print type of wakeup debug messages
        powercap: RAPL: remove unused local MSR define
        PM: runtime: Make clear what we do when conditions are wrong in rpm_suspend()
        Documentation: admin-guide: pm: Document intel-speed-select
        PM: hibernate: Split off snapshot dev option
        PM: hibernate: Incorporate concurrency handling
        Documentation: ABI: make current_governer_ro as a candidate for removal
        ...
      355ba37d
    • Linus Torvalds's avatar
      Merge tag 'platform-drivers-x86-v5.8-1' of git://git.infradead.org/linux-platform-drivers-x86 · a5a82e0a
      Linus Torvalds authored
      Pull x86 platform driver updates from Andy Shevchenko:
      
       - Add a support of the media keys on the ASUS laptop UX325JA/UX425JA
      
       - ASUS WMI driver can now handle 2-in-1 models T100TA, T100CHI, T100HA,
         T200TA
      
       - Big refactoring of Intel SCU driver with Elkhart Lake support has
         been added
      
       - Slim Bootloarder firmware update signaling WMI driver has been added
      
       - Thinkpad ACPI driver can handle dual fan configuration on new P and X
         models
      
       - Touchscreen DMI driver has been extended to support
          - MP-man MPWIN895CL tablet
          - ONDA V891 v5 tablet
          - techBite Arc 11.6
          - Trekstor Twin 10.1
          - Trekstor Yourbook C11B
          - Vinga J116
      
       - Virtual Button driver got a few fixes to detect mode of 2-in-1 tablet
         models
      
       - Intel Speed Select tools update
      
       - Plenty of small cleanups here and there
      
      * tag 'platform-drivers-x86-v5.8-1' of git://git.infradead.org/linux-platform-drivers-x86: (89 commits)
        platform/x86: dcdbas: Check SMBIOS for protected buffer address
        platform/x86: asus_wmi: Reserve more space for struct bias_args
        platform/x86: intel-vbtn: Only blacklist SW_TABLET_MODE on the 9 / "Laptop" chasis-type
        platform/x86: intel-hid: Add a quirk to support HP Spectre X2 (2015)
        platform/x86: touchscreen_dmi: Update Trekstor Twin 10.1 entry
        platform/x86: touchscreen_dmi: Add info for the Trekstor Yourbook C11B
        platform/x86: hp-wmi: Introduce HPWMI_POWER_FW_OR_HW as convenient shortcut
        platform/x86: hp-wmi: Convert simple_strtoul() to kstrtou32()
        platform/x86: hp-wmi: Refactor postcode_store() to follow standard patterns
        platform/x86: acerhdf: replace space by * in modalias
        platform/x86: ISST: Increase timeout
        tools/power/x86/intel-speed-select: Fix invalid core mask
        tools/power/x86/intel-speed-select: Increase CPU count
        tools/power/x86/intel-speed-select: Fix json perf-profile output output
        platform/x86: dell-wmi: Ignore keyboard attached / detached events
        platform/x86: dell-laptop: don't register micmute LED if there is no token
        platform/x86: thinkpad_acpi: Replace custom approach by kstrtoint()
        platform/x86: thinkpad_acpi: Use strndup_user() in dispatch_proc_write()
        platform/x86: thinkpad_acpi: Replace next_cmd(&buf) with strsep(&buf, ",")
        platform/x86: intel-vbtn: Detect switch position before registering the input-device
        ...
      a5a82e0a
    • Linus Torvalds's avatar
      Merge tag 'mmc-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc · c5d6c138
      Linus Torvalds authored
      Pull MMC updates from Ulf Hansson:
       "MMC core:
         - Enable erase/discard/trim support for all (e)MMC/SD hosts
         - Export information through sysfs about enhanced RPMB support (eMMC v5.1+)
         - Align the initialization commands for SDIO cards
         - Fix SDIO initialization to prevent memory leaks and NULL pointer errors
         - Do not export undefined MMC_NAME/MODALIAS for SDIO cards
         - Export device/vendor field from common CIS for SDIO cards
         - Move SDIO IDs from functional drivers to the common SDIO header
         - Introduce the ->request_atomic() host ops
      
        MMC host:
         - Improve support for HW busy signaling for several hosts
         - Converting some DT bindings to the json-schema
         - meson-mx-sdhc: Add driver and DT doc for the Amlogic Meson SDHC controller
         - meson-mx-sdio: Run a soft reset to recover from timeout/CRC error
         - mmci: Convert to use mmc_regulator_set_vqmmc()
         - mmci_stm32_sdmmc: Fix a couple of DMA bugs
         - mmci_stm32_sdmmc: Fix power on issue
         - renesas,mmcif,sdhci: Document r8a7742 DT bindings
         - renesas_sdhi: Add support for M3-W ES1.2 and 1.3 revisions
         - renesas_sdhi: Improvements to the TAP selection
         - renesas_sdhi/tmio: Further fixup runtime PM management at ->remove()
         - sdhci: Introduce ops to dump vendor specific registers
         - sdhci-cadence: Fix PHY write sequence
         - sdhci-esdhc-imx: Improve tunings
         - sdhci-esdhc-imx: Enable GPIO card detect as system wakeup
         - sdhci-esdhc-imx: Add HS400 support for i.MX6SLL
         - sdhci-esdhc-mcf: Add driver for the Coldfire/M5441X esdhc controller
         - m68k: mcf5441x: Add platform data to enable esdhc mmc controller
         - sdhci-msm: Improve HS400 tuning
         - sdhci-msm: Dump vendor specific registers at error
         - sdhci-msm: Add support for DLL/DDR properties provided from DT
         - sdhci-msm: Add support for the sm8250 variant
         - sdhci-msm: Add support for DVFS by converting to dev_pm_opp_set_rate()
         - sdhci-of-arasan: Add support for Intel Keem Bay variant
         - sdhci-of-arasan: Add support for Xilinx Versal SD variant
         - sdhci-of-dwcmshc: Add support for system suspend/resume
         - sdhci-of-dwcmshc: Fix UHS signaling support
         - sdhci-of-esdhc: Fix tuning for eMMC HS400 mode
         - sdhci-pci-gli: Add Genesys Logic GL9763E support
         - sdhci-sprd: Add support for the ->request_atomic() ops
         - sdhci-tegra: Avoid reading autocal timeout values when not applicable
      
        MEMSTICK:
         - Minor trivial update"
      
      * tag 'mmc-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: (127 commits)
        dt-bindings: mmc: Convert sdhci-pxa to json-schema
        mmc: sdhci-msm: Clear tuning done flag while hs400 tuning
        mmc: core: Export device/vendor ids from Common CIS for SDIO cards
        mmc: core: Do not export MMC_NAME= and MODALIAS=mmc:block for SDIO cards
        mmc: sdhci-of-at91: fix CALCR register being rewritten
        mmc: sdhci-esdhc-imx: disable the CMD CRC check for standard tuning
        mmc: sdhci-esdhc-imx: fix the mask for tuning start point
        mmc: host: sdhci-esdhc-imx: add wakeup feature for GPIO CD pin
        mmc: mmci_sdmmc: fix DMA API warning max segment size
        mmc: mmci_sdmmc: fix DMA API warning overlapping mappings
        mmc: sdhci-of-arasan: Add support for Intel Keem Bay
        dt-bindings: mmc: arasan: Add compatible strings for Intel Keem Bay
        mmc: sdhci-cadence: fix PHY write
        mmc: sdio: Sort all SDIO IDs in common include file
        mmc: sdio: Fix Cypress SDIO IDs macros in common include file
        mmc: sdio: Move SDIO IDs from b43-sdio driver to common include file
        mmc: sdio: Move SDIO IDs from ath10k driver to common include file
        mmc: sdio: Move SDIO IDs from ath6kl driver to common include file
        mmc: sdio: Move SDIO IDs from smssdio driver to common include file
        mmc: sdio: Move SDIO IDs from btmtksdio driver to common include file
        ...
      c5d6c138
    • Linus Torvalds's avatar
      Merge branch 'akpm' (patches from Andrew) · 94709049
      Linus Torvalds authored
      Merge updates from Andrew Morton:
       "A few little subsystems and a start of a lot of MM patches.
      
        Subsystems affected by this patch series: squashfs, ocfs2, parisc,
        vfs. With mm subsystems: slab-generic, slub, debug, pagecache, gup,
        swap, memcg, pagemap, memory-failure, vmalloc, kasan"
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (128 commits)
        kasan: move kasan_report() into report.c
        mm/mm_init.c: report kasan-tag information stored in page->flags
        ubsan: entirely disable alignment checks under UBSAN_TRAP
        kasan: fix clang compilation warning due to stack protector
        x86/mm: remove vmalloc faulting
        mm: remove vmalloc_sync_(un)mappings()
        x86/mm/32: implement arch_sync_kernel_mappings()
        x86/mm/64: implement arch_sync_kernel_mappings()
        mm/ioremap: track which page-table levels were modified
        mm/vmalloc: track which page-table levels were modified
        mm: add functions to track page directory modifications
        s390: use __vmalloc_node in stack_alloc
        powerpc: use __vmalloc_node in alloc_vm_stack
        arm64: use __vmalloc_node in arch_alloc_vmap_stack
        mm: remove vmalloc_user_node_flags
        mm: switch the test_vmalloc module to use __vmalloc_node
        mm: remove __vmalloc_node_flags_caller
        mm: remove both instances of __vmalloc_node_flags
        mm: remove the prot argument to __vmalloc_node
        mm: remove the pgprot argument to __vmalloc
        ...
      94709049
    • Andrey Konovalov's avatar
      kasan: move kasan_report() into report.c · 4fba3758
      Andrey Konovalov authored
      The kasan_report() functions belongs to report.c, as it's a common
      functions that does error reporting.
      Reported-by: default avatarLeon Romanovsky <leon@kernel.org>
      Signed-off-by: default avatarAndrey Konovalov <andreyknvl@google.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Tested-by: default avatarLeon Romanovsky <leon@kernel.org>
      Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
      Cc: Alexander Potapenko <glider@google.com>
      Cc: Dmitry Vyukov <dvyukov@google.com>
      Cc: Leon Romanovsky <leonro@mellanox.com>
      Link: http://lkml.kernel.org/r/78a81fde6eeda9db72a7fd55fbc33173a515e4b1.1589297433.git.andreyknvl@google.comSigned-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      4fba3758
    • Jing Xia's avatar
      mm/mm_init.c: report kasan-tag information stored in page->flags · 86fea8b4
      Jing Xia authored
      The pageflags_layout_usage shows incorrect message by means of
      mminit_loglevel when Kasan runs in the mode of software tag-based
      enabled with CONFIG_KASAN_SW_TAGS.  This patch corrects it and reports
      kasan-tag information.
      Signed-off-by: default avatarJing Xia <jing.xia@unisoc.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Cc: Chunyan Zhang <chunyan.zhang@unisoc.com>
      Cc: Orson Zhai <orson.zhai@unisoc.com>
      Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
      Cc: Alexander Potapenko <glider@google.com>
      Cc: Dmitry Vyukov <dvyukov@google.com>
      Link: http://lkml.kernel.org/r/1586929370-10838-1-git-send-email-jing.xia.mail@gmail.comSigned-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      86fea8b4
    • Kees Cook's avatar
      ubsan: entirely disable alignment checks under UBSAN_TRAP · 9380ce24
      Kees Cook authored
      Commit 8d58f222 ("ubsan: disable UBSAN_ALIGNMENT under
      COMPILE_TEST") tried to fix the pathological results of UBSAN_ALIGNMENT
      with UBSAN_TRAP (which objtool would rightly scream about), but it made
      an assumption about how COMPILE_TEST gets set (it is not set for
      randconfig).  As a result, we need a bigger hammer here: just don't
      allow the alignment checks with the trap mode.
      
      Fixes: 8d58f222 ("ubsan: disable UBSAN_ALIGNMENT under COMPILE_TEST")
      Reported-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Acked-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Cc: Josh Poimboeuf <jpoimboe@redhat.com>
      Cc: Dmitry Vyukov <dvyukov@google.com>
      Cc: Elena Petrova <lenaptr@google.com>
      Link: http://lkml.kernel.org/r/202005291236.000FCB6@keescook
      Link: https://lore.kernel.org/lkml/742521db-1e8c-0d7a-1ed4-a908894fb497@infradead.org/Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      9380ce24
    • Andrey Konovalov's avatar
      kasan: fix clang compilation warning due to stack protector · ca734cc6
      Andrey Konovalov authored
      KASAN uses a single cc-option invocation to disable both conserve-stack
      and stack-protector flags.  The former flag is not present in Clang,
      which causes cc-option to fail, and results in stack-protector being
      enabled.
      
      Fix by using separate cc-option calls for each flag.  Also collect all
      flags in a variable to avoid calling cc-option multiple times for
      different files.
      Reported-by: default avatarQian Cai <cai@lca.pw>
      Signed-off-by: default avatarAndrey Konovalov <andreyknvl@google.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Reviewed-by: default avatarMarco Elver <elver@google.com>
      Link: http://lkml.kernel.org/r/c2f0c8e4048852ae014f4a391d96ca42d27e3255.1590779332.git.andreyknvl@google.comSigned-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      ca734cc6
    • Joerg Roedel's avatar
      x86/mm: remove vmalloc faulting · 7f0a002b
      Joerg Roedel authored
      Remove fault handling on vmalloc areas, as the vmalloc code now takes
      care of synchronizing changes to all page-tables in the system.
      Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Acked-by: default avatarAndy Lutomirski <luto@kernel.org>
      Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: "H . Peter Anvin" <hpa@zytor.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
      Cc: Michal Hocko <mhocko@kernel.org>
      Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
      Cc: Steven Rostedt (VMware) <rostedt@goodmis.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Vlastimil Babka <vbabka@suse.cz>
      Link: http://lkml.kernel.org/r/20200515140023.25469-8-joro@8bytes.orgSigned-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      7f0a002b
    • Joerg Roedel's avatar
      mm: remove vmalloc_sync_(un)mappings() · 73f693c3
      Joerg Roedel authored
      These functions are not needed anymore because the vmalloc and ioremap
      mappings are now synchronized when they are created or torn down.
      
      Remove all callers and function definitions.
      Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Tested-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      Acked-by: default avatarAndy Lutomirski <luto@kernel.org>
      Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: "H . Peter Anvin" <hpa@zytor.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
      Cc: Michal Hocko <mhocko@kernel.org>
      Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Vlastimil Babka <vbabka@suse.cz>
      Link: http://lkml.kernel.org/r/20200515140023.25469-7-joro@8bytes.orgSigned-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      73f693c3
    • Joerg Roedel's avatar
      x86/mm/32: implement arch_sync_kernel_mappings() · 86cf69f1
      Joerg Roedel authored
      Implement the function to sync changes in vmalloc and ioremap ranges to
      all page-tables.
      Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Acked-by: default avatarAndy Lutomirski <luto@kernel.org>
      Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: "H . Peter Anvin" <hpa@zytor.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
      Cc: Michal Hocko <mhocko@kernel.org>
      Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
      Cc: Steven Rostedt (VMware) <rostedt@goodmis.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Vlastimil Babka <vbabka@suse.cz>
      Link: http://lkml.kernel.org/r/20200515140023.25469-6-joro@8bytes.orgSigned-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      86cf69f1
    • Joerg Roedel's avatar
      x86/mm/64: implement arch_sync_kernel_mappings() · 8e19843c
      Joerg Roedel authored
      Implement the function to sync changes in vmalloc and ioremap ranges to
      all page-tables.
      Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Acked-by: default avatarAndy Lutomirski <luto@kernel.org>
      Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: "H . Peter Anvin" <hpa@zytor.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
      Cc: Michal Hocko <mhocko@kernel.org>
      Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
      Cc: Steven Rostedt (VMware) <rostedt@goodmis.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Vlastimil Babka <vbabka@suse.cz>
      Link: http://lkml.kernel.org/r/20200515140023.25469-5-joro@8bytes.orgSigned-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      8e19843c
    • Joerg Roedel's avatar
      mm/ioremap: track which page-table levels were modified · 6c0c7d2b
      Joerg Roedel authored
      Track at which levels in the page-table entries were modified by
      ioremap_page_range().
      
      After the page-table has been modified, use that information do decide
      whether the new arch_sync_kernel_mappings() needs to be called.  The
      iounmap path re-uses vunmap(), which has already been taken care of.
      Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Acked-by: default avatarAndy Lutomirski <luto@kernel.org>
      Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: "H . Peter Anvin" <hpa@zytor.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
      Cc: Michal Hocko <mhocko@kernel.org>
      Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
      Cc: Steven Rostedt (VMware) <rostedt@goodmis.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Vlastimil Babka <vbabka@suse.cz>
      Link: http://lkml.kernel.org/r/20200515140023.25469-4-joro@8bytes.orgSigned-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      6c0c7d2b
    • Joerg Roedel's avatar
      mm/vmalloc: track which page-table levels were modified · 2ba3e694
      Joerg Roedel authored
      Track at which levels in the page-table entries were modified by
      vmap/vunmap.
      
      After the page-table has been modified, use that information do decide
      whether the new arch_sync_kernel_mappings() needs to be called.
      
      [akpm@linux-foundation.org: map_kernel_range_noflush() needs the arch_sync_kernel_mappings() call]
      Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Acked-by: default avatarAndy Lutomirski <luto@kernel.org>
      Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: "H . Peter Anvin" <hpa@zytor.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
      Cc: Michal Hocko <mhocko@kernel.org>
      Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
      Cc: Steven Rostedt (VMware) <rostedt@goodmis.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Vlastimil Babka <vbabka@suse.cz>
      Link: http://lkml.kernel.org/r/20200515140023.25469-3-joro@8bytes.orgSigned-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      2ba3e694
    • Joerg Roedel's avatar
      mm: add functions to track page directory modifications · d8626138
      Joerg Roedel authored
      Patch series "mm: Get rid of vmalloc_sync_(un)mappings()", v3.
      
      After the recent issue with vmalloc and tracing code[1] on x86 and a
      long history of previous issues related to the vmalloc_sync_mappings()
      interface, I thought the time has come to remove it.  Please see [2],
      [3], and [4] for some other issues in the past.
      
      The patches add tracking of page-table directory changes to the vmalloc
      and ioremap code.  Depending on which page-table levels changes have
      been made, a new per-arch function is called:
      arch_sync_kernel_mappings().
      
      On x86-64 with 4-level paging, this function will not be called more
      than 64 times in a systems runtime (because vmalloc-space takes 64 PGD
      entries which are only populated, but never cleared).
      
      As a side effect this also allows to get rid of vmalloc faults on x86,
      making it safe to touch vmalloc'ed memory in the page-fault handler.
      Note that this potentially includes per-cpu memory.
      
      This patch (of 7):
      
      Add page-table allocation functions which will keep track of changed
      directory entries.  They are needed for new PGD, P4D, PUD, and PMD
      entries and will be used in vmalloc and ioremap code to decide whether
      any changes in the kernel mappings need to be synchronized between
      page-tables in the system.
      Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Acked-by: default avatarAndy Lutomirski <luto@kernel.org>
      Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: "H . Peter Anvin" <hpa@zytor.com>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Steven Rostedt (VMware) <rostedt@goodmis.org>
      Cc: Vlastimil Babka <vbabka@suse.cz>
      Cc: Michal Hocko <mhocko@kernel.org>
      Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Christoph Hellwig <hch@lst.de>
      Link: http://lkml.kernel.org/r/20200515140023.25469-1-joro@8bytes.org
      Link: http://lkml.kernel.org/r/20200515140023.25469-2-joro@8bytes.orgSigned-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      d8626138
    • Christoph Hellwig's avatar
      s390: use __vmalloc_node in stack_alloc · b200f5b5
      Christoph Hellwig authored
      stack_alloc can use a slightly higher level vmalloc function.
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Acked-by: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
      Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: "K. Y. Srinivasan" <kys@microsoft.com>
      Cc: Haiyang Zhang <haiyangz@microsoft.com>
      Cc: Stephen Hemminger <sthemmin@microsoft.com>
      Cc: Wei Liu <wei.liu@kernel.org>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Laura Abbott <labbott@redhat.com>
      Cc: Sumit Semwal <sumit.semwal@linaro.org>
      Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
      Cc: Minchan Kim <minchan@kernel.org>
      Cc: Nitin Gupta <ngupta@vflare.org>
      Cc: Robin Murphy <robin.murphy@arm.com>
      Cc: Christophe Leroy <christophe.leroy@c-s.fr>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Gao Xiang <xiang@kernel.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Michael Kelley <mikelley@microsoft.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Paul Mackerras <paulus@ozlabs.org>
      Cc: Vasily Gorbik <gor@linux.ibm.com>
      Cc: Will Deacon <will@kernel.org>
      Link: http://lkml.kernel.org/r/20200414131348.444715-30-hch@lst.deSigned-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      b200f5b5
    • Christoph Hellwig's avatar
      powerpc: use __vmalloc_node in alloc_vm_stack · cb0849a9
      Christoph Hellwig authored
      alloc_vm_stack can use a slightly higher level vmalloc function.
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Christophe Leroy <christophe.leroy@c-s.fr>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Gao Xiang <xiang@kernel.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Haiyang Zhang <haiyangz@microsoft.com>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: "K. Y. Srinivasan" <kys@microsoft.com>
      Cc: Laura Abbott <labbott@redhat.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Michael Kelley <mikelley@microsoft.com>
      Cc: Minchan Kim <minchan@kernel.org>
      Cc: Nitin Gupta <ngupta@vflare.org>
      Cc: Robin Murphy <robin.murphy@arm.com>
      Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
      Cc: Stephen Hemminger <sthemmin@microsoft.com>
      Cc: Sumit Semwal <sumit.semwal@linaro.org>
      Cc: Wei Liu <wei.liu@kernel.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Paul Mackerras <paulus@ozlabs.org>
      Cc: Vasily Gorbik <gor@linux.ibm.com>
      Cc: Will Deacon <will@kernel.org>
      Link: http://lkml.kernel.org/r/20200414131348.444715-29-hch@lst.deSigned-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      cb0849a9
    • Christoph Hellwig's avatar
      arm64: use __vmalloc_node in arch_alloc_vmap_stack · ebcdd307
      Christoph Hellwig authored
      arch_alloc_vmap_stack can use a slightly higher level vmalloc function.
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Christophe Leroy <christophe.leroy@c-s.fr>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Gao Xiang <xiang@kernel.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Haiyang Zhang <haiyangz@microsoft.com>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: "K. Y. Srinivasan" <kys@microsoft.com>
      Cc: Laura Abbott <labbott@redhat.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Michael Kelley <mikelley@microsoft.com>
      Cc: Minchan Kim <minchan@kernel.org>
      Cc: Nitin Gupta <ngupta@vflare.org>
      Cc: Robin Murphy <robin.murphy@arm.com>
      Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
      Cc: Stephen Hemminger <sthemmin@microsoft.com>
      Cc: Sumit Semwal <sumit.semwal@linaro.org>
      Cc: Wei Liu <wei.liu@kernel.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Paul Mackerras <paulus@ozlabs.org>
      Cc: Vasily Gorbik <gor@linux.ibm.com>
      Cc: Will Deacon <will@kernel.org>
      Link: http://lkml.kernel.org/r/20200414131348.444715-28-hch@lst.deSigned-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      ebcdd307
    • Christoph Hellwig's avatar
      mm: remove vmalloc_user_node_flags · 041de93f
      Christoph Hellwig authored
      Open code it in __bpf_map_area_alloc, which is the only caller.  Also
      clean up __bpf_map_area_alloc to have a single vmalloc call with slightly
      different flags instead of the current two different calls.
      
      For this to compile for the nommu case add a __vmalloc_node_range stub to
      nommu.c.
      
      [akpm@linux-foundation.org: fix nommu.c build]
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Acked-by: default avatarJohannes Weiner <hannes@cmpxchg.org>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Christophe Leroy <christophe.leroy@c-s.fr>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Gao Xiang <xiang@kernel.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Haiyang Zhang <haiyangz@microsoft.com>
      Cc: "K. Y. Srinivasan" <kys@microsoft.com>
      Cc: Laura Abbott <labbott@redhat.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Michael Kelley <mikelley@microsoft.com>
      Cc: Minchan Kim <minchan@kernel.org>
      Cc: Nitin Gupta <ngupta@vflare.org>
      Cc: Robin Murphy <robin.murphy@arm.com>
      Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
      Cc: Stephen Hemminger <sthemmin@microsoft.com>
      Cc: Sumit Semwal <sumit.semwal@linaro.org>
      Cc: Wei Liu <wei.liu@kernel.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Paul Mackerras <paulus@ozlabs.org>
      Cc: Vasily Gorbik <gor@linux.ibm.com>
      Cc: Will Deacon <will@kernel.org>
      Cc: Stephen Rothwell <sfr@canb.auug.org.au>
      Link: http://lkml.kernel.org/r/20200414131348.444715-27-hch@lst.deSigned-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      041de93f
    • Christoph Hellwig's avatar
      mm: switch the test_vmalloc module to use __vmalloc_node · c3f896dc
      Christoph Hellwig authored
      No need to export the very low-level __vmalloc_node_range when the test
      module can use a slightly higher level variant.
      
      [akpm@linux-foundation.org: add missing `node' arg]
      [akpm@linux-foundation.org: fix riscv nommu build]
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Christophe Leroy <christophe.leroy@c-s.fr>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Gao Xiang <xiang@kernel.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Haiyang Zhang <haiyangz@microsoft.com>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: "K. Y. Srinivasan" <kys@microsoft.com>
      Cc: Laura Abbott <labbott@redhat.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Michael Kelley <mikelley@microsoft.com>
      Cc: Minchan Kim <minchan@kernel.org>
      Cc: Nitin Gupta <ngupta@vflare.org>
      Cc: Robin Murphy <robin.murphy@arm.com>
      Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
      Cc: Stephen Hemminger <sthemmin@microsoft.com>
      Cc: Sumit Semwal <sumit.semwal@linaro.org>
      Cc: Wei Liu <wei.liu@kernel.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Paul Mackerras <paulus@ozlabs.org>
      Cc: Vasily Gorbik <gor@linux.ibm.com>
      Cc: Will Deacon <will@kernel.org>
      Link: http://lkml.kernel.org/r/20200414131348.444715-26-hch@lst.deSigned-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      c3f896dc
    • Christoph Hellwig's avatar
      mm: remove __vmalloc_node_flags_caller · 2b905948
      Christoph Hellwig authored
      Just use __vmalloc_node instead which gets and extra argument.  To be able
      to to use __vmalloc_node in all caller make it available outside of
      vmalloc and implement it in nommu.c.
      
      [akpm@linux-foundation.org: fix nommu build]
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Christophe Leroy <christophe.leroy@c-s.fr>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Gao Xiang <xiang@kernel.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Haiyang Zhang <haiyangz@microsoft.com>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: "K. Y. Srinivasan" <kys@microsoft.com>
      Cc: Laura Abbott <labbott@redhat.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Michael Kelley <mikelley@microsoft.com>
      Cc: Minchan Kim <minchan@kernel.org>
      Cc: Nitin Gupta <ngupta@vflare.org>
      Cc: Robin Murphy <robin.murphy@arm.com>
      Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
      Cc: Stephen Hemminger <sthemmin@microsoft.com>
      Cc: Sumit Semwal <sumit.semwal@linaro.org>
      Cc: Wei Liu <wei.liu@kernel.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Paul Mackerras <paulus@ozlabs.org>
      Cc: Vasily Gorbik <gor@linux.ibm.com>
      Cc: Will Deacon <will@kernel.org>
      Cc: Stephen Rothwell <sfr@canb.auug.org.au>
      Link: http://lkml.kernel.org/r/20200414131348.444715-25-hch@lst.deSigned-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      2b905948
    • Christoph Hellwig's avatar
      mm: remove both instances of __vmalloc_node_flags · 4d39d728
      Christoph Hellwig authored
      The real version just had a few callers that can open code it and remove
      one layer of indirection.  The nommu stub was public but only had a single
      caller, so remove it and avoid a CONFIG_MMU ifdef in vmalloc.h.
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Christophe Leroy <christophe.leroy@c-s.fr>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Gao Xiang <xiang@kernel.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Haiyang Zhang <haiyangz@microsoft.com>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: "K. Y. Srinivasan" <kys@microsoft.com>
      Cc: Laura Abbott <labbott@redhat.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Michael Kelley <mikelley@microsoft.com>
      Cc: Minchan Kim <minchan@kernel.org>
      Cc: Nitin Gupta <ngupta@vflare.org>
      Cc: Robin Murphy <robin.murphy@arm.com>
      Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
      Cc: Stephen Hemminger <sthemmin@microsoft.com>
      Cc: Sumit Semwal <sumit.semwal@linaro.org>
      Cc: Wei Liu <wei.liu@kernel.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Paul Mackerras <paulus@ozlabs.org>
      Cc: Vasily Gorbik <gor@linux.ibm.com>
      Cc: Will Deacon <will@kernel.org>
      Link: http://lkml.kernel.org/r/20200414131348.444715-24-hch@lst.deSigned-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      4d39d728
    • Christoph Hellwig's avatar
      mm: remove the prot argument to __vmalloc_node · f38fcb9c
      Christoph Hellwig authored
      This is always PAGE_KERNEL now.
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Christophe Leroy <christophe.leroy@c-s.fr>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Gao Xiang <xiang@kernel.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Haiyang Zhang <haiyangz@microsoft.com>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: "K. Y. Srinivasan" <kys@microsoft.com>
      Cc: Laura Abbott <labbott@redhat.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Michael Kelley <mikelley@microsoft.com>
      Cc: Minchan Kim <minchan@kernel.org>
      Cc: Nitin Gupta <ngupta@vflare.org>
      Cc: Robin Murphy <robin.murphy@arm.com>
      Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
      Cc: Stephen Hemminger <sthemmin@microsoft.com>
      Cc: Sumit Semwal <sumit.semwal@linaro.org>
      Cc: Wei Liu <wei.liu@kernel.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Paul Mackerras <paulus@ozlabs.org>
      Cc: Vasily Gorbik <gor@linux.ibm.com>
      Cc: Will Deacon <will@kernel.org>
      Link: http://lkml.kernel.org/r/20200414131348.444715-23-hch@lst.deSigned-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      f38fcb9c
    • Christoph Hellwig's avatar
      mm: remove the pgprot argument to __vmalloc · 88dca4ca
      Christoph Hellwig authored
      The pgprot argument to __vmalloc is always PAGE_KERNEL now, so remove it.
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Reviewed-by: Michael Kelley <mikelley@microsoft.com> [hyperv]
      Acked-by: Gao Xiang <xiang@kernel.org> [erofs]
      Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Acked-by: default avatarWei Liu <wei.liu@kernel.org>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Christophe Leroy <christophe.leroy@c-s.fr>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Haiyang Zhang <haiyangz@microsoft.com>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: "K. Y. Srinivasan" <kys@microsoft.com>
      Cc: Laura Abbott <labbott@redhat.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Minchan Kim <minchan@kernel.org>
      Cc: Nitin Gupta <ngupta@vflare.org>
      Cc: Robin Murphy <robin.murphy@arm.com>
      Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
      Cc: Stephen Hemminger <sthemmin@microsoft.com>
      Cc: Sumit Semwal <sumit.semwal@linaro.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Paul Mackerras <paulus@ozlabs.org>
      Cc: Vasily Gorbik <gor@linux.ibm.com>
      Cc: Will Deacon <will@kernel.org>
      Link: http://lkml.kernel.org/r/20200414131348.444715-22-hch@lst.deSigned-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      88dca4ca
    • Christoph Hellwig's avatar
      gpu/drm: remove the powerpc hack in drm_legacy_sg_alloc · d28ff991
      Christoph Hellwig authored
      The non-cached vmalloc mapping was initially added as a hack for the
      first-gen amigaone platform (6xx/book32s), isn't fully supported upstream,
      and which used the legacy radeon driver together with non-coherent DMA.
      However this only ever worked reliably for DRI .
      
      Remove the hack as it is the last user of __vmalloc passing a page
      protection flag other than PAGE_KERNEL and didn't do anything for other
      platforms with non-coherent DMA.
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Acked-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Christophe Leroy <christophe.leroy@c-s.fr>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Gao Xiang <xiang@kernel.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Haiyang Zhang <haiyangz@microsoft.com>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: "K. Y. Srinivasan" <kys@microsoft.com>
      Cc: Laura Abbott <labbott@redhat.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Michael Kelley <mikelley@microsoft.com>
      Cc: Minchan Kim <minchan@kernel.org>
      Cc: Nitin Gupta <ngupta@vflare.org>
      Cc: Robin Murphy <robin.murphy@arm.com>
      Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
      Cc: Stephen Hemminger <sthemmin@microsoft.com>
      Cc: Sumit Semwal <sumit.semwal@linaro.org>
      Cc: Wei Liu <wei.liu@kernel.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Paul Mackerras <paulus@ozlabs.org>
      Cc: Vasily Gorbik <gor@linux.ibm.com>
      Cc: Will Deacon <will@kernel.org>
      Link: http://lkml.kernel.org/r/20200414131348.444715-21-hch@lst.deSigned-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      d28ff991
    • Christoph Hellwig's avatar
      mm: enforce that vmap can't map pages executable · cca98e9f
      Christoph Hellwig authored
      To help enforcing the W^X protection don't allow remapping existing pages
      as executable.
      
      x86 bits from Peter Zijlstra, arm64 bits from Mark Rutland.
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Mark Rutland <mark.rutland@arm.com>.
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Christophe Leroy <christophe.leroy@c-s.fr>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Gao Xiang <xiang@kernel.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Haiyang Zhang <haiyangz@microsoft.com>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: "K. Y. Srinivasan" <kys@microsoft.com>
      Cc: Laura Abbott <labbott@redhat.com>
      Cc: Michael Kelley <mikelley@microsoft.com>
      Cc: Minchan Kim <minchan@kernel.org>
      Cc: Nitin Gupta <ngupta@vflare.org>
      Cc: Robin Murphy <robin.murphy@arm.com>
      Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
      Cc: Stephen Hemminger <sthemmin@microsoft.com>
      Cc: Sumit Semwal <sumit.semwal@linaro.org>
      Cc: Wei Liu <wei.liu@kernel.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Paul Mackerras <paulus@ozlabs.org>
      Cc: Vasily Gorbik <gor@linux.ibm.com>
      Cc: Will Deacon <will@kernel.org>
      Link: http://lkml.kernel.org/r/20200414131348.444715-20-hch@lst.deSigned-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      cca98e9f
    • Christoph Hellwig's avatar
      mm: remove the prot argument from vm_map_ram · d4efd79a
      Christoph Hellwig authored
      This is always PAGE_KERNEL - for long term mappings with other properties
      vmap should be used.
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Christophe Leroy <christophe.leroy@c-s.fr>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Gao Xiang <xiang@kernel.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Haiyang Zhang <haiyangz@microsoft.com>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: "K. Y. Srinivasan" <kys@microsoft.com>
      Cc: Laura Abbott <labbott@redhat.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Michael Kelley <mikelley@microsoft.com>
      Cc: Minchan Kim <minchan@kernel.org>
      Cc: Nitin Gupta <ngupta@vflare.org>
      Cc: Robin Murphy <robin.murphy@arm.com>
      Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
      Cc: Stephen Hemminger <sthemmin@microsoft.com>
      Cc: Sumit Semwal <sumit.semwal@linaro.org>
      Cc: Wei Liu <wei.liu@kernel.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Paul Mackerras <paulus@ozlabs.org>
      Cc: Vasily Gorbik <gor@linux.ibm.com>
      Cc: Will Deacon <will@kernel.org>
      Link: http://lkml.kernel.org/r/20200414131348.444715-19-hch@lst.deSigned-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      d4efd79a
    • Christoph Hellwig's avatar
      mm: remove unmap_vmap_area · 855e57a1
      Christoph Hellwig authored
      This function just has a single caller, open code it there.
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Christophe Leroy <christophe.leroy@c-s.fr>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Gao Xiang <xiang@kernel.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Haiyang Zhang <haiyangz@microsoft.com>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: "K. Y. Srinivasan" <kys@microsoft.com>
      Cc: Laura Abbott <labbott@redhat.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Michael Kelley <mikelley@microsoft.com>
      Cc: Minchan Kim <minchan@kernel.org>
      Cc: Nitin Gupta <ngupta@vflare.org>
      Cc: Robin Murphy <robin.murphy@arm.com>
      Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
      Cc: Stephen Hemminger <sthemmin@microsoft.com>
      Cc: Sumit Semwal <sumit.semwal@linaro.org>
      Cc: Wei Liu <wei.liu@kernel.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Paul Mackerras <paulus@ozlabs.org>
      Cc: Vasily Gorbik <gor@linux.ibm.com>
      Cc: Will Deacon <will@kernel.org>
      Link: http://lkml.kernel.org/r/20200414131348.444715-18-hch@lst.deSigned-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      855e57a1
    • Christoph Hellwig's avatar
      mm: remove map_vm_range · ed1f324c
      Christoph Hellwig authored
      Switch all callers to map_kernel_range, which symmetric to the unmap side
      (as well as the _noflush versions).
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Christophe Leroy <christophe.leroy@c-s.fr>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Gao Xiang <xiang@kernel.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Haiyang Zhang <haiyangz@microsoft.com>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: "K. Y. Srinivasan" <kys@microsoft.com>
      Cc: Laura Abbott <labbott@redhat.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Michael Kelley <mikelley@microsoft.com>
      Cc: Minchan Kim <minchan@kernel.org>
      Cc: Nitin Gupta <ngupta@vflare.org>
      Cc: Robin Murphy <robin.murphy@arm.com>
      Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
      Cc: Stephen Hemminger <sthemmin@microsoft.com>
      Cc: Sumit Semwal <sumit.semwal@linaro.org>
      Cc: Wei Liu <wei.liu@kernel.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Paul Mackerras <paulus@ozlabs.org>
      Cc: Vasily Gorbik <gor@linux.ibm.com>
      Cc: Will Deacon <will@kernel.org>
      Link: http://lkml.kernel.org/r/20200414131348.444715-17-hch@lst.deSigned-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      ed1f324c
    • Christoph Hellwig's avatar
      mm: don't return the number of pages from map_kernel_range{,_noflush} · 60bb4465
      Christoph Hellwig authored
      None of the callers needs the number of pages, and a 0 / -errno return
      value is a lot more intuitive.
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Christophe Leroy <christophe.leroy@c-s.fr>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Gao Xiang <xiang@kernel.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Haiyang Zhang <haiyangz@microsoft.com>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: "K. Y. Srinivasan" <kys@microsoft.com>
      Cc: Laura Abbott <labbott@redhat.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Michael Kelley <mikelley@microsoft.com>
      Cc: Minchan Kim <minchan@kernel.org>
      Cc: Nitin Gupta <ngupta@vflare.org>
      Cc: Robin Murphy <robin.murphy@arm.com>
      Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
      Cc: Stephen Hemminger <sthemmin@microsoft.com>
      Cc: Sumit Semwal <sumit.semwal@linaro.org>
      Cc: Wei Liu <wei.liu@kernel.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Paul Mackerras <paulus@ozlabs.org>
      Cc: Vasily Gorbik <gor@linux.ibm.com>
      Cc: Will Deacon <will@kernel.org>
      Link: http://lkml.kernel.org/r/20200414131348.444715-16-hch@lst.deSigned-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      60bb4465
    • Christoph Hellwig's avatar
      mm: rename vmap_page_range to map_kernel_range · a29adb62
      Christoph Hellwig authored
      This matches the map_kernel_range_noflush API.  Also change to pass a size
      instead of the end, similar to the noflush version.
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Christophe Leroy <christophe.leroy@c-s.fr>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Gao Xiang <xiang@kernel.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Haiyang Zhang <haiyangz@microsoft.com>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: "K. Y. Srinivasan" <kys@microsoft.com>
      Cc: Laura Abbott <labbott@redhat.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Michael Kelley <mikelley@microsoft.com>
      Cc: Minchan Kim <minchan@kernel.org>
      Cc: Nitin Gupta <ngupta@vflare.org>
      Cc: Robin Murphy <robin.murphy@arm.com>
      Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
      Cc: Stephen Hemminger <sthemmin@microsoft.com>
      Cc: Sumit Semwal <sumit.semwal@linaro.org>
      Cc: Wei Liu <wei.liu@kernel.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Paul Mackerras <paulus@ozlabs.org>
      Cc: Vasily Gorbik <gor@linux.ibm.com>
      Cc: Will Deacon <will@kernel.org>
      Link: http://lkml.kernel.org/r/20200414131348.444715-15-hch@lst.deSigned-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      a29adb62
    • Christoph Hellwig's avatar
      mm: remove vmap_page_range_noflush and vunmap_page_range · b521c43f
      Christoph Hellwig authored
      These have non-static aliases called map_kernel_range_noflush and
      unmap_kernel_range_noflush that just differ slightly in the calling
      conventions that pass addr + size instead of an end.
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Christophe Leroy <christophe.leroy@c-s.fr>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Gao Xiang <xiang@kernel.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Haiyang Zhang <haiyangz@microsoft.com>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: "K. Y. Srinivasan" <kys@microsoft.com>
      Cc: Laura Abbott <labbott@redhat.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Michael Kelley <mikelley@microsoft.com>
      Cc: Minchan Kim <minchan@kernel.org>
      Cc: Nitin Gupta <ngupta@vflare.org>
      Cc: Robin Murphy <robin.murphy@arm.com>
      Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
      Cc: Stephen Hemminger <sthemmin@microsoft.com>
      Cc: Sumit Semwal <sumit.semwal@linaro.org>
      Cc: Wei Liu <wei.liu@kernel.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Paul Mackerras <paulus@ozlabs.org>
      Cc: Vasily Gorbik <gor@linux.ibm.com>
      Cc: Will Deacon <will@kernel.org>
      Link: http://lkml.kernel.org/r/20200414131348.444715-14-hch@lst.deSigned-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      b521c43f
    • Christoph Hellwig's avatar
      mm: pass addr as unsigned long to vb_free · 78a0e8c4
      Christoph Hellwig authored
      Ever use of addr in vb_free casts to unsigned long first, and the caller
      has an unsigned long version of the address available anyway.  Just pass
      that and avoid all the casts.
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Christophe Leroy <christophe.leroy@c-s.fr>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Gao Xiang <xiang@kernel.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Haiyang Zhang <haiyangz@microsoft.com>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: "K. Y. Srinivasan" <kys@microsoft.com>
      Cc: Laura Abbott <labbott@redhat.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Michael Kelley <mikelley@microsoft.com>
      Cc: Minchan Kim <minchan@kernel.org>
      Cc: Nitin Gupta <ngupta@vflare.org>
      Cc: Robin Murphy <robin.murphy@arm.com>
      Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
      Cc: Stephen Hemminger <sthemmin@microsoft.com>
      Cc: Sumit Semwal <sumit.semwal@linaro.org>
      Cc: Wei Liu <wei.liu@kernel.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Paul Mackerras <paulus@ozlabs.org>
      Cc: Vasily Gorbik <gor@linux.ibm.com>
      Cc: Will Deacon <will@kernel.org>
      Link: http://lkml.kernel.org/r/20200414131348.444715-13-hch@lst.deSigned-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      78a0e8c4
    • Christoph Hellwig's avatar
      mm: only allow page table mappings for built-in zsmalloc · b607e6d1
      Christoph Hellwig authored
      This allows to unexport map_vm_area and unmap_kernel_range, which are
      rather deep internal and should not be available to modules, as they for
      example allow fine grained control of mapping permissions, and also
      allow splitting the setup of a vmalloc area and the actual mapping and
      thus expose vmalloc internals.
      
      zsmalloc is typically built-in and continues to work (just like the
      percpu-vm code using a similar patter), while modular zsmalloc also
      continues to work, but must use copies.
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Christophe Leroy <christophe.leroy@c-s.fr>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Gao Xiang <xiang@kernel.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Haiyang Zhang <haiyangz@microsoft.com>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: "K. Y. Srinivasan" <kys@microsoft.com>
      Cc: Laura Abbott <labbott@redhat.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Michael Kelley <mikelley@microsoft.com>
      Cc: Minchan Kim <minchan@kernel.org>
      Cc: Nitin Gupta <ngupta@vflare.org>
      Cc: Robin Murphy <robin.murphy@arm.com>
      Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
      Cc: Stephen Hemminger <sthemmin@microsoft.com>
      Cc: Sumit Semwal <sumit.semwal@linaro.org>
      Cc: Wei Liu <wei.liu@kernel.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Paul Mackerras <paulus@ozlabs.org>
      Cc: Vasily Gorbik <gor@linux.ibm.com>
      Cc: Will Deacon <will@kernel.org>
      Link: http://lkml.kernel.org/r/20200414131348.444715-12-hch@lst.deSigned-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      b607e6d1