From b59b84b711333b46acecaaf3f6a328a5d8a9b465 Mon Sep 17 00:00:00 2001 From: Mingzheng Xing Date: Tue, 10 Dec 2024 20:48:25 +0800 Subject: [PATCH] riscv: upgrade to 6.6.0-64 and fixed compilation errors reported by clang riscv kernel patch rebase to 6.6.0-64.0.0, and fixed some compilation errors reported by clang. Signed-off-by: Mingzheng Xing --- 0001-riscv-kernel.patch | 74 ++++++++++++++++++++--------------------- kernel.spec | 6 +++- 2 files changed, 42 insertions(+), 38 deletions(-) diff --git a/0001-riscv-kernel.patch b/0001-riscv-kernel.patch index 96c232d..31a860c 100644 --- a/0001-riscv-kernel.patch +++ b/0001-riscv-kernel.patch @@ -1,6 +1,6 @@ -From e8d4f3e7e16b207b835e27367d61e6c9bb96dfb3 Mon Sep 17 00:00:00 2001 +From e71d7cb54ac724161d5753280d5d0c2ef6f5484d Mon Sep 17 00:00:00 2001 From: Mingzheng Xing -Date: Tue, 3 Dec 2024 15:18:20 +0800 +Date: Tue, 10 Dec 2024 20:35:26 +0800 Subject: [PATCH] riscv kernel Signed-off-by: Mingzheng Xing @@ -19764,7 +19764,7 @@ index 324e8cd9b502..a9f4af9f7f3f 100644 local_flush_tlb_page_asid(start, asid); start += stride; diff --git a/drivers/char/ipmi/ipmi_si_hardcode.c b/drivers/char/ipmi/ipmi_si_hardcode.c -index ed5e91b1e040..210644f3d863 100644 +index 0c92fa3eee88..3cb4ceb53635 100644 --- a/drivers/char/ipmi/ipmi_si_hardcode.c +++ b/drivers/char/ipmi/ipmi_si_hardcode.c @@ -6,7 +6,7 @@ @@ -25022,10 +25022,10 @@ index 000000000000..8bf7a18776f8 + return clk; +} diff --git a/drivers/cpufreq/Kconfig b/drivers/cpufreq/Kconfig -index d1fdea27eb0d..76d6ebda8b8e 100644 +index 1389f095e2e5..0f821fa01df8 100644 --- a/drivers/cpufreq/Kconfig +++ b/drivers/cpufreq/Kconfig -@@ -346,5 +346,14 @@ config QORIQ_CPUFREQ +@@ -366,5 +366,14 @@ config QORIQ_CPUFREQ This adds the CPUFreq driver support for Freescale QorIQ SoCs which are capable of changing the CPU's frequency dynamically. @@ -25041,10 +25041,10 @@ index d1fdea27eb0d..76d6ebda8b8e 100644 endif endmenu diff --git a/drivers/cpufreq/Makefile b/drivers/cpufreq/Makefile -index f9c1c9012ce7..19632122eec8 100644 +index 0950869f1809..df2bb1149b4a 100644 --- a/drivers/cpufreq/Makefile +++ b/drivers/cpufreq/Makefile -@@ -110,3 +110,4 @@ obj-$(CONFIG_SPARC_US2E_CPUFREQ) += sparc-us2e-cpufreq.o +@@ -111,3 +111,4 @@ obj-$(CONFIG_SPARC_US2E_CPUFREQ) += sparc-us2e-cpufreq.o obj-$(CONFIG_SPARC_US3_CPUFREQ) += sparc-us3-cpufreq.o obj-$(CONFIG_SW64_CPUFREQ) += sw64_cpufreq.o obj-$(CONFIG_SW64_CPUFREQ_DEBUGFS) += sw64_cpufreq_debugfs.o @@ -347033,10 +347033,10 @@ index 000000000000..e25cc243c9bc +int i2c_dw_xfer_dma_deinit(struct dw_i2c_dev *dev); + diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c -index c818e9d14b9a..9c770579d80f 100644 +index 11a75130a109..d712a7e418d7 100644 --- a/drivers/i2c/busses/i2c-designware-platdrv.c +++ b/drivers/i2c/busses/i2c-designware-platdrv.c -@@ -321,6 +321,8 @@ static int dw_i2c_plat_probe(struct platform_device *pdev) +@@ -322,6 +322,8 @@ static int dw_i2c_plat_probe(struct platform_device *pdev) if (has_acpi_companion(&pdev->dev)) i2c_dw_acpi_configure(&pdev->dev); @@ -438812,7 +438812,7 @@ index 000000000000..ef46c46678ed + size_t vendor_id_list_num); +#endif diff --git a/drivers/pci/msi/msi.c b/drivers/pci/msi/msi.c -index 785bbf637ab5..03e66832402d 100644 +index 4eea161663b1..1222da5cdc89 100644 --- a/drivers/pci/msi/msi.c +++ b/drivers/pci/msi/msi.c @@ -12,6 +12,7 @@ @@ -438823,7 +438823,7 @@ index 785bbf637ab5..03e66832402d 100644 #ifdef CONFIG_HISI_VIRTCCA_CODA #include -@@ -844,66 +845,70 @@ int __pci_enable_msix_range(struct pci_dev *dev, struct msix_entry *entries, int +@@ -850,66 +851,70 @@ int __pci_enable_msix_range(struct pci_dev *dev, struct msix_entry *entries, int } #endif @@ -451315,7 +451315,7 @@ index 000000000000..d2775de1c477 + */ diff --git a/drivers/soc/xuantie/nna/img_mem/img_mem_carveout.c b/drivers/soc/xuantie/nna/img_mem/img_mem_carveout.c new file mode 100644 -index 000000000000..0dcc4b1ca742 +index 000000000000..9354fa77313f --- /dev/null +++ b/drivers/soc/xuantie/nna/img_mem/img_mem_carveout.c @@ -0,0 +1,854 @@ @@ -451532,12 +451532,12 @@ index 000000000000..0dcc4b1ca742 + struct heap *heap; + + if (!buffer) -+ return NULL; ++ return 0; + + heap = buffer->heap; + + if (carveout_heap_map_km(heap, buffer)) -+ return NULL; ++ return 0; + + pr_debug("%s:%d buffer %d kptr 0x%p\n", __func__, __LINE__, + buffer->id, buffer->kptr); @@ -456386,7 +456386,7 @@ index 000000000000..5771da9812e8 + */ diff --git a/drivers/soc/xuantie/nna/img_mem/img_mem_unified.c b/drivers/soc/xuantie/nna/img_mem/img_mem_unified.c new file mode 100644 -index 000000000000..c19f494e4c16 +index 000000000000..77c8dbab5fc3 --- /dev/null +++ b/drivers/soc/xuantie/nna/img_mem/img_mem_unified.c @@ -0,0 +1,1060 @@ @@ -456707,12 +456707,12 @@ index 000000000000..c19f494e4c16 + struct heap *heap; + + if (!buffer) -+ return NULL; ++ return 0; + + heap = buffer->heap; + + if (unified_map_km(heap, buffer)) -+ return NULL; ++ return 0; + + pr_debug("%s:%d buffer %d kptr 0x%p\n", __func__, __LINE__, + buffer->id, buffer->kptr); @@ -517928,7 +517928,7 @@ index 000000000000..b28f5a6d08fd +exit $? diff --git a/drivers/soc/xuantie/vpu-vc8000d-kernel/linux/memalloc/memalloc.c b/drivers/soc/xuantie/vpu-vc8000d-kernel/linux/memalloc/memalloc.c new file mode 100644 -index 000000000000..d9af14688879 +index 000000000000..fe596b0be9f6 --- /dev/null +++ b/drivers/soc/xuantie/vpu-vc8000d-kernel/linux/memalloc/memalloc.c @@ -0,0 +1,369 @@ @@ -518068,13 +518068,13 @@ index 000000000000..d9af14688879 + + if (_IOC_DIR(cmd) & _IOC_READ) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0) -+ ret = !access_ok(arg, _IOC_SIZE(cmd)); ++ ret = !access_ok((const void *)arg, _IOC_SIZE(cmd)); +#else + ret = !access_ok(VERIFY_WRITE, arg, _IOC_SIZE(cmd)); +#endif + else if (_IOC_DIR(cmd) & _IOC_WRITE) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0) -+ ret = !access_ok(arg, _IOC_SIZE(cmd)); ++ ret = !access_ok((const void *)arg, _IOC_SIZE(cmd)); +#else + ret = !access_ok(VERIFY_READ, arg, _IOC_SIZE(cmd)); +#endif @@ -532520,7 +532520,7 @@ index 000000000000..2642d4184d72 \ No newline at end of file diff --git a/drivers/soc/xuantie/vpu-vc8000d-kernel/linux/subsys_driver/hantro_vcmd.c b/drivers/soc/xuantie/vpu-vc8000d-kernel/linux/subsys_driver/hantro_vcmd.c new file mode 100644 -index 000000000000..75e6851e9209 +index 000000000000..aab7ac27e9b7 --- /dev/null +++ b/drivers/soc/xuantie/vpu-vc8000d-kernel/linux/subsys_driver/hantro_vcmd.c @@ -0,0 +1,4342 @@ @@ -533634,7 +533634,7 @@ index 000000000000..75e6851e9209 + new_status_cmdbuf_addr->mmu_bus_address=vcmd_status_buf_mem_pool.mmu_bus_address + cmdbuf_used_pos*CMDBUF_MAX_SIZE; + new_status_cmdbuf_addr->size=CMDBUF_MAX_SIZE; + new_status_cmdbuf_addr->cmdbuf_id = cmdbuf_used_pos; -+ global_cmdbuf_node[cmdbuf_used_pos]=0x55555555; //temp set it,for another thread not hit cmdbuf_used[x] set but global_cmdbuf_node[x] is null ++ global_cmdbuf_node[cmdbuf_used_pos]=(struct bi_list_node *)0x55555555; //temp set it,for another thread not hit cmdbuf_used[x] set but global_cmdbuf_node[x] is null + cmdbuf_used_pos++; + if(cmdbuf_used_pos>=TOTAL_DISCRETE_CMDBUF_NUM) + cmdbuf_used_pos=0; @@ -535392,7 +535392,7 @@ index 000000000000..75e6851e9209 + pr_info("Init: vcmd_buf_mem_pool.mmu_bus_address=0x%llx.\n",(long long unsigned int)vcmd_buf_mem_pool.mmu_bus_address); + } + -+ vcmd_status_buf_mem_pool.busAddress = (void *)vcmd_buf_mem_pool.busAddress+CMDBUF_POOL_TOTAL_SIZE; ++ vcmd_status_buf_mem_pool.busAddress = (unsigned long long)vcmd_buf_mem_pool.busAddress+CMDBUF_POOL_TOTAL_SIZE; + vcmd_status_buf_mem_pool.virtualAddress = (void *)vcmd_buf_mem_pool.virtualAddress+CMDBUF_POOL_TOTAL_SIZE; + vcmd_status_buf_mem_pool.size =CMDBUF_POOL_TOTAL_SIZE; + pr_info("Init: vcmd_status_buf_mem_pool.busAddress=0x%llx.\n",(long long unsigned int)vcmd_status_buf_mem_pool.busAddress); @@ -535411,7 +535411,7 @@ index 000000000000..75e6851e9209 + pr_info("Init: vcmd_status_buf_mem_pool.mmu_bus_address=0x%llx.\n",(long long unsigned int)vcmd_status_buf_mem_pool.mmu_bus_address); + } + -+ vcmd_registers_mem_pool.busAddress = (void *)vcmd_buf_mem_pool.busAddress+CMDBUF_POOL_TOTAL_SIZE*2; ++ vcmd_registers_mem_pool.busAddress = (unsigned long long)vcmd_buf_mem_pool.busAddress+CMDBUF_POOL_TOTAL_SIZE*2; + vcmd_registers_mem_pool.virtualAddress = (void *)vcmd_buf_mem_pool.virtualAddress+CMDBUF_POOL_TOTAL_SIZE*2; + vcmd_registers_mem_pool.size =CMDBUF_VCMD_REGISTER_TOTAL_SIZE; + pr_info("Init: vcmd_registers_mem_pool.busAddress=0x%llx.\n",(long long unsigned int)vcmd_registers_mem_pool.busAddress); @@ -537473,7 +537473,7 @@ index 000000000000..42f67759dd33 +#endif /* !_VC8000_VCMD_DRIVER_H_ */ diff --git a/drivers/soc/xuantie/vpu-vc8000d-kernel/linux/subsys_driver/kernel_allocator.c b/drivers/soc/xuantie/vpu-vc8000d-kernel/linux/subsys_driver/kernel_allocator.c new file mode 100644 -index 000000000000..5ec19e2a58f0 +index 000000000000..64db436d7bba --- /dev/null +++ b/drivers/soc/xuantie/vpu-vc8000d-kernel/linux/subsys_driver/kernel_allocator.c @@ -0,0 +1,1296 @@ @@ -538640,9 +538640,9 @@ index 000000000000..5ec19e2a58f0 + if (_IOC_NR(cmd) > MEMORY_IOC_MAXNR) return EINVAL; + + if (_IOC_DIR(cmd) & _IOC_READ) -+ ret = !access_ok(arg, _IOC_SIZE(cmd)); ++ ret = !access_ok((const void *)arg, _IOC_SIZE(cmd)); + else if (_IOC_DIR(cmd) & _IOC_WRITE) -+ ret = !access_ok(arg, _IOC_SIZE(cmd)); ++ ret = !access_ok((const void *)arg, _IOC_SIZE(cmd)); + if (ret) return EINVAL; + + switch (cmd) @@ -545835,7 +545835,7 @@ index 000000000000..ba2fbc474726 + diff --git a/drivers/soc/xuantie/vpu-vc8000e-kernel/linux/kernel_module/vc8000_vcmd_driver.c b/drivers/soc/xuantie/vpu-vc8000e-kernel/linux/kernel_module/vc8000_vcmd_driver.c new file mode 100644 -index 000000000000..8237432f9487 +index 000000000000..899154303904 --- /dev/null +++ b/drivers/soc/xuantie/vpu-vc8000e-kernel/linux/kernel_module/vc8000_vcmd_driver.c @@ -0,0 +1,5594 @@ @@ -546972,7 +546972,7 @@ index 000000000000..8237432f9487 + new_status_cmdbuf_addr->mmu_bus_address=vcmd_status_buf_mem_pool.mmu_bus_address + cmdbuf_used_pos*CMDBUF_MAX_SIZE; + new_status_cmdbuf_addr->size=CMDBUF_MAX_SIZE; + new_status_cmdbuf_addr->cmdbuf_id = cmdbuf_used_pos; -+ global_cmdbuf_node[cmdbuf_used_pos]=0x55555555; //temp set it,for another thread not hit cmdbuf_used[x] set but global_cmdbuf_node[x] is null ++ global_cmdbuf_node[cmdbuf_used_pos]=(struct bi_list_node *)0x55555555; //temp set it,for another thread not hit cmdbuf_used[x] set but global_cmdbuf_node[x] is null + cmdbuf_used_pos++; + if(cmdbuf_used_pos>=TOTAL_DISCRETE_CMDBUF_NUM) + cmdbuf_used_pos=0; @@ -549562,7 +549562,7 @@ index 000000000000..8237432f9487 + } + pr_info("Init: vcmd_buf_mem_pool.virtualAddress=0x%llx.\n",(long long unsigned int)vcmd_buf_mem_pool.virtualAddress); + -+ vcmd_status_buf_mem_pool.busAddress = (void *)vcmd_buf_mem_pool.busAddress+CMDBUF_POOL_TOTAL_SIZE; ++ vcmd_status_buf_mem_pool.busAddress = (unsigned long long)vcmd_buf_mem_pool.busAddress+CMDBUF_POOL_TOTAL_SIZE; + vcmd_status_buf_mem_pool.virtualAddress = (void *)vcmd_buf_mem_pool.virtualAddress+CMDBUF_POOL_TOTAL_SIZE; + vcmd_status_buf_mem_pool.size =CMDBUF_POOL_TOTAL_SIZE; + pr_info("Init: vcmd_status_buf_mem_pool.busAddress=0x%llx.\n",(long long unsigned int)vcmd_status_buf_mem_pool.busAddress); @@ -549573,7 +549573,7 @@ index 000000000000..8237432f9487 + } + pr_info("Init: vcmd_status_buf_mem_pool.virtualAddress=0x%llx.\n",(long long unsigned int)vcmd_status_buf_mem_pool.virtualAddress); + -+ vcmd_registers_mem_pool.busAddress = (void *)vcmd_buf_mem_pool.busAddress+CMDBUF_POOL_TOTAL_SIZE*2; ++ vcmd_registers_mem_pool.busAddress = (unsigned long long)vcmd_buf_mem_pool.busAddress+CMDBUF_POOL_TOTAL_SIZE*2; + vcmd_registers_mem_pool.virtualAddress = (void *)vcmd_buf_mem_pool.virtualAddress+CMDBUF_POOL_TOTAL_SIZE*2; + vcmd_registers_mem_pool.size =CMDBUF_VCMD_REGISTER_TOTAL_SIZE; + pr_info("Init: vcmd_registers_mem_pool.busAddress=0x%llx.\n",(long long unsigned int)vcmd_registers_mem_pool.busAddress); @@ -552246,7 +552246,7 @@ index 000000000000..bf30d17ce373 +/* This part must be outside protection */ +#include diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig -index 60826b7ed21e..9c76faf7b780 100644 +index e3217ce5a3f6..2ec45d7ba95a 100644 --- a/drivers/spi/Kconfig +++ b/drivers/spi/Kconfig @@ -295,6 +295,12 @@ config SPI_DAVINCI @@ -552263,7 +552263,7 @@ index 60826b7ed21e..9c76faf7b780 100644 tristate "DesignWare SPI controller core support" imply SPI_MEM diff --git a/drivers/spi/Makefile b/drivers/spi/Makefile -index 26bf16fcf890..aa2e8c603264 100644 +index d6fdb887d97d..796f764ff554 100644 --- a/drivers/spi/Makefile +++ b/drivers/spi/Makefile @@ -43,6 +43,7 @@ obj-$(CONFIG_SPI_COLDFIRE_QSPI) += spi-coldfire-qspi.o @@ -556838,10 +556838,10 @@ index 000000000000..cfb1f017480c + +#endif /* __VS_DRM_H__ */ diff --git a/init/Kconfig b/init/Kconfig -index 2d6ae58a5bf7..430fe23eb2ae 100644 +index 1840935e919c..6ba464555bf7 100644 --- a/init/Kconfig +++ b/init/Kconfig -@@ -2161,6 +2161,9 @@ source "kernel/Kconfig.locks" +@@ -2163,6 +2163,9 @@ source "kernel/Kconfig.locks" config ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE bool @@ -556907,10 +556907,10 @@ index 462571b26f88..c456af8136c4 100644 ++*switch_count; diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c -index 2ef32e806f54..f6303ef63ca6 100644 +index fadc59328e3b..87e1f37996a6 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c -@@ -10594,6 +10594,9 @@ int can_migrate_task(struct task_struct *p, struct lb_env *env) +@@ -10590,6 +10590,9 @@ int can_migrate_task(struct task_struct *p, struct lb_env *env) if (kthread_is_per_cpu(p)) return 0; diff --git a/kernel.spec b/kernel.spec index ba7bcbd..e6b39b1 100644 --- a/kernel.spec +++ b/kernel.spec @@ -41,7 +41,7 @@ rm -f test_openEuler_sign.ko test_openEuler_sign.ko.sig %global upstream_sublevel 0 %global devel_release 64 %global maintenance_release .0.0 -%global pkg_release .68 +%global pkg_release .69 %global openeuler_lts 1 %global openeuler_major 2403 @@ -1087,6 +1087,10 @@ fi %endif %changelog +* Tue Dec 10 2024 Mingzheng Xing - 6.6.0-64.0.0.69 +- riscv kernel upgrade to 6.6.0-64.0.0 +- Fix some compilation errors reported by clang. + * Tue Dec 10 2024 ZhangPeng - 6.6.0-64.0.0.68 - !14106 uacce: some bugfix and cleanup - migration: modify dfx error type without VM driver