1. 12 3月, 2021 6 次提交
    • S
      arm64: Uninstall cpu park after cpu up · 246e8d5b
      Sang Yan 提交于
      hulk inclusion
      category: feature
      bugzilla: 48159
      CVE: N/A
      
      ------------------------------
      
      One cpu in PARK state could not come up in this case:
      	CPU 0			    |   CPU 1
      	boot_secondary(cpu 1)	    |
      	--> write_park_exit(cpu 1)  |
      				    |	cpu uping from PARK
      				    |	...
      	uninstall_cpu_park()	    |
      	--> memset to 0 park text   |
      				    |	...
      				    |	Exception in memory !!
      	wait for cpu up		    |
      
      Cpu 1 uping from PARK may trap into exception while cpu 0
      clear cpu 1's park text memory.
      
      This uninstall_cpu_park should be after waiting for cpu up.
      Signed-off-by: NSang Yan <sangyan@huawei.com>
      Reviewed-by: NXiongfeng Wang <wangxiongfeng2@huawei.com>
      Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
      246e8d5b
    • X
      sysrq: avoid concurrently info printing by 'sysrq-trigger' · e4a530d6
      Xiongfeng Wang 提交于
      hulk inclusion
      category: bugfix
      bugzilla: 50623
      CVE: N/A
      
      ------------------------------
      
      When we print system information by echo 't' into 'sysrq-trigger' on
      several cores at the same time, we got the following calltrace.
      
      [ 1352.854632] NMI watchdog: Watchdog detected hard LOCKUP on cpu 6
      [ 1352.854633] Modules linked in: nf_log_arp nf_log_ipv6 nf_log_ipv4 nf_log_common binfmt_misc salsa20_generic camellia_generic cast6_generic cast_common rfkill serpent_generic twofish_generic twofish_common xts lrw tgr192 wp512 rmd320 rmd256 rmd160 rmd128 md4 sha512_generic loop jprob(OE) ip6t_rpfilter ip6t_REJECT nf_reject_ipv6 ipt_REJECT nf_reject_ipv4 xt_conntrack ebtable_nat ip6table_nat nf_nat_ipv6 ip6table_mangle ip6table_raw ip6table_security iptable_nat nf_nat_ipv4 nf_nat iptable_mangle iptable_raw iptable_security nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 libcrc32c ip_set nfnetlink ebtable_filter ebtables ip6table_filter ip6_tables iptable_filter vfat fat hns_roce_hw_v2 hns_roce ib_core aes_ce_blk crypto_simd cryptd aes_ce_cipher ghash_ce sha2_ce ipmi_ssif ofpart sha256_arm64 sha1_ce cmdlinepart
      [ 1352.854649]  hi_sfc ses enclosure mtd sg sbsa_gwdt ipmi_si ipmi_devintf ipmi_msghandler spi_dw_mmio sch_fq_codel ip_tables ext4 mbcache jbd2 sr_mod cdrom sd_mod realtek hclge hisi_sas_v3_hw hisi_sas_main ahci libsas libahci hns3 hinic libata usb_storage hnae3 megaraid_sas scsi_transport_sas i2c_designware_platform i2c_designware_core dm_multipath dm_mirror dm_region_hash dm_log dm_mod [last unloaded: ip_vs]
      [ 1352.854658] CPU: 6 PID: 220569 Comm: sh Kdump: loaded Tainted: G           OEL    4.19.90-vhulk2001.1.0.0026.aarch64 #1
      [ 1352.854659] Hardware name: Huawei TaiShan 200 (Model 2280)/BC82AMDDA, BIOS 1.06 10/29/2019
      [ 1352.854659] pstate: 80400089 (Nzcv daIf +PAN -UAO)
      [ 1352.854660] pc : queued_spin_lock_slowpath+0x1d8/0x2e0
      [ 1352.854660] lr : print_cpu+0x414/0x690
      [ 1352.854660] sp : ffff0001743afb80
      [ 1352.854661] x29: ffff0001743afb80 x28: ffff805fcef6e880
      [ 1352.854662] x27: 0000000000000000 x26: 0000000000000000
      [ 1352.854662] x25: ffff000008cab000 x24: ffff000008cab000
      [ 1352.854663] x23: 0000000000000000 x22: 0000000000000000
      [ 1352.854664] x21: ffff000009478000 x20: 0000000000900001
      [ 1352.854664] x19: ffff000009478d20 x18: ffffffffffffffff
      [ 1352.854665] x17: 0000000000000000 x16: 0000000000000000
      [ 1352.854666] x15: ffff000009273708 x14: ffff00000947af60
      [ 1352.854667] x13: ffff00000947abab x12: ffff00000929d000
      [ 1352.854668] x11: 0000000000006fc8 x10: ffff00000947a1c0
      [ 1352.854668] x9 : 0000000000000001 x8 : 0000000000000000
      [ 1352.854669] x7 : ffff0000092737c8 x6 : ffff803fffc9e1c0
      [ 1352.854670] x5 : 0000000000000000 x4 : ffff803fffc9e1c0
      [ 1352.854671] x3 : ffff000008f5e000 x2 : 00000000001c0000
      [ 1352.854671] x1 : 0000000000000000 x0 : ffff803fffc9e1c8
      [ 1352.854672] Call trace:
      [ 1352.854673]  queued_spin_lock_slowpath+0x1d8/0x2e0
      [ 1352.854673]  print_cpu+0x414/0x690
      [ 1352.854673]  sysrq_sched_debug_show+0x50/0x80
      [ 1352.854674]  show_state_filter+0xc0/0xd0
      [ 1352.854674]  sysrq_handle_showstate+0x18/0x28
      [ 1352.854674]  __handle_sysrq+0xa0/0x190
      [ 1352.854675]  write_sysrq_trigger+0x70/0x88
      [ 1352.854675]  proc_reg_write+0x80/0xd8
      [ 1352.854675]  __vfs_write+0x60/0x190
      [ 1352.854676]  vfs_write+0xac/0x1c0
      [ 1352.854676]  ksys_write+0x74/0xf0
      [ 1352.854676]  __arm64_sys_write+0x24/0x30
      [ 1352.854677]  el0_svc_common+0x78/0x130
      [ 1352.854677]  el0_svc_handler+0x38/0x78
      [ 1352.854677]  el0_svc+0x8/0xc
      [ 1352.854678] Kernel panic - not syncing: Hard LOCKUP
      [ 1352.854679] CPU: 6 PID: 220569 Comm: sh Kdump: loaded Tainted: G           OEL    4.19.90-vhulk2001.1.0.0026.aarch64 #1
      [ 1352.854679] Hardware name: Huawei TaiShan 200 (Model 2280)/BC82AMDDA, BIOS 1.06 10/29/2019
      [ 1352.854679] Call trace:
      [ 1352.854680]  dump_backtrace+0x0/0x198
      [ 1352.854680]  show_stack+0x24/0x30
      [ 1352.854681]  dump_stack+0xa4/0xc4
      [ 1352.854681]  panic+0x130/0x304
      [ 1352.854681]  __stack_chk_fail+0x0/0x28
      [ 1352.854682]  watchdog_hardlockup_check+0x138/0x140
      [ 1352.854682]  sdei_watchdog_callback+0x20/0x30
      [ 1352.854682]  sdei_event_handler+0x50/0xf0
      [ 1352.854683]  __sdei_handler+0xd8/0x228
      [ 1352.854683]  __sdei_asm_handler+0xbc/0x134
      [ 1352.854683]  queued_spin_lock_slowpath+0x1d8/0x2e0
      [ 1352.854684]  print_cpu+0x414/0x690
      [ 1352.854684]  sysrq_sched_debug_show+0x50/0x80
      [ 1352.854684]  show_state_filter+0xc0/0xd0
      [ 1352.854685]  sysrq_handle_showstate+0x18/0x28
      [ 1352.854685]  __handle_sysrq+0xa0/0x190
      [ 1352.854685]  write_sysrq_trigger+0x70/0x88
      [ 1352.854686]  proc_reg_write+0x80/0xd8
      [ 1352.854686]  __vfs_write+0x60/0x190
      [ 1352.854686]  vfs_write+0xac/0x1c0
      [ 1352.854687]  ksys_write+0x74/0xf0
      [ 1352.854687]  __arm64_sys_write+0x24/0x30
      [ 1352.854687]  el0_svc_common+0x78/0x130
      [ 1352.854688]  el0_svc_handler+0x38/0x78
      [ 1352.854688]  el0_svc+0x8/0xc
      
      It is because there are many processes in the system. 'print_cpu()'
      aquires 'sched_debug_lock', print some information, and releases
      'sched_debug_lock'. This procedure takes about 4 seconds in our
      testcase. When four cores concurrently print system info by sysrq, it
      will takes the last core 12 seconds to get the spinlock. This will
      cause a hardlockup.
      Signed-off-by: NKai Shen <shenkai8@huawei.com>
      Signed-off-by: NXiongfeng Wang <wangxiongfeng2@huawei.com>
      Reviewed-By: NXie XiuQi <xiexiuqi@huawei.com>
      Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
      Signed-off-by: NXiongfeng Wang <wangxiongfeng2@huawei.com>
      Reviewed-by: NXie XiuQi <xiexiuqi@huawei.com>
      Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
      e4a530d6
    • W
      cacheinfo: workaround cacheinfo's info_list uninitialized error · 21aa6036
      Wang ShaoBo 提交于
      hulk inclusion
      category: bugfix
      bugzilla: 48265
      CVE: NA
      
      --------------------------------
      
      Workaround cacheinfo's info_list uninitialized error in some special
      cases, such as free_cache_attributes() free info_list but not set
      num_leaves to zero when PPTT is not supported. this solution lasts
      until upstream issue resolved.
      
      Fixes: 950e5edb ("drivers: base: cacheinfo: Add helper to search cacheinfo by of_node")
      Fixes: 709c4362 ("cacheinfo: Move resctrl's get_cache_id() to the cacheinfo header file")
      Signed-off-by: NWang ShaoBo <bobo.shaobowang@huawei.com>
      Reviewed-by: NJian Cheng <cj.chengjian@huawei.com>
      Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
      21aa6036
    • S
      park: Reserve park mem before kexec reserved · 1b059882
      Sang Yan 提交于
      hulk inclusion
      category: feature
      bugzilla: 48159
      CVE: N/A
      
      ------------------------------
      
      reserve_crashkernel or reserve_quick_kexec may find one sutiable
      memory region and reserves it, which address of the region is
      not fixed.
      
      As a result, cpu park reserves memory could be failed while
      specified address used by crashkernel or quickkexec.
      
      So, move reserve_park_mem before reserve_crashkernel and
      reserve_quick_kexec.
      
      Signed-off-by: Sang Yan <sangyan(a)huawei.com>
      Reviewed-by: Jing Xiangfeng <jingxiangfeng(a)huawei.com>
      Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
      1b059882
    • Z
      pmem: Enable legacy pmem on openEuler · 22d02cc6
      ZhuLing 提交于
      hulk inclusion
      category: feature
      bugzilla: 48159
      CVE: NA
      
      ------------------------------
      
      Enable legacy pmem on openEuler defconfig both
      arm64 and x86
      
      Signed-off-by: ZhuLing <zhuling8(a)huawei.com>
      Signed-off-by: Sang Yan <sangyan(a)huawei.com>
      Acked-by: Hanjun Guo <guohanjun(a)huawei.com>
      Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
      22d02cc6
    • Z
      arm64: Add memmap parameter and register pmem · 0b88c13e
      ZhuLing 提交于
      hulk inclusion
      category: feature
      bugzilla: 48159
      CVE: NA
      
      ------------------------------
      
      Register pmem in arm64:
      Use memmap(memmap=nn[KMG]!ss[KMG]) reserve memory and
      e820(driver/nvdimm/e820.c) function to register persistent
      memory in arm64. when the kernel restart or update, the data
      in PMEM will not be lost and can be loaded faster. this is a
      general features.
      
      driver/nvdimm/e820.c:
      The function of this file is scan "iomem_resource" and take
      advantage of nvdimm resource discovery mechanism by registering
      a resource named "Persistent Memory (legacy)", this function
      doesn't depend on architecture.
      
      We will push the feature to linux kernel community and discuss to
      modify the file name. because people have a mistaken notion that
      the e820.c is depend on x86.
      
      If you want use this features, you need do as follows:
      1.Reserve memory: add memmap to reserve memory in grub.cfg
        memmap=nn[KMG]!ss[KMG] exp:memmap=100K!0x1a0000000.
      2.Insmod nd_e820.ko: modprobe nd_e820.
      3.Check pmem device in /dev exp: /dev/pmem0
      
      Signed-off-by: ZhuLing <zhuling8(a)huawei.com>
      Signed-off-by: Sang Yan <sangyan(a)huawei.com>
      Acked-by: Hanjun Guo <guohanjun(a)huawei.com>
      Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
      0b88c13e
  2. 11 3月, 2021 2 次提交
  3. 08 3月, 2021 2 次提交
    • X
      arm64: ipi_nmi: fix compile error when CONFIG_KGDB is disabled · 227d5adb
      Xiongfeng Wang 提交于
      hulk inclusion
      category: bugfix
      bugzilla: 50485
      CVE: NA
      
      -------------------------------------------------------------------------
      
      Fix the following compile error.
      
      arch/arm64/kernel/ipi_nmi.c: In function ‘ipi_nmi_handler’:
      arch/arm64/kernel/ipi_nmi.c:54:7: error: implicit declaration of function ‘kgdb_nmicallback’ [-Werror=implicit-function-declaration]
        if (!kgdb_nmicallback(cpu, get_irq_regs()))
             ^~~~~~~~~~~~~~~~
      Signed-off-by: NXiongfeng Wang <wangxiongfeng2@huawei.com>
      Reviewed-by: NXie XiuQi <xiexiuqi@huawei.com>
      Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
      227d5adb
    • F
      kbuild: fix compile error in Makefile.lib · c7245434
      Fang Yafen 提交于
      raspberrypi inclusion
      category: feature
      bugzilla: 50432
      
      ------------------------------
      
      Fix the following compile error when using bcm2711_defconfig (for RPi).
      
      /bin/sh: -c: line 0: syntax error near unexpected token `('
      /bin/sh: -c: line 0: `set -e;
      echo '  DTCO    arch/arm64/boot/dts/overlays/act-led.dtbo';
      mkdir -p arch/arm64/boot/dts/overlays/ ;
      gcc -E -Wp,-MMD,arch/arm64/boot/dts/overlays/.act-led.dtbo.d.pre.tmp
      -nostdinc -I./scripts/dtc/include-prefixes -undef -D__DTS__
      -x assembler-with-cpp
      -o arch/arm64/boot/dts/overlays/.act-led.dtbo.dts.tmp
      arch/arm64/boot/dts/overlays/act-led-overlay.dts ;
      ./scripts/dtc/dtc -@ -H epapr -O dtb
      -o arch/arm64/boot/dts/overlays/act-led.dtbo -b 0
      -i arch/arm64/boot/dts/overlays/ -Wno-interrupt_provider
      -Wno-unit_address_vs_reg -Wno-unit_address_format -Wno-gpios_property
      -Wno-avoid_unnecessary_addr_size -Wno-alias_paths
      -Wno-graph_child_address -Wno-simple_bus_reg
      -Wno-unique_unit_address -Wno-pci_device_reg
      -Wno-interrupts_property ifeq (y,y) -Wno-label_is_string
      -Wno-reg_format -Wno-pci_device_bus_num -Wno-i2c_bus_reg
      -Wno-spi_bus_reg -Wno-avoid_default_addr_size endif
      -d arch/arm64/boot/dts/overlays/.act-led.dtbo.d.dtc.tmp
      arch/arm64/boot/dts/overlays/.act-led.dtbo.dts.tmp ;
      cat ...; rm -f arch/arm64/boot/dts/overlays/.act-led.dtbo.d'
      make[2]: *** [scripts/Makefile.lib;363:
      arch/arm64/boot/dts/overlays/act-led.dtbo] Error 1
      make[2]: *** Waiting for unfinished jobs....
      
      Related patches:
      
      ffa2d13c BCM2708: Add core Device Tree support
      4894352e kbuild: Silence unavoidable dtc overlay warnings
      a4a4d07f kbuild: keep the original function for non-RPi
      
      Signed-off-by: Fang Yafen <yafen(a)iscas.ac.cn>
      Reviewed-by: NXie XiuQi <xiexiuqi@huawei.com>
      Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
      c7245434
  4. 05 3月, 2021 10 次提交
  5. 04 3月, 2021 20 次提交