1. 04 May, 2022 2 commits
  2. 05 Apr, 2022 2 commits
    • Ammar Faizi's avatar
      x86/delay: Fix the wrong asm constraint in delay_loop() · b86eb740
      Ammar Faizi authored
      The asm constraint does not reflect the fact that the asm statement can
      modify the value of the local variable loops. Which it does.
      
      Specifying the wrong constraint may lead to undefined behavior, it may
      clobber random stuff (e.g. local variable, important temporary value in
      regs, etc.). This is especially dangerous when the compiler decides to
      inline the function and since it doesn't know that the value gets
      modified, it might decide to use it from a register directly without
      reloading it.
      
      Change the constraint to "+a" to denote that the first argument is an
      input and an output argument.
      
        [ bp: Fix typo, massage commit message. ]
      
      Fixes: e01b70ef ("x86: fix bug in arch/i386/lib/delay.c file, delay_loop function")
      Signed-off-by: default avatarAmmar Faizi <ammarfaizi2@gnuweeb.org>
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Link: https://lore.kernel.org/r/20220329104705.65256-2-ammarfaizi2@gnuweeb.org
      b86eb740
    • Muralidhara M K's avatar
      x86/amd_nb: Unexport amd_cache_northbridges() · e1907d37
      Muralidhara M K authored
      amd_cache_northbridges() is exported by amd_nb.c and is called by
      amd64-agp.c and amd64_edac.c modules at module_init() time so that NB
      descriptors are properly cached before those drivers can use them.
      
      However, the init_amd_nbs() initcall already does call
      amd_cache_northbridges() unconditionally and thus makes sure the NB
      descriptors are enumerated.
      
      That initcall is a fs_initcall type which is on the 5th group (starting
      from 0) of initcalls that gets run in increasing numerical order by the
      init code.
      
      The module_init() call is turned into an __initcall() in the MODULE=n
      case and those are device-level initcalls, i.e., group 6.
      
      Therefore, the northbridges caching is already finished by the time
      module initialization starts and thus the correct initialization order
      is retained.
      
      Unexport amd_cache_northbridges(), update dependent modules to
      call amd_nb_num() instead. While at it, simplify the checks in
      amd_cache_northbridges().
      
        [ bp: Heavily massage and *actually* explain why the change is ok. ]
      Signed-off-by: default avatarMuralidhara M K <muralimk@amd.com>
      Signed-off-by: default avatarNaveen Krishna Chatradhi <nchatrad@amd.com>
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Link: https://lore.kernel.org/r/20220324122729.221765-1-nchatrad@amd.com
      e1907d37
  3. 03 Apr, 2022 8 commits
  4. 02 Apr, 2022 28 commits