]> Git Repo - linux.git/commitdiff
Merge tag 'loongarch-6.10' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuaca...
authorLinus Torvalds <[email protected]>
Wed, 22 May 2024 16:43:07 +0000 (09:43 -0700)
committerLinus Torvalds <[email protected]>
Wed, 22 May 2024 16:43:07 +0000 (09:43 -0700)
Pull LoongArch updates from Huacai Chen:

 - Select some options in Kconfig

 - Give a chance to build with !CONFIG_SMP

 - Switch to use built-in rustc target

 - Add new supported device nodes to dts

 - Some bug fixes and other small changes

 - Update the default config file

* tag 'loongarch-6.10' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson:
  LoongArch: Update Loongson-3 default config file
  LoongArch: dts: Add new supported device nodes to Loongson-2K2000
  LoongArch: dts: Add new supported device nodes to Loongson-2K0500
  LoongArch: dts: Remove "disabled" state of clock controller node
  LoongArch: rust: Switch to use built-in rustc target
  LoongArch: Fix callchain parse error with kernel tracepoint events again
  LoongArch: Give a chance to build with !CONFIG_SMP
  LoongArch: Select THP_SWAP if HAVE_ARCH_TRANSPARENT_HUGEPAGE
  LoongArch: Select ARCH_WANT_DEFAULT_BPF_JIT
  LoongArch: Select ARCH_SUPPORTS_INT128 if CC_HAS_INT128
  LoongArch: Select ARCH_HAS_FAST_MULTIPLIER

1  2 
arch/loongarch/Kconfig
arch/loongarch/configs/loongson3_defconfig
arch/loongarch/include/asm/smp.h
rust/Makefile
scripts/generate_rust_target.rs

diff --combined arch/loongarch/Kconfig
index 4bda59525a1340ab51051c4ae708efcbf1b2eaca,73246b21aae840eb91dcee334b78e0ac1751600b..a2774ad5e916081f1b91d6037bb59a7cb62fb6c5
@@@ -16,6 -16,7 +16,7 @@@ config LOONGARC
        select ARCH_HAS_ACPI_TABLE_UPGRADE      if ACPI
        select ARCH_HAS_CPU_FINALIZE_INIT
        select ARCH_HAS_CURRENT_STACK_POINTER
+       select ARCH_HAS_FAST_MULTIPLIER
        select ARCH_HAS_FORTIFY_SOURCE
        select ARCH_HAS_KCOV
        select ARCH_HAS_NMI_SAFE_THIS_CPU_OPS
@@@ -56,6 -57,7 +57,7 @@@
        select ARCH_SUPPORTS_ACPI
        select ARCH_SUPPORTS_ATOMIC_RMW
        select ARCH_SUPPORTS_HUGETLBFS
+       select ARCH_SUPPORTS_INT128 if CC_HAS_INT128
        select ARCH_SUPPORTS_LTO_CLANG
        select ARCH_SUPPORTS_LTO_CLANG_THIN
        select ARCH_SUPPORTS_NUMA_BALANCING
        select ARCH_USE_CMPXCHG_LOCKREF
        select ARCH_USE_QUEUED_RWLOCKS
        select ARCH_USE_QUEUED_SPINLOCKS
+       select ARCH_WANT_DEFAULT_BPF_JIT
        select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT
        select ARCH_WANT_LD_ORPHAN_WARN
        select ARCH_WANT_OPTIMIZE_HUGETLB_VMEMMAP
        select ARCH_WANTS_NO_INSTR
+       select ARCH_WANTS_THP_SWAP if HAVE_ARCH_TRANSPARENT_HUGEPAGE
        select BUILDTIME_TABLE_SORT
        select COMMON_CLK
        select CPU_PM
        select HAVE_EBPF_JIT
        select HAVE_EFFICIENT_UNALIGNED_ACCESS if !ARCH_STRICT_ALIGN
        select HAVE_EXIT_THREAD
 -      select HAVE_FAST_GUP
 +      select HAVE_GUP_FAST
        select HAVE_FTRACE_MCOUNT_RECORD
        select HAVE_FUNCTION_ARG_ACCESS_API
        select HAVE_FUNCTION_ERROR_INJECTION
        select PCI_QUIRKS
        select PERF_USE_VMALLOC
        select RTC_LIB
-       select SMP
        select SPARSE_IRQ
        select SYSCTL_ARCH_UNALIGN_ALLOW
        select SYSCTL_ARCH_UNALIGN_NO_WARN
@@@ -420,6 -423,7 +423,7 @@@ config EFI_STU
  
  config SCHED_SMT
        bool "SMT scheduler support"
+       depends on SMP
        default y
        help
          Improves scheduler's performance when there are multiple
@@@ -632,15 -636,6 +636,15 @@@ config RANDOMIZE_BASE_MAX_OFFSE
  
  source "kernel/livepatch/Kconfig"
  
 +config PARAVIRT
 +      bool "Enable paravirtualization code"
 +      depends on AS_HAS_LVZ_EXTENSION
 +      help
 +        This changes the kernel so it can modify itself when it is run
 +        under a hypervisor, potentially improving performance significantly
 +        over full virtualization.  However, when run without a hypervisor
 +        the kernel is theoretically slower and slightly larger.
 +
  endmenu
  
  config ARCH_SELECT_MEMORY_MODEL
index fc0d89d4c1c53b521b420b7cb9a0575bff3d57e8,d76adbb1ce929f1a1bacce5f3b6bab535fe623c6..b4252c357c8e232ec7ba452881dcd7cb0d7f9aa2
@@@ -14,6 -14,10 +14,10 @@@ CONFIG_TASKSTATS=
  CONFIG_TASK_DELAY_ACCT=y
  CONFIG_TASK_XACCT=y
  CONFIG_TASK_IO_ACCOUNTING=y
+ CONFIG_PSI=y
+ CONFIG_IKCONFIG=y
+ CONFIG_IKCONFIG_PROC=y
+ CONFIG_IKHEADERS=y
  CONFIG_LOG_BUF_SHIFT=18
  CONFIG_NUMA_BALANCING=y
  CONFIG_MEMCG=y
@@@ -76,6 -80,7 +80,6 @@@ CONFIG_MODULE_FORCE_UNLOAD=
  CONFIG_MODVERSIONS=y
  CONFIG_BLK_DEV_ZONED=y
  CONFIG_BLK_DEV_THROTTLING=y
 -CONFIG_BLK_DEV_THROTTLING_LOW=y
  CONFIG_BLK_WBT=y
  CONFIG_BLK_CGROUP_IOLATENCY=y
  CONFIG_BLK_CGROUP_FC_APPID=y
@@@ -129,13 -134,22 +133,22 @@@ CONFIG_IP_MROUTE=
  CONFIG_IP_MROUTE_MULTIPLE_TABLES=y
  CONFIG_IP_PIMSM_V1=y
  CONFIG_IP_PIMSM_V2=y
+ CONFIG_INET_AH=m
  CONFIG_INET_ESP=m
+ CONFIG_INET_ESP_OFFLOAD=m
+ CONFIG_INET_ESPINTCP=y
+ CONFIG_INET_IPCOMP=m
  CONFIG_INET_UDP_DIAG=y
  CONFIG_TCP_CONG_ADVANCED=y
  CONFIG_TCP_CONG_BBR=m
  CONFIG_IPV6_ROUTER_PREF=y
  CONFIG_IPV6_ROUTE_INFO=y
+ CONFIG_INET6_AH=m
  CONFIG_INET6_ESP=m
+ CONFIG_INET6_ESP_OFFLOAD=m
+ CONFIG_INET6_ESPINTCP=y
+ CONFIG_INET6_IPCOMP=m
+ CONFIG_IPV6_MULTIPLE_TABLES=y
  CONFIG_IPV6_MROUTE=y
  CONFIG_MPTCP=y
  CONFIG_NETWORK_PHY_TIMESTAMPING=y
@@@ -151,6 -165,8 +164,8 @@@ CONFIG_NF_CONNTRACK_PPTP=
  CONFIG_NF_CONNTRACK_TFTP=m
  CONFIG_NF_CT_NETLINK=m
  CONFIG_NF_TABLES=m
+ CONFIG_NF_TABLES_INET=y
+ CONFIG_NFT_CT=m
  CONFIG_NFT_CONNLIMIT=m
  CONFIG_NFT_LOG=m
  CONFIG_NFT_LIMIT=m
@@@ -163,6 -179,7 +178,7 @@@ CONFIG_NFT_QUOTA=
  CONFIG_NFT_REJECT=m
  CONFIG_NFT_COMPAT=m
  CONFIG_NFT_HASH=m
+ CONFIG_NFT_FIB_INET=m
  CONFIG_NFT_SOCKET=m
  CONFIG_NFT_OSF=m
  CONFIG_NFT_TPROXY=m
@@@ -259,6 -276,7 +275,7 @@@ CONFIG_IP_NF_ARPTABLES=
  CONFIG_IP_NF_ARPFILTER=m
  CONFIG_IP_NF_ARP_MANGLE=m
  CONFIG_NF_TABLES_IPV6=y
+ CONFIG_NFT_FIB_IPV6=m
  CONFIG_IP6_NF_IPTABLES=y
  CONFIG_IP6_NF_MATCH_AH=m
  CONFIG_IP6_NF_MATCH_EUI64=m
@@@ -279,6 -297,7 +296,7 @@@ CONFIG_IP6_NF_NAT=
  CONFIG_IP6_NF_TARGET_MASQUERADE=m
  CONFIG_IP6_NF_TARGET_NPT=m
  CONFIG_NF_TABLES_BRIDGE=m
+ CONFIG_NF_CONNTRACK_BRIDGE=m
  CONFIG_BRIDGE_NF_EBTABLES=m
  CONFIG_BRIDGE_EBT_BROUTE=m
  CONFIG_BRIDGE_EBT_T_FILTER=m
@@@ -549,6 -568,7 +567,7 @@@ CONFIG_NGBE=
  CONFIG_TXGBE=y
  # CONFIG_NET_VENDOR_WIZNET is not set
  # CONFIG_NET_VENDOR_XILINX is not set
+ CONFIG_MOTORCOMM_PHY=y
  CONFIG_PPP=m
  CONFIG_PPP_BSDCOMP=m
  CONFIG_PPP_DEFLATE=m
@@@ -810,6 -830,7 +829,7 @@@ CONFIG_NTB_SWITCHTEC=
  CONFIG_NTB_PERF=m
  CONFIG_NTB_TRANSPORT=m
  CONFIG_PWM=y
+ CONFIG_GENERIC_PHY=y
  CONFIG_USB4=y
  CONFIG_EXT2_FS=y
  CONFIG_EXT2_FS_XATTR=y
@@@ -875,10 -896,13 +895,13 @@@ CONFIG_UBIFS_FS=
  CONFIG_UBIFS_FS_ADVANCED_COMPR=y
  CONFIG_CRAMFS=m
  CONFIG_SQUASHFS=y
+ CONFIG_SQUASHFS_FILE_DIRECT=y
+ CONFIG_SQUASHFS_CHOICE_DECOMP_BY_MOUNT=y
  CONFIG_SQUASHFS_XATTR=y
  CONFIG_SQUASHFS_LZ4=y
  CONFIG_SQUASHFS_LZO=y
  CONFIG_SQUASHFS_XZ=y
+ CONFIG_SQUASHFS_ZSTD=y
  CONFIG_MINIX_FS=m
  CONFIG_ROMFS_FS=m
  CONFIG_PSTORE=m
@@@ -960,3 -984,4 +983,4 @@@ CONFIG_DEBUG_FS=
  CONFIG_SCHEDSTATS=y
  # CONFIG_DEBUG_PREEMPT is not set
  # CONFIG_FTRACE is not set
+ CONFIG_UNWINDER_ORC=y
index 1c51bdf3516af5133e56f4d8da7b3510afdb91aa,b3a0868d29eace8ca5debc7ee6541e06e6e224c1..278700cfee887b024c230e5fc4de5c4bac822b45
@@@ -6,19 -6,14 +6,21 @@@
  #ifndef __ASM_SMP_H
  #define __ASM_SMP_H
  
+ #ifdef CONFIG_SMP
  #include <linux/atomic.h>
  #include <linux/bitops.h>
  #include <linux/linkage.h>
  #include <linux/threads.h>
  #include <linux/cpumask.h>
  
 +struct smp_ops {
 +      void (*init_ipi)(void);
 +      void (*send_ipi_single)(int cpu, unsigned int action);
 +      void (*send_ipi_mask)(const struct cpumask *mask, unsigned int action);
 +};
 +extern struct smp_ops mp_ops;
 +
  extern int smp_num_siblings;
  extern int num_processors;
  extern int disabled_cpus;
@@@ -31,6 -26,8 +33,6 @@@ void loongson_prepare_cpus(unsigned in
  void loongson_boot_secondary(int cpu, struct task_struct *idle);
  void loongson_init_secondary(void);
  void loongson_smp_finish(void);
 -void loongson_send_ipi_single(int cpu, unsigned int action);
 -void loongson_send_ipi_mask(const struct cpumask *mask, unsigned int action);
  #ifdef CONFIG_HOTPLUG_CPU
  int loongson_cpu_disable(void);
  void loongson_cpu_die(unsigned int cpu);
@@@ -64,12 -61,9 +66,12 @@@ extern int __cpu_logical_map[NR_CPUS]
  
  #define cpu_physical_id(cpu)  cpu_logical_map(cpu)
  
 -#define SMP_BOOT_CPU          0x1
 -#define SMP_RESCHEDULE                0x2
 -#define SMP_CALL_FUNCTION     0x4
 +#define ACTION_BOOT_CPU       0
 +#define ACTION_RESCHEDULE     1
 +#define ACTION_CALL_FUNCTION  2
 +#define SMP_BOOT_CPU          BIT(ACTION_BOOT_CPU)
 +#define SMP_RESCHEDULE                BIT(ACTION_RESCHEDULE)
 +#define SMP_CALL_FUNCTION     BIT(ACTION_CALL_FUNCTION)
  
  struct secondary_data {
        unsigned long stack;
@@@ -89,12 -83,12 +91,12 @@@ extern void show_ipi_list(struct seq_fi
  
  static inline void arch_send_call_function_single_ipi(int cpu)
  {
 -      loongson_send_ipi_single(cpu, SMP_CALL_FUNCTION);
 +      mp_ops.send_ipi_single(cpu, ACTION_CALL_FUNCTION);
  }
  
  static inline void arch_send_call_function_ipi_mask(const struct cpumask *mask)
  {
 -      loongson_send_ipi_mask(mask, SMP_CALL_FUNCTION);
 +      mp_ops.send_ipi_mask(mask, ACTION_CALL_FUNCTION);
  }
  
  #ifdef CONFIG_HOTPLUG_CPU
@@@ -109,4 -103,8 +111,8 @@@ static inline void __cpu_die(unsigned i
  }
  #endif
  
+ #else /* !CONFIG_SMP */
+ #define cpu_logical_map(cpu)  0
+ #endif /* CONFIG_SMP */
  #endif /* __ASM_SMP_H */
diff --combined rust/Makefile
index 73fbb6c9290b9ed1c0d435d5e0d1b918478b201b,a1eab64140ada52c89b805cdc83f70edcf15c3c2..f70d5e244fee5ff401d1d0adcbc958538088d718
@@@ -61,9 -61,15 +61,9 @@@ core-cfgs = 
      --cfg no_fp_fmt_parse
  
  alloc-cfgs = \
 -    --cfg no_borrow \
 -    --cfg no_fmt \
      --cfg no_global_oom_handling \
 -    --cfg no_macros \
      --cfg no_rc \
 -    --cfg no_str \
 -    --cfg no_string \
 -    --cfg no_sync \
 -    --cfg no_thin
 +    --cfg no_sync
  
  quiet_cmd_rustdoc = RUSTDOC $(if $(rustdoc_host),H, ) $<
        cmd_rustdoc = \
@@@ -117,7 -123,7 +117,7 @@@ rustdoc-compiler_builtins: $(src)/compi
  # due to things that are "configured out" vs. entirely non-existing ones.
  rustdoc-alloc: private rustc_target_flags = $(alloc-cfgs) \
      -Arustdoc::broken_intra_doc_links
 -rustdoc-alloc: $(src)/alloc/lib.rs rustdoc-core rustdoc-compiler_builtins FORCE
 +rustdoc-alloc: $(RUST_LIB_SRC)/alloc/src/lib.rs rustdoc-core rustdoc-compiler_builtins FORCE
        +$(call if_changed,rustdoc)
  
  rustdoc-kernel: private rustc_target_flags = --extern alloc \
@@@ -212,6 -218,8 +212,6 @@@ rusttest: rusttest-macros rusttest-kern
  #   - `cargo` only considers the use case of building the standard library
  #     to use it in a given package. Thus we need to create a dummy package
  #     and pick the generated libraries from there.
 -#   - Since we only keep a subset of upstream `alloc` in-tree, we need
 -#     to recreate it on the fly by putting our sources on top.
  #   - The usual ways of modifying the dependency graph in `cargo` do not seem
  #     to apply for the `-Zbuild-std` steps, thus we have to mislead it
  #     by modifying the sources in the sysroot.
@@@ -230,6 -238,8 +230,6 @@@ quiet_cmd_rustsysroot = RUSTSYSROO
        rm -rf $(objtree)/$(obj)/test; \
        mkdir -p $(objtree)/$(obj)/test; \
        cp -a $(rustc_sysroot) $(objtree)/$(obj)/test/sysroot; \
 -      cp -r $(srctree)/$(src)/alloc/* \
 -              $(objtree)/$(obj)/test/sysroot/lib/rustlib/src/rust/library/alloc/src; \
        echo '\#!/bin/sh' > $(objtree)/$(obj)/test/rustc_sysroot; \
        echo "$(RUSTC) --sysroot=$(abspath $(objtree)/$(obj)/test/sysroot) \"\$$@\"" \
                >> $(objtree)/$(obj)/test/rustc_sysroot; \
@@@ -329,7 -339,7 +329,7 @@@ quiet_cmd_bindgen = BINDGEN $
                $(bindgen_target_cflags) $(bindgen_target_extra)
  
  $(obj)/bindings/bindings_generated.rs: private bindgen_target_flags = \
 -    $(shell grep -Ev '^#|^$$' $(srctree)/$(src)/bindgen_parameters)
 +    $(shell grep -Ev '^#|^$$' $(src)/bindgen_parameters)
  $(obj)/bindings/bindings_generated.rs: private bindgen_target_extra = ; \
      sed -Ei 's/pub const RUST_CONST_HELPER_([a-zA-Z0-9_]*)/pub const \1/g' $@
  $(obj)/bindings/bindings_generated.rs: $(src)/bindings/bindings_helper.h \
        $(call if_changed_dep,bindgen)
  
  $(obj)/uapi/uapi_generated.rs: private bindgen_target_flags = \
 -    $(shell grep -Ev '^#|^$$' $(srctree)/$(src)/bindgen_parameters)
 +    $(shell grep -Ev '^#|^$$' $(src)/bindgen_parameters)
  $(obj)/uapi/uapi_generated.rs: $(src)/uapi/uapi_helper.h \
      $(src)/bindgen_parameters FORCE
        $(call if_changed_dep,bindgen)
@@@ -426,7 -436,7 +426,7 @@@ $(obj)/core.o: private rustc_objcopy = 
  $(obj)/core.o: private rustc_target_flags = $(core-cfgs)
  $(obj)/core.o: $(RUST_LIB_SRC)/core/src/lib.rs FORCE
        +$(call if_changed_dep,rustc_library)
- ifneq ($(or $(CONFIG_X86_64),$(CONFIG_LOONGARCH)),)
+ ifdef CONFIG_X86_64
  $(obj)/core.o: scripts/target.json
  endif
  
@@@ -437,7 -447,7 +437,7 @@@ $(obj)/compiler_builtins.o: $(src)/comp
  $(obj)/alloc.o: private skip_clippy = 1
  $(obj)/alloc.o: private skip_flags = -Dunreachable_pub
  $(obj)/alloc.o: private rustc_target_flags = $(alloc-cfgs)
 -$(obj)/alloc.o: $(src)/alloc/lib.rs $(obj)/compiler_builtins.o FORCE
 +$(obj)/alloc.o: $(RUST_LIB_SRC)/alloc/src/lib.rs $(obj)/compiler_builtins.o FORCE
        +$(call if_changed_dep,rustc_library)
  
  $(obj)/build_error.o: $(src)/build_error.rs $(obj)/compiler_builtins.o FORCE
index 3fcbc3737b2e026fe1b735ee67d1039009882c45,acd3b1acef83777800461a5494f82b1367641c8b..d30f61251ab0350f6fd0867a53910d2a115a5c4f
@@@ -154,7 -154,7 +154,7 @@@ fn main() 
          ts.push("arch", "x86_64");
          ts.push(
              "data-layout",
 -            "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128",
 +            "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128",
          );
          let mut features = "-3dnow,-3dnowa,-mmx,+soft-float".to_string();
          if cfg.has("MITIGATION_RETPOLINE") {
          ts.push("llvm-target", "x86_64-linux-gnu");
          ts.push("target-pointer-width", "64");
      } else if cfg.has("LOONGARCH") {
-         ts.push("arch", "loongarch64");
-         ts.push("data-layout", "e-m:e-p:64:64-i64:64-i128:128-n64-S128");
-         ts.push("features", "-f,-d");
-         ts.push("llvm-target", "loongarch64-linux-gnusf");
-         ts.push("llvm-abiname", "lp64s");
-         ts.push("target-pointer-width", "64");
+         panic!("loongarch uses the builtin rustc loongarch64-unknown-none-softfloat target");
      } else {
          panic!("Unsupported architecture");
      }
This page took 0.076569 seconds and 4 git commands to generate.