1. 17 Aug, 2021 6 commits
    • Lai Jiangshan's avatar
      workqueue: Remove unused WORK_NO_COLOR · bdb0a654
      Lai Jiangshan authored
      WORK_NO_COLOR has no user now, just remove it.
      Signed-off-by: default avatarLai Jiangshan <laijs@linux.alibaba.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      bdb0a654
    • Lai Jiangshan's avatar
      workqueue: Assign a color to barrier work items · d812796e
      Lai Jiangshan authored
      There was no strong reason to or not to flush barrier work items in
      flush_workqueue().  And we have to make barrier work items not participate
      in nr_active so we had been using WORK_NO_COLOR for them which also makes
      them can't be flushed by flush_workqueue().
      
      And the users of flush_workqueue() often do not intend to wait barrier work
      items issued by flush_work().  That made the choice sound perfect.
      
      But barrier work items have reference to internal structure (pool_workqueue)
      and the worker thread[s] is/are still busy for the workqueue user when the
      barrrier work items are not done.  So it is reasonable to make flush_workqueue()
      also watch for flush_work() to make it more robust.
      
      And a problem[1] reported by Li Zhe shows that we need such robustness.
      The warning logs are listed below:
      
      WARNING: CPU: 0 PID: 19336 at kernel/workqueue.c:4430 destroy_workqueue+0x11a/0x2f0
      *****
      destroy_workqueue: test_workqueue9 has the following busy pwq
        pwq 4: cpus=2 node=0 flags=0x0 nice=0 active=0/1 refcnt=2
            in-flight: 5658:wq_barrier_func
      Showing busy workqueues and worker pools:
      *****
      
      It shows that even after drain_workqueue() returns, the barrier work item
      is still in flight and the pwq (and a worker) is still busy on it.
      
      The problem is caused by flush_workqueue() not watching flush_work():
      
      Thread A				Worker
      					/* normal work item with linked */
      					process_scheduled_works()
      destroy_workqueue()			  process_one_work()
        drain_workqueue()			    /* run normal work item */
      				 /--	    pwq_dec_nr_in_flight()
          flush_workqueue()	    <---/
      		/* the last normal work item is done */
        sanity_check				  process_one_work()
      				       /--  raw_spin_unlock_irq(&pool->lock)
          raw_spin_lock_irq(&pool->lock)  <-/     /* maybe preempt */
          *WARNING*				    wq_barrier_func()
      					    /* maybe preempt by cond_resched() */
      
      Thread A can get the pool lock after the Worker unlocks the pool lock before
      running wq_barrier_func().  And if there is any preemption happen around
      wq_barrier_func(), destroy_workqueue()'s sanity check is more likely to
      get the lock and catch it.  (Note: preemption is not necessary to cause the bug,
      the unlocking is enough to possibly trigger the WARNING.)
      
      A simple solution might be just executing all linked barrier work items
      once without releasing pool lock after the head work item's
      pwq_dec_nr_in_flight().  But this solution has two problems:
      
        1) the head work item might also be barrier work item when the user-queued
           work item is cancelled. For example:
      	thread 1:		thread 2:
      	queue_work(wq, &my_work)
      	flush_work(&my_work)
      				cancel_work_sync(&my_work);
      	/* Neiter my_work nor the barrier work is scheduled. */
      				destroy_workqueue(wq);
      	/* This is an easier way to catch the WARNING. */
      
        2) there might be too much linked barrier work items and running them
           all once without releasing pool lock just causes trouble.
      
      The only solution is to make flush_workqueue() aslo watch barrier work
      items.  So we have to assign a color to these barrier work items which
      is the color of the head (user-queued) work item.
      
      Assigning a color doesn't cause any problem in ative management, because
      the prvious patch made barrier work items not participate in nr_active
      via WORK_STRUCT_INACTIVE rather than reliance on the (old) WORK_NO_COLOR.
      
      [1]: https://lore.kernel.org/lkml/20210812083814.32453-1-lizhe.67@bytedance.com/Reported-by: default avatarLi Zhe <lizhe.67@bytedance.com>
      Signed-off-by: default avatarLai Jiangshan <laijs@linux.alibaba.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      d812796e
    • Lai Jiangshan's avatar
      workqueue: Mark barrier work with WORK_STRUCT_INACTIVE · 018f3a13
      Lai Jiangshan authored
      Currently, WORK_NO_COLOR has two meanings:
      	Not participate in flushing
      	Not participate in nr_active
      
      And only non-barrier work items are marked with WORK_STRUCT_INACTIVE
      when they are in inactive_works list.  The barrier work items are not
      marked INACTIVE even linked in inactive_works list since these tail
      items are always moved together with the head work item.
      
      These definitions are simple, clean and practical. (Except a small
      blemish that only the first meaning of WORK_NO_COLOR is documented in
      include/linux/workqueue.h while both meanings are in workqueue.c)
      
      But dual-purpose WORK_NO_COLOR used for barrier work items has proven to
      be problematical[1].  Only the second purpose is obligatory.  So we plan
      to make barrier work items participate in flushing but keep them still
      not participating in nr_active.
      
      So the plan is to mark barrier work items inactive without using
      WORK_NO_COLOR in this patch so that we can assign a flushing color to
      them in next patch.
      
      The reasonable way is to add or reuse a bit in work data of the work
      item.  But adding a bit will double the size of pool_workqueue.
      
      Currently, WORK_STRUCT_INACTIVE is only used in try_to_grab_pending()
      for user-queued work items and try_to_grab_pending() can't work for
      barrier work items.  So we extend WORK_STRUCT_INACTIVE to also mark
      barrier work items no matter which list they are in because we don't
      need to determind which list a barrier work item is in.
      
      So the meaning of WORK_STRUCT_INACTIVE becomes just "the work items don't
      participate in nr_active" (no matter whether it is a barrier work item or
      a user-queued work item).  And WORK_STRUCT_INACTIVE for user-queued work
      items means they are in inactive_works list.
      
      This patch does it by setting WORK_STRUCT_INACTIVE for barrier work items
      in insert_wq_barrier() and checking WORK_STRUCT_INACTIVE first in
      pwq_dec_nr_in_flight().  And the meaning of WORK_NO_COLOR is reduced to
      only "not participating in flushing".
      
      There is no functionality change intended in this patch.  Because
      WORK_NO_COLOR+WORK_STRUCT_INACTIVE represents the previous WORK_NO_COLOR
      in meaning and try_to_grab_pending() doesn't use for barrier work items
      and avoids being confused by this extended WORK_STRUCT_INACTIVE.
      
      A bunch of comment for nr_active & WORK_STRUCT_INACTIVE is also added for
      documenting how WORK_STRUCT_INACTIVE works in nr_active management.
      
      [1]: https://lore.kernel.org/lkml/20210812083814.32453-1-lizhe.67@bytedance.com/Signed-off-by: default avatarLai Jiangshan <laijs@linux.alibaba.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      018f3a13
    • Lai Jiangshan's avatar
      workqueue: Change the code of calculating work_flags in insert_wq_barrier() · d21cece0
      Lai Jiangshan authored
      Add a local var @work_flags to calculate work_flags step by step, so that
      we don't need to squeeze several flags in only the last line of code.
      
      Parepare for next patch to add a bit to barrier work item's flag.  Not
      squshing this to next patch makes it clear that what it will have changed.
      
      No functional change intended.
      Signed-off-by: default avatarLai Jiangshan <laijs@linux.alibaba.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      d21cece0
    • Lai Jiangshan's avatar
      workqueue: Change arguement of pwq_dec_nr_in_flight() · c4560c2c
      Lai Jiangshan authored
      Make pwq_dec_nr_in_flight() use work_data rather just work_color.
      
      Prepare for later patch to get WORK_STRUCT_INACTIVE bit from work_data
      in pwq_dec_nr_in_flight().
      
      No functional change intended.
      Signed-off-by: default avatarLai Jiangshan <laijs@linux.alibaba.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      c4560c2c
    • Lai Jiangshan's avatar
      workqueue: Rename "delayed" (delayed by active management) to "inactive" · f97a4a1a
      Lai Jiangshan authored
      There are two kinds of "delayed" work items in workqueue subsystem.
      
      One is for timer-delayed work items which are visible to workqueue users.
      The other kind is for work items delayed by active management which can
      not be directly visible to workqueue users.  We mixed the word "delayed"
      for both kinds and caused somewhat ambiguity.
      
      This patch renames the later one (delayed by active management) to
      "inactive", because it is used for workqueue active management and
      most of its related symbols are named with "active" or "activate".
      
      All "delayed" and "DELAYED" are carefully checked and renamed one by
      one to avoid accidentally changing the name of the other kind for
      timer-delayed.
      
      No functional change intended.
      Signed-off-by: default avatarLai Jiangshan <laijs@linux.alibaba.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      f97a4a1a
  2. 09 Aug, 2021 3 commits
  3. 29 Jul, 2021 3 commits
    • Zhen Lei's avatar
      workqueue: Fix possible memory leaks in wq_numa_init() · f728c4a9
      Zhen Lei authored
      In error handling branch "if (WARN_ON(node == NUMA_NO_NODE))", the
      previously allocated memories are not released. Doing this before
      allocating memory eliminates memory leaks.
      
      tj: Note that the condition only occurs when the arch code is pretty broken
      and the WARN_ON might as well be BUG_ON().
      Signed-off-by: default avatarZhen Lei <thunder.leizhen@huawei.com>
      Reviewed-by: default avatarLai Jiangshan <jiangshanlai@gmail.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      f728c4a9
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm · 7e96bf47
      Linus Torvalds authored
      Pull kvm fixes from Paolo Bonzini:
       "ARM:
      
         - Fix MTE shared page detection
      
         - Enable selftest's use of PMU registers when asked to
      
        s390:
      
         - restore 5.13 debugfs names
      
        x86:
      
         - fix sizes for vcpu-id indexed arrays
      
         - fixes for AMD virtualized LAPIC (AVIC)
      
         - other small bugfixes
      
        Generic:
      
         - access tracking performance test
      
         - dirty_log_perf_test command line parsing fix
      
         - Fix selftest use of obsolete pthread_yield() in favour of
           sched_yield()
      
         - use cpu_relax when halt polling
      
         - fixed missing KVM_CLEAR_DIRTY_LOG compat ioctl"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
        KVM: add missing compat KVM_CLEAR_DIRTY_LOG
        KVM: use cpu_relax when halt polling
        KVM: SVM: use vmcb01 in svm_refresh_apicv_exec_ctrl
        KVM: SVM: tweak warning about enabled AVIC on nested entry
        KVM: SVM: svm_set_vintr don't warn if AVIC is active but is about to be deactivated
        KVM: s390: restore old debugfs names
        KVM: SVM: delay svm_vcpu_init_msrpm after svm->vmcb is initialized
        KVM: selftests: Introduce access_tracking_perf_test
        KVM: selftests: Fix missing break in dirty_log_perf_test arg parsing
        x86/kvm: fix vcpu-id indexed array sizes
        KVM: x86: Check the right feature bit for MSR_KVM_ASYNC_PF_ACK access
        docs: virt: kvm: api.rst: replace some characters
        KVM: Documentation: Fix KVM_CAP_ENFORCE_PV_FEATURE_CPUID name
        KVM: nSVM: Swap the parameter order for svm_copy_vmrun_state()/svm_copy_vmloadsave_state()
        KVM: nSVM: Rename nested_svm_vmloadsave() to svm_copy_vmloadsave_state()
        KVM: arm64: selftests: get-reg-list: actually enable pmu regs in pmu sublist
        KVM: selftests: change pthread_yield to sched_yield
        KVM: arm64: Fix detection of shared VMAs on guest fault
      7e96bf47
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu · 2b99c470
      Linus Torvalds authored
      Pull m68knommu fix from Greg Ungerer:
       "A single compile time fix"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu:
        m68k/coldfire: change pll var. to clk_pll
      2b99c470
  4. 28 Jul, 2021 6 commits
  5. 27 Jul, 2021 13 commits
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma · 7d549995
      Linus Torvalds authored
      Pull rdma fixes from Jason Gunthorpe:
       "Nothing very exciting here, mainly just a bunch of irdma fixes. irdma
        is a new driver this cycle so it to be expected.
      
         - Many more irdma fixups from bots/etc
      
         - bnxt_re regression in their counters from a FW upgrade
      
         - User triggerable memory leak in rxe"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma:
        RDMA/irdma: Change returned type of irdma_setup_virt_qp to void
        RDMA/irdma: Change the returned type of irdma_set_hw_rsrc to void
        RDMA/irdma: change the returned type of irdma_sc_repost_aeq_entries to void
        RDMA/irdma: Check vsi pointer before using it
        RDMA/rxe: Fix memory leak in error path code
        RDMA/irdma: Change the returned type to void
        RDMA/irdma: Make spdxcheck.py happy
        RDMA/irdma: Fix unused variable total_size warning
        RDMA/bnxt_re: Fix stats counters
      7d549995
    • Linus Torvalds's avatar
      Merge branch 'for-5.14-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup · 51bbe7eb
      Linus Torvalds authored
      Pull cgroup fix from Tejun Heo:
       "Fix leak of filesystem context root which is triggered by LTP.
      
        Not too likely to be a problem in non-testing environments"
      
      * 'for-5.14-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup:
        cgroup1: fix leaked context root causing sporadic NULL deref in LTP
      51bbe7eb
    • Paolo Bonzini's avatar
      KVM: add missing compat KVM_CLEAR_DIRTY_LOG · 8750f9bb
      Paolo Bonzini authored
      The arguments to the KVM_CLEAR_DIRTY_LOG ioctl include a pointer,
      therefore it needs a compat ioctl implementation.  Otherwise,
      32-bit userspace fails to invoke it on 64-bit kernels; for x86
      it might work fine by chance if the padding is zero, but not
      on big-endian architectures.
      
      Reported-by: Thomas Sattler
      Cc: stable@vger.kernel.org
      Fixes: 2a31b9db ("kvm: introduce manual dirty log reprotect")
      Reviewed-by: default avatarPeter Xu <peterx@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      8750f9bb
    • Li RongQing's avatar
      KVM: use cpu_relax when halt polling · 74775654
      Li RongQing authored
      SMT siblings share caches and other hardware, and busy halt polling
      will degrade its sibling performance if its sibling is working
      
      Sean Christopherson suggested as below:
      
      "Rather than disallowing halt-polling entirely, on x86 it should be
      sufficient to simply have the hardware thread yield to its sibling(s)
      via PAUSE.  It probably won't get back all performance, but I would
      expect it to be close.
      This compiles on all KVM architectures, and AFAICT the intended usage
      of cpu_relax() is identical for all architectures."
      Suggested-by: default avatarSean Christopherson <seanjc@google.com>
      Signed-off-by: default avatarLi RongQing <lirongqing@baidu.com>
      Message-Id: <20210727111247.55510-1-lirongqing@baidu.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      74775654
    • Maxim Levitsky's avatar
      KVM: SVM: use vmcb01 in svm_refresh_apicv_exec_ctrl · 5868b822
      Maxim Levitsky authored
      Currently when SVM is enabled in guest CPUID, AVIC is inhibited as soon
      as the guest CPUID is set.
      
      AVIC happens to be fully disabled on all vCPUs by the time any guest
      entry starts (if after migration the entry can be nested).
      
      The reason is that currently we disable avic right away on vCPU from which
      the kvm_request_apicv_update was called and for this case, it happens to be
      called on all vCPUs (by svm_vcpu_after_set_cpuid).
      
      After we stop doing this, AVIC will end up being disabled only when
      KVM_REQ_APICV_UPDATE is processed which is after we done switching to the
      nested guest.
      
      Fix this by just using vmcb01 in svm_refresh_apicv_exec_ctrl for avic
      (which is a right thing to do anyway).
      Signed-off-by: default avatarMaxim Levitsky <mlevitsk@redhat.com>
      Message-Id: <20210713142023.106183-4-mlevitsk@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      5868b822
    • Maxim Levitsky's avatar
      KVM: SVM: tweak warning about enabled AVIC on nested entry · feea0136
      Maxim Levitsky authored
      It is possible that AVIC was requested to be disabled but
      not yet disabled, e.g if the nested entry is done right
      after svm_vcpu_after_set_cpuid.
      Signed-off-by: default avatarMaxim Levitsky <mlevitsk@redhat.com>
      Message-Id: <20210713142023.106183-3-mlevitsk@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      feea0136
    • Maxim Levitsky's avatar
      KVM: SVM: svm_set_vintr don't warn if AVIC is active but is about to be deactivated · f1577ab2
      Maxim Levitsky authored
      It is possible for AVIC inhibit and AVIC active state to be mismatched.
      Currently we disable AVIC right away on vCPU which started the AVIC inhibit
      request thus this warning doesn't trigger but at least in theory,
      if svm_set_vintr is called at the same time on multiple vCPUs,
      the warning can happen.
      Signed-off-by: default avatarMaxim Levitsky <mlevitsk@redhat.com>
      Message-Id: <20210713142023.106183-2-mlevitsk@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      f1577ab2
    • Christian Borntraeger's avatar
      KVM: s390: restore old debugfs names · bb000f64
      Christian Borntraeger authored
      commit bc9e9e67 ("KVM: debugfs: Reuse binary stats descriptors")
      did replace the old definitions with the binary ones. While doing that
      it missed that some files are names different than the counters. This
      is especially important for kvm_stat which does have special handling
      for counters named instruction_*.
      
      Fixes: commit bc9e9e67 ("KVM: debugfs: Reuse binary stats descriptors")
      CC: Jing Zhang <jingzhangos@google.com>
      Signed-off-by: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
      Message-Id: <20210726150108.5603-1-borntraeger@de.ibm.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      bb000f64
    • Paolo Bonzini's avatar
      KVM: SVM: delay svm_vcpu_init_msrpm after svm->vmcb is initialized · 3fa5e8fd
      Paolo Bonzini authored
      Right now, svm_hv_vmcb_dirty_nested_enlightenments has an incorrect
      dereference of vmcb->control.reserved_sw before the vmcb is checked
      for being non-NULL.  The compiler is usually sinking the dereference
      after the check; instead of doing this ourselves in the source,
      ensure that svm_hv_vmcb_dirty_nested_enlightenments is only called
      with a non-NULL VMCB.
      Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Cc: Vineeth Pillai <viremana@linux.microsoft.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      [Untested for now due to issues with my AMD machine. - Paolo]
      3fa5e8fd
    • David Matlack's avatar
      KVM: selftests: Introduce access_tracking_perf_test · c33e05d9
      David Matlack authored
      This test measures the performance effects of KVM's access tracking.
      Access tracking is driven by the MMU notifiers test_young, clear_young,
      and clear_flush_young. These notifiers do not have a direct userspace
      API, however the clear_young notifier can be triggered by marking a
      pages as idle in /sys/kernel/mm/page_idle/bitmap. This test leverages
      that mechanism to enable access tracking on guest memory.
      
      To measure performance this test runs a VM with a configurable number of
      vCPUs that each touch every page in disjoint regions of memory.
      Performance is measured in the time it takes all vCPUs to finish
      touching their predefined region.
      
      Example invocation:
      
        $ ./access_tracking_perf_test -v 8
        Testing guest mode: PA-bits:ANY, VA-bits:48,  4K pages
        guest physical test memory offset: 0xffdfffff000
      
        Populating memory             : 1.337752570s
        Writing to populated memory   : 0.010177640s
        Reading from populated memory : 0.009548239s
        Mark memory idle              : 23.973131748s
        Writing to idle memory        : 0.063584496s
        Mark memory idle              : 24.924652964s
        Reading from idle memory      : 0.062042814s
      
      Breaking down the results:
      
       * "Populating memory": The time it takes for all vCPUs to perform the
         first write to every page in their region.
      
       * "Writing to populated memory" / "Reading from populated memory": The
         time it takes for all vCPUs to write and read to every page in their
         region after it has been populated. This serves as a control for the
         later results.
      
       * "Mark memory idle": The time it takes for every vCPU to mark every
         page in their region as idle through page_idle.
      
       * "Writing to idle memory" / "Reading from idle memory": The time it
         takes for all vCPUs to write and read to every page in their region
         after it has been marked idle.
      
      This test should be portable across architectures but it is only enabled
      for x86_64 since that's all I have tested.
      Reviewed-by: default avatarBen Gardon <bgardon@google.com>
      Signed-off-by: default avatarDavid Matlack <dmatlack@google.com>
      Message-Id: <20210713220957.3493520-7-dmatlack@google.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      c33e05d9
    • David Matlack's avatar
      KVM: selftests: Fix missing break in dirty_log_perf_test arg parsing · 15b7b737
      David Matlack authored
      There is a missing break statement which causes a fallthrough to the
      next statement where optarg will be null and a segmentation fault will
      be generated.
      
      Fixes: 9e965bb7 ("KVM: selftests: Add backing src parameter to dirty_log_perf_test")
      Reviewed-by: default avatarBen Gardon <bgardon@google.com>
      Signed-off-by: default avatarDavid Matlack <dmatlack@google.com>
      Message-Id: <20210713220957.3493520-6-dmatlack@google.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      15b7b737
    • Juergen Gross's avatar
      x86/kvm: fix vcpu-id indexed array sizes · 76b4f357
      Juergen Gross authored
      KVM_MAX_VCPU_ID is the maximum vcpu-id of a guest, and not the number
      of vcpu-ids. Fix array indexed by vcpu-id to have KVM_MAX_VCPU_ID+1
      elements.
      
      Note that this is currently no real problem, as KVM_MAX_VCPU_ID is
      an odd number, resulting in always enough padding being available at
      the end of those arrays.
      
      Nevertheless this should be fixed in order to avoid rare problems in
      case someone is using an even number for KVM_MAX_VCPU_ID.
      Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
      Message-Id: <20210701154105.23215-2-jgross@suse.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      76b4f357
    • Linus Torvalds's avatar
      Merge branch 'for-5.14-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq · 82d712f6
      Linus Torvalds authored
      Pull workqueue fix from Tejun Heo:
       "Fix a use-after-free in allocation failure handling path"
      
      * 'for-5.14-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq:
        workqueue: fix UAF in pwq_unbound_release_workfn()
      82d712f6
  6. 26 Jul, 2021 5 commits
  7. 25 Jul, 2021 4 commits
    • Randy Dunlap's avatar
      m68k/coldfire: change pll var. to clk_pll · 9f668611
      Randy Dunlap authored
      DEFINE_CLK() makes the variable name be clk_xyz, so variable
      'pll' should instead be 'clk_pll'.
      
      In file included from ../arch/m68k/coldfire/m525x.c:12:
      ../arch/m68k/coldfire/m525x.c:29:30: error: 'pll' undeclared here (not in a function)
         29 |  CLKDEV_INIT(NULL, "pll.0", &pll),
            |                              ^~~
      ../include/linux/clkdev.h:30:10: note: in definition of macro 'CLKDEV_INIT'
         30 |   .clk = c, \
            |          ^
      In file included from ../arch/m68k/coldfire/m525x.c:21:
      ../arch/m68k/include/asm/mcfclk.h:43:27: warning: 'clk_pll' defined but not used [-Wunused-variable]
         43 |         static struct clk clk_##clk_ref = { \
            |                           ^~~~
      ../arch/m68k/coldfire/m525x.c:25:1: note: in expansion of macro 'DEFINE_CLK'
         25 | DEFINE_CLK(pll, "pll.0", MCF_CLK);
            | ^~~~~~~~~~
      
      Fixes: 63aadb77 ("m68k: coldfire: use clkdev_lookup on most coldfire")
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Cc: Greg Ungerer <gerg@linux-m68k.org>
      Cc: linux-m68k@lists.linux-m68k.org
      Cc: uclinux-dev@uclinux.org
      Cc: Arnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarGreg Ungerer <gerg@linux-m68k.org>
      9f668611
    • Linus Torvalds's avatar
      Linux 5.14-rc3 · ff117646
      Linus Torvalds authored
      ff117646
    • Linus Torvalds's avatar
      smpboot: fix duplicate and misplaced inlining directive · a1833a54
      Linus Torvalds authored
      gcc doesn't care, but clang quite reasonably pointed out that the recent
      commit e9ba16e6 ("smpboot: Mark idle_init() as __always_inlined to
      work around aggressive compiler un-inlining") did some really odd
      things:
      
          kernel/smpboot.c:50:20: warning: duplicate 'inline' declaration specifier [-Wduplicate-decl-specifier]
          static inline void __always_inline idle_init(unsigned int cpu)
                             ^
      
      which not only has that duplicate inlining specifier, but the new
      __always_inline was put in the wrong place of the function definition.
      
      We put the storage class specifiers (ie things like "static" and
      "extern") first, and the type information after that.  And while the
      compiler may not care, we put the inline specifier before the types.
      
      So it should be just
      
          static __always_inline void idle_init(unsigned int cpu)
      
      instead.
      
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      a1833a54
    • Linus Torvalds's avatar
      Merge tag 'powerpc-5.14-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · 3c0ce149
      Linus Torvalds authored
      Pull powerpc fixes from Michael Ellerman:
      
       - Fix guest to host memory corruption in H_RTAS due to missing nargs
         check.
      
       - Fix guest triggerable host crashes due to bad handling of nested
         guest TM state.
      
       - Fix possible crashes due to incorrect reference counting in
         kvm_arch_vcpu_ioctl().
      
       - Two commits fixing some regressions in KVM transactional memory
         handling introduced by the recent rework of the KVM code.
      
      Thanks to Nicholas Piggin, Alexey Kardashevskiy, and Michael Neuling.
      
      * tag 'powerpc-5.14-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
        KVM: PPC: Book3S HV Nested: Sanitise H_ENTER_NESTED TM state
        KVM: PPC: Book3S: Fix H_RTAS rets buffer overflow
        KVM: PPC: Fix kvm_arch_vcpu_ioctl vcpu_load leak
        KVM: PPC: Book3S: Fix CONFIG_TRANSACTIONAL_MEM=n crash
        KVM: PPC: Book3S HV P9: Fix guest TM support
      3c0ce149