Skip to content
  1. Sep 28, 2018
    • Kairui Song's avatar
      x86/boot: Fix kexec booting failure in the SEV bit detection code · bdec8d7f
      Kairui Song authored
      Commit
      
        1958b5fc ("x86/boot: Add early boot support when running with SEV active")
      
      can occasionally cause system resets when kexec-ing a second kernel even
      if SEV is not active.
      
      That's because get_sev_encryption_bit() uses 32-bit rIP-relative
      addressing to read the value of enc_bit - a variable which caches a
      previously detected encryption bit position - but kexec may allocate
      the early boot code to a higher location, beyond the 32-bit addressing
      limit.
      
      In this case, garbage will be read and get_sev_encryption_bit() will
      return the wrong value, leading to accessing memory with the wrong
      encryption setting.
      
      Therefore, remove enc_bit, and thus get rid of the need to do 32-bit
      rIP-relative addressing in the first place.
      
       [ bp: massage commit message heavily. ]
      
      Fixes: 1958b5fc
      
       ("x86/boot: Add early boot support when running with SEV active")
      Suggested-by: default avatarBorislav Petkov <bp@suse.de>
      Signed-off-by: default avatarKairui Song <kasong@redhat.com>
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Reviewed-by: default avatarTom Lendacky <thomas.lendacky@amd.com>
      Cc: linux-kernel@vger.kernel.org
      Cc: tglx@linutronix.de
      Cc: mingo@redhat.com
      Cc: hpa@zytor.com
      Cc: brijesh.singh@amd.com
      Cc: kexec@lists.infradead.org
      Cc: dyoung@redhat.com
      Cc: bhe@redhat.com
      Cc: ghook@redhat.com
      Link: https://lkml.kernel.org/r/20180927123845.32052-1-kasong@redhat.com
      bdec8d7f
  2. Sep 21, 2018
  3. Sep 19, 2018
    • Thomas Gleixner's avatar
      MAINTAINERS: Add Borislav to the x86 maintainers · 336b0808
      Thomas Gleixner authored
      
      
      Borislav is effectivly maintaining parts of X86 already, make it official.
      
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Acked-by: default avatarIngo Molnar <mingo@kernel.org>
      Acked-by: default avatarBorislav Petkov <bp@alien8.de>
      336b0808
    • Dan Carpenter's avatar
      x86/paravirt: Fix some warning messages · 571d0563
      Dan Carpenter authored
      The first argument to WARN_ONCE() is a condition.
      
      Fixes: 5800dc5c
      
       ("x86/paravirt: Fix spectre-v2 mitigations for paravirt guests")
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Reviewed-by: default avatarJuergen Gross <jgross@suse.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Alok Kataria <akataria@vmware.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: virtualization@lists.linux-foundation.org
      Cc: kernel-janitors@vger.kernel.org
      Link: https://lkml.kernel.org/r/20180919103553.GD9238@mwanda
      
      571d0563
    • Reinette Chatre's avatar
      x86/intel_rdt: Fix incorrect loop end condition · ffb2315f
      Reinette Chatre authored
      In order to determine a sane default cache allocation for a new CAT/CDP
      resource group, all resource groups are checked to determine which cache
      portions are available to share. At this time all possible CLOSIDs
      that can be supported by the resource is checked. This is problematic
      if the resource supports more CLOSIDs than another CAT/CDP resource. In
      this case, the number of CLOSIDs that could be allocated are fewer than
      the number of CLOSIDs that can be supported by the resource.
      
      Limit the check of closids to that what is supported by the system based
      on the minimum across all resources.
      
      Fixes: 95f0b77e
      
       ("x86/intel_rdt: Initialize new resource group with sane defaults")
      Signed-off-by: default avatarReinette Chatre <reinette.chatre@intel.com>
      Signed-off-by: default avatarFenghua Yu <fenghua.yu@intel.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: "H Peter Anvin" <hpa@zytor.com>
      Cc: "Tony Luck" <tony.luck@intel.com>
      Cc: "Xiaochen Shen" <xiaochen.shen@intel.com>
      Cc: "Chen Yu" <yu.c.chen@intel.com>
      Link: https://lkml.kernel.org/r/1537048707-76280-10-git-send-email-fenghua.yu@intel.com
      ffb2315f
    • Reinette Chatre's avatar
      x86/intel_rdt: Fix exclusive mode handling of MBA resource · 939b90b2
      Reinette Chatre authored
      It is possible for a resource group to consist out of MBA as well as
      CAT/CDP resources. The "exclusive" resource mode only applies to the
      CAT/CDP resources since MBA allocations cannot be specified to overlap
      or not. When a user requests a resource group to become "exclusive" then it
      can only be successful if there are CAT/CDP resources in the group
      and none of their CBMs associated with the group's CLOSID overlaps with
      any other resource group.
      
      Fix the "exclusive" mode setting by failing if there isn't any CAT/CDP
      resource in the group and ensuring that the CBM checking is only done on
      CAT/CDP resources.
      
      Fixes: 49f7b4ef
      
       ("x86/intel_rdt: Enable setting of exclusive mode")
      Signed-off-by: default avatarReinette Chatre <reinette.chatre@intel.com>
      Signed-off-by: default avatarFenghua Yu <fenghua.yu@intel.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: "H Peter Anvin" <hpa@zytor.com>
      Cc: "Tony Luck" <tony.luck@intel.com>
      Cc: "Xiaochen Shen" <xiaochen.shen@intel.com>
      Cc: "Chen Yu" <yu.c.chen@intel.com>
      Link: https://lkml.kernel.org/r/1537048707-76280-9-git-send-email-fenghua.yu@intel.com
      939b90b2
    • Reinette Chatre's avatar
      x86/intel_rdt: Fix incorrect loop end condition · f0df4e1a
      Reinette Chatre authored
      A loop is used to check if a CAT resource's CBM of one CLOSID
      overlaps with the CBM of another CLOSID of the same resource. The loop
      is run over all CLOSIDs supported by the resource.
      
      The problem with running the loop over all CLOSIDs supported by the
      resource is that its number of supported CLOSIDs may be more than the
      number of supported CLOSIDs on the system, which is the minimum number of
      CLOSIDs supported across all resources.
      
      Fix the loop to only consider the number of system supported CLOSIDs,
      not all that are supported by the resource.
      
      Fixes: 49f7b4ef
      
       ("x86/intel_rdt: Enable setting of exclusive mode")
      Signed-off-by: default avatarReinette Chatre <reinette.chatre@intel.com>
      Signed-off-by: default avatarFenghua Yu <fenghua.yu@intel.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: "H Peter Anvin" <hpa@zytor.com>
      Cc: "Tony Luck" <tony.luck@intel.com>
      Cc: "Xiaochen Shen" <xiaochen.shen@intel.com>
      Cc: "Chen Yu" <yu.c.chen@intel.com>
      Link: https://lkml.kernel.org/r/1537048707-76280-8-git-send-email-fenghua.yu@intel.com
      f0df4e1a
    • Reinette Chatre's avatar
      x86/intel_rdt: Do not allow pseudo-locking of MBA resource · 32d736ab
      Reinette Chatre authored
      A system supporting pseudo-locking may have MBA as well as CAT
      resources of which only the CAT resources could support cache
      pseudo-locking. When the schemata to be pseudo-locked is provided it
      should be checked that that schemata does not attempt to pseudo-lock a
      MBA resource.
      
      Fixes: e0bdfe8e
      
       ("x86/intel_rdt: Support creation/removal of pseudo-locked region")
      Signed-off-by: default avatarReinette Chatre <reinette.chatre@intel.com>
      Signed-off-by: default avatarFenghua Yu <fenghua.yu@intel.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: "H Peter Anvin" <hpa@zytor.com>
      Cc: "Tony Luck" <tony.luck@intel.com>
      Cc: "Xiaochen Shen" <xiaochen.shen@intel.com>
      Cc: "Chen Yu" <yu.c.chen@intel.com>
      Link: https://lkml.kernel.org/r/1537048707-76280-7-git-send-email-fenghua.yu@intel.com
      32d736ab
    • Reinette Chatre's avatar
      x86/intel_rdt: Fix unchecked MSR access · 70479c01
      Reinette Chatre authored
      When a new resource group is created, it is initialized with sane
      defaults that currently assume the resource being initialized is a CAT
      resource. This code path is also followed by a MBA resource that is not
      allocated the same as a CAT resource and as a result we encounter the
      following unchecked MSR access error:
      
      unchecked MSR access error: WRMSR to 0xd51 (tried to write 0x0000
      000000000064) at rIP: 0xffffffffae059994 (native_write_msr+0x4/0x20)
      Call Trace:
      mba_wrmsr+0x41/0x80
      update_domains+0x125/0x130
      rdtgroup_mkdir+0x270/0x500
      
      Fix the above by ensuring the initial allocation is only attempted on a
      CAT resource.
      
      Fixes: 95f0b77e
      
       ("x86/intel_rdt: Initialize new resource group with sane defaults")
      Signed-off-by: default avatarReinette Chatre <reinette.chatre@intel.com>
      Signed-off-by: default avatarFenghua Yu <fenghua.yu@intel.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: "H Peter Anvin" <hpa@zytor.com>
      Cc: "Tony Luck" <tony.luck@intel.com>
      Cc: "Xiaochen Shen" <xiaochen.shen@intel.com>
      Cc: "Chen Yu" <yu.c.chen@intel.com>
      Link: https://lkml.kernel.org/r/1537048707-76280-6-git-send-email-fenghua.yu@intel.com
      70479c01
    • Reinette Chatre's avatar
      x86/intel_rdt: Fix invalid mode warning when multiple resources are managed · 47d53b18
      Reinette Chatre authored
      When multiple resources are managed by RDT, the number of CLOSIDs used
      is the minimum of the CLOSIDs supported by each resource. In the function
      rdt_bit_usage_show(), the annotated bitmask is created to depict how the
      CAT supporting caches are being used. During this annotated bitmask
      creation, each resource group is queried for its mode that is used as a
      label in the annotated bitmask.
      
      The maximum number of resource groups is currently assumed to be the
      number of CLOSIDs supported by the resource for which the information is
      being displayed. This is incorrect since the number of active CLOSIDs is
      the minimum across all resources.
      
      If information for a cache instance with more CLOSIDs than another is
      being generated we thus encounter a warning like:
      
      invalid mode for closid 8
      WARNING: CPU: 88 PID: 1791 at [SNIP]/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c
      :827 rdt_bit_usage_show+0x221/0x2b0
      
      Fix this by ensuring that only the number of supported CLOSIDs are
      considered.
      
      Fixes: e6519011
      
       ("x86/intel_rdt: Introduce "bit_usage" to display cache allocations details")
      Signed-off-by: default avatarReinette Chatre <reinette.chatre@intel.com>
      Signed-off-by: default avatarFenghua Yu <fenghua.yu@intel.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: "H Peter Anvin" <hpa@zytor.com>
      Cc: "Tony Luck" <tony.luck@intel.com>
      Cc: "Xiaochen Shen" <xiaochen.shen@intel.com>
      Cc: "Chen Yu" <yu.c.chen@intel.com>
      Link: https://lkml.kernel.org/r/1537048707-76280-5-git-send-email-fenghua.yu@intel.com
      47d53b18
    • Reinette Chatre's avatar
      x86/intel_rdt: Global closid helper to support future fixes · c793da8e
      Reinette Chatre authored
      
      
      The number of CLOSIDs supported by a system is the minimum number of
      CLOSIDs supported by any of its resources. Care should be taken when
      iterating over the CLOSIDs of a resource since it may be that the number
      of CLOSIDs supported on the system is less than the number of CLOSIDs
      supported by the resource.
      
      Introduce a helper function that can be used to query the number of
      CLOSIDs that is supported by all resources, irrespective of how many
      CLOSIDs are supported by a particular resource.
      
      Signed-off-by: default avatarReinette Chatre <reinette.chatre@intel.com>
      Signed-off-by: default avatarFenghua Yu <fenghua.yu@intel.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: "H Peter Anvin" <hpa@zytor.com>
      Cc: "Tony Luck" <tony.luck@intel.com>
      Cc: "Xiaochen Shen" <xiaochen.shen@intel.com>
      Cc: "Chen Yu" <yu.c.chen@intel.com>
      Link: https://lkml.kernel.org/r/1537048707-76280-4-git-send-email-fenghua.yu@intel.com
      c793da8e
    • Reinette Chatre's avatar
      x86/intel_rdt: Fix size reporting of MBA resource · f968dc11
      Reinette Chatre authored
      Chen Yu reported a divide-by-zero error when accessing the 'size'
      resctrl file when a MBA resource is enabled.
      
      divide error: 0000 [#1] SMP PTI
      CPU: 93 PID: 1929 Comm: cat Not tainted 4.19.0-rc2-debug-rdt+ #25
      RIP: 0010:rdtgroup_cbm_to_size+0x7e/0xa0
      Call Trace:
      rdtgroup_size_show+0x11a/0x1d0
      seq_read+0xd8/0x3b0
      
      Quoting Chen Yu's report: This is because for MB resource, the
      r->cache.cbm_len is zero, thus calculating size in rdtgroup_cbm_to_size()
      will trigger the exception.
      
      Fix this issue in the 'size' file by getting correct memory bandwidth value
      which is in MBps when MBA software controller is enabled or in percentage
      when MBA software controller is disabled.
      
      Fixes: d9b48c86
      
       ("x86/intel_rdt: Display resource groups' allocations in bytes")
      Reported-by: default avatarChen Yu <yu.c.chen@intel.com>
      Signed-off-by: default avatarReinette Chatre <reinette.chatre@intel.com>
      Signed-off-by: default avatarFenghua Yu <fenghua.yu@intel.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Tested-by: default avatarChen Yu <yu.c.chen@intel.com>
      Cc: "H Peter Anvin" <hpa@zytor.com>
      Cc: "Tony Luck" <tony.luck@intel.com>
      Cc: "Xiaochen Shen" <xiaochen.shen@intel.com>
      Link: https://lkml.kernel.org/r/20180904174614.26682-1-yu.c.chen@intel.com
      Link: https://lkml.kernel.org/r/1537048707-76280-3-git-send-email-fenghua.yu@intel.com
      f968dc11
    • Xiaochen Shen's avatar
      x86/intel_rdt: Fix data type in parsing callbacks · 753694a8
      Xiaochen Shen authored
      Each resource is associated with a parsing callback to parse the data
      provided from user space when writing schemata file.
      
      The 'data' parameter in the callbacks is defined as a void pointer which
      is error prone due to lack of type check.
      
      parse_bw() processes the 'data' parameter as a string while its caller
      actually passes the parameter as a pointer to struct rdt_cbm_parse_data.
      Thus, parse_bw() takes wrong data and causes failure of parsing MBA
      throttle value.
      
      To fix the issue, the 'data' parameter in all parsing callbacks is defined
      and handled as a pointer to struct rdt_parse_data (renamed from struct
      rdt_cbm_parse_data).
      
      Fixes: 7604df6e ("x86/intel_rdt: Support flexible data to parsing callbacks")
      Fixes: 9ab9aa15
      
       ("x86/intel_rdt: Ensure requested schemata respects mode")
      Signed-off-by: default avatarXiaochen Shen <xiaochen.shen@intel.com>
      Signed-off-by: default avatarReinette Chatre <reinette.chatre@intel.com>
      Signed-off-by: default avatarFenghua Yu <fenghua.yu@intel.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: "H Peter Anvin" <hpa@zytor.com>
      Cc: "Tony Luck" <tony.luck@intel.com>
      Cc: "Chen Yu" <yu.c.chen@intel.com>
      Link: https://lkml.kernel.org/r/1537048707-76280-2-git-send-email-fenghua.yu@intel.com
      
      753694a8
  4. Sep 16, 2018
    • Brijesh Singh's avatar
      x86/kvm: Use __bss_decrypted attribute in shared variables · 6a1cac56
      Brijesh Singh authored
      The recent removal of the memblock dependency from kvmclock caused a SEV
      guest regression because the wall_clock and hv_clock_boot variables are
      no longer mapped decrypted when SEV is active.
      
      Use the __bss_decrypted attribute to put the static wall_clock and
      hv_clock_boot in the .bss..decrypted section so that they are mapped
      decrypted during boot.
      
      In the preparatory stage of CPU hotplug, the per-cpu pvclock data pointer
      assigns either an element of the static array or dynamically allocated
      memory for the pvclock data pointer. The static array are now mapped
      decrypted but the dynamically allocated memory is not mapped decrypted.
      However, when SEV is active this memory range must be mapped decrypted.
      
      Add a function which is called after the page allocator is up, and
      allocate memory for the pvclock data pointers for the all possible cpus.
      Map this memory range as decrypted when SEV is active.
      
      Fixes: 368a540e
      
       ("x86/kvmclock: Remove memblock dependency")
      Suggested-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarBrijesh Singh <brijesh.singh@amd.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: Tom Lendacky <thomas.lendacky@amd.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Sean Christopherson <sean.j.christopherson@intel.com>
      Cc: "Radim Krčmář" <rkrcmar@redhat.com>
      Cc: kvm@vger.kernel.org
      Link: https://lkml.kernel.org/r/1536932759-12905-3-git-send-email-brijesh.singh@amd.com
      6a1cac56
    • Brijesh Singh's avatar
      x86/mm: Add .bss..decrypted section to hold shared variables · b3f0907c
      Brijesh Singh authored
      
      
      kvmclock defines few static variables which are shared with the
      hypervisor during the kvmclock initialization.
      
      When SEV is active, memory is encrypted with a guest-specific key, and
      if the guest OS wants to share the memory region with the hypervisor
      then it must clear the C-bit before sharing it.
      
      Currently, we use kernel_physical_mapping_init() to split large pages
      before clearing the C-bit on shared pages. But it fails when called from
      the kvmclock initialization (mainly because the memblock allocator is
      not ready that early during boot).
      
      Add a __bss_decrypted section attribute which can be used when defining
      such shared variable. The so-defined variables will be placed in the
      .bss..decrypted section. This section will be mapped with C=0 early
      during boot.
      
      The .bss..decrypted section has a big chunk of memory that may be unused
      when memory encryption is not active, free it when memory encryption is
      not active.
      
      Suggested-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarBrijesh Singh <brijesh.singh@amd.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: Tom Lendacky <thomas.lendacky@amd.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Sean Christopherson <sean.j.christopherson@intel.com>
      Cc: Radim Krčmář<rkrcmar@redhat.com>
      Cc: kvm@vger.kernel.org
      Link: https://lkml.kernel.org/r/1536932759-12905-2-git-send-email-brijesh.singh@amd.com
      b3f0907c
    • Linus Torvalds's avatar
      Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 27c5a778
      Linus Torvalds authored
      Pull x86 fixes from Ingol Molnar:
       "Misc fixes:
      
         - EFI crash fix
      
         - Xen PV fixes
      
         - do not allow PTI on 2-level 32-bit kernels for now
      
         - documentation fix"
      
      * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/APM: Fix build warning when PROC_FS is not enabled
        Revert "x86/mm/legacy: Populate the user page-table with user pgd's"
        x86/efi: Load fixmap GDT in efi_call_phys_epilog() before setting %cr3
        x86/xen: Disable CPU0 hotplug for Xen PV
        x86/EISA: Don't probe EISA bus for Xen PV guests
        x86/doc: Fix Documentation/x86/earlyprintk.txt
      27c5a778
    • Linus Torvalds's avatar
      Merge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 4314daa5
      Linus Torvalds authored
      Pull scheduler fixes from Ingo Molnar:
       "Misc fixes: various scheduler metrics corner case fixes, a
        sched_features deadlock fix, and a topology fix for certain NUMA
        systems"
      
      * 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        sched/fair: Fix kernel-doc notation warning
        sched/fair: Fix load_balance redo for !imbalance
        sched/fair: Fix scale_rt_capacity() for SMT
        sched/fair: Fix vruntime_normalized() for remote non-migration wakeup
        sched/pelt: Fix update_blocked_averages() for RT and DL classes
        sched/topology: Set correct NUMA topology type
        sched/debug: Fix potential deadlock when writing to sched_features
      4314daa5
    • Linus Torvalds's avatar
      Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · c0be92b5
      Linus Torvalds authored
      Pull perf fixes from Ingo Molnar:
       "Mostly tooling fixes, but also breakpoint and x86 PMU driver fixes"
      
      * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (23 commits)
        perf tools: Fix maps__find_symbol_by_name()
        tools headers uapi: Update tools's copy of linux/if_link.h
        tools headers uapi: Update tools's copy of linux/vhost.h
        tools headers uapi: Update tools's copies of kvm headers
        tools headers uapi: Update tools's copy of drm/drm.h
        tools headers uapi: Update tools's copy of asm-generic/unistd.h
        tools headers uapi: Update tools's copy of linux/perf_event.h
        perf/core: Force USER_DS when recording user stack data
        perf/UAPI: Clearly mark __PERF_SAMPLE_CALLCHAIN_EARLY as internal use
        perf/x86/intel: Add support/quirk for the MISPREDICT bit on Knights Landing CPUs
        perf annotate: Fix parsing aarch64 branch instructions after objdump update
        perf probe powerpc: Ignore SyS symbols irrespective of endianness
        perf event-parse: Use fixed size string for comms
        perf util: Fix bad memory access in trace info.
        perf tools: Streamline bpf examples and headers installation
        perf evsel: Fix potential null pointer dereference in perf_evsel__new_idx()
        perf arm64: Fix include path for asm-generic/unistd.h
        perf/hw_breakpoint: Simplify breakpoint enable in perf_event_modify_breakpoint
        perf/hw_breakpoint: Enable breakpoint in modify_user_hw_breakpoint
        perf/hw_breakpoint: Remove superfluous bp->attr.disabled = 0
        ...
      c0be92b5
    • Linus Torvalds's avatar
      Merge branch 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · ca062f8d
      Linus Torvalds authored
      Pull locking fixes from Ingo Molnar:
       "Misc fixes: liblockdep fixes and ww_mutex fixes"
      
      * 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        locking/ww_mutex: Fix spelling mistake "cylic" -> "cyclic"
        locking/lockdep: Delete unnecessary #include
        tools/lib/lockdep: Add dummy task_struct state member
        tools/lib/lockdep: Add empty nmi.h
        tools/lib/lockdep: Update Sasha Levin email to MSFT
        jump_label: Fix typo in warning message
        locking/mutex: Fix mutex debug call and ww_mutex documentation
      ca062f8d
  5. Sep 15, 2018
    • Randy Dunlap's avatar
      x86/APM: Fix build warning when PROC_FS is not enabled · 002b87d2
      Randy Dunlap authored
      Fix build warning in apm_32.c when CONFIG_PROC_FS is not enabled:
      
      ../arch/x86/kernel/apm_32.c:1643:12: warning: 'proc_apm_show' defined but not used [-Wunused-function]
       static int proc_apm_show(struct seq_file *m, void *v)
      
      Fixes: 3f3942ac
      
       ("proc: introduce proc_create_single{,_data}")
      Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Cc: Jiri Kosina <jikos@kernel.org>
      Link: https://lkml.kernel.org/r/be39ac12-44c2-4715-247f-4dcc3c525b8b@infradead.org
      
      002b87d2
    • Linus Torvalds's avatar
      Merge tag '4.19-rc3-smb3-cifs' of git://git.samba.org/sfrench/cifs-2.6 · 3a5af36b
      Linus Torvalds authored
      Pull cifs fixes from Steve French:
       "Fixes for four CIFS/SMB3 potential pointer overflow issues, one minor
        build fix, and a build warning cleanup"
      
      * tag '4.19-rc3-smb3-cifs' of git://git.samba.org/sfrench/cifs-2.6:
        cifs: read overflow in is_valid_oplock_break()
        cifs: integer overflow in in SMB2_ioctl()
        CIFS: fix wrapping bugs in num_entries()
        cifs: prevent integer overflow in nxt_dir_entry()
        fs/cifs: require sha512
        fs/cifs: suppress a string overflow warning
      3a5af36b
    • Linus Torvalds's avatar
      Merge tag 'nfs-for-4.19-2' of git://git.linux-nfs.org/projects/anna/linux-nfs · 589109df
      Linus Torvalds authored
      Pull NFS client bugfixes from Anna Schumaker:
       "These are a handful of fixes for problems that Trond found. Patch #1
        and #3 have the same name, a second issue was found after applying the
        first patch.
      
        Stable bugfixes:
         - v4.17+: Fix tracepoint Oops in initiate_file_draining()
         - v4.11+: Fix an infinite loop on I/O
      
        Other fixes:
         - Return errors if a waiting layoutget is killed
         - Don't open code clearing of delegation state"
      
      * tag 'nfs-for-4.19-2' of git://git.linux-nfs.org/projects/anna/linux-nfs:
        NFS: Don't open code clearing of delegation state
        NFSv4.1 fix infinite loop on I/O.
        NFSv4: Fix a tracepoint Oops in initiate_file_draining()
        pNFS: Ensure we return the error if someone kills a waiting layoutget
        NFSv4: Fix a tracepoint Oops in initiate_file_draining()
      589109df
    • Linus Torvalds's avatar
      Merge tag 'trace-v4.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace · 5b945fd2
      Linus Torvalds authored
      Pull tracing fix from Steven Rostedt:
       "This fixes an issue with the build system caused by a change that
        modifies CC_FLAGS_FTRACE. The issue is that it breaks the dependencies
        and causes "make targz-pkg" to rebuild the entire world"
      
      * tag 'trace-v4.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
        tracing/Makefile: Fix handling redefinition of CC_FLAGS_FTRACE
      5b945fd2
    • Linus Torvalds's avatar
      Merge tag 'devicetree-fixes-for-4.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux · 090b75bc
      Linus Torvalds authored
      Pull DeviceTree fix from Rob Herring:
       "One regression for a 20 year old PowerMac:
      
         - Fix a regression on systems having a DT without any phandles which
           happens on a PowerMac G3"
      
      * tag 'devicetree-fixes-for-4.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux:
        of: fix phandle cache creation for DTs with no phandles
      090b75bc
    • Linus Torvalds's avatar
      Merge tag 'for-linus-4.19c-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip · d7c02680
      Linus Torvalds authored
      Pull xen fixes from Juergen Gross:
       "This contains some minor cleanups and fixes:
      
         - a new knob for controlling scrubbing of pages returned by the Xen
           balloon driver to the Xen hypervisor to address a boot performance
           issue seen in large guests booted pre-ballooned
      
         - a fix of a regression in the gntdev driver which made it impossible
           to use fully virtualized guests (HVM guests) with a 4.19 based dom0
      
         - a fix in Xen cpu hotplug functionality which could be triggered by
           wrong admin commands (setting number of active vcpus to 0)
      
        One further note: the patches have all been under test for several
        days in another branch. This branch has been rebased in order to avoid
        merge conflicts"
      
      * tag 'for-linus-4.19c-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
        xen/gntdev: fix up blockable calls to mn_invl_range_start
        xen: fix GCC warning and remove duplicate EVTCHN_ROW/EVTCHN_COL usage
        xen: avoid crash in disable_hotplug_cpu
        xen/balloon: add runtime control for scrubbing ballooned out pages
        xen/manage: don't complain about an empty value in control/sysrq node
      d7c02680
    • Linus Torvalds's avatar
      Merge tag 'xtensa-20180914' of git://github.com/jcmvbkbc/linux-xtensa · eae4f885
      Linus Torvalds authored
      Pull Xtensa fixes and cleanups from Max Filippov:
      
       - don't allocate memory in platform_setup as the memory allocator is
         not initialized at that point yet;
      
       - remove unnecessary ifeq KBUILD_SRC from arch/xtensa/Makefile;
      
       - enable SG chaining in arch/xtensa/Kconfig.
      
      * tag 'xtensa-20180914' of git://github.com/jcmvbkbc/linux-xtensa:
        xtensa: enable SG chaining in Kconfig
        xtensa: remove unnecessary KBUILD_SRC ifeq conditional
        xtensa: ISS: don't allocate memory in platform_setup
      eae4f885
    • Linus Torvalds's avatar
      Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux · 3e153256
      Linus Torvalds authored
      Pull arm64 fixes from Will Deacon:
       "The trickle of arm64 fixes continues to come in.
      
        Nothing that's the end of the world, but we've got a fix for PCI IO
        port accesses, an accidental naked "asm goto" and a fix to the
        vmcoreinfo PT_NOTE merged this time around which we'd like to get
        sorted before it becomes ABI.
      
         - Fix ioport_map() mapping the wrong physical address for some I/O
           BARs
      
         - Remove direct use of "asm goto", since some compilers don't like
           that
      
         - Ensure kimage_voffset is always present in vmcoreinfo PT_NOTE"
      
      * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
        asm-generic: io: Fix ioport_map() for !CONFIG_GENERIC_IOMAP && CONFIG_INDIRECT_PIO
        arm64: kernel: arch_crash_save_vmcoreinfo() should depend on CONFIG_CRASH_CORE
        arm64: jump_label.h: use asm_volatile_goto macro instead of "asm goto"
      3e153256
    • Trond Myklebust's avatar
      NFS: Don't open code clearing of delegation state · 9f0c5124
      Trond Myklebust authored
      
      
      Add a helper for the case when the nfs4 open state has been set to use
      a delegation stateid, and we want to revert to using the open stateid.
      
      Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
      Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
      9f0c5124
    • Trond Myklebust's avatar
      NFSv4.1 fix infinite loop on I/O. · 994b15b9
      Trond Myklebust authored
      The previous fix broke recovery of delegated stateids because it assumes
      that if we did not mark the delegation as suspect, then the delegation has
      effectively been revoked, and so it removes that delegation irrespectively
      of whether or not it is valid and still in use. While this is "mostly
      harmless" for ordinary I/O, we've seen pNFS fail with LAYOUTGET spinning
      in an infinite loop while complaining that we're using an invalid stateid
      (in this case the all-zero stateid).
      
      What we rather want to do here is ensure that the delegation is always
      correctly marked as needing testing when that is the case. So we want
      to close the loophole offered by nfs4_schedule_stateid_recovery(),
      which marks the state as needing to be reclaimed, but not the
      delegation that may be backing it.
      
      Fixes: 0e3d3e5d
      
       ("NFSv4.1 fix infinite loop on IO BAD_STATEID error")
      Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
      Cc: stable@vger.kernel.org # v4.11+
      Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
      994b15b9
    • Trond Myklebust's avatar
      NFSv4: Fix a tracepoint Oops in initiate_file_draining() · 2edaead6
      Trond Myklebust authored
      Now that the value of 'ino' can be NULL or an ERR_PTR(), we need to
      change the test in the tracepoint.
      
      Fixes: ce5624f7
      
       ("NFSv4: Return NFS4ERR_DELAY when a layout fails...")
      Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
      Cc: stable@vger.kernel.org # v4.17+
      Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
      2edaead6
    • Trond Myklebust's avatar
      pNFS: Ensure we return the error if someone kills a waiting layoutget · d03360aa
      Trond Myklebust authored
      
      
      If someone interrupts a wait on one or more outstanding layoutgets in
      pnfs_update_layout() then return the ERESTARTSYS/EINTR error.
      
      Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
      Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
      d03360aa
    • Trond Myklebust's avatar
      NFSv4: Fix a tracepoint Oops in initiate_file_draining() · 2a534a74
      Trond Myklebust authored
      Now that the value of 'ino' can be NULL or an ERR_PTR(), we need to
      change the test in the tracepoint.
      
      Fixes: ce5624f7
      
       ("NFSv4: Return NFS4ERR_DELAY when a layout fails...")
      Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
      Cc: stable@vger.kernel.org # v4.17+
      Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
      2a534a74
    • Linus Torvalds's avatar
      Merge tag 'dmaengine-fix-4.19-rc4' of git://git.infradead.org/users/vkoul/slave-dma · f3c0b8ce
      Linus Torvalds authored
      Pull dmaengine fix from Vinod Koul:
       "Fix the mic_x100_dma driver to use devm_kzalloc for driver memory, so
        that it is freed properly when it unregisters from dmaengine using
        managed API"
      
      * tag 'dmaengine-fix-4.19-rc4' of git://git.infradead.org/users/vkoul/slave-dma:
        dmaengine: mic_x100_dma: use devm_kzalloc to fix an issue
      f3c0b8ce
  6. Sep 14, 2018
    • Linus Torvalds's avatar
      Merge tag 'usb-4.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · 1abc088a
      Linus Torvalds authored
      Pull USB fixes from Greg KH:
       "Here are a number of small USB driver fixes for -rc4.
      
        The usual suspects of gadget, xhci, and dwc2/3 are in here, along with
        some reverts of reported problem changes, and a number of build
        documentation warning fixes. Full details are in the shortlog.
      
        All of these have been in linux-next with no reported issues"
      
      * tag 'usb-4.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (28 commits)
        Revert "cdc-acm: implement put_char() and flush_chars()"
        usb: Change usb_of_get_companion_dev() place to usb/common
        usb: xhci: fix interrupt transfer error happened on MTK platforms
        usb: cdc-wdm: Fix a sleep-in-atomic-context bug in service_outstanding_interrupt()
        usb: misc: uss720: Fix two sleep-in-atomic-context bugs
        usb: host: u132-hcd: Fix a sleep-in-atomic-context bug in u132_get_frame()
        usb: Avoid use-after-free by flushing endpoints early in usb_set_interface()
        linux/mod_devicetable.h: fix kernel-doc missing notation for typec_device_id
        usb/typec: fix kernel-doc notation warning for typec_match_altmode
        usb: Don't die twice if PCI xhci host is not responding in resume
        usb: mtu3: fix error of xhci port id when enable U3 dual role
        usb: uas: add support for more quirk flags
        USB: Add quirk to support DJI CineSSD
        usb: typec: fix kernel-doc parameter warning
        usb/dwc3/gadget: fix kernel-doc parameter warning
        USB: yurex: Check for truncation in yurex_read()
        USB: yurex: Fix buffer over-read in yurex_write()
        usb: host: xhci-plat: Iterate over parent nodes for finding quirks
        xhci: Fix use after free for URB cancellation on a reallocated endpoint
        USB: add quirk for WORLDE Controller KS49 or Prodipe MIDI 49C USB controller
        ...
      1abc088a
    • Linus Torvalds's avatar
      Merge tag 'tty-4.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty · c284cf06
      Linus Torvalds authored
      Pull tty fixes from Greg KH:
       "Here are three small HVC tty driver fixes to resolve a reported
        regression from 4.19-rc1.
      
        All of these have been in linux-next for a while with no reported
        issues"
      
      * tag 'tty-4.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
        tty: hvc: hvc_write() fix break condition
        tty: hvc: hvc_poll() fix read loop batching
        tty: hvc: hvc_poll() fix read loop hang
      c284cf06
    • Linus Torvalds's avatar
      Merge tag 'staging-4.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging · 45d9ab8a
      Linus Torvalds authored
      Pull staging/IIO driver fixes from Greg KH:
       "Here are a few small staging and iio driver fixes for -rc4.
      
        Nothing major, just a few small bugfixes for some reported issues, and
        a MAINTAINERS file update for the fbtft drivers.
      
        We also re-enable the building of the erofs filesystem as the XArray
        patches that were causing it to break never got merged in the -rc1
        cycle, so there's no reason it can't be turned back on for now. The
        problem that was previously there is now being handled in the Xarray
        tree at the moment, so it will not hit us again in the future.
      
        All of these patches have been in linux-next with no reported issues"
      
      * tag 'staging-4.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
        staging: vboxvideo: Change address of scanout buffer on page-flip
        staging: vboxvideo: Fix IRQs no longer working
        staging: gasket: TODO: re-implement using UIO
        staging/fbtft: Update TODO and mailing lists
        staging: erofs: rename superblock flags (MS_xyz -> SB_xyz)
        iio: imu: st_lsm6dsx: take into account ts samples in wm configuration
        Revert "iio: temperature: maxim_thermocouple: add MAX31856 part"
        Revert "staging: erofs: disable compiling temporarile"
        MAINTAINERS: Switch a maintainer for drivers/staging/gasket
        staging: wilc1000: revert "fix TODO to compile spi and sdio components in single module"
      45d9ab8a
    • Linus Torvalds's avatar
      Merge tag 'char-misc-4.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc · 319cbacf
      Linus Torvalds authored
      Pull char/misc driver fixes from Greg KH:
       "Here are a small handful of char/misc driver fixes for 4.19-rc4.
      
        All of them are simple, resolving reported problems in a few drivers.
        Full details are in the shortlog.
      
        All of these have been in linux-next with no reported issues"
      
      * tag 'char-misc-4.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
        firmware: Fix security issue with request_firmware_into_buf()
        vmbus: don't return values for uninitalized channels
        fpga: dfl: fme: fix return value check in in pr_mgmt_init()
        misc: hmc6352: fix potential Spectre v1
        Tools: hv: Fix a bug in the key delete code
        misc: ibmvsm: Fix wrong assignment of return code
        android: binder: fix the race mmap and alloc_new_buf_locked
        mei: bus: need to unlink client before freeing
        mei: bus: fix hw module get/put balance
        mei: fix use-after-free in mei_cl_write
        mei: ignore not found client in the enumeration
      319cbacf
    • Joerg Roedel's avatar
      Revert "x86/mm/legacy: Populate the user page-table with user pgd's" · 61a6bd83
      Joerg Roedel authored
      This reverts commit 1f40a46c.
      
      It turned out that this patch is not sufficient to enable PTI on 32 bit
      systems with legacy 2-level page-tables. In this paging mode the huge-page
      PTEs are in the top-level page-table directory, where also the mirroring to
      the user-space page-table happens. So every huge PTE exits twice, in the
      kernel and in the user page-table.
      
      That means that accessed/dirty bits need to be fetched from two PTEs in
      this mode to be safe, but this is not trivial to implement because it needs
      changes to generic code just for the sake of enabling PTI with 32-bit
      legacy paging. As all systems that need PTI should support PAE anyway,
      remove support for PTI when 32-bit legacy paging is used.
      
      Fixes: 7757d607
      
       ('x86/pti: Allow CONFIG_PAGE_TABLE_ISOLATION for x86_32')
      Reported-by: default avatarMeelis Roos <mroos@linux.ee>
      Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: hpa@zytor.com
      Cc: linux-mm@kvack.org
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Dave Hansen <dave.hansen@intel.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Andrea Arcangeli <aarcange@redhat.com>
      Link: https://lkml.kernel.org/r/1536922754-31379-1-git-send-email-joro@8bytes.org
      61a6bd83