1. 03 11月, 2022 5 次提交
  2. 02 11月, 2022 1 次提交
  3. 08 10月, 2022 3 次提交
  4. 20 9月, 2022 2 次提交
  5. 01 9月, 2022 1 次提交
  6. 19 7月, 2022 1 次提交
    • S
      KVM: x86/mmu: Resolve nx_huge_pages when kvm.ko is loaded · 85fc72e3
      Sean Christopherson 提交于
      stable inclusion
      from stable-v5.10.112
      commit 342454231ee5f2c2782f5510cab2e7a968486fef
      category: bugfix
      bugzilla: https://gitee.com/openeuler/kernel/issues/I5HL0X
      
      Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=342454231ee5f2c2782f5510cab2e7a968486fef
      
      --------------------------------
      
      commit 1d0e8480 upstream.
      
      Resolve nx_huge_pages to true/false when kvm.ko is loaded, leaving it as
      -1 is technically undefined behavior when its value is read out by
      param_get_bool(), as boolean values are supposed to be '0' or '1'.
      
      Alternatively, KVM could define a custom getter for the param, but the
      auto value doesn't depend on the vendor module in any way, and printing
      "auto" would be unnecessarily unfriendly to the user.
      
      In addition to fixing the undefined behavior, resolving the auto value
      also fixes the scenario where the auto value resolves to N and no vendor
      module is loaded.  Previously, -1 would result in Y being printed even
      though KVM would ultimately disable the mitigation.
      
      Rename the existing MMU module init/exit helpers to clarify that they're
      invoked with respect to the vendor module, and add comments to document
      why KVM has two separate "module init" flows.
      
        =========================================================================
        UBSAN: invalid-load in kernel/params.c:320:33
        load of value 255 is not a valid value for type '_Bool'
        CPU: 6 PID: 892 Comm: tail Not tainted 5.17.0-rc3+ #799
        Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015
        Call Trace:
         <TASK>
         dump_stack_lvl+0x34/0x44
         ubsan_epilogue+0x5/0x40
         __ubsan_handle_load_invalid_value.cold+0x43/0x48
         param_get_bool.cold+0xf/0x14
         param_attr_show+0x55/0x80
         module_attr_show+0x1c/0x30
         sysfs_kf_seq_show+0x93/0xc0
         seq_read_iter+0x11c/0x450
         new_sync_read+0x11b/0x1a0
         vfs_read+0xf0/0x190
         ksys_read+0x5f/0xe0
         do_syscall_64+0x3b/0xc0
         entry_SYSCALL_64_after_hwframe+0x44/0xae
         </TASK>
        =========================================================================
      
      Fixes: b8e8c830 ("kvm: mmu: ITLB_MULTIHIT mitigation")
      Cc: stable@vger.kernel.org
      Reported-by: NBruno Goncalves <bgoncalv@redhat.com>
      Reported-by: NJan Stancek <jstancek@redhat.com>
      Signed-off-by: NSean Christopherson <seanjc@google.com>
      Message-Id: <20220331221359.3912754-1-seanjc@google.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
      Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
      85fc72e3
  7. 18 7月, 2022 1 次提交
  8. 08 7月, 2022 2 次提交
  9. 06 7月, 2022 1 次提交
  10. 28 6月, 2022 1 次提交
  11. 07 6月, 2022 1 次提交
  12. 10 5月, 2022 2 次提交
  13. 28 4月, 2022 1 次提交
  14. 19 4月, 2022 2 次提交
  15. 14 1月, 2022 1 次提交
  16. 07 1月, 2022 1 次提交
  17. 30 12月, 2021 3 次提交
  18. 15 11月, 2021 2 次提交
  19. 19 10月, 2021 3 次提交
  20. 15 10月, 2021 4 次提交
  21. 13 10月, 2021 1 次提交
  22. 06 7月, 2021 1 次提交