1. 08 6月, 2019 1 次提交
  2. 05 6月, 2019 20 次提交
  3. 03 6月, 2019 1 次提交
    • J
      x86/power: Fix 'nosmt' vs hibernation triple fault during resume · ec527c31
      Jiri Kosina 提交于
      As explained in
      
      	0cc3cd21 ("cpu/hotplug: Boot HT siblings at least once")
      
      we always, no matter what, have to bring up x86 HT siblings during boot at
      least once in order to avoid first MCE bringing the system to its knees.
      
      That means that whenever 'nosmt' is supplied on the kernel command-line,
      all the HT siblings are as a result sitting in mwait or cpudile after
      going through the online-offline cycle at least once.
      
      This causes a serious issue though when a kernel, which saw 'nosmt' on its
      commandline, is going to perform resume from hibernation: if the resume
      from the hibernated image is successful, cr3 is flipped in order to point
      to the address space of the kernel that is being resumed, which in turn
      means that all the HT siblings are all of a sudden mwaiting on address
      which is no longer valid.
      
      That results in triple fault shortly after cr3 is switched, and machine
      reboots.
      
      Fix this by always waking up all the SMT siblings before initiating the
      'restore from hibernation' process; this guarantees that all the HT
      siblings will be properly carried over to the resumed kernel waiting in
      resume_play_dead(), and acted upon accordingly afterwards, based on the
      target kernel configuration.
      
      Symmetricaly, the resumed kernel has to push the SMT siblings to mwait
      again in case it has SMT disabled; this means it has to online all
      the siblings when resuming (so that they come out of hlt) and offline
      them again to let them reach mwait.
      
      Cc: 4.19+ <stable@vger.kernel.org> # v4.19+
      Debugged-by: NThomas Gleixner <tglx@linutronix.de>
      Fixes: 0cc3cd21 ("cpu/hotplug: Boot HT siblings at least once")
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      Acked-by: NPavel Machek <pavel@ucw.cz>
      Reviewed-by: NThomas Gleixner <tglx@linutronix.de>
      Reviewed-by: NJosh Poimboeuf <jpoimboe@redhat.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      ec527c31
  4. 31 5月, 2019 13 次提交
  5. 30 5月, 2019 1 次提交
    • R
      x86: intel_epb: Do not build when CONFIG_PM is unset · be1fcde6
      Rafael J. Wysocki 提交于
      Commit 9ed09853 ("x86: intel_epb: Take CONFIG_PM into account")
      prevented the majority of the Performance and Energy Bias Hint (EPB)
      handling code from being built when CONFIG_PM is unset to fix a
      regression introduced by commit b9c273ba ("PM / arch: x86:
      MSR_IA32_ENERGY_PERF_BIAS sysfs interface").
      
      In hindsight, however, it would be better to skip all of the EPB
      handling code for CONFIG_PM unset as there really is no reason for
      it to be there in that case.  Namely, if the EPB is not touched
      by the kernel at all with CONFIG_PM unset, there is no need to
      worry about modifying the EPB inadvertently on CPU online and since
      the system will not suspend or hibernate then, there is no need to
      worry about possible modifications of the EPB by the platform
      firmware during system-wide PM transitions.
      
      For this reason, revert the changes made by commit 9ed09853
      and only allow intel_epb.o to be built when CONFIG_PM is set.
      
      Note that this changes the behavior of the kernels built with
      CONFIG_PM unset as they will not modify the EPB on boot if it is
      zero initially any more, so it is not a fix strictly speaking, but
      users building their kernels with CONFIG_PM unset really should not
      expect them to take energy efficiency into account.  Moreover, if
      CONFIG_PM is unset for performance reasons, leaving EPB as set
      initially by the platform firmware will actually be consistent
      with the user's expectations.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NIngo Molnar <mingo@kernel.org>
      be1fcde6
  6. 28 5月, 2019 1 次提交
    • T
      KVM: s390: Do not report unusabled IDs via KVM_CAP_MAX_VCPU_ID · a86cb413
      Thomas Huth 提交于
      KVM_CAP_MAX_VCPU_ID is currently always reporting KVM_MAX_VCPU_ID on all
      architectures. However, on s390x, the amount of usable CPUs is determined
      during runtime - it is depending on the features of the machine the code
      is running on. Since we are using the vcpu_id as an index into the SCA
      structures that are defined by the hardware (see e.g. the sca_add_vcpu()
      function), it is not only the amount of CPUs that is limited by the hard-
      ware, but also the range of IDs that we can use.
      Thus KVM_CAP_MAX_VCPU_ID must be determined during runtime on s390x, too.
      So the handling of KVM_CAP_MAX_VCPU_ID has to be moved from the common
      code into the architecture specific code, and on s390x we have to return
      the same value here as for KVM_CAP_MAX_VCPUS.
      This problem has been discovered with the kvm_create_max_vcpus selftest.
      With this change applied, the selftest now passes on s390x, too.
      Reviewed-by: NAndrew Jones <drjones@redhat.com>
      Reviewed-by: NCornelia Huck <cohuck@redhat.com>
      Reviewed-by: NDavid Hildenbrand <david@redhat.com>
      Signed-off-by: NThomas Huth <thuth@redhat.com>
      Message-Id: <20190523164309.13345-9-thuth@redhat.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      a86cb413
  7. 25 5月, 2019 3 次提交