Skip to content
Snippets Groups Projects
  1. Feb 02, 2024
    • Shivaprasad G Bhat's avatar
      powerpc: iommu: Bring back table group release_ownership() call · d2d00e15
      Shivaprasad G Bhat authored
      
      The commit 2ad56efa ("powerpc/iommu: Setup a default domain and
      remove set_platform_dma_ops") refactored the code removing the
      set_platform_dma_ops(). It missed out the table group
      release_ownership() call which would have got called otherwise
      during the guest shutdown via vfio_group_detach_container(). On
      PPC64, this particular call actually sets up the 32-bit TCE table,
      and enables the 64-bit DMA bypass etc. Now after guest shutdown,
      the subsequent host driver (e.g megaraid-sas) probe post unbind
      from vfio-pci fails like,
      
      megaraid_sas 0031:01:00.0: Warning: IOMMU dma not supported: mask 0x7fffffffffffffff, table unavailable
      megaraid_sas 0031:01:00.0: Warning: IOMMU dma not supported: mask 0xffffffff, table unavailable
      megaraid_sas 0031:01:00.0: Failed to set DMA mask
      megaraid_sas 0031:01:00.0: Failed from megasas_init_fw 6539
      
      The patch brings back the call to table_group release_ownership()
      call when switching back to PLATFORM domain from BLOCKED, while
      also separates the domain_ops for both.
      
      Fixes: 2ad56efa ("powerpc/iommu: Setup a default domain and remove set_platform_dma_ops")
      Signed-off-by: default avatarShivaprasad G Bhat <sbhat@linux.ibm.com>
      Reviewed-by: default avatarJason Gunthorpe <jgg@nvidia.com>
      Link: https://lore.kernel.org/r/170628173462.3742.18330000394415935845.stgit@ltcd48-lp2.aus.stglab.ibm.com
      
      
      Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
      d2d00e15
  2. Jan 31, 2024
  3. Jan 30, 2024
  4. Jan 28, 2024
  5. Jan 27, 2024
    • Nathan Chancellor's avatar
      um: Fix adding '-no-pie' for clang · 846cfbee
      Nathan Chancellor authored
      The kernel builds with -fno-PIE, so commit 883354af ("um: link
      vmlinux with -no-pie") added the compiler linker flag '-no-pie' via
      cc-option because '-no-pie' was only supported in GCC 6.1.0 and newer.
      
      While this works for GCC, this does not work for clang because cc-option
      uses '-c', which stops the pipeline right before linking, so '-no-pie'
      is unconsumed and clang warns, causing cc-option to fail just as it
      would if the option was entirely unsupported:
      
        $ clang -Werror -no-pie -c -o /dev/null -x c /dev/null
        clang-16: error: argument unused during compilation: '-no-pie' [-Werror,-Wunused-command-line-argument]
      
      A recent version of clang exposes this because it generates a relocation
      under '-mcmodel=large' that is not supported in PIE mode:
      
        /usr/sbin/ld: init/main.o: relocation R_X86_64_32 against symbol `saved_command_line' can not be used when making a PIE object; recompile with -fPIE
        /usr/sbin/ld: failed to set dynamic section sizes: bad value
        clang: error: linker command failed with exit code 1 (use -v to see invocation)
      
      Remove the cc-option check altogether. It is wasteful to invoke the
      compiler to check for '-no-pie' because only one supported compiler
      version does not support it, GCC 5.x (as it is supported with the
      minimum version of clang and GCC 6.1.0+). Use a combination of the
      gcc-min-version macro and CONFIG_CC_IS_CLANG to unconditionally add
      '-no-pie' with CONFIG_LD_SCRIPT_DYN=y, so that it is enabled with all
      compilers that support this. Furthermore, using gcc-min-version can help
      turn this back into
      
        LINK-$(CONFIG_LD_SCRIPT_DYN) += -no-pie
      
      when the minimum version of GCC is bumped past 6.1.0.
      
      Cc: stable@vger.kernel.org
      Closes: https://github.com/ClangBuiltLinux/linux/issues/1982
      
      
      Signed-off-by: default avatarNathan Chancellor <nathan@kernel.org>
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      846cfbee
    • Xi Ruoyao's avatar
      mips: Call lose_fpu(0) before initializing fcr31 in mips_set_personality_nan · 59be5c35
      Xi Ruoyao authored
      If we still own the FPU after initializing fcr31, when we are preempted
      the dirty value in the FPU will be read out and stored into fcr31,
      clobbering our setting.  This can cause an improper floating-point
      environment after execve().  For example:
      
          zsh% cat measure.c
          #include <fenv.h>
          int main() { return fetestexcept(FE_INEXACT); }
          zsh% cc measure.c -o measure -lm
          zsh% echo $((1.0/3)) # raising FE_INEXACT
          0.33333333333333331
          zsh% while ./measure; do ; done
          (stopped in seconds)
      
      Call lose_fpu(0) before setting fcr31 to prevent this.
      
      Closes: https://lore.kernel.org/linux-mips/7a6aa1bbdbbe2e63ae96ff163fab0349f58f1b9e.camel@xry111.site/
      
      
      Fixes: 9b26616c ("MIPS: Respect the ISA level in FCSR handling")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarXi Ruoyao <xry111@xry111.site>
      Signed-off-by: default avatarThomas Bogendoerfer <tsbogend@alpha.franken.de>
      59be5c35
    • Huang Pei's avatar
      MIPS: loongson64: set nid for reserved memblock region · 822df315
      Huang Pei authored
      
      Commit 61167ad5("mm: pass nid to reserve_bootmem_region()") reveals
      that reserved memblock regions have no valid node id set, just set it
      right since loongson64 firmware makes it clear in memory layout info.
      
      This works around booting failure on 3A1000+ since commit 61167ad5
      ("mm: pass nid to reserve_bootmem_region()") under
      CONFIG_DEFERRED_STRUCT_PAGE_INIT.
      
      Signed-off-by: default avatarHuang Pei <huangpei@loongson.cn>
      Signed-off-by: default avatarThomas Bogendoerfer <tsbogend@alpha.franken.de>
      822df315
    • Thomas Bogendoerfer's avatar
  6. Jan 26, 2024
  7. Jan 25, 2024
  8. Jan 24, 2024
  9. Jan 23, 2024
  10. Jan 22, 2024
Loading