mailweb.openeuler.org
Manage this list

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

Kernel

Threads by month
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2021 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2020 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2019 -----
  • December
kernel@openeuler.org

  • 55 participants
  • 22179 discussions
[openeuler:OLK-6.6 3542/3542] arch/arm64/kvm/rme.c:740:6: warning: variable 'tmp_page' is used uninitialized whenever 'if' condition is true
by kernel test robot 22 Dec '25

22 Dec '25
Hi Steven, FYI, the error/warning still remains. tree: https://gitee.com/openeuler/kernel.git OLK-6.6 head: 04473ee9ed912a16fff0d8846ad565bbf3d63c77 commit: a74f93b7e7c0d8a2114055ed0c652cc735a7a07b [3542/3542] [backport]rme: populate guest memory region without guest_memfd config: arm64-randconfig-001-20251215 (https://download.01.org/0day-ci/archive/20251222/202512222225.THn80kvi-lkp@…) compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project 1335a05ab8bc8339ce24be3a9da89d8c3f4e0571) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251222/202512222225.THn80kvi-lkp@…) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp(a)intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202512222225.THn80kvi-lkp@intel.com/ All warnings (new ones prefixed by >>): >> arch/arm64/kvm/rme.c:740:6: warning: variable 'tmp_page' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] 740 | if (memslot->base_gfn + memslot->npages < end_gfn) { | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/arm64/kvm/rme.c:789:14: note: uninitialized use occurs here 789 | __free_page(tmp_page); | ^~~~~~~~ arch/arm64/kvm/rme.c:740:2: note: remove the 'if' if its condition is always false 740 | if (memslot->base_gfn + memslot->npages < end_gfn) { | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 741 | ret = -EINVAL; | ~~~~~~~~~~~~~~ 742 | goto out; | ~~~~~~~~~ 743 | } | ~ arch/arm64/kvm/rme.c:734:6: warning: variable 'tmp_page' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] 734 | if (!memslot) { | ^~~~~~~~ arch/arm64/kvm/rme.c:789:14: note: uninitialized use occurs here 789 | __free_page(tmp_page); | ^~~~~~~~ arch/arm64/kvm/rme.c:734:2: note: remove the 'if' if its condition is always false 734 | if (!memslot) { | ^~~~~~~~~~~~~~~ 735 | ret = -EFAULT; | ~~~~~~~~~~~~~~ 736 | goto out; | ~~~~~~~~~ 737 | } | ~ arch/arm64/kvm/rme.c:726:23: note: initialize the variable 'tmp_page' to silence this warning 726 | struct page *tmp_page; | ^ | = NULL arch/arm64/kvm/rme.c:798:16: warning: variable 'data_flags' set but not used [-Wunused-but-set-variable] 798 | unsigned long data_flags = 0; | ^ 3 warnings generated. Kconfig warnings: (for reference only) WARNING: unmet direct dependencies detected for RESCTRL_FS Depends on [n]: MISC_FILESYSTEMS [=n] && ARCH_HAS_CPU_RESCTRL [=y] Selected by [y]: - ARM64_MPAM [=y] vim +740 arch/arm64/kvm/rme.c e216f77846eeb7 Steven Price 2025-06-14 715 e216f77846eeb7 Steven Price 2025-06-14 716 static int populate_region(struct kvm *kvm, e216f77846eeb7 Steven Price 2025-06-14 717 phys_addr_t ipa_base, e216f77846eeb7 Steven Price 2025-06-14 718 phys_addr_t ipa_end, e216f77846eeb7 Steven Price 2025-06-14 719 unsigned long data_flags) e216f77846eeb7 Steven Price 2025-06-14 720 { e216f77846eeb7 Steven Price 2025-06-14 721 struct realm *realm = &kvm->arch.realm; e216f77846eeb7 Steven Price 2025-06-14 722 struct kvm_memory_slot *memslot; e216f77846eeb7 Steven Price 2025-06-14 723 gfn_t base_gfn, end_gfn; e216f77846eeb7 Steven Price 2025-06-14 724 int idx; e216f77846eeb7 Steven Price 2025-06-14 725 phys_addr_t ipa = ipa_base; a74f93b7e7c0d8 Steven Price 2025-06-14 726 struct page *tmp_page; e216f77846eeb7 Steven Price 2025-06-14 727 int ret = 0; e216f77846eeb7 Steven Price 2025-06-14 728 e216f77846eeb7 Steven Price 2025-06-14 729 base_gfn = gpa_to_gfn(ipa_base); e216f77846eeb7 Steven Price 2025-06-14 730 end_gfn = gpa_to_gfn(ipa_end); e216f77846eeb7 Steven Price 2025-06-14 731 e216f77846eeb7 Steven Price 2025-06-14 732 idx = srcu_read_lock(&kvm->srcu); e216f77846eeb7 Steven Price 2025-06-14 733 memslot = gfn_to_memslot(kvm, base_gfn); e216f77846eeb7 Steven Price 2025-06-14 734 if (!memslot) { e216f77846eeb7 Steven Price 2025-06-14 735 ret = -EFAULT; e216f77846eeb7 Steven Price 2025-06-14 736 goto out; e216f77846eeb7 Steven Price 2025-06-14 737 } e216f77846eeb7 Steven Price 2025-06-14 738 e216f77846eeb7 Steven Price 2025-06-14 739 /* We require the region to be contained within a single memslot */ e216f77846eeb7 Steven Price 2025-06-14 @740 if (memslot->base_gfn + memslot->npages < end_gfn) { e216f77846eeb7 Steven Price 2025-06-14 741 ret = -EINVAL; e216f77846eeb7 Steven Price 2025-06-14 742 goto out; e216f77846eeb7 Steven Price 2025-06-14 743 } e216f77846eeb7 Steven Price 2025-06-14 744 a74f93b7e7c0d8 Steven Price 2025-06-14 745 tmp_page = alloc_page(GFP_KERNEL); a74f93b7e7c0d8 Steven Price 2025-06-14 746 if (!tmp_page) { a74f93b7e7c0d8 Steven Price 2025-06-14 747 ret = -ENOMEM; e216f77846eeb7 Steven Price 2025-06-14 748 goto out; e216f77846eeb7 Steven Price 2025-06-14 749 } e216f77846eeb7 Steven Price 2025-06-14 750 a74f93b7e7c0d8 Steven Price 2025-06-14 751 mmap_read_lock(current->mm); a74f93b7e7c0d8 Steven Price 2025-06-14 752 e216f77846eeb7 Steven Price 2025-06-14 753 while (ipa < ipa_end) { e216f77846eeb7 Steven Price 2025-06-14 754 struct vm_area_struct *vma; e216f77846eeb7 Steven Price 2025-06-14 755 unsigned long hva; e216f77846eeb7 Steven Price 2025-06-14 756 struct page *page; e216f77846eeb7 Steven Price 2025-06-14 757 kvm_pfn_t pfn; e216f77846eeb7 Steven Price 2025-06-14 758 e216f77846eeb7 Steven Price 2025-06-14 759 hva = gfn_to_hva_memslot(memslot, gpa_to_gfn(ipa)); e216f77846eeb7 Steven Price 2025-06-14 760 vma = vma_lookup(current->mm, hva); e216f77846eeb7 Steven Price 2025-06-14 761 if (!vma) { e216f77846eeb7 Steven Price 2025-06-14 762 ret = -EFAULT; e216f77846eeb7 Steven Price 2025-06-14 763 break; e216f77846eeb7 Steven Price 2025-06-14 764 } e216f77846eeb7 Steven Price 2025-06-14 765 a74f93b7e7c0d8 Steven Price 2025-06-14 766 pfn = gfn_to_pfn_memslot(memslot, gpa_to_gfn(ipa)); e216f77846eeb7 Steven Price 2025-06-14 767 e216f77846eeb7 Steven Price 2025-06-14 768 if (is_error_pfn(pfn)) { e216f77846eeb7 Steven Price 2025-06-14 769 ret = -EFAULT; e216f77846eeb7 Steven Price 2025-06-14 770 break; e216f77846eeb7 Steven Price 2025-06-14 771 } e216f77846eeb7 Steven Price 2025-06-14 772 a74f93b7e7c0d8 Steven Price 2025-06-14 773 page = pfn_to_page(pfn); e216f77846eeb7 Steven Price 2025-06-14 774 e216f77846eeb7 Steven Price 2025-06-14 775 ret = realm_create_protected_data_page(realm, ipa, a74f93b7e7c0d8 Steven Price 2025-06-14 776 page, a74f93b7e7c0d8 Steven Price 2025-06-14 777 tmp_page, e216f77846eeb7 Steven Price 2025-06-14 778 data_flags); a74f93b7e7c0d8 Steven Price 2025-06-14 779 if (ret) { e216f77846eeb7 Steven Price 2025-06-14 780 kvm_release_page_clean(page); e216f77846eeb7 Steven Price 2025-06-14 781 break; a74f93b7e7c0d8 Steven Price 2025-06-14 782 } e216f77846eeb7 Steven Price 2025-06-14 783 e216f77846eeb7 Steven Price 2025-06-14 784 ipa += PAGE_SIZE; a74f93b7e7c0d8 Steven Price 2025-06-14 785 kvm_release_pfn_dirty(pfn); e216f77846eeb7 Steven Price 2025-06-14 786 } e216f77846eeb7 Steven Price 2025-06-14 787 out: a74f93b7e7c0d8 Steven Price 2025-06-14 788 mmap_read_unlock(current->mm); a74f93b7e7c0d8 Steven Price 2025-06-14 789 __free_page(tmp_page); e216f77846eeb7 Steven Price 2025-06-14 790 srcu_read_unlock(&kvm->srcu, idx); e216f77846eeb7 Steven Price 2025-06-14 791 return ret; e216f77846eeb7 Steven Price 2025-06-14 792 } e216f77846eeb7 Steven Price 2025-06-14 793 :::::: The code at line 740 was first introduced by commit :::::: e216f77846eeb7062baa345cea2be0978dea94cc [v8-19-43]arm64: RME: Allow populating initial contents :::::: TO: Steven Price <steven.price(a)arm.com> :::::: CC: Xu Raoqing <xuraoqing(a)huawei.com> -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
1 0
0 0
[openeuler:OLK-5.10 3418/3418] arch/x86/kernel/cpu/common.c:92:16: sparse: sparse: incorrect type in initializer (different address spaces)
by kernel test robot 22 Dec '25

22 Dec '25
tree: https://gitee.com/openeuler/kernel.git OLK-5.10 head: 1588d318a9e388d05b6cf5e2a63134c8beb6a355 commit: f4128ae8e6ff03b4c805707fe75d0345797f7f53 [3418/3418] sched: Add cluster scheduler level for x86 config: x86_64-randconfig-121-20251217 (https://download.01.org/0day-ci/archive/20251222/202512222106.0whCMuCB-lkp@…) compiler: gcc-12 (Debian 12.4.0-5) 12.4.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251222/202512222106.0whCMuCB-lkp@…) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp(a)intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202512222106.0whCMuCB-lkp@intel.com/ sparse warnings: (new ones prefixed by >>) >> arch/x86/kernel/cpu/common.c:92:16: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] __percpu *__vpp_verify @@ got unsigned short * @@ arch/x86/kernel/cpu/common.c:92:16: sparse: expected void const [noderef] __percpu *__vpp_verify arch/x86/kernel/cpu/common.c:92:16: sparse: got unsigned short * arch/x86/kernel/cpu/common.c:1901:1: sparse: sparse: symbol 'fixed_percpu_data' redeclared with different type (different address spaces): arch/x86/kernel/cpu/common.c:1901:1: sparse: struct fixed_percpu_data [addressable] [noderef] [toplevel] __percpu fixed_percpu_data arch/x86/kernel/cpu/common.c: note: in included file (through arch/x86/include/asm/cpufeature.h, arch/x86/include/asm/thread_info.h, include/linux/thread_bits.h, ...): arch/x86/include/asm/processor.h:470:1: sparse: note: previously declared as: arch/x86/include/asm/processor.h:470:1: sparse: struct fixed_percpu_data extern [addressable] [toplevel] fixed_percpu_data arch/x86/kernel/cpu/common.c:144:43: sparse: sparse: cast truncates bits from constant value (fffff becomes ffff) arch/x86/kernel/cpu/common.c:145:43: sparse: sparse: cast truncates bits from constant value (fffff becomes ffff) arch/x86/kernel/cpu/common.c:146:43: sparse: sparse: cast truncates bits from constant value (fffff becomes ffff) arch/x86/kernel/cpu/common.c:147:43: sparse: sparse: cast truncates bits from constant value (fffff becomes ffff) arch/x86/kernel/cpu/common.c:148:43: sparse: sparse: cast truncates bits from constant value (fffff becomes ffff) arch/x86/kernel/cpu/common.c:149:43: sparse: sparse: cast truncates bits from constant value (fffff becomes ffff) arch/x86/include/asm/processor.h:474:31: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] __percpu *__vpp_verify @@ got char ( * )[40] @@ arch/x86/include/asm/processor.h:474:31: sparse: expected void const [noderef] __percpu *__vpp_verify arch/x86/include/asm/processor.h:474:31: sparse: got char ( * )[40] vim +92 arch/x86/kernel/cpu/common.c f8b64d08dde271 Borislav Petkov 2018-04-27 89 6f01df96c462b7 Kim Phillips 2021-08-17 90 u16 get_llc_id(unsigned int cpu) 6f01df96c462b7 Kim Phillips 2021-08-17 91 { 6f01df96c462b7 Kim Phillips 2021-08-17 @92 return per_cpu(cpu_llc_id, cpu); 6f01df96c462b7 Kim Phillips 2021-08-17 93 } 6f01df96c462b7 Kim Phillips 2021-08-17 94 EXPORT_SYMBOL_GPL(get_llc_id); 6f01df96c462b7 Kim Phillips 2021-08-17 95 :::::: The code at line 92 was first introduced by commit :::::: 6f01df96c462b77915b27d404152c47e75e879cf x86/cpu: Add get_llc_id() helper function :::::: TO: Kim Phillips <kim.phillips(a)amd.com> :::::: CC: Xie Haocheng <haocheng.xie(a)amd.com> -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
1 0
0 0
[openeuler:OLK-6.6 3542/3542] arch/arm64/kvm/rme.c:799:16: warning: variable 'data_flags' set but not used
by kernel test robot 22 Dec '25

22 Dec '25
Hi Steven, FYI, the error/warning still remains. tree: https://gitee.com/openeuler/kernel.git OLK-6.6 head: 04473ee9ed912a16fff0d8846ad565bbf3d63c77 commit: e216f77846eeb7062baa345cea2be0978dea94cc [3542/3542] [v8-19-43]arm64: RME: Allow populating initial contents config: arm64-randconfig-001-20251215 (https://download.01.org/0day-ci/archive/20251222/202512222100.DZ0g6W61-lkp@…) compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project 1335a05ab8bc8339ce24be3a9da89d8c3f4e0571) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251222/202512222100.DZ0g6W61-lkp@…) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp(a)intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202512222100.DZ0g6W61-lkp@intel.com/ All warnings (new ones prefixed by >>): arch/arm64/kvm/rme.c:742:7: error: call to undeclared function 'kvm_slot_can_be_private'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 742 | if (!kvm_slot_can_be_private(memslot)) { | ^ arch/arm64/kvm/rme.c:763:9: error: call to undeclared function '__kvm_faultin_pfn'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 763 | pfn = __kvm_faultin_pfn(memslot, gpa_to_gfn(ipa), FOLL_WRITE, | ^ arch/arm64/kvm/rme.c:771:9: error: call to undeclared function 'kvm_gmem_get_pfn'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 771 | ret = kvm_gmem_get_pfn(kvm, memslot, | ^ >> arch/arm64/kvm/rme.c:799:16: warning: variable 'data_flags' set but not used [-Wunused-but-set-variable] 799 | unsigned long data_flags = 0; | ^ 1 warning and 3 errors generated. Kconfig warnings: (for reference only) WARNING: unmet direct dependencies detected for RESCTRL_FS Depends on [n]: MISC_FILESYSTEMS [=n] && ARCH_HAS_CPU_RESCTRL [=y] Selected by [y]: - ARM64_MPAM [=y] vim +/data_flags +799 arch/arm64/kvm/rme.c 794 795 static int kvm_populate_realm(struct kvm *kvm, 796 struct arm_rme_populate_realm *args) 797 { 798 phys_addr_t ipa_base, ipa_end; > 799 unsigned long data_flags = 0; 800 801 if (kvm_realm_state(kvm) != REALM_STATE_NEW) 802 return -EPERM; 803 804 if (!IS_ALIGNED(args->base, PAGE_SIZE) || 805 !IS_ALIGNED(args->size, PAGE_SIZE) || 806 (args->flags & ~RMI_MEASURE_CONTENT)) 807 return -EINVAL; 808 809 ipa_base = args->base; 810 ipa_end = ipa_base + args->size; 811 812 if (ipa_end < ipa_base) 813 return -EINVAL; 814 815 if (args->flags & RMI_MEASURE_CONTENT) 816 data_flags |= RMI_MEASURE_CONTENT; 817 818 /* 819 * Perform the population in parts to ensure locks are not held for too 820 * long 821 */ 822 while (ipa_base < ipa_end) { 823 phys_addr_t end = min(ipa_end, ipa_base + SZ_2M); 824 825 int ret = populate_region(kvm, ipa_base, end, 826 args->flags); 827 828 if (ret) 829 return ret; 830 831 ipa_base = end; 832 833 cond_resched(); 834 } 835 836 return 0; 837 } 838 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
1 0
0 0
[openeuler:OLK-5.10 3418/3418] drivers/usb/cdns3/drd.c:44:38: sparse: sparse: incorrect type in assignment (different base types)
by kernel test robot 22 Dec '25

22 Dec '25
tree: https://gitee.com/openeuler/kernel.git OLK-5.10 head: 1588d318a9e388d05b6cf5e2a63134c8beb6a355 commit: fe4466c05ba70c2e354965de9548eb4ab5db783b [3418/3418] usb: cdns3: Add support for DRD CDNSP config: x86_64-randconfig-122-20251217 (https://download.01.org/0day-ci/archive/20251222/202512222111.1LJ3T3qn-lkp@…) compiler: gcc-14 (Debian 14.2.0-19) 14.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251222/202512222111.1LJ3T3qn-lkp@…) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp(a)intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202512222111.1LJ3T3qn-lkp@intel.com/ sparse warnings: (new ones prefixed by >>) >> drivers/usb/cdns3/drd.c:44:38: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [noderef] [usertype] __iomem *override_reg @@ got restricted __le32 * @@ drivers/usb/cdns3/drd.c:44:38: sparse: expected unsigned int [noderef] [usertype] __iomem *override_reg drivers/usb/cdns3/drd.c:44:38: sparse: got restricted __le32 * drivers/usb/cdns3/drd.c:46:38: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [noderef] [usertype] __iomem *override_reg @@ got restricted __le32 * @@ drivers/usb/cdns3/drd.c:46:38: sparse: expected unsigned int [noderef] [usertype] __iomem *override_reg drivers/usb/cdns3/drd.c:46:38: sparse: got restricted __le32 * drivers/usb/cdns3/drd.c:48:38: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [noderef] [usertype] __iomem *override_reg @@ got restricted __le32 * @@ drivers/usb/cdns3/drd.c:48:38: sparse: expected unsigned int [noderef] [usertype] __iomem *override_reg drivers/usb/cdns3/drd.c:48:38: sparse: got restricted __le32 * drivers/usb/cdns3/drd.c:67:50: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got restricted __le32 * @@ drivers/usb/cdns3/drd.c:67:50: sparse: expected void const volatile [noderef] __iomem *addr drivers/usb/cdns3/drd.c:67:50: sparse: got restricted __le32 * drivers/usb/cdns3/drd.c:69:50: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got restricted __le32 * @@ drivers/usb/cdns3/drd.c:69:50: sparse: expected void volatile [noderef] __iomem *addr drivers/usb/cdns3/drd.c:69:50: sparse: got restricted __le32 * drivers/usb/cdns3/drd.c:92:25: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got restricted __le32 * @@ drivers/usb/cdns3/drd.c:92:25: sparse: expected void const volatile [noderef] __iomem *addr drivers/usb/cdns3/drd.c:92:25: sparse: got restricted __le32 * drivers/usb/cdns3/drd.c:102:30: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got restricted __le32 * @@ drivers/usb/cdns3/drd.c:102:30: sparse: expected void const volatile [noderef] __iomem *addr drivers/usb/cdns3/drd.c:102:30: sparse: got restricted __le32 * drivers/usb/cdns3/drd.c:135:24: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got restricted __le32 * @@ drivers/usb/cdns3/drd.c:135:24: sparse: expected void volatile [noderef] __iomem *addr drivers/usb/cdns3/drd.c:135:24: sparse: got restricted __le32 * drivers/usb/cdns3/drd.c:145:48: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got restricted __le32 * @@ drivers/usb/cdns3/drd.c:145:48: sparse: expected void volatile [noderef] __iomem *addr drivers/usb/cdns3/drd.c:145:48: sparse: got restricted __le32 * drivers/usb/cdns3/drd.c:161:21: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got restricted __le32 * @@ drivers/usb/cdns3/drd.c:161:21: sparse: expected void volatile [noderef] __iomem *addr drivers/usb/cdns3/drd.c:161:21: sparse: got restricted __le32 * drivers/usb/cdns3/drd.c:169:15: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got restricted __le32 * @@ drivers/usb/cdns3/drd.c:169:15: sparse: expected void const volatile [noderef] __iomem *addr drivers/usb/cdns3/drd.c:169:15: sparse: got restricted __le32 * drivers/usb/cdns3/drd.c:169:15: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got restricted __le32 * @@ drivers/usb/cdns3/drd.c:169:15: sparse: expected void const volatile [noderef] __iomem *addr drivers/usb/cdns3/drd.c:169:15: sparse: got restricted __le32 * drivers/usb/cdns3/drd.c:189:21: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got restricted __le32 * @@ drivers/usb/cdns3/drd.c:189:21: sparse: expected void volatile [noderef] __iomem *addr drivers/usb/cdns3/drd.c:189:21: sparse: got restricted __le32 * drivers/usb/cdns3/drd.c:192:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got restricted __le32 * @@ drivers/usb/cdns3/drd.c:192:9: sparse: expected void const volatile [noderef] __iomem *addr drivers/usb/cdns3/drd.c:192:9: sparse: got restricted __le32 * drivers/usb/cdns3/drd.c:192:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got restricted __le32 * @@ drivers/usb/cdns3/drd.c:192:9: sparse: expected void const volatile [noderef] __iomem *addr drivers/usb/cdns3/drd.c:192:9: sparse: got restricted __le32 * drivers/usb/cdns3/drd.c:211:47: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got restricted __le32 * @@ drivers/usb/cdns3/drd.c:211:47: sparse: expected void volatile [noderef] __iomem *addr drivers/usb/cdns3/drd.c:211:47: sparse: got restricted __le32 * drivers/usb/cdns3/drd.c:220:15: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got restricted __le32 * @@ drivers/usb/cdns3/drd.c:220:15: sparse: expected void const volatile [noderef] __iomem *addr drivers/usb/cdns3/drd.c:220:15: sparse: got restricted __le32 * drivers/usb/cdns3/drd.c:220:15: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got restricted __le32 * @@ drivers/usb/cdns3/drd.c:220:15: sparse: expected void const volatile [noderef] __iomem *addr drivers/usb/cdns3/drd.c:220:15: sparse: got restricted __le32 * drivers/usb/cdns3/drd.c:246:21: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got restricted __le32 * @@ drivers/usb/cdns3/drd.c:246:21: sparse: expected void volatile [noderef] __iomem *addr drivers/usb/cdns3/drd.c:246:21: sparse: got restricted __le32 * drivers/usb/cdns3/drd.c:248:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got restricted __le32 * @@ drivers/usb/cdns3/drd.c:248:9: sparse: expected void const volatile [noderef] __iomem *addr drivers/usb/cdns3/drd.c:248:9: sparse: got restricted __le32 * drivers/usb/cdns3/drd.c:248:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got restricted __le32 * @@ drivers/usb/cdns3/drd.c:248:9: sparse: expected void const volatile [noderef] __iomem *addr drivers/usb/cdns3/drd.c:248:9: sparse: got restricted __le32 * drivers/usb/cdns3/drd.c:266:25: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got restricted __le32 * @@ drivers/usb/cdns3/drd.c:266:25: sparse: expected void volatile [noderef] __iomem *addr drivers/usb/cdns3/drd.c:266:25: sparse: got restricted __le32 * drivers/usb/cdns3/drd.c:335:26: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got restricted __le32 * @@ drivers/usb/cdns3/drd.c:335:26: sparse: expected void const volatile [noderef] __iomem *addr drivers/usb/cdns3/drd.c:335:26: sparse: got restricted __le32 * drivers/usb/cdns3/drd.c:354:25: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got restricted __le32 * @@ drivers/usb/cdns3/drd.c:354:25: sparse: expected void volatile [noderef] __iomem *addr drivers/usb/cdns3/drd.c:354:25: sparse: got restricted __le32 * drivers/usb/cdns3/drd.c:377:27: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct cdns3_otg_legacy_regs *otg_v0_regs @@ got void [noderef] __iomem *[assigned] regs @@ drivers/usb/cdns3/drd.c:377:27: sparse: expected struct cdns3_otg_legacy_regs *otg_v0_regs drivers/usb/cdns3/drd.c:377:27: sparse: got void [noderef] __iomem *[assigned] regs drivers/usb/cdns3/drd.c:378:25: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got restricted __le32 * @@ drivers/usb/cdns3/drd.c:378:25: sparse: expected void const volatile [noderef] __iomem *addr drivers/usb/cdns3/drd.c:378:25: sparse: got restricted __le32 * drivers/usb/cdns3/drd.c:382:32: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct cdns3_otg_common_regs *otg_regs @@ got void [noderef] __iomem *[assigned] regs @@ drivers/usb/cdns3/drd.c:382:32: sparse: expected struct cdns3_otg_common_regs *otg_regs drivers/usb/cdns3/drd.c:382:32: sparse: got void [noderef] __iomem *[assigned] regs drivers/usb/cdns3/drd.c:385:32: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got restricted __le32 * @@ drivers/usb/cdns3/drd.c:385:32: sparse: expected void volatile [noderef] __iomem *addr drivers/usb/cdns3/drd.c:385:32: sparse: got restricted __le32 * drivers/usb/cdns3/drd.c:386:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got restricted __le32 * @@ drivers/usb/cdns3/drd.c:386:17: sparse: expected void const volatile [noderef] __iomem *addr drivers/usb/cdns3/drd.c:386:17: sparse: got restricted __le32 * drivers/usb/cdns3/drd.c:390:35: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct cdns3_otg_regs *otg_v1_regs @@ got void [noderef] __iomem *[assigned] regs @@ drivers/usb/cdns3/drd.c:390:35: sparse: expected struct cdns3_otg_regs *otg_v1_regs drivers/usb/cdns3/drd.c:390:35: sparse: got void [noderef] __iomem *[assigned] regs drivers/usb/cdns3/drd.c:391:38: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct cdnsp_otg_regs *otg_cdnsp_regs @@ got void [noderef] __iomem *[assigned] regs @@ drivers/usb/cdns3/drd.c:391:38: sparse: expected struct cdnsp_otg_regs *otg_cdnsp_regs drivers/usb/cdns3/drd.c:391:38: sparse: got void [noderef] __iomem *[assigned] regs drivers/usb/cdns3/drd.c:395:41: sparse: sparse: restricted __le32 degrades to integer drivers/usb/cdns3/drd.c:402:40: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got restricted __le32 * @@ drivers/usb/cdns3/drd.c:402:40: sparse: expected void volatile [noderef] __iomem *addr drivers/usb/cdns3/drd.c:402:40: sparse: got restricted __le32 * drivers/usb/cdns3/drd.c:406:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got restricted __le32 * @@ drivers/usb/cdns3/drd.c:406:17: sparse: expected void const volatile [noderef] __iomem *addr drivers/usb/cdns3/drd.c:406:17: sparse: got restricted __le32 * drivers/usb/cdns3/drd.c:406:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got restricted __le32 * @@ vim +44 drivers/usb/cdns3/drd.c 22 23 /** 24 * cdns3_set_mode - change mode of OTG Core 25 * @cdns: pointer to context structure 26 * @mode: selected mode from cdns_role 27 * 28 * Returns 0 on success otherwise negative errno 29 */ 30 static int cdns3_set_mode(struct cdns3 *cdns, enum usb_dr_mode mode) 31 { 32 u32 __iomem *override_reg; 33 u32 reg; 34 35 switch (mode) { 36 case USB_DR_MODE_PERIPHERAL: 37 break; 38 case USB_DR_MODE_HOST: 39 break; 40 case USB_DR_MODE_OTG: 41 dev_dbg(cdns->dev, "Set controller to OTG mode\n"); 42 43 if (cdns->version == CDNSP_CONTROLLER_V2) > 44 override_reg = &cdns->otg_cdnsp_regs->override; 45 else if (cdns->version == CDNS3_CONTROLLER_V1) 46 override_reg = &cdns->otg_v1_regs->override; 47 else 48 override_reg = &cdns->otg_v0_regs->ctrl1; 49 50 reg = readl(override_reg); 51 52 if (cdns->version != CDNS3_CONTROLLER_V0) 53 reg |= OVERRIDE_IDPULLUP; 54 else 55 reg |= OVERRIDE_IDPULLUP_V0; 56 57 writel(reg, override_reg); 58 59 if (cdns->version == CDNS3_CONTROLLER_V1) { 60 /* 61 * Enable work around feature built into the 62 * controller to address issue with RX Sensitivity 63 * est (EL_17) for USB2 PHY. The issue only occures 64 * for 0x0002450D controller version. 65 */ 66 if (cdns->phyrst_a_enable) { 67 reg = readl(&cdns->otg_v1_regs->phyrst_cfg); 68 reg |= PHYRST_CFG_PHYRST_A_ENABLE; 69 writel(reg, &cdns->otg_v1_regs->phyrst_cfg); 70 } 71 } 72 73 /* 74 * Hardware specification says: "ID_VALUE must be valid within 75 * 50ms after idpullup is set to '1" so driver must wait 76 * 50ms before reading this pin. 77 */ 78 usleep_range(50000, 60000); 79 break; 80 default: 81 dev_err(cdns->dev, "Unsupported mode of operation %d\n", mode); 82 return -EINVAL; 83 } 84 85 return 0; 86 } 87 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
1 0
0 0
[PATCH OLK-6.6] mm: migrate: add dma copy offloading for hugetlb
by Zeng Heng 22 Dec '25

22 Dec '25
From: Tong Tiangen <tongtiangen(a)huawei.com> hulk inclusion category: feature bugzilla: https://gitcode.com/openeuler/kernel/issues/7837 ------------------------------- Large memory migration imposes significant overhead on the CPU. This patch introduces enhancements to the page migration by offloading the copy to UDMA hardware which based on the DMA engine framework, and a new migration mode has been introduced, If DMA migration fails, it will fall back to CPU migration. DMA migration supports both asynchronous and synchronous modes for subsequent debugging purposes. Signed-off-by: Tong Tiangen <tongtiangen(a)huawei.com> Signed-off-by: Zeng Heng <zengheng4(a)huawei.com> --- arch/arm64/configs/openeuler_defconfig | 1 + include/linux/migrate_mode.h | 7 ++ include/linux/mm.h | 8 ++ mm/Kconfig | 12 +++ mm/Makefile | 1 + mm/migrate.c | 9 ++ mm/migrate_dma.c | 143 +++++++++++++++++++++++++ 7 files changed, 181 insertions(+) create mode 100644 mm/migrate_dma.c diff --git a/arch/arm64/configs/openeuler_defconfig b/arch/arm64/configs/openeuler_defconfig index c25ac4ff6c2f..08af29cf2776 100644 --- a/arch/arm64/configs/openeuler_defconfig +++ b/arch/arm64/configs/openeuler_defconfig @@ -1186,6 +1186,7 @@ CONFIG_COMPACTION=y CONFIG_COMPACT_UNEVICTABLE_DEFAULT=1 CONFIG_PAGE_REPORTING=y CONFIG_MIGRATION=y +CONFIG_MIGRATE_PAGES_DMA_OFFLOADING=y CONFIG_DEVICE_MIGRATION=y CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION=y CONFIG_ARCH_ENABLE_THP_MIGRATION=y diff --git a/include/linux/migrate_mode.h b/include/linux/migrate_mode.h index 0f577f932bb4..5283e62b7d1b 100644 --- a/include/linux/migrate_mode.h +++ b/include/linux/migrate_mode.h @@ -19,6 +19,13 @@ enum migrate_mode { MIGRATE_SYNC_NO_COPY, }; +/* + * Actually the macro MIGRATE_ASYNC_DMA_OFFLOADING definition should be + * placed within enum migrate_mode, but for KABI compatibility, it is + * defined here alone. + */ +#define MIGRATE_ASYNC_DMA_OFFLOADING (10) + enum migrate_reason { MR_COMPACTION, MR_MEMORY_FAILURE, diff --git a/include/linux/mm.h b/include/linux/mm.h index c0040a2014c4..036822cb1b9d 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -1330,6 +1330,14 @@ void put_pages_list(struct list_head *pages); void split_page(struct page *page, unsigned int order); void folio_copy(struct folio *dst, struct folio *src); int folio_mc_copy(struct folio *dst, struct folio *src); +#ifdef CONFIG_MIGRATE_PAGES_DMA_OFFLOADING +int folio_dma_copy(struct folio *dst, struct folio *src); +#else +static inline int folio_dma_copy(struct folio *dst, struct folio *src) +{ + return -ENODEV; +} +#endif unsigned long nr_free_buffer_pages(void); diff --git a/mm/Kconfig b/mm/Kconfig index 4eb0642b71e5..12438e8dff88 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -696,6 +696,18 @@ config MIGRATION pages as migration can relocate pages to satisfy a huge page allocation instead of reclaiming. +config MIGRATE_PAGES_DMA_OFFLOADING + bool "Support to use DMA channels for page migration" + depends on DMA_ENGINE + depends on MIGRATION + default y + help + This config enhances page migration by introducing a new mode + that offloads copy operations to UB-DMA hardware based on the + DMA engine framework, with automatic fallback to CPU migration + if DMA migration fails. DMA migration supports both asynchronous + and synchronous modes to facilitate debugging. + config DEVICE_MIGRATION def_bool MIGRATION && ZONE_DEVICE diff --git a/mm/Makefile b/mm/Makefile index e45cdeda47b7..dd81f8c33e03 100644 --- a/mm/Makefile +++ b/mm/Makefile @@ -92,6 +92,7 @@ obj-$(CONFIG_FAILSLAB) += failslab.o obj-$(CONFIG_FAIL_PAGE_ALLOC) += fail_page_alloc.o obj-$(CONFIG_MEMTEST) += memtest.o obj-$(CONFIG_MIGRATION) += migrate.o +obj-$(CONFIG_MIGRATE_PAGES_DMA_OFFLOADING) += migrate_dma.o obj-$(CONFIG_NUMA) += memory-tiers.o obj-$(CONFIG_DEVICE_MIGRATION) += migrate_device.o obj-$(CONFIG_TRANSPARENT_HUGEPAGE) += huge_memory.o khugepaged.o diff --git a/mm/migrate.c b/mm/migrate.c index 148e55fab012..216f45c9570f 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -583,6 +583,15 @@ static int folio_migrate_mc_copy(struct folio *dst, struct folio *src, if (mode == MIGRATE_SYNC_NO_COPY) return 0; + if (mode == MIGRATE_ASYNC_DMA_OFFLOADING) { + if (folio_test_hugetlb(src) || + folio_test_pmd_mappable(src)) { + /* if dma offloading fail, fallback */ + if (!folio_dma_copy(dst, src)) + return 0; + } + } + return folio_mc_copy(dst, src); } diff --git a/mm/migrate_dma.c b/mm/migrate_dma.c new file mode 100644 index 000000000000..796cd9a5477e --- /dev/null +++ b/mm/migrate_dma.c @@ -0,0 +1,143 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Support to use DMA channels for page migration. + * + * Copyright (C) 2025 Huawei Limited + */ + +#define pr_fmt(fmt) "migrate_dma: " fmt + +#include <linux/dmaengine.h> +#include <linux/dma-mapping.h> + +/* DMA channel track its transfers done */ +struct dma_channel_work { + struct dma_chan *chan; + enum dma_status status; + struct completion done; +}; + +static void folios_dma_copy_completion_callback(void *param, + const struct dmaengine_result *result) +{ + struct dma_channel_work *chan_work = param; + + if (result) { + enum dmaengine_tx_result dma_res = result->result; + + if (dma_res == DMA_TRANS_NOERROR) + chan_work->status = DMA_COMPLETE; + else + chan_work->status = DMA_ERROR; + } + + complete(&chan_work->done); +} + +static int process_folio_dma_transfer(struct dma_channel_work *chan_work, + struct folio *src, struct folio *dst) +{ + struct dma_chan *chan = chan_work->chan; + struct device *dev = dmaengine_get_dma_device(chan); + enum dma_ctrl_flags flags = DMA_CTRL_ACK | DMA_PREP_INTERRUPT; + struct dma_async_tx_descriptor *tx; + dma_addr_t src_handle, dst_handle; + size_t size = folio_size(src); + int ret; + + src_handle = dma_map_page(dev, &src->page, 0, size, DMA_TO_DEVICE); + if (dma_mapping_error(dev, src_handle)) { + dev_err(dev, "map dma src page error.\n"); + return -ENOMEM; + } + + dst_handle = dma_map_page(dev, &dst->page, 0, size, DMA_FROM_DEVICE); + if (dma_mapping_error(dev, dst_handle)) { + dev_err(dev, "map dma dst page error.\n"); + ret = -ENOMEM; + goto out_unmap; + } + + tx = dmaengine_prep_dma_memcpy(chan, dst_handle, src_handle, + size, flags); + if (unlikely(!tx)) { + dev_err(dev, "prep dma memcpy error.\n"); + ret = -EBUSY; + goto out_unmap_all; + } + + tx->callback_result = folios_dma_copy_completion_callback; + tx->callback_param = chan_work; + init_completion(&chan_work->done); + chan_work->status = DMA_ERROR; + + if (dma_submit_error(dmaengine_submit(tx))) { + dev_err(dev, "dma submit error.\n"); + ret = -EINVAL; + goto out_unmap_all; + } + + dma_async_issue_pending(chan); + if (!wait_for_completion_timeout(&chan_work->done, + msecs_to_jiffies(1000))) { + ret = -ETIMEDOUT; + goto out_unmap_all; + } + + ret = (chan_work->status == DMA_COMPLETE) ? 0 : -EPROTO; + +out_unmap_all: + dma_unmap_page(dev, dst_handle, size, DMA_FROM_DEVICE); +out_unmap: + dma_unmap_page(dev, src_handle, size, DMA_TO_DEVICE); + + return ret; +} + +static bool folio_dma_chan_filter(struct dma_chan *chan, void *param) +{ + return !strcmp(dev_name(chan->device->dev), "ub_dma_device"); +} + +int folio_dma_copy(struct folio *dst, struct folio *src) +{ + struct dma_channel_work *chan_work; + struct dma_slave_config dma_cfg; + struct dma_chan *chan; + dma_cap_mask_t mask; + int ret = -ENODEV; + + dma_cap_zero(mask); + dma_cap_set(DMA_MEMCPY, mask); + chan = dma_request_channel(mask, folio_dma_chan_filter, NULL); + if (!chan) { + pr_err("failed to allocate dma channel.\n"); + return ret; + } + + memset(&dma_cfg, 0, sizeof(dma_cfg)); + dma_cfg.direction = DMA_MEM_TO_MEM; + ret = dmaengine_slave_config(chan, &dma_cfg); + if (ret) { + pr_err("failed to config dma channel.\n"); + goto out_release; + } + + chan_work = kmalloc(sizeof(*chan_work), GFP_KERNEL); + if (unlikely(!chan_work)) { + pr_err("failed to allocate memory for chan work.\n"); + goto out_release; + } + + chan_work->chan = chan; + ret = process_folio_dma_transfer(chan_work, src, dst); + if (unlikely(ret)) + pr_err("failed to process folio dma transfer.\n"); + + kfree(chan_work); +out_release: + dma_release_channel(chan); + + return ret; +} +EXPORT_SYMBOL(folio_dma_copy); -- 2.25.1
2 1
0 0
[openeuler:OLK-6.6 3557/3557] drivers/platform/mpam/mpam_resctrl.c:25:1: sparse: sparse: symbol 'resctrl_mon_ctx_waiters' was not declared. Should it be static?
by kernel test robot 22 Dec '25

22 Dec '25
tree: https://gitee.com/openeuler/kernel.git OLK-6.6 head: 04473ee9ed912a16fff0d8846ad565bbf3d63c77 commit: 9119da1439390ea4f29a0635652248aa3c2040f0 [3557/3557] arm_mpam: resctrl: Allow resctrl to allocate monitors config: arm64-randconfig-r132-20251218 (https://download.01.org/0day-ci/archive/20251222/202512221945.aSbuNpcr-lkp@…) compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251222/202512221945.aSbuNpcr-lkp@…) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp(a)intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202512221945.aSbuNpcr-lkp@intel.com/ sparse warnings: (new ones prefixed by >>) >> drivers/platform/mpam/mpam_resctrl.c:25:1: sparse: sparse: symbol 'resctrl_mon_ctx_waiters' was not declared. Should it be static? >> drivers/platform/mpam/mpam_resctrl.c:45:5: sparse: sparse: symbol '__mon_is_rmid_idx' was not declared. Should it be static? drivers/platform/mpam/mpam_resctrl.c:46:6: sparse: sparse: symbol 'mon_is_rmid_idx' was not declared. Should it be static? vim +/resctrl_mon_ctx_waiters +25 drivers/platform/mpam/mpam_resctrl.c 24 > 25 DECLARE_WAIT_QUEUE_HEAD(resctrl_mon_ctx_waiters); 26 27 /* 28 * The classes we've picked to map to resctrl resources. 29 * Class pointer may be NULL. 30 */ 31 static struct mpam_resctrl_res mpam_resctrl_exports[RDT_NUM_RESOURCES]; 32 33 static bool exposed_alloc_capable; 34 static bool exposed_mon_capable; 35 static struct mpam_class *mbm_local_class; 36 static struct mpam_class *mbm_total_class; 37 38 /* 39 * MPAM emulates CDP by setting different PARTID in the I/D fields of MPAM1_EL1. 40 * This applies globally to all traffic the CPU generates. 41 */ 42 static bool cdp_enabled; 43 44 /* A dummy mon context to use when the monitors were allocated up front */ > 45 u32 __mon_is_rmid_idx = USE_RMID_IDX; 46 void *mon_is_rmid_idx = &__mon_is_rmid_idx; 47 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
1 0
0 0
[PATCH OLK-6.6] PCI/IOV: Add PCI rescan-remove locking when enabling/disabling SR-IOV
by Ziming Du 22 Dec '25

22 Dec '25
From: Niklas Schnelle <schnelle(a)linux.ibm.com> stable inclusion from stable-v6.6.113 commit 36039348bca77828bf06eae41b8f76e38cd15847 category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/IDATN0 CVE: CVE-2025-40219 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id… -------------------------------- commit 05703271c3cdcc0f2a8cf6ebdc45892b8ca83520 upstream. Before disabling SR-IOV via config space accesses to the parent PF, sriov_disable() first removes the PCI devices representing the VFs. Since commit 9d16947b7583 ("PCI: Add global pci_lock_rescan_remove()") such removal operations are serialized against concurrent remove and rescan using the pci_rescan_remove_lock. No such locking was ever added in sriov_disable() however. In particular when commit 18f9e9d150fc ("PCI/IOV: Factor out sriov_add_vfs()") factored out the PCI device removal into sriov_del_vfs() there was still no locking around the pci_iov_remove_virtfn() calls. On s390 the lack of serialization in sriov_disable() may cause double remove and list corruption with the below (amended) trace being observed: PSW: 0704c00180000000 0000000c914e4b38 (klist_put+56) GPRS: 000003800313fb48 0000000000000000 0000000100000001 0000000000000001 00000000f9b520a8 0000000000000000 0000000000002fbd 00000000f4cc9480 0000000000000001 0000000000000000 0000000000000000 0000000180692828 00000000818e8000 000003800313fe2c 000003800313fb20 000003800313fad8 #0 [3800313fb20] device_del at c9158ad5c #1 [3800313fb88] pci_remove_bus_device at c915105ba #2 [3800313fbd0] pci_iov_remove_virtfn at c9152f198 #3 [3800313fc28] zpci_iov_remove_virtfn at c90fb67c0 #4 [3800313fc60] zpci_bus_remove_device at c90fb6104 #5 [3800313fca0] __zpci_event_availability at c90fb3dca #6 [3800313fd08] chsc_process_sei_nt0 at c918fe4a2 #7 [3800313fd60] crw_collect_info at c91905822 #8 [3800313fe10] kthread at c90feb390 #9 [3800313fe68] __ret_from_fork at c90f6aa64 #10 [3800313fe98] ret_from_fork at c9194f3f2. This is because in addition to sriov_disable() removing the VFs, the platform also generates hot-unplug events for the VFs. This being the reverse operation to the hotplug events generated by sriov_enable() and handled via pdev->no_vf_scan. And while the event processing takes pci_rescan_remove_lock and checks whether the struct pci_dev still exists, the lack of synchronization makes this checking racy. Other races may also be possible of course though given that this lack of locking persisted so long observable races seem very rare. Even on s390 the list corruption was only observed with certain devices since the platform events are only triggered by config accesses after the removal, so as long as the removal finished synchronously they would not race. Either way the locking is missing so fix this by adding it to the sriov_del_vfs() helper. Just like PCI rescan-remove, locking is also missing in sriov_add_vfs() including for the error case where pci_stop_and_remove_bus_device() is called without the PCI rescan-remove lock being held. Even in the non-error case, adding new PCI devices and buses should be serialized via the PCI rescan-remove lock. Add the necessary locking. Fixes: 18f9e9d150fc ("PCI/IOV: Factor out sriov_add_vfs()") Signed-off-by: Niklas Schnelle <schnelle(a)linux.ibm.com> Signed-off-by: Bjorn Helgaas <bhelgaas(a)google.com> Reviewed-by: Benjamin Block <bblock(a)linux.ibm.com> Reviewed-by: Farhan Ali <alifm(a)linux.ibm.com> Reviewed-by: Julian Ruess <julianr(a)linux.ibm.com> Cc: stable(a)vger.kernel.org Link: https://patch.msgid.link/20250826-pci_fix_sriov_disable-v1-1-2d0bc938f2a3@l… Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org> Signed-off-by: Ziming Du <duziming2(a)huawei.com> --- drivers/pci/iov.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c index 54ec841e3e18..2cb477fd8e3b 100644 --- a/drivers/pci/iov.c +++ b/drivers/pci/iov.c @@ -590,15 +590,18 @@ static int sriov_add_vfs(struct pci_dev *dev, u16 num_vfs) if (dev->no_vf_scan) return 0; + pci_lock_rescan_remove(); for (i = 0; i < num_vfs; i++) { rc = pci_iov_add_virtfn(dev, i); if (rc) goto failed; } + pci_unlock_rescan_remove(); return 0; failed: while (i--) pci_iov_remove_virtfn(dev, i); + pci_unlock_rescan_remove(); return rc; } @@ -718,8 +721,10 @@ static void sriov_del_vfs(struct pci_dev *dev) struct pci_sriov *iov = dev->sriov; int i; + pci_lock_rescan_remove(); for (i = 0; i < iov->num_VFs; i++) pci_iov_remove_virtfn(dev, i); + pci_unlock_rescan_remove(); } static void sriov_disable(struct pci_dev *dev) -- 2.43.0
2 1
0 0
[PATCH OLK-5.10] hisi: l3t: enable l3t with specific cpuid
by Wupeng Ma 22 Dec '25

22 Dec '25
hulk inclusion category: bugfix bugzilla: https://atomgit.com/openeuler/kernel/issues/8282 -------------------------------- L3t is only work with specific cpus, now add checker during init to make sure this is enabled with specific cpus. Fixes: c40d971092ff ("hisi: l3t: Add L3 cache driver for hisi") Signed-off-by: Wupeng Ma <mawupeng1(a)huawei.com> --- arch/arm64/include/asm/cputype.h | 2 ++ drivers/soc/hisilicon/l3t.c | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/arch/arm64/include/asm/cputype.h b/arch/arm64/include/asm/cputype.h index b3b1977e9980..ca90d0e13ad6 100644 --- a/arch/arm64/include/asm/cputype.h +++ b/arch/arm64/include/asm/cputype.h @@ -113,6 +113,7 @@ #define HISI_CPU_PART_TSV110 0xD01 #define HISI_CPU_PART_TSV200 0xD02 #define HISI_CPU_PART_LINXICORE9100 0xD02 +#define HISI_CPU_PART_HIP10 0xD03 #define PHYTIUM_CPU_PART_1500A 0X660 #define PHYTIUM_CPU_PART_2000AHK 0X661 @@ -165,6 +166,7 @@ #define MIDR_FUJITSU_A64FX MIDR_CPU_MODEL(ARM_CPU_IMP_FUJITSU, FUJITSU_CPU_PART_A64FX) #define MIDR_HISI_TSV110 MIDR_CPU_MODEL(ARM_CPU_IMP_HISI, HISI_CPU_PART_TSV110) #define MIDR_HISI_TSV200 MIDR_CPU_MODEL(ARM_CPU_IMP_HISI, HISI_CPU_PART_TSV200) +#define MIDR_HISI_HIP10 MIDR_CPU_MODEL(ARM_CPU_IMP_HISI, HISI_CPU_PART_HIP10) #define MIDR_HISI_LINXICORE9100 MIDR_CPU_MODEL(ARM_CPU_IMP_HISI, HISI_CPU_PART_LINXICORE9100) #define MIDR_FT_1500A MIDR_CPU_MODEL(ARM_CPU_IMP_PHYTIUM, PHYTIUM_CPU_PART_1500A) #define MIDR_FT_2000AHK MIDR_CPU_MODEL(ARM_CPU_IMP_PHYTIUM, PHYTIUM_CPU_PART_2000AHK) diff --git a/drivers/soc/hisilicon/l3t.c b/drivers/soc/hisilicon/l3t.c index 35106e091098..69e65d659a35 100644 --- a/drivers/soc/hisilicon/l3t.c +++ b/drivers/soc/hisilicon/l3t.c @@ -264,6 +264,14 @@ static struct platform_driver hisi_l3t_driver = { static int __init hisi_l3t_init(void) { + static const struct midr_range l3t_support_list[] = { + MIDR_ALL_VERSIONS(MIDR_HISI_TSV200), + MIDR_ALL_VERSIONS(MIDR_HISI_HIP10), + {} + }; + if (!is_midr_in_range_list(read_cpuid_id(), l3t_support_list)) + return -ENODEV; + mutex_init(&l3t_mutex); xa_init(&l3t_mapping); -- 2.43.0
2 1
0 0
[openeuler:OLK-6.6 3542/3542] arch/arm64/kvm/vgic/vgic-v4.c:260: warning: Function parameter or member 'vcpu' not described in 'kvm_vgic_get_vcpu_vpeid'
by kernel test robot 22 Dec '25

22 Dec '25
tree: https://gitee.com/openeuler/kernel.git OLK-6.6 head: 04473ee9ed912a16fff0d8846ad565bbf3d63c77 commit: 78feb450c1fbd0f2a1a542882ed62a0993c86c5a [3542/3542] KVM: arm64: GICv4.1: Add support for MBIGEN save/restore config: arm64-randconfig-001-20251215 (https://download.01.org/0day-ci/archive/20251222/202512221812.bA9JN365-lkp@…) compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project 1335a05ab8bc8339ce24be3a9da89d8c3f4e0571) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251222/202512221812.bA9JN365-lkp@…) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp(a)intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202512221812.bA9JN365-lkp@intel.com/ All warnings (new ones prefixed by >>): >> arch/arm64/kvm/vgic/vgic-v4.c:260: warning: Function parameter or member 'vcpu' not described in 'kvm_vgic_get_vcpu_vpeid' Kconfig warnings: (for reference only) WARNING: unmet direct dependencies detected for RESCTRL_FS Depends on [n]: MISC_FILESYSTEMS [=n] && ARCH_HAS_CPU_RESCTRL [=y] Selected by [y]: - ARM64_MPAM [=y] vim +260 arch/arm64/kvm/vgic/vgic-v4.c 253 254 /** 255 * kvm_vgic_get_vcpu_vpeid - Get the VCPU's vpeid 256 * 257 * The vtimer mbigen needs the vcpu vpeid info which will resident. 258 */ 259 u16 kvm_vgic_get_vcpu_vpeid(struct kvm_vcpu *vcpu) > 260 { 261 return vcpu->arch.vgic_cpu.vgic_v3.its_vpe.vpe_id; 262 } 263 #endif 264 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
1 0
0 0
[openeuler:openEuler-1.0-LTS 1944/1944] drivers/gpio/gpio-phytium-platform.c:111:2-3: Unneeded semicolon
by kernel test robot 22 Dec '25

22 Dec '25
tree: https://gitee.com/openeuler/kernel.git openEuler-1.0-LTS head: 4e9c55920995d70b3e88b60c69753df54b03fdf4 commit: 00711bad7e372a30c4975ba43811ffa666aff0e1 [1944/1944] gpio: add phytium gpio driver config: arm64-randconfig-r052-20251217 (https://download.01.org/0day-ci/archive/20251222/202512221720.DJfxv97T-lkp@…) compiler: aarch64-linux-gcc (GCC) 9.5.0 If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp(a)intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202512221720.DJfxv97T-lkp@intel.com/ cocci warnings: (new ones prefixed by >>) >> drivers/gpio/gpio-phytium-platform.c:111:2-3: Unneeded semicolon vim +111 drivers/gpio/gpio-phytium-platform.c 35 36 static int phytium_gpio_probe(struct platform_device *pdev) 37 { 38 struct device *dev = &pdev->dev; 39 struct resource *res; 40 struct phytium_gpio *gpio; 41 struct gpio_irq_chip *girq; 42 struct fwnode_handle *fwnode; 43 int err, irq_count; 44 45 gpio = devm_kzalloc(&pdev->dev, sizeof(*gpio), GFP_KERNEL); 46 if (!gpio) 47 return -ENOMEM; 48 49 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 50 gpio->regs = devm_ioremap_resource(&pdev->dev, res); 51 if (IS_ERR(gpio->regs)) 52 return PTR_ERR(gpio->regs); 53 54 if (!device_get_child_node_count(dev)) 55 return -ENODEV; 56 57 device_for_each_child_node(dev, fwnode) { 58 int idx; 59 60 if (fwnode_property_read_u32(fwnode, "reg", &idx) || 61 idx >= MAX_NPORTS) { 62 dev_err(dev, "missing/invalid port index\n"); 63 fwnode_handle_put(fwnode); 64 return -EINVAL; 65 } 66 67 if (fwnode_property_read_u32(fwnode, "nr-gpios", 68 &gpio->ngpio[idx])) { 69 dev_info(dev, 70 "failed to get number of gpios for Port%c\n", 71 idx ? 'B' : 'A'); 72 gpio->ngpio[idx] = NGPIO_DEFAULT; 73 } 74 } 75 76 /* irq_chip support */ 77 gpio->irq_chip.name = dev_name(dev); 78 gpio->irq_chip.irq_ack = phytium_gpio_irq_ack; 79 gpio->irq_chip.irq_mask = phytium_gpio_irq_mask; 80 gpio->irq_chip.irq_unmask = phytium_gpio_irq_unmask; 81 gpio->irq_chip.irq_set_type = phytium_gpio_irq_set_type; 82 gpio->irq_chip.irq_enable = phytium_gpio_irq_enable; 83 gpio->irq_chip.irq_disable = phytium_gpio_irq_disable; 84 #ifdef CONFIG_SMP 85 gpio->irq_chip.irq_set_affinity = phytium_gpio_irq_set_affinity; 86 #endif 87 raw_spin_lock_init(&gpio->lock); 88 89 gpio->gc.base = -1; 90 gpio->gc.get_direction = phytium_gpio_get_direction; 91 gpio->gc.direction_input = phytium_gpio_direction_input; 92 gpio->gc.direction_output = phytium_gpio_direction_output; 93 gpio->gc.get = phytium_gpio_get; 94 gpio->gc.set = phytium_gpio_set; 95 gpio->gc.ngpio = gpio->ngpio[0] + gpio->ngpio[1]; 96 gpio->gc.label = dev_name(dev); 97 gpio->gc.parent = dev; 98 gpio->gc.owner = THIS_MODULE; 99 100 girq = &gpio->gc.irq; 101 girq->handler = handle_bad_irq; 102 girq->default_type = IRQ_TYPE_NONE; 103 104 for (irq_count = 0; irq_count < gpio->ngpio[0]; irq_count++) { 105 gpio->irq[irq_count] = -ENXIO; 106 gpio->irq[irq_count] = platform_get_irq(pdev, irq_count); 107 if (gpio->irq[irq_count] < 0) { 108 dev_warn(dev, "no irq is found.\n"); 109 break; 110 } > 111 }; 112 113 girq->num_parents = irq_count; 114 girq->parents = gpio->irq; 115 girq->parent_handler = phytium_gpio_irq_handler; 116 117 girq->chip = &gpio->irq_chip; 118 119 err = devm_gpiochip_add_data(dev, &gpio->gc, gpio); 120 if (err) 121 return err; 122 123 platform_set_drvdata(pdev, gpio); 124 dev_info(dev, "Phytium GPIO controller @%pa registered\n", 125 &res->start); 126 127 return 0; 128 } 129 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
1 0
0 0
  • ← Newer
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • ...
  • 2218
  • Older →

HyperKitty Powered by HyperKitty