From 73ee80f7454606afcab781a8e994e400a9587abb Mon Sep 17 00:00:00 2001 From: Jianping Liu Date: Tue, 26 Apr 2022 17:35:16 +0800 Subject: [PATCH 1/6] fix gcc compile floating-point computation program when using option -march=native MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When compile UnixBench, using command as below: gcc -o pgms/float -Wall -pedantic -O0 -march=native -mtune=native -I ./src -DTIME -Ddatum=float src/arith.c It will have an error: src/arith.c: In function ‘dumb_stuff’: src/arith.c:89:5: error: ‘+nofp’ feature modifier is incompatible with floating-point code The root cause is that gcc will read /proc/cpuinfo, get supported features from the line begin with 'Features'. But tk4 haven't 'Features', it using 'flags' instead, which causing gcc can't get the supported features. The correct usage is "Features:" always, just a buggy patch change it to 'flags' stupidly. Now change it back. Signed-off-by: Jianping Liu Signed-off-by: Alex Shi --- arch/arm64/kernel/cpuinfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/kernel/cpuinfo.c b/arch/arm64/kernel/cpuinfo.c index 4fb9e88d466c..7dd5d9cf4f4c 100644 --- a/arch/arm64/kernel/cpuinfo.c +++ b/arch/arm64/kernel/cpuinfo.c @@ -171,7 +171,7 @@ static int c_show(struct seq_file *m, void *v) * rather than attempting to parse this, but there's a body of * software which does already (at least for 32-bit). */ - seq_puts(m, "flags\t\t:"); + seq_puts(m, "Features\t:"); if (compat) { #ifdef CONFIG_COMPAT for (j = 0; compat_hwcap_str[j]; j++) -- Gitee From 816d439713bb94f50c8029f97e701b24b855a5d4 Mon Sep 17 00:00:00 2001 From: Youquan Song Date: Fri, 14 Jul 2023 18:27:24 -0400 Subject: [PATCH 2/6] Fix build error kmem_cache_xxx not defined commit opencloudos. In x86_64-randconfig, below building error was reported: >> arch/x86/events/intel/lbr.c:718:4: error: implicit declaration of >> function 'kmem_cache_free' [-Werror,-Wimplicit-function-declaration] kmem_cache_free(kmem_cache, cpuc->lbr_xsave); ^ arch/x86/events/intel/lbr.c:1596:9: error: implicit declaration of function 'kmem_cache_create' [-Werror,-Wimplicit-function-declaration] return kmem_cache_create("x86_lbr", size, align, 0, NULL); so deliver patch to fix it. Reported-by: kernel test robot Signed-off-by: Youquan Song --- arch/x86/events/intel/lbr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/events/intel/lbr.c b/arch/x86/events/intel/lbr.c index faa798839971..f23a955f96e4 100644 --- a/arch/x86/events/intel/lbr.c +++ b/arch/x86/events/intel/lbr.c @@ -5,7 +5,7 @@ #include #include #include - +#include #include "../perf_event.h" static const enum { -- Gitee From 120e680069f99c0601f0808586acc90bff547059 Mon Sep 17 00:00:00 2001 From: Youquan Song Date: Mon, 24 Jul 2023 09:19:43 -0400 Subject: [PATCH 3/6] Fix build error for NOT_STACK not defined commit opencloudos. In x86_64-randconfig, below build error was reported. In file included from arch/x86/include/asm/smp.h:8: arch/x86/include/asm/thread_info.h: In function 'arch_within_stack_frames': >> arch/x86/include/asm/thread_info.h:212:16: error: 'NOT_STACK' >> undeclared (first use in this function) 212 | return NOT_STACK; | ^~~~~~~~~ so deliver patch to fix it. Reported-by: kernel test robot Signed-off-by: Youquan Song --- arch/x86/include/asm/smp.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/include/asm/smp.h b/arch/x86/include/asm/smp.h index c0538f82c9a2..ff9fe5238924 100644 --- a/arch/x86/include/asm/smp.h +++ b/arch/x86/include/asm/smp.h @@ -5,6 +5,7 @@ #include #include +#include #include #include -- Gitee From a34b6921f5565059f16f36a511db20d6d6e763c9 Mon Sep 17 00:00:00 2001 From: Youquan Song Date: Mon, 24 Jul 2023 14:00:44 -0400 Subject: [PATCH 4/6] Fix build error when CONFIG_IOMMU_API disable commit opencloudos. When CONFIG_IOMMU_API disable, below error will reported. >> include/linux/iommu.h:1115:1: error: expected '=', ',', ';', 'asm' or >> '__attribute__' before '{' token 1115 | { | ^ static inline void (*sva_resume_pasid)(struct device *dev, u32 pasid) > { } So fix it. Reported-by: kernel test robot Signed-off-by: Youquan Song --- include/linux/iommu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/iommu.h b/include/linux/iommu.h index 51e0ebfa9639..48cd105f6ff2 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -1182,7 +1182,7 @@ static inline void sva_suspend_pasid(struct device *dev, u32 pasid) { } -static inline void (*sva_resume_pasid)(struct device *dev, u32 pasid) +static inline void sva_resume_pasid(struct device *dev, u32 pasid) { } -- Gitee From bdf97d5c82aa99f1cfe187884d4151cbc962fbd4 Mon Sep 17 00:00:00 2001 From: Youquan Song Date: Wed, 12 Jul 2023 11:06:44 -0400 Subject: [PATCH 5/6] Build report error when config IOASID disable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit opencloudos. When CONFING_IOASID is not enable, it will report below eror: ./include/linux/ioasid.h:214:9: error: unknown type name ‘ioasid_set_type’ so deliver patch to fix it. Reported-by: kernel test robot Signed-off-by: Youquan Song --- include/linux/ioasid.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/ioasid.h b/include/linux/ioasid.h index 02be9292a74a..1a0d39b463dc 100644 --- a/include/linux/ioasid.h +++ b/include/linux/ioasid.h @@ -211,7 +211,7 @@ static inline ioasid_t ioasid_alloc(struct ioasid_set *set, ioasid_t min, } static inline struct ioasid_set *ioasid_set_alloc(void *token, ioasid_t quota, - ioasid_set_type type) + int type) { return ERR_PTR(-ENOTSUPP); } -- Gitee From bcb0c06d358d712a7e12212586a3228176723e9e Mon Sep 17 00:00:00 2001 From: Youquan Song Date: Sun, 16 Jul 2023 13:07:33 -0400 Subject: [PATCH 6/6] Fix build error for ioasid function declaration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit opencloudos. In randomconfig, when CONFING_IOASID etc. not enable, below build error was reported. drivers/vfio/vfio_iommu_type1.c: In function ‘vfio_iommu_type1_detach_group’: drivers/vfio/vfio_iommu_type1.c:2876:12: error: implicit declaration of function ‘ioasid_user_get_from_task’; did you mean ‘rt_mutex_get_top_task’? [-Werror=implicit-function-declaration] iuser = ioasid_user_get_from_task(current); so fix it. Reported-by: kernel test robot Signed-off-by: Youquan Song --- include/linux/ioasid.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/include/linux/ioasid.h b/include/linux/ioasid.h index 1a0d39b463dc..8d5e6b9fea9f 100644 --- a/include/linux/ioasid.h +++ b/include/linux/ioasid.h @@ -333,5 +333,32 @@ static inline bool ioasid_queue_work(struct work_struct *work) { return false; } + +/* No cgroup control, allocation will proceed until run out total pool */ +static inline int ioasid_cg_charge(struct ioasid_set *set) +{ + return 0; +} + +static inline int ioasid_cg_uncharge(struct ioasid_set *set) +{ + return 0; +} + +static inline struct ioasid_user * +ioasid_user_get_from_task(struct task_struct *task) +{ + return ERR_PTR(-ENOTTY); +} + +static inline void ioasid_user_put(struct ioasid_user *iuser) +{ +} + +static inline void ioasid_user_for_each_id(struct ioasid_user *iuser, void *data, + void (*fn)(ioasid_t id, void *data)) +{ +} + #endif /* CONFIG_IOASID */ #endif /* __LINUX_IOASID_H */ -- Gitee