Kernel
Threads by month
- ----- 2025 -----
- 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
- 52 participants
- 19133 discussions

15 Apr '25
From: Ard Biesheuvel <ardb(a)kernel.org>
mainline inclusion
from mainline-v6.14-rc5
commit 73cfc53cc3b6380eccf013049574485f64cb83ca
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IC10DU
CVE: NA
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?…
--------------------------------
A C jump table (such as the one used by the BPF interpreter) is a const
global array of absolute code addresses, and this means that the actual
values in the table may not be known until the kernel is booted (e.g.,
when using KASLR or when the kernel VA space is sized dynamically).
When using PIE codegen, the compiler will default to placing such const
global objects in .data.rel.ro (which is annotated as writable), rather
than .rodata (which is annotated as read-only). As C jump tables are
explicitly emitted into .rodata, this used to result in warnings for
LoongArch builds (which uses PIE codegen for the entire kernel) like
Warning: setting incorrect section attributes for .rodata..c_jump_table
due to the fact that the explicitly specified .rodata section inherited
the read-write annotation that the compiler uses for such objects when
using PIE codegen.
This warning was suppressed by explicitly adding the read-only
annotation to the __attribute__((section(""))) string, by commit
c5b1184decc8 ("compiler.h: specify correct attribute for .rodata..c_jump_table")
Unfortunately, this hack does not work on Clang's integrated assembler,
which happily interprets the appended section type and permission
specifiers as part of the section name, which therefore no longer
matches the hard-coded pattern '.rodata..c_jump_table' that objtool
expects, causing it to emit a warning
kernel/bpf/core.o: warning: objtool: ___bpf_prog_run+0x20: sibling call from callable instruction with modified stack frame
Work around this, by emitting C jump tables into .data.rel.ro instead,
which is treated as .rodata by the linker script for all builds, not
just PIE based ones.
Fixes: c5b1184decc8 ("compiler.h: specify correct attribute for .rodata..c_jump_table")
Tested-by: Tiezhu Yang <yangtiezhu(a)loongson.cn> # on LoongArch
Signed-off-by: Ard Biesheuvel <ardb(a)kernel.org>
Link: https://lore.kernel.org/r/20250221135704.431269-6-ardb+git@google.com
Signed-off-by: Josh Poimboeuf <jpoimboe(a)kernel.org>
---
include/linux/compiler.h | 2 +-
tools/objtool/check.c | 7 ++++---
tools/objtool/include/objtool/special.h | 2 +-
3 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index db140f106f3d..c61c59e26e1b 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -133,7 +133,7 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val,
#define annotate_unreachable() __annotate_unreachable(__COUNTER__)
/* Annotate a C jump table to allow objtool to follow the code flow */
-#define __annotate_jump_table __section(".rodata..c_jump_table,\"a\",@progbits #")
+#define __annotate_jump_table __section(".data.rel.ro.c_jump_table")
#else /* !CONFIG_OBJTOOL */
#define annotate_reachable()
diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index 6e9dd6d6db37..c88131a4b1d3 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -2559,13 +2559,14 @@ static void mark_rodata(struct objtool_file *file)
*
* - .rodata: can contain GCC switch tables
* - .rodata.<func>: same, if -fdata-sections is being used
- * - .rodata..c_jump_table: contains C annotated jump tables
+ * - .data.rel.ro.c_jump_table: contains C annotated jump tables
*
* .rodata.str1.* sections are ignored; they don't contain jump tables.
*/
for_each_sec(file, sec) {
- if (!strncmp(sec->name, ".rodata", 7) &&
- !strstr(sec->name, ".str1.")) {
+ if ((!strncmp(sec->name, ".rodata", 7) &&
+ !strstr(sec->name, ".str1.")) ||
+ !strncmp(sec->name, ".data.rel.ro", 12)) {
sec->rodata = true;
found = true;
}
diff --git a/tools/objtool/include/objtool/special.h b/tools/objtool/include/objtool/special.h
index 86d4af9c5aa9..89ee12b1a138 100644
--- a/tools/objtool/include/objtool/special.h
+++ b/tools/objtool/include/objtool/special.h
@@ -10,7 +10,7 @@
#include <objtool/check.h>
#include <objtool/elf.h>
-#define C_JUMP_TABLE_SECTION ".rodata..c_jump_table"
+#define C_JUMP_TABLE_SECTION ".data.rel.ro.c_jump_table"
struct special_alt {
struct list_head list;
--
2.43.0
2
8

[PATCH openEuler-1.0-LTS] tty: goldfish: Use tty_port_destroy() to destroy port
by Gu Bowen 15 Apr '25
by Gu Bowen 15 Apr '25
15 Apr '25
From: Wang Weiyang <wangweiyang2(a)huawei.com>
stable inclusion
from stable-v4.19.247
commit 326192b99c903a2193d820c30ed936cc2402382c
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IBP6XS
CVE: CVE-2022-49399
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id…
--------------------------------
[ Upstream commit 507b05063d1b7a1fcb9f7d7c47586fc4f3508f98 ]
In goldfish_tty_probe(), the port initialized through tty_port_init()
should be destroyed in error paths.In goldfish_tty_remove(), qtty->port
also should be destroyed or else might leak resources.
Fix the above by calling tty_port_destroy().
Fixes: 666b7793d4bf ("goldfish: tty driver")
Reviewed-by: Jiri Slaby <jirislaby(a)kernel.org>
Signed-off-by: Wang Weiyang <wangweiyang2(a)huawei.com>
Link: https://lore.kernel.org/r/20220328115844.86032-1-wangweiyang2@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal(a)kernel.org>
Conflicts:
drivers/tty/goldfish.c
[Context conflicts due to commit 499e13aac6c7 ("tty: goldfish: Fix
free_irq() on remove") has merged.]
Signed-off-by: Gu Bowen <gubowen5(a)huawei.com>
---
drivers/tty/goldfish.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/tty/goldfish.c b/drivers/tty/goldfish.c
index 48ea55beaf43..d6e82eb61fc2 100644
--- a/drivers/tty/goldfish.c
+++ b/drivers/tty/goldfish.c
@@ -407,6 +407,7 @@ static int goldfish_tty_probe(struct platform_device *pdev)
err_tty_register_device_failed:
free_irq(irq, qtty);
err_dec_line_count:
+ tty_port_destroy(&qtty->port);
goldfish_tty_current_line_count--;
if (goldfish_tty_current_line_count == 0)
goldfish_tty_delete_driver();
@@ -428,6 +429,7 @@ static int goldfish_tty_remove(struct platform_device *pdev)
iounmap(qtty->base);
qtty->base = NULL;
free_irq(qtty->irq, qtty);
+ tty_port_destroy(&qtty->port);
goldfish_tty_current_line_count--;
if (goldfish_tty_current_line_count == 0)
goldfish_tty_delete_driver();
--
2.25.1
2
1

[PATCH OLK-5.10] drm/amdgpu: avoid buffer overflow attach in smu_sys_set_pp_table()
by Wang Zhaolong 15 Apr '25
by Wang Zhaolong 15 Apr '25
15 Apr '25
From: Jiang Liu <gerry(a)linux.alibaba.com>
mainline inclusion
from mainline-v6.14-rc3
commit 1abb2648698bf10783d2236a6b4a7ca5e8021699
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IBPC78
CVE: CVE-2025-21780
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?…
--------------------------------
It malicious user provides a small pptable through sysfs and then
a bigger pptable, it may cause buffer overflow attack in function
smu_sys_set_pp_table().
Reviewed-by: Lijo Lazar <lijo.lazar(a)amd.com>
Signed-off-by: Jiang Liu <gerry(a)linux.alibaba.com>
Signed-off-by: Alex Deucher <alexander.deucher(a)amd.com>
Cc: stable(a)vger.kernel.org
Conflicts:
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
[The smu->mutex in the context has not been removed.]
Signed-off-by: Wang Zhaolong <wangzhaolong1(a)huawei.com>
---
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
index ee27970cfff9..98c9ac875daa 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
@@ -325,12 +325,14 @@ int smu_sys_set_pp_table(struct smu_context *smu, void *buf, size_t size)
dev_err(smu->adev->dev, "pp table size not matched !\n");
return -EIO;
}
mutex_lock(&smu->mutex);
- if (!smu_table->hardcode_pptable)
+ if (!smu_table->hardcode_pptable || smu_table->power_play_table_size < size) {
+ kfree(smu_table->hardcode_pptable);
smu_table->hardcode_pptable = kzalloc(size, GFP_KERNEL);
+ }
if (!smu_table->hardcode_pptable) {
ret = -ENOMEM;
goto failed;
}
--
2.34.3
2
1

[PATCH OLK-6.6 0/4] Some mainline patches merged into olk-6.6: drivers/hwmon
by Lifeng Zheng 15 Apr '25
by Lifeng Zheng 15 Apr '25
15 Apr '25
From: Xinghai Cen <cenxinghai(a)h-partners.com>
Some mainline patches merged into olk-6.6: drivers/hwmon
Huisong Li (2):
hwmon: Fix the missing of 'average' word in hwmon_power_attr_templates
hwmon: (acpi_power_meter) Replace the deprecated hwmon_device_register
Kai-Heng Feng (2):
ACPI: IPMI: Add helper to wait for when SMI is selected
hwmon: (acpi_power_meter) Ensure IPMI space handler is ready on Dell
systems
drivers/acpi/acpi_ipmi.c | 23 +-
drivers/hwmon/acpi_power_meter.c | 874 ++++++++++++++++---------------
drivers/hwmon/hwmon.c | 4 +-
include/acpi/acpi_bus.h | 5 +
4 files changed, 469 insertions(+), 437 deletions(-)
--
2.33.0
2
5

15 Apr '25
driver inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/IC15TR
----------------------------------------------------------------------
This series adds support for HiSilicon SoC cache lockdown and cache
maintenance operations.
Cache lockdown feature prevents cache entries from being evicted from L3
cache. It can be enabled by calling mmap function to the file
(`/dev/hisi_soc_cache_mgmt`). This feature is implemented in the driver
hisi_soc_l3c.
Cache maintenance feature, following Arm64's CHI spec[1], enables users
to raise certain transactions to the memory residing in the cache. This
can be achieved by calling ioctl function to the same file as above.
This feature is implemented in the driver hisi_soc_hha.
L3 cache and L3 cache PMU share the same memory resource, which makes
one fails to probe while another is on board. Since both devices
rely on distinct information exported by ACPI, their probing functions
should be unrelated. Workaround the resource conflict check by
replacing devm_ioremap_resource() to devm_ioremap() instead.
[1] https://developer.arm.com/documentation/ihi0050/latest/
Yushan Wang (2):
soc cache: Add framework driver for HiSilicon SoC cache
soc cache: Support cache maintenance for HiSilicon SoC Hydra Home
Agent
drivers/soc/hisilicon/Kconfig | 22 +
drivers/soc/hisilicon/Makefile | 3 +
.../soc/hisilicon/hisi_soc_cache_framework.c | 381 ++++++++++++++++++
.../soc/hisilicon/hisi_soc_cache_framework.h | 77 ++++
drivers/soc/hisilicon/hisi_soc_hha.c | 188 +++++++++
.../uapi/misc/hisi_soc_cache/hisi_soc_cache.h | 35 ++
6 files changed, 706 insertions(+)
create mode 100644 drivers/soc/hisilicon/hisi_soc_cache_framework.c
create mode 100644 drivers/soc/hisilicon/hisi_soc_cache_framework.h
create mode 100644 drivers/soc/hisilicon/hisi_soc_hha.c
create mode 100644 include/uapi/misc/hisi_soc_cache/hisi_soc_cache.h
--
2.33.0
2
3
Patch#1 Allocate VM table and save vpeid in it
Patch#2 avoid sending multi-SGIs in IPIV
Patch#3 Set base address of vm table and targe ITS when vpe schedule and deschedule
Patch#4 Register ipiv exception interrupt
Patch#5 Add interface KVM_CAP_ARM_IPIV_MODE
Patch#6 Probe and configure IPIV capacity on HIP12
Patch#7 Use KABI_EXTEND to perform kabi repair for IPIV
Jinqian Yang (2):
kvm: arm64: avoid sending multi-SGIs in IPIV
kabi: Use KABI_EXTEND to perform kabi repair for IPIV
Xiang Chen (5):
kvm: hisi_virt: Allocate VM table and save vpeid in it
irqchip: gicv3-its: Set base address of vm table and targe ITS when
vpe schedule and deschedule
kvm: hisi_virt: Register ipiv exception interrupt
kvm: arm64: Add interface KVM_CAP_ARM_IPIV_MODE
kvm: hisi_virt: Probe and configure IPIV capacity on HIP12
.../admin-guide/kernel-parameters.txt | 3 +
arch/arm64/include/asm/kvm_host.h | 1 +
arch/arm64/include/asm/sysreg.h | 3 +
arch/arm64/kvm/arm.c | 16 +++
arch/arm64/kvm/hisilicon/hisi_virt.c | 38 ++++++++
arch/arm64/kvm/hisilicon/hisi_virt.h | 11 +++
arch/arm64/kvm/sys_regs.c | 11 +++
arch/arm64/kvm/vgic/vgic-init.c | 44 ++++++++-
arch/arm64/kvm/vgic/vgic-mmio-v3.c | 1 +
drivers/irqchip/irq-gic-v3-its.c | 97 ++++++++++++++++++-
drivers/irqchip/irq-gic-v3.c | 33 +++++++
include/linux/irqchip/arm-gic-v3.h | 24 +++++
include/linux/irqchip/arm-gic-v4.h | 2 +
include/uapi/linux/kvm.h | 2 +
14 files changed, 282 insertions(+), 4 deletions(-)
--
2.33.0
2
8
*** BLURB HERE ***
David Gow (1):
x86/uaccess: Zero the 8-byte get_range case on failure on 32-bit
David Laight (1):
x86: fix off-by-one in access_ok()
Linus Torvalds (5):
runtime constants: deal with old decrepit linkers
runtime constants: add x86 architecture support
x86: fix whitespace in runtime-const assembler output
x86/uaccess: Improve the 8-byte getuser() case
x86: fix user address masking non-canonical speculation issue
Stephen Brennan (1):
dcache: keep dentry_hashtable or d_hash_shift even when not used
Thomas Gleixner (1):
x86/uaccess: Add missing __force to casts in __access_ok() and
valid_user_address()
arch/x86/include/asm/runtime-const.h | 61 +++++++++++++++++++++
arch/x86/include/asm/uaccess_64.h | 49 ++++++++++-------
arch/x86/kernel/cpu/common.c | 10 ++++
arch/x86/kernel/vmlinux.lds.S | 4 ++
arch/x86/lib/getuser.S | 80 ++++++++++------------------
fs/dcache.c | 9 +++-
include/asm-generic/vmlinux.lds.h | 7 +++
7 files changed, 149 insertions(+), 71 deletions(-)
create mode 100644 arch/x86/include/asm/runtime-const.h
--
2.33.0
2
10
Patch#1 Allocate VM table and save vpeid in it
Patch#2 avoid sending multi-SGIs in IPIV
Patch#3 Set base address of vm table and targe ITS when vpe schedule and deschedule
Patch#4 Register ipiv exception interrupt
Patch#5 Add interface KVM_CAP_ARM_IPIV_MODE
Patch#6 Probe and configure IPIV capacity on HIP12
Patch#7 Use KABI_EXTEND to perform kabi repair for IPIV
Jinqian Yang (2):
kvm: arm64: avoid sending multi-SGIs in IPIV
kabi: Use KABI_EXTEND to perform kabi repair for IPIV
Xiang Chen (5):
kvm: hisi_virt: Allocate VM table and save vpeid in it
irqchip: gicv3-its: Set base address of vm table and targe ITS when
vpe schedule and deschedule
kvm: hisi_virt: Register ipiv exception interrupt
kvm: arm64: Add interface KVM_CAP_ARM_IPIV_MODE
kvm: hisi_virt: Probe and configure IPIV capacity on HIP12
.../admin-guide/kernel-parameters.txt | 3 +
arch/arm64/include/asm/kvm_host.h | 1 +
arch/arm64/include/asm/sysreg.h | 3 +
arch/arm64/kvm/arm.c | 16 +++
arch/arm64/kvm/hisilicon/hisi_virt.c | 38 ++++++++
arch/arm64/kvm/hisilicon/hisi_virt.h | 11 +++
arch/arm64/kvm/sys_regs.c | 11 +++
arch/arm64/kvm/vgic/vgic-init.c | 44 ++++++++-
arch/arm64/kvm/vgic/vgic-mmio-v3.c | 1 +
drivers/irqchip/irq-gic-v3-its.c | 97 ++++++++++++++++++-
drivers/irqchip/irq-gic-v3.c | 33 +++++++
include/linux/irqchip/arm-gic-v3.h | 24 +++++
include/linux/irqchip/arm-gic-v4.h | 2 +
include/uapi/linux/kvm.h | 2 +
14 files changed, 282 insertions(+), 4 deletions(-)
--
2.33.0
2
8

15 Apr '25
driver inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/IC15TR
----------------------------------------------------------------------
This series adds support for HiSilicon SoC cache lockdown and cache
maintenance operations.
Cache lockdown feature prevents cache entries from being evicted from L3
cache. It can be enabled by calling mmap function to the file
(`/dev/hisi_soc_cache_mgmt`). This feature is implemented in the driver
hisi_soc_l3c.
Cache maintenance feature, following Arm64's CHI spec[1], enables users
to raise certain transactions to the memory residing in the cache. This
can be achieved by calling ioctl function to the same file as above.
This feature is implemented in the driver hisi_soc_hha.
L3 cache and L3 cache PMU share the same memory resource, which makes
one fails to probe while another is on board. Since both devices
rely on distinct information exported by ACPI, their probing functions
should be unrelated. Workaround the resource conflict check by
replacing devm_ioremap_resource() to devm_ioremap() instead.
[1] https://developer.arm.com/documentation/ihi0050/latest/
Yushan Wang (2):
soc cache: Add framework driver for HiSilicon SoC cache
soc cache: Support cache maintenance for HiSilicon SoC Hydra Home
Agent
drivers/soc/hisilicon/Kconfig | 22 +
drivers/soc/hisilicon/Makefile | 3 +
.../soc/hisilicon/hisi_soc_cache_framework.c | 381 ++++++++++++++++++
.../soc/hisilicon/hisi_soc_cache_framework.h | 77 ++++
drivers/soc/hisilicon/hisi_soc_hha.c | 188 +++++++++
.../uapi/misc/hisi_soc_cache/hisi_soc_cache.h | 35 ++
6 files changed, 706 insertions(+)
create mode 100644 drivers/soc/hisilicon/hisi_soc_cache_framework.c
create mode 100644 drivers/soc/hisilicon/hisi_soc_cache_framework.h
create mode 100644 drivers/soc/hisilicon/hisi_soc_hha.c
create mode 100644 include/uapi/misc/hisi_soc_cache/hisi_soc_cache.h
--
2.33.0
2
3
driver inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/IC15TR
----------------------------------------------------------------------
This series adds support for HiSilicon SoC cache lockdown and cache
maintenance operations.
Cache lockdown feature prevents cache entries from being evicted from L3
cache. It can be enabled by calling mmap function to the file
(`/dev/hisi_soc_cache_mgmt`). This feature is implemented in the driver
hisi_soc_l3c.
Cache maintenance feature, following Arm64's CHI spec[1], enables users
to raise certain transactions to the memory residing in the cache. This
can be achieved by calling ioctl function to the same file as above.
This feature is implemented in the driver hisi_soc_hha.
L3 cache and L3 cache PMU share the same memory resource, which makes
one fails to probe while another is on board. Since both devices
rely on distinct information exported by ACPI, their probing functions
should be unrelated. Workaround the resource conflict check by
replacing devm_ioremap_resource() to devm_ioremap() instead.
[1] https://developer.arm.com/documentation/ihi0050/latest/
Yushan Wang (2):
soc cache: Add framework driver for HiSilicon SoC cache
soc cache: Support cache maintenance for HiSilicon SoC Hydra Home
Agent
drivers/soc/hisilicon/Kconfig | 22 +
drivers/soc/hisilicon/Makefile | 3 +
.../soc/hisilicon/hisi_soc_cache_framework.c | 381 ++++++++++++++++++
.../soc/hisilicon/hisi_soc_cache_framework.h | 77 ++++
drivers/soc/hisilicon/hisi_soc_hha.c | 188 +++++++++
.../uapi/misc/hisi_soc_cache/hisi_soc_cache.h | 35 ++
6 files changed, 706 insertions(+)
create mode 100644 drivers/soc/hisilicon/hisi_soc_cache_framework.c
create mode 100644 drivers/soc/hisilicon/hisi_soc_cache_framework.h
create mode 100644 drivers/soc/hisilicon/hisi_soc_hha.c
create mode 100644 include/uapi/misc/hisi_soc_cache/hisi_soc_cache.h
--
2.33.0
1
2
From: Zhu Yanjun <yanjun.zhu(a)linux.dev>
mainline inclusion
from mainline-v6.13-rc6
commit 2ac5415022d16d63d912a39a06f32f1f51140261
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IBID2B
CVE: CVE-2024-57795
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?…
-------------------------------------------------
The similar patch in siw is in the link:
https://git.kernel.org/rdma/rdma/c/16b87037b48889
This problem also occurred in RXE. The following analyze this problem.
In the following Call Traces:
"
BUG: KASAN: slab-use-after-free in dev_get_flags+0x188/0x1d0 net/core/dev.c:8782
Read of size 4 at addr ffff8880554640b0 by task kworker/1:4/5295
CPU: 1 UID: 0 PID: 5295 Comm: kworker/1:4 Not tainted
6.12.0-rc3-syzkaller-00399-g9197b73fd7bb #0
Hardware name: Google Compute Engine/Google Compute Engine,
BIOS Google 09/13/2024
Workqueue: infiniband ib_cache_event_task
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:94 [inline]
dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120
print_address_description mm/kasan/report.c:377 [inline]
print_report+0x169/0x550 mm/kasan/report.c:488
kasan_report+0x143/0x180 mm/kasan/report.c:601
dev_get_flags+0x188/0x1d0 net/core/dev.c:8782
rxe_query_port+0x12d/0x260 drivers/infiniband/sw/rxe/rxe_verbs.c:60
__ib_query_port drivers/infiniband/core/device.c:2111 [inline]
ib_query_port+0x168/0x7d0 drivers/infiniband/core/device.c:2143
ib_cache_update+0x1a9/0xb80 drivers/infiniband/core/cache.c:1494
ib_cache_event_task+0xf3/0x1e0 drivers/infiniband/core/cache.c:1568
process_one_work kernel/workqueue.c:3229 [inline]
process_scheduled_works+0xa65/0x1850 kernel/workqueue.c:3310
worker_thread+0x870/0xd30 kernel/workqueue.c:3391
kthread+0x2f2/0x390 kernel/kthread.c:389
ret_from_fork+0x4d/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
</TASK>
"
1). In the link [1],
"
infiniband syz2: set down
"
This means that on 839.350575, the event ib_cache_event_task was sent andi
queued in ib_wq.
2). In the link [1],
"
team0 (unregistering): Port device team_slave_0 removed
"
It indicates that before 843.251853, the net device should be freed.
3). In the link [1],
"
BUG: KASAN: slab-use-after-free in dev_get_flags+0x188/0x1d0
"
This means that on 850.559070, this slab-use-after-free problem occurred.
In all, on 839.350575, the event ib_cache_event_task was sent and queued
in ib_wq,
before 843.251853, the net device veth was freed.
on 850.559070, this event was executed, and the mentioned freed net device
was called. Thus, the above call trace occurred.
[1] https://syzkaller.appspot.com/x/log.txt?x=12e7025f980000
Reported-by: syzbot+4b87489410b4efd181bf(a)syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=4b87489410b4efd181bf
Fixes: 8700e3e7c485 ("Soft RoCE driver")
Signed-off-by: Zhu Yanjun <yanjun.zhu(a)linux.dev>
Link: https://patch.msgid.link/20241220222325.2487767-1-yanjun.zhu@linux.dev
Signed-off-by: Leon Romanovsky <leon(a)kernel.org>
Conflicts:
drivers/infiniband/sw/rxe/rxe_net.c
[Did not backport af48f95492dc.]
Signed-off-by: Liu Jian <liujian56(a)huawei.com>
---
drivers/infiniband/sw/rxe/rxe.c | 23 +++++++++++++++++++----
drivers/infiniband/sw/rxe/rxe.h | 3 ++-
drivers/infiniband/sw/rxe/rxe_mcast.c | 22 ++++++++++++++++++++--
drivers/infiniband/sw/rxe/rxe_net.c | 25 ++++++++++++++++++++-----
drivers/infiniband/sw/rxe/rxe_verbs.c | 26 +++++++++++++++++++++-----
drivers/infiniband/sw/rxe/rxe_verbs.h | 11 ++++++++---
6 files changed, 90 insertions(+), 20 deletions(-)
diff --git a/drivers/infiniband/sw/rxe/rxe.c b/drivers/infiniband/sw/rxe/rxe.c
index 0f8356cea293..1fb4fa4514bf 100644
--- a/drivers/infiniband/sw/rxe/rxe.c
+++ b/drivers/infiniband/sw/rxe/rxe.c
@@ -40,6 +40,8 @@ void rxe_dealloc(struct ib_device *ib_dev)
/* initialize rxe device parameters */
static void rxe_init_device_param(struct rxe_dev *rxe)
{
+ struct net_device *ndev;
+
rxe->max_inline_data = RXE_MAX_INLINE_DATA;
rxe->attr.vendor_id = RXE_VENDOR_ID;
@@ -71,8 +73,15 @@ static void rxe_init_device_param(struct rxe_dev *rxe)
rxe->attr.max_fast_reg_page_list_len = RXE_MAX_FMR_PAGE_LIST_LEN;
rxe->attr.max_pkeys = RXE_MAX_PKEYS;
rxe->attr.local_ca_ack_delay = RXE_LOCAL_CA_ACK_DELAY;
+
+ ndev = rxe_ib_device_get_netdev(&rxe->ib_dev);
+ if (!ndev)
+ return;
+
addrconf_addr_eui48((unsigned char *)&rxe->attr.sys_image_guid,
- rxe->ndev->dev_addr);
+ ndev->dev_addr);
+
+ dev_put(ndev);
rxe->max_ucontext = RXE_MAX_UCONTEXT;
}
@@ -109,10 +118,15 @@ static void rxe_init_port_param(struct rxe_port *port)
static void rxe_init_ports(struct rxe_dev *rxe)
{
struct rxe_port *port = &rxe->port;
+ struct net_device *ndev;
rxe_init_port_param(port);
+ ndev = rxe_ib_device_get_netdev(&rxe->ib_dev);
+ if (!ndev)
+ return;
addrconf_addr_eui48((unsigned char *)&port->port_guid,
- rxe->ndev->dev_addr);
+ ndev->dev_addr);
+ dev_put(ndev);
spin_lock_init(&port->port_lock);
}
@@ -169,12 +183,13 @@ void rxe_set_mtu(struct rxe_dev *rxe, unsigned int ndev_mtu)
/* called by ifc layer to create new rxe device.
* The caller should allocate memory for rxe by calling ib_alloc_device.
*/
-int rxe_add(struct rxe_dev *rxe, unsigned int mtu, const char *ibdev_name)
+int rxe_add(struct rxe_dev *rxe, unsigned int mtu, const char *ibdev_name,
+ struct net_device *ndev)
{
rxe_init(rxe);
rxe_set_mtu(rxe, mtu);
- return rxe_register_device(rxe, ibdev_name);
+ return rxe_register_device(rxe, ibdev_name, ndev);
}
static int rxe_newlink(const char *ibdev_name, struct net_device *ndev)
diff --git a/drivers/infiniband/sw/rxe/rxe.h b/drivers/infiniband/sw/rxe/rxe.h
index d8fb2c7af30a..fe7f97066732 100644
--- a/drivers/infiniband/sw/rxe/rxe.h
+++ b/drivers/infiniband/sw/rxe/rxe.h
@@ -139,7 +139,8 @@ enum resp_states {
void rxe_set_mtu(struct rxe_dev *rxe, unsigned int dev_mtu);
-int rxe_add(struct rxe_dev *rxe, unsigned int mtu, const char *ibdev_name);
+int rxe_add(struct rxe_dev *rxe, unsigned int mtu, const char *ibdev_name,
+ struct net_device *ndev);
void rxe_rcv(struct sk_buff *skb);
diff --git a/drivers/infiniband/sw/rxe/rxe_mcast.c b/drivers/infiniband/sw/rxe/rxe_mcast.c
index 86cc2e18a7fd..07ff47bae31d 100644
--- a/drivers/infiniband/sw/rxe/rxe_mcast.c
+++ b/drivers/infiniband/sw/rxe/rxe_mcast.c
@@ -31,10 +31,19 @@
static int rxe_mcast_add(struct rxe_dev *rxe, union ib_gid *mgid)
{
unsigned char ll_addr[ETH_ALEN];
+ struct net_device *ndev;
+ int ret;
+
+ ndev = rxe_ib_device_get_netdev(&rxe->ib_dev);
+ if (!ndev)
+ return -ENODEV;
ipv6_eth_mc_map((struct in6_addr *)mgid->raw, ll_addr);
- return dev_mc_add(rxe->ndev, ll_addr);
+ ret = dev_mc_add(ndev, ll_addr);
+ dev_put(ndev);
+
+ return ret;
}
/**
@@ -47,10 +56,19 @@ static int rxe_mcast_add(struct rxe_dev *rxe, union ib_gid *mgid)
static int rxe_mcast_del(struct rxe_dev *rxe, union ib_gid *mgid)
{
unsigned char ll_addr[ETH_ALEN];
+ struct net_device *ndev;
+ int ret;
+
+ ndev = rxe_ib_device_get_netdev(&rxe->ib_dev);
+ if (!ndev)
+ return -ENODEV;
ipv6_eth_mc_map((struct in6_addr *)mgid->raw, ll_addr);
- return dev_mc_del(rxe->ndev, ll_addr);
+ ret = dev_mc_del(ndev, ll_addr);
+ dev_put(ndev);
+
+ return ret;
}
/**
diff --git a/drivers/infiniband/sw/rxe/rxe_net.c b/drivers/infiniband/sw/rxe/rxe_net.c
index e5827064ab1e..e2859bbc9a71 100644
--- a/drivers/infiniband/sw/rxe/rxe_net.c
+++ b/drivers/infiniband/sw/rxe/rxe_net.c
@@ -509,7 +509,16 @@ struct sk_buff *rxe_init_packet(struct rxe_dev *rxe, struct rxe_av *av,
*/
const char *rxe_parent_name(struct rxe_dev *rxe, unsigned int port_num)
{
- return rxe->ndev->name;
+ struct net_device *ndev;
+ char *ndev_name;
+
+ ndev = rxe_ib_device_get_netdev(&rxe->ib_dev);
+ if (!ndev)
+ return NULL;
+ ndev_name = ndev->name;
+ dev_put(ndev);
+
+ return ndev_name;
}
int rxe_net_add(const char *ibdev_name, struct net_device *ndev)
@@ -521,9 +530,7 @@ int rxe_net_add(const char *ibdev_name, struct net_device *ndev)
if (!rxe)
return -ENOMEM;
- rxe->ndev = ndev;
-
- err = rxe_add(rxe, ndev->mtu, ibdev_name);
+ err = rxe_add(rxe, ndev->mtu, ibdev_name, ndev);
if (err) {
ib_dealloc_device(&rxe->ib_dev);
return err;
@@ -571,10 +578,18 @@ void rxe_port_down(struct rxe_dev *rxe)
void rxe_set_port_state(struct rxe_dev *rxe)
{
- if (netif_running(rxe->ndev) && netif_carrier_ok(rxe->ndev))
+ struct net_device *ndev;
+
+ ndev = rxe_ib_device_get_netdev(&rxe->ib_dev);
+ if (!ndev)
+ return;
+
+ if (netif_running(ndev) && netif_carrier_ok(ndev))
rxe_port_up(rxe);
else
rxe_port_down(rxe);
+
+ dev_put(ndev);
}
static int rxe_notify(struct notifier_block *not_blk,
diff --git a/drivers/infiniband/sw/rxe/rxe_verbs.c b/drivers/infiniband/sw/rxe/rxe_verbs.c
index dbb9baa4ffd0..c4726f894fc2 100644
--- a/drivers/infiniband/sw/rxe/rxe_verbs.c
+++ b/drivers/infiniband/sw/rxe/rxe_verbs.c
@@ -41,6 +41,7 @@ static int rxe_query_port(struct ib_device *ibdev,
u32 port_num, struct ib_port_attr *attr)
{
struct rxe_dev *rxe = to_rdev(ibdev);
+ struct net_device *ndev;
int err, ret;
if (port_num != 1) {
@@ -49,6 +50,12 @@ static int rxe_query_port(struct ib_device *ibdev,
goto err_out;
}
+ ndev = rxe_ib_device_get_netdev(ibdev);
+ if (!ndev) {
+ err = -ENODEV;
+ goto err_out;
+ }
+
memcpy(attr, &rxe->port.attr, sizeof(*attr));
mutex_lock(&rxe->usdev_lock);
@@ -57,13 +64,14 @@ static int rxe_query_port(struct ib_device *ibdev,
if (attr->state == IB_PORT_ACTIVE)
attr->phys_state = IB_PORT_PHYS_STATE_LINK_UP;
- else if (dev_get_flags(rxe->ndev) & IFF_UP)
+ else if (dev_get_flags(ndev) & IFF_UP)
attr->phys_state = IB_PORT_PHYS_STATE_POLLING;
else
attr->phys_state = IB_PORT_PHYS_STATE_DISABLED;
mutex_unlock(&rxe->usdev_lock);
+ dev_put(ndev);
return ret;
err_out:
@@ -1428,9 +1436,16 @@ static const struct attribute_group rxe_attr_group = {
static int rxe_enable_driver(struct ib_device *ib_dev)
{
struct rxe_dev *rxe = container_of(ib_dev, struct rxe_dev, ib_dev);
+ struct net_device *ndev;
+
+ ndev = rxe_ib_device_get_netdev(ib_dev);
+ if (!ndev)
+ return -ENODEV;
rxe_set_port_state(rxe);
- dev_info(&rxe->ib_dev.dev, "added %s\n", netdev_name(rxe->ndev));
+ dev_info(&rxe->ib_dev.dev, "added %s\n", netdev_name(ndev));
+
+ dev_put(ndev);
return 0;
}
@@ -1498,7 +1513,8 @@ static const struct ib_device_ops rxe_dev_ops = {
INIT_RDMA_OBJ_SIZE(ib_mw, rxe_mw, ibmw),
};
-int rxe_register_device(struct rxe_dev *rxe, const char *ibdev_name)
+int rxe_register_device(struct rxe_dev *rxe, const char *ibdev_name,
+ struct net_device *ndev)
{
int err;
struct ib_device *dev = &rxe->ib_dev;
@@ -1510,13 +1526,13 @@ int rxe_register_device(struct rxe_dev *rxe, const char *ibdev_name)
dev->num_comp_vectors = num_possible_cpus();
dev->local_dma_lkey = 0;
addrconf_addr_eui48((unsigned char *)&dev->node_guid,
- rxe->ndev->dev_addr);
+ ndev->dev_addr);
dev->uverbs_cmd_mask |= BIT_ULL(IB_USER_VERBS_CMD_POST_SEND) |
BIT_ULL(IB_USER_VERBS_CMD_REQ_NOTIFY_CQ);
ib_set_device_ops(dev, &rxe_dev_ops);
- err = ib_device_set_netdev(&rxe->ib_dev, rxe->ndev, 1);
+ err = ib_device_set_netdev(&rxe->ib_dev, ndev, 1);
if (err)
return err;
diff --git a/drivers/infiniband/sw/rxe/rxe_verbs.h b/drivers/infiniband/sw/rxe/rxe_verbs.h
index ccb9d19ffe8a..4242b24a47da 100644
--- a/drivers/infiniband/sw/rxe/rxe_verbs.h
+++ b/drivers/infiniband/sw/rxe/rxe_verbs.h
@@ -369,6 +369,7 @@ struct rxe_port {
u32 qp_gsi_index;
};
+#define RXE_PORT 1
struct rxe_dev {
struct ib_device ib_dev;
struct ib_device_attr attr;
@@ -376,8 +377,6 @@ struct rxe_dev {
int max_inline_data;
struct mutex usdev_lock;
- struct net_device *ndev;
-
struct rxe_pool uc_pool;
struct rxe_pool pd_pool;
struct rxe_pool ah_pool;
@@ -405,6 +404,11 @@ struct rxe_dev {
struct crypto_shash *tfm;
};
+static inline struct net_device *rxe_ib_device_get_netdev(struct ib_device *dev)
+{
+ return ib_device_get_netdev(dev, RXE_PORT);
+}
+
static inline void rxe_counter_inc(struct rxe_dev *rxe, enum rxe_counters index)
{
atomic64_inc(&rxe->stats_counters[index]);
@@ -470,6 +474,7 @@ static inline struct rxe_pd *rxe_mw_pd(struct rxe_mw *mw)
return to_rpd(mw->ibmw.pd);
}
-int rxe_register_device(struct rxe_dev *rxe, const char *ibdev_name);
+int rxe_register_device(struct rxe_dev *rxe, const char *ibdev_name,
+ struct net_device *ndev);
#endif /* RXE_VERBS_H */
--
2.34.1
2
1

[openeuler:OLK-6.6 2123/2123] vmlinux.o: warning: objtool: kasan_report+0x10b: RET before UNTRAIN
by kernel test robot 15 Apr '25
by kernel test robot 15 Apr '25
15 Apr '25
tree: https://gitee.com/openeuler/kernel.git OLK-6.6
head: 8e04020e957c517ad3fb6bb3caa90e037dc3d5b8
commit: b73666e1e9554c77a69a647427cf77782e0bd9aa [2123/2123] x86/xen: don't do PV iret hypercall through hypercall page
config: x86_64-buildonly-randconfig-002-20250415 (https://download.01.org/0day-ci/archive/20250415/202504150515.bR3H6UHH-lkp@…)
compiler: gcc-11 (Debian 11.3.0-12) 11.3.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250415/202504150515.bR3H6UHH-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/202504150515.bR3H6UHH-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> vmlinux.o: warning: objtool: kasan_report+0x10b: RET before UNTRAIN
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
1
0

[openeuler:OLK-5.10 2861/2861] llvm-objcopy: error: 'arch/x86/entry/vdso/vdso64.so.dbg': No such file or directory
by kernel test robot 15 Apr '25
by kernel test robot 15 Apr '25
15 Apr '25
Hi Sean,
FYI, the error/warning still remains.
tree: https://gitee.com/openeuler/kernel.git OLK-5.10
head: 1afd05e282420aba2d2fc2132a8c2e52d4d9b253
commit: 5476cb89ef2297bd36f8b38e27b54617b6f63236 [2861/2861] x86/vdso: Implement a vDSO for Intel SGX enclave call
config: x86_64-buildonly-randconfig-003-20250414 (https://download.01.org/0day-ci/archive/20250415/202504150150.pd024mOU-lkp@…)
compiler: clang version 20.1.2 (https://github.com/llvm/llvm-project 58df0ef89dd64126512e4ee27b4ac3fd8ddf6247)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250415/202504150150.pd024mOU-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/202504150150.pd024mOU-lkp@intel.com/
All errors (new ones prefixed by >>):
>> llvm-objcopy: error: 'arch/x86/entry/vdso/vdso64.so.dbg': No such file or directory
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
1
0
Patch#1 Allocate VM table and save vpeid in it
Patch#2 avoid sending multi-SGIs in IPIV
Patch#3 Set base address of vm table and targe ITS when vpe schedule and deschedule
Patch#4 Register ipiv exception interrupt
Patch#5 Add interface KVM_CAP_ARM_IPIV_MODE
Patch#6 Probe and configure IPIV capacity on HIP12
Patch#7 Use KABI_EXTEND to perform kabi repair for IPIV
Jinqian Yang (2):
kvm: arm64: avoid sending multi-SGIs in IPIV
kabi: Use KABI_EXTEND to perform kabi repair for IPIV
Xiang Chen (5):
kvm: hisi_virt: Allocate VM table and save vpeid in it
irqchip: gicv3-its: Set base address of vm table and targe ITS when
vpe schedule and deschedule
kvm: hisi_virt: Register ipiv exception interrupt
kvm: arm64: Add interface KVM_CAP_ARM_IPIV_MODE
kvm: hisi_virt: Probe and configure IPIV capacity on HIP12
.../admin-guide/kernel-parameters.txt | 3 +
arch/arm64/include/asm/kvm_host.h | 1 +
arch/arm64/include/asm/sysreg.h | 3 +
arch/arm64/kvm/arm.c | 16 +++
arch/arm64/kvm/hisilicon/hisi_virt.c | 38 ++++++++
arch/arm64/kvm/hisilicon/hisi_virt.h | 11 +++
arch/arm64/kvm/sys_regs.c | 11 +++
arch/arm64/kvm/vgic/vgic-init.c | 44 ++++++++-
arch/arm64/kvm/vgic/vgic-mmio-v3.c | 1 +
drivers/irqchip/irq-gic-v3-its.c | 97 ++++++++++++++++++-
drivers/irqchip/irq-gic-v3.c | 33 +++++++
include/linux/irqchip/arm-gic-v3.h | 24 +++++
include/linux/irqchip/arm-gic-v4.h | 2 +
include/uapi/linux/kvm.h | 2 +
14 files changed, 282 insertions(+), 4 deletions(-)
--
2.33.0
2
8

[PATCH OLK-6.6] perf arm-spe: Add support for SPE Data Source packet on HiSilicon HIP12
by Yushan Wang 14 Apr '25
by Yushan Wang 14 Apr '25
14 Apr '25
From: Yicong Yang <yangyicong(a)hisilicon.com>
driver inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/IC07S9
----------------------------------------------------------------------
Add data source encoding for HiSilicon HIP12 and coresponding mapping
to the perf's memory data source. This will help to synthesize the data
and support upper layer tools like perf-mem and perf-c2c.
Signed-off-by: Yicong Yang <yangyicong(a)hisilicon.com>
Signed-off-by: Yushan Wang <wangyushan12(a)huawei.com>
Signed-off-by: Qizhi Zhang <zhangqizhi3(a)h-partners.com>
---
arch/arm64/include/asm/cputype.h | 2 +
tools/arch/arm64/include/asm/cputype.h | 2 +
.../util/arm-spe-decoder/arm-spe-decoder.h | 17 +++
tools/perf/util/arm-spe.c | 103 ++++++++++++++++++
4 files changed, 124 insertions(+)
diff --git a/arch/arm64/include/asm/cputype.h b/arch/arm64/include/asm/cputype.h
index 5c1cadeb032d..ae983d335456 100644
--- a/arch/arm64/include/asm/cputype.h
+++ b/arch/arm64/include/asm/cputype.h
@@ -137,6 +137,7 @@
#define HISI_CPU_PART_TSV110 0xD01
#define HISI_CPU_PART_LINXICORE9100 0xD02
+#define HISI_CPU_PART_HIP12 0xD06
#define APPLE_CPU_PART_M1_ICESTORM 0x022
#define APPLE_CPU_PART_M1_FIRESTORM 0x023
@@ -217,6 +218,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_LINXICORE9100 MIDR_CPU_MODEL(ARM_CPU_IMP_HISI, HISI_CPU_PART_LINXICORE9100)
+#define MIDR_HISI_HIP12 MIDR_CPU_MODEL(ARM_CPU_IMP_HISI, HISI_CPU_PART_HIP12)
#define MIDR_APPLE_M1_ICESTORM MIDR_CPU_MODEL(ARM_CPU_IMP_APPLE, APPLE_CPU_PART_M1_ICESTORM)
#define MIDR_APPLE_M1_FIRESTORM MIDR_CPU_MODEL(ARM_CPU_IMP_APPLE, APPLE_CPU_PART_M1_FIRESTORM)
#define MIDR_APPLE_M1_ICESTORM_PRO MIDR_CPU_MODEL(ARM_CPU_IMP_APPLE, APPLE_CPU_PART_M1_ICESTORM_PRO)
diff --git a/tools/arch/arm64/include/asm/cputype.h b/tools/arch/arm64/include/asm/cputype.h
index 329d41f8c923..8ade4dc85fcb 100644
--- a/tools/arch/arm64/include/asm/cputype.h
+++ b/tools/arch/arm64/include/asm/cputype.h
@@ -120,6 +120,7 @@
#define FUJITSU_CPU_PART_A64FX 0x001
#define HISI_CPU_PART_TSV110 0xD01
+#define HISI_CPU_PART_HIP12 0xD06
#define APPLE_CPU_PART_M1_ICESTORM 0x022
#define APPLE_CPU_PART_M1_FIRESTORM 0x023
@@ -183,6 +184,7 @@
#define MIDR_NVIDIA_CARMEL MIDR_CPU_MODEL(ARM_CPU_IMP_NVIDIA, NVIDIA_CPU_PART_CARMEL)
#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_HIP12 MIDR_CPU_MODEL(ARM_CPU_IMP_HISI, HISI_CPU_PART_HIP12)
#define MIDR_APPLE_M1_ICESTORM MIDR_CPU_MODEL(ARM_CPU_IMP_APPLE, APPLE_CPU_PART_M1_ICESTORM)
#define MIDR_APPLE_M1_FIRESTORM MIDR_CPU_MODEL(ARM_CPU_IMP_APPLE, APPLE_CPU_PART_M1_FIRESTORM)
#define MIDR_APPLE_M1_ICESTORM_PRO MIDR_CPU_MODEL(ARM_CPU_IMP_APPLE, APPLE_CPU_PART_M1_ICESTORM_PRO)
diff --git a/tools/perf/util/arm-spe-decoder/arm-spe-decoder.h b/tools/perf/util/arm-spe-decoder/arm-spe-decoder.h
index 1443c28545a9..713d778a4fad 100644
--- a/tools/perf/util/arm-spe-decoder/arm-spe-decoder.h
+++ b/tools/perf/util/arm-spe-decoder/arm-spe-decoder.h
@@ -67,6 +67,23 @@ enum arm_spe_neoverse_data_source {
ARM_SPE_NV_DRAM = 0xe,
};
+enum arm_spe_hisi_hip_data_source {
+ ARM_SPE_HISI_HIP_PEER_CPU = 0,
+ ARM_SPE_HISI_HIP_PEER_CPU_HITM = 1,
+ ARM_SPE_HISI_HIP_L3 = 2,
+ ARM_SPE_HISI_HIP_L3_HITM = 3,
+ ARM_SPE_HISI_HIP_PEER_CLUSTER = 4,
+ ARM_SPE_HISI_HIP_PEER_CLUSTER_HITM = 5,
+ ARM_SPE_HISI_HIP_REMOTE_SOCKET = 6,
+ ARM_SPE_HISI_HIP_REMOTE_SOCKET_HITM = 7,
+ ARM_SPE_HISI_HIP_LOCAL = 8,
+ ARM_SPE_HISI_HIP_REMOTE = 9,
+ ARM_SPE_HISI_HIP_NC_DEV = 13,
+ ARM_SPE_HISI_HIP_L2 = 16,
+ ARM_SPE_HISI_HIP_L2_HITM = 17,
+ ARM_SPE_HISI_HIP_L1 = 18,
+};
+
struct arm_spe_record {
enum arm_spe_sample_type type;
int err;
diff --git a/tools/perf/util/arm-spe.c b/tools/perf/util/arm-spe.c
index afbd5869f6bf..dbc437532fb7 100644
--- a/tools/perf/util/arm-spe.c
+++ b/tools/perf/util/arm-spe.c
@@ -416,6 +416,11 @@ static const struct midr_range neoverse_spe[] = {
{},
};
+static const struct midr_range hisi_hip_ds_encoding_cpus[] = {
+ MIDR_ALL_VERSIONS(MIDR_HISI_HIP12),
+ {},
+};
+
static void arm_spe__synth_data_source_neoverse(const struct arm_spe_record *record,
union perf_mem_data_src *data_src)
{
@@ -515,10 +520,106 @@ static void arm_spe__synth_data_source_generic(const struct arm_spe_record *reco
data_src->mem_lvl |= PERF_MEM_LVL_REM_CCE1;
}
+static void arm_spe__synth_data_source_hisi_hip(const struct arm_spe_record *record,
+ union perf_mem_data_src *data_src)
+{
+ /* Use common synthesis method to handle store operations */
+ if (record->op & ARM_SPE_OP_ST) {
+ arm_spe__synth_data_source_generic(record, data_src);
+ return;
+ }
+
+ switch (record->source) {
+ case ARM_SPE_HISI_HIP_PEER_CPU:
+ data_src->mem_lvl = PERF_MEM_LVL_L3 | PERF_MEM_LVL_HIT;
+ data_src->mem_lvl_num = PERF_MEM_LVLNUM_L3;
+ data_src->mem_snoop = PERF_MEM_SNOOP_NONE;
+ data_src->mem_snoopx = PERF_MEM_SNOOPX_PEER;
+ break;
+ case ARM_SPE_HISI_HIP_PEER_CPU_HITM:
+ data_src->mem_lvl = PERF_MEM_LVL_L3 | PERF_MEM_LVL_HIT;
+ data_src->mem_lvl_num = PERF_MEM_LVLNUM_L3;
+ data_src->mem_snoop = PERF_MEM_SNOOP_HITM;
+ data_src->mem_snoopx = PERF_MEM_SNOOPX_PEER;
+ break;
+ case ARM_SPE_HISI_HIP_L3:
+ data_src->mem_lvl = PERF_MEM_LVL_L3 | PERF_MEM_LVL_HIT;
+ data_src->mem_lvl_num = PERF_MEM_LVLNUM_L3;
+ data_src->mem_snoop = PERF_MEM_SNOOP_NONE;
+ break;
+ case ARM_SPE_HISI_HIP_L3_HITM:
+ data_src->mem_lvl = PERF_MEM_LVL_L3 | PERF_MEM_LVL_HIT;
+ data_src->mem_lvl_num = PERF_MEM_LVLNUM_L3;
+ data_src->mem_snoop = PERF_MEM_SNOOP_HITM;
+ data_src->mem_snoopx = PERF_MEM_SNOOPX_PEER;
+ break;
+ case ARM_SPE_HISI_HIP_PEER_CLUSTER:
+ data_src->mem_lvl = PERF_MEM_LVL_REM_CCE1 | PERF_MEM_LVL_HIT;
+ data_src->mem_lvl_num = PERF_MEM_LVLNUM_L3;
+ data_src->mem_snoop = PERF_MEM_SNOOP_NONE;
+ data_src->mem_snoopx = PERF_MEM_SNOOPX_PEER;
+ break;
+ case ARM_SPE_HISI_HIP_PEER_CLUSTER_HITM:
+ data_src->mem_lvl = PERF_MEM_LVL_REM_CCE1 | PERF_MEM_LVL_HIT;
+ data_src->mem_lvl_num = PERF_MEM_LVLNUM_L3;
+ data_src->mem_snoop = PERF_MEM_SNOOP_HITM;
+ data_src->mem_snoopx = PERF_MEM_SNOOPX_PEER;
+ break;
+ case ARM_SPE_HISI_HIP_REMOTE_SOCKET:
+ data_src->mem_lvl = PERF_MEM_LVL_REM_CCE2;
+ data_src->mem_lvl_num = PERF_MEM_LVLNUM_ANY_CACHE;
+ data_src->mem_remote = PERF_MEM_REMOTE_REMOTE;
+ data_src->mem_snoopx = PERF_MEM_SNOOPX_PEER;
+ break;
+ case ARM_SPE_HISI_HIP_REMOTE_SOCKET_HITM:
+ data_src->mem_lvl = PERF_MEM_LVL_REM_CCE2;
+ data_src->mem_lvl_num = PERF_MEM_LVLNUM_ANY_CACHE;
+ data_src->mem_snoop = PERF_MEM_SNOOP_HITM;
+ data_src->mem_remote = PERF_MEM_REMOTE_REMOTE;
+ data_src->mem_snoopx = PERF_MEM_SNOOPX_PEER;
+ break;
+ case ARM_SPE_HISI_HIP_LOCAL:
+ data_src->mem_lvl = PERF_MEM_LVL_LOC_RAM | PERF_MEM_LVL_HIT;
+ data_src->mem_lvl_num = PERF_MEM_LVLNUM_RAM;
+ data_src->mem_snoop = PERF_MEM_SNOOP_NONE;
+ break;
+ case ARM_SPE_HISI_HIP_REMOTE:
+ data_src->mem_lvl = PERF_MEM_LVL_REM_RAM1 | PERF_MEM_LVL_HIT;
+ data_src->mem_lvl_num = PERF_MEM_LVLNUM_RAM;
+ data_src->mem_snoop = PERF_MEM_SNOOP_NONE;
+ data_src->mem_remote = PERF_MEM_REMOTE_REMOTE;
+ break;
+ case ARM_SPE_HISI_HIP_NC_DEV:
+ data_src->mem_lvl = PERF_MEM_LVL_IO | PERF_MEM_LVL_HIT;
+ data_src->mem_lvl_num = PERF_MEM_LVLNUM_IO;
+ data_src->mem_snoop = PERF_MEM_SNOOP_NONE;
+ break;
+ case ARM_SPE_HISI_HIP_L2:
+ data_src->mem_lvl = PERF_MEM_LVL_L2 | PERF_MEM_LVL_HIT;
+ data_src->mem_lvl_num = PERF_MEM_LVLNUM_L2;
+ data_src->mem_snoop = PERF_MEM_SNOOP_NONE;
+ break;
+ case ARM_SPE_HISI_HIP_L2_HITM:
+ data_src->mem_lvl = PERF_MEM_LVL_L2 | PERF_MEM_LVL_HIT;
+ data_src->mem_lvl_num = PERF_MEM_LVLNUM_L2;
+ data_src->mem_snoop = PERF_MEM_SNOOP_HITM;
+ data_src->mem_snoopx = PERF_MEM_SNOOPX_PEER;
+ break;
+ case ARM_SPE_HISI_HIP_L1:
+ data_src->mem_lvl = PERF_MEM_LVL_L1 | PERF_MEM_LVL_HIT;
+ data_src->mem_lvl_num = PERF_MEM_LVLNUM_L1;
+ data_src->mem_snoop = PERF_MEM_SNOOP_NONE;
+ break;
+ default:
+ break;
+ }
+}
+
static u64 arm_spe__synth_data_source(const struct arm_spe_record *record, u64 midr)
{
union perf_mem_data_src data_src = { .mem_op = PERF_MEM_OP_NA };
bool is_neoverse = is_midr_in_range_list(midr, neoverse_spe);
+ bool is_hisilicon = is_midr_in_range_list(midr, hisi_hip_ds_encoding_cpus);
if (record->op & ARM_SPE_OP_LD)
data_src.mem_op = PERF_MEM_OP_LOAD;
@@ -529,6 +630,8 @@ static u64 arm_spe__synth_data_source(const struct arm_spe_record *record, u64 m
if (is_neoverse)
arm_spe__synth_data_source_neoverse(record, &data_src);
+ else if (is_hisilicon)
+ arm_spe__synth_data_source_hisi_hip(record, &data_src);
else
arm_spe__synth_data_source_generic(record, &data_src);
--
2.33.0
2
1
From: Qinxin Xia <xiaqinxin(a)huawei.com>
driver inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/IC0ZB4
----------------------------------------------------------------------
This patch introduce optprobe for ARM64. In optprobe, probed
instruction is replaced by a branch instruction to trampoline.
Performance of optprobe on Hip08 platform is test using kprobe
example module to analyze the latency of a kernel function,
and here is the result:
common kprobe:
[280709.846380] do_empty returned 0 and took 1530 ns to execute
[280709.852057] do_empty returned 0 and took 550 ns to execute
[280709.857631] do_empty returned 0 and took 440 ns to execute
[280709.863215] do_empty returned 0 and took 380 ns to execute
[280709.868787] do_empty returned 0 and took 360 ns to execute
[280709.874362] do_empty returned 0 and took 340 ns to execute
[280709.879936] do_empty returned 0 and took 320 ns to execute
[280709.885505] do_empty returned 0 and took 300 ns to execute
[280709.891075] do_empty returned 0 and took 280 ns to execute
[280709.896646] do_empty returned 0 and took 290 ns to execute
optprobe:
[ 2965.964572] do_empty returned 0 and took 90 ns to execute
[ 2965.969952] do_empty returned 0 and took 80 ns to execute
[ 2965.975332] do_empty returned 0 and took 70 ns to execute
[ 2965.980714] do_empty returned 0 and took 60 ns to execute
[ 2965.986128] do_empty returned 0 and took 80 ns to execute
[ 2965.991507] do_empty returned 0 and took 70 ns to execute
[ 2965.996884] do_empty returned 0 and took 70 ns to execute
[ 2966.002262] do_empty returned 0 and took 80 ns to execute
[ 2966.007642] do_empty returned 0 and took 70 ns to execute
[ 2966.013020] do_empty returned 0 and took 70 ns to execute
[ 2966.018400] do_empty returned 0 and took 70 ns to execute
As the result shows, optprobe can greatly reduce the latency. Big
latency of common kprobe will significantly impact the real result
while doing performance analysis or debugging performance issues
in lab, so optprobe is useful in this scenario.
The trampoline design is illustrated in the following diagram.
Some commands will be replaced in arch_prepare_optimized_kprobe.
+------------------optprobe_template_entry---------------------+
|- Saving stacks and registers |
|- Loading params for callback |
+------------------optprobe_template_common--------------------+
|- nop |
|(replaced to the branch jump to optprobe_common) |
|- Restore stacks and registers |
+-------------optprobe_template_restore_orig_insn--------------+
|- nop |
|(replaced to the kprobe->opcode) |
+----------------optprobe_template_restore_end-----------------+
|- nop |
|(replaced to next address of the probe point) |
+------------------optprobe_template_val-----------------------+
|- 0 (two 32-bit words) |
|(replaced to params for optprobe_optimized_callback) |
+-----------------optprobe_template_orig_addr------------------+
|- 0 (two 32-bit words) |
|(replaced to origin probe point address) |
+-------------------optprobe_template_end----------------------+
|- nop |
+--------------------------------------------------------------+
Co-developed-by: Qi Liu <liuqi115(a)huawei.com>
Signed-off-by: Qi Liu <liuqi115(a)huawei.com>
Signed-off-by: Qinxin Xia <xiaqinxin(a)huawei.com>
Signed-off-by: Qizhi Zhang <zhangqizhi3(a)h-partners.com>
Signed-off-by: Yushan Wang <wangyushan12(a)huawei.com>
---
arch/arm64/Kconfig | 1 +
arch/arm64/include/asm/kprobes.h | 22 ++
arch/arm64/kernel/probes/Makefile | 2 +
arch/arm64/kernel/probes/opt_arm64.c | 243 ++++++++++++++++++
.../arm64/kernel/probes/optprobe_trampoline.S | 113 ++++++++
5 files changed, 381 insertions(+)
create mode 100644 arch/arm64/kernel/probes/opt_arm64.c
create mode 100644 arch/arm64/kernel/probes/optprobe_trampoline.S
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 9da9d58f1c02..194051628457 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -240,6 +240,7 @@ config ARM64
select HAVE_SYSCALL_TRACEPOINTS
select HAVE_KPROBES
select HAVE_KRETPROBES
+ select HAVE_OPTPROBES
select HAVE_GENERIC_VDSO
select HOTPLUG_CORE_SYNC_DEAD if HOTPLUG_CPU
select HOTPLUG_SMT if (SMP && HOTPLUG_CPU)
diff --git a/arch/arm64/include/asm/kprobes.h b/arch/arm64/include/asm/kprobes.h
index 05cd82eeca13..e4972645a381 100644
--- a/arch/arm64/include/asm/kprobes.h
+++ b/arch/arm64/include/asm/kprobes.h
@@ -39,6 +39,28 @@ void arch_remove_kprobe(struct kprobe *);
int kprobe_fault_handler(struct pt_regs *regs, unsigned int fsr);
int kprobe_exceptions_notify(struct notifier_block *self,
unsigned long val, void *data);
+
+struct arch_optimized_insn {
+ kprobe_opcode_t orig_insn[1];
+ kprobe_opcode_t *trampoline;
+};
+
+#define MAX_OPTIMIZED_LENGTH sizeof(kprobe_opcode_t)
+#define MAX_OPTINSN_SIZE \
+ ((unsigned long)optprobe_template_end - (unsigned long)optprobe_template_entry)
+
+extern __visible kprobe_opcode_t optprobe_template_entry[];
+extern __visible kprobe_opcode_t optprobe_template_val[];
+extern __visible kprobe_opcode_t optprobe_template_orig_addr[];
+extern __visible kprobe_opcode_t optprobe_template_common[];
+extern __visible kprobe_opcode_t optprobe_template_end[];
+extern __visible kprobe_opcode_t optprobe_template_restore_begin[];
+extern __visible kprobe_opcode_t optprobe_template_restore_orig_insn[];
+extern __visible kprobe_opcode_t optprobe_template_restore_end[];
+extern __visible kprobe_opcode_t optinsn_slot[];
+
+void optprobe_common(void);
+
void __kretprobe_trampoline(void);
void __kprobes *trampoline_probe_handler(struct pt_regs *regs);
diff --git a/arch/arm64/kernel/probes/Makefile b/arch/arm64/kernel/probes/Makefile
index 8e4be92e25b1..7b2885b23ff6 100644
--- a/arch/arm64/kernel/probes/Makefile
+++ b/arch/arm64/kernel/probes/Makefile
@@ -4,3 +4,5 @@ obj-$(CONFIG_KPROBES) += kprobes.o decode-insn.o \
simulate-insn.o
obj-$(CONFIG_UPROBES) += uprobes.o decode-insn.o \
simulate-insn.o
+obj-$(CONFIG_OPTPROBES) += opt_arm64.o \
+ optprobe_trampoline.o
diff --git a/arch/arm64/kernel/probes/opt_arm64.c b/arch/arm64/kernel/probes/opt_arm64.c
new file mode 100644
index 000000000000..976ab264350d
--- /dev/null
+++ b/arch/arm64/kernel/probes/opt_arm64.c
@@ -0,0 +1,243 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Code for Kernel probes Jump optimization.
+ *
+ * Copyright (C) 2025 HiSilicon Limited
+ */
+
+#include <linux/jump_label.h>
+#include <linux/kprobes.h>
+
+#include <asm/cacheflush.h>
+#include <asm/compiler.h>
+#include <asm/insn.h>
+#include <asm/kprobes.h>
+#include <asm/patching.h>
+
+#define OPTPROBE_BATCH_SIZE 64
+
+#define TMPL_VAL_IDX \
+ (optprobe_template_val - optprobe_template_entry)
+#define TMPL_ORIGN_ADDR \
+ (optprobe_template_orig_addr - optprobe_template_entry)
+#define TMPL_CALL_COMMON \
+ (optprobe_template_common - optprobe_template_entry)
+#define TMPL_RESTORE_ORIGN_INSN \
+ (optprobe_template_restore_orig_insn - optprobe_template_entry)
+#define TMPL_RESTORE_END \
+ (optprobe_template_restore_end - optprobe_template_entry)
+
+#define OPT_SLOT_SIZE 65536
+#define OPT_INSN_PAGES (OPT_SLOT_SIZE / PAGE_SIZE)
+
+static bool insn_page_in_use[OPT_INSN_PAGES];
+
+void *alloc_optinsn_page(void)
+{
+ int i;
+
+ for (i = 0; i < OPT_INSN_PAGES; i++) {
+ if (!insn_page_in_use[i]) {
+ insn_page_in_use[i] = true;
+ return (void *)((unsigned long)optinsn_slot + PAGE_SIZE * i);
+ }
+ }
+
+ return NULL;
+}
+
+void free_optinsn_page(void *page)
+{
+ unsigned long idx = (unsigned long)page - (unsigned long)optinsn_slot;
+
+ WARN_ONCE(idx & (PAGE_SIZE - 1), "Invalid idx with wrong align\n");
+ idx >>= PAGE_SHIFT;
+ if (WARN_ONCE(idx >= OPT_INSN_PAGES, "Invalid idx with wrong size\n"))
+ return;
+ insn_page_in_use[idx] = false;
+}
+
+/*
+ * In ARM ISA, kprobe opt always replace one instruction (4 bytes
+ * aligned and 4 bytes long). It is impossible to encounter another
+ * kprobe in the address range. So always return 0.
+ */
+int arch_check_optimized_kprobe(struct optimized_kprobe *op)
+{
+ return 0;
+}
+
+int arch_prepared_optinsn(struct arch_optimized_insn *optinsn)
+{
+ return optinsn->trampoline != NULL;
+}
+
+int arch_within_optimized_kprobe(struct optimized_kprobe *op, kprobe_opcode_t *addr)
+{
+ return op->kp.addr == addr;
+}
+
+static int optprobe_check_branch_limit(unsigned long pc, unsigned long addr)
+{
+ long offset;
+
+ if ((pc & 0x3) || (addr & 0x3))
+ return -ERANGE;
+
+ offset = (long)addr - (long)pc;
+ if (offset < -SZ_128M || offset >= SZ_128M)
+ return -ERANGE;
+
+ return 0;
+}
+
+int arch_prepare_optimized_kprobe(struct optimized_kprobe *op, struct kprobe *orig)
+{
+ kprobe_opcode_t *code, *buf;
+ int ret = -ENOMEM;
+ u32 insn;
+ int i;
+
+ buf = kzalloc(MAX_OPTINSN_SIZE, GFP_KERNEL);
+ if (!buf)
+ return ret;
+
+ code = get_optinsn_slot();
+ if (!code)
+ goto out;
+
+ if (optprobe_check_branch_limit((unsigned long)code, (unsigned long)orig->addr + 8)) {
+ ret = -ERANGE;
+ goto error;
+ }
+
+ memcpy(buf, optprobe_template_entry, MAX_OPTINSN_SIZE);
+
+ insn = aarch64_insn_gen_branch_imm((unsigned long)&code[TMPL_CALL_COMMON],
+ (unsigned long)&optprobe_common,
+ AARCH64_INSN_BRANCH_LINK);
+ if (insn == AARCH64_BREAK_FAULT) {
+ ret = -ERANGE;
+ goto error;
+ }
+
+ buf[TMPL_CALL_COMMON] = insn;
+
+ insn = aarch64_insn_gen_branch_imm((unsigned long)&code[TMPL_RESTORE_END],
+ (unsigned long)(op->kp.addr + 1),
+ AARCH64_INSN_BRANCH_NOLINK);
+ if (insn == AARCH64_BREAK_FAULT) {
+ ret = -ERANGE;
+ goto error;
+ }
+
+ buf[TMPL_RESTORE_END] = insn;
+
+ buf[TMPL_VAL_IDX] = cpu_to_le32(lower_32_bits((unsigned long)op));
+ buf[TMPL_VAL_IDX + 1] = cpu_to_le32(upper_32_bits((unsigned long)op));
+ buf[TMPL_ORIGN_ADDR] = cpu_to_le32(lower_32_bits((unsigned long)orig->addr));
+ buf[TMPL_ORIGN_ADDR + 1] = cpu_to_le32(upper_32_bits((unsigned long)orig->addr));
+
+ buf[TMPL_RESTORE_ORIGN_INSN] = orig->opcode;
+
+ /* Setup template */
+ for (i = 0; i < MAX_OPTINSN_SIZE / MAX_OPTIMIZED_LENGTH; i++)
+ aarch64_insn_patch_text_nosync(code + i, buf[i]);
+
+ flush_icache_range((unsigned long)code, (unsigned long)(&code[TMPL_VAL_IDX]));
+ /* Set op->optinsn.trampoline means prepared. */
+ op->optinsn.trampoline = code;
+
+ return 0;
+error:
+ free_optinsn_slot(code, 0);
+
+out:
+ kfree(buf);
+ return ret;
+}
+
+void arch_optimize_kprobes(struct list_head *oplist)
+{
+ struct optimized_kprobe *op, *tmp;
+ kprobe_opcode_t insns[OPTPROBE_BATCH_SIZE];
+ void *addrs[OPTPROBE_BATCH_SIZE];
+ int i = 0;
+
+ list_for_each_entry_safe(op, tmp, oplist, list) {
+ WARN_ON(kprobe_disabled(&op->kp));
+
+ /*
+ * Backup instructions which will be replaced
+ * by jump address
+ */
+ memcpy(op->optinsn.orig_insn, op->kp.addr, AARCH64_INSN_SIZE);
+
+ addrs[i] = op->kp.addr;
+ insns[i] = aarch64_insn_gen_branch_imm((unsigned long)op->kp.addr,
+ (unsigned long)op->optinsn.trampoline,
+ AARCH64_INSN_BRANCH_NOLINK);
+
+ list_del_init(&op->list);
+ if (++i == OPTPROBE_BATCH_SIZE)
+ break;
+ }
+
+ aarch64_insn_patch_text(addrs, insns, i);
+}
+
+void arch_unoptimize_kprobe(struct optimized_kprobe *op)
+{
+ arch_arm_kprobe(&op->kp);
+}
+
+/*
+ * Recover original instructions and breakpoints from relative jumps.
+ * Caller must call with locking kprobe_mutex.
+ */
+void arch_unoptimize_kprobes(struct list_head *oplist,
+ struct list_head *done_list)
+{
+ struct optimized_kprobe *op, *tmp;
+ kprobe_opcode_t insns[OPTPROBE_BATCH_SIZE];
+ void *addrs[OPTPROBE_BATCH_SIZE];
+ int i = 0;
+
+ list_for_each_entry_safe(op, tmp, oplist, list) {
+ addrs[i] = op->kp.addr;
+ insns[i] = BRK64_OPCODE_KPROBES;
+ list_move(&op->list, done_list);
+
+ if (++i == OPTPROBE_BATCH_SIZE)
+ break;
+ }
+
+ aarch64_insn_patch_text(addrs, insns, i);
+}
+
+void arch_remove_optimized_kprobe(struct optimized_kprobe *op)
+{
+ if (op->optinsn.trampoline) {
+ free_optinsn_slot(op->optinsn.trampoline, 1);
+ op->optinsn.trampoline = NULL;
+ }
+
+}
+
+void optprobe_optimized_callback(struct optimized_kprobe *op, struct pt_regs *regs)
+{
+ if (kprobe_disabled(&op->kp))
+ return;
+
+ guard(preempt)();
+
+ if (kprobe_running()) {
+ kprobes_inc_nmissed_count(&op->kp);
+ } else {
+ __this_cpu_write(current_kprobe, &op->kp);
+ get_kprobe_ctlblk()->kprobe_status = KPROBE_HIT_ACTIVE;
+ opt_pre_handler(&op->kp, regs);
+ __this_cpu_write(current_kprobe, NULL);
+ }
+}
+NOKPROBE_SYMBOL(optprobe_optimized_callback)
diff --git a/arch/arm64/kernel/probes/optprobe_trampoline.S b/arch/arm64/kernel/probes/optprobe_trampoline.S
new file mode 100644
index 000000000000..d08f39c5d8c5
--- /dev/null
+++ b/arch/arm64/kernel/probes/optprobe_trampoline.S
@@ -0,0 +1,113 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * trampoline entry and return code for optprobes.
+ */
+
+#include <linux/linkage.h>
+#include <asm/asm-offsets.h>
+#include <asm/assembler.h>
+
+#define OPT_SLOT_SIZE 65536
+
+ .global optinsn_slot
+optinsn_slot:
+ .space OPT_SLOT_SIZE
+
+SYM_CODE_START(optprobe_common)
+ stp x2, x3, [sp, #S_X2]
+ stp x4, x5, [sp, #S_X4]
+ stp x6, x7, [sp, #S_X6]
+ stp x8, x9, [sp, #S_X8]
+ stp x10, x11, [sp, #S_X10]
+ stp x12, x13, [sp, #S_X12]
+ stp x14, x15, [sp, #S_X14]
+ stp x16, x17, [sp, #S_X16]
+ stp x18, x19, [sp, #S_X18]
+ stp x20, x21, [sp, #S_X20]
+ stp x22, x23, [sp, #S_X22]
+ stp x24, x25, [sp, #S_X24]
+ stp x26, x27, [sp, #S_X26]
+ stp x28, x29, [sp, #S_X28]
+ add x2, sp, #PT_REGS_SIZE
+ str x2, [sp, #S_SP]
+ /* Construct a useful saved PSTATE */
+ mrs x2, nzcv
+ mrs x3, daif
+ orr x2, x2, x3
+ mrs x3, CurrentEL
+ orr x2, x2, x3
+ mrs x3, SPSel
+ orr x2, x2, x3
+ stp x1, x2, [sp, #S_PC]
+
+ /* set the pt_regs address to x1 */
+ mov x1, sp
+ /* store lr of optprobe_common temporary */
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+
+ bl optprobe_optimized_callback
+
+ ldp x29, x30, [sp], #16
+
+ ldr x0, [sp, #S_PSTATE]
+ and x0, x0, #(PSR_N_BIT | PSR_Z_BIT | PSR_C_BIT | PSR_V_BIT)
+ msr nzcv, x0
+
+ ldp x0, x1, [sp, #S_X0]
+ ldp x2, x3, [sp, #S_X2]
+ ldp x4, x5, [sp, #S_X4]
+ ldp x6, x7, [sp, #S_X6]
+ ldp x8, x9, [sp, #S_X8]
+ ldp x10, x11, [sp, #S_X10]
+ ldp x12, x13, [sp, #S_X12]
+ ldp x14, x15, [sp, #S_X14]
+ ldp x16, x17, [sp, #S_X16]
+ ldp x18, x19, [sp, #S_X18]
+ ldp x20, x21, [sp, #S_X20]
+ ldp x22, x23, [sp, #S_X22]
+ ldp x24, x25, [sp, #S_X24]
+ ldp x26, x27, [sp, #S_X26]
+ ldp x28, x29, [sp, #S_X28]
+ ret
+SYM_CODE_END(optprobe_common)
+
+ .global optprobe_template_entry
+optprobe_template_entry:
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ ldr x30, 2f
+ stp x29, x30, [sp, #-16]!
+ mov x29, sp
+ sub sp, sp, #PT_REGS_SIZE
+ str lr, [sp, #S_LR]
+ stp x0, x1, [sp, #S_X0]
+ /* Get parameters to optimized_callback() */
+ ldr x0, 1f
+ ldr x1, 2f
+ .global optprobe_template_common
+optprobe_template_common:
+ nop
+ ldr lr, [sp, #S_LR]
+ add sp, sp, #PT_REGS_SIZE
+ ldp x29, x30, [sp], #16
+ ldp x29, x30, [sp], #16
+ .global optprobe_template_restore_orig_insn
+optprobe_template_restore_orig_insn:
+ nop
+ .global optprobe_template_restore_end
+optprobe_template_restore_end:
+ nop
+ .balign
+ .global optprobe_template_val
+optprobe_template_val:
+ 1: .long 0
+ .long 0
+ .balign
+ .global optprobe_template_orig_addr
+optprobe_template_orig_addr:
+ 2: .long 0
+ .long 0
+ .global optprobe_template_end
+optprobe_template_end:
+ nop
--
2.33.0
2
1
*** BLURB HERE ***
Mark Rutland (1):
KVM: arm64: Unconditionally save+flush host FPSIMD/SVE/SME state
Yue Haibing (1):
arm64/fpsimd: Remove unused declaration fpsimd_kvm_prepare()
arch/arm64/include/asm/fpsimd.h | 1 -
arch/arm64/kernel/fpsimd.c | 25 -------------------------
arch/arm64/kvm/fpsimd.c | 33 +++++++++------------------------
3 files changed, 9 insertions(+), 50 deletions(-)
--
2.34.1
2
3

[openeuler:OLK-6.6 2121/2121] mm/kasan/shadow.c:90: undefined reference to `__memcpy_mc'
by kernel test robot 14 Apr '25
by kernel test robot 14 Apr '25
14 Apr '25
tree: https://gitee.com/openeuler/kernel.git OLK-6.6
head: 856215a06729654f070692189189edc4570084a0
commit: b991780c836ceb9a479c6c6e385e914b487e353a [2121/2121] arm64: introduce copy_mc_to_kernel() implementation
config: arm64-randconfig-003-20250414 (https://download.01.org/0day-ci/archive/20250414/202504142028.WisA9n7Q-lkp@…)
compiler: aarch64-linux-gcc (GCC) 8.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250414/202504142028.WisA9n7Q-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/202504142028.WisA9n7Q-lkp@intel.com/
All errors (new ones prefixed by >>):
aarch64-linux-ld: Unexpected GOT/PLT entries detected!
aarch64-linux-ld: Unexpected run-time procedure linkages detected!
aarch64-linux-ld: mm/kasan/shadow.o: in function `memcpy_mc':
>> mm/kasan/shadow.c:90: undefined reference to `__memcpy_mc'
vim +90 mm/kasan/shadow.c
81
82 #ifdef __HAVE_ARCH_MEMCPY_MC
83 #undef memcpy_mc
84 int memcpy_mc(void *dest, const void *src, size_t len)
85 {
86 if (!kasan_check_range(src, len, false, _RET_IP_) ||
87 !kasan_check_range(dest, len, true, _RET_IP_))
88 return (int)len;
89
> 90 return __memcpy_mc(dest, src, len);
91 }
92 #endif
93
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
1
0
From: Qunqin Zhao <zhaoqunqin(a)loongson.cn>
LoongArch inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/IC1081
CVE: NA
--------------------------------
Add support for WST se chip support for LS*5000*.
Signed-off-by: Qunqin Zhao <zhaoqunqin(a)loongson.cn>
---
arch/loongarch/configs/loongson3_defconfig | 1 +
drivers/crypto/Kconfig | 1 +
drivers/crypto/Makefile | 1 +
drivers/crypto/sedriver/Kconfig | 8 +
drivers/crypto/sedriver/Makefile | 7 +
drivers/crypto/sedriver/wst_se_common_type.h | 98 ++
drivers/crypto/sedriver/wst_se_define.h | 27 +
drivers/crypto/sedriver/wst_se_echip_driver.c | 1368 +++++++++++++++++
drivers/crypto/sedriver/wst_se_echip_driver.h | 184 +++
drivers/crypto/sedriver/wst_se_ktrans.h | 17 +
10 files changed, 1712 insertions(+)
create mode 100644 drivers/crypto/sedriver/Kconfig
create mode 100644 drivers/crypto/sedriver/Makefile
create mode 100644 drivers/crypto/sedriver/wst_se_common_type.h
create mode 100644 drivers/crypto/sedriver/wst_se_define.h
create mode 100644 drivers/crypto/sedriver/wst_se_echip_driver.c
create mode 100644 drivers/crypto/sedriver/wst_se_echip_driver.h
create mode 100644 drivers/crypto/sedriver/wst_se_ktrans.h
diff --git a/arch/loongarch/configs/loongson3_defconfig b/arch/loongarch/configs/loongson3_defconfig
index 980f5f2c99a1..cf359d1a2554 100644
--- a/arch/loongarch/configs/loongson3_defconfig
+++ b/arch/loongarch/configs/loongson3_defconfig
@@ -2177,6 +2177,7 @@ CONFIG_CRYPTO_CRC32_LOONGARCH=m
CONFIG_CRYPTO_DEV_NITROX_CNN55XX=m
CONFIG_CRYPTO_DEV_CHELSIO=m
CONFIG_CRYPTO_DEV_VIRTIO=m
+CONFIG_SW_SE_CHIP=m
CONFIG_SIGNED_PE_FILE_VERIFICATION=y
CONFIG_SECONDARY_TRUSTED_KEYRING=y
CONFIG_SYSTEM_BLACKLIST_KEYRING=y
diff --git a/drivers/crypto/Kconfig b/drivers/crypto/Kconfig
index b84a921d293f..efd6a855bca3 100644
--- a/drivers/crypto/Kconfig
+++ b/drivers/crypto/Kconfig
@@ -836,5 +836,6 @@ config CRYPTO_DEV_SA2UL
source "drivers/crypto/aspeed/Kconfig"
source "drivers/crypto/starfive/Kconfig"
source "drivers/crypto/montage/Kconfig"
+source "drivers/crypto/sedriver/Kconfig"
endif # CRYPTO_HW
diff --git a/drivers/crypto/Makefile b/drivers/crypto/Makefile
index 5247d2bf09ce..6ad337bad109 100644
--- a/drivers/crypto/Makefile
+++ b/drivers/crypto/Makefile
@@ -54,3 +54,4 @@ obj-$(CONFIG_CRYPTO_DEV_AMLOGIC_GXL) += amlogic/
obj-y += intel/
obj-y += starfive/
obj-y += montage/
+obj-$(CONFIG_SW_SE_CHIP) += sedriver/
diff --git a/drivers/crypto/sedriver/Kconfig b/drivers/crypto/sedriver/Kconfig
new file mode 100644
index 000000000000..6a11bdf1e5fa
--- /dev/null
+++ b/drivers/crypto/sedriver/Kconfig
@@ -0,0 +1,8 @@
+#
+# se chip configuration
+#
+config SW_SE_CHIP
+ tristate "wst se chip driver"
+ depends on LOONGARCH
+ help
+ If unsure, say N.
diff --git a/drivers/crypto/sedriver/Makefile b/drivers/crypto/sedriver/Makefile
new file mode 100644
index 000000000000..0ee095d1a1d2
--- /dev/null
+++ b/drivers/crypto/sedriver/Makefile
@@ -0,0 +1,7 @@
+#
+# Makefile for SE CHIP Driver
+#
+
+obj-$(CONFIG_SW_SE_CHIP) += sw_se_echip_drv.o
+sw_se_echip_drv-objs := wst_se_echip_driver.o
+
diff --git a/drivers/crypto/sedriver/wst_se_common_type.h b/drivers/crypto/sedriver/wst_se_common_type.h
new file mode 100644
index 000000000000..e29e9bccaa6d
--- /dev/null
+++ b/drivers/crypto/sedriver/wst_se_common_type.h
@@ -0,0 +1,98 @@
+#ifndef _WST_SE_COMMON_TYPE_H
+#define _WST_SE_COMMON_TYPE_H
+
+#include <linux/kernel.h> /* We're doing kernel work */
+#include <linux/module.h> /* Specifically, a module */
+#include <linux/errno.h>
+#include <linux/init.h>
+#include <linux/poll.h>
+#include <linux/pci.h>
+#include <linux/types.h>
+#include <linux/fs.h>
+#include <linux/interrupt.h>
+#include <linux/workqueue.h>
+#include <linux/mm.h>
+#include <linux/sched.h>
+#include <linux/slab.h>
+#include <linux/wait.h>
+#include <linux/version.h>
+#include <linux/ioport.h>
+#include <linux/time.h>
+#include <linux/pagemap.h>
+#include <linux/delay.h>
+#include <linux/list.h>
+#include <linux/uaccess.h>
+#include <linux/io.h>
+#include <asm/mman.h>
+#include <asm/irq.h>
+#include <asm/dma.h>
+
+#define WST_GO_CHANNEL0 0x0002
+#define WST_GO_CHANNEL1 0x0000
+#define WST_GO_CHANNEL2 0x0001
+
+#define SE_OK 0
+
+struct loongson_sedriver_irq {
+ char *pat;
+ int irq;
+};
+
+typedef struct tag_dma_buf_ctl {
+ struct list_head list;
+ unsigned char *pDmaBuf;
+} dmabuf_ctl, *pdmabuf_ctl;
+
+typedef struct tag_Queue_container {
+ struct list_head m_Head;
+ unsigned int qlen;
+ unsigned int max_qlen;
+} QUEUE_CONTAIN, *PQUEUE_CONTAIN;
+
+
+static inline int wst_InitQueue(struct tag_Queue_container *pQueue, int count)
+{
+ INIT_LIST_HEAD(&pQueue->m_Head);
+ pQueue->qlen = 0;
+ pQueue->max_qlen = count;
+ return 0;
+}
+
+
+static inline struct list_head *wst_Popfront_Que(struct tag_Queue_container *pQueue)
+{
+ struct list_head *pNode = NULL;
+
+ if (list_empty(&pQueue->m_Head))
+ return NULL;
+
+ pQueue->qlen--;
+ pNode = pQueue->m_Head.next;
+ list_del(pNode);
+ return pNode;
+}
+
+
+static inline int wst_Pushback_Que(struct tag_Queue_container *pQueue, void *pNode)
+{
+ if (unlikely(pQueue->qlen >= pQueue->max_qlen))
+ return -1;
+
+ pQueue->qlen++;
+ list_add_tail((struct list_head *)(pNode), &pQueue->m_Head);
+ return 0;
+}
+
+#define READUBUF 0
+#define WRITEUBUF 1
+
+static inline int wst_cpyusrbuf(unsigned char *puserbuf,
+ unsigned char *pkbuf, size_t num, int orient)
+{
+ if (orient == READUBUF)
+ return copy_from_user(pkbuf, puserbuf, num);
+ else
+ return copy_to_user(puserbuf, pkbuf, num);
+}
+
+#endif
diff --git a/drivers/crypto/sedriver/wst_se_define.h b/drivers/crypto/sedriver/wst_se_define.h
new file mode 100644
index 000000000000..7a29f1029afa
--- /dev/null
+++ b/drivers/crypto/sedriver/wst_se_define.h
@@ -0,0 +1,27 @@
+#ifndef _WST_SE_DEFINE_H
+#define _WST_SE_DEFINE_H
+
+
+typedef void (*PSECallBackfn)(void *pParam);
+
+#define WST_SE_OK 0 //function syccess
+#define WST_SE_FAILURE 1
+#define WST_SE_ERROR_MALLOC 2
+#define WST_SE_ERROR_OPEN 3
+#define WST_SE_ERROR_ID 4
+#define WST_SE_ERROR_OPERTYPE 5
+#define WST_SE_ERROR_KEYID 6
+#define WST_SE_NOT_SUPPORT 7
+#define WST_SE_ERROR_FULL 8
+#define WST_SE_VERIFY_ERROR 0xb
+#define WST_SE_NOT_SUPPORT_VERIFY 0xd
+#define WST_SE_ERROR_LENGTH 0xc
+#define WST_SE_HAS_OPEN 0xd
+#define WST_COPY_MEM_ERROR 0xe
+#define WST_SE_PARAM_ERROR 0xf
+
+#define BASE_ERROR 0x1000
+#define WST_SE_ERROR_LICENSE 0x100b
+#define WST_SE_ERROR_NOT_SUPPORT_TYPE 0x100d
+
+#endif
diff --git a/drivers/crypto/sedriver/wst_se_echip_driver.c b/drivers/crypto/sedriver/wst_se_echip_driver.c
new file mode 100644
index 000000000000..66e34549d209
--- /dev/null
+++ b/drivers/crypto/sedriver/wst_se_echip_driver.c
@@ -0,0 +1,1368 @@
+#include <linux/semaphore.h>
+#include <linux/moduleparam.h>
+#include <linux/kthread.h>
+#include <linux/module.h>
+#include <linux/of_device.h>
+#include <linux/workqueue.h>
+#include <linux/platform_device.h>
+#include <linux/crypto.h>
+#include <crypto/internal/skcipher.h>
+#include <linux/acpi.h>
+#include <asm/loongson.h>
+#include "wst_se_echip_driver.h"
+
+#define LS_CRYPTO_SE_ADDR1 TO_UNCACHE(LOONGSON_REG_BASE+0x0400)
+#define LS_CRYPTO_SE_ADDR2 TO_UNCACHE(0xc0010200000)
+#define DRIVER_VERSION "01.10.220111"
+DEFINE_SPINLOCK(g_reclistlock);
+DEFINE_SPINLOCK(g_sendlistlock);
+DEFINE_SPINLOCK(g_getdmabuflock);
+
+unsigned char *g_pCacheInBuf = NULL, *g_pCacheOutBuf = NULL;
+static struct class *g_psecclass;
+static struct device *g_psecdev;
+static SECHIPDRV_CTRL *g_psechipDrvCtrl;
+static int g_isechip_Major = -1;
+static struct semaphore g_lowsema, g_lowirqsema;
+static atomic_t g_sendtotallen;
+static struct tag_Queue_container g_RecQueueContainer;
+static struct tag_Queue_container g_SendQueueContainer;
+static int g_suspend;
+static struct semaphore g_dmabufsem;
+struct loongson_sedriver_irq se_irq[] = {
+ {
+ .pat = "se-irq",
+ },
+ {
+ .pat = "se-lirq",
+ },
+};
+static struct tag_Queue_container g_DmaBQueueContainer;
+static struct tag_dma_buf_ctl *g_pdmadatabuf;
+static int g_iDmaBufNum;
+static struct work_struct g_recwork, g_sendwork;
+static struct workqueue_struct *g_worksendqueue, *g_workrecqueue;
+static irqreturn_t se_interrupt(int irq, void *p);
+static irqreturn_t wst_low_channel_status(int irq, void *p);
+static void globalmem_do_send_op(struct work_struct *p);
+static void globalmem_do_rec_op(struct work_struct *p);
+static int g_iUseIntr = 1;
+module_param(g_iUseIntr, int, 0644);
+
+static int se_init_dma_buf(int idatasize, int idatanum)
+{
+ int i;
+ struct tag_dma_buf_ctl *pdmactl;
+
+ wst_InitQueue(&g_DmaBQueueContainer, idatanum);
+ g_pdmadatabuf = kmalloc((sizeof(struct tag_dma_buf_ctl)*idatanum), GFP_KERNEL);
+ if (!g_pdmadatabuf)
+ return -1;
+ for (i = 0; i < idatanum; i++) {
+ pdmactl = &g_pdmadatabuf[i];
+ pdmactl->pDmaBuf = (unsigned char *)__get_free_page(GFP_KERNEL|GFP_DMA);
+ if (!pdmactl->pDmaBuf) {
+ g_iDmaBufNum = i;
+ return SE_OK;
+ }
+ wst_Pushback_Que(&g_DmaBQueueContainer, pdmactl);
+ }
+ g_iDmaBufNum = i;
+ sema_init(&g_dmabufsem, 1);
+ return SE_OK;
+}
+
+static int se_del_dma_buf(void)
+{
+ int i;
+ struct tag_dma_buf_ctl *pdmactl;
+
+ for (i = 0; i < g_iDmaBufNum; i++) {
+ pdmactl = &g_pdmadatabuf[i];
+ if (pdmactl) {
+ free_page((unsigned long)pdmactl->pDmaBuf);
+ pdmactl->pDmaBuf = NULL;
+ }
+ }
+ kfree(g_pdmadatabuf);
+ g_pdmadatabuf = NULL;
+ return 0;
+}
+
+struct tag_dma_buf_ctl *se_get_dma_buf(int ikernel)
+{
+ struct tag_dma_buf_ctl *pbufctl = NULL;
+ unsigned long ultimeout = 0;
+
+ ultimeout = jiffies+20*HZ;
+ while (1) {
+ spin_lock(&g_getdmabuflock);
+ pbufctl = (struct tag_dma_buf_ctl *)wst_Popfront_Que(&g_DmaBQueueContainer);
+ spin_unlock(&g_getdmabuflock);
+ if (pbufctl)
+ return pbufctl;
+ if (down_timeout(&g_dmabufsem, ultimeout))
+ return NULL;
+ }
+ return pbufctl;
+}
+
+int se_free_dma_buf(struct tag_dma_buf_ctl *pdmabufctl)
+{
+ spin_lock(&g_getdmabuflock);
+ wst_Pushback_Que(&g_DmaBQueueContainer, pdmabufctl);
+ spin_unlock(&g_getdmabuflock);
+ if (g_dmabufsem.count <= 0)
+ up(&g_dmabufsem);
+
+ return 0;
+}
+
+static unsigned long bytes_align(struct device *pdev, unsigned long ulVirAddr)
+{
+ unsigned char diff;
+ unsigned long ulPhyAddr = (unsigned long)__pa((void *)ulVirAddr);
+
+ if ((ulPhyAddr & 0x000000000000003f) == 0)
+ return ulVirAddr;
+ diff = ((long)ulPhyAddr & (~(0x000000000000003f))) + 64 - ulPhyAddr;
+ ulVirAddr += diff;
+
+ return ulVirAddr;
+}
+
+static unsigned long descri_bytes_align(unsigned long ulVirAddr)
+{
+ unsigned char diff;
+ unsigned long ulPhyAddr = ulVirAddr;
+
+ if ((ulPhyAddr & (~0x00000000ffffffe0)) == 0)
+ return ulVirAddr;
+ diff = ((long)ulPhyAddr & 0x00000000ffffffe0) + 32 - ulPhyAddr;
+ ulVirAddr += diff;
+ return ulVirAddr;
+}
+
+int se_printk_hex(unsigned char *buff, int length)
+{
+ unsigned char *string_tmp = buff;
+ int i;
+ int count = 0;
+
+ for (i = 0; i < length; i++, count++) {
+ if (count < 16)
+ pr_info("%02x ", string_tmp[i]);
+ else {
+ count = 0;
+ pr_info("\n%02x ", string_tmp[i]);
+ continue;
+ }
+ }
+ pr_info("\n");
+ return 0;
+}
+
+static int se_ChipInit(SECHIPDRV_CTRL *pDrvCtrl)
+{
+ dma_addr_t ulBusAddr;
+ unsigned long ulVirAddr;
+ int i = 0, j = 0;
+ unsigned int dmaoldmask;
+
+ for (i = 0; i < SWCHANNELNUM; i++) {
+ ulVirAddr = (unsigned long)dma_alloc_coherent(
+ pDrvCtrl->pdev,
+ (SE_BDQUEUE_LEN * SE_BD_LENGTH+32),
+ &ulBusAddr, GFP_KERNEL
+ );
+ if (ulVirAddr == 0 || ulBusAddr == 0)
+ return -EFAULT;
+ memset((void *)ulVirAddr, 0, (SE_BDQUEUE_LEN*SE_BD_LENGTH));
+
+ pDrvCtrl->ulBDMemBasePhy[i] = ulBusAddr;
+ pDrvCtrl->ulBDMemBase[i] = ulVirAddr;
+ pDrvCtrl->ulCurrBdReadPtr[i] = 0;
+ pDrvCtrl->ulCurrBdWritePtr[i] = 0;
+ pDrvCtrl->ulCurrReadPtr[i] = 0;
+ pDrvCtrl->ulCurrWritePtr[i] = 0;
+ }
+ for (i = 0; i < SE_BDQUEUE_LEN; i++) {
+ for (j = 0; j < SWCHANNELNUM; j++)
+ (&((SE_BASIC_BD *)(pDrvCtrl->ulBDMemBase[j]))[i])->ucRetCode = 0x0f;
+ }
+ ulBusAddr = descri_bytes_align(pDrvCtrl->ulBDMemBasePhy[0]);
+ HandleWrite32(pDrvCtrl, SE_HREG_BQBA0, HIULONG(ulBusAddr));
+ HandleWrite32(pDrvCtrl, SE_LREG_BQBA0, LOULONG(ulBusAddr));
+ HandleWrite32(pDrvCtrl, SE_REG_BQS0, SE_BDQUEUE_LEN - 1);
+ HandleWrite32(pDrvCtrl, SE_REG_RQRP0, pDrvCtrl->ulCurrBdReadPtr[0]);
+ HandleWrite32(pDrvCtrl, SE_REG_BQWP0, pDrvCtrl->ulCurrBdWritePtr[0]);
+
+ ulBusAddr = descri_bytes_align(pDrvCtrl->ulBDMemBasePhy[1]);
+ HandleWrite32(pDrvCtrl, SE_HREG_BQBA1, HIULONG(ulBusAddr));
+ HandleWrite32(pDrvCtrl, SE_LREG_BQBA1, LOULONG(ulBusAddr));
+ HandleWrite32(pDrvCtrl, SE_REG_BQS1, SE_BDQUEUE_LEN - 1);
+ HandleWrite32(pDrvCtrl, SE_REG_RQRP1, pDrvCtrl->ulCurrBdReadPtr[1]);
+ HandleWrite32(pDrvCtrl, SE_REG_BQWP1, pDrvCtrl->ulCurrBdWritePtr[1]);
+ HandleRead32(pDrvCtrl, SE_REG_MSK, &dmaoldmask);
+ HandleWrite32(pDrvCtrl, SE_REG_MSK, (dmaoldmask | DMA0_CTRL_CHANNEL_ENABLE | DMA1_CTRL_CHANNEL_ENABLE));
+ if (g_iUseIntr != 0)
+ HandleWrite32(pDrvCtrl, SE_LOWREG_INQ, 1);
+ else
+ HandleWrite32(pDrvCtrl, SE_LOWREG_INQ, 0);
+ mdelay(1000);
+
+ return SE_OK;
+}
+
+static void se_ChipRelease(SECHIPDRV_CTRL *pDrvCtrl)
+{
+ int i;
+
+ for (i = 0; i < SWCHANNELNUM; i++) {
+ if (pDrvCtrl->ulBDMemBase[i]) {
+ dma_free_coherent(
+ pDrvCtrl->pdev,
+ (SE_BDQUEUE_LEN * SE_BD_LENGTH),
+ (void *)pDrvCtrl->ulBDMemBase[i],
+ pDrvCtrl->ulBDMemBasePhy[i]
+ );
+ pDrvCtrl->ulBDMemBase[i] = 0;
+ pDrvCtrl->ulBDMemBasePhy[i] = 0;
+ }
+ }
+}
+
+static void SE_RESET(SECHIPDRV_CTRL *pdrvctl)
+{
+
+ unsigned int reg;
+ unsigned long ulreg64, uladdr = LS_CRYPTO_SE_ADDR1;
+
+ HandleRead32(pdrvctl, SE_REG_RESET, ®);
+ HandleWrite32(pdrvctl, SE_REG_RESET, reg|SE_DMA_CONTROL_RESET);
+ mdelay(300);
+ HandleWrite32(pdrvctl, SE_REG_RESET, (reg&(~SE_DMA_CONTROL_RESET))|SE_DMA_CONTROL_SET);
+ mdelay(300);
+ ulreg64 = readq((volatile void __iomem *)uladdr);
+ if ((ulreg64 & 0xf0000000000000) != 0xf0000000000000)
+ writeq(ulreg64|0xf0000000000000, (volatile void __iomem *)uladdr);
+ HandleWrite32(pdrvctl, SE_INT_CLR, 0xf);
+}
+
+static int wst_init(void)
+{
+ int iRes = SE_OK;
+ static u64 wst_dma_mask = DMA_BIT_MASK(64);
+ char cName[256];
+ SECHIPDRV_CTRL *pdrvctl = NULL;
+
+ pdrvctl = kmalloc(sizeof(SECHIPDRV_CTRL), GFP_KERNEL);
+ if (pdrvctl == NULL)
+ return -ENOMEM;
+ memset(pdrvctl, 0, sizeof(SECHIPDRV_CTRL));
+ pdrvctl->ulMemBase = LS_CRYPTO_SE_ADDR2;
+ memset(cName, 0, 256);
+ sema_init(&(pdrvctl->sema), 0);
+ rwlock_init(&(pdrvctl->mr_lock));
+ rwlock_init(&(pdrvctl->mr_lowlock));
+ g_psechipDrvCtrl = pdrvctl;
+ g_psechipDrvCtrl->pdev = g_psecdev;
+ g_psechipDrvCtrl->pdev->dma_mask = &wst_dma_mask;
+ g_psechipDrvCtrl->pdev->coherent_dma_mask = (unsigned long long)&wst_dma_mask;
+ wst_InitQueue(&g_RecQueueContainer, 2000);
+ wst_InitQueue(&g_SendQueueContainer, 2000);
+ SE_RESET(pdrvctl);
+ pdrvctl->ilowIrq = 0;
+ pdrvctl->iIrq = se_irq[0].irq;
+ iRes = request_irq(pdrvctl->iIrq, &se_interrupt, IRQF_SHARED, "wst-se-hirq", pdrvctl);
+ if (iRes) {
+ pr_err("request_irq err\n");
+ pdrvctl->iIrq = 0;
+ goto err;
+ }
+ if (g_iUseIntr == 1) {
+ pdrvctl->ilowIrq = se_irq[1].irq;
+ iRes = request_irq(pdrvctl->ilowIrq, &wst_low_channel_status, IRQF_SHARED, "wst-se-lirq", pdrvctl);
+ if (iRes) {
+ pr_err("\nrequest_lowirq err, iRes=0x%x\n", iRes);
+ pdrvctl->ilowIrq = 0;
+ goto err;
+ }
+ }
+ if (se_ChipInit(pdrvctl) != SE_OK) {
+ iRes = -ENODEV;
+ goto err;
+ }
+ return SE_OK;
+err:
+ if (pdrvctl != NULL) {
+ if (pdrvctl->iIrq) {
+ free_irq(pdrvctl->iIrq, pdrvctl);
+ pdrvctl->iIrq = 0;
+ }
+ if (pdrvctl->ilowIrq) {
+ free_irq(pdrvctl->ilowIrq, pdrvctl);
+ pdrvctl->ilowIrq = 0;
+ }
+ se_ChipRelease(pdrvctl);
+ kfree(pdrvctl);
+ g_psechipDrvCtrl = NULL;
+ }
+ return iRes;
+}
+
+static void wst_clear(void)
+{
+ SECHIPDRV_CTRL *pdrvctl = NULL;
+
+ pdrvctl = g_psechipDrvCtrl;
+ if (pdrvctl) {
+ if (pdrvctl->iIrq) {
+ free_irq(pdrvctl->iIrq, pdrvctl);
+ pdrvctl->iIrq = 0;
+ }
+ if (pdrvctl->ilowIrq) {
+ free_irq(pdrvctl->ilowIrq, pdrvctl);
+ pdrvctl->ilowIrq = 0;
+ }
+ se_ChipRelease(pdrvctl);
+ kfree(pdrvctl);
+ g_psechipDrvCtrl = NULL;
+ }
+}
+static void globalmem_do_send_op(struct work_struct *p)
+{
+ SE_BASIC_BD *pCurBD;
+ unsigned int ulCurrWritePtr, ulWritePtr;
+ unsigned short len = 0;
+ unsigned long ulCurrAddrInput = 0, ulCurrAddrOutput = 0;
+ SECHIPDRV_CTRL *pdrvctl;
+ unsigned char *pInPtr;
+ unsigned short usInlen;
+ unsigned char *pOutPtr;
+ unsigned short *pusOutlen;
+ int iChannel;
+ unsigned char ucFlag;
+ unsigned char ucOpCode;
+ unsigned char *pucRetCode;
+ PSECallBackfn pcallback;
+ void *pParma;
+ int iKernel;
+ struct completion *mycomplete;
+ SEND_PACKAGE *psendpackage;
+ unsigned long ulflag;
+ unsigned long ultimeout;
+ int rv = 0;
+
+ while (1) {
+PROG:
+ spin_lock_irq(&g_sendlistlock);
+ psendpackage = (SEND_PACKAGE *)wst_Popfront_Que(&g_SendQueueContainer);
+ if (!psendpackage) {
+ spin_unlock_irq(&g_sendlistlock);
+ return;
+ }
+ spin_unlock_irq(&g_sendlistlock);
+ pdrvctl = psendpackage->pdrvctl;
+ pInPtr = psendpackage->pInPtr;
+ usInlen = psendpackage->usInlen;
+ pOutPtr = psendpackage->pOutPtr;
+ pusOutlen = psendpackage->pusOutlen;
+ iChannel = psendpackage->iChannel;
+ ucFlag = psendpackage->ucFlag;
+ ucOpCode = psendpackage->ucOpCode;
+ pucRetCode = psendpackage->pucRetCode;
+ pcallback = psendpackage->pcallback;
+ pParma = psendpackage->pParma;
+ iKernel = psendpackage->iKernel;
+ mycomplete = psendpackage->mycomplete;
+ ultimeout = psendpackage->ulendtime;
+ kfree(psendpackage);
+
+ if (iKernel == 0) {
+ while (time_before(jiffies, ultimeout)) {
+#ifdef CONFIG_MIPS
+ if ((pdrvctl->ulCurrBdReadPtr[iChannel] == ((pdrvctl->ulCurrBdWritePtr[iChannel] + 1) & (SE_BDQUEUE_LEN-1)))
+ || ((atomic_read(&g_sendtotallen) + *pusOutlen + SE_FILL_LEN) > SE_MAX_SEND_LEN))
+#else
+ if (pdrvctl->ulCurrBdReadPtr[iChannel] == ((pdrvctl->ulCurrBdWritePtr[iChannel] + 1) & (SE_BDQUEUE_LEN-1)))
+#endif
+ {
+ down_timeout(&(pdrvctl->sema), 1*HZ);
+ rv = WST_SE_ERROR_FULL;
+ } else {
+ rv = 0;
+ break;
+ }
+ }
+ if (rv != 0x0) {
+ *pucRetCode = WST_SE_ERROR_FULL;
+ complete(mycomplete);
+ goto PROG;
+ }
+ } else {
+ ultimeout = jiffies+1*HZ;
+ while (time_before(jiffies, ultimeout)) {
+#ifdef CONFIG_MIPS
+ if ((pdrvctl->ulCurrBdReadPtr[iChannel] == ((pdrvctl->ulCurrBdWritePtr[iChannel] + 1) & (SE_BDQUEUE_LEN-1)))
+ || ((atomic_read(&g_sendtotallen) + *pusOutlen + SE_FILL_LEN) > SE_MAX_SEND_LEN))
+#else
+ if (pdrvctl->ulCurrBdReadPtr[iChannel] == ((pdrvctl->ulCurrBdWritePtr[iChannel] + 1) & (SE_BDQUEUE_LEN-1)))
+#endif
+ {
+ rv = WST_SE_ERROR_FULL;
+ } else {
+ rv = 0;
+ break;
+ }
+ }
+ if (rv != 0x0) {
+ *pucRetCode = WST_SE_ERROR_FULL;
+ if (pcallback)
+ pcallback(pParma);
+ goto PROG;
+ }
+ }
+ ulCurrWritePtr = pdrvctl->ulCurrBdWritePtr[iChannel];
+ ulWritePtr = (ulCurrWritePtr + 1) & (SE_BDQUEUE_LEN-1);
+
+ pCurBD = &((SE_BASIC_BD *)(pdrvctl->ulBDMemBase[iChannel]))[ulCurrWritePtr];
+ memset(pCurBD, 0x0, sizeof(SE_BASIC_BD));
+ if (pcallback != NULL) {
+ (pdrvctl->pcallback)[iChannel][ulCurrWritePtr] = pcallback;
+ pdrvctl->pParma[iChannel][ulCurrWritePtr] = pParma;
+ } else {
+ (pdrvctl->pcallback)[iChannel][ulCurrWritePtr] = NULL;
+ pdrvctl->pParma[iChannel][ulCurrWritePtr] = NULL;
+ }
+
+ pdrvctl->ikernel[iChannel][ulCurrWritePtr] = iKernel;
+ pdrvctl->stsemphore[iChannel][ulCurrWritePtr] = mycomplete;
+
+ if (pInPtr == pOutPtr) {
+ if (pOutPtr) {
+ len = usInlen >= *pusOutlen ? usInlen : *pusOutlen;
+ if (len) {
+ ulCurrAddrOutput = dma_map_single(pdrvctl->pdev, pOutPtr, len, DMA_BIDIRECTIONAL);
+ if (ulCurrAddrOutput == 0) {
+ TRACEERR("map ulCurrAddrOutput error\n");
+ *pucRetCode = WST_SE_FAILURE;
+ if (iKernel == 0) {
+ complete(mycomplete);
+ } else {
+ *pucRetCode = WST_SE_FAILURE;
+ if (pcallback)
+ pcallback(pParma);
+ }
+ goto PROG;
+ }
+ pCurBD->ulOutputLPtr = LOULONG(ulCurrAddrOutput);
+ pCurBD->ulOutputHPtr = HIULONG(ulCurrAddrOutput);
+ pCurBD->ulInputLPtr = pCurBD->ulOutputLPtr;
+ pCurBD->ulInputHPtr = pCurBD->ulOutputHPtr;
+ }
+ }
+ } else {
+ if (pOutPtr && (*pusOutlen)) {
+ ulCurrAddrOutput = dma_map_single(pdrvctl->pdev, pOutPtr, *pusOutlen, DMA_FROM_DEVICE);
+ if (ulCurrAddrOutput == 0) {
+ TRACEERR("map ulCurrAddrOutput error\n");
+ *pucRetCode = WST_SE_FAILURE;
+ if (iKernel == 0) {
+ complete(mycomplete);
+ } else {
+ *pucRetCode = WST_SE_FAILURE;
+ if (pcallback)
+ pcallback(pParma);
+ }
+ goto PROG;
+ }
+ pCurBD->ulOutputLPtr = LOULONG(ulCurrAddrOutput);
+ pCurBD->ulOutputHPtr = HIULONG(ulCurrAddrOutput);
+ }
+ if (usInlen && pInPtr) {
+ ulCurrAddrInput = dma_map_single(pdrvctl->pdev, pInPtr, usInlen, DMA_TO_DEVICE);
+ if (ulCurrAddrInput == 0) {
+ if (ulCurrAddrOutput) {
+ dma_unmap_single(pdrvctl->pdev, ulCurrAddrOutput, *pusOutlen, DMA_FROM_DEVICE);
+ pCurBD->ulOutputLPtr = 0;
+ pCurBD->ulOutputHPtr = 0;
+ }
+ *pucRetCode = WST_SE_FAILURE;
+ if (iKernel == 0) {
+ complete(mycomplete);
+ } else {
+ *pucRetCode = WST_SE_FAILURE;
+ if (pcallback)
+ pcallback(pParma);
+ }
+ goto PROG;
+ }
+ pCurBD->ulInputLPtr = LOULONG(ulCurrAddrInput);
+ pCurBD->ulInputHPtr = HIULONG(ulCurrAddrInput);
+ }
+ }
+ pCurBD->ucOpCode = ucOpCode & 0x0f;
+ pCurBD->ucFlag = ucFlag & 0x7;
+ pCurBD->usInputLength = usInlen;
+ if (pusOutlen)
+ pCurBD->usOutputLength = *pusOutlen;
+
+ pCurBD->ucRetCode = 0x0f;
+
+ pdrvctl->pusOutlen[iChannel][ulCurrWritePtr] = pusOutlen;
+ pdrvctl->usInlen[iChannel][ulCurrWritePtr] = usInlen&0xffff;
+ if (ulCurrAddrOutput)
+ pdrvctl->ulOutputPtr[iChannel][ulCurrWritePtr] = (unsigned long *)ulCurrAddrOutput;
+ else
+ pdrvctl->ulOutputPtr[iChannel][ulCurrWritePtr] = 0;
+ if (ulCurrAddrInput)
+ pdrvctl->ulInputPtr[iChannel][ulCurrWritePtr] = (unsigned long *)ulCurrAddrInput;
+ else
+ pdrvctl->ulInputPtr[iChannel][ulCurrWritePtr] = 0;
+ pdrvctl->pucRetCode[iChannel][ulCurrWritePtr] = pucRetCode;
+
+#ifdef CONFIG_MIPS
+ atomic_add((*(pdrvctl->pusOutlen[iChannel][ulCurrWritePtr]) + SE_FILL_LEN), &g_sendtotallen);
+#endif
+ write_lock_irqsave(&(pdrvctl->mr_lock), ulflag);
+ if (iChannel == 0)
+ HandleWrite32(pdrvctl, SE_REG_BQWP0, ulWritePtr);
+ else
+ HandleWrite32(pdrvctl, SE_REG_BQWP1, ulWritePtr);
+ write_unlock_irqrestore(&(pdrvctl->mr_lock), ulflag);
+ pdrvctl->ulCurrBdWritePtr[iChannel] = ulWritePtr;
+ }
+}
+
+static int se_hardtrans(
+ SECHIPDRV_CTRL *pdrvctl,
+ unsigned char *pInPtr,
+ unsigned short usInlen,
+ unsigned char *pOutPtr,
+ unsigned short *pusOutlen,
+ int iChannel,
+ unsigned char ucFlag,
+ unsigned char ucOpCode,
+ unsigned char *pucRetCode,
+ PSECallBackfn pcallback,
+ void *pParma,
+ int iKernel,
+ struct completion *mycomplete
+ )
+{
+ SEND_PACKAGE *psendpackage;
+ gfp_t gfp_flag;
+
+ if (in_interrupt())
+ gfp_flag = GFP_ATOMIC;
+ else
+ gfp_flag = GFP_KERNEL;
+ if (g_suspend == 1)
+ return WST_SE_FAILURE;
+ psendpackage = kmalloc(sizeof(SEND_PACKAGE), gfp_flag);
+ if (psendpackage == NULL)
+ return -1;
+
+ psendpackage->pdrvctl = pdrvctl;
+ psendpackage->pInPtr = pInPtr;
+ psendpackage->usInlen = usInlen;
+ psendpackage->pOutPtr = pOutPtr;
+ psendpackage->pusOutlen = pusOutlen;
+ psendpackage->iChannel = iChannel;
+ psendpackage->ucFlag = ucFlag;
+ psendpackage->ucOpCode = ucOpCode;
+ psendpackage->pucRetCode = pucRetCode;
+ psendpackage->pcallback = pcallback;
+ psendpackage->pParma = pParma;
+ psendpackage->iKernel = iKernel;
+ psendpackage->mycomplete = mycomplete;
+ psendpackage->ulendtime = jiffies+30*HZ;
+ spin_lock_irq(&g_sendlistlock);
+ if (wst_Pushback_Que(&g_SendQueueContainer, psendpackage) == -1) {
+ spin_unlock_irq(&g_sendlistlock);
+ kfree(psendpackage);
+ return WST_SE_ERROR_FULL;
+ }
+ spin_unlock_irq(&g_sendlistlock);
+ queue_work(g_worksendqueue, &g_sendwork);
+ return 0;
+}
+
+static irqreturn_t wst_low_channel_status(int irq, void *p)
+{
+ SECHIPDRV_CTRL *pdrvctl = (SECHIPDRV_CTRL *)p;
+ int64_t ulIntStat = 0;
+ unsigned long ulflag;
+
+ read_lock_irqsave(&(pdrvctl->mr_lock), ulflag);
+ HandleRead64(pdrvctl, SE_LOWREG_STS, &ulIntStat);
+ if (ulIntStat == 2) {
+ HandleWrite64(pdrvctl, SE_LOWINT_CLEAR, 2);
+ up(&g_lowirqsema);
+ }
+ read_unlock_irqrestore(&(pdrvctl->mr_lock), ulflag);
+
+ return IRQ_HANDLED;
+}
+
+static int se_useropen(struct inode *inode, struct file *file)
+{
+ if (MINOR(inode->i_rdev) != 0)
+ return -ENODEV;
+
+ return SE_OK;
+}
+
+static ssize_t wst_low_channel_userwrite_op(
+ SECHIPDRV_CTRL *pdrvctl,
+ SWCommuData *UserCommuData,
+ int iskernel
+ )
+{
+ unsigned long long addr = 0, outaddr = 0;
+ int ilen;
+ int count = SE_OK;
+ unsigned long long ulsendlen;
+ unsigned char *m_pCacheInBuf;
+ unsigned char *m_pCacheOutBuf;
+ unsigned long ulflag;
+
+ if ((g_pCacheInBuf == NULL) || (g_pCacheOutBuf == NULL))
+ return -EFAULT;
+
+ m_pCacheInBuf = (unsigned char *)bytes_align(0, (unsigned long)g_pCacheInBuf);
+ m_pCacheOutBuf = (unsigned char *)bytes_align(0, (unsigned long)g_pCacheOutBuf);
+ if (iskernel == 0) {
+ if (wst_cpyusrbuf((void *)(UserCommuData->pucInbuf), (void *)m_pCacheInBuf, UserCommuData->usInputLen, READUBUF)) {
+ TRACEERR("copy user data error\n");
+ return -EFAULT;
+ }
+ } else
+
+ memcpy((void *)m_pCacheInBuf, (void *)(UserCommuData->pucInbuf), UserCommuData->usInputLen);
+ ilen = UserCommuData->usInputLen >= UserCommuData->usOutputLen ? UserCommuData->usInputLen:UserCommuData->usOutputLen;
+ addr = dma_map_single(pdrvctl->pdev, m_pCacheInBuf, ilen, DMA_TO_DEVICE);
+ if (addr == 0) {
+ TRACEERR("transfer buffer is err\n");
+ return -EFAULT;
+ }
+ outaddr = dma_map_single(pdrvctl->pdev, m_pCacheOutBuf, ilen, DMA_FROM_DEVICE);
+ if (outaddr == 0) {
+ TRACEERR("transfer buffer is err\n");
+ dma_unmap_single(pdrvctl->pdev, addr, ilen, DMA_TO_DEVICE);
+ return -EFAULT;
+ }
+ ulsendlen = (UserCommuData->usInputLen/8);
+ ulsendlen = (ulsendlen & 0x00000000ffffffff) << 32;
+ write_lock_irqsave(&(pdrvctl->mr_lock), ulflag);
+ HandleWrite64(pdrvctl, SE_WRITE_REG1, ulsendlen);
+ HandleWrite64(pdrvctl, SE_WRITE_REG2, addr);
+ HandleWrite64(pdrvctl, SE_WRITE_REG3, outaddr);
+ write_unlock_irqrestore(&(pdrvctl->mr_lock), ulflag);
+ if (g_iUseIntr != 0) {
+ if (down_interruptible(&g_lowirqsema) == -EINTR) {
+ count = -EINTR;
+ goto EXIT;
+ }
+ } else {
+ unsigned long start_jiffies = 0, end_jiffies = 0;
+ int64_t ulIntStat = 0;
+
+ start_jiffies = jiffies;
+ end_jiffies = jiffies;
+ while (1) {
+ write_lock_irqsave(&(pdrvctl->mr_lock), ulflag);
+ HandleRead64(pdrvctl, SE_LOWREG_SR, &ulIntStat);
+ end_jiffies = jiffies;
+ if (ulIntStat == 1) {
+ HandleWrite64(pdrvctl, SE_LOWREG_SR, 0);
+ write_unlock_irqrestore(&(pdrvctl->mr_lock), ulflag);
+ break;
+ }
+ write_unlock_irqrestore(&(pdrvctl->mr_lock), ulflag);
+ if (jiffies_to_msecs(end_jiffies-start_jiffies)/1000 >= 90) {
+ count = -EFAULT;
+ goto EXIT;
+ }
+ }
+ }
+ dma_unmap_single(pdrvctl->pdev, addr, ilen, DMA_TO_DEVICE);
+ dma_unmap_single(pdrvctl->pdev, outaddr, ilen, DMA_FROM_DEVICE);
+ if (UserCommuData->usOutputLen) {
+ if (iskernel == 0) {
+ if (wst_cpyusrbuf(UserCommuData->pucOutbuf, m_pCacheOutBuf, UserCommuData->usOutputLen, WRITEUBUF))
+ return -EFAULT;
+ } else
+ memcpy(UserCommuData->pucOutbuf, m_pCacheOutBuf, UserCommuData->usOutputLen);
+ }
+ return count;
+EXIT:
+ dma_unmap_single(pdrvctl->pdev, addr, ilen, DMA_TO_DEVICE);
+ dma_unmap_single(pdrvctl->pdev, outaddr, ilen, DMA_FROM_DEVICE);
+ return count;
+}
+
+static ssize_t se_userwrite(struct file *file, const char *buf, size_t count, loff_t *ppos)
+{
+ unsigned char *pCacheBuf = NULL, *pCacheOutBuf = NULL, *pCacheBufalign = NULL, *pCacheOutBufalign = NULL;
+ SECHIPDRV_CTRL *pdrvctl = NULL;
+ SWCommuData *pCommuData = NULL;
+ int iCommuDatalen = 0;
+ int pucRetCode = 0;
+ unsigned short iChannel = 0;
+ unsigned char ucFlag = 0, ucOpCode = 0;
+ int *ppucRetCode;
+ struct completion mycomplete;
+ struct tag_dma_buf_ctl *pbufinctl = NULL;
+ int iret = 0;
+
+ if (count == 0) {
+ TRACEERR("count=0\n");
+ return SE_OK;
+ }
+
+ if (MINOR(file->f_path.dentry->d_inode->i_rdev) != 0)
+ return -ENODEV;
+
+ iCommuDatalen = sizeof(SWCommuData);
+ if (count != iCommuDatalen)
+ return -EINVAL;
+
+ pdrvctl = g_psechipDrvCtrl;
+ pCommuData = kmalloc(iCommuDatalen, GFP_KERNEL);
+ if (!pCommuData) {
+ TRACEERR("pCommuData NULL\n");
+ return -ENOMEM;
+ }
+ if (wst_cpyusrbuf((void *)buf, (void *)pCommuData, iCommuDatalen, READUBUF)) {
+ TRACEERR("copy user data error\n");
+ count = -EFAULT;
+ goto EXIT;
+ }
+ switch ((pCommuData->usFlags)&0x000f) {
+ case WST_GO_CHANNEL2:
+ if ((pCommuData->usInputLen > DMA_BUFSIZE) || (pCommuData->usOutputLen > DMA_BUFSIZE)) {
+ TRACEERR("len is error\n");
+ count = -EINVAL;
+ goto EXIT;
+ }
+ if (down_interruptible(&g_lowsema) == -EINTR) {
+ count = -EINTR;
+ goto EXIT;
+ }
+ count = wst_low_channel_userwrite_op(pdrvctl, pCommuData, 0);
+ up(&g_lowsema);
+ goto EXIT;
+ case WST_GO_CHANNEL0:
+ if (pCommuData->usInputLen == 0) {
+ count = -EINVAL;
+ goto EXIT;
+ }
+ if (pCommuData->usInputLen != 0) {
+ if (pCommuData->usInputLen > DMA_BUFSIZE) {
+ count = -EINVAL;
+ goto EXIT;
+ }
+ ucFlag = INPUT_VALID;
+ if (pCommuData->usOutputLen)
+ ucFlag |= OUTPUT_VALID;
+ }
+
+ iChannel = 0;
+ ucOpCode = 0x0;
+ break;
+ case WST_GO_CHANNEL1:
+ if (pCommuData->usInputLen == 0) {
+ count = -EINVAL;
+ goto EXIT;
+ }
+ if (pCommuData->usInputLen != 0) {
+ if (pCommuData->usInputLen > DMA_BUFSIZE) {
+ count = -EINVAL;
+ goto EXIT;
+ }
+ ucFlag = INPUT_VALID;
+ if (pCommuData->usOutputLen)
+ ucFlag |= OUTPUT_VALID;
+ }
+ iChannel = 1;
+ ucOpCode = 0x0;
+ break;
+ default:
+ {
+ count = -EINVAL;
+ goto EXIT;
+ }
+ }
+ pbufinctl = se_get_dma_buf(0);
+ if (pbufinctl == NULL) {
+ TRACEERR("kmalloc pCacheBuf error\n");
+ count = -ENOMEM;
+ goto EXIT;
+ }
+ pCacheBuf = pbufinctl->pDmaBuf;
+ pCacheBufalign = pCacheBuf;
+
+ if (wst_cpyusrbuf((void *)(pCommuData->pucInbuf), (void *)pCacheBufalign,
+ pCommuData->usInputLen, READUBUF)) {
+ TRACEERR("cpyuserbuf pCacheBufalign error\n");
+ count = -ENOMEM;
+ goto EXIT;
+ }
+
+ pCacheOutBuf = pbufinctl->pDmaBuf;
+ pCacheOutBufalign = pCacheOutBuf;
+
+ ppucRetCode = &pucRetCode;
+
+ count = SE_OK;
+ init_completion(&mycomplete);
+ iret = se_hardtrans(
+ pdrvctl,
+ pCacheBufalign,
+ pCommuData->usInputLen,
+ pCacheOutBufalign,
+ &(pCommuData->usOutputLen),
+ iChannel,
+ ucFlag,
+ ucOpCode,
+ (unsigned char *)ppucRetCode,
+ 0,
+ 0,
+ 0,
+ &mycomplete
+ );
+ if (iret == -1) {
+ count = -EIO;
+ goto EXIT;
+ }
+ if (!wait_for_completion_timeout(&mycomplete, msecs_to_jiffies(60*1000))) {
+ count = -EFAULT;
+ goto EXIT;
+ }
+ if (pucRetCode != SE_OK) {
+ count = -(SE_BASEERR+pucRetCode);
+ goto EXIT;
+ }
+
+ if (pCommuData->pucOutbuf) {
+ if (wst_cpyusrbuf(pCommuData->pucOutbuf, pCacheOutBufalign,
+ pCommuData->usOutputLen, WRITEUBUF)) {
+ count = -EFAULT;
+ goto EXIT;
+ }
+ }
+EXIT:
+ if (pbufinctl)
+ se_free_dma_buf(pbufinctl);
+ kfree(pCommuData);
+ return count;
+}
+static void globalmem_do_rec_op(struct work_struct *p)
+{
+ INT_MESSAGE *intmessage;
+ unsigned long ulflags1;
+
+ while (1) {
+ spin_lock_irqsave(&g_reclistlock, ulflags1);
+ intmessage = (INT_MESSAGE *)wst_Popfront_Que(&g_RecQueueContainer);
+ spin_unlock_irqrestore(&g_reclistlock, ulflags1);
+ if (!intmessage)
+ return;
+ intmessage->pcallback(intmessage->pParma);
+ kfree(intmessage);
+ }
+}
+static irqreturn_t se_interrupt(int irq, void *p)
+{
+ SECHIPDRV_CTRL *pdrvctl;
+ SE_BASIC_BD *pCurBD;
+ unsigned int ulCurrReadPtr, ulReadPtr;
+ int iChannel;
+ int len = 0;
+ int i;
+ unsigned char ucMyRetCode = 0;
+ unsigned long ulIntStat;
+ int istatus[2] = {1, 2};
+ unsigned long ulflags;
+
+ pdrvctl = (SECHIPDRV_CTRL *)p;
+ if (!pdrvctl)
+ return IRQ_HANDLED;
+
+ read_lock_irqsave(&(pdrvctl->mr_lock), ulflags);
+ HandleRead32(pdrvctl, SE_REG_STS, &ulIntStat);
+ read_unlock_irqrestore(&(pdrvctl->mr_lock), ulflags);
+ if ((!(ulIntStat & INT_STAT_DMA_MASK)) || (ulIntStat == 0xffffffff))
+ return IRQ_HANDLED;
+
+ for (i = 0; i <= 1; i++) {
+ if (ulIntStat & istatus[i]) {
+ if (i == 0) {
+ read_lock_irqsave(&(pdrvctl->mr_lock), ulflags);
+ HandleWrite32(pdrvctl, SE_INT_CLR, 1);
+ HandleRead32(pdrvctl, SE_REG_RQRP0, &ulReadPtr);
+ read_unlock_irqrestore(&(pdrvctl->mr_lock), ulflags);
+ iChannel = 0;
+ } else {
+ read_lock_irqsave(&(pdrvctl->mr_lock), ulflags);
+ HandleWrite32(pdrvctl, SE_INT_CLR, 2);
+ HandleRead32(pdrvctl, SE_REG_RQRP1, &ulReadPtr);
+ read_unlock_irqrestore(&(pdrvctl->mr_lock), ulflags);
+ iChannel = 1;
+ }
+ } else
+ continue;
+ ulCurrReadPtr = pdrvctl->ulCurrReadPtr[iChannel];
+ while (1) {
+ if (ulCurrReadPtr != ulReadPtr) {
+ pCurBD = &((SE_BASIC_BD *)(pdrvctl->ulBDMemBase[iChannel]))[ulCurrReadPtr];
+ if ((pCurBD->ucRetCode == 0x0f) || ((pCurBD->ucFlag & 0x8) != 0x8)) {
+ continue;
+ } else {
+ if (pdrvctl->ulInputPtr[iChannel][ulCurrReadPtr] == pdrvctl->ulOutputPtr[iChannel][ulCurrReadPtr]) {
+ if (pdrvctl->ulOutputPtr[iChannel][ulCurrReadPtr]) {
+ len = (*(pdrvctl->pusOutlen[iChannel][ulCurrReadPtr])) >= pdrvctl->usInlen[iChannel][ulCurrReadPtr] ?
+ (*(pdrvctl->pusOutlen[iChannel][ulCurrReadPtr])):pdrvctl->usInlen[iChannel][ulCurrReadPtr];
+ dma_unmap_single(
+ pdrvctl->pdev,
+ (unsigned long)(pdrvctl->ulOutputPtr[iChannel][ulCurrReadPtr]),
+ len,
+ DMA_BIDIRECTIONAL
+ );
+ pCurBD->ulOutputLPtr = 0;
+ pCurBD->ulOutputHPtr = 0;
+ pCurBD->ulInputHPtr = 0;
+ pCurBD->ulInputLPtr = 0;
+ pdrvctl->ulOutputPtr[iChannel][ulCurrReadPtr] = 0;
+ }
+ } else {
+ if (pdrvctl->ulOutputPtr[iChannel][ulCurrReadPtr]) {
+ dma_unmap_single(
+ pdrvctl->pdev,
+ (unsigned long)(pdrvctl->ulOutputPtr[iChannel][ulCurrReadPtr]),
+ *(pdrvctl->pusOutlen[iChannel][ulCurrReadPtr]), DMA_FROM_DEVICE
+ );
+ smp_wmb();
+ pdrvctl->ulOutputPtr[iChannel][ulCurrReadPtr] = 0;
+ }
+ if (pdrvctl->ulInputPtr[iChannel][ulCurrReadPtr]) {
+ dma_unmap_single(
+ pdrvctl->pdev,
+ (unsigned long)(pdrvctl->ulInputPtr[iChannel][ulCurrReadPtr]),
+ pdrvctl->usInlen[iChannel][ulCurrReadPtr],
+ DMA_TO_DEVICE
+ );
+ pdrvctl->ulInputPtr[iChannel][ulCurrReadPtr] = 0;
+ }
+ }
+ ucMyRetCode = pCurBD->ucRetCode;
+ memcpy(pdrvctl->pucRetCode[iChannel][ulCurrReadPtr], &ucMyRetCode, 1);
+ if (pCurBD->ucRetCode != SE_OK)
+ pr_info("\nstatus %x\n", pCurBD->ucRetCode);
+#ifdef CONFIG_MIPS
+ atomic_sub(((*(pdrvctl->pusOutlen[iChannel][ulCurrReadPtr])) + SE_FILL_LEN), &g_sendtotallen);
+#endif
+ if ((pdrvctl->ikernel)[iChannel][ulCurrReadPtr] != 0) {
+ if (pdrvctl->pcallback[iChannel][ulCurrReadPtr]) {
+ INT_MESSAGE *intmessage = NULL;
+ unsigned long ulflags1;
+
+ intmessage = (INT_MESSAGE *)kmalloc(sizeof(INT_MESSAGE), GFP_ATOMIC);
+ if (!intmessage)
+ return IRQ_HANDLED;
+ intmessage->pcallback = pdrvctl->pcallback[iChannel][ulCurrReadPtr];
+ intmessage->pParma = pdrvctl->pParma[iChannel][ulCurrReadPtr];
+ spin_lock_irqsave(&g_reclistlock, ulflags1);
+ wst_Pushback_Que(&g_RecQueueContainer, intmessage);
+ spin_unlock_irqrestore(&g_reclistlock, ulflags1);
+ queue_work(g_workrecqueue, &g_recwork);
+ }
+ } else {
+ complete(pdrvctl->stsemphore[iChannel][ulCurrReadPtr]);
+ }
+ ulCurrReadPtr = ((ulCurrReadPtr + 1)&(SE_BDQUEUE_LEN - 1));
+ pdrvctl->ulCurrReadPtr[iChannel] = ulCurrReadPtr;
+ pdrvctl->ulCurrBdReadPtr[iChannel] = ulCurrReadPtr;
+ if (pdrvctl->sema.count <= 0)
+ up(&(pdrvctl->sema));
+ }
+ } else
+
+ break;
+ }
+ }
+ return IRQ_HANDLED;
+}
+
+static int se_userrelease(struct inode *inode, struct file *file)
+{
+ return SE_OK;
+}
+
+ssize_t se_kernelwrite(
+ unsigned char *pInPtr,
+ unsigned short usInlen,
+ unsigned char *pOutPtr,
+ unsigned short *pusOutlen,
+ unsigned char ucFlag,
+ unsigned char *pucRetCode,
+ PSECallBackfn pcallback,
+ void *pParma
+ )
+{
+ int iret;
+ SECHIPDRV_CTRL *pdrvctl;
+ int iChannel;
+ unsigned char ucOpCode;
+ SWCommuData CommuData;
+
+ pdrvctl = g_psechipDrvCtrl;
+
+ switch (ucFlag) {
+ case WST_GO_CHANNEL2:
+ {
+ CommuData.pucInbuf = pInPtr;
+ CommuData.pucOutbuf = pOutPtr;
+ CommuData.usFlags = 0;
+ CommuData.usInputLen = usInlen;
+ CommuData.usOutputLen = *pusOutlen;
+ CommuData.usReserve = 0;
+ if (down_interruptible(&g_lowsema) == -EINTR)
+ return -EINTR;
+ iret = wst_low_channel_userwrite_op(pdrvctl, &CommuData, 1);
+ up(&g_lowsema);
+ return iret;
+ }
+ case WST_GO_CHANNEL0:
+ if (pcallback == NULL)
+ return WST_SE_PARAM_ERROR;
+ if (usInlen == 0)
+ return -EINVAL;
+ ucFlag = 0;
+ if (usInlen != 0) {
+ if (usInlen > DMA_BUFSIZE)
+ return -EINVAL;
+ ucFlag = INPUT_VALID;
+ if (*pusOutlen)
+ ucFlag |= OUTPUT_VALID;
+ }
+ iChannel = 0;
+ ucOpCode = 0x0;
+ break;
+ case WST_GO_CHANNEL1:
+ if (pcallback == NULL)
+ return WST_SE_PARAM_ERROR;
+ if (usInlen == 0) {
+ return -EINVAL;
+ }
+ ucFlag = 0;
+ if (usInlen != 0) {
+ if (usInlen > DMA_BUFSIZE)
+ return -EINVAL;
+ ucFlag = INPUT_VALID;
+ if (*pusOutlen)
+ ucFlag |= OUTPUT_VALID;
+ }
+ iChannel = 1;
+ ucOpCode = 0x0;
+ break;
+ default:
+ return -EINVAL;
+ }
+ iret = se_hardtrans(
+ pdrvctl,
+ pInPtr,
+ usInlen,
+ pOutPtr,
+ pusOutlen,
+ iChannel,
+ ucFlag,
+ ucOpCode,
+ pucRetCode,
+ pcallback,
+ pParma,
+ 1,
+ NULL
+ );
+ if (iret == -1)
+ return -EIO;
+
+ return SE_OK;
+}
+EXPORT_SYMBOL(se_kernelwrite);
+
+static long se_userioctl(struct file *filp, u_int cmd, u_long arg)
+{
+ long iret = SE_OK;
+ SECHIPDRV_CTRL *pdrvctl = g_psechipDrvCtrl;
+ unsigned long ulvalue;
+
+ HandleRead64(pdrvctl, 0x120, &ulvalue);
+ pr_info("read reg value is 0x%lx in offset 120\n", ulvalue);
+ HandleRead64(pdrvctl, 0x118, &ulvalue);
+ pr_info("read reg value is 0x%lx in offset 118\n", ulvalue);
+
+ return iret;
+}
+
+
+static const struct file_operations SE_fops = {
+ .owner = THIS_MODULE,
+ .write = se_userwrite,
+ .open = se_useropen,
+ .release = se_userrelease,
+ .unlocked_ioctl = se_userioctl,
+ .compat_ioctl = se_userioctl
+};
+
+int se_chip_load(void)
+{
+ int iRes = SE_OK;
+
+ if (g_isechip_Major >= 0)
+ return WST_SE_HAS_OPEN;
+ g_psechipDrvCtrl = NULL;
+ iRes = se_init_dma_buf(DMA_BUFSIZE, CTL_DMABUFNUM);
+ if (iRes != SE_OK)
+ return WST_SE_ERROR_MALLOC;
+ iRes = register_chrdev(0, CRYNAME, &SE_fops);
+ if (iRes < 0)
+ goto EXIT;
+
+ g_isechip_Major = iRes;
+ iRes = 0;
+ g_psecclass = class_create(CRYNAME);
+ if (IS_ERR(g_psecclass)) {
+ iRes = PTR_ERR(g_psecclass);
+ goto EXIT;
+ }
+ g_psecdev = device_create(g_psecclass, NULL, MKDEV(g_isechip_Major, 0), NULL, CRYNAME);
+ if (IS_ERR(g_psecdev)) {
+ iRes = PTR_ERR(g_psecdev);
+ goto EXIT;
+ }
+ iRes = wst_init();
+ if (iRes != SE_OK)
+ goto EXIT;
+
+ sema_init(&g_lowsema, 1);
+ sema_init(&g_lowirqsema, 0);
+ atomic_set(&g_sendtotallen, 0);
+ g_pCacheInBuf = (unsigned char *)__get_free_page(GFP_DMA);
+ if (IS_ERR(g_pCacheInBuf)) {
+ iRes = PTR_ERR(g_pCacheInBuf);
+ goto EXIT;
+ }
+ g_pCacheOutBuf = (unsigned char *)__get_free_page(GFP_DMA);
+ if (IS_ERR(g_pCacheOutBuf)) {
+ iRes = PTR_ERR(g_pCacheOutBuf);
+ goto EXIT;
+ }
+
+ g_worksendqueue = alloc_workqueue("seworksendqueue",
+ WQ_MEM_RECLAIM|__WQ_ORDERED|WQ_UNBOUND, 1);
+ if (IS_ERR(g_worksendqueue)) {
+ iRes = PTR_ERR(g_worksendqueue);
+ goto EXIT;
+ }
+ g_workrecqueue = alloc_workqueue("seworkrecqueue", WQ_MEM_RECLAIM|__WQ_ORDERED, 0);
+ if (IS_ERR(g_workrecqueue)) {
+ iRes = PTR_ERR(g_workrecqueue);
+ goto EXIT;
+ }
+ INIT_WORK(&g_recwork, globalmem_do_rec_op);
+ INIT_WORK(&g_sendwork, globalmem_do_send_op);
+ pr_info("this driver version is %s\n", DRIVER_VERSION);
+
+ return SE_OK;
+EXIT:
+ se_del_dma_buf();
+ if (g_pCacheInBuf) {
+
+ free_page((unsigned long)g_pCacheInBuf);
+ g_pCacheInBuf = NULL;
+ }
+ if (g_pCacheOutBuf) {
+
+ free_page((unsigned long)g_pCacheOutBuf);
+ g_pCacheOutBuf = NULL;
+ }
+ if (g_worksendqueue) {
+ destroy_workqueue(g_worksendqueue);
+ g_worksendqueue = NULL;
+ }
+ if (g_workrecqueue) {
+ destroy_workqueue(g_workrecqueue);
+ g_workrecqueue = NULL;
+ }
+ wst_clear();
+ if (g_psecdev) {
+ device_unregister(g_psecdev);
+ g_psecdev = NULL;
+ }
+ if (g_psecclass) {
+ class_destroy(g_psecclass);
+ g_psecclass = NULL;
+ }
+ if (g_isechip_Major >= 0) {
+ unregister_chrdev(g_isechip_Major, CRYNAME);
+ g_isechip_Major = -1;
+ }
+ return iRes;
+}
+
+void se_chip_unload(void)
+{
+ SECHIPDRV_CTRL *pdrvctl = NULL;
+
+ pdrvctl = g_psechipDrvCtrl;
+
+ up(&pdrvctl->sema);
+ if (g_pCacheInBuf) {
+
+ free_page((unsigned long)g_pCacheInBuf);
+ g_pCacheInBuf = NULL;
+ }
+ if (g_pCacheOutBuf) {
+
+ free_page((unsigned long)g_pCacheOutBuf);
+ g_pCacheOutBuf = NULL;
+ }
+ if (g_worksendqueue) {
+ cancel_work_sync(&g_sendwork);
+ destroy_workqueue(g_worksendqueue);
+ g_worksendqueue = NULL;
+ }
+ if (g_workrecqueue) {
+ cancel_work_sync(&g_recwork);
+ destroy_workqueue(g_workrecqueue);
+ g_workrecqueue = NULL;
+ }
+ wst_clear();
+ if (g_psecdev) {
+ device_destroy(g_psecclass, MKDEV(g_isechip_Major, 0));
+ g_psecdev = NULL;
+ }
+ if (g_psecclass) {
+ class_destroy(g_psecclass);
+ g_psecclass = NULL;
+ }
+ if (g_isechip_Major >= 0) {
+ unregister_chrdev(g_isechip_Major, CRYNAME);
+ g_isechip_Major = -1;
+ }
+ se_del_dma_buf();
+}
+
+static int loongson_cryp_get_irq(struct platform_device *pdev, char *pat)
+{
+ int i;
+ struct resource *res = pdev->resource;
+
+ for (i = 0; i < pdev->num_resources; i++) {
+ if (strcmp(res[i].name, pat) == 0)
+ return res[i].start;
+ }
+ return -1;
+
+}
+static int loongson_cryp_probe(struct platform_device *pdev)
+{
+ int i;
+
+ if (ACPI_COMPANION(&pdev->dev)) {
+ se_irq[0].irq = platform_get_irq(pdev, 1);
+ se_irq[1].irq = platform_get_irq(pdev, 0);
+ } else {
+ for (i = 0; i < pdev->num_resources; i++) {
+ se_irq[i].irq = loongson_cryp_get_irq(pdev,
+ se_irq[i].pat);
+ if (se_irq[i].irq < 0) {
+ pr_warn("ERROR:sedriver get irq failed\n");
+ return -1;
+ }
+ }
+ }
+
+ return se_chip_load();
+}
+static int loongson_cryp_remove(struct platform_device *pdev)
+{
+ se_chip_unload();
+ return 0;
+}
+static int loongson_cryp_suspend(struct platform_device *pdev, pm_message_t state)
+{
+ g_suspend = 1;
+ cancel_work_sync(&g_recwork);
+ cancel_work_sync(&g_sendwork);
+ flush_work(&g_recwork);
+ flush_work(&g_sendwork);
+ se_chip_unload();
+ return 0;
+}
+
+static int loongson_cryp_resume(struct platform_device *pdev)
+{
+ int i;
+
+ g_suspend = 0;
+ g_worksendqueue = NULL;
+ g_workrecqueue = NULL;
+ g_isechip_Major = -1;
+ g_pCacheInBuf = NULL;
+ g_pCacheOutBuf = NULL;
+ g_iUseIntr = 1;
+ spin_lock_init(&g_reclistlock);
+ spin_lock_init(&g_sendlistlock);
+ spin_lock_init(&g_getdmabuflock);
+
+ for (i = 0; i < pdev->num_resources; i++) {
+ se_irq[i].irq = loongson_cryp_get_irq(pdev, se_irq[i].pat);
+
+ if (se_irq[i].irq < 0) {
+ pr_warn("ERROR:sedriver get irq failed\n");
+ return -1;
+ }
+ }
+ se_chip_load();
+ return 0;
+}
+
+static const struct acpi_device_id loongson_cryp_acpi_match[] = {
+ {"LOON0003"},
+ {}
+};
+MODULE_DEVICE_TABLE(acpi, loongson_cryp_acpi_match);
+
+static struct platform_driver loongson_cryp_driver = {
+ .probe = loongson_cryp_probe,
+ .remove = loongson_cryp_remove,
+ .suspend = loongson_cryp_suspend,
+ .resume = loongson_cryp_resume,
+ .driver = {
+ .name = "loongson3_crypto",
+ .acpi_match_table = ACPI_PTR(loongson_cryp_acpi_match),
+ },
+};
+
+static int __init initmodule(void)
+{
+ return platform_driver_register(&loongson_cryp_driver);
+}
+
+static void __exit exitmodule(void)
+{
+ platform_driver_unregister(&loongson_cryp_driver);
+}
+
+module_init(initmodule);
+module_exit(exitmodule);
+
+MODULE_ALIAS("platform:loongson3_crypto");
+MODULE_AUTHOR("dcm");
+MODULE_DESCRIPTION("se encryption chip driver Co westone");
+MODULE_VERSION(DRIVER_VERSION);
+MODULE_LICENSE("GPL");
diff --git a/drivers/crypto/sedriver/wst_se_echip_driver.h b/drivers/crypto/sedriver/wst_se_echip_driver.h
new file mode 100644
index 000000000000..3e562e55faac
--- /dev/null
+++ b/drivers/crypto/sedriver/wst_se_echip_driver.h
@@ -0,0 +1,184 @@
+#ifndef _WST_SE_ECHIP_DRIVER_H
+#define _WST_SE_ECHIP_DRIVER_H
+#include "wst_se_ktrans.h"
+
+#define CRYNAME "wst-se"
+
+#define SWBUFNUM 512
+#define SWCHANNELNUM 2
+#define CTL_DMABUFNUM 512
+
+#define DMA_MASK 0xffffffff
+#define SE_DMA_CONTROL_RESET 0x80000000
+#define SE_DMA_CONTROL_SET 0x00000000
+
+#define SE_BASEERR 1000
+
+#define SE_MAX_SEND_LEN (3*2048)
+#define SE_FILL_LEN 48
+#define SE_BD_LENGTH sizeof(SE_BASIC_BD)
+#define SE_BDQUEUE_LEN SWBUFNUM
+#define DMA0_CTRL_CHANNEL_ENABLE 1
+#define DMA0_CTRL_CHANNEL_DISABLE 0xfffffffe
+#define DMA1_CTRL_CHANNEL_ENABLE 2
+#define DMA1_CTRL_CHANNEL_DISABLE 0xfffffffd
+
+#define SE_REG_RESET 0
+#define SE_REG_STS 0x08
+#define SE_INT_CTRL 0x10
+#define SE_REG_MSK 0x18
+#define SE_INT_CLR 0x20
+
+#define SE_LREG_BQBA0 0x100
+#define SE_HREG_BQBA0 0x108
+#define SE_REG_BQS0 0x110
+#define SE_REG_BQWP0 0x118
+#define SE_REG_RQRP0 0x120
+
+#define SE_LREG_BQBA1 0x128
+#define SE_HREG_BQBA1 0x130
+#define SE_REG_BQS1 0x138
+#define SE_REG_BQWP1 0x140
+#define SE_REG_RQRP1 0x148
+
+#define SE_WRITE_REG1 0x200
+#define SE_WRITE_REG2 0x208
+#define SE_WRITE_REG3 0x210
+#define SE_LOWREG_STS 0x240
+#define SE_LOWINT_CLEAR 0x248
+#define SE_LOWREG_INQ 0x1600
+#define SE_LOWREG_SR 0x1608
+#define INPUT_VALID 0x4
+#define OUTPUT_VALID 0x8
+#define SE_LOWINT_CLR 0x228
+#define INT_STAT_DMA0_PACK_DONE 1
+#define INT_STAT_DMA1_PACK_DONE 2
+#define INT_STAT_DMA_MASK (INT_STAT_DMA0_PACK_DONE|INT_STAT_DMA1_PACK_DONE)
+
+typedef struct tagSEdrvctl {
+
+ unsigned long ulMemBase;
+ struct device *pdev;
+ struct device dev;
+ unsigned int ulCurrBdReadPtr[SWCHANNELNUM];
+ unsigned int ulCurrBdWritePtr[SWCHANNELNUM];
+ unsigned int ulCurrReadPtr[SWCHANNELNUM];
+ unsigned int ulCurrWritePtr[SWCHANNELNUM];
+ PSECallBackfn pcallback[SWCHANNELNUM][SWBUFNUM];
+ void *pParma[SWCHANNELNUM][SWBUFNUM];
+ struct completion *stsemphore[SWCHANNELNUM][SWBUFNUM];
+ int ikernel[SWCHANNELNUM][SWBUFNUM];
+ unsigned long ulBDMemBasePhy[SWCHANNELNUM];
+ unsigned long ulBDMemBase[SWCHANNELNUM];
+ unsigned short *pusOutlen[SWCHANNELNUM][SWBUFNUM];
+ unsigned short usInlen[SWCHANNELNUM][SWBUFNUM];
+ unsigned long *ulOutputPtr[SWCHANNELNUM][SWBUFNUM];
+ unsigned long *ulInputPtr[SWCHANNELNUM][SWBUFNUM];
+ unsigned char *pucRetCode[SWCHANNELNUM][SWBUFNUM];
+ rwlock_t mr_lock;
+ rwlock_t mr_lowlock;
+ spinlock_t readlock;
+ struct semaphore sema;
+ int iIrq;
+ int ilowIrq;
+} SECHIPDRV_CTRL;
+
+typedef struct tagSEBasicBD {
+
+ unsigned int ucOpCode:4,
+ ucFlag:4,
+ ucRetCode:8,
+ ucInCtxLength:8,
+ ucOutCtxLength:8;
+ unsigned int usInputLength:16,
+ usOutputLength:16;
+ unsigned int ulCtxLPtr;
+ unsigned int ulCtxHPtr;
+ unsigned int ulInputLPtr;
+ unsigned int ulInputHPtr;
+ unsigned int ulOutputLPtr;
+ unsigned int ulOutputHPtr;
+
+} SE_BASIC_BD;
+
+#define SW_CONT_BUF_SIZE 0x100
+#define DMA_BUFSIZE 0x1000
+
+#define PAGE_NUM (DMA_BUFSIZE/PAGE_SIZE+1)
+
+typedef struct _SW_GET_STAT {
+ unsigned long TXD;
+ unsigned long RXD;
+} SW_GET_STAT, *PSW_GET_STAT;
+
+DEFINE_SPINLOCK(g_writelock);
+
+#define HandleRead32(handle, addr, pData) \
+ do { \
+ smp_mb(); \
+ *(pData) = readl((void *)(handle->ulMemBase + addr)); \
+ } while (0)
+
+#define HandleWrite32(handle, addr, value)\
+ do { \
+ writel(value, (void *)(handle->ulMemBase + addr)); \
+ smp_mb(); \
+ } while (0)
+
+#define HandleRead64(handle, addr, pData) \
+ do { \
+ smp_mb(); \
+ *(pData) = readq((void *)(handle->ulMemBase + addr)); \
+ } while (0)
+
+#define HandleWrite64(handle, addr, value)\
+ do { \
+ writeq(value, (void *)(handle->ulMemBase + addr)); \
+ smp_mb(); \
+ } while (0)
+
+
+#define SPRINTF sprintf
+
+#define HIULONG(w) ((unsigned int)((((unsigned long long)w) >> 32) & 0x00000000ffffffff))
+#define LOULONG(w) ((unsigned int)((unsigned long long)w) & 0x00000000ffffffff)
+
+#ifdef DEBUG_DRIVER
+ #define TRACEMSG(fmt, args...) printk(KERN_DEBUG "msg: " fmt, ##args)
+#else
+ #define TRACEMSG(fmt, args...)
+#endif
+
+#ifdef DEBUG_DRIVER_ERROR
+ #define TRACEERR(fmt, args...) printk(KERN_DEBUG "err: " fmt, ##args)
+#else
+ #define TRACEERR(fmt, args...)
+#endif
+
+#define HIBYTE(w) ((unsigned char)(((unsigned short)(w) >> 8) & 0xFF))
+#define LOBYTE(w) ((unsigned char)(w))
+
+typedef struct ST_SEND_PACKAGE {
+ struct list_head list;
+ SECHIPDRV_CTRL *pdrvctl;
+ unsigned char *pInPtr;
+ unsigned short usInlen;
+ unsigned char *pOutPtr;
+ unsigned short *pusOutlen;
+ int iChannel;
+ unsigned char ucFlag;
+ unsigned char ucOpCode;
+ unsigned char *pucRetCode;
+ PSECallBackfn pcallback;
+ void *pParma;
+ int iKernel;
+ struct completion *mycomplete;
+ unsigned long ulendtime;
+} SEND_PACKAGE;
+
+typedef struct ST_INT_MESSAGE {
+ struct list_head list;
+ PSECallBackfn pcallback;
+ void *pParma;
+} INT_MESSAGE;
+#endif
diff --git a/drivers/crypto/sedriver/wst_se_ktrans.h b/drivers/crypto/sedriver/wst_se_ktrans.h
new file mode 100644
index 000000000000..da6c4b8f2824
--- /dev/null
+++ b/drivers/crypto/sedriver/wst_se_ktrans.h
@@ -0,0 +1,17 @@
+#ifndef _WST_SE_KTRANS_H
+#define _WST_SE_KTRANS_H
+
+#include "wst_se_common_type.h"
+#include "wst_se_define.h"
+
+
+typedef struct tagSWCOMMUDATA {
+ unsigned short usFlags;
+ unsigned short usInputLen;
+ unsigned short usOutputLen;
+ unsigned short usReserve;
+ unsigned char *pucInbuf;
+ unsigned char *pucOutbuf;
+} SWCommuData;
+
+#endif
--
2.33.0
2
1

14 Apr '25
Ard Biesheuvel (1):
objtool: Fix C jump table annotations for Clang
Gao Qihang (1):
LoongArch: Preserve firmware configuration if ACPI requires.
Juxin Gao (1):
LoongArch: configs: set CONFIG_UNWINDER_ORC=y
Ming Wang (1):
LoongArch: configs: Disable CONFIG_RT_GROUP_SCHED to prevent cgroup2
issues
Tiezhu Yang (3):
LoongArch: Handle fp, lsx, lasx and lbt assembly symbols
LoongArch: Make some signal and ptrace functions non-static
LoongArch: Export some signal functions
arch/loongarch/configs/loongson3_defconfig | 2 +-
arch/loongarch/include/asm/fpu.h | 6 ++++
arch/loongarch/include/asm/lbt.h | 4 +++
arch/loongarch/kernel/Makefile | 1 +
arch/loongarch/kernel/extern.c | 31 ++++++++++++++++++
arch/loongarch/kernel/fpu.S | 6 ++++
arch/loongarch/kernel/lbt.S | 4 +++
arch/loongarch/kernel/ptrace.c | 37 +++++++++++++++-------
arch/loongarch/kernel/signal.c | 28 +++-------------
arch/loongarch/pci/acpi.c | 14 ++++++--
include/linux/compiler.h | 2 +-
tools/objtool/check.c | 7 ++--
tools/objtool/include/objtool/special.h | 2 +-
13 files changed, 102 insertions(+), 42 deletions(-)
create mode 100644 arch/loongarch/kernel/extern.c
--
2.33.0
2
8
From: Qunqin Zhao <zhaoqunqin(a)loongson.cn>
LoongArch inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/IC10DU
CVE: NA
--------------------------------
Add support for WST se chip support for LS*5000*.
Signed-off-by: Qunqin Zhao <zhaoqunqin(a)loongson.cn>
---
arch/loongarch/configs/loongson3_defconfig | 1 +
drivers/crypto/Kconfig | 1 +
drivers/crypto/Makefile | 1 +
drivers/crypto/sedriver/Kconfig | 8 +
drivers/crypto/sedriver/Makefile | 7 +
drivers/crypto/sedriver/wst_se_common_type.h | 98 ++
drivers/crypto/sedriver/wst_se_define.h | 27 +
drivers/crypto/sedriver/wst_se_echip_driver.c | 1368 +++++++++++++++++
drivers/crypto/sedriver/wst_se_echip_driver.h | 184 +++
drivers/crypto/sedriver/wst_se_ktrans.h | 17 +
10 files changed, 1712 insertions(+)
create mode 100644 drivers/crypto/sedriver/Kconfig
create mode 100644 drivers/crypto/sedriver/Makefile
create mode 100644 drivers/crypto/sedriver/wst_se_common_type.h
create mode 100644 drivers/crypto/sedriver/wst_se_define.h
create mode 100644 drivers/crypto/sedriver/wst_se_echip_driver.c
create mode 100644 drivers/crypto/sedriver/wst_se_echip_driver.h
create mode 100644 drivers/crypto/sedriver/wst_se_ktrans.h
diff --git a/arch/loongarch/configs/loongson3_defconfig b/arch/loongarch/configs/loongson3_defconfig
index 980f5f2c99a1..cf359d1a2554 100644
--- a/arch/loongarch/configs/loongson3_defconfig
+++ b/arch/loongarch/configs/loongson3_defconfig
@@ -2177,6 +2177,7 @@ CONFIG_CRYPTO_CRC32_LOONGARCH=m
CONFIG_CRYPTO_DEV_NITROX_CNN55XX=m
CONFIG_CRYPTO_DEV_CHELSIO=m
CONFIG_CRYPTO_DEV_VIRTIO=m
+CONFIG_SW_SE_CHIP=m
CONFIG_SIGNED_PE_FILE_VERIFICATION=y
CONFIG_SECONDARY_TRUSTED_KEYRING=y
CONFIG_SYSTEM_BLACKLIST_KEYRING=y
diff --git a/drivers/crypto/Kconfig b/drivers/crypto/Kconfig
index b84a921d293f..efd6a855bca3 100644
--- a/drivers/crypto/Kconfig
+++ b/drivers/crypto/Kconfig
@@ -836,5 +836,6 @@ config CRYPTO_DEV_SA2UL
source "drivers/crypto/aspeed/Kconfig"
source "drivers/crypto/starfive/Kconfig"
source "drivers/crypto/montage/Kconfig"
+source "drivers/crypto/sedriver/Kconfig"
endif # CRYPTO_HW
diff --git a/drivers/crypto/Makefile b/drivers/crypto/Makefile
index 5247d2bf09ce..6ad337bad109 100644
--- a/drivers/crypto/Makefile
+++ b/drivers/crypto/Makefile
@@ -54,3 +54,4 @@ obj-$(CONFIG_CRYPTO_DEV_AMLOGIC_GXL) += amlogic/
obj-y += intel/
obj-y += starfive/
obj-y += montage/
+obj-$(CONFIG_SW_SE_CHIP) += sedriver/
diff --git a/drivers/crypto/sedriver/Kconfig b/drivers/crypto/sedriver/Kconfig
new file mode 100644
index 000000000000..6a11bdf1e5fa
--- /dev/null
+++ b/drivers/crypto/sedriver/Kconfig
@@ -0,0 +1,8 @@
+#
+# se chip configuration
+#
+config SW_SE_CHIP
+ tristate "wst se chip driver"
+ depends on LOONGARCH
+ help
+ If unsure, say N.
diff --git a/drivers/crypto/sedriver/Makefile b/drivers/crypto/sedriver/Makefile
new file mode 100644
index 000000000000..0ee095d1a1d2
--- /dev/null
+++ b/drivers/crypto/sedriver/Makefile
@@ -0,0 +1,7 @@
+#
+# Makefile for SE CHIP Driver
+#
+
+obj-$(CONFIG_SW_SE_CHIP) += sw_se_echip_drv.o
+sw_se_echip_drv-objs := wst_se_echip_driver.o
+
diff --git a/drivers/crypto/sedriver/wst_se_common_type.h b/drivers/crypto/sedriver/wst_se_common_type.h
new file mode 100644
index 000000000000..e29e9bccaa6d
--- /dev/null
+++ b/drivers/crypto/sedriver/wst_se_common_type.h
@@ -0,0 +1,98 @@
+#ifndef _WST_SE_COMMON_TYPE_H
+#define _WST_SE_COMMON_TYPE_H
+
+#include <linux/kernel.h> /* We're doing kernel work */
+#include <linux/module.h> /* Specifically, a module */
+#include <linux/errno.h>
+#include <linux/init.h>
+#include <linux/poll.h>
+#include <linux/pci.h>
+#include <linux/types.h>
+#include <linux/fs.h>
+#include <linux/interrupt.h>
+#include <linux/workqueue.h>
+#include <linux/mm.h>
+#include <linux/sched.h>
+#include <linux/slab.h>
+#include <linux/wait.h>
+#include <linux/version.h>
+#include <linux/ioport.h>
+#include <linux/time.h>
+#include <linux/pagemap.h>
+#include <linux/delay.h>
+#include <linux/list.h>
+#include <linux/uaccess.h>
+#include <linux/io.h>
+#include <asm/mman.h>
+#include <asm/irq.h>
+#include <asm/dma.h>
+
+#define WST_GO_CHANNEL0 0x0002
+#define WST_GO_CHANNEL1 0x0000
+#define WST_GO_CHANNEL2 0x0001
+
+#define SE_OK 0
+
+struct loongson_sedriver_irq {
+ char *pat;
+ int irq;
+};
+
+typedef struct tag_dma_buf_ctl {
+ struct list_head list;
+ unsigned char *pDmaBuf;
+} dmabuf_ctl, *pdmabuf_ctl;
+
+typedef struct tag_Queue_container {
+ struct list_head m_Head;
+ unsigned int qlen;
+ unsigned int max_qlen;
+} QUEUE_CONTAIN, *PQUEUE_CONTAIN;
+
+
+static inline int wst_InitQueue(struct tag_Queue_container *pQueue, int count)
+{
+ INIT_LIST_HEAD(&pQueue->m_Head);
+ pQueue->qlen = 0;
+ pQueue->max_qlen = count;
+ return 0;
+}
+
+
+static inline struct list_head *wst_Popfront_Que(struct tag_Queue_container *pQueue)
+{
+ struct list_head *pNode = NULL;
+
+ if (list_empty(&pQueue->m_Head))
+ return NULL;
+
+ pQueue->qlen--;
+ pNode = pQueue->m_Head.next;
+ list_del(pNode);
+ return pNode;
+}
+
+
+static inline int wst_Pushback_Que(struct tag_Queue_container *pQueue, void *pNode)
+{
+ if (unlikely(pQueue->qlen >= pQueue->max_qlen))
+ return -1;
+
+ pQueue->qlen++;
+ list_add_tail((struct list_head *)(pNode), &pQueue->m_Head);
+ return 0;
+}
+
+#define READUBUF 0
+#define WRITEUBUF 1
+
+static inline int wst_cpyusrbuf(unsigned char *puserbuf,
+ unsigned char *pkbuf, size_t num, int orient)
+{
+ if (orient == READUBUF)
+ return copy_from_user(pkbuf, puserbuf, num);
+ else
+ return copy_to_user(puserbuf, pkbuf, num);
+}
+
+#endif
diff --git a/drivers/crypto/sedriver/wst_se_define.h b/drivers/crypto/sedriver/wst_se_define.h
new file mode 100644
index 000000000000..7a29f1029afa
--- /dev/null
+++ b/drivers/crypto/sedriver/wst_se_define.h
@@ -0,0 +1,27 @@
+#ifndef _WST_SE_DEFINE_H
+#define _WST_SE_DEFINE_H
+
+
+typedef void (*PSECallBackfn)(void *pParam);
+
+#define WST_SE_OK 0 //function syccess
+#define WST_SE_FAILURE 1
+#define WST_SE_ERROR_MALLOC 2
+#define WST_SE_ERROR_OPEN 3
+#define WST_SE_ERROR_ID 4
+#define WST_SE_ERROR_OPERTYPE 5
+#define WST_SE_ERROR_KEYID 6
+#define WST_SE_NOT_SUPPORT 7
+#define WST_SE_ERROR_FULL 8
+#define WST_SE_VERIFY_ERROR 0xb
+#define WST_SE_NOT_SUPPORT_VERIFY 0xd
+#define WST_SE_ERROR_LENGTH 0xc
+#define WST_SE_HAS_OPEN 0xd
+#define WST_COPY_MEM_ERROR 0xe
+#define WST_SE_PARAM_ERROR 0xf
+
+#define BASE_ERROR 0x1000
+#define WST_SE_ERROR_LICENSE 0x100b
+#define WST_SE_ERROR_NOT_SUPPORT_TYPE 0x100d
+
+#endif
diff --git a/drivers/crypto/sedriver/wst_se_echip_driver.c b/drivers/crypto/sedriver/wst_se_echip_driver.c
new file mode 100644
index 000000000000..66e34549d209
--- /dev/null
+++ b/drivers/crypto/sedriver/wst_se_echip_driver.c
@@ -0,0 +1,1368 @@
+#include <linux/semaphore.h>
+#include <linux/moduleparam.h>
+#include <linux/kthread.h>
+#include <linux/module.h>
+#include <linux/of_device.h>
+#include <linux/workqueue.h>
+#include <linux/platform_device.h>
+#include <linux/crypto.h>
+#include <crypto/internal/skcipher.h>
+#include <linux/acpi.h>
+#include <asm/loongson.h>
+#include "wst_se_echip_driver.h"
+
+#define LS_CRYPTO_SE_ADDR1 TO_UNCACHE(LOONGSON_REG_BASE+0x0400)
+#define LS_CRYPTO_SE_ADDR2 TO_UNCACHE(0xc0010200000)
+#define DRIVER_VERSION "01.10.220111"
+DEFINE_SPINLOCK(g_reclistlock);
+DEFINE_SPINLOCK(g_sendlistlock);
+DEFINE_SPINLOCK(g_getdmabuflock);
+
+unsigned char *g_pCacheInBuf = NULL, *g_pCacheOutBuf = NULL;
+static struct class *g_psecclass;
+static struct device *g_psecdev;
+static SECHIPDRV_CTRL *g_psechipDrvCtrl;
+static int g_isechip_Major = -1;
+static struct semaphore g_lowsema, g_lowirqsema;
+static atomic_t g_sendtotallen;
+static struct tag_Queue_container g_RecQueueContainer;
+static struct tag_Queue_container g_SendQueueContainer;
+static int g_suspend;
+static struct semaphore g_dmabufsem;
+struct loongson_sedriver_irq se_irq[] = {
+ {
+ .pat = "se-irq",
+ },
+ {
+ .pat = "se-lirq",
+ },
+};
+static struct tag_Queue_container g_DmaBQueueContainer;
+static struct tag_dma_buf_ctl *g_pdmadatabuf;
+static int g_iDmaBufNum;
+static struct work_struct g_recwork, g_sendwork;
+static struct workqueue_struct *g_worksendqueue, *g_workrecqueue;
+static irqreturn_t se_interrupt(int irq, void *p);
+static irqreturn_t wst_low_channel_status(int irq, void *p);
+static void globalmem_do_send_op(struct work_struct *p);
+static void globalmem_do_rec_op(struct work_struct *p);
+static int g_iUseIntr = 1;
+module_param(g_iUseIntr, int, 0644);
+
+static int se_init_dma_buf(int idatasize, int idatanum)
+{
+ int i;
+ struct tag_dma_buf_ctl *pdmactl;
+
+ wst_InitQueue(&g_DmaBQueueContainer, idatanum);
+ g_pdmadatabuf = kmalloc((sizeof(struct tag_dma_buf_ctl)*idatanum), GFP_KERNEL);
+ if (!g_pdmadatabuf)
+ return -1;
+ for (i = 0; i < idatanum; i++) {
+ pdmactl = &g_pdmadatabuf[i];
+ pdmactl->pDmaBuf = (unsigned char *)__get_free_page(GFP_KERNEL|GFP_DMA);
+ if (!pdmactl->pDmaBuf) {
+ g_iDmaBufNum = i;
+ return SE_OK;
+ }
+ wst_Pushback_Que(&g_DmaBQueueContainer, pdmactl);
+ }
+ g_iDmaBufNum = i;
+ sema_init(&g_dmabufsem, 1);
+ return SE_OK;
+}
+
+static int se_del_dma_buf(void)
+{
+ int i;
+ struct tag_dma_buf_ctl *pdmactl;
+
+ for (i = 0; i < g_iDmaBufNum; i++) {
+ pdmactl = &g_pdmadatabuf[i];
+ if (pdmactl) {
+ free_page((unsigned long)pdmactl->pDmaBuf);
+ pdmactl->pDmaBuf = NULL;
+ }
+ }
+ kfree(g_pdmadatabuf);
+ g_pdmadatabuf = NULL;
+ return 0;
+}
+
+struct tag_dma_buf_ctl *se_get_dma_buf(int ikernel)
+{
+ struct tag_dma_buf_ctl *pbufctl = NULL;
+ unsigned long ultimeout = 0;
+
+ ultimeout = jiffies+20*HZ;
+ while (1) {
+ spin_lock(&g_getdmabuflock);
+ pbufctl = (struct tag_dma_buf_ctl *)wst_Popfront_Que(&g_DmaBQueueContainer);
+ spin_unlock(&g_getdmabuflock);
+ if (pbufctl)
+ return pbufctl;
+ if (down_timeout(&g_dmabufsem, ultimeout))
+ return NULL;
+ }
+ return pbufctl;
+}
+
+int se_free_dma_buf(struct tag_dma_buf_ctl *pdmabufctl)
+{
+ spin_lock(&g_getdmabuflock);
+ wst_Pushback_Que(&g_DmaBQueueContainer, pdmabufctl);
+ spin_unlock(&g_getdmabuflock);
+ if (g_dmabufsem.count <= 0)
+ up(&g_dmabufsem);
+
+ return 0;
+}
+
+static unsigned long bytes_align(struct device *pdev, unsigned long ulVirAddr)
+{
+ unsigned char diff;
+ unsigned long ulPhyAddr = (unsigned long)__pa((void *)ulVirAddr);
+
+ if ((ulPhyAddr & 0x000000000000003f) == 0)
+ return ulVirAddr;
+ diff = ((long)ulPhyAddr & (~(0x000000000000003f))) + 64 - ulPhyAddr;
+ ulVirAddr += diff;
+
+ return ulVirAddr;
+}
+
+static unsigned long descri_bytes_align(unsigned long ulVirAddr)
+{
+ unsigned char diff;
+ unsigned long ulPhyAddr = ulVirAddr;
+
+ if ((ulPhyAddr & (~0x00000000ffffffe0)) == 0)
+ return ulVirAddr;
+ diff = ((long)ulPhyAddr & 0x00000000ffffffe0) + 32 - ulPhyAddr;
+ ulVirAddr += diff;
+ return ulVirAddr;
+}
+
+int se_printk_hex(unsigned char *buff, int length)
+{
+ unsigned char *string_tmp = buff;
+ int i;
+ int count = 0;
+
+ for (i = 0; i < length; i++, count++) {
+ if (count < 16)
+ pr_info("%02x ", string_tmp[i]);
+ else {
+ count = 0;
+ pr_info("\n%02x ", string_tmp[i]);
+ continue;
+ }
+ }
+ pr_info("\n");
+ return 0;
+}
+
+static int se_ChipInit(SECHIPDRV_CTRL *pDrvCtrl)
+{
+ dma_addr_t ulBusAddr;
+ unsigned long ulVirAddr;
+ int i = 0, j = 0;
+ unsigned int dmaoldmask;
+
+ for (i = 0; i < SWCHANNELNUM; i++) {
+ ulVirAddr = (unsigned long)dma_alloc_coherent(
+ pDrvCtrl->pdev,
+ (SE_BDQUEUE_LEN * SE_BD_LENGTH+32),
+ &ulBusAddr, GFP_KERNEL
+ );
+ if (ulVirAddr == 0 || ulBusAddr == 0)
+ return -EFAULT;
+ memset((void *)ulVirAddr, 0, (SE_BDQUEUE_LEN*SE_BD_LENGTH));
+
+ pDrvCtrl->ulBDMemBasePhy[i] = ulBusAddr;
+ pDrvCtrl->ulBDMemBase[i] = ulVirAddr;
+ pDrvCtrl->ulCurrBdReadPtr[i] = 0;
+ pDrvCtrl->ulCurrBdWritePtr[i] = 0;
+ pDrvCtrl->ulCurrReadPtr[i] = 0;
+ pDrvCtrl->ulCurrWritePtr[i] = 0;
+ }
+ for (i = 0; i < SE_BDQUEUE_LEN; i++) {
+ for (j = 0; j < SWCHANNELNUM; j++)
+ (&((SE_BASIC_BD *)(pDrvCtrl->ulBDMemBase[j]))[i])->ucRetCode = 0x0f;
+ }
+ ulBusAddr = descri_bytes_align(pDrvCtrl->ulBDMemBasePhy[0]);
+ HandleWrite32(pDrvCtrl, SE_HREG_BQBA0, HIULONG(ulBusAddr));
+ HandleWrite32(pDrvCtrl, SE_LREG_BQBA0, LOULONG(ulBusAddr));
+ HandleWrite32(pDrvCtrl, SE_REG_BQS0, SE_BDQUEUE_LEN - 1);
+ HandleWrite32(pDrvCtrl, SE_REG_RQRP0, pDrvCtrl->ulCurrBdReadPtr[0]);
+ HandleWrite32(pDrvCtrl, SE_REG_BQWP0, pDrvCtrl->ulCurrBdWritePtr[0]);
+
+ ulBusAddr = descri_bytes_align(pDrvCtrl->ulBDMemBasePhy[1]);
+ HandleWrite32(pDrvCtrl, SE_HREG_BQBA1, HIULONG(ulBusAddr));
+ HandleWrite32(pDrvCtrl, SE_LREG_BQBA1, LOULONG(ulBusAddr));
+ HandleWrite32(pDrvCtrl, SE_REG_BQS1, SE_BDQUEUE_LEN - 1);
+ HandleWrite32(pDrvCtrl, SE_REG_RQRP1, pDrvCtrl->ulCurrBdReadPtr[1]);
+ HandleWrite32(pDrvCtrl, SE_REG_BQWP1, pDrvCtrl->ulCurrBdWritePtr[1]);
+ HandleRead32(pDrvCtrl, SE_REG_MSK, &dmaoldmask);
+ HandleWrite32(pDrvCtrl, SE_REG_MSK, (dmaoldmask | DMA0_CTRL_CHANNEL_ENABLE | DMA1_CTRL_CHANNEL_ENABLE));
+ if (g_iUseIntr != 0)
+ HandleWrite32(pDrvCtrl, SE_LOWREG_INQ, 1);
+ else
+ HandleWrite32(pDrvCtrl, SE_LOWREG_INQ, 0);
+ mdelay(1000);
+
+ return SE_OK;
+}
+
+static void se_ChipRelease(SECHIPDRV_CTRL *pDrvCtrl)
+{
+ int i;
+
+ for (i = 0; i < SWCHANNELNUM; i++) {
+ if (pDrvCtrl->ulBDMemBase[i]) {
+ dma_free_coherent(
+ pDrvCtrl->pdev,
+ (SE_BDQUEUE_LEN * SE_BD_LENGTH),
+ (void *)pDrvCtrl->ulBDMemBase[i],
+ pDrvCtrl->ulBDMemBasePhy[i]
+ );
+ pDrvCtrl->ulBDMemBase[i] = 0;
+ pDrvCtrl->ulBDMemBasePhy[i] = 0;
+ }
+ }
+}
+
+static void SE_RESET(SECHIPDRV_CTRL *pdrvctl)
+{
+
+ unsigned int reg;
+ unsigned long ulreg64, uladdr = LS_CRYPTO_SE_ADDR1;
+
+ HandleRead32(pdrvctl, SE_REG_RESET, ®);
+ HandleWrite32(pdrvctl, SE_REG_RESET, reg|SE_DMA_CONTROL_RESET);
+ mdelay(300);
+ HandleWrite32(pdrvctl, SE_REG_RESET, (reg&(~SE_DMA_CONTROL_RESET))|SE_DMA_CONTROL_SET);
+ mdelay(300);
+ ulreg64 = readq((volatile void __iomem *)uladdr);
+ if ((ulreg64 & 0xf0000000000000) != 0xf0000000000000)
+ writeq(ulreg64|0xf0000000000000, (volatile void __iomem *)uladdr);
+ HandleWrite32(pdrvctl, SE_INT_CLR, 0xf);
+}
+
+static int wst_init(void)
+{
+ int iRes = SE_OK;
+ static u64 wst_dma_mask = DMA_BIT_MASK(64);
+ char cName[256];
+ SECHIPDRV_CTRL *pdrvctl = NULL;
+
+ pdrvctl = kmalloc(sizeof(SECHIPDRV_CTRL), GFP_KERNEL);
+ if (pdrvctl == NULL)
+ return -ENOMEM;
+ memset(pdrvctl, 0, sizeof(SECHIPDRV_CTRL));
+ pdrvctl->ulMemBase = LS_CRYPTO_SE_ADDR2;
+ memset(cName, 0, 256);
+ sema_init(&(pdrvctl->sema), 0);
+ rwlock_init(&(pdrvctl->mr_lock));
+ rwlock_init(&(pdrvctl->mr_lowlock));
+ g_psechipDrvCtrl = pdrvctl;
+ g_psechipDrvCtrl->pdev = g_psecdev;
+ g_psechipDrvCtrl->pdev->dma_mask = &wst_dma_mask;
+ g_psechipDrvCtrl->pdev->coherent_dma_mask = (unsigned long long)&wst_dma_mask;
+ wst_InitQueue(&g_RecQueueContainer, 2000);
+ wst_InitQueue(&g_SendQueueContainer, 2000);
+ SE_RESET(pdrvctl);
+ pdrvctl->ilowIrq = 0;
+ pdrvctl->iIrq = se_irq[0].irq;
+ iRes = request_irq(pdrvctl->iIrq, &se_interrupt, IRQF_SHARED, "wst-se-hirq", pdrvctl);
+ if (iRes) {
+ pr_err("request_irq err\n");
+ pdrvctl->iIrq = 0;
+ goto err;
+ }
+ if (g_iUseIntr == 1) {
+ pdrvctl->ilowIrq = se_irq[1].irq;
+ iRes = request_irq(pdrvctl->ilowIrq, &wst_low_channel_status, IRQF_SHARED, "wst-se-lirq", pdrvctl);
+ if (iRes) {
+ pr_err("\nrequest_lowirq err, iRes=0x%x\n", iRes);
+ pdrvctl->ilowIrq = 0;
+ goto err;
+ }
+ }
+ if (se_ChipInit(pdrvctl) != SE_OK) {
+ iRes = -ENODEV;
+ goto err;
+ }
+ return SE_OK;
+err:
+ if (pdrvctl != NULL) {
+ if (pdrvctl->iIrq) {
+ free_irq(pdrvctl->iIrq, pdrvctl);
+ pdrvctl->iIrq = 0;
+ }
+ if (pdrvctl->ilowIrq) {
+ free_irq(pdrvctl->ilowIrq, pdrvctl);
+ pdrvctl->ilowIrq = 0;
+ }
+ se_ChipRelease(pdrvctl);
+ kfree(pdrvctl);
+ g_psechipDrvCtrl = NULL;
+ }
+ return iRes;
+}
+
+static void wst_clear(void)
+{
+ SECHIPDRV_CTRL *pdrvctl = NULL;
+
+ pdrvctl = g_psechipDrvCtrl;
+ if (pdrvctl) {
+ if (pdrvctl->iIrq) {
+ free_irq(pdrvctl->iIrq, pdrvctl);
+ pdrvctl->iIrq = 0;
+ }
+ if (pdrvctl->ilowIrq) {
+ free_irq(pdrvctl->ilowIrq, pdrvctl);
+ pdrvctl->ilowIrq = 0;
+ }
+ se_ChipRelease(pdrvctl);
+ kfree(pdrvctl);
+ g_psechipDrvCtrl = NULL;
+ }
+}
+static void globalmem_do_send_op(struct work_struct *p)
+{
+ SE_BASIC_BD *pCurBD;
+ unsigned int ulCurrWritePtr, ulWritePtr;
+ unsigned short len = 0;
+ unsigned long ulCurrAddrInput = 0, ulCurrAddrOutput = 0;
+ SECHIPDRV_CTRL *pdrvctl;
+ unsigned char *pInPtr;
+ unsigned short usInlen;
+ unsigned char *pOutPtr;
+ unsigned short *pusOutlen;
+ int iChannel;
+ unsigned char ucFlag;
+ unsigned char ucOpCode;
+ unsigned char *pucRetCode;
+ PSECallBackfn pcallback;
+ void *pParma;
+ int iKernel;
+ struct completion *mycomplete;
+ SEND_PACKAGE *psendpackage;
+ unsigned long ulflag;
+ unsigned long ultimeout;
+ int rv = 0;
+
+ while (1) {
+PROG:
+ spin_lock_irq(&g_sendlistlock);
+ psendpackage = (SEND_PACKAGE *)wst_Popfront_Que(&g_SendQueueContainer);
+ if (!psendpackage) {
+ spin_unlock_irq(&g_sendlistlock);
+ return;
+ }
+ spin_unlock_irq(&g_sendlistlock);
+ pdrvctl = psendpackage->pdrvctl;
+ pInPtr = psendpackage->pInPtr;
+ usInlen = psendpackage->usInlen;
+ pOutPtr = psendpackage->pOutPtr;
+ pusOutlen = psendpackage->pusOutlen;
+ iChannel = psendpackage->iChannel;
+ ucFlag = psendpackage->ucFlag;
+ ucOpCode = psendpackage->ucOpCode;
+ pucRetCode = psendpackage->pucRetCode;
+ pcallback = psendpackage->pcallback;
+ pParma = psendpackage->pParma;
+ iKernel = psendpackage->iKernel;
+ mycomplete = psendpackage->mycomplete;
+ ultimeout = psendpackage->ulendtime;
+ kfree(psendpackage);
+
+ if (iKernel == 0) {
+ while (time_before(jiffies, ultimeout)) {
+#ifdef CONFIG_MIPS
+ if ((pdrvctl->ulCurrBdReadPtr[iChannel] == ((pdrvctl->ulCurrBdWritePtr[iChannel] + 1) & (SE_BDQUEUE_LEN-1)))
+ || ((atomic_read(&g_sendtotallen) + *pusOutlen + SE_FILL_LEN) > SE_MAX_SEND_LEN))
+#else
+ if (pdrvctl->ulCurrBdReadPtr[iChannel] == ((pdrvctl->ulCurrBdWritePtr[iChannel] + 1) & (SE_BDQUEUE_LEN-1)))
+#endif
+ {
+ down_timeout(&(pdrvctl->sema), 1*HZ);
+ rv = WST_SE_ERROR_FULL;
+ } else {
+ rv = 0;
+ break;
+ }
+ }
+ if (rv != 0x0) {
+ *pucRetCode = WST_SE_ERROR_FULL;
+ complete(mycomplete);
+ goto PROG;
+ }
+ } else {
+ ultimeout = jiffies+1*HZ;
+ while (time_before(jiffies, ultimeout)) {
+#ifdef CONFIG_MIPS
+ if ((pdrvctl->ulCurrBdReadPtr[iChannel] == ((pdrvctl->ulCurrBdWritePtr[iChannel] + 1) & (SE_BDQUEUE_LEN-1)))
+ || ((atomic_read(&g_sendtotallen) + *pusOutlen + SE_FILL_LEN) > SE_MAX_SEND_LEN))
+#else
+ if (pdrvctl->ulCurrBdReadPtr[iChannel] == ((pdrvctl->ulCurrBdWritePtr[iChannel] + 1) & (SE_BDQUEUE_LEN-1)))
+#endif
+ {
+ rv = WST_SE_ERROR_FULL;
+ } else {
+ rv = 0;
+ break;
+ }
+ }
+ if (rv != 0x0) {
+ *pucRetCode = WST_SE_ERROR_FULL;
+ if (pcallback)
+ pcallback(pParma);
+ goto PROG;
+ }
+ }
+ ulCurrWritePtr = pdrvctl->ulCurrBdWritePtr[iChannel];
+ ulWritePtr = (ulCurrWritePtr + 1) & (SE_BDQUEUE_LEN-1);
+
+ pCurBD = &((SE_BASIC_BD *)(pdrvctl->ulBDMemBase[iChannel]))[ulCurrWritePtr];
+ memset(pCurBD, 0x0, sizeof(SE_BASIC_BD));
+ if (pcallback != NULL) {
+ (pdrvctl->pcallback)[iChannel][ulCurrWritePtr] = pcallback;
+ pdrvctl->pParma[iChannel][ulCurrWritePtr] = pParma;
+ } else {
+ (pdrvctl->pcallback)[iChannel][ulCurrWritePtr] = NULL;
+ pdrvctl->pParma[iChannel][ulCurrWritePtr] = NULL;
+ }
+
+ pdrvctl->ikernel[iChannel][ulCurrWritePtr] = iKernel;
+ pdrvctl->stsemphore[iChannel][ulCurrWritePtr] = mycomplete;
+
+ if (pInPtr == pOutPtr) {
+ if (pOutPtr) {
+ len = usInlen >= *pusOutlen ? usInlen : *pusOutlen;
+ if (len) {
+ ulCurrAddrOutput = dma_map_single(pdrvctl->pdev, pOutPtr, len, DMA_BIDIRECTIONAL);
+ if (ulCurrAddrOutput == 0) {
+ TRACEERR("map ulCurrAddrOutput error\n");
+ *pucRetCode = WST_SE_FAILURE;
+ if (iKernel == 0) {
+ complete(mycomplete);
+ } else {
+ *pucRetCode = WST_SE_FAILURE;
+ if (pcallback)
+ pcallback(pParma);
+ }
+ goto PROG;
+ }
+ pCurBD->ulOutputLPtr = LOULONG(ulCurrAddrOutput);
+ pCurBD->ulOutputHPtr = HIULONG(ulCurrAddrOutput);
+ pCurBD->ulInputLPtr = pCurBD->ulOutputLPtr;
+ pCurBD->ulInputHPtr = pCurBD->ulOutputHPtr;
+ }
+ }
+ } else {
+ if (pOutPtr && (*pusOutlen)) {
+ ulCurrAddrOutput = dma_map_single(pdrvctl->pdev, pOutPtr, *pusOutlen, DMA_FROM_DEVICE);
+ if (ulCurrAddrOutput == 0) {
+ TRACEERR("map ulCurrAddrOutput error\n");
+ *pucRetCode = WST_SE_FAILURE;
+ if (iKernel == 0) {
+ complete(mycomplete);
+ } else {
+ *pucRetCode = WST_SE_FAILURE;
+ if (pcallback)
+ pcallback(pParma);
+ }
+ goto PROG;
+ }
+ pCurBD->ulOutputLPtr = LOULONG(ulCurrAddrOutput);
+ pCurBD->ulOutputHPtr = HIULONG(ulCurrAddrOutput);
+ }
+ if (usInlen && pInPtr) {
+ ulCurrAddrInput = dma_map_single(pdrvctl->pdev, pInPtr, usInlen, DMA_TO_DEVICE);
+ if (ulCurrAddrInput == 0) {
+ if (ulCurrAddrOutput) {
+ dma_unmap_single(pdrvctl->pdev, ulCurrAddrOutput, *pusOutlen, DMA_FROM_DEVICE);
+ pCurBD->ulOutputLPtr = 0;
+ pCurBD->ulOutputHPtr = 0;
+ }
+ *pucRetCode = WST_SE_FAILURE;
+ if (iKernel == 0) {
+ complete(mycomplete);
+ } else {
+ *pucRetCode = WST_SE_FAILURE;
+ if (pcallback)
+ pcallback(pParma);
+ }
+ goto PROG;
+ }
+ pCurBD->ulInputLPtr = LOULONG(ulCurrAddrInput);
+ pCurBD->ulInputHPtr = HIULONG(ulCurrAddrInput);
+ }
+ }
+ pCurBD->ucOpCode = ucOpCode & 0x0f;
+ pCurBD->ucFlag = ucFlag & 0x7;
+ pCurBD->usInputLength = usInlen;
+ if (pusOutlen)
+ pCurBD->usOutputLength = *pusOutlen;
+
+ pCurBD->ucRetCode = 0x0f;
+
+ pdrvctl->pusOutlen[iChannel][ulCurrWritePtr] = pusOutlen;
+ pdrvctl->usInlen[iChannel][ulCurrWritePtr] = usInlen&0xffff;
+ if (ulCurrAddrOutput)
+ pdrvctl->ulOutputPtr[iChannel][ulCurrWritePtr] = (unsigned long *)ulCurrAddrOutput;
+ else
+ pdrvctl->ulOutputPtr[iChannel][ulCurrWritePtr] = 0;
+ if (ulCurrAddrInput)
+ pdrvctl->ulInputPtr[iChannel][ulCurrWritePtr] = (unsigned long *)ulCurrAddrInput;
+ else
+ pdrvctl->ulInputPtr[iChannel][ulCurrWritePtr] = 0;
+ pdrvctl->pucRetCode[iChannel][ulCurrWritePtr] = pucRetCode;
+
+#ifdef CONFIG_MIPS
+ atomic_add((*(pdrvctl->pusOutlen[iChannel][ulCurrWritePtr]) + SE_FILL_LEN), &g_sendtotallen);
+#endif
+ write_lock_irqsave(&(pdrvctl->mr_lock), ulflag);
+ if (iChannel == 0)
+ HandleWrite32(pdrvctl, SE_REG_BQWP0, ulWritePtr);
+ else
+ HandleWrite32(pdrvctl, SE_REG_BQWP1, ulWritePtr);
+ write_unlock_irqrestore(&(pdrvctl->mr_lock), ulflag);
+ pdrvctl->ulCurrBdWritePtr[iChannel] = ulWritePtr;
+ }
+}
+
+static int se_hardtrans(
+ SECHIPDRV_CTRL *pdrvctl,
+ unsigned char *pInPtr,
+ unsigned short usInlen,
+ unsigned char *pOutPtr,
+ unsigned short *pusOutlen,
+ int iChannel,
+ unsigned char ucFlag,
+ unsigned char ucOpCode,
+ unsigned char *pucRetCode,
+ PSECallBackfn pcallback,
+ void *pParma,
+ int iKernel,
+ struct completion *mycomplete
+ )
+{
+ SEND_PACKAGE *psendpackage;
+ gfp_t gfp_flag;
+
+ if (in_interrupt())
+ gfp_flag = GFP_ATOMIC;
+ else
+ gfp_flag = GFP_KERNEL;
+ if (g_suspend == 1)
+ return WST_SE_FAILURE;
+ psendpackage = kmalloc(sizeof(SEND_PACKAGE), gfp_flag);
+ if (psendpackage == NULL)
+ return -1;
+
+ psendpackage->pdrvctl = pdrvctl;
+ psendpackage->pInPtr = pInPtr;
+ psendpackage->usInlen = usInlen;
+ psendpackage->pOutPtr = pOutPtr;
+ psendpackage->pusOutlen = pusOutlen;
+ psendpackage->iChannel = iChannel;
+ psendpackage->ucFlag = ucFlag;
+ psendpackage->ucOpCode = ucOpCode;
+ psendpackage->pucRetCode = pucRetCode;
+ psendpackage->pcallback = pcallback;
+ psendpackage->pParma = pParma;
+ psendpackage->iKernel = iKernel;
+ psendpackage->mycomplete = mycomplete;
+ psendpackage->ulendtime = jiffies+30*HZ;
+ spin_lock_irq(&g_sendlistlock);
+ if (wst_Pushback_Que(&g_SendQueueContainer, psendpackage) == -1) {
+ spin_unlock_irq(&g_sendlistlock);
+ kfree(psendpackage);
+ return WST_SE_ERROR_FULL;
+ }
+ spin_unlock_irq(&g_sendlistlock);
+ queue_work(g_worksendqueue, &g_sendwork);
+ return 0;
+}
+
+static irqreturn_t wst_low_channel_status(int irq, void *p)
+{
+ SECHIPDRV_CTRL *pdrvctl = (SECHIPDRV_CTRL *)p;
+ int64_t ulIntStat = 0;
+ unsigned long ulflag;
+
+ read_lock_irqsave(&(pdrvctl->mr_lock), ulflag);
+ HandleRead64(pdrvctl, SE_LOWREG_STS, &ulIntStat);
+ if (ulIntStat == 2) {
+ HandleWrite64(pdrvctl, SE_LOWINT_CLEAR, 2);
+ up(&g_lowirqsema);
+ }
+ read_unlock_irqrestore(&(pdrvctl->mr_lock), ulflag);
+
+ return IRQ_HANDLED;
+}
+
+static int se_useropen(struct inode *inode, struct file *file)
+{
+ if (MINOR(inode->i_rdev) != 0)
+ return -ENODEV;
+
+ return SE_OK;
+}
+
+static ssize_t wst_low_channel_userwrite_op(
+ SECHIPDRV_CTRL *pdrvctl,
+ SWCommuData *UserCommuData,
+ int iskernel
+ )
+{
+ unsigned long long addr = 0, outaddr = 0;
+ int ilen;
+ int count = SE_OK;
+ unsigned long long ulsendlen;
+ unsigned char *m_pCacheInBuf;
+ unsigned char *m_pCacheOutBuf;
+ unsigned long ulflag;
+
+ if ((g_pCacheInBuf == NULL) || (g_pCacheOutBuf == NULL))
+ return -EFAULT;
+
+ m_pCacheInBuf = (unsigned char *)bytes_align(0, (unsigned long)g_pCacheInBuf);
+ m_pCacheOutBuf = (unsigned char *)bytes_align(0, (unsigned long)g_pCacheOutBuf);
+ if (iskernel == 0) {
+ if (wst_cpyusrbuf((void *)(UserCommuData->pucInbuf), (void *)m_pCacheInBuf, UserCommuData->usInputLen, READUBUF)) {
+ TRACEERR("copy user data error\n");
+ return -EFAULT;
+ }
+ } else
+
+ memcpy((void *)m_pCacheInBuf, (void *)(UserCommuData->pucInbuf), UserCommuData->usInputLen);
+ ilen = UserCommuData->usInputLen >= UserCommuData->usOutputLen ? UserCommuData->usInputLen:UserCommuData->usOutputLen;
+ addr = dma_map_single(pdrvctl->pdev, m_pCacheInBuf, ilen, DMA_TO_DEVICE);
+ if (addr == 0) {
+ TRACEERR("transfer buffer is err\n");
+ return -EFAULT;
+ }
+ outaddr = dma_map_single(pdrvctl->pdev, m_pCacheOutBuf, ilen, DMA_FROM_DEVICE);
+ if (outaddr == 0) {
+ TRACEERR("transfer buffer is err\n");
+ dma_unmap_single(pdrvctl->pdev, addr, ilen, DMA_TO_DEVICE);
+ return -EFAULT;
+ }
+ ulsendlen = (UserCommuData->usInputLen/8);
+ ulsendlen = (ulsendlen & 0x00000000ffffffff) << 32;
+ write_lock_irqsave(&(pdrvctl->mr_lock), ulflag);
+ HandleWrite64(pdrvctl, SE_WRITE_REG1, ulsendlen);
+ HandleWrite64(pdrvctl, SE_WRITE_REG2, addr);
+ HandleWrite64(pdrvctl, SE_WRITE_REG3, outaddr);
+ write_unlock_irqrestore(&(pdrvctl->mr_lock), ulflag);
+ if (g_iUseIntr != 0) {
+ if (down_interruptible(&g_lowirqsema) == -EINTR) {
+ count = -EINTR;
+ goto EXIT;
+ }
+ } else {
+ unsigned long start_jiffies = 0, end_jiffies = 0;
+ int64_t ulIntStat = 0;
+
+ start_jiffies = jiffies;
+ end_jiffies = jiffies;
+ while (1) {
+ write_lock_irqsave(&(pdrvctl->mr_lock), ulflag);
+ HandleRead64(pdrvctl, SE_LOWREG_SR, &ulIntStat);
+ end_jiffies = jiffies;
+ if (ulIntStat == 1) {
+ HandleWrite64(pdrvctl, SE_LOWREG_SR, 0);
+ write_unlock_irqrestore(&(pdrvctl->mr_lock), ulflag);
+ break;
+ }
+ write_unlock_irqrestore(&(pdrvctl->mr_lock), ulflag);
+ if (jiffies_to_msecs(end_jiffies-start_jiffies)/1000 >= 90) {
+ count = -EFAULT;
+ goto EXIT;
+ }
+ }
+ }
+ dma_unmap_single(pdrvctl->pdev, addr, ilen, DMA_TO_DEVICE);
+ dma_unmap_single(pdrvctl->pdev, outaddr, ilen, DMA_FROM_DEVICE);
+ if (UserCommuData->usOutputLen) {
+ if (iskernel == 0) {
+ if (wst_cpyusrbuf(UserCommuData->pucOutbuf, m_pCacheOutBuf, UserCommuData->usOutputLen, WRITEUBUF))
+ return -EFAULT;
+ } else
+ memcpy(UserCommuData->pucOutbuf, m_pCacheOutBuf, UserCommuData->usOutputLen);
+ }
+ return count;
+EXIT:
+ dma_unmap_single(pdrvctl->pdev, addr, ilen, DMA_TO_DEVICE);
+ dma_unmap_single(pdrvctl->pdev, outaddr, ilen, DMA_FROM_DEVICE);
+ return count;
+}
+
+static ssize_t se_userwrite(struct file *file, const char *buf, size_t count, loff_t *ppos)
+{
+ unsigned char *pCacheBuf = NULL, *pCacheOutBuf = NULL, *pCacheBufalign = NULL, *pCacheOutBufalign = NULL;
+ SECHIPDRV_CTRL *pdrvctl = NULL;
+ SWCommuData *pCommuData = NULL;
+ int iCommuDatalen = 0;
+ int pucRetCode = 0;
+ unsigned short iChannel = 0;
+ unsigned char ucFlag = 0, ucOpCode = 0;
+ int *ppucRetCode;
+ struct completion mycomplete;
+ struct tag_dma_buf_ctl *pbufinctl = NULL;
+ int iret = 0;
+
+ if (count == 0) {
+ TRACEERR("count=0\n");
+ return SE_OK;
+ }
+
+ if (MINOR(file->f_path.dentry->d_inode->i_rdev) != 0)
+ return -ENODEV;
+
+ iCommuDatalen = sizeof(SWCommuData);
+ if (count != iCommuDatalen)
+ return -EINVAL;
+
+ pdrvctl = g_psechipDrvCtrl;
+ pCommuData = kmalloc(iCommuDatalen, GFP_KERNEL);
+ if (!pCommuData) {
+ TRACEERR("pCommuData NULL\n");
+ return -ENOMEM;
+ }
+ if (wst_cpyusrbuf((void *)buf, (void *)pCommuData, iCommuDatalen, READUBUF)) {
+ TRACEERR("copy user data error\n");
+ count = -EFAULT;
+ goto EXIT;
+ }
+ switch ((pCommuData->usFlags)&0x000f) {
+ case WST_GO_CHANNEL2:
+ if ((pCommuData->usInputLen > DMA_BUFSIZE) || (pCommuData->usOutputLen > DMA_BUFSIZE)) {
+ TRACEERR("len is error\n");
+ count = -EINVAL;
+ goto EXIT;
+ }
+ if (down_interruptible(&g_lowsema) == -EINTR) {
+ count = -EINTR;
+ goto EXIT;
+ }
+ count = wst_low_channel_userwrite_op(pdrvctl, pCommuData, 0);
+ up(&g_lowsema);
+ goto EXIT;
+ case WST_GO_CHANNEL0:
+ if (pCommuData->usInputLen == 0) {
+ count = -EINVAL;
+ goto EXIT;
+ }
+ if (pCommuData->usInputLen != 0) {
+ if (pCommuData->usInputLen > DMA_BUFSIZE) {
+ count = -EINVAL;
+ goto EXIT;
+ }
+ ucFlag = INPUT_VALID;
+ if (pCommuData->usOutputLen)
+ ucFlag |= OUTPUT_VALID;
+ }
+
+ iChannel = 0;
+ ucOpCode = 0x0;
+ break;
+ case WST_GO_CHANNEL1:
+ if (pCommuData->usInputLen == 0) {
+ count = -EINVAL;
+ goto EXIT;
+ }
+ if (pCommuData->usInputLen != 0) {
+ if (pCommuData->usInputLen > DMA_BUFSIZE) {
+ count = -EINVAL;
+ goto EXIT;
+ }
+ ucFlag = INPUT_VALID;
+ if (pCommuData->usOutputLen)
+ ucFlag |= OUTPUT_VALID;
+ }
+ iChannel = 1;
+ ucOpCode = 0x0;
+ break;
+ default:
+ {
+ count = -EINVAL;
+ goto EXIT;
+ }
+ }
+ pbufinctl = se_get_dma_buf(0);
+ if (pbufinctl == NULL) {
+ TRACEERR("kmalloc pCacheBuf error\n");
+ count = -ENOMEM;
+ goto EXIT;
+ }
+ pCacheBuf = pbufinctl->pDmaBuf;
+ pCacheBufalign = pCacheBuf;
+
+ if (wst_cpyusrbuf((void *)(pCommuData->pucInbuf), (void *)pCacheBufalign,
+ pCommuData->usInputLen, READUBUF)) {
+ TRACEERR("cpyuserbuf pCacheBufalign error\n");
+ count = -ENOMEM;
+ goto EXIT;
+ }
+
+ pCacheOutBuf = pbufinctl->pDmaBuf;
+ pCacheOutBufalign = pCacheOutBuf;
+
+ ppucRetCode = &pucRetCode;
+
+ count = SE_OK;
+ init_completion(&mycomplete);
+ iret = se_hardtrans(
+ pdrvctl,
+ pCacheBufalign,
+ pCommuData->usInputLen,
+ pCacheOutBufalign,
+ &(pCommuData->usOutputLen),
+ iChannel,
+ ucFlag,
+ ucOpCode,
+ (unsigned char *)ppucRetCode,
+ 0,
+ 0,
+ 0,
+ &mycomplete
+ );
+ if (iret == -1) {
+ count = -EIO;
+ goto EXIT;
+ }
+ if (!wait_for_completion_timeout(&mycomplete, msecs_to_jiffies(60*1000))) {
+ count = -EFAULT;
+ goto EXIT;
+ }
+ if (pucRetCode != SE_OK) {
+ count = -(SE_BASEERR+pucRetCode);
+ goto EXIT;
+ }
+
+ if (pCommuData->pucOutbuf) {
+ if (wst_cpyusrbuf(pCommuData->pucOutbuf, pCacheOutBufalign,
+ pCommuData->usOutputLen, WRITEUBUF)) {
+ count = -EFAULT;
+ goto EXIT;
+ }
+ }
+EXIT:
+ if (pbufinctl)
+ se_free_dma_buf(pbufinctl);
+ kfree(pCommuData);
+ return count;
+}
+static void globalmem_do_rec_op(struct work_struct *p)
+{
+ INT_MESSAGE *intmessage;
+ unsigned long ulflags1;
+
+ while (1) {
+ spin_lock_irqsave(&g_reclistlock, ulflags1);
+ intmessage = (INT_MESSAGE *)wst_Popfront_Que(&g_RecQueueContainer);
+ spin_unlock_irqrestore(&g_reclistlock, ulflags1);
+ if (!intmessage)
+ return;
+ intmessage->pcallback(intmessage->pParma);
+ kfree(intmessage);
+ }
+}
+static irqreturn_t se_interrupt(int irq, void *p)
+{
+ SECHIPDRV_CTRL *pdrvctl;
+ SE_BASIC_BD *pCurBD;
+ unsigned int ulCurrReadPtr, ulReadPtr;
+ int iChannel;
+ int len = 0;
+ int i;
+ unsigned char ucMyRetCode = 0;
+ unsigned long ulIntStat;
+ int istatus[2] = {1, 2};
+ unsigned long ulflags;
+
+ pdrvctl = (SECHIPDRV_CTRL *)p;
+ if (!pdrvctl)
+ return IRQ_HANDLED;
+
+ read_lock_irqsave(&(pdrvctl->mr_lock), ulflags);
+ HandleRead32(pdrvctl, SE_REG_STS, &ulIntStat);
+ read_unlock_irqrestore(&(pdrvctl->mr_lock), ulflags);
+ if ((!(ulIntStat & INT_STAT_DMA_MASK)) || (ulIntStat == 0xffffffff))
+ return IRQ_HANDLED;
+
+ for (i = 0; i <= 1; i++) {
+ if (ulIntStat & istatus[i]) {
+ if (i == 0) {
+ read_lock_irqsave(&(pdrvctl->mr_lock), ulflags);
+ HandleWrite32(pdrvctl, SE_INT_CLR, 1);
+ HandleRead32(pdrvctl, SE_REG_RQRP0, &ulReadPtr);
+ read_unlock_irqrestore(&(pdrvctl->mr_lock), ulflags);
+ iChannel = 0;
+ } else {
+ read_lock_irqsave(&(pdrvctl->mr_lock), ulflags);
+ HandleWrite32(pdrvctl, SE_INT_CLR, 2);
+ HandleRead32(pdrvctl, SE_REG_RQRP1, &ulReadPtr);
+ read_unlock_irqrestore(&(pdrvctl->mr_lock), ulflags);
+ iChannel = 1;
+ }
+ } else
+ continue;
+ ulCurrReadPtr = pdrvctl->ulCurrReadPtr[iChannel];
+ while (1) {
+ if (ulCurrReadPtr != ulReadPtr) {
+ pCurBD = &((SE_BASIC_BD *)(pdrvctl->ulBDMemBase[iChannel]))[ulCurrReadPtr];
+ if ((pCurBD->ucRetCode == 0x0f) || ((pCurBD->ucFlag & 0x8) != 0x8)) {
+ continue;
+ } else {
+ if (pdrvctl->ulInputPtr[iChannel][ulCurrReadPtr] == pdrvctl->ulOutputPtr[iChannel][ulCurrReadPtr]) {
+ if (pdrvctl->ulOutputPtr[iChannel][ulCurrReadPtr]) {
+ len = (*(pdrvctl->pusOutlen[iChannel][ulCurrReadPtr])) >= pdrvctl->usInlen[iChannel][ulCurrReadPtr] ?
+ (*(pdrvctl->pusOutlen[iChannel][ulCurrReadPtr])):pdrvctl->usInlen[iChannel][ulCurrReadPtr];
+ dma_unmap_single(
+ pdrvctl->pdev,
+ (unsigned long)(pdrvctl->ulOutputPtr[iChannel][ulCurrReadPtr]),
+ len,
+ DMA_BIDIRECTIONAL
+ );
+ pCurBD->ulOutputLPtr = 0;
+ pCurBD->ulOutputHPtr = 0;
+ pCurBD->ulInputHPtr = 0;
+ pCurBD->ulInputLPtr = 0;
+ pdrvctl->ulOutputPtr[iChannel][ulCurrReadPtr] = 0;
+ }
+ } else {
+ if (pdrvctl->ulOutputPtr[iChannel][ulCurrReadPtr]) {
+ dma_unmap_single(
+ pdrvctl->pdev,
+ (unsigned long)(pdrvctl->ulOutputPtr[iChannel][ulCurrReadPtr]),
+ *(pdrvctl->pusOutlen[iChannel][ulCurrReadPtr]), DMA_FROM_DEVICE
+ );
+ smp_wmb();
+ pdrvctl->ulOutputPtr[iChannel][ulCurrReadPtr] = 0;
+ }
+ if (pdrvctl->ulInputPtr[iChannel][ulCurrReadPtr]) {
+ dma_unmap_single(
+ pdrvctl->pdev,
+ (unsigned long)(pdrvctl->ulInputPtr[iChannel][ulCurrReadPtr]),
+ pdrvctl->usInlen[iChannel][ulCurrReadPtr],
+ DMA_TO_DEVICE
+ );
+ pdrvctl->ulInputPtr[iChannel][ulCurrReadPtr] = 0;
+ }
+ }
+ ucMyRetCode = pCurBD->ucRetCode;
+ memcpy(pdrvctl->pucRetCode[iChannel][ulCurrReadPtr], &ucMyRetCode, 1);
+ if (pCurBD->ucRetCode != SE_OK)
+ pr_info("\nstatus %x\n", pCurBD->ucRetCode);
+#ifdef CONFIG_MIPS
+ atomic_sub(((*(pdrvctl->pusOutlen[iChannel][ulCurrReadPtr])) + SE_FILL_LEN), &g_sendtotallen);
+#endif
+ if ((pdrvctl->ikernel)[iChannel][ulCurrReadPtr] != 0) {
+ if (pdrvctl->pcallback[iChannel][ulCurrReadPtr]) {
+ INT_MESSAGE *intmessage = NULL;
+ unsigned long ulflags1;
+
+ intmessage = (INT_MESSAGE *)kmalloc(sizeof(INT_MESSAGE), GFP_ATOMIC);
+ if (!intmessage)
+ return IRQ_HANDLED;
+ intmessage->pcallback = pdrvctl->pcallback[iChannel][ulCurrReadPtr];
+ intmessage->pParma = pdrvctl->pParma[iChannel][ulCurrReadPtr];
+ spin_lock_irqsave(&g_reclistlock, ulflags1);
+ wst_Pushback_Que(&g_RecQueueContainer, intmessage);
+ spin_unlock_irqrestore(&g_reclistlock, ulflags1);
+ queue_work(g_workrecqueue, &g_recwork);
+ }
+ } else {
+ complete(pdrvctl->stsemphore[iChannel][ulCurrReadPtr]);
+ }
+ ulCurrReadPtr = ((ulCurrReadPtr + 1)&(SE_BDQUEUE_LEN - 1));
+ pdrvctl->ulCurrReadPtr[iChannel] = ulCurrReadPtr;
+ pdrvctl->ulCurrBdReadPtr[iChannel] = ulCurrReadPtr;
+ if (pdrvctl->sema.count <= 0)
+ up(&(pdrvctl->sema));
+ }
+ } else
+
+ break;
+ }
+ }
+ return IRQ_HANDLED;
+}
+
+static int se_userrelease(struct inode *inode, struct file *file)
+{
+ return SE_OK;
+}
+
+ssize_t se_kernelwrite(
+ unsigned char *pInPtr,
+ unsigned short usInlen,
+ unsigned char *pOutPtr,
+ unsigned short *pusOutlen,
+ unsigned char ucFlag,
+ unsigned char *pucRetCode,
+ PSECallBackfn pcallback,
+ void *pParma
+ )
+{
+ int iret;
+ SECHIPDRV_CTRL *pdrvctl;
+ int iChannel;
+ unsigned char ucOpCode;
+ SWCommuData CommuData;
+
+ pdrvctl = g_psechipDrvCtrl;
+
+ switch (ucFlag) {
+ case WST_GO_CHANNEL2:
+ {
+ CommuData.pucInbuf = pInPtr;
+ CommuData.pucOutbuf = pOutPtr;
+ CommuData.usFlags = 0;
+ CommuData.usInputLen = usInlen;
+ CommuData.usOutputLen = *pusOutlen;
+ CommuData.usReserve = 0;
+ if (down_interruptible(&g_lowsema) == -EINTR)
+ return -EINTR;
+ iret = wst_low_channel_userwrite_op(pdrvctl, &CommuData, 1);
+ up(&g_lowsema);
+ return iret;
+ }
+ case WST_GO_CHANNEL0:
+ if (pcallback == NULL)
+ return WST_SE_PARAM_ERROR;
+ if (usInlen == 0)
+ return -EINVAL;
+ ucFlag = 0;
+ if (usInlen != 0) {
+ if (usInlen > DMA_BUFSIZE)
+ return -EINVAL;
+ ucFlag = INPUT_VALID;
+ if (*pusOutlen)
+ ucFlag |= OUTPUT_VALID;
+ }
+ iChannel = 0;
+ ucOpCode = 0x0;
+ break;
+ case WST_GO_CHANNEL1:
+ if (pcallback == NULL)
+ return WST_SE_PARAM_ERROR;
+ if (usInlen == 0) {
+ return -EINVAL;
+ }
+ ucFlag = 0;
+ if (usInlen != 0) {
+ if (usInlen > DMA_BUFSIZE)
+ return -EINVAL;
+ ucFlag = INPUT_VALID;
+ if (*pusOutlen)
+ ucFlag |= OUTPUT_VALID;
+ }
+ iChannel = 1;
+ ucOpCode = 0x0;
+ break;
+ default:
+ return -EINVAL;
+ }
+ iret = se_hardtrans(
+ pdrvctl,
+ pInPtr,
+ usInlen,
+ pOutPtr,
+ pusOutlen,
+ iChannel,
+ ucFlag,
+ ucOpCode,
+ pucRetCode,
+ pcallback,
+ pParma,
+ 1,
+ NULL
+ );
+ if (iret == -1)
+ return -EIO;
+
+ return SE_OK;
+}
+EXPORT_SYMBOL(se_kernelwrite);
+
+static long se_userioctl(struct file *filp, u_int cmd, u_long arg)
+{
+ long iret = SE_OK;
+ SECHIPDRV_CTRL *pdrvctl = g_psechipDrvCtrl;
+ unsigned long ulvalue;
+
+ HandleRead64(pdrvctl, 0x120, &ulvalue);
+ pr_info("read reg value is 0x%lx in offset 120\n", ulvalue);
+ HandleRead64(pdrvctl, 0x118, &ulvalue);
+ pr_info("read reg value is 0x%lx in offset 118\n", ulvalue);
+
+ return iret;
+}
+
+
+static const struct file_operations SE_fops = {
+ .owner = THIS_MODULE,
+ .write = se_userwrite,
+ .open = se_useropen,
+ .release = se_userrelease,
+ .unlocked_ioctl = se_userioctl,
+ .compat_ioctl = se_userioctl
+};
+
+int se_chip_load(void)
+{
+ int iRes = SE_OK;
+
+ if (g_isechip_Major >= 0)
+ return WST_SE_HAS_OPEN;
+ g_psechipDrvCtrl = NULL;
+ iRes = se_init_dma_buf(DMA_BUFSIZE, CTL_DMABUFNUM);
+ if (iRes != SE_OK)
+ return WST_SE_ERROR_MALLOC;
+ iRes = register_chrdev(0, CRYNAME, &SE_fops);
+ if (iRes < 0)
+ goto EXIT;
+
+ g_isechip_Major = iRes;
+ iRes = 0;
+ g_psecclass = class_create(CRYNAME);
+ if (IS_ERR(g_psecclass)) {
+ iRes = PTR_ERR(g_psecclass);
+ goto EXIT;
+ }
+ g_psecdev = device_create(g_psecclass, NULL, MKDEV(g_isechip_Major, 0), NULL, CRYNAME);
+ if (IS_ERR(g_psecdev)) {
+ iRes = PTR_ERR(g_psecdev);
+ goto EXIT;
+ }
+ iRes = wst_init();
+ if (iRes != SE_OK)
+ goto EXIT;
+
+ sema_init(&g_lowsema, 1);
+ sema_init(&g_lowirqsema, 0);
+ atomic_set(&g_sendtotallen, 0);
+ g_pCacheInBuf = (unsigned char *)__get_free_page(GFP_DMA);
+ if (IS_ERR(g_pCacheInBuf)) {
+ iRes = PTR_ERR(g_pCacheInBuf);
+ goto EXIT;
+ }
+ g_pCacheOutBuf = (unsigned char *)__get_free_page(GFP_DMA);
+ if (IS_ERR(g_pCacheOutBuf)) {
+ iRes = PTR_ERR(g_pCacheOutBuf);
+ goto EXIT;
+ }
+
+ g_worksendqueue = alloc_workqueue("seworksendqueue",
+ WQ_MEM_RECLAIM|__WQ_ORDERED|WQ_UNBOUND, 1);
+ if (IS_ERR(g_worksendqueue)) {
+ iRes = PTR_ERR(g_worksendqueue);
+ goto EXIT;
+ }
+ g_workrecqueue = alloc_workqueue("seworkrecqueue", WQ_MEM_RECLAIM|__WQ_ORDERED, 0);
+ if (IS_ERR(g_workrecqueue)) {
+ iRes = PTR_ERR(g_workrecqueue);
+ goto EXIT;
+ }
+ INIT_WORK(&g_recwork, globalmem_do_rec_op);
+ INIT_WORK(&g_sendwork, globalmem_do_send_op);
+ pr_info("this driver version is %s\n", DRIVER_VERSION);
+
+ return SE_OK;
+EXIT:
+ se_del_dma_buf();
+ if (g_pCacheInBuf) {
+
+ free_page((unsigned long)g_pCacheInBuf);
+ g_pCacheInBuf = NULL;
+ }
+ if (g_pCacheOutBuf) {
+
+ free_page((unsigned long)g_pCacheOutBuf);
+ g_pCacheOutBuf = NULL;
+ }
+ if (g_worksendqueue) {
+ destroy_workqueue(g_worksendqueue);
+ g_worksendqueue = NULL;
+ }
+ if (g_workrecqueue) {
+ destroy_workqueue(g_workrecqueue);
+ g_workrecqueue = NULL;
+ }
+ wst_clear();
+ if (g_psecdev) {
+ device_unregister(g_psecdev);
+ g_psecdev = NULL;
+ }
+ if (g_psecclass) {
+ class_destroy(g_psecclass);
+ g_psecclass = NULL;
+ }
+ if (g_isechip_Major >= 0) {
+ unregister_chrdev(g_isechip_Major, CRYNAME);
+ g_isechip_Major = -1;
+ }
+ return iRes;
+}
+
+void se_chip_unload(void)
+{
+ SECHIPDRV_CTRL *pdrvctl = NULL;
+
+ pdrvctl = g_psechipDrvCtrl;
+
+ up(&pdrvctl->sema);
+ if (g_pCacheInBuf) {
+
+ free_page((unsigned long)g_pCacheInBuf);
+ g_pCacheInBuf = NULL;
+ }
+ if (g_pCacheOutBuf) {
+
+ free_page((unsigned long)g_pCacheOutBuf);
+ g_pCacheOutBuf = NULL;
+ }
+ if (g_worksendqueue) {
+ cancel_work_sync(&g_sendwork);
+ destroy_workqueue(g_worksendqueue);
+ g_worksendqueue = NULL;
+ }
+ if (g_workrecqueue) {
+ cancel_work_sync(&g_recwork);
+ destroy_workqueue(g_workrecqueue);
+ g_workrecqueue = NULL;
+ }
+ wst_clear();
+ if (g_psecdev) {
+ device_destroy(g_psecclass, MKDEV(g_isechip_Major, 0));
+ g_psecdev = NULL;
+ }
+ if (g_psecclass) {
+ class_destroy(g_psecclass);
+ g_psecclass = NULL;
+ }
+ if (g_isechip_Major >= 0) {
+ unregister_chrdev(g_isechip_Major, CRYNAME);
+ g_isechip_Major = -1;
+ }
+ se_del_dma_buf();
+}
+
+static int loongson_cryp_get_irq(struct platform_device *pdev, char *pat)
+{
+ int i;
+ struct resource *res = pdev->resource;
+
+ for (i = 0; i < pdev->num_resources; i++) {
+ if (strcmp(res[i].name, pat) == 0)
+ return res[i].start;
+ }
+ return -1;
+
+}
+static int loongson_cryp_probe(struct platform_device *pdev)
+{
+ int i;
+
+ if (ACPI_COMPANION(&pdev->dev)) {
+ se_irq[0].irq = platform_get_irq(pdev, 1);
+ se_irq[1].irq = platform_get_irq(pdev, 0);
+ } else {
+ for (i = 0; i < pdev->num_resources; i++) {
+ se_irq[i].irq = loongson_cryp_get_irq(pdev,
+ se_irq[i].pat);
+ if (se_irq[i].irq < 0) {
+ pr_warn("ERROR:sedriver get irq failed\n");
+ return -1;
+ }
+ }
+ }
+
+ return se_chip_load();
+}
+static int loongson_cryp_remove(struct platform_device *pdev)
+{
+ se_chip_unload();
+ return 0;
+}
+static int loongson_cryp_suspend(struct platform_device *pdev, pm_message_t state)
+{
+ g_suspend = 1;
+ cancel_work_sync(&g_recwork);
+ cancel_work_sync(&g_sendwork);
+ flush_work(&g_recwork);
+ flush_work(&g_sendwork);
+ se_chip_unload();
+ return 0;
+}
+
+static int loongson_cryp_resume(struct platform_device *pdev)
+{
+ int i;
+
+ g_suspend = 0;
+ g_worksendqueue = NULL;
+ g_workrecqueue = NULL;
+ g_isechip_Major = -1;
+ g_pCacheInBuf = NULL;
+ g_pCacheOutBuf = NULL;
+ g_iUseIntr = 1;
+ spin_lock_init(&g_reclistlock);
+ spin_lock_init(&g_sendlistlock);
+ spin_lock_init(&g_getdmabuflock);
+
+ for (i = 0; i < pdev->num_resources; i++) {
+ se_irq[i].irq = loongson_cryp_get_irq(pdev, se_irq[i].pat);
+
+ if (se_irq[i].irq < 0) {
+ pr_warn("ERROR:sedriver get irq failed\n");
+ return -1;
+ }
+ }
+ se_chip_load();
+ return 0;
+}
+
+static const struct acpi_device_id loongson_cryp_acpi_match[] = {
+ {"LOON0003"},
+ {}
+};
+MODULE_DEVICE_TABLE(acpi, loongson_cryp_acpi_match);
+
+static struct platform_driver loongson_cryp_driver = {
+ .probe = loongson_cryp_probe,
+ .remove = loongson_cryp_remove,
+ .suspend = loongson_cryp_suspend,
+ .resume = loongson_cryp_resume,
+ .driver = {
+ .name = "loongson3_crypto",
+ .acpi_match_table = ACPI_PTR(loongson_cryp_acpi_match),
+ },
+};
+
+static int __init initmodule(void)
+{
+ return platform_driver_register(&loongson_cryp_driver);
+}
+
+static void __exit exitmodule(void)
+{
+ platform_driver_unregister(&loongson_cryp_driver);
+}
+
+module_init(initmodule);
+module_exit(exitmodule);
+
+MODULE_ALIAS("platform:loongson3_crypto");
+MODULE_AUTHOR("dcm");
+MODULE_DESCRIPTION("se encryption chip driver Co westone");
+MODULE_VERSION(DRIVER_VERSION);
+MODULE_LICENSE("GPL");
diff --git a/drivers/crypto/sedriver/wst_se_echip_driver.h b/drivers/crypto/sedriver/wst_se_echip_driver.h
new file mode 100644
index 000000000000..3e562e55faac
--- /dev/null
+++ b/drivers/crypto/sedriver/wst_se_echip_driver.h
@@ -0,0 +1,184 @@
+#ifndef _WST_SE_ECHIP_DRIVER_H
+#define _WST_SE_ECHIP_DRIVER_H
+#include "wst_se_ktrans.h"
+
+#define CRYNAME "wst-se"
+
+#define SWBUFNUM 512
+#define SWCHANNELNUM 2
+#define CTL_DMABUFNUM 512
+
+#define DMA_MASK 0xffffffff
+#define SE_DMA_CONTROL_RESET 0x80000000
+#define SE_DMA_CONTROL_SET 0x00000000
+
+#define SE_BASEERR 1000
+
+#define SE_MAX_SEND_LEN (3*2048)
+#define SE_FILL_LEN 48
+#define SE_BD_LENGTH sizeof(SE_BASIC_BD)
+#define SE_BDQUEUE_LEN SWBUFNUM
+#define DMA0_CTRL_CHANNEL_ENABLE 1
+#define DMA0_CTRL_CHANNEL_DISABLE 0xfffffffe
+#define DMA1_CTRL_CHANNEL_ENABLE 2
+#define DMA1_CTRL_CHANNEL_DISABLE 0xfffffffd
+
+#define SE_REG_RESET 0
+#define SE_REG_STS 0x08
+#define SE_INT_CTRL 0x10
+#define SE_REG_MSK 0x18
+#define SE_INT_CLR 0x20
+
+#define SE_LREG_BQBA0 0x100
+#define SE_HREG_BQBA0 0x108
+#define SE_REG_BQS0 0x110
+#define SE_REG_BQWP0 0x118
+#define SE_REG_RQRP0 0x120
+
+#define SE_LREG_BQBA1 0x128
+#define SE_HREG_BQBA1 0x130
+#define SE_REG_BQS1 0x138
+#define SE_REG_BQWP1 0x140
+#define SE_REG_RQRP1 0x148
+
+#define SE_WRITE_REG1 0x200
+#define SE_WRITE_REG2 0x208
+#define SE_WRITE_REG3 0x210
+#define SE_LOWREG_STS 0x240
+#define SE_LOWINT_CLEAR 0x248
+#define SE_LOWREG_INQ 0x1600
+#define SE_LOWREG_SR 0x1608
+#define INPUT_VALID 0x4
+#define OUTPUT_VALID 0x8
+#define SE_LOWINT_CLR 0x228
+#define INT_STAT_DMA0_PACK_DONE 1
+#define INT_STAT_DMA1_PACK_DONE 2
+#define INT_STAT_DMA_MASK (INT_STAT_DMA0_PACK_DONE|INT_STAT_DMA1_PACK_DONE)
+
+typedef struct tagSEdrvctl {
+
+ unsigned long ulMemBase;
+ struct device *pdev;
+ struct device dev;
+ unsigned int ulCurrBdReadPtr[SWCHANNELNUM];
+ unsigned int ulCurrBdWritePtr[SWCHANNELNUM];
+ unsigned int ulCurrReadPtr[SWCHANNELNUM];
+ unsigned int ulCurrWritePtr[SWCHANNELNUM];
+ PSECallBackfn pcallback[SWCHANNELNUM][SWBUFNUM];
+ void *pParma[SWCHANNELNUM][SWBUFNUM];
+ struct completion *stsemphore[SWCHANNELNUM][SWBUFNUM];
+ int ikernel[SWCHANNELNUM][SWBUFNUM];
+ unsigned long ulBDMemBasePhy[SWCHANNELNUM];
+ unsigned long ulBDMemBase[SWCHANNELNUM];
+ unsigned short *pusOutlen[SWCHANNELNUM][SWBUFNUM];
+ unsigned short usInlen[SWCHANNELNUM][SWBUFNUM];
+ unsigned long *ulOutputPtr[SWCHANNELNUM][SWBUFNUM];
+ unsigned long *ulInputPtr[SWCHANNELNUM][SWBUFNUM];
+ unsigned char *pucRetCode[SWCHANNELNUM][SWBUFNUM];
+ rwlock_t mr_lock;
+ rwlock_t mr_lowlock;
+ spinlock_t readlock;
+ struct semaphore sema;
+ int iIrq;
+ int ilowIrq;
+} SECHIPDRV_CTRL;
+
+typedef struct tagSEBasicBD {
+
+ unsigned int ucOpCode:4,
+ ucFlag:4,
+ ucRetCode:8,
+ ucInCtxLength:8,
+ ucOutCtxLength:8;
+ unsigned int usInputLength:16,
+ usOutputLength:16;
+ unsigned int ulCtxLPtr;
+ unsigned int ulCtxHPtr;
+ unsigned int ulInputLPtr;
+ unsigned int ulInputHPtr;
+ unsigned int ulOutputLPtr;
+ unsigned int ulOutputHPtr;
+
+} SE_BASIC_BD;
+
+#define SW_CONT_BUF_SIZE 0x100
+#define DMA_BUFSIZE 0x1000
+
+#define PAGE_NUM (DMA_BUFSIZE/PAGE_SIZE+1)
+
+typedef struct _SW_GET_STAT {
+ unsigned long TXD;
+ unsigned long RXD;
+} SW_GET_STAT, *PSW_GET_STAT;
+
+DEFINE_SPINLOCK(g_writelock);
+
+#define HandleRead32(handle, addr, pData) \
+ do { \
+ smp_mb(); \
+ *(pData) = readl((void *)(handle->ulMemBase + addr)); \
+ } while (0)
+
+#define HandleWrite32(handle, addr, value)\
+ do { \
+ writel(value, (void *)(handle->ulMemBase + addr)); \
+ smp_mb(); \
+ } while (0)
+
+#define HandleRead64(handle, addr, pData) \
+ do { \
+ smp_mb(); \
+ *(pData) = readq((void *)(handle->ulMemBase + addr)); \
+ } while (0)
+
+#define HandleWrite64(handle, addr, value)\
+ do { \
+ writeq(value, (void *)(handle->ulMemBase + addr)); \
+ smp_mb(); \
+ } while (0)
+
+
+#define SPRINTF sprintf
+
+#define HIULONG(w) ((unsigned int)((((unsigned long long)w) >> 32) & 0x00000000ffffffff))
+#define LOULONG(w) ((unsigned int)((unsigned long long)w) & 0x00000000ffffffff)
+
+#ifdef DEBUG_DRIVER
+ #define TRACEMSG(fmt, args...) printk(KERN_DEBUG "msg: " fmt, ##args)
+#else
+ #define TRACEMSG(fmt, args...)
+#endif
+
+#ifdef DEBUG_DRIVER_ERROR
+ #define TRACEERR(fmt, args...) printk(KERN_DEBUG "err: " fmt, ##args)
+#else
+ #define TRACEERR(fmt, args...)
+#endif
+
+#define HIBYTE(w) ((unsigned char)(((unsigned short)(w) >> 8) & 0xFF))
+#define LOBYTE(w) ((unsigned char)(w))
+
+typedef struct ST_SEND_PACKAGE {
+ struct list_head list;
+ SECHIPDRV_CTRL *pdrvctl;
+ unsigned char *pInPtr;
+ unsigned short usInlen;
+ unsigned char *pOutPtr;
+ unsigned short *pusOutlen;
+ int iChannel;
+ unsigned char ucFlag;
+ unsigned char ucOpCode;
+ unsigned char *pucRetCode;
+ PSECallBackfn pcallback;
+ void *pParma;
+ int iKernel;
+ struct completion *mycomplete;
+ unsigned long ulendtime;
+} SEND_PACKAGE;
+
+typedef struct ST_INT_MESSAGE {
+ struct list_head list;
+ PSECallBackfn pcallback;
+ void *pParma;
+} INT_MESSAGE;
+#endif
diff --git a/drivers/crypto/sedriver/wst_se_ktrans.h b/drivers/crypto/sedriver/wst_se_ktrans.h
new file mode 100644
index 000000000000..da6c4b8f2824
--- /dev/null
+++ b/drivers/crypto/sedriver/wst_se_ktrans.h
@@ -0,0 +1,17 @@
+#ifndef _WST_SE_KTRANS_H
+#define _WST_SE_KTRANS_H
+
+#include "wst_se_common_type.h"
+#include "wst_se_define.h"
+
+
+typedef struct tagSWCOMMUDATA {
+ unsigned short usFlags;
+ unsigned short usInputLen;
+ unsigned short usOutputLen;
+ unsigned short usReserve;
+ unsigned char *pucInbuf;
+ unsigned char *pucOutbuf;
+} SWCommuData;
+
+#endif
--
2.33.0
2
1

[PATCH OLK-6.6] KVM: arm64: Unconditionally save+flush host FPSIMD/SVE/SME state
by Huang Xiaojia 14 Apr '25
by Huang Xiaojia 14 Apr '25
14 Apr '25
From: Mark Rutland <mark.rutland(a)arm.com>
stable inclusion
from stable-v6.12.21
commit 79e140bba70bcacc5fe15bf8c0b958793fd7d56f
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IBZH7N
CVE: CVE-2025-22013
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id…
--------------------------------
[ Upstream commit fbc7e61195e23f744814e78524b73b59faa54ab4 ]
There are several problems with the way hyp code lazily saves the host's
FPSIMD/SVE state, including:
* Host SVE being discarded unexpectedly due to inconsistent
configuration of TIF_SVE and CPACR_ELx.ZEN. This has been seen to
result in QEMU crashes where SVE is used by memmove(), as reported by
Eric Auger:
https://issues.redhat.com/browse/RHEL-68997
* Host SVE state is discarded *after* modification by ptrace, which was an
unintentional ptrace ABI change introduced with lazy discarding of SVE state.
* The host FPMR value can be discarded when running a non-protected VM,
where FPMR support is not exposed to a VM, and that VM uses
FPSIMD/SVE. In these cases the hyp code does not save the host's FPMR
before unbinding the host's FPSIMD/SVE/SME state, leaving a stale
value in memory.
Avoid these by eagerly saving and "flushing" the host's FPSIMD/SVE/SME
state when loading a vCPU such that KVM does not need to save any of the
host's FPSIMD/SVE/SME state. For clarity, fpsimd_kvm_prepare() is
removed and the necessary call to fpsimd_save_and_flush_cpu_state() is
placed in kvm_arch_vcpu_load_fp(). As 'fpsimd_state' and 'fpmr_ptr'
should not be used, they are set to NULL; all uses of these will be
removed in subsequent patches.
Historical problems go back at least as far as v5.17, e.g. erroneous
assumptions about TIF_SVE being clear in commit:
8383741ab2e773a9 ("KVM: arm64: Get rid of host SVE tracking/saving")
... and so this eager save+flush probably needs to be backported to ALL
stable trees.
Fixes: 93ae6b01bafee8fa ("KVM: arm64: Discard any SVE state when entering KVM guests")
Fixes: 8c845e2731041f0f ("arm64/sve: Leave SVE enabled on syscall if we don't context switch")
Fixes: ef3be86021c3bdf3 ("KVM: arm64: Add save/restore support for FPMR")
Reported-by: Eric Auger <eauger(a)redhat.com>
Reported-by: Wilco Dijkstra <wilco.dijkstra(a)arm.com>
Reviewed-by: Mark Brown <broonie(a)kernel.org>
Tested-by: Mark Brown <broonie(a)kernel.org>
Tested-by: Eric Auger <eric.auger(a)redhat.com>
Acked-by: Will Deacon <will(a)kernel.org>
Cc: Catalin Marinas <catalin.marinas(a)arm.com>
Cc: Florian Weimer <fweimer(a)redhat.com>
Cc: Fuad Tabba <tabba(a)google.com>
Cc: Jeremy Linton <jeremy.linton(a)arm.com>
Cc: Marc Zyngier <maz(a)kernel.org>
Cc: Oliver Upton <oliver.upton(a)linux.dev>
Cc: Paolo Bonzini <pbonzini(a)redhat.com>
Signed-off-by: Mark Rutland <mark.rutland(a)arm.com>
Reviewed-by: Oliver Upton <oliver.upton(a)linux.dev>
Link: https://lore.kernel.org/r/20250210195226.1215254-2-mark.rutland@arm.com
Signed-off-by: Marc Zyngier <maz(a)kernel.org>
[ Mark: Handle vcpu/host flag conflict ]
Signed-off-by: Mark Rutland <mark.rutland(a)arm.com>
Signed-off-by: Mark Brown <broonie(a)kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Conflicts:
arch/arm64/kvm/fpsimd.c
[Lack of commit ef3be86021c3bdf384c36d9d4aa1ee9fe65b95af]
Signed-off-by: Huang Xiaojia <huangxiaojia2(a)huawei.com>
---
arch/arm64/kernel/fpsimd.c | 25 -------------------------
arch/arm64/kvm/fpsimd.c | 33 +++++++++------------------------
2 files changed, 9 insertions(+), 49 deletions(-)
diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c
index 0137d987631e..bd4f6c6ee0f3 100644
--- a/arch/arm64/kernel/fpsimd.c
+++ b/arch/arm64/kernel/fpsimd.c
@@ -1707,31 +1707,6 @@ void fpsimd_signal_preserve_current_state(void)
sve_to_fpsimd(current);
}
-/*
- * Called by KVM when entering the guest.
- */
-void fpsimd_kvm_prepare(void)
-{
- if (!system_supports_sve())
- return;
-
- /*
- * KVM does not save host SVE state since we can only enter
- * the guest from a syscall so the ABI means that only the
- * non-saved SVE state needs to be saved. If we have left
- * SVE enabled for performance reasons then update the task
- * state to be FPSIMD only.
- */
- get_cpu_fpsimd_context();
-
- if (test_and_clear_thread_flag(TIF_SVE)) {
- sve_to_fpsimd(current);
- current->thread.fp_type = FP_STATE_FPSIMD;
- }
-
- put_cpu_fpsimd_context();
-}
-
/*
* Associate current's FPSIMD context with this cpu
* The caller must have ownership of the cpu FPSIMD context before calling
diff --git a/arch/arm64/kvm/fpsimd.c b/arch/arm64/kvm/fpsimd.c
index 4f51293db173..9c444a277a17 100644
--- a/arch/arm64/kvm/fpsimd.c
+++ b/arch/arm64/kvm/fpsimd.c
@@ -77,15 +77,17 @@ void kvm_arch_vcpu_load_fp(struct kvm_vcpu *vcpu)
if (!system_supports_fpsimd())
return;
- fpsimd_kvm_prepare();
-
/*
- * We will check TIF_FOREIGN_FPSTATE just before entering the
- * guest in kvm_arch_vcpu_ctxflush_fp() and override this to
- * FP_STATE_FREE if the flag set.
+ * Ensure that any host FPSIMD/SVE/SME state is saved and unbound such
+ * that the host kernel is responsible for restoring this state upon
+ * return to userspace, and the hyp code doesn't need to save anything.
+ *
+ * When the host may use SME, fpsimd_save_and_flush_cpu_state() ensures
+ * that PSTATE.{SM,ZA} == {0,0}.
*/
- *host_data_ptr(fp_owner) = FP_STATE_HOST_OWNED;
- *host_data_ptr(fpsimd_state) = kern_hyp_va(¤t->thread.uw.fpsimd_state);
+ fpsimd_save_and_flush_cpu_state();
+ *host_data_ptr(fp_owner) = FP_STATE_FREE;
+ *host_data_ptr(fpsimd_state) = NULL;
vcpu_clear_flag(vcpu, HOST_SVE_ENABLED);
if (read_sysreg(cpacr_el1) & CPACR_EL1_ZEN_EL0EN)
@@ -95,23 +97,6 @@ void kvm_arch_vcpu_load_fp(struct kvm_vcpu *vcpu)
vcpu_clear_flag(vcpu, HOST_SME_ENABLED);
if (read_sysreg(cpacr_el1) & CPACR_EL1_SMEN_EL0EN)
vcpu_set_flag(vcpu, HOST_SME_ENABLED);
-
- /*
- * If PSTATE.SM is enabled then save any pending FP
- * state and disable PSTATE.SM. If we leave PSTATE.SM
- * enabled and the guest does not enable SME via
- * CPACR_EL1.SMEN then operations that should be valid
- * may generate SME traps from EL1 to EL1 which we
- * can't intercept and which would confuse the guest.
- *
- * Do the same for PSTATE.ZA in the case where there
- * is state in the registers which has not already
- * been saved, this is very unlikely to happen.
- */
- if (read_sysreg_s(SYS_SVCR) & (SVCR_SM_MASK | SVCR_ZA_MASK)) {
- *host_data_ptr(fp_owner) = FP_STATE_FREE;
- fpsimd_save_and_flush_cpu_state();
- }
}
}
--
2.34.1
2
1
From: Qunqin Zhao <zhaoqunqin(a)loongson.cn>
LoongArch inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/IC10DU
CVE: NA
--------------------------------
Add support for WST se chip support for LS*5000*.
Signed-off-by: Qunqin Zhao <zhaoqunqin(a)loongson.cn>
---
arch/loongarch/configs/loongson3_defconfig | 1 +
drivers/crypto/Kconfig | 1 +
drivers/crypto/Makefile | 1 +
drivers/crypto/sedriver/Kconfig | 8 +
drivers/crypto/sedriver/Makefile | 7 +
drivers/crypto/sedriver/wst_se_common_type.h | 98 ++
drivers/crypto/sedriver/wst_se_define.h | 27 +
drivers/crypto/sedriver/wst_se_echip_driver.c | 1368 +++++++++++++++++
drivers/crypto/sedriver/wst_se_echip_driver.h | 184 +++
drivers/crypto/sedriver/wst_se_ktrans.h | 17 +
10 files changed, 1712 insertions(+)
create mode 100644 drivers/crypto/sedriver/Kconfig
create mode 100644 drivers/crypto/sedriver/Makefile
create mode 100644 drivers/crypto/sedriver/wst_se_common_type.h
create mode 100644 drivers/crypto/sedriver/wst_se_define.h
create mode 100644 drivers/crypto/sedriver/wst_se_echip_driver.c
create mode 100644 drivers/crypto/sedriver/wst_se_echip_driver.h
create mode 100644 drivers/crypto/sedriver/wst_se_ktrans.h
diff --git a/arch/loongarch/configs/loongson3_defconfig b/arch/loongarch/configs/loongson3_defconfig
index 980f5f2c99a1..cf359d1a2554 100644
--- a/arch/loongarch/configs/loongson3_defconfig
+++ b/arch/loongarch/configs/loongson3_defconfig
@@ -2177,6 +2177,7 @@ CONFIG_CRYPTO_CRC32_LOONGARCH=m
CONFIG_CRYPTO_DEV_NITROX_CNN55XX=m
CONFIG_CRYPTO_DEV_CHELSIO=m
CONFIG_CRYPTO_DEV_VIRTIO=m
+CONFIG_SW_SE_CHIP=m
CONFIG_SIGNED_PE_FILE_VERIFICATION=y
CONFIG_SECONDARY_TRUSTED_KEYRING=y
CONFIG_SYSTEM_BLACKLIST_KEYRING=y
diff --git a/drivers/crypto/Kconfig b/drivers/crypto/Kconfig
index b84a921d293f..efd6a855bca3 100644
--- a/drivers/crypto/Kconfig
+++ b/drivers/crypto/Kconfig
@@ -836,5 +836,6 @@ config CRYPTO_DEV_SA2UL
source "drivers/crypto/aspeed/Kconfig"
source "drivers/crypto/starfive/Kconfig"
source "drivers/crypto/montage/Kconfig"
+source "drivers/crypto/sedriver/Kconfig"
endif # CRYPTO_HW
diff --git a/drivers/crypto/Makefile b/drivers/crypto/Makefile
index 5247d2bf09ce..6ad337bad109 100644
--- a/drivers/crypto/Makefile
+++ b/drivers/crypto/Makefile
@@ -54,3 +54,4 @@ obj-$(CONFIG_CRYPTO_DEV_AMLOGIC_GXL) += amlogic/
obj-y += intel/
obj-y += starfive/
obj-y += montage/
+obj-$(CONFIG_SW_SE_CHIP) += sedriver/
diff --git a/drivers/crypto/sedriver/Kconfig b/drivers/crypto/sedriver/Kconfig
new file mode 100644
index 000000000000..6a11bdf1e5fa
--- /dev/null
+++ b/drivers/crypto/sedriver/Kconfig
@@ -0,0 +1,8 @@
+#
+# se chip configuration
+#
+config SW_SE_CHIP
+ tristate "wst se chip driver"
+ depends on LOONGARCH
+ help
+ If unsure, say N.
diff --git a/drivers/crypto/sedriver/Makefile b/drivers/crypto/sedriver/Makefile
new file mode 100644
index 000000000000..0ee095d1a1d2
--- /dev/null
+++ b/drivers/crypto/sedriver/Makefile
@@ -0,0 +1,7 @@
+#
+# Makefile for SE CHIP Driver
+#
+
+obj-$(CONFIG_SW_SE_CHIP) += sw_se_echip_drv.o
+sw_se_echip_drv-objs := wst_se_echip_driver.o
+
diff --git a/drivers/crypto/sedriver/wst_se_common_type.h b/drivers/crypto/sedriver/wst_se_common_type.h
new file mode 100644
index 000000000000..e29e9bccaa6d
--- /dev/null
+++ b/drivers/crypto/sedriver/wst_se_common_type.h
@@ -0,0 +1,98 @@
+#ifndef _WST_SE_COMMON_TYPE_H
+#define _WST_SE_COMMON_TYPE_H
+
+#include <linux/kernel.h> /* We're doing kernel work */
+#include <linux/module.h> /* Specifically, a module */
+#include <linux/errno.h>
+#include <linux/init.h>
+#include <linux/poll.h>
+#include <linux/pci.h>
+#include <linux/types.h>
+#include <linux/fs.h>
+#include <linux/interrupt.h>
+#include <linux/workqueue.h>
+#include <linux/mm.h>
+#include <linux/sched.h>
+#include <linux/slab.h>
+#include <linux/wait.h>
+#include <linux/version.h>
+#include <linux/ioport.h>
+#include <linux/time.h>
+#include <linux/pagemap.h>
+#include <linux/delay.h>
+#include <linux/list.h>
+#include <linux/uaccess.h>
+#include <linux/io.h>
+#include <asm/mman.h>
+#include <asm/irq.h>
+#include <asm/dma.h>
+
+#define WST_GO_CHANNEL0 0x0002
+#define WST_GO_CHANNEL1 0x0000
+#define WST_GO_CHANNEL2 0x0001
+
+#define SE_OK 0
+
+struct loongson_sedriver_irq {
+ char *pat;
+ int irq;
+};
+
+typedef struct tag_dma_buf_ctl {
+ struct list_head list;
+ unsigned char *pDmaBuf;
+} dmabuf_ctl, *pdmabuf_ctl;
+
+typedef struct tag_Queue_container {
+ struct list_head m_Head;
+ unsigned int qlen;
+ unsigned int max_qlen;
+} QUEUE_CONTAIN, *PQUEUE_CONTAIN;
+
+
+static inline int wst_InitQueue(struct tag_Queue_container *pQueue, int count)
+{
+ INIT_LIST_HEAD(&pQueue->m_Head);
+ pQueue->qlen = 0;
+ pQueue->max_qlen = count;
+ return 0;
+}
+
+
+static inline struct list_head *wst_Popfront_Que(struct tag_Queue_container *pQueue)
+{
+ struct list_head *pNode = NULL;
+
+ if (list_empty(&pQueue->m_Head))
+ return NULL;
+
+ pQueue->qlen--;
+ pNode = pQueue->m_Head.next;
+ list_del(pNode);
+ return pNode;
+}
+
+
+static inline int wst_Pushback_Que(struct tag_Queue_container *pQueue, void *pNode)
+{
+ if (unlikely(pQueue->qlen >= pQueue->max_qlen))
+ return -1;
+
+ pQueue->qlen++;
+ list_add_tail((struct list_head *)(pNode), &pQueue->m_Head);
+ return 0;
+}
+
+#define READUBUF 0
+#define WRITEUBUF 1
+
+static inline int wst_cpyusrbuf(unsigned char *puserbuf,
+ unsigned char *pkbuf, size_t num, int orient)
+{
+ if (orient == READUBUF)
+ return copy_from_user(pkbuf, puserbuf, num);
+ else
+ return copy_to_user(puserbuf, pkbuf, num);
+}
+
+#endif
diff --git a/drivers/crypto/sedriver/wst_se_define.h b/drivers/crypto/sedriver/wst_se_define.h
new file mode 100644
index 000000000000..7a29f1029afa
--- /dev/null
+++ b/drivers/crypto/sedriver/wst_se_define.h
@@ -0,0 +1,27 @@
+#ifndef _WST_SE_DEFINE_H
+#define _WST_SE_DEFINE_H
+
+
+typedef void (*PSECallBackfn)(void *pParam);
+
+#define WST_SE_OK 0 //function syccess
+#define WST_SE_FAILURE 1
+#define WST_SE_ERROR_MALLOC 2
+#define WST_SE_ERROR_OPEN 3
+#define WST_SE_ERROR_ID 4
+#define WST_SE_ERROR_OPERTYPE 5
+#define WST_SE_ERROR_KEYID 6
+#define WST_SE_NOT_SUPPORT 7
+#define WST_SE_ERROR_FULL 8
+#define WST_SE_VERIFY_ERROR 0xb
+#define WST_SE_NOT_SUPPORT_VERIFY 0xd
+#define WST_SE_ERROR_LENGTH 0xc
+#define WST_SE_HAS_OPEN 0xd
+#define WST_COPY_MEM_ERROR 0xe
+#define WST_SE_PARAM_ERROR 0xf
+
+#define BASE_ERROR 0x1000
+#define WST_SE_ERROR_LICENSE 0x100b
+#define WST_SE_ERROR_NOT_SUPPORT_TYPE 0x100d
+
+#endif
diff --git a/drivers/crypto/sedriver/wst_se_echip_driver.c b/drivers/crypto/sedriver/wst_se_echip_driver.c
new file mode 100644
index 000000000000..66e34549d209
--- /dev/null
+++ b/drivers/crypto/sedriver/wst_se_echip_driver.c
@@ -0,0 +1,1368 @@
+#include <linux/semaphore.h>
+#include <linux/moduleparam.h>
+#include <linux/kthread.h>
+#include <linux/module.h>
+#include <linux/of_device.h>
+#include <linux/workqueue.h>
+#include <linux/platform_device.h>
+#include <linux/crypto.h>
+#include <crypto/internal/skcipher.h>
+#include <linux/acpi.h>
+#include <asm/loongson.h>
+#include "wst_se_echip_driver.h"
+
+#define LS_CRYPTO_SE_ADDR1 TO_UNCACHE(LOONGSON_REG_BASE+0x0400)
+#define LS_CRYPTO_SE_ADDR2 TO_UNCACHE(0xc0010200000)
+#define DRIVER_VERSION "01.10.220111"
+DEFINE_SPINLOCK(g_reclistlock);
+DEFINE_SPINLOCK(g_sendlistlock);
+DEFINE_SPINLOCK(g_getdmabuflock);
+
+unsigned char *g_pCacheInBuf = NULL, *g_pCacheOutBuf = NULL;
+static struct class *g_psecclass;
+static struct device *g_psecdev;
+static SECHIPDRV_CTRL *g_psechipDrvCtrl;
+static int g_isechip_Major = -1;
+static struct semaphore g_lowsema, g_lowirqsema;
+static atomic_t g_sendtotallen;
+static struct tag_Queue_container g_RecQueueContainer;
+static struct tag_Queue_container g_SendQueueContainer;
+static int g_suspend;
+static struct semaphore g_dmabufsem;
+struct loongson_sedriver_irq se_irq[] = {
+ {
+ .pat = "se-irq",
+ },
+ {
+ .pat = "se-lirq",
+ },
+};
+static struct tag_Queue_container g_DmaBQueueContainer;
+static struct tag_dma_buf_ctl *g_pdmadatabuf;
+static int g_iDmaBufNum;
+static struct work_struct g_recwork, g_sendwork;
+static struct workqueue_struct *g_worksendqueue, *g_workrecqueue;
+static irqreturn_t se_interrupt(int irq, void *p);
+static irqreturn_t wst_low_channel_status(int irq, void *p);
+static void globalmem_do_send_op(struct work_struct *p);
+static void globalmem_do_rec_op(struct work_struct *p);
+static int g_iUseIntr = 1;
+module_param(g_iUseIntr, int, 0644);
+
+static int se_init_dma_buf(int idatasize, int idatanum)
+{
+ int i;
+ struct tag_dma_buf_ctl *pdmactl;
+
+ wst_InitQueue(&g_DmaBQueueContainer, idatanum);
+ g_pdmadatabuf = kmalloc((sizeof(struct tag_dma_buf_ctl)*idatanum), GFP_KERNEL);
+ if (!g_pdmadatabuf)
+ return -1;
+ for (i = 0; i < idatanum; i++) {
+ pdmactl = &g_pdmadatabuf[i];
+ pdmactl->pDmaBuf = (unsigned char *)__get_free_page(GFP_KERNEL|GFP_DMA);
+ if (!pdmactl->pDmaBuf) {
+ g_iDmaBufNum = i;
+ return SE_OK;
+ }
+ wst_Pushback_Que(&g_DmaBQueueContainer, pdmactl);
+ }
+ g_iDmaBufNum = i;
+ sema_init(&g_dmabufsem, 1);
+ return SE_OK;
+}
+
+static int se_del_dma_buf(void)
+{
+ int i;
+ struct tag_dma_buf_ctl *pdmactl;
+
+ for (i = 0; i < g_iDmaBufNum; i++) {
+ pdmactl = &g_pdmadatabuf[i];
+ if (pdmactl) {
+ free_page((unsigned long)pdmactl->pDmaBuf);
+ pdmactl->pDmaBuf = NULL;
+ }
+ }
+ kfree(g_pdmadatabuf);
+ g_pdmadatabuf = NULL;
+ return 0;
+}
+
+struct tag_dma_buf_ctl *se_get_dma_buf(int ikernel)
+{
+ struct tag_dma_buf_ctl *pbufctl = NULL;
+ unsigned long ultimeout = 0;
+
+ ultimeout = jiffies+20*HZ;
+ while (1) {
+ spin_lock(&g_getdmabuflock);
+ pbufctl = (struct tag_dma_buf_ctl *)wst_Popfront_Que(&g_DmaBQueueContainer);
+ spin_unlock(&g_getdmabuflock);
+ if (pbufctl)
+ return pbufctl;
+ if (down_timeout(&g_dmabufsem, ultimeout))
+ return NULL;
+ }
+ return pbufctl;
+}
+
+int se_free_dma_buf(struct tag_dma_buf_ctl *pdmabufctl)
+{
+ spin_lock(&g_getdmabuflock);
+ wst_Pushback_Que(&g_DmaBQueueContainer, pdmabufctl);
+ spin_unlock(&g_getdmabuflock);
+ if (g_dmabufsem.count <= 0)
+ up(&g_dmabufsem);
+
+ return 0;
+}
+
+static unsigned long bytes_align(struct device *pdev, unsigned long ulVirAddr)
+{
+ unsigned char diff;
+ unsigned long ulPhyAddr = (unsigned long)__pa((void *)ulVirAddr);
+
+ if ((ulPhyAddr & 0x000000000000003f) == 0)
+ return ulVirAddr;
+ diff = ((long)ulPhyAddr & (~(0x000000000000003f))) + 64 - ulPhyAddr;
+ ulVirAddr += diff;
+
+ return ulVirAddr;
+}
+
+static unsigned long descri_bytes_align(unsigned long ulVirAddr)
+{
+ unsigned char diff;
+ unsigned long ulPhyAddr = ulVirAddr;
+
+ if ((ulPhyAddr & (~0x00000000ffffffe0)) == 0)
+ return ulVirAddr;
+ diff = ((long)ulPhyAddr & 0x00000000ffffffe0) + 32 - ulPhyAddr;
+ ulVirAddr += diff;
+ return ulVirAddr;
+}
+
+int se_printk_hex(unsigned char *buff, int length)
+{
+ unsigned char *string_tmp = buff;
+ int i;
+ int count = 0;
+
+ for (i = 0; i < length; i++, count++) {
+ if (count < 16)
+ pr_info("%02x ", string_tmp[i]);
+ else {
+ count = 0;
+ pr_info("\n%02x ", string_tmp[i]);
+ continue;
+ }
+ }
+ pr_info("\n");
+ return 0;
+}
+
+static int se_ChipInit(SECHIPDRV_CTRL *pDrvCtrl)
+{
+ dma_addr_t ulBusAddr;
+ unsigned long ulVirAddr;
+ int i = 0, j = 0;
+ unsigned int dmaoldmask;
+
+ for (i = 0; i < SWCHANNELNUM; i++) {
+ ulVirAddr = (unsigned long)dma_alloc_coherent(
+ pDrvCtrl->pdev,
+ (SE_BDQUEUE_LEN * SE_BD_LENGTH+32),
+ &ulBusAddr, GFP_KERNEL
+ );
+ if (ulVirAddr == 0 || ulBusAddr == 0)
+ return -EFAULT;
+ memset((void *)ulVirAddr, 0, (SE_BDQUEUE_LEN*SE_BD_LENGTH));
+
+ pDrvCtrl->ulBDMemBasePhy[i] = ulBusAddr;
+ pDrvCtrl->ulBDMemBase[i] = ulVirAddr;
+ pDrvCtrl->ulCurrBdReadPtr[i] = 0;
+ pDrvCtrl->ulCurrBdWritePtr[i] = 0;
+ pDrvCtrl->ulCurrReadPtr[i] = 0;
+ pDrvCtrl->ulCurrWritePtr[i] = 0;
+ }
+ for (i = 0; i < SE_BDQUEUE_LEN; i++) {
+ for (j = 0; j < SWCHANNELNUM; j++)
+ (&((SE_BASIC_BD *)(pDrvCtrl->ulBDMemBase[j]))[i])->ucRetCode = 0x0f;
+ }
+ ulBusAddr = descri_bytes_align(pDrvCtrl->ulBDMemBasePhy[0]);
+ HandleWrite32(pDrvCtrl, SE_HREG_BQBA0, HIULONG(ulBusAddr));
+ HandleWrite32(pDrvCtrl, SE_LREG_BQBA0, LOULONG(ulBusAddr));
+ HandleWrite32(pDrvCtrl, SE_REG_BQS0, SE_BDQUEUE_LEN - 1);
+ HandleWrite32(pDrvCtrl, SE_REG_RQRP0, pDrvCtrl->ulCurrBdReadPtr[0]);
+ HandleWrite32(pDrvCtrl, SE_REG_BQWP0, pDrvCtrl->ulCurrBdWritePtr[0]);
+
+ ulBusAddr = descri_bytes_align(pDrvCtrl->ulBDMemBasePhy[1]);
+ HandleWrite32(pDrvCtrl, SE_HREG_BQBA1, HIULONG(ulBusAddr));
+ HandleWrite32(pDrvCtrl, SE_LREG_BQBA1, LOULONG(ulBusAddr));
+ HandleWrite32(pDrvCtrl, SE_REG_BQS1, SE_BDQUEUE_LEN - 1);
+ HandleWrite32(pDrvCtrl, SE_REG_RQRP1, pDrvCtrl->ulCurrBdReadPtr[1]);
+ HandleWrite32(pDrvCtrl, SE_REG_BQWP1, pDrvCtrl->ulCurrBdWritePtr[1]);
+ HandleRead32(pDrvCtrl, SE_REG_MSK, &dmaoldmask);
+ HandleWrite32(pDrvCtrl, SE_REG_MSK, (dmaoldmask | DMA0_CTRL_CHANNEL_ENABLE | DMA1_CTRL_CHANNEL_ENABLE));
+ if (g_iUseIntr != 0)
+ HandleWrite32(pDrvCtrl, SE_LOWREG_INQ, 1);
+ else
+ HandleWrite32(pDrvCtrl, SE_LOWREG_INQ, 0);
+ mdelay(1000);
+
+ return SE_OK;
+}
+
+static void se_ChipRelease(SECHIPDRV_CTRL *pDrvCtrl)
+{
+ int i;
+
+ for (i = 0; i < SWCHANNELNUM; i++) {
+ if (pDrvCtrl->ulBDMemBase[i]) {
+ dma_free_coherent(
+ pDrvCtrl->pdev,
+ (SE_BDQUEUE_LEN * SE_BD_LENGTH),
+ (void *)pDrvCtrl->ulBDMemBase[i],
+ pDrvCtrl->ulBDMemBasePhy[i]
+ );
+ pDrvCtrl->ulBDMemBase[i] = 0;
+ pDrvCtrl->ulBDMemBasePhy[i] = 0;
+ }
+ }
+}
+
+static void SE_RESET(SECHIPDRV_CTRL *pdrvctl)
+{
+
+ unsigned int reg;
+ unsigned long ulreg64, uladdr = LS_CRYPTO_SE_ADDR1;
+
+ HandleRead32(pdrvctl, SE_REG_RESET, ®);
+ HandleWrite32(pdrvctl, SE_REG_RESET, reg|SE_DMA_CONTROL_RESET);
+ mdelay(300);
+ HandleWrite32(pdrvctl, SE_REG_RESET, (reg&(~SE_DMA_CONTROL_RESET))|SE_DMA_CONTROL_SET);
+ mdelay(300);
+ ulreg64 = readq((volatile void __iomem *)uladdr);
+ if ((ulreg64 & 0xf0000000000000) != 0xf0000000000000)
+ writeq(ulreg64|0xf0000000000000, (volatile void __iomem *)uladdr);
+ HandleWrite32(pdrvctl, SE_INT_CLR, 0xf);
+}
+
+static int wst_init(void)
+{
+ int iRes = SE_OK;
+ static u64 wst_dma_mask = DMA_BIT_MASK(64);
+ char cName[256];
+ SECHIPDRV_CTRL *pdrvctl = NULL;
+
+ pdrvctl = kmalloc(sizeof(SECHIPDRV_CTRL), GFP_KERNEL);
+ if (pdrvctl == NULL)
+ return -ENOMEM;
+ memset(pdrvctl, 0, sizeof(SECHIPDRV_CTRL));
+ pdrvctl->ulMemBase = LS_CRYPTO_SE_ADDR2;
+ memset(cName, 0, 256);
+ sema_init(&(pdrvctl->sema), 0);
+ rwlock_init(&(pdrvctl->mr_lock));
+ rwlock_init(&(pdrvctl->mr_lowlock));
+ g_psechipDrvCtrl = pdrvctl;
+ g_psechipDrvCtrl->pdev = g_psecdev;
+ g_psechipDrvCtrl->pdev->dma_mask = &wst_dma_mask;
+ g_psechipDrvCtrl->pdev->coherent_dma_mask = (unsigned long long)&wst_dma_mask;
+ wst_InitQueue(&g_RecQueueContainer, 2000);
+ wst_InitQueue(&g_SendQueueContainer, 2000);
+ SE_RESET(pdrvctl);
+ pdrvctl->ilowIrq = 0;
+ pdrvctl->iIrq = se_irq[0].irq;
+ iRes = request_irq(pdrvctl->iIrq, &se_interrupt, IRQF_SHARED, "wst-se-hirq", pdrvctl);
+ if (iRes) {
+ pr_err("request_irq err\n");
+ pdrvctl->iIrq = 0;
+ goto err;
+ }
+ if (g_iUseIntr == 1) {
+ pdrvctl->ilowIrq = se_irq[1].irq;
+ iRes = request_irq(pdrvctl->ilowIrq, &wst_low_channel_status, IRQF_SHARED, "wst-se-lirq", pdrvctl);
+ if (iRes) {
+ pr_err("\nrequest_lowirq err, iRes=0x%x\n", iRes);
+ pdrvctl->ilowIrq = 0;
+ goto err;
+ }
+ }
+ if (se_ChipInit(pdrvctl) != SE_OK) {
+ iRes = -ENODEV;
+ goto err;
+ }
+ return SE_OK;
+err:
+ if (pdrvctl != NULL) {
+ if (pdrvctl->iIrq) {
+ free_irq(pdrvctl->iIrq, pdrvctl);
+ pdrvctl->iIrq = 0;
+ }
+ if (pdrvctl->ilowIrq) {
+ free_irq(pdrvctl->ilowIrq, pdrvctl);
+ pdrvctl->ilowIrq = 0;
+ }
+ se_ChipRelease(pdrvctl);
+ kfree(pdrvctl);
+ g_psechipDrvCtrl = NULL;
+ }
+ return iRes;
+}
+
+static void wst_clear(void)
+{
+ SECHIPDRV_CTRL *pdrvctl = NULL;
+
+ pdrvctl = g_psechipDrvCtrl;
+ if (pdrvctl) {
+ if (pdrvctl->iIrq) {
+ free_irq(pdrvctl->iIrq, pdrvctl);
+ pdrvctl->iIrq = 0;
+ }
+ if (pdrvctl->ilowIrq) {
+ free_irq(pdrvctl->ilowIrq, pdrvctl);
+ pdrvctl->ilowIrq = 0;
+ }
+ se_ChipRelease(pdrvctl);
+ kfree(pdrvctl);
+ g_psechipDrvCtrl = NULL;
+ }
+}
+static void globalmem_do_send_op(struct work_struct *p)
+{
+ SE_BASIC_BD *pCurBD;
+ unsigned int ulCurrWritePtr, ulWritePtr;
+ unsigned short len = 0;
+ unsigned long ulCurrAddrInput = 0, ulCurrAddrOutput = 0;
+ SECHIPDRV_CTRL *pdrvctl;
+ unsigned char *pInPtr;
+ unsigned short usInlen;
+ unsigned char *pOutPtr;
+ unsigned short *pusOutlen;
+ int iChannel;
+ unsigned char ucFlag;
+ unsigned char ucOpCode;
+ unsigned char *pucRetCode;
+ PSECallBackfn pcallback;
+ void *pParma;
+ int iKernel;
+ struct completion *mycomplete;
+ SEND_PACKAGE *psendpackage;
+ unsigned long ulflag;
+ unsigned long ultimeout;
+ int rv = 0;
+
+ while (1) {
+PROG:
+ spin_lock_irq(&g_sendlistlock);
+ psendpackage = (SEND_PACKAGE *)wst_Popfront_Que(&g_SendQueueContainer);
+ if (!psendpackage) {
+ spin_unlock_irq(&g_sendlistlock);
+ return;
+ }
+ spin_unlock_irq(&g_sendlistlock);
+ pdrvctl = psendpackage->pdrvctl;
+ pInPtr = psendpackage->pInPtr;
+ usInlen = psendpackage->usInlen;
+ pOutPtr = psendpackage->pOutPtr;
+ pusOutlen = psendpackage->pusOutlen;
+ iChannel = psendpackage->iChannel;
+ ucFlag = psendpackage->ucFlag;
+ ucOpCode = psendpackage->ucOpCode;
+ pucRetCode = psendpackage->pucRetCode;
+ pcallback = psendpackage->pcallback;
+ pParma = psendpackage->pParma;
+ iKernel = psendpackage->iKernel;
+ mycomplete = psendpackage->mycomplete;
+ ultimeout = psendpackage->ulendtime;
+ kfree(psendpackage);
+
+ if (iKernel == 0) {
+ while (time_before(jiffies, ultimeout)) {
+#ifdef CONFIG_MIPS
+ if ((pdrvctl->ulCurrBdReadPtr[iChannel] == ((pdrvctl->ulCurrBdWritePtr[iChannel] + 1) & (SE_BDQUEUE_LEN-1)))
+ || ((atomic_read(&g_sendtotallen) + *pusOutlen + SE_FILL_LEN) > SE_MAX_SEND_LEN))
+#else
+ if (pdrvctl->ulCurrBdReadPtr[iChannel] == ((pdrvctl->ulCurrBdWritePtr[iChannel] + 1) & (SE_BDQUEUE_LEN-1)))
+#endif
+ {
+ down_timeout(&(pdrvctl->sema), 1*HZ);
+ rv = WST_SE_ERROR_FULL;
+ } else {
+ rv = 0;
+ break;
+ }
+ }
+ if (rv != 0x0) {
+ *pucRetCode = WST_SE_ERROR_FULL;
+ complete(mycomplete);
+ goto PROG;
+ }
+ } else {
+ ultimeout = jiffies+1*HZ;
+ while (time_before(jiffies, ultimeout)) {
+#ifdef CONFIG_MIPS
+ if ((pdrvctl->ulCurrBdReadPtr[iChannel] == ((pdrvctl->ulCurrBdWritePtr[iChannel] + 1) & (SE_BDQUEUE_LEN-1)))
+ || ((atomic_read(&g_sendtotallen) + *pusOutlen + SE_FILL_LEN) > SE_MAX_SEND_LEN))
+#else
+ if (pdrvctl->ulCurrBdReadPtr[iChannel] == ((pdrvctl->ulCurrBdWritePtr[iChannel] + 1) & (SE_BDQUEUE_LEN-1)))
+#endif
+ {
+ rv = WST_SE_ERROR_FULL;
+ } else {
+ rv = 0;
+ break;
+ }
+ }
+ if (rv != 0x0) {
+ *pucRetCode = WST_SE_ERROR_FULL;
+ if (pcallback)
+ pcallback(pParma);
+ goto PROG;
+ }
+ }
+ ulCurrWritePtr = pdrvctl->ulCurrBdWritePtr[iChannel];
+ ulWritePtr = (ulCurrWritePtr + 1) & (SE_BDQUEUE_LEN-1);
+
+ pCurBD = &((SE_BASIC_BD *)(pdrvctl->ulBDMemBase[iChannel]))[ulCurrWritePtr];
+ memset(pCurBD, 0x0, sizeof(SE_BASIC_BD));
+ if (pcallback != NULL) {
+ (pdrvctl->pcallback)[iChannel][ulCurrWritePtr] = pcallback;
+ pdrvctl->pParma[iChannel][ulCurrWritePtr] = pParma;
+ } else {
+ (pdrvctl->pcallback)[iChannel][ulCurrWritePtr] = NULL;
+ pdrvctl->pParma[iChannel][ulCurrWritePtr] = NULL;
+ }
+
+ pdrvctl->ikernel[iChannel][ulCurrWritePtr] = iKernel;
+ pdrvctl->stsemphore[iChannel][ulCurrWritePtr] = mycomplete;
+
+ if (pInPtr == pOutPtr) {
+ if (pOutPtr) {
+ len = usInlen >= *pusOutlen ? usInlen : *pusOutlen;
+ if (len) {
+ ulCurrAddrOutput = dma_map_single(pdrvctl->pdev, pOutPtr, len, DMA_BIDIRECTIONAL);
+ if (ulCurrAddrOutput == 0) {
+ TRACEERR("map ulCurrAddrOutput error\n");
+ *pucRetCode = WST_SE_FAILURE;
+ if (iKernel == 0) {
+ complete(mycomplete);
+ } else {
+ *pucRetCode = WST_SE_FAILURE;
+ if (pcallback)
+ pcallback(pParma);
+ }
+ goto PROG;
+ }
+ pCurBD->ulOutputLPtr = LOULONG(ulCurrAddrOutput);
+ pCurBD->ulOutputHPtr = HIULONG(ulCurrAddrOutput);
+ pCurBD->ulInputLPtr = pCurBD->ulOutputLPtr;
+ pCurBD->ulInputHPtr = pCurBD->ulOutputHPtr;
+ }
+ }
+ } else {
+ if (pOutPtr && (*pusOutlen)) {
+ ulCurrAddrOutput = dma_map_single(pdrvctl->pdev, pOutPtr, *pusOutlen, DMA_FROM_DEVICE);
+ if (ulCurrAddrOutput == 0) {
+ TRACEERR("map ulCurrAddrOutput error\n");
+ *pucRetCode = WST_SE_FAILURE;
+ if (iKernel == 0) {
+ complete(mycomplete);
+ } else {
+ *pucRetCode = WST_SE_FAILURE;
+ if (pcallback)
+ pcallback(pParma);
+ }
+ goto PROG;
+ }
+ pCurBD->ulOutputLPtr = LOULONG(ulCurrAddrOutput);
+ pCurBD->ulOutputHPtr = HIULONG(ulCurrAddrOutput);
+ }
+ if (usInlen && pInPtr) {
+ ulCurrAddrInput = dma_map_single(pdrvctl->pdev, pInPtr, usInlen, DMA_TO_DEVICE);
+ if (ulCurrAddrInput == 0) {
+ if (ulCurrAddrOutput) {
+ dma_unmap_single(pdrvctl->pdev, ulCurrAddrOutput, *pusOutlen, DMA_FROM_DEVICE);
+ pCurBD->ulOutputLPtr = 0;
+ pCurBD->ulOutputHPtr = 0;
+ }
+ *pucRetCode = WST_SE_FAILURE;
+ if (iKernel == 0) {
+ complete(mycomplete);
+ } else {
+ *pucRetCode = WST_SE_FAILURE;
+ if (pcallback)
+ pcallback(pParma);
+ }
+ goto PROG;
+ }
+ pCurBD->ulInputLPtr = LOULONG(ulCurrAddrInput);
+ pCurBD->ulInputHPtr = HIULONG(ulCurrAddrInput);
+ }
+ }
+ pCurBD->ucOpCode = ucOpCode & 0x0f;
+ pCurBD->ucFlag = ucFlag & 0x7;
+ pCurBD->usInputLength = usInlen;
+ if (pusOutlen)
+ pCurBD->usOutputLength = *pusOutlen;
+
+ pCurBD->ucRetCode = 0x0f;
+
+ pdrvctl->pusOutlen[iChannel][ulCurrWritePtr] = pusOutlen;
+ pdrvctl->usInlen[iChannel][ulCurrWritePtr] = usInlen&0xffff;
+ if (ulCurrAddrOutput)
+ pdrvctl->ulOutputPtr[iChannel][ulCurrWritePtr] = (unsigned long *)ulCurrAddrOutput;
+ else
+ pdrvctl->ulOutputPtr[iChannel][ulCurrWritePtr] = 0;
+ if (ulCurrAddrInput)
+ pdrvctl->ulInputPtr[iChannel][ulCurrWritePtr] = (unsigned long *)ulCurrAddrInput;
+ else
+ pdrvctl->ulInputPtr[iChannel][ulCurrWritePtr] = 0;
+ pdrvctl->pucRetCode[iChannel][ulCurrWritePtr] = pucRetCode;
+
+#ifdef CONFIG_MIPS
+ atomic_add((*(pdrvctl->pusOutlen[iChannel][ulCurrWritePtr]) + SE_FILL_LEN), &g_sendtotallen);
+#endif
+ write_lock_irqsave(&(pdrvctl->mr_lock), ulflag);
+ if (iChannel == 0)
+ HandleWrite32(pdrvctl, SE_REG_BQWP0, ulWritePtr);
+ else
+ HandleWrite32(pdrvctl, SE_REG_BQWP1, ulWritePtr);
+ write_unlock_irqrestore(&(pdrvctl->mr_lock), ulflag);
+ pdrvctl->ulCurrBdWritePtr[iChannel] = ulWritePtr;
+ }
+}
+
+static int se_hardtrans(
+ SECHIPDRV_CTRL *pdrvctl,
+ unsigned char *pInPtr,
+ unsigned short usInlen,
+ unsigned char *pOutPtr,
+ unsigned short *pusOutlen,
+ int iChannel,
+ unsigned char ucFlag,
+ unsigned char ucOpCode,
+ unsigned char *pucRetCode,
+ PSECallBackfn pcallback,
+ void *pParma,
+ int iKernel,
+ struct completion *mycomplete
+ )
+{
+ SEND_PACKAGE *psendpackage;
+ gfp_t gfp_flag;
+
+ if (in_interrupt())
+ gfp_flag = GFP_ATOMIC;
+ else
+ gfp_flag = GFP_KERNEL;
+ if (g_suspend == 1)
+ return WST_SE_FAILURE;
+ psendpackage = kmalloc(sizeof(SEND_PACKAGE), gfp_flag);
+ if (psendpackage == NULL)
+ return -1;
+
+ psendpackage->pdrvctl = pdrvctl;
+ psendpackage->pInPtr = pInPtr;
+ psendpackage->usInlen = usInlen;
+ psendpackage->pOutPtr = pOutPtr;
+ psendpackage->pusOutlen = pusOutlen;
+ psendpackage->iChannel = iChannel;
+ psendpackage->ucFlag = ucFlag;
+ psendpackage->ucOpCode = ucOpCode;
+ psendpackage->pucRetCode = pucRetCode;
+ psendpackage->pcallback = pcallback;
+ psendpackage->pParma = pParma;
+ psendpackage->iKernel = iKernel;
+ psendpackage->mycomplete = mycomplete;
+ psendpackage->ulendtime = jiffies+30*HZ;
+ spin_lock_irq(&g_sendlistlock);
+ if (wst_Pushback_Que(&g_SendQueueContainer, psendpackage) == -1) {
+ spin_unlock_irq(&g_sendlistlock);
+ kfree(psendpackage);
+ return WST_SE_ERROR_FULL;
+ }
+ spin_unlock_irq(&g_sendlistlock);
+ queue_work(g_worksendqueue, &g_sendwork);
+ return 0;
+}
+
+static irqreturn_t wst_low_channel_status(int irq, void *p)
+{
+ SECHIPDRV_CTRL *pdrvctl = (SECHIPDRV_CTRL *)p;
+ int64_t ulIntStat = 0;
+ unsigned long ulflag;
+
+ read_lock_irqsave(&(pdrvctl->mr_lock), ulflag);
+ HandleRead64(pdrvctl, SE_LOWREG_STS, &ulIntStat);
+ if (ulIntStat == 2) {
+ HandleWrite64(pdrvctl, SE_LOWINT_CLEAR, 2);
+ up(&g_lowirqsema);
+ }
+ read_unlock_irqrestore(&(pdrvctl->mr_lock), ulflag);
+
+ return IRQ_HANDLED;
+}
+
+static int se_useropen(struct inode *inode, struct file *file)
+{
+ if (MINOR(inode->i_rdev) != 0)
+ return -ENODEV;
+
+ return SE_OK;
+}
+
+static ssize_t wst_low_channel_userwrite_op(
+ SECHIPDRV_CTRL *pdrvctl,
+ SWCommuData *UserCommuData,
+ int iskernel
+ )
+{
+ unsigned long long addr = 0, outaddr = 0;
+ int ilen;
+ int count = SE_OK;
+ unsigned long long ulsendlen;
+ unsigned char *m_pCacheInBuf;
+ unsigned char *m_pCacheOutBuf;
+ unsigned long ulflag;
+
+ if ((g_pCacheInBuf == NULL) || (g_pCacheOutBuf == NULL))
+ return -EFAULT;
+
+ m_pCacheInBuf = (unsigned char *)bytes_align(0, (unsigned long)g_pCacheInBuf);
+ m_pCacheOutBuf = (unsigned char *)bytes_align(0, (unsigned long)g_pCacheOutBuf);
+ if (iskernel == 0) {
+ if (wst_cpyusrbuf((void *)(UserCommuData->pucInbuf), (void *)m_pCacheInBuf, UserCommuData->usInputLen, READUBUF)) {
+ TRACEERR("copy user data error\n");
+ return -EFAULT;
+ }
+ } else
+
+ memcpy((void *)m_pCacheInBuf, (void *)(UserCommuData->pucInbuf), UserCommuData->usInputLen);
+ ilen = UserCommuData->usInputLen >= UserCommuData->usOutputLen ? UserCommuData->usInputLen:UserCommuData->usOutputLen;
+ addr = dma_map_single(pdrvctl->pdev, m_pCacheInBuf, ilen, DMA_TO_DEVICE);
+ if (addr == 0) {
+ TRACEERR("transfer buffer is err\n");
+ return -EFAULT;
+ }
+ outaddr = dma_map_single(pdrvctl->pdev, m_pCacheOutBuf, ilen, DMA_FROM_DEVICE);
+ if (outaddr == 0) {
+ TRACEERR("transfer buffer is err\n");
+ dma_unmap_single(pdrvctl->pdev, addr, ilen, DMA_TO_DEVICE);
+ return -EFAULT;
+ }
+ ulsendlen = (UserCommuData->usInputLen/8);
+ ulsendlen = (ulsendlen & 0x00000000ffffffff) << 32;
+ write_lock_irqsave(&(pdrvctl->mr_lock), ulflag);
+ HandleWrite64(pdrvctl, SE_WRITE_REG1, ulsendlen);
+ HandleWrite64(pdrvctl, SE_WRITE_REG2, addr);
+ HandleWrite64(pdrvctl, SE_WRITE_REG3, outaddr);
+ write_unlock_irqrestore(&(pdrvctl->mr_lock), ulflag);
+ if (g_iUseIntr != 0) {
+ if (down_interruptible(&g_lowirqsema) == -EINTR) {
+ count = -EINTR;
+ goto EXIT;
+ }
+ } else {
+ unsigned long start_jiffies = 0, end_jiffies = 0;
+ int64_t ulIntStat = 0;
+
+ start_jiffies = jiffies;
+ end_jiffies = jiffies;
+ while (1) {
+ write_lock_irqsave(&(pdrvctl->mr_lock), ulflag);
+ HandleRead64(pdrvctl, SE_LOWREG_SR, &ulIntStat);
+ end_jiffies = jiffies;
+ if (ulIntStat == 1) {
+ HandleWrite64(pdrvctl, SE_LOWREG_SR, 0);
+ write_unlock_irqrestore(&(pdrvctl->mr_lock), ulflag);
+ break;
+ }
+ write_unlock_irqrestore(&(pdrvctl->mr_lock), ulflag);
+ if (jiffies_to_msecs(end_jiffies-start_jiffies)/1000 >= 90) {
+ count = -EFAULT;
+ goto EXIT;
+ }
+ }
+ }
+ dma_unmap_single(pdrvctl->pdev, addr, ilen, DMA_TO_DEVICE);
+ dma_unmap_single(pdrvctl->pdev, outaddr, ilen, DMA_FROM_DEVICE);
+ if (UserCommuData->usOutputLen) {
+ if (iskernel == 0) {
+ if (wst_cpyusrbuf(UserCommuData->pucOutbuf, m_pCacheOutBuf, UserCommuData->usOutputLen, WRITEUBUF))
+ return -EFAULT;
+ } else
+ memcpy(UserCommuData->pucOutbuf, m_pCacheOutBuf, UserCommuData->usOutputLen);
+ }
+ return count;
+EXIT:
+ dma_unmap_single(pdrvctl->pdev, addr, ilen, DMA_TO_DEVICE);
+ dma_unmap_single(pdrvctl->pdev, outaddr, ilen, DMA_FROM_DEVICE);
+ return count;
+}
+
+static ssize_t se_userwrite(struct file *file, const char *buf, size_t count, loff_t *ppos)
+{
+ unsigned char *pCacheBuf = NULL, *pCacheOutBuf = NULL, *pCacheBufalign = NULL, *pCacheOutBufalign = NULL;
+ SECHIPDRV_CTRL *pdrvctl = NULL;
+ SWCommuData *pCommuData = NULL;
+ int iCommuDatalen = 0;
+ int pucRetCode = 0;
+ unsigned short iChannel = 0;
+ unsigned char ucFlag = 0, ucOpCode = 0;
+ int *ppucRetCode;
+ struct completion mycomplete;
+ struct tag_dma_buf_ctl *pbufinctl = NULL;
+ int iret = 0;
+
+ if (count == 0) {
+ TRACEERR("count=0\n");
+ return SE_OK;
+ }
+
+ if (MINOR(file->f_path.dentry->d_inode->i_rdev) != 0)
+ return -ENODEV;
+
+ iCommuDatalen = sizeof(SWCommuData);
+ if (count != iCommuDatalen)
+ return -EINVAL;
+
+ pdrvctl = g_psechipDrvCtrl;
+ pCommuData = kmalloc(iCommuDatalen, GFP_KERNEL);
+ if (!pCommuData) {
+ TRACEERR("pCommuData NULL\n");
+ return -ENOMEM;
+ }
+ if (wst_cpyusrbuf((void *)buf, (void *)pCommuData, iCommuDatalen, READUBUF)) {
+ TRACEERR("copy user data error\n");
+ count = -EFAULT;
+ goto EXIT;
+ }
+ switch ((pCommuData->usFlags)&0x000f) {
+ case WST_GO_CHANNEL2:
+ if ((pCommuData->usInputLen > DMA_BUFSIZE) || (pCommuData->usOutputLen > DMA_BUFSIZE)) {
+ TRACEERR("len is error\n");
+ count = -EINVAL;
+ goto EXIT;
+ }
+ if (down_interruptible(&g_lowsema) == -EINTR) {
+ count = -EINTR;
+ goto EXIT;
+ }
+ count = wst_low_channel_userwrite_op(pdrvctl, pCommuData, 0);
+ up(&g_lowsema);
+ goto EXIT;
+ case WST_GO_CHANNEL0:
+ if (pCommuData->usInputLen == 0) {
+ count = -EINVAL;
+ goto EXIT;
+ }
+ if (pCommuData->usInputLen != 0) {
+ if (pCommuData->usInputLen > DMA_BUFSIZE) {
+ count = -EINVAL;
+ goto EXIT;
+ }
+ ucFlag = INPUT_VALID;
+ if (pCommuData->usOutputLen)
+ ucFlag |= OUTPUT_VALID;
+ }
+
+ iChannel = 0;
+ ucOpCode = 0x0;
+ break;
+ case WST_GO_CHANNEL1:
+ if (pCommuData->usInputLen == 0) {
+ count = -EINVAL;
+ goto EXIT;
+ }
+ if (pCommuData->usInputLen != 0) {
+ if (pCommuData->usInputLen > DMA_BUFSIZE) {
+ count = -EINVAL;
+ goto EXIT;
+ }
+ ucFlag = INPUT_VALID;
+ if (pCommuData->usOutputLen)
+ ucFlag |= OUTPUT_VALID;
+ }
+ iChannel = 1;
+ ucOpCode = 0x0;
+ break;
+ default:
+ {
+ count = -EINVAL;
+ goto EXIT;
+ }
+ }
+ pbufinctl = se_get_dma_buf(0);
+ if (pbufinctl == NULL) {
+ TRACEERR("kmalloc pCacheBuf error\n");
+ count = -ENOMEM;
+ goto EXIT;
+ }
+ pCacheBuf = pbufinctl->pDmaBuf;
+ pCacheBufalign = pCacheBuf;
+
+ if (wst_cpyusrbuf((void *)(pCommuData->pucInbuf), (void *)pCacheBufalign,
+ pCommuData->usInputLen, READUBUF)) {
+ TRACEERR("cpyuserbuf pCacheBufalign error\n");
+ count = -ENOMEM;
+ goto EXIT;
+ }
+
+ pCacheOutBuf = pbufinctl->pDmaBuf;
+ pCacheOutBufalign = pCacheOutBuf;
+
+ ppucRetCode = &pucRetCode;
+
+ count = SE_OK;
+ init_completion(&mycomplete);
+ iret = se_hardtrans(
+ pdrvctl,
+ pCacheBufalign,
+ pCommuData->usInputLen,
+ pCacheOutBufalign,
+ &(pCommuData->usOutputLen),
+ iChannel,
+ ucFlag,
+ ucOpCode,
+ (unsigned char *)ppucRetCode,
+ 0,
+ 0,
+ 0,
+ &mycomplete
+ );
+ if (iret == -1) {
+ count = -EIO;
+ goto EXIT;
+ }
+ if (!wait_for_completion_timeout(&mycomplete, msecs_to_jiffies(60*1000))) {
+ count = -EFAULT;
+ goto EXIT;
+ }
+ if (pucRetCode != SE_OK) {
+ count = -(SE_BASEERR+pucRetCode);
+ goto EXIT;
+ }
+
+ if (pCommuData->pucOutbuf) {
+ if (wst_cpyusrbuf(pCommuData->pucOutbuf, pCacheOutBufalign,
+ pCommuData->usOutputLen, WRITEUBUF)) {
+ count = -EFAULT;
+ goto EXIT;
+ }
+ }
+EXIT:
+ if (pbufinctl)
+ se_free_dma_buf(pbufinctl);
+ kfree(pCommuData);
+ return count;
+}
+static void globalmem_do_rec_op(struct work_struct *p)
+{
+ INT_MESSAGE *intmessage;
+ unsigned long ulflags1;
+
+ while (1) {
+ spin_lock_irqsave(&g_reclistlock, ulflags1);
+ intmessage = (INT_MESSAGE *)wst_Popfront_Que(&g_RecQueueContainer);
+ spin_unlock_irqrestore(&g_reclistlock, ulflags1);
+ if (!intmessage)
+ return;
+ intmessage->pcallback(intmessage->pParma);
+ kfree(intmessage);
+ }
+}
+static irqreturn_t se_interrupt(int irq, void *p)
+{
+ SECHIPDRV_CTRL *pdrvctl;
+ SE_BASIC_BD *pCurBD;
+ unsigned int ulCurrReadPtr, ulReadPtr;
+ int iChannel;
+ int len = 0;
+ int i;
+ unsigned char ucMyRetCode = 0;
+ unsigned long ulIntStat;
+ int istatus[2] = {1, 2};
+ unsigned long ulflags;
+
+ pdrvctl = (SECHIPDRV_CTRL *)p;
+ if (!pdrvctl)
+ return IRQ_HANDLED;
+
+ read_lock_irqsave(&(pdrvctl->mr_lock), ulflags);
+ HandleRead32(pdrvctl, SE_REG_STS, &ulIntStat);
+ read_unlock_irqrestore(&(pdrvctl->mr_lock), ulflags);
+ if ((!(ulIntStat & INT_STAT_DMA_MASK)) || (ulIntStat == 0xffffffff))
+ return IRQ_HANDLED;
+
+ for (i = 0; i <= 1; i++) {
+ if (ulIntStat & istatus[i]) {
+ if (i == 0) {
+ read_lock_irqsave(&(pdrvctl->mr_lock), ulflags);
+ HandleWrite32(pdrvctl, SE_INT_CLR, 1);
+ HandleRead32(pdrvctl, SE_REG_RQRP0, &ulReadPtr);
+ read_unlock_irqrestore(&(pdrvctl->mr_lock), ulflags);
+ iChannel = 0;
+ } else {
+ read_lock_irqsave(&(pdrvctl->mr_lock), ulflags);
+ HandleWrite32(pdrvctl, SE_INT_CLR, 2);
+ HandleRead32(pdrvctl, SE_REG_RQRP1, &ulReadPtr);
+ read_unlock_irqrestore(&(pdrvctl->mr_lock), ulflags);
+ iChannel = 1;
+ }
+ } else
+ continue;
+ ulCurrReadPtr = pdrvctl->ulCurrReadPtr[iChannel];
+ while (1) {
+ if (ulCurrReadPtr != ulReadPtr) {
+ pCurBD = &((SE_BASIC_BD *)(pdrvctl->ulBDMemBase[iChannel]))[ulCurrReadPtr];
+ if ((pCurBD->ucRetCode == 0x0f) || ((pCurBD->ucFlag & 0x8) != 0x8)) {
+ continue;
+ } else {
+ if (pdrvctl->ulInputPtr[iChannel][ulCurrReadPtr] == pdrvctl->ulOutputPtr[iChannel][ulCurrReadPtr]) {
+ if (pdrvctl->ulOutputPtr[iChannel][ulCurrReadPtr]) {
+ len = (*(pdrvctl->pusOutlen[iChannel][ulCurrReadPtr])) >= pdrvctl->usInlen[iChannel][ulCurrReadPtr] ?
+ (*(pdrvctl->pusOutlen[iChannel][ulCurrReadPtr])):pdrvctl->usInlen[iChannel][ulCurrReadPtr];
+ dma_unmap_single(
+ pdrvctl->pdev,
+ (unsigned long)(pdrvctl->ulOutputPtr[iChannel][ulCurrReadPtr]),
+ len,
+ DMA_BIDIRECTIONAL
+ );
+ pCurBD->ulOutputLPtr = 0;
+ pCurBD->ulOutputHPtr = 0;
+ pCurBD->ulInputHPtr = 0;
+ pCurBD->ulInputLPtr = 0;
+ pdrvctl->ulOutputPtr[iChannel][ulCurrReadPtr] = 0;
+ }
+ } else {
+ if (pdrvctl->ulOutputPtr[iChannel][ulCurrReadPtr]) {
+ dma_unmap_single(
+ pdrvctl->pdev,
+ (unsigned long)(pdrvctl->ulOutputPtr[iChannel][ulCurrReadPtr]),
+ *(pdrvctl->pusOutlen[iChannel][ulCurrReadPtr]), DMA_FROM_DEVICE
+ );
+ smp_wmb();
+ pdrvctl->ulOutputPtr[iChannel][ulCurrReadPtr] = 0;
+ }
+ if (pdrvctl->ulInputPtr[iChannel][ulCurrReadPtr]) {
+ dma_unmap_single(
+ pdrvctl->pdev,
+ (unsigned long)(pdrvctl->ulInputPtr[iChannel][ulCurrReadPtr]),
+ pdrvctl->usInlen[iChannel][ulCurrReadPtr],
+ DMA_TO_DEVICE
+ );
+ pdrvctl->ulInputPtr[iChannel][ulCurrReadPtr] = 0;
+ }
+ }
+ ucMyRetCode = pCurBD->ucRetCode;
+ memcpy(pdrvctl->pucRetCode[iChannel][ulCurrReadPtr], &ucMyRetCode, 1);
+ if (pCurBD->ucRetCode != SE_OK)
+ pr_info("\nstatus %x\n", pCurBD->ucRetCode);
+#ifdef CONFIG_MIPS
+ atomic_sub(((*(pdrvctl->pusOutlen[iChannel][ulCurrReadPtr])) + SE_FILL_LEN), &g_sendtotallen);
+#endif
+ if ((pdrvctl->ikernel)[iChannel][ulCurrReadPtr] != 0) {
+ if (pdrvctl->pcallback[iChannel][ulCurrReadPtr]) {
+ INT_MESSAGE *intmessage = NULL;
+ unsigned long ulflags1;
+
+ intmessage = (INT_MESSAGE *)kmalloc(sizeof(INT_MESSAGE), GFP_ATOMIC);
+ if (!intmessage)
+ return IRQ_HANDLED;
+ intmessage->pcallback = pdrvctl->pcallback[iChannel][ulCurrReadPtr];
+ intmessage->pParma = pdrvctl->pParma[iChannel][ulCurrReadPtr];
+ spin_lock_irqsave(&g_reclistlock, ulflags1);
+ wst_Pushback_Que(&g_RecQueueContainer, intmessage);
+ spin_unlock_irqrestore(&g_reclistlock, ulflags1);
+ queue_work(g_workrecqueue, &g_recwork);
+ }
+ } else {
+ complete(pdrvctl->stsemphore[iChannel][ulCurrReadPtr]);
+ }
+ ulCurrReadPtr = ((ulCurrReadPtr + 1)&(SE_BDQUEUE_LEN - 1));
+ pdrvctl->ulCurrReadPtr[iChannel] = ulCurrReadPtr;
+ pdrvctl->ulCurrBdReadPtr[iChannel] = ulCurrReadPtr;
+ if (pdrvctl->sema.count <= 0)
+ up(&(pdrvctl->sema));
+ }
+ } else
+
+ break;
+ }
+ }
+ return IRQ_HANDLED;
+}
+
+static int se_userrelease(struct inode *inode, struct file *file)
+{
+ return SE_OK;
+}
+
+ssize_t se_kernelwrite(
+ unsigned char *pInPtr,
+ unsigned short usInlen,
+ unsigned char *pOutPtr,
+ unsigned short *pusOutlen,
+ unsigned char ucFlag,
+ unsigned char *pucRetCode,
+ PSECallBackfn pcallback,
+ void *pParma
+ )
+{
+ int iret;
+ SECHIPDRV_CTRL *pdrvctl;
+ int iChannel;
+ unsigned char ucOpCode;
+ SWCommuData CommuData;
+
+ pdrvctl = g_psechipDrvCtrl;
+
+ switch (ucFlag) {
+ case WST_GO_CHANNEL2:
+ {
+ CommuData.pucInbuf = pInPtr;
+ CommuData.pucOutbuf = pOutPtr;
+ CommuData.usFlags = 0;
+ CommuData.usInputLen = usInlen;
+ CommuData.usOutputLen = *pusOutlen;
+ CommuData.usReserve = 0;
+ if (down_interruptible(&g_lowsema) == -EINTR)
+ return -EINTR;
+ iret = wst_low_channel_userwrite_op(pdrvctl, &CommuData, 1);
+ up(&g_lowsema);
+ return iret;
+ }
+ case WST_GO_CHANNEL0:
+ if (pcallback == NULL)
+ return WST_SE_PARAM_ERROR;
+ if (usInlen == 0)
+ return -EINVAL;
+ ucFlag = 0;
+ if (usInlen != 0) {
+ if (usInlen > DMA_BUFSIZE)
+ return -EINVAL;
+ ucFlag = INPUT_VALID;
+ if (*pusOutlen)
+ ucFlag |= OUTPUT_VALID;
+ }
+ iChannel = 0;
+ ucOpCode = 0x0;
+ break;
+ case WST_GO_CHANNEL1:
+ if (pcallback == NULL)
+ return WST_SE_PARAM_ERROR;
+ if (usInlen == 0) {
+ return -EINVAL;
+ }
+ ucFlag = 0;
+ if (usInlen != 0) {
+ if (usInlen > DMA_BUFSIZE)
+ return -EINVAL;
+ ucFlag = INPUT_VALID;
+ if (*pusOutlen)
+ ucFlag |= OUTPUT_VALID;
+ }
+ iChannel = 1;
+ ucOpCode = 0x0;
+ break;
+ default:
+ return -EINVAL;
+ }
+ iret = se_hardtrans(
+ pdrvctl,
+ pInPtr,
+ usInlen,
+ pOutPtr,
+ pusOutlen,
+ iChannel,
+ ucFlag,
+ ucOpCode,
+ pucRetCode,
+ pcallback,
+ pParma,
+ 1,
+ NULL
+ );
+ if (iret == -1)
+ return -EIO;
+
+ return SE_OK;
+}
+EXPORT_SYMBOL(se_kernelwrite);
+
+static long se_userioctl(struct file *filp, u_int cmd, u_long arg)
+{
+ long iret = SE_OK;
+ SECHIPDRV_CTRL *pdrvctl = g_psechipDrvCtrl;
+ unsigned long ulvalue;
+
+ HandleRead64(pdrvctl, 0x120, &ulvalue);
+ pr_info("read reg value is 0x%lx in offset 120\n", ulvalue);
+ HandleRead64(pdrvctl, 0x118, &ulvalue);
+ pr_info("read reg value is 0x%lx in offset 118\n", ulvalue);
+
+ return iret;
+}
+
+
+static const struct file_operations SE_fops = {
+ .owner = THIS_MODULE,
+ .write = se_userwrite,
+ .open = se_useropen,
+ .release = se_userrelease,
+ .unlocked_ioctl = se_userioctl,
+ .compat_ioctl = se_userioctl
+};
+
+int se_chip_load(void)
+{
+ int iRes = SE_OK;
+
+ if (g_isechip_Major >= 0)
+ return WST_SE_HAS_OPEN;
+ g_psechipDrvCtrl = NULL;
+ iRes = se_init_dma_buf(DMA_BUFSIZE, CTL_DMABUFNUM);
+ if (iRes != SE_OK)
+ return WST_SE_ERROR_MALLOC;
+ iRes = register_chrdev(0, CRYNAME, &SE_fops);
+ if (iRes < 0)
+ goto EXIT;
+
+ g_isechip_Major = iRes;
+ iRes = 0;
+ g_psecclass = class_create(CRYNAME);
+ if (IS_ERR(g_psecclass)) {
+ iRes = PTR_ERR(g_psecclass);
+ goto EXIT;
+ }
+ g_psecdev = device_create(g_psecclass, NULL, MKDEV(g_isechip_Major, 0), NULL, CRYNAME);
+ if (IS_ERR(g_psecdev)) {
+ iRes = PTR_ERR(g_psecdev);
+ goto EXIT;
+ }
+ iRes = wst_init();
+ if (iRes != SE_OK)
+ goto EXIT;
+
+ sema_init(&g_lowsema, 1);
+ sema_init(&g_lowirqsema, 0);
+ atomic_set(&g_sendtotallen, 0);
+ g_pCacheInBuf = (unsigned char *)__get_free_page(GFP_DMA);
+ if (IS_ERR(g_pCacheInBuf)) {
+ iRes = PTR_ERR(g_pCacheInBuf);
+ goto EXIT;
+ }
+ g_pCacheOutBuf = (unsigned char *)__get_free_page(GFP_DMA);
+ if (IS_ERR(g_pCacheOutBuf)) {
+ iRes = PTR_ERR(g_pCacheOutBuf);
+ goto EXIT;
+ }
+
+ g_worksendqueue = alloc_workqueue("seworksendqueue",
+ WQ_MEM_RECLAIM|__WQ_ORDERED|WQ_UNBOUND, 1);
+ if (IS_ERR(g_worksendqueue)) {
+ iRes = PTR_ERR(g_worksendqueue);
+ goto EXIT;
+ }
+ g_workrecqueue = alloc_workqueue("seworkrecqueue", WQ_MEM_RECLAIM|__WQ_ORDERED, 0);
+ if (IS_ERR(g_workrecqueue)) {
+ iRes = PTR_ERR(g_workrecqueue);
+ goto EXIT;
+ }
+ INIT_WORK(&g_recwork, globalmem_do_rec_op);
+ INIT_WORK(&g_sendwork, globalmem_do_send_op);
+ pr_info("this driver version is %s\n", DRIVER_VERSION);
+
+ return SE_OK;
+EXIT:
+ se_del_dma_buf();
+ if (g_pCacheInBuf) {
+
+ free_page((unsigned long)g_pCacheInBuf);
+ g_pCacheInBuf = NULL;
+ }
+ if (g_pCacheOutBuf) {
+
+ free_page((unsigned long)g_pCacheOutBuf);
+ g_pCacheOutBuf = NULL;
+ }
+ if (g_worksendqueue) {
+ destroy_workqueue(g_worksendqueue);
+ g_worksendqueue = NULL;
+ }
+ if (g_workrecqueue) {
+ destroy_workqueue(g_workrecqueue);
+ g_workrecqueue = NULL;
+ }
+ wst_clear();
+ if (g_psecdev) {
+ device_unregister(g_psecdev);
+ g_psecdev = NULL;
+ }
+ if (g_psecclass) {
+ class_destroy(g_psecclass);
+ g_psecclass = NULL;
+ }
+ if (g_isechip_Major >= 0) {
+ unregister_chrdev(g_isechip_Major, CRYNAME);
+ g_isechip_Major = -1;
+ }
+ return iRes;
+}
+
+void se_chip_unload(void)
+{
+ SECHIPDRV_CTRL *pdrvctl = NULL;
+
+ pdrvctl = g_psechipDrvCtrl;
+
+ up(&pdrvctl->sema);
+ if (g_pCacheInBuf) {
+
+ free_page((unsigned long)g_pCacheInBuf);
+ g_pCacheInBuf = NULL;
+ }
+ if (g_pCacheOutBuf) {
+
+ free_page((unsigned long)g_pCacheOutBuf);
+ g_pCacheOutBuf = NULL;
+ }
+ if (g_worksendqueue) {
+ cancel_work_sync(&g_sendwork);
+ destroy_workqueue(g_worksendqueue);
+ g_worksendqueue = NULL;
+ }
+ if (g_workrecqueue) {
+ cancel_work_sync(&g_recwork);
+ destroy_workqueue(g_workrecqueue);
+ g_workrecqueue = NULL;
+ }
+ wst_clear();
+ if (g_psecdev) {
+ device_destroy(g_psecclass, MKDEV(g_isechip_Major, 0));
+ g_psecdev = NULL;
+ }
+ if (g_psecclass) {
+ class_destroy(g_psecclass);
+ g_psecclass = NULL;
+ }
+ if (g_isechip_Major >= 0) {
+ unregister_chrdev(g_isechip_Major, CRYNAME);
+ g_isechip_Major = -1;
+ }
+ se_del_dma_buf();
+}
+
+static int loongson_cryp_get_irq(struct platform_device *pdev, char *pat)
+{
+ int i;
+ struct resource *res = pdev->resource;
+
+ for (i = 0; i < pdev->num_resources; i++) {
+ if (strcmp(res[i].name, pat) == 0)
+ return res[i].start;
+ }
+ return -1;
+
+}
+static int loongson_cryp_probe(struct platform_device *pdev)
+{
+ int i;
+
+ if (ACPI_COMPANION(&pdev->dev)) {
+ se_irq[0].irq = platform_get_irq(pdev, 1);
+ se_irq[1].irq = platform_get_irq(pdev, 0);
+ } else {
+ for (i = 0; i < pdev->num_resources; i++) {
+ se_irq[i].irq = loongson_cryp_get_irq(pdev,
+ se_irq[i].pat);
+ if (se_irq[i].irq < 0) {
+ pr_warn("ERROR:sedriver get irq failed\n");
+ return -1;
+ }
+ }
+ }
+
+ return se_chip_load();
+}
+static int loongson_cryp_remove(struct platform_device *pdev)
+{
+ se_chip_unload();
+ return 0;
+}
+static int loongson_cryp_suspend(struct platform_device *pdev, pm_message_t state)
+{
+ g_suspend = 1;
+ cancel_work_sync(&g_recwork);
+ cancel_work_sync(&g_sendwork);
+ flush_work(&g_recwork);
+ flush_work(&g_sendwork);
+ se_chip_unload();
+ return 0;
+}
+
+static int loongson_cryp_resume(struct platform_device *pdev)
+{
+ int i;
+
+ g_suspend = 0;
+ g_worksendqueue = NULL;
+ g_workrecqueue = NULL;
+ g_isechip_Major = -1;
+ g_pCacheInBuf = NULL;
+ g_pCacheOutBuf = NULL;
+ g_iUseIntr = 1;
+ spin_lock_init(&g_reclistlock);
+ spin_lock_init(&g_sendlistlock);
+ spin_lock_init(&g_getdmabuflock);
+
+ for (i = 0; i < pdev->num_resources; i++) {
+ se_irq[i].irq = loongson_cryp_get_irq(pdev, se_irq[i].pat);
+
+ if (se_irq[i].irq < 0) {
+ pr_warn("ERROR:sedriver get irq failed\n");
+ return -1;
+ }
+ }
+ se_chip_load();
+ return 0;
+}
+
+static const struct acpi_device_id loongson_cryp_acpi_match[] = {
+ {"LOON0003"},
+ {}
+};
+MODULE_DEVICE_TABLE(acpi, loongson_cryp_acpi_match);
+
+static struct platform_driver loongson_cryp_driver = {
+ .probe = loongson_cryp_probe,
+ .remove = loongson_cryp_remove,
+ .suspend = loongson_cryp_suspend,
+ .resume = loongson_cryp_resume,
+ .driver = {
+ .name = "loongson3_crypto",
+ .acpi_match_table = ACPI_PTR(loongson_cryp_acpi_match),
+ },
+};
+
+static int __init initmodule(void)
+{
+ return platform_driver_register(&loongson_cryp_driver);
+}
+
+static void __exit exitmodule(void)
+{
+ platform_driver_unregister(&loongson_cryp_driver);
+}
+
+module_init(initmodule);
+module_exit(exitmodule);
+
+MODULE_ALIAS("platform:loongson3_crypto");
+MODULE_AUTHOR("dcm");
+MODULE_DESCRIPTION("se encryption chip driver Co westone");
+MODULE_VERSION(DRIVER_VERSION);
+MODULE_LICENSE("GPL");
diff --git a/drivers/crypto/sedriver/wst_se_echip_driver.h b/drivers/crypto/sedriver/wst_se_echip_driver.h
new file mode 100644
index 000000000000..3e562e55faac
--- /dev/null
+++ b/drivers/crypto/sedriver/wst_se_echip_driver.h
@@ -0,0 +1,184 @@
+#ifndef _WST_SE_ECHIP_DRIVER_H
+#define _WST_SE_ECHIP_DRIVER_H
+#include "wst_se_ktrans.h"
+
+#define CRYNAME "wst-se"
+
+#define SWBUFNUM 512
+#define SWCHANNELNUM 2
+#define CTL_DMABUFNUM 512
+
+#define DMA_MASK 0xffffffff
+#define SE_DMA_CONTROL_RESET 0x80000000
+#define SE_DMA_CONTROL_SET 0x00000000
+
+#define SE_BASEERR 1000
+
+#define SE_MAX_SEND_LEN (3*2048)
+#define SE_FILL_LEN 48
+#define SE_BD_LENGTH sizeof(SE_BASIC_BD)
+#define SE_BDQUEUE_LEN SWBUFNUM
+#define DMA0_CTRL_CHANNEL_ENABLE 1
+#define DMA0_CTRL_CHANNEL_DISABLE 0xfffffffe
+#define DMA1_CTRL_CHANNEL_ENABLE 2
+#define DMA1_CTRL_CHANNEL_DISABLE 0xfffffffd
+
+#define SE_REG_RESET 0
+#define SE_REG_STS 0x08
+#define SE_INT_CTRL 0x10
+#define SE_REG_MSK 0x18
+#define SE_INT_CLR 0x20
+
+#define SE_LREG_BQBA0 0x100
+#define SE_HREG_BQBA0 0x108
+#define SE_REG_BQS0 0x110
+#define SE_REG_BQWP0 0x118
+#define SE_REG_RQRP0 0x120
+
+#define SE_LREG_BQBA1 0x128
+#define SE_HREG_BQBA1 0x130
+#define SE_REG_BQS1 0x138
+#define SE_REG_BQWP1 0x140
+#define SE_REG_RQRP1 0x148
+
+#define SE_WRITE_REG1 0x200
+#define SE_WRITE_REG2 0x208
+#define SE_WRITE_REG3 0x210
+#define SE_LOWREG_STS 0x240
+#define SE_LOWINT_CLEAR 0x248
+#define SE_LOWREG_INQ 0x1600
+#define SE_LOWREG_SR 0x1608
+#define INPUT_VALID 0x4
+#define OUTPUT_VALID 0x8
+#define SE_LOWINT_CLR 0x228
+#define INT_STAT_DMA0_PACK_DONE 1
+#define INT_STAT_DMA1_PACK_DONE 2
+#define INT_STAT_DMA_MASK (INT_STAT_DMA0_PACK_DONE|INT_STAT_DMA1_PACK_DONE)
+
+typedef struct tagSEdrvctl {
+
+ unsigned long ulMemBase;
+ struct device *pdev;
+ struct device dev;
+ unsigned int ulCurrBdReadPtr[SWCHANNELNUM];
+ unsigned int ulCurrBdWritePtr[SWCHANNELNUM];
+ unsigned int ulCurrReadPtr[SWCHANNELNUM];
+ unsigned int ulCurrWritePtr[SWCHANNELNUM];
+ PSECallBackfn pcallback[SWCHANNELNUM][SWBUFNUM];
+ void *pParma[SWCHANNELNUM][SWBUFNUM];
+ struct completion *stsemphore[SWCHANNELNUM][SWBUFNUM];
+ int ikernel[SWCHANNELNUM][SWBUFNUM];
+ unsigned long ulBDMemBasePhy[SWCHANNELNUM];
+ unsigned long ulBDMemBase[SWCHANNELNUM];
+ unsigned short *pusOutlen[SWCHANNELNUM][SWBUFNUM];
+ unsigned short usInlen[SWCHANNELNUM][SWBUFNUM];
+ unsigned long *ulOutputPtr[SWCHANNELNUM][SWBUFNUM];
+ unsigned long *ulInputPtr[SWCHANNELNUM][SWBUFNUM];
+ unsigned char *pucRetCode[SWCHANNELNUM][SWBUFNUM];
+ rwlock_t mr_lock;
+ rwlock_t mr_lowlock;
+ spinlock_t readlock;
+ struct semaphore sema;
+ int iIrq;
+ int ilowIrq;
+} SECHIPDRV_CTRL;
+
+typedef struct tagSEBasicBD {
+
+ unsigned int ucOpCode:4,
+ ucFlag:4,
+ ucRetCode:8,
+ ucInCtxLength:8,
+ ucOutCtxLength:8;
+ unsigned int usInputLength:16,
+ usOutputLength:16;
+ unsigned int ulCtxLPtr;
+ unsigned int ulCtxHPtr;
+ unsigned int ulInputLPtr;
+ unsigned int ulInputHPtr;
+ unsigned int ulOutputLPtr;
+ unsigned int ulOutputHPtr;
+
+} SE_BASIC_BD;
+
+#define SW_CONT_BUF_SIZE 0x100
+#define DMA_BUFSIZE 0x1000
+
+#define PAGE_NUM (DMA_BUFSIZE/PAGE_SIZE+1)
+
+typedef struct _SW_GET_STAT {
+ unsigned long TXD;
+ unsigned long RXD;
+} SW_GET_STAT, *PSW_GET_STAT;
+
+DEFINE_SPINLOCK(g_writelock);
+
+#define HandleRead32(handle, addr, pData) \
+ do { \
+ smp_mb(); \
+ *(pData) = readl((void *)(handle->ulMemBase + addr)); \
+ } while (0)
+
+#define HandleWrite32(handle, addr, value)\
+ do { \
+ writel(value, (void *)(handle->ulMemBase + addr)); \
+ smp_mb(); \
+ } while (0)
+
+#define HandleRead64(handle, addr, pData) \
+ do { \
+ smp_mb(); \
+ *(pData) = readq((void *)(handle->ulMemBase + addr)); \
+ } while (0)
+
+#define HandleWrite64(handle, addr, value)\
+ do { \
+ writeq(value, (void *)(handle->ulMemBase + addr)); \
+ smp_mb(); \
+ } while (0)
+
+
+#define SPRINTF sprintf
+
+#define HIULONG(w) ((unsigned int)((((unsigned long long)w) >> 32) & 0x00000000ffffffff))
+#define LOULONG(w) ((unsigned int)((unsigned long long)w) & 0x00000000ffffffff)
+
+#ifdef DEBUG_DRIVER
+ #define TRACEMSG(fmt, args...) printk(KERN_DEBUG "msg: " fmt, ##args)
+#else
+ #define TRACEMSG(fmt, args...)
+#endif
+
+#ifdef DEBUG_DRIVER_ERROR
+ #define TRACEERR(fmt, args...) printk(KERN_DEBUG "err: " fmt, ##args)
+#else
+ #define TRACEERR(fmt, args...)
+#endif
+
+#define HIBYTE(w) ((unsigned char)(((unsigned short)(w) >> 8) & 0xFF))
+#define LOBYTE(w) ((unsigned char)(w))
+
+typedef struct ST_SEND_PACKAGE {
+ struct list_head list;
+ SECHIPDRV_CTRL *pdrvctl;
+ unsigned char *pInPtr;
+ unsigned short usInlen;
+ unsigned char *pOutPtr;
+ unsigned short *pusOutlen;
+ int iChannel;
+ unsigned char ucFlag;
+ unsigned char ucOpCode;
+ unsigned char *pucRetCode;
+ PSECallBackfn pcallback;
+ void *pParma;
+ int iKernel;
+ struct completion *mycomplete;
+ unsigned long ulendtime;
+} SEND_PACKAGE;
+
+typedef struct ST_INT_MESSAGE {
+ struct list_head list;
+ PSECallBackfn pcallback;
+ void *pParma;
+} INT_MESSAGE;
+#endif
diff --git a/drivers/crypto/sedriver/wst_se_ktrans.h b/drivers/crypto/sedriver/wst_se_ktrans.h
new file mode 100644
index 000000000000..da6c4b8f2824
--- /dev/null
+++ b/drivers/crypto/sedriver/wst_se_ktrans.h
@@ -0,0 +1,17 @@
+#ifndef _WST_SE_KTRANS_H
+#define _WST_SE_KTRANS_H
+
+#include "wst_se_common_type.h"
+#include "wst_se_define.h"
+
+
+typedef struct tagSWCOMMUDATA {
+ unsigned short usFlags;
+ unsigned short usInputLen;
+ unsigned short usOutputLen;
+ unsigned short usReserve;
+ unsigned char *pucInbuf;
+ unsigned char *pucOutbuf;
+} SWCommuData;
+
+#endif
--
2.33.0
2
1
From: JiangShui Yang <yangjiangshui(a)h-partners.com>
Longfang Liu (9):
hisi_acc_vfio_pci: fix XQE dma address error
hisi_acc_vfio_pci: add eq and aeq interruption restore
hisi_acc_vfio_pci: bugfix cache write-back issue
hisi_acc_vfio_pci: bugfix the problem of uninstalling driver
hisi_acc_vfio_pci: bugfix live migration function without VF device
driver
hisi_acc_vfio_pci: update function return values.
migration: update BAR space size
migration: qm updates BAR configuration
migration: adapt to new migration configuration
drivers/crypto/hisilicon/qm.c | 29 ++
.../vfio/pci/hisilicon/hisi_acc_vfio_pci.c | 312 +++++++++++++-----
.../vfio/pci/hisilicon/hisi_acc_vfio_pci.h | 21 +-
3 files changed, 272 insertions(+), 90 deletions(-)
--
2.43.0
1
9

[PATCH OLK-6.6] regulator: check that dummy regulator has been probed before using it
by Huang Xiaojia 14 Apr '25
by Huang Xiaojia 14 Apr '25
14 Apr '25
From: Christian Eggers <ceggers(a)arri.de>
stable inclusion
from stable-v6.6.85
commit 998b1aae22dca87da392ea35f089406cbef6032d
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IBZH67
CVE: CVE-2025-22008
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id…
--------------------------------
commit 2c7a50bec4958f1d1c84d19cde518d0e96a676fd upstream.
Due to asynchronous driver probing there is a chance that the dummy
regulator hasn't already been probed when first accessing it.
Cc: stable(a)vger.kernel.org
Signed-off-by: Christian Eggers <ceggers(a)arri.de>
Link: https://patch.msgid.link/20250313103051.32430-3-ceggers@arri.de
Signed-off-by: Mark Brown <broonie(a)kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Signed-off-by: Huang Xiaojia <huangxiaojia2(a)huawei.com>
---
drivers/regulator/core.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index c96bf095695f..9e435a332057 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -2084,6 +2084,10 @@ static int regulator_resolve_supply(struct regulator_dev *rdev)
if (have_full_constraints()) {
r = dummy_regulator_rdev;
+ if (!r) {
+ ret = -EPROBE_DEFER;
+ goto out;
+ }
get_device(&r->dev);
} else {
dev_err(dev, "Failed to resolve %s-supply for %s\n",
@@ -2101,6 +2105,10 @@ static int regulator_resolve_supply(struct regulator_dev *rdev)
goto out;
}
r = dummy_regulator_rdev;
+ if (!r) {
+ ret = -EPROBE_DEFER;
+ goto out;
+ }
get_device(&r->dev);
}
@@ -2209,8 +2217,10 @@ struct regulator *_regulator_get(struct device *dev, const char *id,
* enabled, even if it isn't hooked up, and just
* provide a dummy.
*/
- dev_warn(dev, "supply %s not found, using dummy regulator\n", id);
rdev = dummy_regulator_rdev;
+ if (!rdev)
+ return ERR_PTR(-EPROBE_DEFER);
+ dev_warn(dev, "supply %s not found, using dummy regulator\n", id);
get_device(&rdev->dev);
break;
--
2.34.1
2
1

[PATCH OLK-6.6] KVM: arm64: Unconditionally save+flush host FPSIMD/SVE/SME state
by Huang Xiaojia 14 Apr '25
by Huang Xiaojia 14 Apr '25
14 Apr '25
From: Mark Rutland <mark.rutland(a)arm.com>
stable inclusion
from stable-v6.12.21
commit 79e140bba70bcacc5fe15bf8c0b958793fd7d56f
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IBZH7N
CVE: CVE-2025-22013
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id…
--------------------------------
[ Upstream commit fbc7e61195e23f744814e78524b73b59faa54ab4 ]
There are several problems with the way hyp code lazily saves the host's
FPSIMD/SVE state, including:
* Host SVE being discarded unexpectedly due to inconsistent
configuration of TIF_SVE and CPACR_ELx.ZEN. This has been seen to
result in QEMU crashes where SVE is used by memmove(), as reported by
Eric Auger:
https://issues.redhat.com/browse/RHEL-68997
* Host SVE state is discarded *after* modification by ptrace, which was an
unintentional ptrace ABI change introduced with lazy discarding of SVE state.
* The host FPMR value can be discarded when running a non-protected VM,
where FPMR support is not exposed to a VM, and that VM uses
FPSIMD/SVE. In these cases the hyp code does not save the host's FPMR
before unbinding the host's FPSIMD/SVE/SME state, leaving a stale
value in memory.
Avoid these by eagerly saving and "flushing" the host's FPSIMD/SVE/SME
state when loading a vCPU such that KVM does not need to save any of the
host's FPSIMD/SVE/SME state. For clarity, fpsimd_kvm_prepare() is
removed and the necessary call to fpsimd_save_and_flush_cpu_state() is
placed in kvm_arch_vcpu_load_fp(). As 'fpsimd_state' and 'fpmr_ptr'
should not be used, they are set to NULL; all uses of these will be
removed in subsequent patches.
Historical problems go back at least as far as v5.17, e.g. erroneous
assumptions about TIF_SVE being clear in commit:
8383741ab2e773a9 ("KVM: arm64: Get rid of host SVE tracking/saving")
... and so this eager save+flush probably needs to be backported to ALL
stable trees.
Fixes: 93ae6b01bafee8fa ("KVM: arm64: Discard any SVE state when entering KVM guests")
Fixes: 8c845e2731041f0f ("arm64/sve: Leave SVE enabled on syscall if we don't context switch")
Fixes: ef3be86021c3bdf3 ("KVM: arm64: Add save/restore support for FPMR")
Reported-by: Eric Auger <eauger(a)redhat.com>
Reported-by: Wilco Dijkstra <wilco.dijkstra(a)arm.com>
Reviewed-by: Mark Brown <broonie(a)kernel.org>
Tested-by: Mark Brown <broonie(a)kernel.org>
Tested-by: Eric Auger <eric.auger(a)redhat.com>
Acked-by: Will Deacon <will(a)kernel.org>
Cc: Catalin Marinas <catalin.marinas(a)arm.com>
Cc: Florian Weimer <fweimer(a)redhat.com>
Cc: Fuad Tabba <tabba(a)google.com>
Cc: Jeremy Linton <jeremy.linton(a)arm.com>
Cc: Marc Zyngier <maz(a)kernel.org>
Cc: Oliver Upton <oliver.upton(a)linux.dev>
Cc: Paolo Bonzini <pbonzini(a)redhat.com>
Signed-off-by: Mark Rutland <mark.rutland(a)arm.com>
Reviewed-by: Oliver Upton <oliver.upton(a)linux.dev>
Link: https://lore.kernel.org/r/20250210195226.1215254-2-mark.rutland@arm.com
Signed-off-by: Marc Zyngier <maz(a)kernel.org>
[ Mark: Handle vcpu/host flag conflict ]
Signed-off-by: Mark Rutland <mark.rutland(a)arm.com>
Signed-off-by: Mark Brown <broonie(a)kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Signed-off-by: Huang Xiaojia <huangxiaojia2(a)huawei.com>
---
arch/arm64/kernel/fpsimd.c | 25 -------------------------
arch/arm64/kvm/fpsimd.c | 33 +++++++++------------------------
2 files changed, 9 insertions(+), 49 deletions(-)
diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c
index 0137d987631e..bd4f6c6ee0f3 100644
--- a/arch/arm64/kernel/fpsimd.c
+++ b/arch/arm64/kernel/fpsimd.c
@@ -1707,31 +1707,6 @@ void fpsimd_signal_preserve_current_state(void)
sve_to_fpsimd(current);
}
-/*
- * Called by KVM when entering the guest.
- */
-void fpsimd_kvm_prepare(void)
-{
- if (!system_supports_sve())
- return;
-
- /*
- * KVM does not save host SVE state since we can only enter
- * the guest from a syscall so the ABI means that only the
- * non-saved SVE state needs to be saved. If we have left
- * SVE enabled for performance reasons then update the task
- * state to be FPSIMD only.
- */
- get_cpu_fpsimd_context();
-
- if (test_and_clear_thread_flag(TIF_SVE)) {
- sve_to_fpsimd(current);
- current->thread.fp_type = FP_STATE_FPSIMD;
- }
-
- put_cpu_fpsimd_context();
-}
-
/*
* Associate current's FPSIMD context with this cpu
* The caller must have ownership of the cpu FPSIMD context before calling
diff --git a/arch/arm64/kvm/fpsimd.c b/arch/arm64/kvm/fpsimd.c
index 4f51293db173..9c444a277a17 100644
--- a/arch/arm64/kvm/fpsimd.c
+++ b/arch/arm64/kvm/fpsimd.c
@@ -77,15 +77,17 @@ void kvm_arch_vcpu_load_fp(struct kvm_vcpu *vcpu)
if (!system_supports_fpsimd())
return;
- fpsimd_kvm_prepare();
-
/*
- * We will check TIF_FOREIGN_FPSTATE just before entering the
- * guest in kvm_arch_vcpu_ctxflush_fp() and override this to
- * FP_STATE_FREE if the flag set.
+ * Ensure that any host FPSIMD/SVE/SME state is saved and unbound such
+ * that the host kernel is responsible for restoring this state upon
+ * return to userspace, and the hyp code doesn't need to save anything.
+ *
+ * When the host may use SME, fpsimd_save_and_flush_cpu_state() ensures
+ * that PSTATE.{SM,ZA} == {0,0}.
*/
- *host_data_ptr(fp_owner) = FP_STATE_HOST_OWNED;
- *host_data_ptr(fpsimd_state) = kern_hyp_va(¤t->thread.uw.fpsimd_state);
+ fpsimd_save_and_flush_cpu_state();
+ *host_data_ptr(fp_owner) = FP_STATE_FREE;
+ *host_data_ptr(fpsimd_state) = NULL;
vcpu_clear_flag(vcpu, HOST_SVE_ENABLED);
if (read_sysreg(cpacr_el1) & CPACR_EL1_ZEN_EL0EN)
@@ -95,23 +97,6 @@ void kvm_arch_vcpu_load_fp(struct kvm_vcpu *vcpu)
vcpu_clear_flag(vcpu, HOST_SME_ENABLED);
if (read_sysreg(cpacr_el1) & CPACR_EL1_SMEN_EL0EN)
vcpu_set_flag(vcpu, HOST_SME_ENABLED);
-
- /*
- * If PSTATE.SM is enabled then save any pending FP
- * state and disable PSTATE.SM. If we leave PSTATE.SM
- * enabled and the guest does not enable SME via
- * CPACR_EL1.SMEN then operations that should be valid
- * may generate SME traps from EL1 to EL1 which we
- * can't intercept and which would confuse the guest.
- *
- * Do the same for PSTATE.ZA in the case where there
- * is state in the registers which has not already
- * been saved, this is very unlikely to happen.
- */
- if (read_sysreg_s(SYS_SVCR) & (SVCR_SM_MASK | SVCR_ZA_MASK)) {
- *host_data_ptr(fp_owner) = FP_STATE_FREE;
- fpsimd_save_and_flush_cpu_state();
- }
}
}
--
2.34.1
2
1

[PATCH openEuler-1.0-LTS] tty: synclink_gt: Fix null-pointer-dereference in slgt_clean()
by Cui GaoSheng 14 Apr '25
by Cui GaoSheng 14 Apr '25
14 Apr '25
From: Zheyu Ma <zheyuma97(a)gmail.com>
stable inclusion
from stable-v4.19.247
commit ba08cbc5b53e151d0acf1930fb526fc65b7f3e65
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IBP74I
CVE: CVE-2022-49307
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id…
--------------------------------
[ Upstream commit 689ca31c542687709ba21ec2195c1fbce34fd029 ]
When the driver fails at alloc_hdlcdev(), and then we remove the driver
module, we will get the following splat:
[ 25.065966] general protection fault, probably for non-canonical address 0xdffffc0000000182: 0000 [#1] PREEMPT SMP KASAN PTI
[ 25.066914] KASAN: null-ptr-deref in range [0x0000000000000c10-0x0000000000000c17]
[ 25.069262] RIP: 0010:detach_hdlc_protocol+0x2a/0x3e0
[ 25.077709] Call Trace:
[ 25.077924] <TASK>
[ 25.078108] unregister_hdlc_device+0x16/0x30
[ 25.078481] slgt_cleanup+0x157/0x9f0 [synclink_gt]
Fix this by checking whether the 'info->netdev' is a null pointer first.
Reviewed-by: Jiri Slaby <jirislaby(a)kernel.org>
Signed-off-by: Zheyu Ma <zheyuma97(a)gmail.com>
Link: https://lore.kernel.org/r/20220410114814.3920474-1-zheyuma97@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal(a)kernel.org>
Signed-off-by: Cui GaoSheng <cuigaosheng1(a)huawei.com>
---
drivers/tty/synclink_gt.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/tty/synclink_gt.c b/drivers/tty/synclink_gt.c
index b88ecf102764..5d971ae3f5e5 100644
--- a/drivers/tty/synclink_gt.c
+++ b/drivers/tty/synclink_gt.c
@@ -1808,6 +1808,8 @@ static int hdlcdev_init(struct slgt_info *info)
*/
static void hdlcdev_exit(struct slgt_info *info)
{
+ if (!info->netdev)
+ return;
unregister_hdlc_device(info->netdev);
free_netdev(info->netdev);
info->netdev = NULL;
--
2.34.1
2
1
This series includes adding Motorcomm YT6801 Gigabit ethernet driver
and adding yt6801 ethernet driver entry in MAINTAINERS file.
YT6801 integrates a YT8531S phy.
Frank Sae (14):
yt6801: Add support for a pci table in this module
yt6801: Implement mdio register
yt6801: Implement pci_driver shutdown
yt6801: Implement the fxgmac_init function
yt6801: Implement the .ndo_open function
yt6801: Implement the fxgmac_start function
net:phy:motorcomm: Add PHY_INTERFACE_MODE_INTERNAL to support YT6801
yt6801: Implement the fxgmac_hw_init function
yt6801: Implement the poll functions
yt6801: Implement .ndo_start_xmit function
yt6801: Implement some net_device_ops function
yt6801: Implement pci_driver suspend and resume
yt6801: Add makefile and Kconfig
yt6801: Update the Makefile, Kconfig and maintainer for yt6801
MAINTAINERS | 7 +
arch/arm64/configs/openeuler_defconfig | 4 +-
arch/loongarch/configs/loongson3_defconfig | 3 +
arch/powerpc/configs/openeuler_defconfig | 4 +-
arch/riscv/configs/openeuler_defconfig | 4 +-
arch/x86/configs/openeuler_defconfig | 4 +-
drivers/net/ethernet/Kconfig | 1 +
drivers/net/ethernet/Makefile | 1 +
drivers/net/ethernet/motorcomm/Kconfig | 27 +
drivers/net/ethernet/motorcomm/Makefile | 6 +
.../net/ethernet/motorcomm/yt6801/Makefile | 8 +
.../ethernet/motorcomm/yt6801/yt6801_desc.c | 565 +++
.../ethernet/motorcomm/yt6801/yt6801_desc.h | 35 +
.../ethernet/motorcomm/yt6801/yt6801_main.c | 3020 +++++++++++++++++
.../ethernet/motorcomm/yt6801/yt6801_type.h | 957 ++++++
drivers/net/phy/motorcomm.c | 6 +
16 files changed, 4648 insertions(+), 4 deletions(-)
create mode 100644 drivers/net/ethernet/motorcomm/Kconfig
create mode 100644 drivers/net/ethernet/motorcomm/Makefile
create mode 100644 drivers/net/ethernet/motorcomm/yt6801/Makefile
create mode 100644 drivers/net/ethernet/motorcomm/yt6801/yt6801_desc.c
create mode 100644 drivers/net/ethernet/motorcomm/yt6801/yt6801_desc.h
create mode 100644 drivers/net/ethernet/motorcomm/yt6801/yt6801_main.c
create mode 100644 drivers/net/ethernet/motorcomm/yt6801/yt6801_type.h
--
2.34.1
1
14

[PATCH openEuler-1.0-LTS] tty: goldfish: Use tty_port_destroy() to destroy port
by Gu Bowen 14 Apr '25
by Gu Bowen 14 Apr '25
14 Apr '25
From: Wang Weiyang <wangweiyang2(a)huawei.com>
stable inclusion
from stable-v4.19.247
commit 326192b99c903a2193d820c30ed936cc2402382c
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IBP6XS
CVE: CVE-2022-49399
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id…
--------------------------------
[ Upstream commit 507b05063d1b7a1fcb9f7d7c47586fc4f3508f98 ]
In goldfish_tty_probe(), the port initialized through tty_port_init()
should be destroyed in error paths.In goldfish_tty_remove(), qtty->port
also should be destroyed or else might leak resources.
Fix the above by calling tty_port_destroy().
Fixes: 666b7793d4bf ("goldfish: tty driver")
Reviewed-by: Jiri Slaby <jirislaby(a)kernel.org>
Signed-off-by: Wang Weiyang <wangweiyang2(a)huawei.com>
Link: https://lore.kernel.org/r/20220328115844.86032-1-wangweiyang2@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal(a)kernel.org>
Conflicts:
drivers/tty/goldfish.c
[Context conflicts due to commit 1b4acdcf01e0 ("tty: goldfish: Fix
free_irq() on remove") has merged.]
Signed-off-by: Gu Bowen <gubowen5(a)huawei.com>
---
drivers/tty/goldfish.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/tty/goldfish.c b/drivers/tty/goldfish.c
index 48ea55beaf43..d6e82eb61fc2 100644
--- a/drivers/tty/goldfish.c
+++ b/drivers/tty/goldfish.c
@@ -407,6 +407,7 @@ static int goldfish_tty_probe(struct platform_device *pdev)
err_tty_register_device_failed:
free_irq(irq, qtty);
err_dec_line_count:
+ tty_port_destroy(&qtty->port);
goldfish_tty_current_line_count--;
if (goldfish_tty_current_line_count == 0)
goldfish_tty_delete_driver();
@@ -428,6 +429,7 @@ static int goldfish_tty_remove(struct platform_device *pdev)
iounmap(qtty->base);
qtty->base = NULL;
free_irq(qtty->irq, qtty);
+ tty_port_destroy(&qtty->port);
goldfish_tty_current_line_count--;
if (goldfish_tty_current_line_count == 0)
goldfish_tty_delete_driver();
--
2.25.1
2
1

[PATCH OLK-5.10] HID: intel-ish-hid: Fix use-after-free issue in ishtp_hid_remove()
by Pu Lehui 14 Apr '25
by Pu Lehui 14 Apr '25
14 Apr '25
From: Zhang Lixu <lixu.zhang(a)intel.com>
stable inclusion
from stable-v5.10.235
commit d3faae7f42181865c799d88c5054176f38ae4625
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IBY43Y
CVE: CVE-2025-21928
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id…
--------------------------------
[ Upstream commit 07583a0010696a17fb0942e0b499a62785c5fc9f ]
The system can experience a random crash a few minutes after the driver is
removed. This issue occurs due to improper handling of memory freeing in
the ishtp_hid_remove() function.
The function currently frees the `driver_data` directly within the loop
that destroys the HID devices, which can lead to accessing freed memory.
Specifically, `hid_destroy_device()` uses `driver_data` when it calls
`hid_ishtp_set_feature()` to power off the sensor, so freeing
`driver_data` beforehand can result in accessing invalid memory.
This patch resolves the issue by storing the `driver_data` in a temporary
variable before calling `hid_destroy_device()`, and then freeing the
`driver_data` after the device is destroyed.
Fixes: 0b28cb4bcb17 ("HID: intel-ish-hid: ISH HID client driver")
Signed-off-by: Zhang Lixu <lixu.zhang(a)intel.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada(a)linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina(a)suse.com>
Signed-off-by: Sasha Levin <sashal(a)kernel.org>
Signed-off-by: Pu Lehui <pulehui(a)huawei.com>
---
drivers/hid/intel-ish-hid/ishtp-hid.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/hid/intel-ish-hid/ishtp-hid.c b/drivers/hid/intel-ish-hid/ishtp-hid.c
index b8aae69ad15d..ef5236855771 100644
--- a/drivers/hid/intel-ish-hid/ishtp-hid.c
+++ b/drivers/hid/intel-ish-hid/ishtp-hid.c
@@ -263,12 +263,14 @@ int ishtp_hid_probe(unsigned int cur_hid_dev,
*/
void ishtp_hid_remove(struct ishtp_cl_data *client_data)
{
+ void *data;
int i;
for (i = 0; i < client_data->num_hid_devices; ++i) {
if (client_data->hid_sensor_hubs[i]) {
- kfree(client_data->hid_sensor_hubs[i]->driver_data);
+ data = client_data->hid_sensor_hubs[i]->driver_data;
hid_destroy_device(client_data->hid_sensor_hubs[i]);
+ kfree(data);
client_data->hid_sensor_hubs[i] = NULL;
}
}
--
2.34.1
2
1

[openeuler:OLK-5.10 2860/2860] mm/damon/core-test.h:284:9: sparse: sparse: incompatible types in comparison expression (different signedness):
by kernel test robot 12 Apr '25
by kernel test robot 12 Apr '25
12 Apr '25
tree: https://gitee.com/openeuler/kernel.git OLK-5.10
head: 8cf05d37849321b8bb9b74e099fa5bb6164d4f56
commit: 83b931be40b2829e20f38356509d8706ea6b6238 [2860/2860] mm/damon/core-test: test damon_set_regions
config: x86_64-randconfig-121-20250412 (https://download.01.org/0day-ci/archive/20250412/202504121904.5u9UZZmR-lkp@…)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250412/202504121904.5u9UZZmR-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/202504121904.5u9UZZmR-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
mm/damon/core.c: note: in included file:
>> mm/damon/core-test.h:284:9: sparse: sparse: incompatible types in comparison expression (different signedness):
mm/damon/core-test.h:284:9: sparse: unsigned int *
mm/damon/core-test.h:284:9: sparse: int *
vim +284 mm/damon/core-test.h
269
270 static void damon_test_set_regions(struct kunit *test)
271 {
272 struct damon_target *t = damon_new_target();
273 struct damon_region *r1 = damon_new_region(4, 16);
274 struct damon_region *r2 = damon_new_region(24, 32);
275 struct damon_addr_range range = {.start = 8, .end = 28};
276 unsigned long expects[] = {8, 16, 16, 24, 24, 28};
277 int expect_idx = 0;
278 struct damon_region *r;
279
280 damon_add_region(r1, t);
281 damon_add_region(r2, t);
282 damon_set_regions(t, &range, 1);
283
> 284 KUNIT_EXPECT_EQ(test, damon_nr_regions(t), 3);
285 damon_for_each_region(r, t) {
286 KUNIT_EXPECT_EQ(test, r->ar.start, expects[expect_idx++]);
287 KUNIT_EXPECT_EQ(test, r->ar.end, expects[expect_idx++]);
288 }
289 damon_destroy_target(t);
290 }
291
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
1
0

[openeuler:OLK-6.6] BUILD REGRESSION a8f711b494f352fee7d319f77d87d63916854c6e
by kernel test robot 12 Apr '25
by kernel test robot 12 Apr '25
12 Apr '25
tree/branch: https://gitee.com/openeuler/kernel.git OLK-6.6
branch HEAD: a8f711b494f352fee7d319f77d87d63916854c6e !15827 perf stat: Enable iostat mode for HiSilicon PCIe PMU
Error/Warning (recently discovered and may have been fixed):
https://lore.kernel.org/oe-kbuild-all/202503141744.6L1UQKTr-lkp@intel.com
https://lore.kernel.org/oe-kbuild-all/202503151158.xNxBbX1r-lkp@intel.com
https://lore.kernel.org/oe-kbuild-all/202503182233.88LCSaAj-lkp@intel.com
https://lore.kernel.org/oe-kbuild-all/202503200858.XSvAPfQM-lkp@intel.com
https://lore.kernel.org/oe-kbuild-all/202503201027.i8HE43EJ-lkp@intel.com
https://lore.kernel.org/oe-kbuild-all/202503220823.mG13Rroz-lkp@intel.com
https://lore.kernel.org/oe-kbuild-all/202503220924.Uw2cwpZV-lkp@intel.com
https://lore.kernel.org/oe-kbuild-all/202503290855.eVbc4pVd-lkp@intel.com
https://lore.kernel.org/oe-kbuild-all/202504012026.kzT6d2HZ-lkp@intel.com
aarch64-linux-ld: Unexpected GOT/PLT entries detected!
aarch64-linux-ld: Unexpected run-time procedure linkages detected!
arch/arm64/kvm/virtcca_cvm.c:819:5: warning: no previous prototype for function 'virtcca_get_tmi_version' [-Wmissing-prototypes]
arch/loongarch/mm/cache.c:69:29: warning: variable 'way_size' set but not used [-Wunused-but-set-variable]
drivers/coda/coda_pci.c:228: warning: Excess function parameter 'pdev' description in 'virtcca_pci_get_rom_size'
drivers/coda/coda_pci.c:228: warning: Function parameter or member 'p' not described in 'virtcca_pci_get_rom_size'
drivers/gpu/drm/sti/sti_dvo.c:531:21: error: implicit declaration of function 'devm_ioremap' [-Werror=implicit-function-declaration]
drivers/net/ethernet/huawei/hinic/hinic_dcb.c:1026:28: error: 'DCB_CAP_DCBX_VER_IEEE' undeclared (first use in this function)
drivers/net/ethernet/huawei/hinic/hinic_dcb.c:103:26: error: invalid application of 'sizeof' to incomplete type 'struct ieee_ets'
drivers/net/ethernet/huawei/hinic/hinic_dcb.c:1126:18: error: storage size of 'pfc' isn't known
drivers/net/ethernet/huawei/hinic/hinic_dcb.c:1126:9: error: variable 'pfc' has initializer but incomplete type
drivers/net/ethernet/huawei/hinic/hinic_dcb.c:117:26: error: invalid application of 'sizeof' to incomplete type 'struct ieee_pfc'
drivers/net/ethernet/huawei/hinic/hinic_dcb.c:1432:7: error: 'DCB_NUMTCS_ATTR_PG' undeclared (first use in this function)
drivers/net/ethernet/huawei/hinic/hinic_dcb.c:1519:14: error: variable 'hinic_dcbnl_ops' has initializer but incomplete type
drivers/net/ethernet/huawei/hinic/hinic_dcb.c:1522:3: error: 'const struct dcbnl_rtnl_ops' has no member named 'ieee_setets'
drivers/net/ethernet/huawei/hinic/hinic_dcb.c:1524:3: error: 'const struct dcbnl_rtnl_ops' has no member named 'ieee_setpfc'
drivers/net/ethernet/huawei/hinic/hinic_dcb.c:1528:3: error: 'const struct dcbnl_rtnl_ops' has no member named 'setstate'
drivers/net/ethernet/huawei/hinic/hinic_dcb.c:1530:3: error: 'const struct dcbnl_rtnl_ops' has no member named 'setpgtccfgtx'
drivers/net/ethernet/huawei/hinic/hinic_dcb.c:1531:3: error: 'const struct dcbnl_rtnl_ops' has no member named 'setpgbwgcfgtx'
drivers/net/ethernet/huawei/hinic/hinic_dcb.c:1532:3: error: 'const struct dcbnl_rtnl_ops' has no member named 'setpgtccfgrx'
drivers/net/ethernet/huawei/hinic/hinic_dcb.c:1535:3: error: 'const struct dcbnl_rtnl_ops' has no member named 'getpgbwgcfgtx'
drivers/net/ethernet/huawei/hinic/hinic_dcb.c:1536:3: error: 'const struct dcbnl_rtnl_ops' has no member named 'getpgtccfgrx'
drivers/net/ethernet/huawei/hinic/hinic_dcb.c:1538:3: error: 'const struct dcbnl_rtnl_ops' has no member named 'setpfccfg'
drivers/net/ethernet/huawei/hinic/hinic_dcb.c:1539:3: error: 'const struct dcbnl_rtnl_ops' has no member named 'getpfccfg'
drivers/net/ethernet/huawei/hinic/hinic_dcb.c:1541:3: error: 'const struct dcbnl_rtnl_ops' has no member named 'getcap'
drivers/net/ethernet/huawei/hinic/hinic_dcb.c:1542:3: error: 'const struct dcbnl_rtnl_ops' has no member named 'getnumtcs'
drivers/net/ethernet/huawei/hinic/hinic_dcb.c:1543:3: error: 'const struct dcbnl_rtnl_ops' has no member named 'setnumtcs'
drivers/net/ethernet/huawei/hinic/hinic_dcb.c:1545:3: error: 'const struct dcbnl_rtnl_ops' has no member named 'setpfcstate'
drivers/net/ethernet/huawei/hinic/hinic_dcb.c:1549:3: error: 'const struct dcbnl_rtnl_ops' has no member named 'setdcbx'
drivers/net/ethernet/huawei/hinic/hinic_dcb.c:244:22: error: 'DCB_CAP_DCBX_HOST' undeclared (first use in this function)
drivers/net/ethernet/huawei/hinic/hinic_dcb.c:244:42: error: 'DCB_CAP_DCBX_VER_CEE' undeclared (first use in this function)
drivers/net/ethernet/huawei/hinic/hinic_dcb.c:475:14: error: 'DCB_ATTR_VALUE_UNDEFINED' undeclared (first use in this function)
drivers/net/ethernet/huawei/hinic/hinic_dcb.c:698:7: error: 'DCB_CAP_ATTR_PG_TCS' undeclared (first use in this function)
drivers/net/ethernet/huawei/hinic/hinic_dcb.c:707:7: error: 'DCB_CAP_ATTR_BCN' undeclared (first use in this function)
drivers/net/ethernet/huawei/hinic/hinic_main.c:2291:19: error: 'struct net_device' has no member named 'dcbnl_ops'
drivers/net/ethernet/huawei/hinic/hinic_nic_dev.h:210:19: error: field 'hinic_ieee_ets_default' has incomplete type
drivers/net/ethernet/huawei/hinic/hinic_nic_dev.h:211:19: error: field 'hinic_ieee_ets' has incomplete type
drivers/scsi/linkdata/ps3stor/./linux/ps3_base.c:545:5: error: no previous prototype for 'ps3_pci_init' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/./linux/ps3_base.c:899:5: error: no previous prototype for 'ps3_pci_init_complete' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/./linux/ps3_base.c:945:6: error: no previous prototype for 'ps3_pci_init_complete_exit' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/./linux/ps3_cli.c:108:9: error: function 'ps3stor_cli_printf' might be a candidate for 'gnu_printf' format attribute [-Werror=suggest-attribute=format]
drivers/scsi/linkdata/ps3stor/./linux/ps3_cli_debug.c:1059:5: error: no previous prototype for 'ps3_dump_context_show' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/./linux/ps3_dump.c:159:5: error: no previous prototype for 'ps3_dump_file_write' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/./linux/ps3_dump.c:200:5: error: no previous prototype for 'ps3_dump_file_close' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/./linux/ps3_dump.c:28:5: error: no previous prototype for 'ps3_dump_local_time' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/./linux/ps3_dump.c:50:5: error: no previous prototype for 'ps3_dump_filename_build' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/./linux/ps3_dump.c:76:5: error: no previous prototype for 'ps3_dump_file_open' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_cmd_complete.c:131:6: error: no previous prototype for 'ps3_trigger_irq_poll' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_cmd_complete.c:243:5: error: no previous prototype for 'ps3_resp_status_convert' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_cmd_statistics.c:403:6: error: no previous prototype for 'ps3_io_recv_ok_stat_inc' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_cmd_statistics.c:85:6: error: no previous prototype for 'ps3_cmd_stat_content_clear' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_debug.c:883:5: error: no previous prototype for 'ps3_dump_dir_length' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_device_manager.c:1581:5: error: no previous prototype for 'ps3_scsi_private_init_pd' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_device_manager.c:1663:5: error: no previous prototype for 'ps3_scsi_private_init_vd' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_device_manager_sas.c:1632:5: error: no previous prototype for 'ps3_sas_expander_phys_refresh' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_instance_manager.c:669:60: error: 'snprintf' output may be truncated before the last format character [-Werror=format-truncation=]
drivers/scsi/linkdata/ps3stor/ps3_ioc_adp.c:147:6: error: no previous prototype for 'ps3_ioc_resource_prepare_hba' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_ioc_adp.c:36:6: error: no previous prototype for 'ps3_ioc_resource_prepare_switch' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_ioc_adp.c:88:6: error: no previous prototype for 'ps3_ioc_resource_prepare_raid' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_ioc_manager.c:307:5: error: no previous prototype for 'ps3_hard_reset_to_ready' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_ioctl.c:785:6: error: no previous prototype for 'ps3_clean_mgr_cmd' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_irq.c:21:27: error: 'PS3_INTERRUPT_CMD_DISABLE_ALL_MASK' defined but not used [-Werror=unused-const-variable=]
drivers/scsi/linkdata/ps3stor/ps3_irq.c:22:27: error: 'PS3_INTERRUPT_CMD_ENABLE_MSIX' defined but not used [-Werror=unused-const-variable=]
drivers/scsi/linkdata/ps3stor/ps3_irq.c:23:27: error: 'PS3_INTERRUPT_MASK_DISABLE' defined but not used [-Werror=unused-const-variable=]
drivers/scsi/linkdata/ps3stor/ps3_irq.c:24:27: error: 'PS3_INTERRUPT_STATUS_EXIST_IRQ' defined but not used [-Werror=unused-const-variable=]
drivers/scsi/linkdata/ps3stor/ps3_irq.c:25:27: error: 'PS3_INTERRUPT_CLEAR_IRQ' defined but not used [-Werror=unused-const-variable=]
drivers/scsi/linkdata/ps3stor/ps3_irq.c:27:27: error: 'PS3_SSD_IOPS_MSIX_VECTORS' defined but not used [-Werror=unused-const-variable=]
drivers/scsi/linkdata/ps3stor/ps3_irq.c:28:27: error: 'PS3_HDD_IOPS_MSIX_VECTORS' defined but not used [-Werror=unused-const-variable=]
drivers/scsi/linkdata/ps3stor/ps3_module_para.c:609:14: error: no previous prototype for 'ps3_cli_ver_query' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_qos.c:1058:6: error: no previous prototype for 'ps3_qos_pd_waitq_ratio_update' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_qos.c:2019:15: error: no previous prototype for 'ps3_hba_qos_decision' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_qos.c:2040:6: error: no previous prototype for 'ps3_hba_qos_waitq_notify' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_qos.c:2100:6: error: no previous prototype for 'ps3_cmd_waitq_abort' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_qos.c:211:1: error: no previous prototype for 'ps3_qos_cmd_waitq_get' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_qos.c:2463:6: error: no previous prototype for 'ps3_hba_qos_waitq_clear_all' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_qos.c:2827:6: error: no previous prototype for 'ps3_hba_qos_vd_init' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_qos.c:2936:6: error: no previous prototype for 'ps3_hba_qos_vd_reset' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_qos.c:3023:6: error: no previous prototype for 'ps3_hba_qos_waitq_poll' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_qos.c:3279:15: error: no previous prototype for 'ps3_raid_qos_decision' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_qos.c:3334:6: error: no previous prototype for 'ps3_qos_mgrq_resend' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_qos.c:335:15: error: no previous prototype for 'ps3_qos_vd_cmdword_get' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_qos.c:3478:6: error: no previous prototype for 'ps3_raid_qos_waitq_notify' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_qos.c:351:15: error: no previous prototype for 'ps3_qos_exclusive_cmdword_get' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_qos.c:363:15: error: no previous prototype for 'ps3_qos_tg_decision' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_qos.c:3821:15: error: no previous prototype for 'ps3_raid_qos_waitq_abort' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_qos.c:4022:6: error: no previous prototype for 'ps3_raid_qos_waitq_clear_all' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_qos.c:4083:6: error: no previous prototype for 'ps3_raid_qos_waitq_poll' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_qos.c:749:15: error: no previous prototype for 'ps3_qos_all_pd_rc_get' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_qos.c:876:6: error: no previous prototype for 'ps3_pd_quota_waitq_clear_all' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_qos.c:892:6: error: no previous prototype for 'ps3_pd_quota_waitq_clean' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_r1x_write_lock.c:1173:5: error: no previous prototype for 'ps3_range_check_and_insert' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_r1x_write_lock.c:1231:5: error: no previous prototype for 'ps3_r1x_hash_range_lock' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_r1x_write_lock.c:1312:6: error: no previous prototype for 'ps3_r1x_hash_range_unlock' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_r1x_write_lock.c:578:5: error: no previous prototype for 'ps3_r1x_hash_bit_check' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_r1x_write_lock.c:678:6: error: no previous prototype for 'ps3_r1x_conflict_queue_hash_bit_lock' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_r1x_write_lock.c:730:5: error: no previous prototype for 'ps3_r1x_hash_bit_lock' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_r1x_write_lock.c:988:6: error: no previous prototype for 'ps3_r1x_hash_bit_unlock' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_rb_tree.c:154:6: error: no previous prototype for 'rbtDelNodeDo' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_recovery.c:204:6: error: no previous prototype for 'ps3_recovery_irq_queue_destroy' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_recovery.c:2700:6: error: no previous prototype for 'ps3_hard_recovery_state_finish' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_recovery.c:363:5: error: no previous prototype for 'ps3_recovery_state_transfer' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_recovery.c:72:30: error: no previous prototype for 'ps3_recovery_context_alloc' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_recovery.c:82:6: error: no previous prototype for 'ps3_recovery_context_free' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_recovery.c:88:6: error: no previous prototype for 'ps3_recovery_context_delete' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_sas_transport.c:407:5: error: no previous prototype for 'ps3_sas_update_phy_info' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_scsi_cmd_err.c:1110:5: error: no previous prototype for 'ps3_wait_for_outstanding_complete' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_scsi_cmd_err.c:876:6: error: no previous prototype for 'ps3_set_task_manager_busy' [-Werror=missing-prototypes]
kismet: WARNING: unmet direct dependencies detected for ACPI_HOTPLUG_IGNORE_OSC when selected by X86
kismet: WARNING: unmet direct dependencies detected for CRYPTO_DRBG_CTR when selected by CRYPTO_DEV_HISI_TRNG
kismet: WARNING: unmet direct dependencies detected for HALTPOLL_CPUIDLE when selected by ARM64
mm/mempolicy.c:3129:26: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
Unverified Error/Warning (likely false positive, kindly check if interested):
mm/oom_kill.c: linux/nmi.h is included more than once.
Error/Warning ids grouped by kconfigs:
recent_errors
|-- arm64-allmodconfig
| |-- arch-arm64-kvm-virtcca_cvm.c:warning:no-previous-prototype-for-function-virtcca_get_tmi_version
| |-- drivers-coda-coda_pci.c:warning:Excess-function-parameter-pdev-description-in-virtcca_pci_get_rom_size
| `-- drivers-coda-coda_pci.c:warning:Function-parameter-or-member-p-not-described-in-virtcca_pci_get_rom_size
|-- arm64-allnoconfig
| |-- kismet:WARNING:unmet-direct-dependencies-detected-for-CRYPTO_DRBG_CTR-when-selected-by-CRYPTO_DEV_HISI_TRNG
| `-- kismet:WARNING:unmet-direct-dependencies-detected-for-HALTPOLL_CPUIDLE-when-selected-by-ARM64
|-- arm64-randconfig-001-20250411
| |-- drivers-net-ethernet-huawei-hinic-hinic_dcb.c:error:DCB_ATTR_VALUE_UNDEFINED-undeclared-(first-use-in-this-function)
| |-- drivers-net-ethernet-huawei-hinic-hinic_dcb.c:error:DCB_CAP_ATTR_BCN-undeclared-(first-use-in-this-function)
| |-- drivers-net-ethernet-huawei-hinic-hinic_dcb.c:error:DCB_CAP_ATTR_PG_TCS-undeclared-(first-use-in-this-function)
| |-- drivers-net-ethernet-huawei-hinic-hinic_dcb.c:error:DCB_CAP_DCBX_HOST-undeclared-(first-use-in-this-function)
| |-- drivers-net-ethernet-huawei-hinic-hinic_dcb.c:error:DCB_CAP_DCBX_VER_CEE-undeclared-(first-use-in-this-function)
| |-- drivers-net-ethernet-huawei-hinic-hinic_dcb.c:error:DCB_CAP_DCBX_VER_IEEE-undeclared-(first-use-in-this-function)
| |-- drivers-net-ethernet-huawei-hinic-hinic_dcb.c:error:DCB_NUMTCS_ATTR_PG-undeclared-(first-use-in-this-function)
| |-- drivers-net-ethernet-huawei-hinic-hinic_dcb.c:error:const-struct-dcbnl_rtnl_ops-has-no-member-named-getcap
| |-- drivers-net-ethernet-huawei-hinic-hinic_dcb.c:error:const-struct-dcbnl_rtnl_ops-has-no-member-named-getnumtcs
| |-- drivers-net-ethernet-huawei-hinic-hinic_dcb.c:error:const-struct-dcbnl_rtnl_ops-has-no-member-named-getpfccfg
| |-- drivers-net-ethernet-huawei-hinic-hinic_dcb.c:error:const-struct-dcbnl_rtnl_ops-has-no-member-named-getpgbwgcfgtx
| |-- drivers-net-ethernet-huawei-hinic-hinic_dcb.c:error:const-struct-dcbnl_rtnl_ops-has-no-member-named-getpgtccfgrx
| |-- drivers-net-ethernet-huawei-hinic-hinic_dcb.c:error:const-struct-dcbnl_rtnl_ops-has-no-member-named-ieee_setets
| |-- drivers-net-ethernet-huawei-hinic-hinic_dcb.c:error:const-struct-dcbnl_rtnl_ops-has-no-member-named-ieee_setpfc
| |-- drivers-net-ethernet-huawei-hinic-hinic_dcb.c:error:const-struct-dcbnl_rtnl_ops-has-no-member-named-setdcbx
| |-- drivers-net-ethernet-huawei-hinic-hinic_dcb.c:error:const-struct-dcbnl_rtnl_ops-has-no-member-named-setnumtcs
| |-- drivers-net-ethernet-huawei-hinic-hinic_dcb.c:error:const-struct-dcbnl_rtnl_ops-has-no-member-named-setpfccfg
| |-- drivers-net-ethernet-huawei-hinic-hinic_dcb.c:error:const-struct-dcbnl_rtnl_ops-has-no-member-named-setpfcstate
| |-- drivers-net-ethernet-huawei-hinic-hinic_dcb.c:error:const-struct-dcbnl_rtnl_ops-has-no-member-named-setpgbwgcfgtx
| |-- drivers-net-ethernet-huawei-hinic-hinic_dcb.c:error:const-struct-dcbnl_rtnl_ops-has-no-member-named-setpgtccfgrx
| |-- drivers-net-ethernet-huawei-hinic-hinic_dcb.c:error:const-struct-dcbnl_rtnl_ops-has-no-member-named-setpgtccfgtx
| |-- drivers-net-ethernet-huawei-hinic-hinic_dcb.c:error:const-struct-dcbnl_rtnl_ops-has-no-member-named-setstate
| |-- drivers-net-ethernet-huawei-hinic-hinic_dcb.c:error:invalid-application-of-sizeof-to-incomplete-type-struct-ieee_ets
| |-- drivers-net-ethernet-huawei-hinic-hinic_dcb.c:error:invalid-application-of-sizeof-to-incomplete-type-struct-ieee_pfc
| |-- drivers-net-ethernet-huawei-hinic-hinic_dcb.c:error:storage-size-of-pfc-isn-t-known
| |-- drivers-net-ethernet-huawei-hinic-hinic_dcb.c:error:variable-hinic_dcbnl_ops-has-initializer-but-incomplete-type
| |-- drivers-net-ethernet-huawei-hinic-hinic_dcb.c:error:variable-pfc-has-initializer-but-incomplete-type
| |-- drivers-net-ethernet-huawei-hinic-hinic_main.c:error:struct-net_device-has-no-member-named-dcbnl_ops
| |-- drivers-net-ethernet-huawei-hinic-hinic_nic_dev.h:error:field-hinic_ieee_ets-has-incomplete-type
| `-- drivers-net-ethernet-huawei-hinic-hinic_nic_dev.h:error:field-hinic_ieee_ets_default-has-incomplete-type
|-- arm64-randconfig-002-20250411
| |-- aarch64-linux-ld:Unexpected-GOT-PLT-entries-detected
| `-- aarch64-linux-ld:Unexpected-run-time-procedure-linkages-detected
|-- loongarch-allmodconfig
| |-- arch-loongarch-mm-cache.c:warning:variable-way_size-set-but-not-used
| |-- drivers-scsi-linkdata-ps3stor-.-linux-ps3_base.c:error:no-previous-prototype-for-ps3_pci_init
| |-- drivers-scsi-linkdata-ps3stor-.-linux-ps3_base.c:error:no-previous-prototype-for-ps3_pci_init_complete
| |-- drivers-scsi-linkdata-ps3stor-.-linux-ps3_base.c:error:no-previous-prototype-for-ps3_pci_init_complete_exit
| |-- drivers-scsi-linkdata-ps3stor-.-linux-ps3_cli.c:error:function-ps3stor_cli_printf-might-be-a-candidate-for-gnu_printf-format-attribute
| |-- drivers-scsi-linkdata-ps3stor-.-linux-ps3_cli_debug.c:error:no-previous-prototype-for-ps3_dump_context_show
| |-- drivers-scsi-linkdata-ps3stor-.-linux-ps3_dump.c:error:no-previous-prototype-for-ps3_dump_file_close
| |-- drivers-scsi-linkdata-ps3stor-.-linux-ps3_dump.c:error:no-previous-prototype-for-ps3_dump_file_open
| |-- drivers-scsi-linkdata-ps3stor-.-linux-ps3_dump.c:error:no-previous-prototype-for-ps3_dump_file_write
| |-- drivers-scsi-linkdata-ps3stor-.-linux-ps3_dump.c:error:no-previous-prototype-for-ps3_dump_filename_build
| |-- drivers-scsi-linkdata-ps3stor-.-linux-ps3_dump.c:error:no-previous-prototype-for-ps3_dump_local_time
| |-- drivers-scsi-linkdata-ps3stor-ps3_cmd_complete.c:error:no-previous-prototype-for-ps3_resp_status_convert
| |-- drivers-scsi-linkdata-ps3stor-ps3_cmd_complete.c:error:no-previous-prototype-for-ps3_trigger_irq_poll
| |-- drivers-scsi-linkdata-ps3stor-ps3_cmd_statistics.c:error:no-previous-prototype-for-ps3_cmd_stat_content_clear
| |-- drivers-scsi-linkdata-ps3stor-ps3_cmd_statistics.c:error:no-previous-prototype-for-ps3_io_recv_ok_stat_inc
| |-- drivers-scsi-linkdata-ps3stor-ps3_debug.c:error:no-previous-prototype-for-ps3_dump_dir_length
| |-- drivers-scsi-linkdata-ps3stor-ps3_device_manager.c:error:no-previous-prototype-for-ps3_scsi_private_init_pd
| |-- drivers-scsi-linkdata-ps3stor-ps3_device_manager.c:error:no-previous-prototype-for-ps3_scsi_private_init_vd
| |-- drivers-scsi-linkdata-ps3stor-ps3_device_manager_sas.c:error:no-previous-prototype-for-ps3_sas_expander_phys_refresh
| |-- drivers-scsi-linkdata-ps3stor-ps3_instance_manager.c:error:snprintf-output-may-be-truncated-before-the-last-format-character
| |-- drivers-scsi-linkdata-ps3stor-ps3_ioc_adp.c:error:no-previous-prototype-for-ps3_ioc_resource_prepare_hba
| |-- drivers-scsi-linkdata-ps3stor-ps3_ioc_adp.c:error:no-previous-prototype-for-ps3_ioc_resource_prepare_raid
| |-- drivers-scsi-linkdata-ps3stor-ps3_ioc_adp.c:error:no-previous-prototype-for-ps3_ioc_resource_prepare_switch
| |-- drivers-scsi-linkdata-ps3stor-ps3_ioc_manager.c:error:no-previous-prototype-for-ps3_hard_reset_to_ready
| |-- drivers-scsi-linkdata-ps3stor-ps3_ioctl.c:error:no-previous-prototype-for-ps3_clean_mgr_cmd
| |-- drivers-scsi-linkdata-ps3stor-ps3_irq.c:error:PS3_HDD_IOPS_MSIX_VECTORS-defined-but-not-used
| |-- drivers-scsi-linkdata-ps3stor-ps3_irq.c:error:PS3_INTERRUPT_CLEAR_IRQ-defined-but-not-used
| |-- drivers-scsi-linkdata-ps3stor-ps3_irq.c:error:PS3_INTERRUPT_CMD_DISABLE_ALL_MASK-defined-but-not-used
| |-- drivers-scsi-linkdata-ps3stor-ps3_irq.c:error:PS3_INTERRUPT_CMD_ENABLE_MSIX-defined-but-not-used
| |-- drivers-scsi-linkdata-ps3stor-ps3_irq.c:error:PS3_INTERRUPT_MASK_DISABLE-defined-but-not-used
| |-- drivers-scsi-linkdata-ps3stor-ps3_irq.c:error:PS3_INTERRUPT_STATUS_EXIST_IRQ-defined-but-not-used
| |-- drivers-scsi-linkdata-ps3stor-ps3_irq.c:error:PS3_SSD_IOPS_MSIX_VECTORS-defined-but-not-used
| |-- drivers-scsi-linkdata-ps3stor-ps3_module_para.c:error:no-previous-prototype-for-ps3_cli_ver_query
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_cmd_waitq_abort
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_hba_qos_decision
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_hba_qos_vd_init
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_hba_qos_vd_reset
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_hba_qos_waitq_clear_all
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_hba_qos_waitq_notify
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_hba_qos_waitq_poll
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_pd_quota_waitq_clean
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_pd_quota_waitq_clear_all
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_qos_all_pd_rc_get
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_qos_cmd_waitq_get
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_qos_exclusive_cmdword_get
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_qos_mgrq_resend
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_qos_pd_waitq_ratio_update
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_qos_tg_decision
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_qos_vd_cmdword_get
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_raid_qos_decision
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_raid_qos_waitq_abort
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_raid_qos_waitq_clear_all
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_raid_qos_waitq_notify
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_raid_qos_waitq_poll
| |-- drivers-scsi-linkdata-ps3stor-ps3_r1x_write_lock.c:error:no-previous-prototype-for-ps3_r1x_conflict_queue_hash_bit_lock
| |-- drivers-scsi-linkdata-ps3stor-ps3_r1x_write_lock.c:error:no-previous-prototype-for-ps3_r1x_hash_bit_check
| |-- drivers-scsi-linkdata-ps3stor-ps3_r1x_write_lock.c:error:no-previous-prototype-for-ps3_r1x_hash_bit_lock
| |-- drivers-scsi-linkdata-ps3stor-ps3_r1x_write_lock.c:error:no-previous-prototype-for-ps3_r1x_hash_bit_unlock
| |-- drivers-scsi-linkdata-ps3stor-ps3_r1x_write_lock.c:error:no-previous-prototype-for-ps3_r1x_hash_range_lock
| |-- drivers-scsi-linkdata-ps3stor-ps3_r1x_write_lock.c:error:no-previous-prototype-for-ps3_r1x_hash_range_unlock
| |-- drivers-scsi-linkdata-ps3stor-ps3_r1x_write_lock.c:error:no-previous-prototype-for-ps3_range_check_and_insert
| |-- drivers-scsi-linkdata-ps3stor-ps3_rb_tree.c:error:no-previous-prototype-for-rbtDelNodeDo
| |-- drivers-scsi-linkdata-ps3stor-ps3_recovery.c:error:no-previous-prototype-for-ps3_hard_recovery_state_finish
| |-- drivers-scsi-linkdata-ps3stor-ps3_recovery.c:error:no-previous-prototype-for-ps3_recovery_context_alloc
| |-- drivers-scsi-linkdata-ps3stor-ps3_recovery.c:error:no-previous-prototype-for-ps3_recovery_context_delete
| |-- drivers-scsi-linkdata-ps3stor-ps3_recovery.c:error:no-previous-prototype-for-ps3_recovery_context_free
| |-- drivers-scsi-linkdata-ps3stor-ps3_recovery.c:error:no-previous-prototype-for-ps3_recovery_irq_queue_destroy
| |-- drivers-scsi-linkdata-ps3stor-ps3_recovery.c:error:no-previous-prototype-for-ps3_recovery_state_transfer
| |-- drivers-scsi-linkdata-ps3stor-ps3_sas_transport.c:error:no-previous-prototype-for-ps3_sas_update_phy_info
| |-- drivers-scsi-linkdata-ps3stor-ps3_scsi_cmd_err.c:error:no-previous-prototype-for-ps3_set_task_manager_busy
| `-- drivers-scsi-linkdata-ps3stor-ps3_scsi_cmd_err.c:error:no-previous-prototype-for-ps3_wait_for_outstanding_complete
|-- loongarch-allnoconfig
| `-- arch-loongarch-mm-cache.c:warning:variable-way_size-set-but-not-used
|-- loongarch-allyesconfig
| |-- arch-loongarch-mm-cache.c:warning:variable-way_size-set-but-not-used
| |-- drivers-scsi-linkdata-ps3stor-.-linux-ps3_base.c:error:no-previous-prototype-for-ps3_pci_init
| |-- drivers-scsi-linkdata-ps3stor-.-linux-ps3_base.c:error:no-previous-prototype-for-ps3_pci_init_complete
| |-- drivers-scsi-linkdata-ps3stor-.-linux-ps3_base.c:error:no-previous-prototype-for-ps3_pci_init_complete_exit
| |-- drivers-scsi-linkdata-ps3stor-.-linux-ps3_cli.c:error:function-ps3stor_cli_printf-might-be-a-candidate-for-gnu_printf-format-attribute
| |-- drivers-scsi-linkdata-ps3stor-.-linux-ps3_cli_debug.c:error:no-previous-prototype-for-ps3_dump_context_show
| |-- drivers-scsi-linkdata-ps3stor-.-linux-ps3_dump.c:error:no-previous-prototype-for-ps3_dump_file_close
| |-- drivers-scsi-linkdata-ps3stor-.-linux-ps3_dump.c:error:no-previous-prototype-for-ps3_dump_file_open
| |-- drivers-scsi-linkdata-ps3stor-.-linux-ps3_dump.c:error:no-previous-prototype-for-ps3_dump_file_write
| |-- drivers-scsi-linkdata-ps3stor-.-linux-ps3_dump.c:error:no-previous-prototype-for-ps3_dump_filename_build
| |-- drivers-scsi-linkdata-ps3stor-.-linux-ps3_dump.c:error:no-previous-prototype-for-ps3_dump_local_time
| |-- drivers-scsi-linkdata-ps3stor-ps3_cmd_complete.c:error:no-previous-prototype-for-ps3_resp_status_convert
| |-- drivers-scsi-linkdata-ps3stor-ps3_cmd_complete.c:error:no-previous-prototype-for-ps3_trigger_irq_poll
| |-- drivers-scsi-linkdata-ps3stor-ps3_cmd_statistics.c:error:no-previous-prototype-for-ps3_cmd_stat_content_clear
| |-- drivers-scsi-linkdata-ps3stor-ps3_cmd_statistics.c:error:no-previous-prototype-for-ps3_io_recv_ok_stat_inc
| |-- drivers-scsi-linkdata-ps3stor-ps3_debug.c:error:no-previous-prototype-for-ps3_dump_dir_length
| |-- drivers-scsi-linkdata-ps3stor-ps3_device_manager.c:error:no-previous-prototype-for-ps3_scsi_private_init_pd
| |-- drivers-scsi-linkdata-ps3stor-ps3_device_manager.c:error:no-previous-prototype-for-ps3_scsi_private_init_vd
| |-- drivers-scsi-linkdata-ps3stor-ps3_device_manager_sas.c:error:no-previous-prototype-for-ps3_sas_expander_phys_refresh
| |-- drivers-scsi-linkdata-ps3stor-ps3_instance_manager.c:error:snprintf-output-may-be-truncated-before-the-last-format-character
| |-- drivers-scsi-linkdata-ps3stor-ps3_ioc_adp.c:error:no-previous-prototype-for-ps3_ioc_resource_prepare_hba
| |-- drivers-scsi-linkdata-ps3stor-ps3_ioc_adp.c:error:no-previous-prototype-for-ps3_ioc_resource_prepare_raid
| |-- drivers-scsi-linkdata-ps3stor-ps3_ioc_adp.c:error:no-previous-prototype-for-ps3_ioc_resource_prepare_switch
| |-- drivers-scsi-linkdata-ps3stor-ps3_ioc_manager.c:error:no-previous-prototype-for-ps3_hard_reset_to_ready
| |-- drivers-scsi-linkdata-ps3stor-ps3_ioctl.c:error:no-previous-prototype-for-ps3_clean_mgr_cmd
| |-- drivers-scsi-linkdata-ps3stor-ps3_irq.c:error:PS3_HDD_IOPS_MSIX_VECTORS-defined-but-not-used
| |-- drivers-scsi-linkdata-ps3stor-ps3_irq.c:error:PS3_INTERRUPT_CLEAR_IRQ-defined-but-not-used
| |-- drivers-scsi-linkdata-ps3stor-ps3_irq.c:error:PS3_INTERRUPT_CMD_DISABLE_ALL_MASK-defined-but-not-used
| |-- drivers-scsi-linkdata-ps3stor-ps3_irq.c:error:PS3_INTERRUPT_CMD_ENABLE_MSIX-defined-but-not-used
| |-- drivers-scsi-linkdata-ps3stor-ps3_irq.c:error:PS3_INTERRUPT_MASK_DISABLE-defined-but-not-used
| |-- drivers-scsi-linkdata-ps3stor-ps3_irq.c:error:PS3_INTERRUPT_STATUS_EXIST_IRQ-defined-but-not-used
| |-- drivers-scsi-linkdata-ps3stor-ps3_irq.c:error:PS3_SSD_IOPS_MSIX_VECTORS-defined-but-not-used
| |-- drivers-scsi-linkdata-ps3stor-ps3_module_para.c:error:no-previous-prototype-for-ps3_cli_ver_query
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_cmd_waitq_abort
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_hba_qos_decision
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_hba_qos_vd_init
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_hba_qos_vd_reset
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_hba_qos_waitq_clear_all
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_hba_qos_waitq_notify
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_hba_qos_waitq_poll
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_pd_quota_waitq_clean
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_pd_quota_waitq_clear_all
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_qos_all_pd_rc_get
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_qos_cmd_waitq_get
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_qos_exclusive_cmdword_get
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_qos_mgrq_resend
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_qos_pd_waitq_ratio_update
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_qos_tg_decision
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_qos_vd_cmdword_get
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_raid_qos_decision
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_raid_qos_waitq_abort
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_raid_qos_waitq_clear_all
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_raid_qos_waitq_notify
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_raid_qos_waitq_poll
| |-- drivers-scsi-linkdata-ps3stor-ps3_r1x_write_lock.c:error:no-previous-prototype-for-ps3_r1x_conflict_queue_hash_bit_lock
| |-- drivers-scsi-linkdata-ps3stor-ps3_r1x_write_lock.c:error:no-previous-prototype-for-ps3_r1x_hash_bit_check
| |-- drivers-scsi-linkdata-ps3stor-ps3_r1x_write_lock.c:error:no-previous-prototype-for-ps3_r1x_hash_bit_lock
| |-- drivers-scsi-linkdata-ps3stor-ps3_r1x_write_lock.c:error:no-previous-prototype-for-ps3_r1x_hash_bit_unlock
| |-- drivers-scsi-linkdata-ps3stor-ps3_r1x_write_lock.c:error:no-previous-prototype-for-ps3_r1x_hash_range_lock
| |-- drivers-scsi-linkdata-ps3stor-ps3_r1x_write_lock.c:error:no-previous-prototype-for-ps3_r1x_hash_range_unlock
| |-- drivers-scsi-linkdata-ps3stor-ps3_r1x_write_lock.c:error:no-previous-prototype-for-ps3_range_check_and_insert
| |-- drivers-scsi-linkdata-ps3stor-ps3_rb_tree.c:error:no-previous-prototype-for-rbtDelNodeDo
| |-- drivers-scsi-linkdata-ps3stor-ps3_recovery.c:error:no-previous-prototype-for-ps3_hard_recovery_state_finish
| |-- drivers-scsi-linkdata-ps3stor-ps3_recovery.c:error:no-previous-prototype-for-ps3_recovery_context_alloc
| |-- drivers-scsi-linkdata-ps3stor-ps3_recovery.c:error:no-previous-prototype-for-ps3_recovery_context_delete
| |-- drivers-scsi-linkdata-ps3stor-ps3_recovery.c:error:no-previous-prototype-for-ps3_recovery_context_free
| |-- drivers-scsi-linkdata-ps3stor-ps3_recovery.c:error:no-previous-prototype-for-ps3_recovery_irq_queue_destroy
| |-- drivers-scsi-linkdata-ps3stor-ps3_recovery.c:error:no-previous-prototype-for-ps3_recovery_state_transfer
| |-- drivers-scsi-linkdata-ps3stor-ps3_sas_transport.c:error:no-previous-prototype-for-ps3_sas_update_phy_info
| |-- drivers-scsi-linkdata-ps3stor-ps3_scsi_cmd_err.c:error:no-previous-prototype-for-ps3_set_task_manager_busy
| `-- drivers-scsi-linkdata-ps3stor-ps3_scsi_cmd_err.c:error:no-previous-prototype-for-ps3_wait_for_outstanding_complete
|-- loongarch-defconfig
| `-- arch-loongarch-mm-cache.c:warning:variable-way_size-set-but-not-used
|-- loongarch-randconfig-002-20250411
| `-- arch-loongarch-mm-cache.c:warning:variable-way_size-set-but-not-used
|-- loongarch-randconfig-r062-20250412
| |-- arch-loongarch-mm-cache.c:warning:variable-way_size-set-but-not-used
| |-- drivers-scsi-linkdata-ps3stor-.-linux-ps3_base.c:error:no-previous-prototype-for-ps3_pci_init
| |-- drivers-scsi-linkdata-ps3stor-.-linux-ps3_base.c:error:no-previous-prototype-for-ps3_pci_init_complete
| |-- drivers-scsi-linkdata-ps3stor-.-linux-ps3_base.c:error:no-previous-prototype-for-ps3_pci_init_complete_exit
| |-- drivers-scsi-linkdata-ps3stor-.-linux-ps3_cli.c:error:function-ps3stor_cli_printf-might-be-a-candidate-for-gnu_printf-format-attribute
| |-- drivers-scsi-linkdata-ps3stor-.-linux-ps3_cli_debug.c:error:no-previous-prototype-for-ps3_dump_context_show
| |-- drivers-scsi-linkdata-ps3stor-.-linux-ps3_dump.c:error:no-previous-prototype-for-ps3_dump_file_close
| |-- drivers-scsi-linkdata-ps3stor-.-linux-ps3_dump.c:error:no-previous-prototype-for-ps3_dump_file_open
| |-- drivers-scsi-linkdata-ps3stor-.-linux-ps3_dump.c:error:no-previous-prototype-for-ps3_dump_file_write
| |-- drivers-scsi-linkdata-ps3stor-.-linux-ps3_dump.c:error:no-previous-prototype-for-ps3_dump_filename_build
| |-- drivers-scsi-linkdata-ps3stor-.-linux-ps3_dump.c:error:no-previous-prototype-for-ps3_dump_local_time
| |-- drivers-scsi-linkdata-ps3stor-ps3_cmd_complete.c:error:no-previous-prototype-for-ps3_resp_status_convert
| |-- drivers-scsi-linkdata-ps3stor-ps3_cmd_complete.c:error:no-previous-prototype-for-ps3_trigger_irq_poll
| |-- drivers-scsi-linkdata-ps3stor-ps3_cmd_statistics.c:error:no-previous-prototype-for-ps3_cmd_stat_content_clear
| |-- drivers-scsi-linkdata-ps3stor-ps3_cmd_statistics.c:error:no-previous-prototype-for-ps3_io_recv_ok_stat_inc
| |-- drivers-scsi-linkdata-ps3stor-ps3_debug.c:error:no-previous-prototype-for-ps3_dump_dir_length
| |-- drivers-scsi-linkdata-ps3stor-ps3_device_manager.c:error:no-previous-prototype-for-ps3_scsi_private_init_pd
| |-- drivers-scsi-linkdata-ps3stor-ps3_device_manager.c:error:no-previous-prototype-for-ps3_scsi_private_init_vd
| |-- drivers-scsi-linkdata-ps3stor-ps3_device_manager_sas.c:error:no-previous-prototype-for-ps3_sas_expander_phys_refresh
| |-- drivers-scsi-linkdata-ps3stor-ps3_instance_manager.c:error:snprintf-output-may-be-truncated-before-the-last-format-character
| |-- drivers-scsi-linkdata-ps3stor-ps3_ioc_adp.c:error:no-previous-prototype-for-ps3_ioc_resource_prepare_hba
| |-- drivers-scsi-linkdata-ps3stor-ps3_ioc_adp.c:error:no-previous-prototype-for-ps3_ioc_resource_prepare_raid
| |-- drivers-scsi-linkdata-ps3stor-ps3_ioc_adp.c:error:no-previous-prototype-for-ps3_ioc_resource_prepare_switch
| |-- drivers-scsi-linkdata-ps3stor-ps3_ioc_manager.c:error:no-previous-prototype-for-ps3_hard_reset_to_ready
| |-- drivers-scsi-linkdata-ps3stor-ps3_ioctl.c:error:no-previous-prototype-for-ps3_clean_mgr_cmd
| |-- drivers-scsi-linkdata-ps3stor-ps3_irq.c:error:PS3_HDD_IOPS_MSIX_VECTORS-defined-but-not-used
| |-- drivers-scsi-linkdata-ps3stor-ps3_irq.c:error:PS3_INTERRUPT_CLEAR_IRQ-defined-but-not-used
| |-- drivers-scsi-linkdata-ps3stor-ps3_irq.c:error:PS3_INTERRUPT_CMD_DISABLE_ALL_MASK-defined-but-not-used
| |-- drivers-scsi-linkdata-ps3stor-ps3_irq.c:error:PS3_INTERRUPT_CMD_ENABLE_MSIX-defined-but-not-used
| |-- drivers-scsi-linkdata-ps3stor-ps3_irq.c:error:PS3_INTERRUPT_MASK_DISABLE-defined-but-not-used
| |-- drivers-scsi-linkdata-ps3stor-ps3_irq.c:error:PS3_INTERRUPT_STATUS_EXIST_IRQ-defined-but-not-used
| |-- drivers-scsi-linkdata-ps3stor-ps3_irq.c:error:PS3_SSD_IOPS_MSIX_VECTORS-defined-but-not-used
| |-- drivers-scsi-linkdata-ps3stor-ps3_module_para.c:error:no-previous-prototype-for-ps3_cli_ver_query
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_cmd_waitq_abort
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_hba_qos_decision
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_hba_qos_vd_init
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_hba_qos_vd_reset
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_hba_qos_waitq_clear_all
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_hba_qos_waitq_notify
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_hba_qos_waitq_poll
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_pd_quota_waitq_clean
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_pd_quota_waitq_clear_all
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_qos_all_pd_rc_get
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_qos_cmd_waitq_get
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_qos_exclusive_cmdword_get
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_qos_mgrq_resend
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_qos_pd_waitq_ratio_update
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_qos_tg_decision
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_qos_vd_cmdword_get
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_raid_qos_decision
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_raid_qos_waitq_abort
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_raid_qos_waitq_clear_all
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_raid_qos_waitq_notify
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_raid_qos_waitq_poll
| |-- drivers-scsi-linkdata-ps3stor-ps3_r1x_write_lock.c:error:no-previous-prototype-for-ps3_r1x_conflict_queue_hash_bit_lock
| |-- drivers-scsi-linkdata-ps3stor-ps3_r1x_write_lock.c:error:no-previous-prototype-for-ps3_r1x_hash_bit_check
| |-- drivers-scsi-linkdata-ps3stor-ps3_r1x_write_lock.c:error:no-previous-prototype-for-ps3_r1x_hash_bit_lock
| |-- drivers-scsi-linkdata-ps3stor-ps3_r1x_write_lock.c:error:no-previous-prototype-for-ps3_r1x_hash_bit_unlock
| |-- drivers-scsi-linkdata-ps3stor-ps3_r1x_write_lock.c:error:no-previous-prototype-for-ps3_r1x_hash_range_lock
| |-- drivers-scsi-linkdata-ps3stor-ps3_r1x_write_lock.c:error:no-previous-prototype-for-ps3_r1x_hash_range_unlock
| |-- drivers-scsi-linkdata-ps3stor-ps3_r1x_write_lock.c:error:no-previous-prototype-for-ps3_range_check_and_insert
| |-- drivers-scsi-linkdata-ps3stor-ps3_rb_tree.c:error:no-previous-prototype-for-rbtDelNodeDo
| |-- drivers-scsi-linkdata-ps3stor-ps3_recovery.c:error:no-previous-prototype-for-ps3_hard_recovery_state_finish
| |-- drivers-scsi-linkdata-ps3stor-ps3_recovery.c:error:no-previous-prototype-for-ps3_recovery_context_alloc
| |-- drivers-scsi-linkdata-ps3stor-ps3_recovery.c:error:no-previous-prototype-for-ps3_recovery_context_delete
| |-- drivers-scsi-linkdata-ps3stor-ps3_recovery.c:error:no-previous-prototype-for-ps3_recovery_context_free
| |-- drivers-scsi-linkdata-ps3stor-ps3_recovery.c:error:no-previous-prototype-for-ps3_recovery_irq_queue_destroy
| |-- drivers-scsi-linkdata-ps3stor-ps3_recovery.c:error:no-previous-prototype-for-ps3_recovery_state_transfer
| |-- drivers-scsi-linkdata-ps3stor-ps3_sas_transport.c:error:no-previous-prototype-for-ps3_sas_update_phy_info
| |-- drivers-scsi-linkdata-ps3stor-ps3_scsi_cmd_err.c:error:no-previous-prototype-for-ps3_set_task_manager_busy
| `-- drivers-scsi-linkdata-ps3stor-ps3_scsi_cmd_err.c:error:no-previous-prototype-for-ps3_wait_for_outstanding_complete
|-- x86_64-allnoconfig
| |-- kismet:WARNING:unmet-direct-dependencies-detected-for-ACPI_HOTPLUG_IGNORE_OSC-when-selected-by-X86
| `-- mm-oom_kill.c:linux-nmi.h-is-included-more-than-once.
|-- x86_64-buildonly-randconfig-006-20250411
| `-- drivers-gpu-drm-sti-sti_dvo.c:error:implicit-declaration-of-function-devm_ioremap
`-- x86_64-defconfig
`-- mm-mempolicy.c:warning:writing-byte-into-a-region-of-size
elapsed time: 1443m
configs tested: 21
configs skipped: 122
tested configs:
arm64 allmodconfig clang-19
arm64 allnoconfig gcc-14.2.0
arm64 defconfig gcc-14.2.0
arm64 randconfig-001-20250411 gcc-9.5.0
arm64 randconfig-002-20250411 gcc-9.5.0
arm64 randconfig-003-20250411 clang-21
arm64 randconfig-004-20250411 clang-21
loongarch allmodconfig gcc-14.2.0
loongarch allnoconfig gcc-14.2.0
loongarch defconfig gcc-14.2.0
loongarch randconfig-001-20250411 gcc-14.2.0
loongarch randconfig-002-20250411 gcc-14.2.0
x86_64 allnoconfig clang-20
x86_64 allyesconfig clang-20
x86_64 buildonly-randconfig-001-20250411 gcc-11
x86_64 buildonly-randconfig-002-20250411 gcc-11
x86_64 buildonly-randconfig-003-20250411 clang-20
x86_64 buildonly-randconfig-004-20250411 gcc-12
x86_64 buildonly-randconfig-005-20250411 clang-20
x86_64 buildonly-randconfig-006-20250411 gcc-12
x86_64 defconfig gcc-11
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
1
0

[openeuler:OLK-5.10] BUILD REGRESSION 8cf05d37849321b8bb9b74e099fa5bb6164d4f56
by kernel test robot 12 Apr '25
by kernel test robot 12 Apr '25
12 Apr '25
tree/branch: https://gitee.com/openeuler/kernel.git OLK-5.10
branch HEAD: 8cf05d37849321b8bb9b74e099fa5bb6164d4f56 !15828 mt76: fix use-after-free by removing a non-RCU wcid pointer
Error/Warning (recently discovered and may have been fixed):
https://lore.kernel.org/oe-kbuild-all/202503171920.f4jVchcy-lkp@intel.com
https://lore.kernel.org/oe-kbuild-all/202503181406.E4pR441t-lkp@intel.com
https://lore.kernel.org/oe-kbuild-all/202503220351.uj1q69QX-lkp@intel.com
https://lore.kernel.org/oe-kbuild-all/202503220607.nbhzXKry-lkp@intel.com
https://lore.kernel.org/oe-kbuild-all/202504120007.4O7NSSul-lkp@intel.com
drivers/scsi/linkdata/ps3stor/./linux/ps3_driver_log.c:41:19: error: unused function 'time_for_log' [-Werror,-Wunused-function]
drivers/scsi/linkdata/ps3stor/./linux/ps3_driver_log.c:65:19: error: unused function 'time_for_file_name' [-Werror,-Wunused-function]
drivers/scsi/linkdata/ps3stor/ps3_irq.c:22:27: error: unused variable 'PS3_INTERRUPT_CMD_DISABLE_ALL_MASK' [-Werror,-Wunused-const-variable]
drivers/scsi/linkdata/ps3stor/ps3_irq.c:23:27: error: unused variable 'PS3_INTERRUPT_CMD_ENABLE_MSIX' [-Werror,-Wunused-const-variable]
drivers/scsi/linkdata/ps3stor/ps3_irq.c:24:27: error: unused variable 'PS3_INTERRUPT_MASK_DISABLE' [-Werror,-Wunused-const-variable]
drivers/scsi/linkdata/ps3stor/ps3_irq.c:25:27: error: unused variable 'PS3_INTERRUPT_STATUS_EXIST_IRQ' [-Werror,-Wunused-const-variable]
drivers/scsi/linkdata/ps3stor/ps3_irq.c:26:27: error: unused variable 'PS3_INTERRUPT_CLEAR_IRQ' [-Werror,-Wunused-const-variable]
drivers/scsi/linkdata/ps3stor/ps3_irq.c:28:27: error: unused variable 'PS3_SSD_IOPS_MSIX_VECTORS' [-Werror,-Wunused-const-variable]
drivers/scsi/linkdata/ps3stor/ps3_irq.c:29:27: error: unused variable 'PS3_HDD_IOPS_MSIX_VECTORS' [-Werror,-Wunused-const-variable]
drivers/scsi/linkdata/ps3stor/ps3_qos.c:3024:6: error: no previous prototype for function 'ps3_hba_qos_waitq_poll' [-Werror,-Wmissing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_qos.c:3280:15: error: no previous prototype for function 'ps3_raid_qos_decision' [-Werror,-Wmissing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_qos.c:3335:6: error: no previous prototype for function 'ps3_qos_mgrq_resend' [-Werror,-Wmissing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_qos.c:3479:6: error: no previous prototype for function 'ps3_raid_qos_waitq_notify' [-Werror,-Wmissing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_qos.c:3822:15: error: no previous prototype for function 'ps3_raid_qos_waitq_abort' [-Werror,-Wmissing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_scsih.c:1959:1: error: unused function 'ps3_scsih_dev_id_get' [-Werror,-Wunused-function]
kismet: WARNING: unmet direct dependencies detected for CPPC_CPUFREQ_SYSFS_INTERFACE when selected by CPU_FREQ_GOV_SEEP
ld.lld: error: version script assignment of 'LINUX_2.6' to symbol '__vdso_sgx_enter_enclave' failed: symbol not defined
llvm-objcopy: error: 'arch/x86/entry/vdso/vdso64.so.dbg': No such file or directory
llvm-objdump: error: 'arch/x86/entry/vdso/vdso64.so.dbg': No such file or directory
Unverified Error/Warning (likely false positive, kindly check if interested):
drivers/block/rnbd/rnbd-srv-sysfs.c:56 rnbd_srv_create_dev_sysfs() warn: missing error code 'ret'
drivers/gpu/drm/amd/amdgpu/dce_v10_0.o: warning: objtool: dce_v10_0_bandwidth_update() falls through to next function dce_v10_0_vblank_get_counter()
drivers/gpu/drm/amd/amdgpu/dce_v11_0.o: warning: objtool: dce_v11_0_bandwidth_update() falls through to next function dce_v11_0_vblank_get_counter()
drivers/gpu/drm/amd/amdgpu/dce_v6_0.o: warning: objtool: dce_v6_0_program_watermarks() falls through to next function dce_v6_0_latency_watermark()
drivers/gpu/drm/radeon/cik.o: warning: objtool: dce8_bandwidth_update() falls through to next function cik_get_gpu_clock_counter()
drivers/gpu/drm/radeon/evergreen.o: warning: objtool: evergreen_program_watermarks() falls through to next function evergreen_mc_wait_for_idle()
drivers/gpu/drm/radeon/si.o: warning: objtool: dce6_program_watermarks() falls through to next function si_fence_ring_emit()
drivers/gpu/drm/vmwgfx/vmwgfx_fb.o: warning: objtool: vmw_deferred_io() falls through to next function asan.module_ctor()
drivers/media/test-drivers/vivid/vivid-kthread-cap.o: warning: objtool: vivid_thread_vid_cap_tick() falls through to next function plane_vaddr()
drivers/media/tuners/e4000.o: warning: objtool: e4000_set_params() falls through to next function e4000_standby()
drivers/nvdimm/namespace_devs.o: warning: objtool: size_store() falls through to next function nd_namespace_label_update()
drivers/video/fbdev/hyperv_fb.o: warning: objtool: synthvid_deferred_io() falls through to next function hvfb_pci_stub_probe()
fs/btrfs/free-space-cache.o: warning: objtool: add_bytes_to_bitmap() falls through to next function recalculate_thresholds()
fs/btrfs/free-space-cache.o: warning: objtool: btrfs_alloc_from_cluster() falls through to next function btrfs_find_space_cluster()
fs/btrfs/free-space-cache.o: warning: objtool: setup_cluster_bitmap() falls through to next function btrfs_init_free_cluster()
fs/btrfs/free-space-cache.o: warning: objtool: steal_from_bitmap() falls through to next function link_free_space()
fs/btrfs/free-space-tree.o: warning: objtool: modify_free_space_bitmap() falls through to next function free_space_test_bit()
fs/btrfs/free-space-tree.o: warning: objtool: update_free_space_extent_count() falls through to next function add_new_free_space_info()
mm/memcontrol.c:8106 uncharge_page() error: uninitialized symbol 'objcg'.
mm/vmscan.o: warning: objtool: do_shrink_slab() falls through to next function allow_direct_reclaim()
sound/soc/fsl/fsl_easrc.o: warning: objtool: fsl_easrc_runtime_resume() falls through to next function asan.module_ctor()
Error/Warning ids grouped by kconfigs:
recent_errors
|-- arm64-allnoconfig
| `-- kismet:WARNING:unmet-direct-dependencies-detected-for-CPPC_CPUFREQ_SYSFS_INTERFACE-when-selected-by-CPU_FREQ_GOV_SEEP
|-- x86_64-allnoconfig
| |-- ld.lld:error:version-script-assignment-of-LINUX_2.-to-symbol-__vdso_sgx_enter_enclave-failed:symbol-not-defined
| |-- llvm-objcopy:error:arch-x86-entry-vdso-vdso64.so.dbg:No-such-file-or-directory
| `-- llvm-objdump:error:arch-x86-entry-vdso-vdso64.so.dbg:No-such-file-or-directory
|-- x86_64-allyesconfig
| |-- drivers-scsi-linkdata-ps3stor-.-linux-ps3_driver_log.c:error:unused-function-time_for_file_name-Werror-Wunused-function
| |-- drivers-scsi-linkdata-ps3stor-.-linux-ps3_driver_log.c:error:unused-function-time_for_log-Werror-Wunused-function
| |-- drivers-scsi-linkdata-ps3stor-ps3_irq.c:error:unused-variable-PS3_HDD_IOPS_MSIX_VECTORS-Werror-Wunused-const-variable
| |-- drivers-scsi-linkdata-ps3stor-ps3_irq.c:error:unused-variable-PS3_INTERRUPT_CLEAR_IRQ-Werror-Wunused-const-variable
| |-- drivers-scsi-linkdata-ps3stor-ps3_irq.c:error:unused-variable-PS3_INTERRUPT_CMD_DISABLE_ALL_MASK-Werror-Wunused-const-variable
| |-- drivers-scsi-linkdata-ps3stor-ps3_irq.c:error:unused-variable-PS3_INTERRUPT_CMD_ENABLE_MSIX-Werror-Wunused-const-variable
| |-- drivers-scsi-linkdata-ps3stor-ps3_irq.c:error:unused-variable-PS3_INTERRUPT_MASK_DISABLE-Werror-Wunused-const-variable
| |-- drivers-scsi-linkdata-ps3stor-ps3_irq.c:error:unused-variable-PS3_INTERRUPT_STATUS_EXIST_IRQ-Werror-Wunused-const-variable
| |-- drivers-scsi-linkdata-ps3stor-ps3_irq.c:error:unused-variable-PS3_SSD_IOPS_MSIX_VECTORS-Werror-Wunused-const-variable
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-function-ps3_hba_qos_waitq_poll-Werror-Wmissing-prototypes
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-function-ps3_qos_mgrq_resend-Werror-Wmissing-prototypes
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-function-ps3_raid_qos_decision-Werror-Wmissing-prototypes
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-function-ps3_raid_qos_waitq_abort-Werror-Wmissing-prototypes
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-function-ps3_raid_qos_waitq_notify-Werror-Wmissing-prototypes
| `-- drivers-scsi-linkdata-ps3stor-ps3_scsih.c:error:unused-function-ps3_scsih_dev_id_get-Werror-Wunused-function
|-- x86_64-buildonly-randconfig-005-20250411
| |-- ld.lld:error:version-script-assignment-of-LINUX_2.-to-symbol-__vdso_sgx_enter_enclave-failed:symbol-not-defined
| |-- llvm-objcopy:error:arch-x86-entry-vdso-vdso64.so.dbg:No-such-file-or-directory
| `-- llvm-objdump:error:arch-x86-entry-vdso-vdso64.so.dbg:No-such-file-or-directory
|-- x86_64-randconfig-101-20250412
| |-- drivers-gpu-drm-amd-amdgpu-dce_v10_0.o:warning:objtool:dce_v10_0_bandwidth_update-falls-through-to-next-function-dce_v10_0_vblank_get_counter()
| |-- drivers-gpu-drm-amd-amdgpu-dce_v11_0.o:warning:objtool:dce_v11_0_bandwidth_update-falls-through-to-next-function-dce_v11_0_vblank_get_counter()
| |-- drivers-gpu-drm-amd-amdgpu-dce_v6_0.o:warning:objtool:dce_v6_0_program_watermarks-falls-through-to-next-function-dce_v6_0_latency_watermark()
| |-- drivers-gpu-drm-radeon-cik.o:warning:objtool:dce8_bandwidth_update-falls-through-to-next-function-cik_get_gpu_clock_counter()
| |-- drivers-gpu-drm-radeon-evergreen.o:warning:objtool:evergreen_program_watermarks-falls-through-to-next-function-evergreen_mc_wait_for_idle()
| |-- drivers-gpu-drm-radeon-si.o:warning:objtool:dce6_program_watermarks-falls-through-to-next-function-si_fence_ring_emit()
| |-- drivers-gpu-drm-vmwgfx-vmwgfx_fb.o:warning:objtool:vmw_deferred_io-falls-through-to-next-function-asanmodule_ctor()
| |-- drivers-media-test-drivers-vivid-vivid-kthread-cap.o:warning:objtool:vivid_thread_vid_cap_tick-falls-through-to-next-function-plane_vaddr()
| |-- drivers-media-tuners-e4000.o:warning:objtool:e4000_set_params-falls-through-to-next-function-e4000_standby()
| |-- drivers-nvdimm-namespace_devs.o:warning:objtool:size_store-falls-through-to-next-function-nd_namespace_label_update()
| |-- drivers-video-fbdev-hyperv_fb.o:warning:objtool:synthvid_deferred_io-falls-through-to-next-function-hvfb_pci_stub_probe()
| |-- fs-btrfs-free-space-cache.o:warning:objtool:add_bytes_to_bitmap-falls-through-to-next-function-recalculate_thresholds()
| |-- fs-btrfs-free-space-cache.o:warning:objtool:btrfs_alloc_from_cluster-falls-through-to-next-function-btrfs_find_space_cluster()
| |-- fs-btrfs-free-space-cache.o:warning:objtool:setup_cluster_bitmap-falls-through-to-next-function-btrfs_init_free_cluster()
| |-- fs-btrfs-free-space-cache.o:warning:objtool:steal_from_bitmap-falls-through-to-next-function-link_free_space()
| |-- fs-btrfs-free-space-tree.o:warning:objtool:modify_free_space_bitmap-falls-through-to-next-function-free_space_test_bit()
| |-- fs-btrfs-free-space-tree.o:warning:objtool:update_free_space_extent_count-falls-through-to-next-function-add_new_free_space_info()
| |-- ld.lld:error:version-script-assignment-of-LINUX_2.-to-symbol-__vdso_sgx_enter_enclave-failed:symbol-not-defined
| |-- llvm-objcopy:error:arch-x86-entry-vdso-vdso64.so.dbg:No-such-file-or-directory
| |-- llvm-objdump:error:arch-x86-entry-vdso-vdso64.so.dbg:No-such-file-or-directory
| `-- sound-soc-fsl-fsl_easrc.o:warning:objtool:fsl_easrc_runtime_resume-falls-through-to-next-function-asanmodule_ctor()
|-- x86_64-randconfig-104-20250412
| |-- drivers-gpu-drm-amd-amdgpu-dce_v10_0.o:warning:objtool:dce_v10_0_bandwidth_update-falls-through-to-next-function-dce_v10_0_vblank_get_counter()
| |-- drivers-gpu-drm-amd-amdgpu-dce_v11_0.o:warning:objtool:dce_v11_0_bandwidth_update-falls-through-to-next-function-dce_v11_0_vblank_get_counter()
| |-- drivers-gpu-drm-amd-amdgpu-dce_v6_0.o:warning:objtool:dce_v6_0_program_watermarks-falls-through-to-next-function-dce_v6_0_latency_watermark()
| |-- drivers-media-test-drivers-vivid-vivid-kthread-cap.o:warning:objtool:vivid_thread_vid_cap_tick-falls-through-to-next-function-plane_vaddr()
| |-- drivers-media-tuners-e4000.o:warning:objtool:e4000_set_params-falls-through-to-next-function-e4000_standby()
| |-- ld.lld:error:version-script-assignment-of-LINUX_2.-to-symbol-__vdso_sgx_enter_enclave-failed:symbol-not-defined
| |-- llvm-objcopy:error:arch-x86-entry-vdso-vdso64.so.dbg:No-such-file-or-directory
| `-- llvm-objdump:error:arch-x86-entry-vdso-vdso64.so.dbg:No-such-file-or-directory
|-- x86_64-randconfig-121-20250412
| |-- block-blk-mq-sysfs.c:sparse:sparse:incorrect-type-in-argument-(different-address-spaces)-expected-struct-blk_mq_hw_ctx-hctx-got-struct-blk_mq_hw_ctx-noderef-__rcu
| |-- block-blk-mq.c:sparse:sparse:incorrect-type-in-assignment-(different-address-spaces)-expected-struct-blk_mq_hw_ctx-hctx-got-struct-blk_mq_hw_ctx-noderef-__rcu
| `-- block-blk-mq.c:sparse:sparse:incorrect-type-in-initializer-(different-address-spaces)-expected-struct-blk_mq_hw_ctx-hctxs-got-struct-blk_mq_hw_ctx-noderef-__rcu-queue_hw_ctx
|-- x86_64-randconfig-122-20250412
| |-- drivers-nvdimm-namespace_devs.o:warning:objtool:size_store-falls-through-to-next-function-nd_namespace_label_update()
| |-- mm-vmscan.o:warning:objtool:do_shrink_slab-falls-through-to-next-function-allow_direct_reclaim()
| `-- sound-soc-fsl-fsl_easrc.o:warning:objtool:fsl_easrc_runtime_resume-falls-through-to-next-function-asanmodule_ctor()
|-- x86_64-randconfig-123-20250412
| |-- block-blk-mq-sysfs.c:sparse:sparse:incorrect-type-in-argument-(different-address-spaces)-expected-struct-blk_mq_hw_ctx-hctx-got-struct-blk_mq_hw_ctx-noderef-__rcu
| |-- block-blk-mq.c:sparse:sparse:incorrect-type-in-assignment-(different-address-spaces)-expected-struct-blk_mq_hw_ctx-hctx-got-struct-blk_mq_hw_ctx-noderef-__rcu
| `-- block-blk-mq.c:sparse:sparse:incorrect-type-in-initializer-(different-address-spaces)-expected-struct-blk_mq_hw_ctx-hctxs-got-struct-blk_mq_hw_ctx-noderef-__rcu-queue_hw_ctx
|-- x86_64-randconfig-161-20250411
| |-- drivers-block-rnbd-rnbd-srv-sysfs.c-rnbd_srv_create_dev_sysfs()-warn:missing-error-code-ret
| `-- drivers-net-ethernet-netswift-ngbe-ngbe_main.c-ngbe_io_error_detected()-warn:inconsistent-indenting
`-- x86_64-randconfig-161-20250412
`-- mm-memcontrol.c-uncharge_page()-error:uninitialized-symbol-objcg-.
elapsed time: 1445m
configs tested: 16
configs skipped: 129
tested configs:
arm64 allmodconfig clang-19
arm64 allnoconfig gcc-14.2.0
arm64 defconfig gcc-14.2.0
arm64 randconfig-001-20250411 gcc-9.5.0
arm64 randconfig-002-20250411 gcc-9.5.0
arm64 randconfig-003-20250411 clang-21
arm64 randconfig-004-20250411 clang-21
x86_64 allnoconfig clang-20
x86_64 allyesconfig clang-20
x86_64 buildonly-randconfig-001-20250411 gcc-11
x86_64 buildonly-randconfig-002-20250411 gcc-11
x86_64 buildonly-randconfig-003-20250411 clang-20
x86_64 buildonly-randconfig-004-20250411 gcc-12
x86_64 buildonly-randconfig-005-20250411 clang-20
x86_64 buildonly-randconfig-006-20250411 gcc-12
x86_64 defconfig gcc-11
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
1
0
Patch 2 aims to fix bug caused in patch 1.
Zheng Qixing (2):
block: fix resource leak in elevator registration error path
block: fix lock ordering in blk_register_queue() error path
block/blk-sysfs.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--
2.39.2
2
3
Baokun Li (2):
ext4: goto right label 'out_mmap_sem' in ext4_setattr()
iomap: do not interrupt IOMAP_ZERO
Brian Foster (1):
mm: zero range of eof folio exposed by inode size extension
Matthew Wilcox (Oracle) (1):
mm: convert pagecache_isize_extended to use a folio
Yongjian Sun (2):
ext4: do not always order data when partial zeroing out a block
ext4: fix potential memory exposure issues during truncate in iomap
mode.
Zhang Yi (1):
jbd2: fix off-by-one while erasing journal
fs/ext4/inode.c | 130 ++++++++++++++++++++++++++++++-----------
fs/iomap/buffered-io.c | 7 ++-
fs/jbd2/journal.c | 15 ++---
mm/truncate.c | 51 ++++++++++------
4 files changed, 141 insertions(+), 62 deletions(-)
--
2.46.1
2
8

[openeuler:OLK-5.10 2858/2858] drivers/net/ethernet/netswift/ngbe/ngbe_main.c:6835 ngbe_io_error_detected() warn: inconsistent indenting
by kernel test robot 12 Apr '25
by kernel test robot 12 Apr '25
12 Apr '25
tree: https://gitee.com/openeuler/kernel.git OLK-5.10
head: 8cf05d37849321b8bb9b74e099fa5bb6164d4f56
commit: a5961b4bc6ce09a70902686ecc848a47493a9251 [2858/2858] openeuler: net: ngbe: add ngbe module support
config: x86_64-randconfig-161-20250411 (https://download.01.org/0day-ci/archive/20250412/202504120007.4O7NSSul-lkp@…)
compiler: clang version 20.1.2 (https://github.com/llvm/llvm-project 58df0ef89dd64126512e4ee27b4ac3fd8ddf6247)
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/202504120007.4O7NSSul-lkp@intel.com/
New smatch warnings:
drivers/net/ethernet/netswift/ngbe/ngbe_main.c:6835 ngbe_io_error_detected() warn: inconsistent indenting
Old smatch warnings:
drivers/net/ethernet/netswift/ngbe/ngbe_main.c:1850 ngbe_request_msix_irqs() warn: 'entry->vector' from request_irq() not released on lines: 1850.
drivers/net/ethernet/netswift/ngbe/ngbe_main.c:3931 ngbe_setup_all_rx_resources() warn: inconsistent indenting
drivers/net/ethernet/netswift/ngbe/ngbe_main.c:5084 ngbe_reset_subtask() warn: inconsistent indenting
drivers/net/ethernet/netswift/ngbe/ngbe_main.c:5313 ngbe_tso() warn: inconsistent indenting
vim +6835 drivers/net/ethernet/netswift/ngbe/ngbe_main.c
6819
6820 /**
6821 * ngbe_io_error_detected - called when PCI error is detected
6822 * @pdev: Pointer to PCI device
6823 * @state: The current pci connection state
6824 *
6825 * This function is called after a PCI bus error affecting
6826 * this device has been detected.
6827 */
6828 static pci_ers_result_t ngbe_io_error_detected(struct pci_dev *pdev,
6829 pci_channel_state_t state)
6830 {
6831 struct ngbe_adapter *adapter = pci_get_drvdata(pdev);
6832 struct net_device *netdev = adapter->netdev;
6833
6834 #ifdef CONFIG_PCI_IOV
> 6835 struct ngbe_hw *hw = &adapter->hw;
6836 struct pci_dev *bdev, *vfdev;
6837 u32 dw0, dw1, dw2, dw3;
6838 int vf, pos;
6839 u16 req_id, pf_func;
6840
6841 if (adapter->num_vfs == 0)
6842 goto skip_bad_vf_detection;
6843
6844 bdev = pdev->bus->self;
6845 while (bdev && (pci_pcie_type(bdev) != PCI_EXP_TYPE_ROOT_PORT))
6846 bdev = bdev->bus->self;
6847
6848 if (!bdev)
6849 goto skip_bad_vf_detection;
6850
6851 pos = pci_find_ext_capability(bdev, PCI_EXT_CAP_ID_ERR);
6852 if (!pos)
6853 goto skip_bad_vf_detection;
6854
6855 dw0 = ngbe_read_pci_cfg_dword(hw, pos + PCI_ERR_HEADER_LOG);
6856 dw1 = ngbe_read_pci_cfg_dword(hw,
6857 pos + PCI_ERR_HEADER_LOG + 4);
6858 dw2 = ngbe_read_pci_cfg_dword(hw,
6859 pos + PCI_ERR_HEADER_LOG + 8);
6860 dw3 = ngbe_read_pci_cfg_dword(hw,
6861 pos + PCI_ERR_HEADER_LOG + 12);
6862 if (NGBE_REMOVED(hw->hw_addr))
6863 goto skip_bad_vf_detection;
6864
6865 req_id = dw1 >> 16;
6866 /* if bit 7 of the requestor ID is set then it's a VF */
6867 if (!(req_id & 0x0080))
6868 goto skip_bad_vf_detection;
6869
6870 pf_func = req_id & 0x01;
6871 if ((pf_func & 1) == (pdev->devfn & 1)) {
6872 vf = (req_id & 0x7F) >> 1;
6873 e_dev_err("VF %d has caused a PCIe error\n", vf);
6874 e_dev_err("TLP: dw0: %8.8x\tdw1: %8.8x\tdw2: %8.8x\tdw3: %8.8x\n",
6875 dw0, dw1, dw2, dw3);
6876
6877 /* Find the pci device of the offending VF */
6878 vfdev = pci_get_device(PCI_VENDOR_ID_TRUSTNETIC,
6879 NGBE_VF_DEVICE_ID, NULL);
6880 while (vfdev) {
6881 if (vfdev->devfn == (req_id & 0xFF))
6882 break;
6883 vfdev = pci_get_device(PCI_VENDOR_ID_TRUSTNETIC,
6884 NGBE_VF_DEVICE_ID, vfdev);
6885 }
6886 /* There's a slim chance the VF could have been hot
6887 * plugged, so if it is no longer present we don't need
6888 * to issue the VFLR.Just clean up the AER in that case.
6889 */
6890 if (vfdev) {
6891 ngbe_issue_vf_flr(adapter, vfdev);
6892 /* Free device reference count */
6893 pci_dev_put(vfdev);
6894 }
6895
6896 pci_aer_clear_nonfatal_status(pdev);
6897 }
6898
6899 /* Even though the error may have occurred on the other port
6900 * we still need to increment the vf error reference count for
6901 * both ports because the I/O resume function will be called
6902 * for both of them.
6903 */
6904 adapter->vferr_refcount++;
6905
6906 return PCI_ERS_RESULT_RECOVERED;
6907
6908 skip_bad_vf_detection:
6909 #endif /* CONFIG_PCI_IOV */
6910
6911 if (!test_bit(__NGBE_SERVICE_INITED, &adapter->state))
6912 return PCI_ERS_RESULT_DISCONNECT;
6913
6914 rtnl_lock();
6915 netif_device_detach(netdev);
6916
6917 if (state == pci_channel_io_perm_failure) {
6918 rtnl_unlock();
6919 return PCI_ERS_RESULT_DISCONNECT;
6920 }
6921
6922 if (netif_running(netdev))
6923 ngbe_close(netdev);
6924
6925 if (!test_and_set_bit(__NGBE_DISABLED, &adapter->state))
6926 pci_disable_device(pdev);
6927 rtnl_unlock();
6928
6929 /* Request a slot reset. */
6930 return PCI_ERS_RESULT_NEED_RESET;
6931 }
6932
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
1
0

[openeuler:openEuler-1.0-LTS] BUILD REGRESSION ac44c6a4925e0772513c3597d420e5705faf482b
by kernel test robot 11 Apr '25
by kernel test robot 11 Apr '25
11 Apr '25
tree/branch: https://gitee.com/openeuler/kernel.git openEuler-1.0-LTS
branch HEAD: ac44c6a4925e0772513c3597d420e5705faf482b !15664 CVE-2025-21858
Error/Warning (recently discovered and may have been fixed):
https://lore.kernel.org/oe-kbuild-all/202503201721.gZeymcpc-lkp@intel.com
https://lore.kernel.org/oe-kbuild-all/202503251400.xG2WACIP-lkp@intel.com
https://lore.kernel.org/oe-kbuild-all/202503271858.j6vJ9Bhc-lkp@intel.com
https://lore.kernel.org/oe-kbuild-all/202503281620.pNXaYE13-lkp@intel.com
https://lore.kernel.org/oe-kbuild-all/202504110241.8SiMchEQ-lkp@intel.com
https://lore.kernel.org/oe-kbuild/202503150349.Roa6uXS0-lkp@intel.com
https://lore.kernel.org/oe-kbuild/202504081102.ziLuPC5Y-lkp@intel.com
arch/x86/entry/entry_64.o: warning: objtool: .entry.text+0x162: unsupported intra-function call
arch/x86/entry/entry_64.o: warning: objtool: .entry.text+0x1b2: unsupported intra-function call
arch/x86/entry/entry_64.o: warning: objtool: .entry.text+0x1c2: unsupported intra-function call
arch/x86/entry/entry_64.o: warning: objtool: .entry.text+0x1d1: unsupported intra-function call
arch/x86/entry/entry_64.o: warning: objtool: .entry.text+0x1d2: unsupported intra-function call
arch/x86/entry/entry_64.o: warning: objtool: .entry.text+0x1e1: unsupported intra-function call
arch/x86/entry/entry_64.o: warning: objtool: .entry.text+0x1e2: unsupported intra-function call
arch/x86/entry/entry_64.o: warning: objtool: If this is a retpoline, please patch it in with alternatives and annotate it with ANNOTATE_NOSPEC_ALTERNATIVE.
block/blk-mq-debugfs-zoned.o: warning: objtool: missing symbol for section .text
block/blk-zoned.o: warning: objtool: missing symbol for section .text
drivers/dma/pl330.c:2598:15: warning: 'dst' may be used uninitialized in this function [-Wmaybe-uninitialized]
drivers/dma/pl330.c:2598:22: warning: 'dst' may be used uninitialized in this function [-Wmaybe-uninitialized]
drivers/dma/pl330.c:2599:15: warning: 'src' may be used uninitialized in this function [-Wmaybe-uninitialized]
drivers/dma/pl330.c:2599:22: warning: 'src' may be used uninitialized in this function [-Wmaybe-uninitialized]
drivers/gpu/drm/ttm/ttm_object.c:60: error: Cannot parse struct or union!
drivers/net/ethernet/netswift/ngbe/ngbe_hw.o: warning: objtool: missing symbol for section .text.unlikely.
drivers/pinctrl/core.c:1338: error: Cannot parse struct or union!
include/asm-generic/io.h:742:19: warning: 'reg' may be used uninitialized in this function [-Wmaybe-uninitialized]
include/linux/filter.h:332:4: warning: cast between incompatible function types from 'int (* const)(struct bpf_map *, void *)' to 'u64 (*)(u64, u64, u64, u64, u64)' {aka 'long long unsigned int (*)(long long unsigned int, long long unsigned int, long long unsigned int, long long unsigned int, long long unsigned int)'} [-Wcast-function-type]
include/linux/filter.h:332:4: warning: cast between incompatible function types from 'int (* const)(struct bpf_map *, void *, void *, u64)' {aka 'int (* const)(struct bpf_map *, void *, void *, long long unsigned int)'} to 'u64 (*)(u64, u64, u64, u64, u64)' {aka 'long long unsigned int (*)(long long unsigned int, long long unsigned int, long long unsigned int, long long unsigned int, long long unsigned int)'} [-Wcast-function-type]
include/linux/filter.h:332:4: warning: cast between incompatible function types from 'void * (* const)(struct bpf_map *, void *)' to 'u64 (*)(u64, u64, u64, u64, u64)' {aka 'long long unsigned int (*)(long long unsigned int, long long unsigned int, long long unsigned int, long long unsigned int, long long unsigned int)'} [-Wcast-function-type]
init/Kconfig:34: syntax error
kernel/hung_task.c:148:7: error: use of undeclared identifier 'sysctl_hung_task_all_cpu_backtrace'
mm/early_ioremap.o: warning: objtool: missing symbol for section .text
mm/page_ext.o: warning: objtool: missing symbol for section .init.text
Unverified Error/Warning (likely false positive, kindly check if interested):
./samples/mic/mpssd/mpssd.c: 40 linux/version.h not needed.
/kbuild/src/headers/Makefile:626: include/config/auto.conf.cmd: No such file or directory
block/blk-throttle.c:2377:1-7: preceding lock on line 2269
drivers/gpu/drm/i915/i915_gem.o: warning: objtool: i915_gem_fault() falls through to next function i915_gem_object_ggtt_pin()
drivers/gpu/drm/i915/intel_display.o: warning: objtool: _intel_compute_tile_offset() falls through to next function skl_format_to_fourcc()
drivers/gpu/drm/i915/intel_display.o: warning: objtool: skl_plane_stride() falls through to next function skl_plane_ctl()
drivers/gpu/drm/i915/vlv_dsi_pll.o: warning: objtool: bxt_dsi_pll_enable() falls through to next function bxt_dsi_reset_clocks()
drivers/net/ethernet/intel/e1000/e1000_main.o: warning: objtool: e1000_watchdog() falls through to next function e1000_82547_tx_fifo_stall_task()
mm/kasan/kasan_init.c:220: warning: Function parameter or member 'shadow_end' not described in 'kasan_populate_zero_shadow'
mm/kasan/kasan_init.c:220: warning: Function parameter or member 'shadow_start' not described in 'kasan_populate_zero_shadow'
Error/Warning ids grouped by kconfigs:
recent_errors
|-- arm64-randconfig-001-20250410
| |-- drivers-gpu-drm-ttm-ttm_object.c:error:Cannot-parse-struct-or-union
| |-- drivers-pinctrl-core.c:error:Cannot-parse-struct-or-union
| |-- mm-kasan-kasan_init.c:warning:Function-parameter-or-member-shadow_end-not-described-in-kasan_populate_zero_shadow
| `-- mm-kasan-kasan_init.c:warning:Function-parameter-or-member-shadow_start-not-described-in-kasan_populate_zero_shadow
|-- arm64-randconfig-002-20250410
| `-- drivers-pinctrl-core.c:error:Cannot-parse-struct-or-union
|-- arm64-randconfig-003-20250410
| `-- init-Kconfig:syntax-error
|-- arm64-randconfig-004-20250410
| |-- drivers-dma-pl330.c:warning:dst-may-be-used-uninitialized-in-this-function
| |-- drivers-dma-pl330.c:warning:src-may-be-used-uninitialized-in-this-function
| |-- drivers-pinctrl-core.c:error:Cannot-parse-struct-or-union
| |-- include-linux-filter.h:warning:cast-between-incompatible-function-types-from-int-(-const)(struct-bpf_map-void-)-to-u64-(-)(u64-u64-u64-u64-u64)-aka-long-long-unsigned-int-(-)(long-long-unsigned-int-lo
| |-- include-linux-filter.h:warning:cast-between-incompatible-function-types-from-int-(-const)(struct-bpf_map-void-void-u64)-aka-int-(-const)(struct-bpf_map-void-void-long-long-unsigned-int)-to-u64-(-)(u64
| |-- include-linux-filter.h:warning:cast-between-incompatible-function-types-from-void-(-const)(struct-bpf_map-void-)-to-u64-(-)(u64-u64-u64-u64-u64)-aka-long-long-unsigned-int-(-)(long-long-unsigned-int-l
| |-- mm-kasan-kasan_init.c:warning:Function-parameter-or-member-shadow_end-not-described-in-kasan_populate_zero_shadow
| `-- mm-kasan-kasan_init.c:warning:Function-parameter-or-member-shadow_start-not-described-in-kasan_populate_zero_shadow
|-- arm64-randconfig-055-20250411
| `-- init-Kconfig:syntax-error
|-- arm64-randconfig-r054-20250411
| |-- block-blk-throttle.c:preceding-lock-on-line
| |-- drivers-dma-pl330.c:warning:dst-may-be-used-uninitialized-in-this-function
| |-- drivers-dma-pl330.c:warning:src-may-be-used-uninitialized-in-this-function
| |-- drivers-gpu-drm-ttm-ttm_object.c:error:Cannot-parse-struct-or-union
| |-- drivers-pinctrl-core.c:error:Cannot-parse-struct-or-union
| `-- include-asm-generic-io.h:warning:reg-may-be-used-uninitialized-in-this-function
|-- arm64-randconfig-r062-20250411
| `-- init-Kconfig:syntax-error
|-- x86_64-allnoconfig
| |-- Makefile:include-config-auto.conf.cmd:No-such-file-or-directory
| |-- arch-x86-entry-entry_64.o:warning:objtool:.entry.text:unsupported-intra-function-call
| |-- mm-vmscan.c:error:implicit-declaration-of-function-kernel_swap_enabled-Werror-Wimplicit-function-declaration
| `-- samples-mic-mpssd-mpssd.c:linux-version.h-not-needed.
|-- x86_64-allyesconfig
| |-- drivers-gpu-drm-ttm-ttm_object.c:error:Cannot-parse-struct-or-union
| |-- drivers-pinctrl-core.c:error:Cannot-parse-struct-or-union
| |-- mm-kasan-kasan_init.c:warning:Function-parameter-or-member-shadow_end-not-described-in-kasan_populate_zero_shadow
| |-- mm-kasan-kasan_init.c:warning:Function-parameter-or-member-shadow_start-not-described-in-kasan_populate_zero_shadow
| `-- mm-page_alloc.c:warning:cast-from-int-(-)(unsigned-long-unsigned-long-struct-deferred_args-)-to-ktask_thread_func-(aka-int-(-)(void-void-void-)-)-converts-to-incompatible-function-type
|-- x86_64-buildonly-randconfig-001-20250410
| |-- arch-x86-entry-entry_64.o:warning:objtool:.entry.text:unsupported-intra-function-call
| |-- arch-x86-entry-entry_64.o:warning:objtool:If-this-is-a-retpoline-please-patch-it-in-with-alternatives-and-annotate-it-with-ANNOTATE_NOSPEC_ALTERNATIVE.
| |-- drivers-pinctrl-core.c:error:Cannot-parse-struct-or-union
| |-- mm-page_alloc.c:warning:cast-from-int-(-)(unsigned-long-unsigned-long-struct-deferred_args-)-to-ktask_thread_func-(aka-int-(-)(void-void-void-)-)-converts-to-incompatible-function-type
| `-- mm-vmscan.c:error:implicit-declaration-of-function-kernel_swap_enabled-Werror-Wimplicit-function-declaration
|-- x86_64-buildonly-randconfig-002-20250410
| |-- drivers-gpu-drm-ttm-ttm_object.c:error:Cannot-parse-struct-or-union
| |-- drivers-pinctrl-core.c:error:Cannot-parse-struct-or-union
| |-- mm-kasan-kasan_init.c:warning:Function-parameter-or-member-shadow_end-not-described-in-kasan_populate_zero_shadow
| `-- mm-kasan-kasan_init.c:warning:Function-parameter-or-member-shadow_start-not-described-in-kasan_populate_zero_shadow
|-- x86_64-buildonly-randconfig-003-20250410
| |-- arch-x86-entry-entry_64.o:warning:objtool:.entry.text:unsupported-intra-function-call
| |-- arch-x86-entry-entry_64.o:warning:objtool:If-this-is-a-retpoline-please-patch-it-in-with-alternatives-and-annotate-it-with-ANNOTATE_NOSPEC_ALTERNATIVE.
| |-- drivers-pinctrl-core.c:error:Cannot-parse-struct-or-union
| |-- kernel-trace-trace_output.o:warning:objtool:missing-symbol-for-section-.init.text
| |-- mm-early_ioremap.o:warning:objtool:missing-symbol-for-section-.text
| |-- mm-hugetlb.c:warning:no-previous-prototype-for-function-free_huge_page_to_dhugetlb_pool
| |-- mm-kasan-kasan_init.c:warning:Function-parameter-or-member-shadow_end-not-described-in-kasan_populate_zero_shadow
| |-- mm-kasan-kasan_init.c:warning:Function-parameter-or-member-shadow_start-not-described-in-kasan_populate_zero_shadow
| `-- mm-vmscan.c:error:implicit-declaration-of-function-kernel_swap_enabled-Werror-Wimplicit-function-declaration
|-- x86_64-buildonly-randconfig-004-20250410
| |-- arch-x86-entry-entry_64.o:warning:objtool:.entry.text:unsupported-intra-function-call
| |-- arch-x86-entry-entry_64.o:warning:objtool:If-this-is-a-retpoline-please-patch-it-in-with-alternatives-and-annotate-it-with-ANNOTATE_NOSPEC_ALTERNATIVE.
| |-- block-blk-mq-debugfs-zoned.o:warning:objtool:missing-symbol-for-section-.text
| |-- block-blk-zoned.o:warning:objtool:missing-symbol-for-section-.text
| |-- drivers-gpu-drm-ttm-ttm_object.c:error:Cannot-parse-struct-or-union
| |-- drivers-pinctrl-core.c:error:Cannot-parse-struct-or-union
| |-- kernel-trace-trace_output.o:warning:objtool:missing-symbol-for-section-.init.text
| `-- mm-page_ext.o:warning:objtool:missing-symbol-for-section-.init.text
|-- x86_64-buildonly-randconfig-005-20250410
| |-- arch-x86-entry-entry_64.o:warning:objtool:.entry.text:unsupported-intra-function-call
| |-- arch-x86-entry-entry_64.o:warning:objtool:If-this-is-a-retpoline-please-patch-it-in-with-alternatives-and-annotate-it-with-ANNOTATE_NOSPEC_ALTERNATIVE.
| |-- drivers-gpu-drm-ttm-ttm_object.c:error:Cannot-parse-struct-or-union
| |-- drivers-net-ethernet-netswift-ngbe-ngbe_hw.o:warning:objtool:missing-symbol-for-section-.text.unlikely.
| |-- drivers-pinctrl-core.c:error:Cannot-parse-struct-or-union
| |-- kernel-hung_task.c:error:use-of-undeclared-identifier-sysctl_hung_task_all_cpu_backtrace
| |-- mm-kasan-kasan_init.c:warning:Function-parameter-or-member-shadow_end-not-described-in-kasan_populate_zero_shadow
| |-- mm-kasan-kasan_init.c:warning:Function-parameter-or-member-shadow_start-not-described-in-kasan_populate_zero_shadow
| `-- mm-vmscan.c:error:implicit-declaration-of-function-kernel_swap_enabled-Werror-Wimplicit-function-declaration
|-- x86_64-buildonly-randconfig-006-20250410
| |-- arch-x86-entry-entry_64.o:warning:objtool:.entry.text:unsupported-intra-function-call
| |-- arch-x86-entry-entry_64.o:warning:objtool:If-this-is-a-retpoline-please-patch-it-in-with-alternatives-and-annotate-it-with-ANNOTATE_NOSPEC_ALTERNATIVE.
| |-- drivers-gpu-drm-ttm-ttm_object.c:error:Cannot-parse-struct-or-union
| |-- drivers-pinctrl-core.c:error:Cannot-parse-struct-or-union
| `-- mm-page_alloc.c:warning:cast-from-int-(-)(unsigned-long-unsigned-long-struct-deferred_args-)-to-ktask_thread_func-(aka-int-(-)(void-void-void-)-)-converts-to-incompatible-function-type
|-- x86_64-defconfig
| |-- arch-x86-entry-entry_64.o:warning:objtool:.entry.text:unsupported-intra-function-call
| |-- arch-x86-entry-entry_64.o:warning:objtool:If-this-is-a-retpoline-please-patch-it-in-with-alternatives-and-annotate-it-with-ANNOTATE_NOSPEC_ALTERNATIVE.
| `-- include-asm-generic-bug.h:warning:mcu_ctrl-may-be-used-uninitialized-in-this-function
|-- x86_64-randconfig-101-20250411
| |-- arch-x86-entry-entry_64.o:warning:objtool:.entry.text:unsupported-intra-function-call
| |-- arch-x86-entry-entry_64.o:warning:objtool:If-this-is-a-retpoline-please-patch-it-in-with-alternatives-and-annotate-it-with-ANNOTATE_NOSPEC_ALTERNATIVE.
| |-- drivers-gpu-drm-i915-i915_gem.o:warning:objtool:i915_gem_fault-falls-through-to-next-function-i915_gem_object_ggtt_pin()
| |-- drivers-gpu-drm-i915-intel_display.o:warning:objtool:_intel_compute_tile_offset-falls-through-to-next-function-skl_format_to_fourcc()
| |-- drivers-gpu-drm-i915-intel_display.o:warning:objtool:skl_plane_stride-falls-through-to-next-function-skl_plane_ctl()
| |-- drivers-gpu-drm-i915-vlv_dsi_pll.o:warning:objtool:bxt_dsi_pll_enable-falls-through-to-next-function-bxt_dsi_reset_clocks()
| |-- drivers-gpu-drm-radeon-evergreen_cs.o:warning:objtool:evergreen_surface_check-falls-through-to-next-function-evergreen_cs_track_validate_htile()
| |-- drivers-gpu-drm-ttm-ttm_object.c:error:Cannot-parse-struct-or-union
| |-- drivers-net-ethernet-intel-e1000-e1000_main.o:warning:objtool:e1000_watchdog-falls-through-to-next-function-e1000_82547_tx_fifo_stall_task()
| |-- drivers-pinctrl-core.c:error:Cannot-parse-struct-or-union
| |-- kernel-hung_task.c:error:use-of-undeclared-identifier-sysctl_hung_task_all_cpu_backtrace
| |-- mm-hugetlb.c:warning:no-previous-prototype-for-function-free_huge_page_to_dhugetlb_pool
| |-- mm-kasan-kasan_init.c:warning:Function-parameter-or-member-shadow_end-not-described-in-kasan_populate_zero_shadow
| |-- mm-kasan-kasan_init.c:warning:Function-parameter-or-member-shadow_start-not-described-in-kasan_populate_zero_shadow
| `-- mm-vmscan.c:error:implicit-declaration-of-function-kernel_swap_enabled-Werror-Wimplicit-function-declaration
|-- x86_64-randconfig-102-20250411
| |-- arch-x86-entry-entry_64.o:warning:objtool:.entry.text:unsupported-intra-function-call
| |-- arch-x86-entry-entry_64.o:warning:objtool:If-this-is-a-retpoline-please-patch-it-in-with-alternatives-and-annotate-it-with-ANNOTATE_NOSPEC_ALTERNATIVE.
| |-- drivers-gpu-drm-ttm-ttm_object.c:error:Cannot-parse-struct-or-union
| |-- drivers-net-ethernet-intel-e1000-e1000_main.o:warning:objtool:e1000_watchdog-falls-through-to-next-function-e1000_82547_tx_fifo_stall_task()
| |-- drivers-pinctrl-core.c:error:Cannot-parse-struct-or-union
| |-- kernel-hung_task.c:error:use-of-undeclared-identifier-sysctl_hung_task_all_cpu_backtrace
| |-- mm-kasan-kasan_init.c:warning:Function-parameter-or-member-shadow_end-not-described-in-kasan_populate_zero_shadow
| |-- mm-kasan-kasan_init.c:warning:Function-parameter-or-member-shadow_start-not-described-in-kasan_populate_zero_shadow
| `-- mm-vmscan.c:error:implicit-declaration-of-function-kernel_swap_enabled-Werror-Wimplicit-function-declaration
|-- x86_64-randconfig-103-20250411
| |-- arch-x86-entry-entry_64.o:warning:objtool:.entry.text:unsupported-intra-function-call
| |-- arch-x86-entry-entry_64.o:warning:objtool:If-this-is-a-retpoline-please-patch-it-in-with-alternatives-and-annotate-it-with-ANNOTATE_NOSPEC_ALTERNATIVE.
| `-- drivers-pinctrl-core.c:error:Cannot-parse-struct-or-union
|-- x86_64-randconfig-104-20250411
| |-- arch-x86-entry-entry_64.o:warning:objtool:.entry.text:unsupported-intra-function-call
| |-- arch-x86-entry-entry_64.o:warning:objtool:If-this-is-a-retpoline-please-patch-it-in-with-alternatives-and-annotate-it-with-ANNOTATE_NOSPEC_ALTERNATIVE.
| |-- drivers-pinctrl-core.c:error:Cannot-parse-struct-or-union
| |-- mm-kasan-kasan_init.c:warning:Function-parameter-or-member-shadow_end-not-described-in-kasan_populate_zero_shadow
| `-- mm-kasan-kasan_init.c:warning:Function-parameter-or-member-shadow_start-not-described-in-kasan_populate_zero_shadow
`-- x86_64-randconfig-161-20250411
|-- arch-x86-entry-entry_64.o:warning:objtool:.entry.text:unsupported-intra-function-call
|-- arch-x86-entry-entry_64.o:warning:objtool:If-this-is-a-retpoline-please-patch-it-in-with-alternatives-and-annotate-it-with-ANNOTATE_NOSPEC_ALTERNATIVE.
|-- drivers-gpu-drm-ttm-ttm_object.c:error:Cannot-parse-struct-or-union
|-- drivers-md-raid5.o:warning:objtool:raid5_compute_sector-falls-through-to-next-function-raid5_compute_blocknr()
|-- drivers-media-tuners-fc2580.o:warning:objtool:fc2580_set_params-falls-through-to-next-function-fc2580_standby()
|-- drivers-net-ethernet-intel-e1000-e1000_main.o:warning:objtool:e1000_watchdog-falls-through-to-next-function-e1000_82547_tx_fifo_stall_task()
|-- drivers-pinctrl-core.c:error:Cannot-parse-struct-or-union
|-- kernel-hung_task.c:error:use-of-undeclared-identifier-sysctl_hung_task_all_cpu_backtrace
|-- mm-kasan-kasan_init.c:warning:Function-parameter-or-member-shadow_end-not-described-in-kasan_populate_zero_shadow
`-- mm-kasan-kasan_init.c:warning:Function-parameter-or-member-shadow_start-not-described-in-kasan_populate_zero_shadow
elapsed time: 1454m
configs tested: 16
configs skipped: 133
tested configs:
arm64 allmodconfig gcc-14.2.0
arm64 allnoconfig gcc-14.2.0
arm64 defconfig gcc-14.2.0
arm64 randconfig-001-20250410 gcc-14.2.0
arm64 randconfig-002-20250410 gcc-10.5.0
arm64 randconfig-003-20250410 gcc-6.5.0
arm64 randconfig-004-20250410 gcc-8.5.0
x86_64 allnoconfig clang-20
x86_64 allyesconfig clang-20
x86_64 buildonly-randconfig-001-20250410 clang-20
x86_64 buildonly-randconfig-002-20250410 gcc-12
x86_64 buildonly-randconfig-003-20250410 clang-20
x86_64 buildonly-randconfig-004-20250410 clang-20
x86_64 buildonly-randconfig-005-20250410 clang-20
x86_64 buildonly-randconfig-006-20250410 clang-20
x86_64 defconfig gcc-11
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
1
0
driver inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/IC0GTV
----------------------------------------------------------------------
General updates of HiSilicon PMU drivers.
Junhao He (8):
drivers/perf: hisi: Fix incorrect variable name "hha_pmu" in DDRC PMU
driver
drivers/perf: hisi: Delete redundant blank line of DDRC PMU
drivers/perf: hisi: Simplify the probe process for each DDRC version
drivers/perf: hisi: Add support for HiSilicon DDRC v3 PMU driver
drivers/perf: hisi: Use ACPI driver_data to retrieve SLLC PMU
information
drivers/perf: hisi: Add support for HiSilicon SLLC v3 PMU driver
drivers/perf: hisi: Relax the event number check of v2 PMUs
drivers/perf: hisi: Add support for HiSilicon MN PMU driver
Yicong Yang (10):
drivers/perf: hisi: Define a symbol namespace for HiSilicon Uncore
PMUs
drivers/perf: hisi: Don't update the associated_cpus on CPU offline
drivers/perf: hisi: Migrate to one online CPU if no associated one
online
drivers/perf: hisi: Refactor the detection of associated CPUs
drivers/perf: hisi: Extract topology information to a separate
structure
drivers/perf: hisi: Add a common function to retrieve topology from
firmware
drivers/perf: hisi: Provide a generic implementation of
cpumask/identifier
drivers/perf: hisi: Export associated CPUs of each PMU through sysfs
drivers/perf: hisi: Support PMUs with no interrupt
drivers/perf: hisi: Add support for HiSilicon NoC PMU
Documentation/admin-guide/perf/hisi-pmu.rst | 16 +-
drivers/perf/hisilicon/Makefile | 3 +-
drivers/perf/hisilicon/hisi_uncore_cpa_pmu.c | 42 +-
drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c | 283 +++++--------
drivers/perf/hisilicon/hisi_uncore_hha_pmu.c | 54 +--
drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c | 44 +-
drivers/perf/hisilicon/hisi_uncore_mn_pmu.c | 355 ++++++++++++++++
drivers/perf/hisilicon/hisi_uncore_noc_pmu.c | 392 ++++++++++++++++++
drivers/perf/hisilicon/hisi_uncore_pa_pmu.c | 55 +--
drivers/perf/hisilicon/hisi_uncore_pmu.c | 166 ++++++--
drivers/perf/hisilicon/hisi_uncore_pmu.h | 51 ++-
drivers/perf/hisilicon/hisi_uncore_sllc_pmu.c | 251 +++++++----
drivers/perf/hisilicon/hisi_uncore_uc_pmu.c | 45 +-
13 files changed, 1260 insertions(+), 497 deletions(-)
create mode 100644 drivers/perf/hisilicon/hisi_uncore_mn_pmu.c
create mode 100644 drivers/perf/hisilicon/hisi_uncore_noc_pmu.c
--
2.33.0
2
19
Kuniyuki Iwashima (2):
geneve: Fix use-after-free in geneve_find_dev().
geneve: Suppress list corruption splat in geneve_destroy_tunnels().
drivers/net/geneve.c | 16 ++--------------
1 file changed, 2 insertions(+), 14 deletions(-)
--
2.9.5
2
3
This series includes adding Motorcomm YT6801 Gigabit ethernet driver
and adding yt6801 ethernet driver entry in MAINTAINERS file.
YT6801 integrates a YT8531S phy.
Frank Sae (14):
yt6801: Add support for a pci table in this module
yt6801: Implement mdio register
yt6801: Implement pci_driver shutdown
yt6801: Implement the fxgmac_init function
yt6801: Implement the .ndo_open function
yt6801: Implement the fxgmac_start function
net:phy:motorcomm: Add PHY_INTERFACE_MODE_INTERNAL to support YT6801
yt6801: Implement the fxgmac_hw_init function
yt6801: Implement the poll functions
yt6801: Implement .ndo_start_xmit function
yt6801: Implement some net_device_ops function
yt6801: Implement pci_driver suspend and resume
yt6801: Add makefile and Kconfig
yt6801: Update the Makefile, Kconfig and maintainer for yt6801
MAINTAINERS | 7 +
arch/arm64/configs/openeuler_defconfig | 4 +-
arch/loongarch/configs/loongson3_defconfig | 3 +
arch/powerpc/configs/openeuler_defconfig | 4 +-
arch/riscv/configs/openeuler_defconfig | 4 +-
arch/x86/configs/openeuler_defconfig | 4 +-
drivers/net/ethernet/Kconfig | 1 +
drivers/net/ethernet/Makefile | 1 +
drivers/net/ethernet/motorcomm/Kconfig | 27 +
drivers/net/ethernet/motorcomm/Makefile | 6 +
.../net/ethernet/motorcomm/yt6801/Makefile | 8 +
.../ethernet/motorcomm/yt6801/yt6801_desc.c | 565 +++
.../ethernet/motorcomm/yt6801/yt6801_desc.h | 35 +
.../ethernet/motorcomm/yt6801/yt6801_main.c | 3020 +++++++++++++++++
.../ethernet/motorcomm/yt6801/yt6801_type.h | 957 ++++++
drivers/net/phy/motorcomm.c | 6 +
16 files changed, 4648 insertions(+), 4 deletions(-)
create mode 100644 drivers/net/ethernet/motorcomm/Kconfig
create mode 100644 drivers/net/ethernet/motorcomm/Makefile
create mode 100644 drivers/net/ethernet/motorcomm/yt6801/Makefile
create mode 100644 drivers/net/ethernet/motorcomm/yt6801/yt6801_desc.c
create mode 100644 drivers/net/ethernet/motorcomm/yt6801/yt6801_desc.h
create mode 100644 drivers/net/ethernet/motorcomm/yt6801/yt6801_main.c
create mode 100644 drivers/net/ethernet/motorcomm/yt6801/yt6801_type.h
--
2.34.1
1
14

[openeuler:OLK-6.6 2117/2117] kernel/sched/fair.c:8988:1: sparse: sparse: symbol 'qos_smt_expell_switch' was not declared. Should it be static?
by kernel test robot 11 Apr '25
by kernel test robot 11 Apr '25
11 Apr '25
tree: https://gitee.com/openeuler/kernel.git OLK-6.6
head: 62b846e657553d00552c1c71b6ecc26017eb1a9a
commit: a62d532da0b51fe39f726c4c08f3debc8b3bc5d7 [2117/2117] sched/fair: Add cmdline nosmtexpell
config: loongarch-randconfig-r121-20250411 (https://download.01.org/0day-ci/archive/20250411/202504111549.QczZh25x-lkp@…)
compiler: loongarch64-linux-gcc (GCC) 14.2.0
reproduce: (https://download.01.org/0day-ci/archive/20250411/202504111549.QczZh25x-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/202504111549.QczZh25x-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
kernel/sched/fair.c:7727:9: sparse: got int [noderef] __percpu *
kernel/sched/fair.c:7727:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
kernel/sched/fair.c:7727:9: sparse: expected void *ptr
kernel/sched/fair.c:7727:9: sparse: got int [noderef] __percpu *
kernel/sched/fair.c:7727:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
kernel/sched/fair.c:7727:9: sparse: expected void *ptr
kernel/sched/fair.c:7727:9: sparse: got int [noderef] __percpu *
kernel/sched/fair.c:1284:34: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct sched_entity const *se @@ got struct sched_entity [noderef] __rcu * @@
kernel/sched/fair.c:1284:34: sparse: expected struct sched_entity const *se
kernel/sched/fair.c:1284:34: sparse: got struct sched_entity [noderef] __rcu *
kernel/sched/fair.c:13325:9: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct sched_domain *[assigned] sd @@ got struct sched_domain [noderef] __rcu *parent @@
kernel/sched/fair.c:13325:9: sparse: expected struct sched_domain *[assigned] sd
kernel/sched/fair.c:13325:9: sparse: got struct sched_domain [noderef] __rcu *parent
kernel/sched/fair.c:5162:25: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/sched/fair.c:5162:25: sparse: struct sparsemask [noderef] __rcu *
kernel/sched/fair.c:5162:25: sparse: struct sparsemask *
kernel/sched/fair.c:5179:25: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/sched/fair.c:5179:25: sparse: struct sparsemask [noderef] __rcu *
kernel/sched/fair.c:5179:25: sparse: struct sparsemask *
kernel/sched/fair.c:13681:25: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/sched/fair.c:13681:25: sparse: struct sparsemask [noderef] __rcu *
kernel/sched/fair.c:13681:25: sparse: struct sparsemask *
kernel/sched/fair.c:6038:22: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/sched/fair.c:6038:22: sparse: struct task_struct [noderef] __rcu *
kernel/sched/fair.c:6038:22: sparse: struct task_struct *
kernel/sched/fair.c:6780:38: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected struct task_struct *curr @@ got struct task_struct [noderef] __rcu *curr @@
kernel/sched/fair.c:6780:38: sparse: expected struct task_struct *curr
kernel/sched/fair.c:6780:38: sparse: got struct task_struct [noderef] __rcu *curr
kernel/sched/fair.c:7531:32: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got struct cpumask *[noderef] __percpu * @@
kernel/sched/fair.c:7531:32: sparse: expected void *ptr
kernel/sched/fair.c:7531:32: sparse: got struct cpumask *[noderef] __percpu *
kernel/sched/fair.c:7531:32: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got struct cpumask *[noderef] __percpu * @@
kernel/sched/fair.c:7531:32: sparse: expected void *ptr
kernel/sched/fair.c:7531:32: sparse: got struct cpumask *[noderef] __percpu *
kernel/sched/fair.c:7531:32: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got struct cpumask *[noderef] __percpu * @@
kernel/sched/fair.c:7531:32: sparse: expected void *ptr
kernel/sched/fair.c:7531:32: sparse: got struct cpumask *[noderef] __percpu *
kernel/sched/fair.c:7531:32: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got struct cpumask *[noderef] __percpu * @@
kernel/sched/fair.c:7531:32: sparse: expected void *ptr
kernel/sched/fair.c:7531:32: sparse: got struct cpumask *[noderef] __percpu *
kernel/sched/fair.c:7634:16: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got struct cpumask *[noderef] __percpu * @@
kernel/sched/fair.c:7634:16: sparse: expected void *ptr
kernel/sched/fair.c:7634:16: sparse: got struct cpumask *[noderef] __percpu *
kernel/sched/fair.c:7634:16: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got struct cpumask *[noderef] __percpu * @@
kernel/sched/fair.c:7634:16: sparse: expected void *ptr
kernel/sched/fair.c:7634:16: sparse: got struct cpumask *[noderef] __percpu *
kernel/sched/fair.c:7634:16: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got struct cpumask *[noderef] __percpu * @@
kernel/sched/fair.c:7634:16: sparse: expected void *ptr
kernel/sched/fair.c:7634:16: sparse: got struct cpumask *[noderef] __percpu *
kernel/sched/fair.c:7634:16: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got struct cpumask *[noderef] __percpu * @@
kernel/sched/fair.c:7634:16: sparse: expected void *ptr
kernel/sched/fair.c:7634:16: sparse: got struct cpumask *[noderef] __percpu *
kernel/sched/fair.c:8139:32: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got struct cpumask *[noderef] __percpu * @@
kernel/sched/fair.c:8139:32: sparse: expected void *ptr
kernel/sched/fair.c:8139:32: sparse: got struct cpumask *[noderef] __percpu *
kernel/sched/fair.c:8139:32: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got struct cpumask *[noderef] __percpu * @@
kernel/sched/fair.c:8139:32: sparse: expected void *ptr
kernel/sched/fair.c:8139:32: sparse: got struct cpumask *[noderef] __percpu *
kernel/sched/fair.c:8139:32: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got struct cpumask *[noderef] __percpu * @@
kernel/sched/fair.c:8139:32: sparse: expected void *ptr
kernel/sched/fair.c:8139:32: sparse: got struct cpumask *[noderef] __percpu *
kernel/sched/fair.c:8139:32: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got struct cpumask *[noderef] __percpu * @@
kernel/sched/fair.c:8139:32: sparse: expected void *ptr
kernel/sched/fair.c:8139:32: sparse: got struct cpumask *[noderef] __percpu *
kernel/sched/fair.c:8163:20: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct sched_domain *[assigned] sd @@ got struct sched_domain [noderef] __rcu *parent @@
kernel/sched/fair.c:8163:20: sparse: expected struct sched_domain *[assigned] sd
kernel/sched/fair.c:8163:20: sparse: got struct sched_domain [noderef] __rcu *parent
kernel/sched/fair.c:8478:9: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct sched_domain *[assigned] tmp @@ got struct sched_domain [noderef] __rcu *parent @@
kernel/sched/fair.c:8478:9: sparse: expected struct sched_domain *[assigned] tmp
kernel/sched/fair.c:8478:9: sparse: got struct sched_domain [noderef] __rcu *parent
kernel/sched/fair.c:8590:38: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected struct task_struct *curr @@ got struct task_struct [noderef] __rcu *curr @@
kernel/sched/fair.c:8590:38: sparse: expected struct task_struct *curr
kernel/sched/fair.c:8590:38: sparse: got struct task_struct [noderef] __rcu *curr
kernel/sched/fair.c:8910:16: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
kernel/sched/fair.c:8910:16: sparse: expected void *ptr
kernel/sched/fair.c:8910:16: sparse: got int [noderef] __percpu *
kernel/sched/fair.c:8910:16: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
kernel/sched/fair.c:8910:16: sparse: expected void *ptr
kernel/sched/fair.c:8910:16: sparse: got int [noderef] __percpu *
kernel/sched/fair.c:8910:16: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
kernel/sched/fair.c:8910:16: sparse: expected void *ptr
kernel/sched/fair.c:8910:16: sparse: got int [noderef] __percpu *
kernel/sched/fair.c:8910:16: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
kernel/sched/fair.c:8910:16: sparse: expected void *ptr
kernel/sched/fair.c:8910:16: sparse: got int [noderef] __percpu *
kernel/sched/fair.c:8936:22: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/sched/fair.c:8936:22: sparse: struct task_struct [noderef] __rcu *
kernel/sched/fair.c:8936:22: sparse: struct task_struct *
kernel/sched/fair.c:8972:13: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
kernel/sched/fair.c:8972:13: sparse: expected void *ptr
kernel/sched/fair.c:8972:13: sparse: got int [noderef] __percpu *
kernel/sched/fair.c:8972:13: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
kernel/sched/fair.c:8972:13: sparse: expected void *ptr
kernel/sched/fair.c:8972:13: sparse: got int [noderef] __percpu *
kernel/sched/fair.c:8972:13: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
kernel/sched/fair.c:8972:13: sparse: expected void *ptr
kernel/sched/fair.c:8972:13: sparse: got int [noderef] __percpu *
kernel/sched/fair.c:8972:13: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
kernel/sched/fair.c:8972:13: sparse: expected void *ptr
kernel/sched/fair.c:8972:13: sparse: got int [noderef] __percpu *
>> kernel/sched/fair.c:8988:1: sparse: sparse: symbol 'qos_smt_expell_switch' was not declared. Should it be static?
kernel/sched/fair.c:9122:51: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct task_struct *sibling_p @@ got struct task_struct [noderef] __rcu *curr @@
kernel/sched/fair.c:9122:51: sparse: expected struct task_struct *sibling_p
kernel/sched/fair.c:9122:51: sparse: got struct task_struct [noderef] __rcu *curr
kernel/sched/fair.c:9127:30: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/sched/fair.c:9127:30: sparse: struct task_struct [noderef] __rcu *
kernel/sched/fair.c:9127:30: sparse: struct task_struct *
kernel/sched/fair.c:9205:48: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct task_struct *p @@ got struct task_struct [noderef] __rcu *curr @@
kernel/sched/fair.c:9454:38: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected struct task_struct *curr @@ got struct task_struct [noderef] __rcu *curr @@
kernel/sched/fair.c:10525:40: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected struct sched_domain *child @@ got struct sched_domain [noderef] __rcu *child @@
kernel/sched/fair.c:11162:22: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/sched/fair.c:11162:22: sparse: struct task_struct [noderef] __rcu *
kernel/sched/fair.c:11162:22: sparse: struct task_struct *
kernel/sched/fair.c:12603:9: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct sched_domain *[assigned] sd @@ got struct sched_domain [noderef] __rcu *parent @@
kernel/sched/fair.c:12603:9: sparse: expected struct sched_domain *[assigned] sd
kernel/sched/fair.c:12603:9: sparse: got struct sched_domain [noderef] __rcu *parent
kernel/sched/fair.c:12187:36: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got struct cpumask *[noderef] __percpu * @@
kernel/sched/fair.c:12187:36: sparse: expected void *ptr
kernel/sched/fair.c:12187:36: sparse: got struct cpumask *[noderef] __percpu *
kernel/sched/fair.c:12187:36: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got struct cpumask *[noderef] __percpu * @@
kernel/sched/fair.c:12187:36: sparse: expected void *ptr
kernel/sched/fair.c:12187:36: sparse: got struct cpumask *[noderef] __percpu *
kernel/sched/fair.c:12187:36: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got struct cpumask *[noderef] __percpu * @@
kernel/sched/fair.c:12187:36: sparse: expected void *ptr
kernel/sched/fair.c:12187:36: sparse: got struct cpumask *[noderef] __percpu *
kernel/sched/fair.c:12187:36: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got struct cpumask *[noderef] __percpu * @@
kernel/sched/fair.c:12187:36: sparse: expected void *ptr
kernel/sched/fair.c:12187:36: sparse: got struct cpumask *[noderef] __percpu *
kernel/sched/fair.c:12260:44: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected struct sched_domain *sd_parent @@ got struct sched_domain [noderef] __rcu *parent @@
kernel/sched/fair.c:12260:44: sparse: expected struct sched_domain *sd_parent
kernel/sched/fair.c:12260:44: sparse: got struct sched_domain [noderef] __rcu *parent
kernel/sched/fair.c:12264:32: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got struct cpumask *[noderef] __percpu * @@
kernel/sched/fair.c:12264:32: sparse: expected void *ptr
kernel/sched/fair.c:12264:32: sparse: got struct cpumask *[noderef] __percpu *
kernel/sched/fair.c:12264:32: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got struct cpumask *[noderef] __percpu * @@
kernel/sched/fair.c:12264:32: sparse: expected void *ptr
kernel/sched/fair.c:12264:32: sparse: got struct cpumask *[noderef] __percpu *
kernel/sched/fair.c:12264:32: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got struct cpumask *[noderef] __percpu * @@
kernel/sched/fair.c:12264:32: sparse: expected void *ptr
kernel/sched/fair.c:12264:32: sparse: got struct cpumask *[noderef] __percpu *
kernel/sched/fair.c:12264:32: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got struct cpumask *[noderef] __percpu * @@
kernel/sched/fair.c:12264:32: sparse: expected void *ptr
kernel/sched/fair.c:12264:32: sparse: got struct cpumask *[noderef] __percpu *
kernel/sched/fair.c:12699:9: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct sched_domain *[assigned] sd @@ got struct sched_domain [noderef] __rcu *parent @@
kernel/sched/fair.c:12699:9: sparse: expected struct sched_domain *[assigned] sd
kernel/sched/fair.c:12699:9: sparse: got struct sched_domain [noderef] __rcu *parent
kernel/sched/fair.c: note: in included file:
kernel/sched/sched.h:2182:25: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/sched/sched.h:2182:25: sparse: struct task_struct [noderef] __rcu *
kernel/sched/sched.h:2182:25: sparse: struct task_struct *
kernel/sched/sched.h:2346:9: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/sched/sched.h:2346:9: sparse: struct task_struct [noderef] __rcu *
kernel/sched/sched.h:2346:9: sparse: struct task_struct *
kernel/sched/sched.h:2346:9: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/sched/sched.h:2346:9: sparse: struct task_struct [noderef] __rcu *
kernel/sched/sched.h:2346:9: sparse: struct task_struct *
kernel/sched/sched.h:2182:25: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/sched/sched.h:2182:25: sparse: struct task_struct [noderef] __rcu *
kernel/sched/sched.h:2182:25: sparse: struct task_struct *
kernel/sched/sched.h:2182:25: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/sched/sched.h:2182:25: sparse: struct task_struct [noderef] __rcu *
kernel/sched/sched.h:2182:25: sparse: struct task_struct *
vim +/qos_smt_expell_switch +8988 kernel/sched/fair.c
8986
8987 #ifdef CONFIG_QOS_SCHED_SMT_EXPELLER
> 8988 DEFINE_STATIC_KEY_TRUE(qos_smt_expell_switch);
8989
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
1
0
From: Ye Bin <yebin10(a)huawei.com>
mainline inclusion
from mainline-v6.14-rc6
commit 654b33ada4ab5e926cd9c570196fefa7bec7c1df
category: bugfix
bugzilla: 190521
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?…
--------------------------------
Fix race between rmmod and /proc/XXX's inode instantiation.
The bug is that pde->proc_ops don't belong to /proc, it belongs to a
module, therefore dereferencing it after /proc entry has been registered
is a bug unless use_pde/unuse_pde() pair has been used.
use_pde/unuse_pde can be avoided (2 atomic ops!) because pde->proc_ops
never changes so information necessary for inode instantiation can be
saved _before_ proc_register() in PDE itself and used later, avoiding
pde->proc_ops->... dereference.
rmmod lookup
sys_delete_module
proc_lookup_de
pde_get(de);
proc_get_inode(dir->i_sb, de);
mod->exit()
proc_remove
remove_proc_subtree
proc_entry_rundown(de);
free_module(mod);
if (S_ISREG(inode->i_mode))
if (de->proc_ops->proc_read_iter)
--> As module is already freed, will trigger UAF
BUG: unable to handle page fault for address: fffffbfff80a702b
PGD 817fc4067 P4D 817fc4067 PUD 817fc0067 PMD 102ef4067 PTE 0
Oops: Oops: 0000 [#1] PREEMPT SMP KASAN PTI
CPU: 26 UID: 0 PID: 2667 Comm: ls Tainted: G
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996)
RIP: 0010:proc_get_inode+0x302/0x6e0
RSP: 0018:ffff88811c837998 EFLAGS: 00010a06
RAX: dffffc0000000000 RBX: ffffffffc0538140 RCX: 0000000000000007
RDX: 1ffffffff80a702b RSI: 0000000000000001 RDI: ffffffffc0538158
RBP: ffff8881299a6000 R08: 0000000067bbe1e5 R09: 1ffff11023906f20
R10: ffffffffb560ca07 R11: ffffffffb2b43a58 R12: ffff888105bb78f0
R13: ffff888100518048 R14: ffff8881299a6004 R15: 0000000000000001
FS: 00007f95b9686840(0000) GS:ffff8883af100000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: fffffbfff80a702b CR3: 0000000117dd2000 CR4: 00000000000006f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
proc_lookup_de+0x11f/0x2e0
__lookup_slow+0x188/0x350
walk_component+0x2ab/0x4f0
path_lookupat+0x120/0x660
filename_lookup+0x1ce/0x560
vfs_statx+0xac/0x150
__do_sys_newstat+0x96/0x110
do_syscall_64+0x5f/0x170
entry_SYSCALL_64_after_hwframe+0x76/0x7e
[adobriyan(a)gmail.com: don't do 2 atomic ops on the common path]
Link: https://lkml.kernel.org/r/3d25ded0-1739-447e-812b-e34da7990dcf@p183
Fixes: 778f3dd5a13c ("Fix procfs compat_ioctl regression")
Signed-off-by: Ye Bin <yebin10(a)huawei.com>
Signed-off-by: Alexey Dobriyan <adobriyan(a)gmail.com>
Cc: Al Viro <viro(a)zeniv.linux.org.uk>
Cc: David S. Miller <davem(a)davemloft.net>
Cc: <stable(a)vger.kernel.org>
Signed-off-by: Andrew Morton <akipm(a)linux-foundation.org>
Conflicts:
fs/proc/internal.h
[ef1d61781bc67 not applied]
Signed-off-by: Yongjian Sun <sunyongjian1(a)huawei.com>
---
fs/proc/generic.c | 10 +++++++++-
fs/proc/inode.c | 6 +++---
fs/proc/internal.h | 14 ++++++++++++++
include/linux/proc_fs.h | 7 +++++--
4 files changed, 31 insertions(+), 6 deletions(-)
diff --git a/fs/proc/generic.c b/fs/proc/generic.c
index 5898761698c2..7b6d9c77b425 100644
--- a/fs/proc/generic.c
+++ b/fs/proc/generic.c
@@ -563,10 +563,16 @@ struct proc_dir_entry *proc_create_reg(const char *name, umode_t mode,
return p;
}
-static inline void pde_set_flags(struct proc_dir_entry *pde)
+static void pde_set_flags(struct proc_dir_entry *pde)
{
if (pde->proc_ops->proc_flags & PROC_ENTRY_PERMANENT)
pde->flags |= PROC_ENTRY_PERMANENT;
+ if (pde->proc_ops->proc_read_iter)
+ pde->flags |= PROC_ENTRY_proc_read_iter;
+#ifdef CONFIG_COMPAT
+ if (pde->proc_ops->proc_compat_ioctl)
+ pde->flags |= PROC_ENTRY_proc_compat_ioctl;
+#endif
}
struct proc_dir_entry *proc_create_data(const char *name, umode_t mode,
@@ -630,6 +636,7 @@ struct proc_dir_entry *proc_create_seq_private(const char *name, umode_t mode,
p->proc_ops = &proc_seq_ops;
p->seq_ops = ops;
p->state_size = state_size;
+ pde_set_flags(p);
return proc_register(parent, p);
}
EXPORT_SYMBOL(proc_create_seq_private);
@@ -660,6 +667,7 @@ struct proc_dir_entry *proc_create_single_data(const char *name, umode_t mode,
return NULL;
p->proc_ops = &proc_single_ops;
p->single_show = show;
+ pde_set_flags(p);
return proc_register(parent, p);
}
EXPORT_SYMBOL(proc_create_single_data);
diff --git a/fs/proc/inode.c b/fs/proc/inode.c
index bde6b6f69852..ba35ffc426ea 100644
--- a/fs/proc/inode.c
+++ b/fs/proc/inode.c
@@ -684,13 +684,13 @@ struct inode *proc_get_inode(struct super_block *sb, struct proc_dir_entry *de)
if (S_ISREG(inode->i_mode)) {
inode->i_op = de->proc_iops;
- if (de->proc_ops->proc_read_iter)
+ if (pde_has_proc_read_iter(de))
inode->i_fop = &proc_iter_file_ops;
else
inode->i_fop = &proc_reg_file_ops;
#ifdef CONFIG_COMPAT
- if (de->proc_ops->proc_compat_ioctl) {
- if (de->proc_ops->proc_read_iter)
+ if (pde_has_proc_compat_ioctl(de)) {
+ if (pde_has_proc_read_iter(de))
inode->i_fop = &proc_iter_file_ops_compat;
else
inode->i_fop = &proc_reg_file_ops_compat;
diff --git a/fs/proc/internal.h b/fs/proc/internal.h
index 104945bbeb9f..c75d0db70a85 100644
--- a/fs/proc/internal.h
+++ b/fs/proc/internal.h
@@ -79,6 +79,20 @@ static inline bool pde_is_permanent(const struct proc_dir_entry *pde)
return pde->flags & PROC_ENTRY_PERMANENT;
}
+static inline bool pde_has_proc_read_iter(const struct proc_dir_entry *pde)
+{
+ return pde->flags & PROC_ENTRY_proc_read_iter;
+}
+
+static inline bool pde_has_proc_compat_ioctl(const struct proc_dir_entry *pde)
+{
+#ifdef CONFIG_COMPAT
+ return pde->flags & PROC_ENTRY_proc_compat_ioctl;
+#else
+ return false;
+#endif
+}
+
extern struct kmem_cache *proc_dir_entry_cache;
void pde_free(struct proc_dir_entry *pde);
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h
index 8c892730a1f1..9f8e0072b30f 100644
--- a/include/linux/proc_fs.h
+++ b/include/linux/proc_fs.h
@@ -20,10 +20,13 @@ enum {
* If in doubt, ignore this flag.
*/
#ifdef MODULE
- PROC_ENTRY_PERMANENT = 0U,
+ PROC_ENTRY_PERMANENT = 0U,
#else
- PROC_ENTRY_PERMANENT = 1U << 0,
+ PROC_ENTRY_PERMANENT = 1U << 0,
#endif
+
+ PROC_ENTRY_proc_read_iter = 1U << 1,
+ PROC_ENTRY_proc_compat_ioctl = 1U << 2,
};
struct proc_ops {
--
2.39.2
2
1
Patch#1 Allocate VM table and save vpeid in it
Patch#2 avoid sending multi-SGIs in IPIV
Patch#3 Set base address of vm table and targe ITS when vpe schedule and deschedule
Patch#4 Register ipiv exception interrupt
Patch#5 Add interface KVM_CAP_ARM_IPIV_MODE
Patch#6 Probe and configure IPIV capacity on HIP12
Patch#7 Use KABI_EXTEND to perform kabi repair for IPIV
Jinqian Yang (2):
KVM: arm64: avoid sending multi-SGIs in IPIV
kabi: Use KABI_EXTEND to perform kabi repair for IPIV
Xiang Chen (5):
kvm: hisi_virt: Allocate VM table and save vpeid in it
irqchip: gicv3-its: Set base address of vm table and targe ITS when
vpe schedule and deschedule
kvm: hisi_virt: Register ipiv exception interrupt
kvm: arm64: Add interface KVM_CAP_ARM_IPIV_MODE
kvm: hisi_virt: Probe and configure IPIV capacity on HIP12
.../admin-guide/kernel-parameters.txt | 3 +
arch/arm64/include/asm/kvm_host.h | 1 +
arch/arm64/include/asm/sysreg.h | 3 +
arch/arm64/kvm/arm.c | 16 ++++
arch/arm64/kvm/hisilicon/hisi_virt.c | 38 ++++++++
arch/arm64/kvm/hisilicon/hisi_virt.h | 11 +++
arch/arm64/kvm/sys_regs.c | 30 ++++--
arch/arm64/kvm/vgic/vgic-init.c | 44 ++++++++-
arch/arm64/kvm/vgic/vgic-mmio-v3.c | 2 +
drivers/irqchip/irq-gic-v3-its.c | 93 ++++++++++++++++++-
drivers/irqchip/irq-gic-v3.c | 33 +++++++
include/linux/irqchip/arm-gic-v3.h | 24 +++++
include/linux/irqchip/arm-gic-v4.h | 2 +
include/uapi/linux/kvm.h | 2 +
14 files changed, 288 insertions(+), 14 deletions(-)
--
2.33.0
3
9

[openeuler:OLK-6.6 2117/2117] kernel/sched/fair.c:9005:51: sparse: sparse: incorrect type in argument 1 (different address spaces)
by kernel test robot 11 Apr '25
by kernel test robot 11 Apr '25
11 Apr '25
tree: https://gitee.com/openeuler/kernel.git OLK-6.6
head: 62b846e657553d00552c1c71b6ecc26017eb1a9a
commit: c52c17a85f1fa9cde2bcb15359096634cfd9eb7c [2117/2117] sched: Add tracepoint for qos smt expeller
config: loongarch-randconfig-r121-20250411 (https://download.01.org/0day-ci/archive/20250411/202504111253.jKd4DxgW-lkp@…)
compiler: loongarch64-linux-gcc (GCC) 14.2.0
reproduce: (https://download.01.org/0day-ci/archive/20250411/202504111253.jKd4DxgW-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/202504111253.jKd4DxgW-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
kernel/sched/fair.c:7685:9: sparse: got int [noderef] __percpu *
kernel/sched/fair.c:7685:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
kernel/sched/fair.c:7685:9: sparse: expected void *ptr
kernel/sched/fair.c:7685:9: sparse: got int [noderef] __percpu *
kernel/sched/fair.c:7685:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
kernel/sched/fair.c:7685:9: sparse: expected void *ptr
kernel/sched/fair.c:7685:9: sparse: got int [noderef] __percpu *
kernel/sched/fair.c:1283:34: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct sched_entity const *se @@ got struct sched_entity [noderef] __rcu * @@
kernel/sched/fair.c:1283:34: sparse: expected struct sched_entity const *se
kernel/sched/fair.c:1283:34: sparse: got struct sched_entity [noderef] __rcu *
kernel/sched/fair.c:13203:9: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct sched_domain *[assigned] sd @@ got struct sched_domain [noderef] __rcu *parent @@
kernel/sched/fair.c:13203:9: sparse: expected struct sched_domain *[assigned] sd
kernel/sched/fair.c:13203:9: sparse: got struct sched_domain [noderef] __rcu *parent
kernel/sched/fair.c:5161:25: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/sched/fair.c:5161:25: sparse: struct sparsemask [noderef] __rcu *
kernel/sched/fair.c:5161:25: sparse: struct sparsemask *
kernel/sched/fair.c:5178:25: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/sched/fair.c:5178:25: sparse: struct sparsemask [noderef] __rcu *
kernel/sched/fair.c:5178:25: sparse: struct sparsemask *
kernel/sched/fair.c:13559:25: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/sched/fair.c:13559:25: sparse: struct sparsemask [noderef] __rcu *
kernel/sched/fair.c:13559:25: sparse: struct sparsemask *
kernel/sched/fair.c:6012:22: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/sched/fair.c:6012:22: sparse: struct task_struct [noderef] __rcu *
kernel/sched/fair.c:6012:22: sparse: struct task_struct *
kernel/sched/fair.c:6754:38: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected struct task_struct *curr @@ got struct task_struct [noderef] __rcu *curr @@
kernel/sched/fair.c:6754:38: sparse: expected struct task_struct *curr
kernel/sched/fair.c:6754:38: sparse: got struct task_struct [noderef] __rcu *curr
kernel/sched/fair.c:7489:32: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got struct cpumask *[noderef] __percpu * @@
kernel/sched/fair.c:7489:32: sparse: expected void *ptr
kernel/sched/fair.c:7489:32: sparse: got struct cpumask *[noderef] __percpu *
kernel/sched/fair.c:7489:32: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got struct cpumask *[noderef] __percpu * @@
kernel/sched/fair.c:7489:32: sparse: expected void *ptr
kernel/sched/fair.c:7489:32: sparse: got struct cpumask *[noderef] __percpu *
kernel/sched/fair.c:7489:32: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got struct cpumask *[noderef] __percpu * @@
kernel/sched/fair.c:7489:32: sparse: expected void *ptr
kernel/sched/fair.c:7489:32: sparse: got struct cpumask *[noderef] __percpu *
kernel/sched/fair.c:7489:32: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got struct cpumask *[noderef] __percpu * @@
kernel/sched/fair.c:7489:32: sparse: expected void *ptr
kernel/sched/fair.c:7489:32: sparse: got struct cpumask *[noderef] __percpu *
kernel/sched/fair.c:7592:16: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got struct cpumask *[noderef] __percpu * @@
kernel/sched/fair.c:7592:16: sparse: expected void *ptr
kernel/sched/fair.c:7592:16: sparse: got struct cpumask *[noderef] __percpu *
kernel/sched/fair.c:7592:16: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got struct cpumask *[noderef] __percpu * @@
kernel/sched/fair.c:7592:16: sparse: expected void *ptr
kernel/sched/fair.c:7592:16: sparse: got struct cpumask *[noderef] __percpu *
kernel/sched/fair.c:7592:16: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got struct cpumask *[noderef] __percpu * @@
kernel/sched/fair.c:7592:16: sparse: expected void *ptr
kernel/sched/fair.c:7592:16: sparse: got struct cpumask *[noderef] __percpu *
kernel/sched/fair.c:7592:16: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got struct cpumask *[noderef] __percpu * @@
kernel/sched/fair.c:7592:16: sparse: expected void *ptr
kernel/sched/fair.c:7592:16: sparse: got struct cpumask *[noderef] __percpu *
kernel/sched/fair.c:8097:32: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got struct cpumask *[noderef] __percpu * @@
kernel/sched/fair.c:8097:32: sparse: expected void *ptr
kernel/sched/fair.c:8097:32: sparse: got struct cpumask *[noderef] __percpu *
kernel/sched/fair.c:8097:32: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got struct cpumask *[noderef] __percpu * @@
kernel/sched/fair.c:8097:32: sparse: expected void *ptr
kernel/sched/fair.c:8097:32: sparse: got struct cpumask *[noderef] __percpu *
kernel/sched/fair.c:8097:32: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got struct cpumask *[noderef] __percpu * @@
kernel/sched/fair.c:8097:32: sparse: expected void *ptr
kernel/sched/fair.c:8097:32: sparse: got struct cpumask *[noderef] __percpu *
kernel/sched/fair.c:8097:32: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got struct cpumask *[noderef] __percpu * @@
kernel/sched/fair.c:8097:32: sparse: expected void *ptr
kernel/sched/fair.c:8097:32: sparse: got struct cpumask *[noderef] __percpu *
kernel/sched/fair.c:8121:20: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct sched_domain *[assigned] sd @@ got struct sched_domain [noderef] __rcu *parent @@
kernel/sched/fair.c:8121:20: sparse: expected struct sched_domain *[assigned] sd
kernel/sched/fair.c:8121:20: sparse: got struct sched_domain [noderef] __rcu *parent
kernel/sched/fair.c:8436:9: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct sched_domain *[assigned] tmp @@ got struct sched_domain [noderef] __rcu *parent @@
kernel/sched/fair.c:8436:9: sparse: expected struct sched_domain *[assigned] tmp
kernel/sched/fair.c:8436:9: sparse: got struct sched_domain [noderef] __rcu *parent
kernel/sched/fair.c:8548:38: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected struct task_struct *curr @@ got struct task_struct [noderef] __rcu *curr @@
kernel/sched/fair.c:8548:38: sparse: expected struct task_struct *curr
kernel/sched/fair.c:8548:38: sparse: got struct task_struct [noderef] __rcu *curr
kernel/sched/fair.c:8774:22: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/sched/fair.c:8774:22: sparse: struct task_struct [noderef] __rcu *
kernel/sched/fair.c:8774:22: sparse: struct task_struct *
kernel/sched/fair.c:8839:16: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
kernel/sched/fair.c:8839:16: sparse: expected void *ptr
kernel/sched/fair.c:8839:16: sparse: got int [noderef] __percpu *
kernel/sched/fair.c:8839:16: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
kernel/sched/fair.c:8839:16: sparse: expected void *ptr
kernel/sched/fair.c:8839:16: sparse: got int [noderef] __percpu *
kernel/sched/fair.c:8839:16: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
kernel/sched/fair.c:8839:16: sparse: expected void *ptr
kernel/sched/fair.c:8839:16: sparse: got int [noderef] __percpu *
kernel/sched/fair.c:8839:16: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
kernel/sched/fair.c:8839:16: sparse: expected void *ptr
kernel/sched/fair.c:8839:16: sparse: got int [noderef] __percpu *
kernel/sched/fair.c:8896:13: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
kernel/sched/fair.c:8896:13: sparse: expected void *ptr
kernel/sched/fair.c:8896:13: sparse: got int [noderef] __percpu *
kernel/sched/fair.c:8896:13: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
kernel/sched/fair.c:8896:13: sparse: expected void *ptr
kernel/sched/fair.c:8896:13: sparse: got int [noderef] __percpu *
kernel/sched/fair.c:8896:13: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
kernel/sched/fair.c:8896:13: sparse: expected void *ptr
kernel/sched/fair.c:8896:13: sparse: got int [noderef] __percpu *
kernel/sched/fair.c:8896:13: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
kernel/sched/fair.c:8896:13: sparse: expected void *ptr
kernel/sched/fair.c:8896:13: sparse: got int [noderef] __percpu *
>> kernel/sched/fair.c:9005:51: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct task_struct *sibling_p @@ got struct task_struct [noderef] __rcu *curr @@
kernel/sched/fair.c:9005:51: sparse: expected struct task_struct *sibling_p
kernel/sched/fair.c:9005:51: sparse: got struct task_struct [noderef] __rcu *curr
kernel/sched/fair.c:9010:30: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/sched/fair.c:9010:30: sparse: struct task_struct [noderef] __rcu *
kernel/sched/fair.c:9010:30: sparse: struct task_struct *
kernel/sched/fair.c:9084:48: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct task_struct *p @@ got struct task_struct [noderef] __rcu *curr @@
kernel/sched/fair.c:9332:38: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected struct task_struct *curr @@ got struct task_struct [noderef] __rcu *curr @@
kernel/sched/fair.c:10403:40: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected struct sched_domain *child @@ got struct sched_domain [noderef] __rcu *child @@
kernel/sched/fair.c:11040:22: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/sched/fair.c:11040:22: sparse: struct task_struct [noderef] __rcu *
kernel/sched/fair.c:11040:22: sparse: struct task_struct *
kernel/sched/fair.c:12481:9: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct sched_domain *[assigned] sd @@ got struct sched_domain [noderef] __rcu *parent @@
kernel/sched/fair.c:12481:9: sparse: expected struct sched_domain *[assigned] sd
kernel/sched/fair.c:12481:9: sparse: got struct sched_domain [noderef] __rcu *parent
kernel/sched/fair.c:12065:36: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got struct cpumask *[noderef] __percpu * @@
kernel/sched/fair.c:12065:36: sparse: expected void *ptr
kernel/sched/fair.c:12065:36: sparse: got struct cpumask *[noderef] __percpu *
kernel/sched/fair.c:12065:36: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got struct cpumask *[noderef] __percpu * @@
kernel/sched/fair.c:12065:36: sparse: expected void *ptr
kernel/sched/fair.c:12065:36: sparse: got struct cpumask *[noderef] __percpu *
kernel/sched/fair.c:12065:36: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got struct cpumask *[noderef] __percpu * @@
kernel/sched/fair.c:12065:36: sparse: expected void *ptr
kernel/sched/fair.c:12065:36: sparse: got struct cpumask *[noderef] __percpu *
kernel/sched/fair.c:12065:36: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got struct cpumask *[noderef] __percpu * @@
kernel/sched/fair.c:12065:36: sparse: expected void *ptr
kernel/sched/fair.c:12065:36: sparse: got struct cpumask *[noderef] __percpu *
kernel/sched/fair.c:12138:44: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected struct sched_domain *sd_parent @@ got struct sched_domain [noderef] __rcu *parent @@
kernel/sched/fair.c:12138:44: sparse: expected struct sched_domain *sd_parent
kernel/sched/fair.c:12138:44: sparse: got struct sched_domain [noderef] __rcu *parent
kernel/sched/fair.c:12142:32: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got struct cpumask *[noderef] __percpu * @@
kernel/sched/fair.c:12142:32: sparse: expected void *ptr
kernel/sched/fair.c:12142:32: sparse: got struct cpumask *[noderef] __percpu *
kernel/sched/fair.c:12142:32: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got struct cpumask *[noderef] __percpu * @@
kernel/sched/fair.c:12142:32: sparse: expected void *ptr
kernel/sched/fair.c:12142:32: sparse: got struct cpumask *[noderef] __percpu *
kernel/sched/fair.c:12142:32: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got struct cpumask *[noderef] __percpu * @@
kernel/sched/fair.c:12142:32: sparse: expected void *ptr
kernel/sched/fair.c:12142:32: sparse: got struct cpumask *[noderef] __percpu *
kernel/sched/fair.c:12142:32: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got struct cpumask *[noderef] __percpu * @@
kernel/sched/fair.c:12142:32: sparse: expected void *ptr
kernel/sched/fair.c:12142:32: sparse: got struct cpumask *[noderef] __percpu *
kernel/sched/fair.c:12577:9: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct sched_domain *[assigned] sd @@ got struct sched_domain [noderef] __rcu *parent @@
kernel/sched/fair.c:12577:9: sparse: expected struct sched_domain *[assigned] sd
kernel/sched/fair.c:12577:9: sparse: got struct sched_domain [noderef] __rcu *parent
kernel/sched/fair.c: note: in included file:
kernel/sched/sched.h:2174:25: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/sched/sched.h:2174:25: sparse: struct task_struct [noderef] __rcu *
kernel/sched/sched.h:2174:25: sparse: struct task_struct *
kernel/sched/sched.h:2338:9: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/sched/sched.h:2338:9: sparse: struct task_struct [noderef] __rcu *
kernel/sched/sched.h:2338:9: sparse: struct task_struct *
kernel/sched/sched.h:2338:9: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/sched/sched.h:2338:9: sparse: struct task_struct [noderef] __rcu *
kernel/sched/sched.h:2338:9: sparse: struct task_struct *
kernel/sched/sched.h:2174:25: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/sched/sched.h:2174:25: sparse: struct task_struct [noderef] __rcu *
kernel/sched/sched.h:2174:25: sparse: struct task_struct *
kernel/sched/sched.h:2174:25: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/sched/sched.h:2174:25: sparse: struct task_struct [noderef] __rcu *
kernel/sched/sched.h:2174:25: sparse: struct task_struct *
vim +9005 kernel/sched/fair.c
8984
8985 static bool _qos_smt_check_need_resched(int this_cpu, struct rq *rq)
8986 {
8987 int cpu;
8988
8989 if (!sched_smt_active())
8990 return false;
8991
8992 for_each_cpu(cpu, cpu_smt_mask(this_cpu)) {
8993 if (cpu == this_cpu)
8994 continue;
8995
8996 /*
8997 * There are two cases rely on the set need_resched to drive away
8998 * offline task:
8999 * a) The qos_smt_status of siblings cpu is online, the task of curr cpu is offline;
9000 * b) The qos_smt_status of siblings cpu is offline, the task of curr cpu is idle,
9001 * and current cpu only has SCHED_IDLE tasks enqueued.
9002 */
9003 if (per_cpu(qos_smt_status, cpu) == QOS_LEVEL_ONLINE &&
9004 task_group(current)->qos_level < QOS_LEVEL_ONLINE) {
> 9005 trace_sched_qos_smt_expel(cpu_curr(cpu), per_cpu(qos_smt_status, cpu));
9006 return true;
9007 }
9008
9009 if (per_cpu(qos_smt_status, cpu) == QOS_LEVEL_OFFLINE &&
9010 rq->curr == rq->idle && sched_idle_cpu(this_cpu)) {
9011 trace_sched_qos_smt_expel(cpu_curr(cpu), per_cpu(qos_smt_status, cpu));
9012 return true;
9013 }
9014 }
9015
9016 return false;
9017 }
9018
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
1
0

[openeuler:OLK-6.6] BUILD REGRESSION 62b846e657553d00552c1c71b6ecc26017eb1a9a
by kernel test robot 11 Apr '25
by kernel test robot 11 Apr '25
11 Apr '25
tree/branch: https://gitee.com/openeuler/kernel.git OLK-6.6
branch HEAD: 62b846e657553d00552c1c71b6ecc26017eb1a9a !15611 Minimize xa_node allocation during xarry split
Error/Warning (recently discovered and may have been fixed):
https://lore.kernel.org/oe-kbuild-all/202503151158.xNxBbX1r-lkp@intel.com
https://lore.kernel.org/oe-kbuild-all/202503182233.88LCSaAj-lkp@intel.com
https://lore.kernel.org/oe-kbuild-all/202503200858.XSvAPfQM-lkp@intel.com
https://lore.kernel.org/oe-kbuild-all/202503201027.i8HE43EJ-lkp@intel.com
https://lore.kernel.org/oe-kbuild-all/202503220823.mG13Rroz-lkp@intel.com
https://lore.kernel.org/oe-kbuild-all/202503220924.Uw2cwpZV-lkp@intel.com
https://lore.kernel.org/oe-kbuild-all/202503231106.ZSS1yt6E-lkp@intel.com
https://lore.kernel.org/oe-kbuild-all/202503231154.d6j01UpO-lkp@intel.com
https://lore.kernel.org/oe-kbuild-all/202503280313.olFyEFIT-lkp@intel.com
https://lore.kernel.org/oe-kbuild-all/202503290855.eVbc4pVd-lkp@intel.com
https://lore.kernel.org/oe-kbuild-all/202504012026.kzT6d2HZ-lkp@intel.com
https://lore.kernel.org/oe-kbuild-all/202504101403.RKyoTq9Z-lkp@intel.com
https://lore.kernel.org/oe-kbuild-all/202504101645.mRh7GNFb-lkp@intel.com
https://lore.kernel.org/oe-kbuild-all/202504110226.FM6zQ8DE-lkp@intel.com
https://lore.kernel.org/oe-kbuild-all/202504110741.FCO7H6rm-lkp@intel.com
https://lore.kernel.org/oe-kbuild/202503271832.WycjTkRa-lkp@intel.com
aarch64-linux-ld: Unexpected GOT/PLT entries detected!
aarch64-linux-ld: Unexpected run-time procedure linkages detected!
arch/arm64/kvm/virtcca_cvm.c:819:5: warning: no previous prototype for function 'virtcca_get_tmi_version' [-Wmissing-prototypes]
arch/loongarch/mm/cache.c:69:29: warning: variable 'way_size' set but not used [-Wunused-but-set-variable]
clang: warning: -Wl,-soname=linux-ilp32-vdso.so.1: 'linker' input unused [-Wunused-command-line-argument]
drivers/coda/coda_pci.c:228: warning: Excess function parameter 'pdev' description in 'virtcca_pci_get_rom_size'
drivers/coda/coda_pci.c:228: warning: Function parameter or member 'p' not described in 'virtcca_pci_get_rom_size'
drivers/scsi/linkdata/ps3stor/./linux/ps3_base.c:545:5: error: no previous prototype for 'ps3_pci_init' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/./linux/ps3_base.c:899:5: error: no previous prototype for 'ps3_pci_init_complete' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/./linux/ps3_base.c:945:6: error: no previous prototype for 'ps3_pci_init_complete_exit' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/./linux/ps3_cli.c:108:9: error: function 'ps3stor_cli_printf' might be a candidate for 'gnu_printf' format attribute [-Werror=suggest-attribute=format]
drivers/scsi/linkdata/ps3stor/./linux/ps3_cli_debug.c:1059:5: error: no previous prototype for 'ps3_dump_context_show' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/./linux/ps3_dump.c:159:5: error: no previous prototype for 'ps3_dump_file_write' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/./linux/ps3_dump.c:200:5: error: no previous prototype for 'ps3_dump_file_close' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/./linux/ps3_dump.c:28:5: error: no previous prototype for 'ps3_dump_local_time' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/./linux/ps3_dump.c:50:5: error: no previous prototype for 'ps3_dump_filename_build' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/./linux/ps3_dump.c:76:5: error: no previous prototype for 'ps3_dump_file_open' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_cmd_complete.c:131:6: error: no previous prototype for 'ps3_trigger_irq_poll' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_cmd_complete.c:243:5: error: no previous prototype for 'ps3_resp_status_convert' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_cmd_statistics.c:403:6: error: no previous prototype for 'ps3_io_recv_ok_stat_inc' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_cmd_statistics.c:85:6: error: no previous prototype for 'ps3_cmd_stat_content_clear' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_debug.c:883:5: error: no previous prototype for 'ps3_dump_dir_length' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_device_manager.c:1581:5: error: no previous prototype for 'ps3_scsi_private_init_pd' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_device_manager.c:1663:5: error: no previous prototype for 'ps3_scsi_private_init_vd' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_device_manager_sas.c:1632:5: error: no previous prototype for 'ps3_sas_expander_phys_refresh' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_instance_manager.c:669:60: error: 'snprintf' output may be truncated before the last format character [-Werror=format-truncation=]
drivers/scsi/linkdata/ps3stor/ps3_ioc_adp.c:147:6: error: no previous prototype for 'ps3_ioc_resource_prepare_hba' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_ioc_adp.c:36:6: error: no previous prototype for 'ps3_ioc_resource_prepare_switch' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_ioc_adp.c:88:6: error: no previous prototype for 'ps3_ioc_resource_prepare_raid' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_ioc_manager.c:307:5: error: no previous prototype for 'ps3_hard_reset_to_ready' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_ioctl.c:785:6: error: no previous prototype for 'ps3_clean_mgr_cmd' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_irq.c:21:27: error: 'PS3_INTERRUPT_CMD_DISABLE_ALL_MASK' defined but not used [-Werror=unused-const-variable=]
drivers/scsi/linkdata/ps3stor/ps3_irq.c:22:27: error: 'PS3_INTERRUPT_CMD_ENABLE_MSIX' defined but not used [-Werror=unused-const-variable=]
drivers/scsi/linkdata/ps3stor/ps3_irq.c:23:27: error: 'PS3_INTERRUPT_MASK_DISABLE' defined but not used [-Werror=unused-const-variable=]
drivers/scsi/linkdata/ps3stor/ps3_irq.c:24:27: error: 'PS3_INTERRUPT_STATUS_EXIST_IRQ' defined but not used [-Werror=unused-const-variable=]
drivers/scsi/linkdata/ps3stor/ps3_irq.c:25:27: error: 'PS3_INTERRUPT_CLEAR_IRQ' defined but not used [-Werror=unused-const-variable=]
drivers/scsi/linkdata/ps3stor/ps3_irq.c:27:27: error: 'PS3_SSD_IOPS_MSIX_VECTORS' defined but not used [-Werror=unused-const-variable=]
drivers/scsi/linkdata/ps3stor/ps3_irq.c:28:27: error: 'PS3_HDD_IOPS_MSIX_VECTORS' defined but not used [-Werror=unused-const-variable=]
drivers/scsi/linkdata/ps3stor/ps3_module_para.c:609:14: error: no previous prototype for 'ps3_cli_ver_query' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_qos.c:1058:6: error: no previous prototype for 'ps3_qos_pd_waitq_ratio_update' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_qos.c:2019:15: error: no previous prototype for 'ps3_hba_qos_decision' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_qos.c:2040:6: error: no previous prototype for 'ps3_hba_qos_waitq_notify' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_qos.c:2100:6: error: no previous prototype for 'ps3_cmd_waitq_abort' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_qos.c:211:1: error: no previous prototype for 'ps3_qos_cmd_waitq_get' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_qos.c:2463:6: error: no previous prototype for 'ps3_hba_qos_waitq_clear_all' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_qos.c:2827:6: error: no previous prototype for 'ps3_hba_qos_vd_init' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_qos.c:2936:6: error: no previous prototype for 'ps3_hba_qos_vd_reset' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_qos.c:3023:6: error: no previous prototype for 'ps3_hba_qos_waitq_poll' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_qos.c:3279:15: error: no previous prototype for 'ps3_raid_qos_decision' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_qos.c:3334:6: error: no previous prototype for 'ps3_qos_mgrq_resend' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_qos.c:335:15: error: no previous prototype for 'ps3_qos_vd_cmdword_get' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_qos.c:3478:6: error: no previous prototype for 'ps3_raid_qos_waitq_notify' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_qos.c:351:15: error: no previous prototype for 'ps3_qos_exclusive_cmdword_get' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_qos.c:363:15: error: no previous prototype for 'ps3_qos_tg_decision' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_qos.c:3821:15: error: no previous prototype for 'ps3_raid_qos_waitq_abort' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_qos.c:4022:6: error: no previous prototype for 'ps3_raid_qos_waitq_clear_all' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_qos.c:4083:6: error: no previous prototype for 'ps3_raid_qos_waitq_poll' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_qos.c:749:15: error: no previous prototype for 'ps3_qos_all_pd_rc_get' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_qos.c:876:6: error: no previous prototype for 'ps3_pd_quota_waitq_clear_all' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_qos.c:892:6: error: no previous prototype for 'ps3_pd_quota_waitq_clean' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_r1x_write_lock.c:1173:5: error: no previous prototype for 'ps3_range_check_and_insert' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_r1x_write_lock.c:1231:5: error: no previous prototype for 'ps3_r1x_hash_range_lock' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_r1x_write_lock.c:1312:6: error: no previous prototype for 'ps3_r1x_hash_range_unlock' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_r1x_write_lock.c:578:5: error: no previous prototype for 'ps3_r1x_hash_bit_check' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_r1x_write_lock.c:678:6: error: no previous prototype for 'ps3_r1x_conflict_queue_hash_bit_lock' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_r1x_write_lock.c:730:5: error: no previous prototype for 'ps3_r1x_hash_bit_lock' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_r1x_write_lock.c:988:6: error: no previous prototype for 'ps3_r1x_hash_bit_unlock' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_rb_tree.c:154:6: error: no previous prototype for 'rbtDelNodeDo' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_recovery.c:204:6: error: no previous prototype for 'ps3_recovery_irq_queue_destroy' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_recovery.c:2700:6: error: no previous prototype for 'ps3_hard_recovery_state_finish' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_recovery.c:363:5: error: no previous prototype for 'ps3_recovery_state_transfer' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_recovery.c:72:30: error: no previous prototype for 'ps3_recovery_context_alloc' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_recovery.c:82:6: error: no previous prototype for 'ps3_recovery_context_free' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_recovery.c:88:6: error: no previous prototype for 'ps3_recovery_context_delete' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_sas_transport.c:407:5: error: no previous prototype for 'ps3_sas_update_phy_info' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_scsi_cmd_err.c:1110:5: error: no previous prototype for 'ps3_wait_for_outstanding_complete' [-Werror=missing-prototypes]
drivers/scsi/linkdata/ps3stor/ps3_scsi_cmd_err.c:876:6: error: no previous prototype for 'ps3_set_task_manager_busy' [-Werror=missing-prototypes]
error: unknown target ABI 'ilp32'
kismet: WARNING: unmet direct dependencies detected for ACPI_HOTPLUG_IGNORE_OSC when selected by X86
kismet: WARNING: unmet direct dependencies detected for CRYPTO_DRBG_CTR when selected by CRYPTO_DEV_HISI_TRNG
kismet: WARNING: unmet direct dependencies detected for HALTPOLL_CPUIDLE when selected by ARM64
mm/mempolicy.c:3129:26: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
Unverified Error/Warning (likely false positive, kindly check if interested):
drivers/hid/hid-thrustmaster.c:178 thrustmaster_interrupts() warn: possible memory leak of 'send_buf'
mm/kasan/kasan_test.c:1186 rcu_uaf_reclaim() error: dereferencing freed memory 'fp' (line 1185)
mm/oom_kill.c: linux/nmi.h is included more than once.
Error/Warning ids grouped by kconfigs:
recent_errors
|-- arm64-allmodconfig
| |-- arch-arm64-kvm-virtcca_cvm.c:warning:no-previous-prototype-for-function-virtcca_get_tmi_version
| |-- drivers-coda-coda_pci.c:warning:Excess-function-parameter-pdev-description-in-virtcca_pci_get_rom_size
| `-- drivers-coda-coda_pci.c:warning:Function-parameter-or-member-p-not-described-in-virtcca_pci_get_rom_size
|-- arm64-allnoconfig
| |-- kismet:WARNING:unmet-direct-dependencies-detected-for-CRYPTO_DRBG_CTR-when-selected-by-CRYPTO_DEV_HISI_TRNG
| `-- kismet:WARNING:unmet-direct-dependencies-detected-for-HALTPOLL_CPUIDLE-when-selected-by-ARM64
|-- arm64-randconfig-004-20250410
| |-- aarch64-linux-ld:Unexpected-GOT-PLT-entries-detected
| `-- aarch64-linux-ld:Unexpected-run-time-procedure-linkages-detected
|-- arm64-randconfig-r054-20250411
| |-- clang:warning:Wl-soname-linux-ilp32-vdso.so.:linker-input-unused
| `-- error:unknown-target-ABI-ilp32
|-- loongarch-allmodconfig
| |-- arch-loongarch-mm-cache.c:warning:variable-way_size-set-but-not-used
| |-- drivers-scsi-linkdata-ps3stor-.-linux-ps3_base.c:error:no-previous-prototype-for-ps3_pci_init
| |-- drivers-scsi-linkdata-ps3stor-.-linux-ps3_base.c:error:no-previous-prototype-for-ps3_pci_init_complete
| |-- drivers-scsi-linkdata-ps3stor-.-linux-ps3_base.c:error:no-previous-prototype-for-ps3_pci_init_complete_exit
| |-- drivers-scsi-linkdata-ps3stor-.-linux-ps3_cli.c:error:function-ps3stor_cli_printf-might-be-a-candidate-for-gnu_printf-format-attribute
| |-- drivers-scsi-linkdata-ps3stor-.-linux-ps3_cli_debug.c:error:no-previous-prototype-for-ps3_dump_context_show
| |-- drivers-scsi-linkdata-ps3stor-.-linux-ps3_dump.c:error:no-previous-prototype-for-ps3_dump_file_close
| |-- drivers-scsi-linkdata-ps3stor-.-linux-ps3_dump.c:error:no-previous-prototype-for-ps3_dump_file_open
| |-- drivers-scsi-linkdata-ps3stor-.-linux-ps3_dump.c:error:no-previous-prototype-for-ps3_dump_file_write
| |-- drivers-scsi-linkdata-ps3stor-.-linux-ps3_dump.c:error:no-previous-prototype-for-ps3_dump_filename_build
| |-- drivers-scsi-linkdata-ps3stor-.-linux-ps3_dump.c:error:no-previous-prototype-for-ps3_dump_local_time
| |-- drivers-scsi-linkdata-ps3stor-ps3_cmd_complete.c:error:no-previous-prototype-for-ps3_resp_status_convert
| |-- drivers-scsi-linkdata-ps3stor-ps3_cmd_complete.c:error:no-previous-prototype-for-ps3_trigger_irq_poll
| |-- drivers-scsi-linkdata-ps3stor-ps3_cmd_statistics.c:error:no-previous-prototype-for-ps3_cmd_stat_content_clear
| |-- drivers-scsi-linkdata-ps3stor-ps3_cmd_statistics.c:error:no-previous-prototype-for-ps3_io_recv_ok_stat_inc
| |-- drivers-scsi-linkdata-ps3stor-ps3_debug.c:error:no-previous-prototype-for-ps3_dump_dir_length
| |-- drivers-scsi-linkdata-ps3stor-ps3_device_manager.c:error:no-previous-prototype-for-ps3_scsi_private_init_pd
| |-- drivers-scsi-linkdata-ps3stor-ps3_device_manager.c:error:no-previous-prototype-for-ps3_scsi_private_init_vd
| |-- drivers-scsi-linkdata-ps3stor-ps3_device_manager_sas.c:error:no-previous-prototype-for-ps3_sas_expander_phys_refresh
| |-- drivers-scsi-linkdata-ps3stor-ps3_instance_manager.c:error:snprintf-output-may-be-truncated-before-the-last-format-character
| |-- drivers-scsi-linkdata-ps3stor-ps3_ioc_adp.c:error:no-previous-prototype-for-ps3_ioc_resource_prepare_hba
| |-- drivers-scsi-linkdata-ps3stor-ps3_ioc_adp.c:error:no-previous-prototype-for-ps3_ioc_resource_prepare_raid
| |-- drivers-scsi-linkdata-ps3stor-ps3_ioc_adp.c:error:no-previous-prototype-for-ps3_ioc_resource_prepare_switch
| |-- drivers-scsi-linkdata-ps3stor-ps3_ioc_manager.c:error:no-previous-prototype-for-ps3_hard_reset_to_ready
| |-- drivers-scsi-linkdata-ps3stor-ps3_ioctl.c:error:no-previous-prototype-for-ps3_clean_mgr_cmd
| |-- drivers-scsi-linkdata-ps3stor-ps3_irq.c:error:PS3_HDD_IOPS_MSIX_VECTORS-defined-but-not-used
| |-- drivers-scsi-linkdata-ps3stor-ps3_irq.c:error:PS3_INTERRUPT_CLEAR_IRQ-defined-but-not-used
| |-- drivers-scsi-linkdata-ps3stor-ps3_irq.c:error:PS3_INTERRUPT_CMD_DISABLE_ALL_MASK-defined-but-not-used
| |-- drivers-scsi-linkdata-ps3stor-ps3_irq.c:error:PS3_INTERRUPT_CMD_ENABLE_MSIX-defined-but-not-used
| |-- drivers-scsi-linkdata-ps3stor-ps3_irq.c:error:PS3_INTERRUPT_MASK_DISABLE-defined-but-not-used
| |-- drivers-scsi-linkdata-ps3stor-ps3_irq.c:error:PS3_INTERRUPT_STATUS_EXIST_IRQ-defined-but-not-used
| |-- drivers-scsi-linkdata-ps3stor-ps3_irq.c:error:PS3_SSD_IOPS_MSIX_VECTORS-defined-but-not-used
| |-- drivers-scsi-linkdata-ps3stor-ps3_module_para.c:error:no-previous-prototype-for-ps3_cli_ver_query
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_cmd_waitq_abort
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_hba_qos_decision
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_hba_qos_vd_init
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_hba_qos_vd_reset
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_hba_qos_waitq_clear_all
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_hba_qos_waitq_notify
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_hba_qos_waitq_poll
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_pd_quota_waitq_clean
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_pd_quota_waitq_clear_all
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_qos_all_pd_rc_get
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_qos_cmd_waitq_get
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_qos_exclusive_cmdword_get
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_qos_mgrq_resend
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_qos_pd_waitq_ratio_update
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_qos_tg_decision
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_qos_vd_cmdword_get
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_raid_qos_decision
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_raid_qos_waitq_abort
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_raid_qos_waitq_clear_all
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_raid_qos_waitq_notify
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_raid_qos_waitq_poll
| |-- drivers-scsi-linkdata-ps3stor-ps3_r1x_write_lock.c:error:no-previous-prototype-for-ps3_r1x_conflict_queue_hash_bit_lock
| |-- drivers-scsi-linkdata-ps3stor-ps3_r1x_write_lock.c:error:no-previous-prototype-for-ps3_r1x_hash_bit_check
| |-- drivers-scsi-linkdata-ps3stor-ps3_r1x_write_lock.c:error:no-previous-prototype-for-ps3_r1x_hash_bit_lock
| |-- drivers-scsi-linkdata-ps3stor-ps3_r1x_write_lock.c:error:no-previous-prototype-for-ps3_r1x_hash_bit_unlock
| |-- drivers-scsi-linkdata-ps3stor-ps3_r1x_write_lock.c:error:no-previous-prototype-for-ps3_r1x_hash_range_lock
| |-- drivers-scsi-linkdata-ps3stor-ps3_r1x_write_lock.c:error:no-previous-prototype-for-ps3_r1x_hash_range_unlock
| |-- drivers-scsi-linkdata-ps3stor-ps3_r1x_write_lock.c:error:no-previous-prototype-for-ps3_range_check_and_insert
| |-- drivers-scsi-linkdata-ps3stor-ps3_rb_tree.c:error:no-previous-prototype-for-rbtDelNodeDo
| |-- drivers-scsi-linkdata-ps3stor-ps3_recovery.c:error:no-previous-prototype-for-ps3_hard_recovery_state_finish
| |-- drivers-scsi-linkdata-ps3stor-ps3_recovery.c:error:no-previous-prototype-for-ps3_recovery_context_alloc
| |-- drivers-scsi-linkdata-ps3stor-ps3_recovery.c:error:no-previous-prototype-for-ps3_recovery_context_delete
| |-- drivers-scsi-linkdata-ps3stor-ps3_recovery.c:error:no-previous-prototype-for-ps3_recovery_context_free
| |-- drivers-scsi-linkdata-ps3stor-ps3_recovery.c:error:no-previous-prototype-for-ps3_recovery_irq_queue_destroy
| |-- drivers-scsi-linkdata-ps3stor-ps3_recovery.c:error:no-previous-prototype-for-ps3_recovery_state_transfer
| |-- drivers-scsi-linkdata-ps3stor-ps3_sas_transport.c:error:no-previous-prototype-for-ps3_sas_update_phy_info
| |-- drivers-scsi-linkdata-ps3stor-ps3_scsi_cmd_err.c:error:no-previous-prototype-for-ps3_set_task_manager_busy
| `-- drivers-scsi-linkdata-ps3stor-ps3_scsi_cmd_err.c:error:no-previous-prototype-for-ps3_wait_for_outstanding_complete
|-- loongarch-allnoconfig
| `-- arch-loongarch-mm-cache.c:warning:variable-way_size-set-but-not-used
|-- loongarch-allyesconfig
| |-- arch-loongarch-mm-cache.c:warning:variable-way_size-set-but-not-used
| |-- drivers-scsi-linkdata-ps3stor-.-linux-ps3_base.c:error:no-previous-prototype-for-ps3_pci_init
| |-- drivers-scsi-linkdata-ps3stor-.-linux-ps3_base.c:error:no-previous-prototype-for-ps3_pci_init_complete
| |-- drivers-scsi-linkdata-ps3stor-.-linux-ps3_base.c:error:no-previous-prototype-for-ps3_pci_init_complete_exit
| |-- drivers-scsi-linkdata-ps3stor-.-linux-ps3_cli.c:error:function-ps3stor_cli_printf-might-be-a-candidate-for-gnu_printf-format-attribute
| |-- drivers-scsi-linkdata-ps3stor-.-linux-ps3_cli_debug.c:error:no-previous-prototype-for-ps3_dump_context_show
| |-- drivers-scsi-linkdata-ps3stor-.-linux-ps3_dump.c:error:no-previous-prototype-for-ps3_dump_file_close
| |-- drivers-scsi-linkdata-ps3stor-.-linux-ps3_dump.c:error:no-previous-prototype-for-ps3_dump_file_open
| |-- drivers-scsi-linkdata-ps3stor-.-linux-ps3_dump.c:error:no-previous-prototype-for-ps3_dump_file_write
| |-- drivers-scsi-linkdata-ps3stor-.-linux-ps3_dump.c:error:no-previous-prototype-for-ps3_dump_filename_build
| |-- drivers-scsi-linkdata-ps3stor-.-linux-ps3_dump.c:error:no-previous-prototype-for-ps3_dump_local_time
| |-- drivers-scsi-linkdata-ps3stor-ps3_cmd_complete.c:error:no-previous-prototype-for-ps3_resp_status_convert
| |-- drivers-scsi-linkdata-ps3stor-ps3_cmd_complete.c:error:no-previous-prototype-for-ps3_trigger_irq_poll
| |-- drivers-scsi-linkdata-ps3stor-ps3_cmd_statistics.c:error:no-previous-prototype-for-ps3_cmd_stat_content_clear
| |-- drivers-scsi-linkdata-ps3stor-ps3_cmd_statistics.c:error:no-previous-prototype-for-ps3_io_recv_ok_stat_inc
| |-- drivers-scsi-linkdata-ps3stor-ps3_debug.c:error:no-previous-prototype-for-ps3_dump_dir_length
| |-- drivers-scsi-linkdata-ps3stor-ps3_device_manager.c:error:no-previous-prototype-for-ps3_scsi_private_init_pd
| |-- drivers-scsi-linkdata-ps3stor-ps3_device_manager.c:error:no-previous-prototype-for-ps3_scsi_private_init_vd
| |-- drivers-scsi-linkdata-ps3stor-ps3_device_manager_sas.c:error:no-previous-prototype-for-ps3_sas_expander_phys_refresh
| |-- drivers-scsi-linkdata-ps3stor-ps3_instance_manager.c:error:snprintf-output-may-be-truncated-before-the-last-format-character
| |-- drivers-scsi-linkdata-ps3stor-ps3_ioc_adp.c:error:no-previous-prototype-for-ps3_ioc_resource_prepare_hba
| |-- drivers-scsi-linkdata-ps3stor-ps3_ioc_adp.c:error:no-previous-prototype-for-ps3_ioc_resource_prepare_raid
| |-- drivers-scsi-linkdata-ps3stor-ps3_ioc_adp.c:error:no-previous-prototype-for-ps3_ioc_resource_prepare_switch
| |-- drivers-scsi-linkdata-ps3stor-ps3_ioc_manager.c:error:no-previous-prototype-for-ps3_hard_reset_to_ready
| |-- drivers-scsi-linkdata-ps3stor-ps3_ioctl.c:error:no-previous-prototype-for-ps3_clean_mgr_cmd
| |-- drivers-scsi-linkdata-ps3stor-ps3_irq.c:error:PS3_HDD_IOPS_MSIX_VECTORS-defined-but-not-used
| |-- drivers-scsi-linkdata-ps3stor-ps3_irq.c:error:PS3_INTERRUPT_CLEAR_IRQ-defined-but-not-used
| |-- drivers-scsi-linkdata-ps3stor-ps3_irq.c:error:PS3_INTERRUPT_CMD_DISABLE_ALL_MASK-defined-but-not-used
| |-- drivers-scsi-linkdata-ps3stor-ps3_irq.c:error:PS3_INTERRUPT_CMD_ENABLE_MSIX-defined-but-not-used
| |-- drivers-scsi-linkdata-ps3stor-ps3_irq.c:error:PS3_INTERRUPT_MASK_DISABLE-defined-but-not-used
| |-- drivers-scsi-linkdata-ps3stor-ps3_irq.c:error:PS3_INTERRUPT_STATUS_EXIST_IRQ-defined-but-not-used
| |-- drivers-scsi-linkdata-ps3stor-ps3_irq.c:error:PS3_SSD_IOPS_MSIX_VECTORS-defined-but-not-used
| |-- drivers-scsi-linkdata-ps3stor-ps3_module_para.c:error:no-previous-prototype-for-ps3_cli_ver_query
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_cmd_waitq_abort
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_hba_qos_decision
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_hba_qos_vd_init
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_hba_qos_vd_reset
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_hba_qos_waitq_clear_all
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_hba_qos_waitq_notify
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_hba_qos_waitq_poll
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_pd_quota_waitq_clean
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_pd_quota_waitq_clear_all
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_qos_all_pd_rc_get
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_qos_cmd_waitq_get
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_qos_exclusive_cmdword_get
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_qos_mgrq_resend
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_qos_pd_waitq_ratio_update
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_qos_tg_decision
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_qos_vd_cmdword_get
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_raid_qos_decision
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_raid_qos_waitq_abort
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_raid_qos_waitq_clear_all
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_raid_qos_waitq_notify
| |-- drivers-scsi-linkdata-ps3stor-ps3_qos.c:error:no-previous-prototype-for-ps3_raid_qos_waitq_poll
| |-- drivers-scsi-linkdata-ps3stor-ps3_r1x_write_lock.c:error:no-previous-prototype-for-ps3_r1x_conflict_queue_hash_bit_lock
| |-- drivers-scsi-linkdata-ps3stor-ps3_r1x_write_lock.c:error:no-previous-prototype-for-ps3_r1x_hash_bit_check
| |-- drivers-scsi-linkdata-ps3stor-ps3_r1x_write_lock.c:error:no-previous-prototype-for-ps3_r1x_hash_bit_lock
| |-- drivers-scsi-linkdata-ps3stor-ps3_r1x_write_lock.c:error:no-previous-prototype-for-ps3_r1x_hash_bit_unlock
| |-- drivers-scsi-linkdata-ps3stor-ps3_r1x_write_lock.c:error:no-previous-prototype-for-ps3_r1x_hash_range_lock
| |-- drivers-scsi-linkdata-ps3stor-ps3_r1x_write_lock.c:error:no-previous-prototype-for-ps3_r1x_hash_range_unlock
| |-- drivers-scsi-linkdata-ps3stor-ps3_r1x_write_lock.c:error:no-previous-prototype-for-ps3_range_check_and_insert
| |-- drivers-scsi-linkdata-ps3stor-ps3_rb_tree.c:error:no-previous-prototype-for-rbtDelNodeDo
| |-- drivers-scsi-linkdata-ps3stor-ps3_recovery.c:error:no-previous-prototype-for-ps3_hard_recovery_state_finish
| |-- drivers-scsi-linkdata-ps3stor-ps3_recovery.c:error:no-previous-prototype-for-ps3_recovery_context_alloc
| |-- drivers-scsi-linkdata-ps3stor-ps3_recovery.c:error:no-previous-prototype-for-ps3_recovery_context_delete
| |-- drivers-scsi-linkdata-ps3stor-ps3_recovery.c:error:no-previous-prototype-for-ps3_recovery_context_free
| |-- drivers-scsi-linkdata-ps3stor-ps3_recovery.c:error:no-previous-prototype-for-ps3_recovery_irq_queue_destroy
| |-- drivers-scsi-linkdata-ps3stor-ps3_recovery.c:error:no-previous-prototype-for-ps3_recovery_state_transfer
| |-- drivers-scsi-linkdata-ps3stor-ps3_sas_transport.c:error:no-previous-prototype-for-ps3_sas_update_phy_info
| |-- drivers-scsi-linkdata-ps3stor-ps3_scsi_cmd_err.c:error:no-previous-prototype-for-ps3_set_task_manager_busy
| `-- drivers-scsi-linkdata-ps3stor-ps3_scsi_cmd_err.c:error:no-previous-prototype-for-ps3_wait_for_outstanding_complete
|-- loongarch-defconfig
| `-- arch-loongarch-mm-cache.c:warning:variable-way_size-set-but-not-used
|-- loongarch-randconfig-001-20250410
| `-- arch-loongarch-mm-cache.c:warning:variable-way_size-set-but-not-used
|-- loongarch-randconfig-002-20250410
| `-- arch-loongarch-mm-cache.c:warning:variable-way_size-set-but-not-used
|-- loongarch-randconfig-r121-20250411
| |-- arch-loongarch-mm-cache.c:warning:variable-way_size-set-but-not-used
| |-- kernel-sched-fair.c:sparse:sparse:symbol-sysctl_sched_prio_load_balance_enabled-was-not-declared.-Should-it-be-static
| |-- mm-memblock.c:sparse:sparse:symbol-memblock_alloc_range_nid_flags-was-not-declared.-Should-it-be-static
| `-- mm-show_mem.c:sparse:sparse:incorrect-type-in-argument-(different-address-spaces)-expected-void-ptr-got-int-noderef-__percpu
|-- loongarch-randconfig-r132-20250411
| |-- arch-loongarch-mm-cache.c:warning:variable-way_size-set-but-not-used
| |-- drivers-iommu-loongarch_iommu.c:sparse:sparse:incorrect-type-in-argument-(different-address-spaces)-expected-void-volatile-noderef-__iomem-addr-got-void-confbase
| |-- include-linux-if_caqm.h:sparse:sparse:incorrect-type-in-assignment-(different-base-types)-expected-unsigned-short-usertype-caqm_hdr_info-got-restricted-__be16-usertype-h_caqm_info
| |-- include-linux-if_caqm.h:sparse:sparse:incorrect-type-in-assignment-(different-base-types)-expected-unsigned-short-usertype-got-restricted-__be16-usertype
| |-- mm-memblock.c:sparse:sparse:symbol-memblock_alloc_range_nid_flags-was-not-declared.-Should-it-be-static
| `-- mm-show_mem.c:sparse:sparse:incorrect-type-in-argument-(different-address-spaces)-expected-void-ptr-got-int-noderef-__percpu
|-- x86_64-allnoconfig
| |-- kismet:WARNING:unmet-direct-dependencies-detected-for-ACPI_HOTPLUG_IGNORE_OSC-when-selected-by-X86
| `-- mm-oom_kill.c:linux-nmi.h-is-included-more-than-once.
|-- x86_64-defconfig
| `-- mm-mempolicy.c:warning:writing-byte-into-a-region-of-size
|-- x86_64-randconfig-161-20250411
| |-- drivers-hid-hid-thrustmaster.c-thrustmaster_interrupts()-warn:possible-memory-leak-of-send_buf
| `-- mm-kasan-kasan_test.c-rcu_uaf_reclaim()-error:dereferencing-freed-memory-fp-(line-)
`-- x86_64-randconfig-r113-20250410
|-- drivers-crypto-montage-tsse-tsse_dev_drv.c:sparse:sparse:symbol-dev_attr_tsse_image_load-was-not-declared.-Should-it-be-static
|-- drivers-crypto-montage-tsse-tsse_ipc.c:sparse:sparse:incorrect-type-in-argument-(different-address-spaces)-expected-void-const-volatile-noderef-__iomem-got-unsigned-char-usertype-assigned-device_msg_d
|-- drivers-crypto-montage-tsse-tsse_ipc_drv.c:sparse:sparse:cast-from-restricted-__le32
|-- drivers-crypto-montage-tsse-tsse_ipc_drv.c:sparse:sparse:cast-removes-address-space-__iomem-of-expression
|-- drivers-crypto-montage-tsse-tsse_ipc_drv.c:sparse:sparse:incorrect-type-in-argument-(different-address-spaces)-expected-void-const-volatile-noderef-__iomem-got-unsigned-char-usertype
|-- drivers-crypto-montage-tsse-tsse_ipc_drv.c:sparse:sparse:incorrect-type-in-argument-(different-address-spaces)-expected-void-msg-got-void-noderef-__iomem-d2h_msg
|-- drivers-crypto-montage-tsse-tsse_ipc_drv.c:sparse:sparse:incorrect-type-in-argument-(different-address-spaces)-expected-void-volatile-noderef-__iomem-got-unsigned-char-usertype-addr
|-- drivers-crypto-montage-tsse-tsse_ipc_hash.c:sparse:sparse:symbol-service_handle_table-was-not-declared.-Should-it-be-static
`-- drivers-crypto-montage-tsse-tsse_ipc_hash.c:sparse:sparse:symbol-service_info_table-was-not-declared.-Should-it-be-static
elapsed time: 1461m
configs tested: 21
configs skipped: 123
tested configs:
arm64 allmodconfig clang-19
arm64 allnoconfig gcc-14.2.0
arm64 defconfig gcc-14.2.0
arm64 randconfig-001-20250410 clang-21
arm64 randconfig-002-20250410 clang-21
arm64 randconfig-003-20250410 gcc-6.5.0
arm64 randconfig-004-20250410 gcc-8.5.0
loongarch allmodconfig gcc-14.2.0
loongarch allnoconfig gcc-14.2.0
loongarch defconfig gcc-14.2.0
loongarch randconfig-001-20250410 gcc-12.4.0
loongarch randconfig-002-20250410 gcc-12.4.0
x86_64 allnoconfig clang-20
x86_64 allyesconfig clang-20
x86_64 buildonly-randconfig-001-20250410 clang-20
x86_64 buildonly-randconfig-002-20250410 gcc-12
x86_64 buildonly-randconfig-003-20250410 clang-20
x86_64 buildonly-randconfig-004-20250410 clang-20
x86_64 buildonly-randconfig-005-20250410 clang-20
x86_64 buildonly-randconfig-006-20250410 clang-20
x86_64 defconfig gcc-11
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
1
0
From: Hongye Lin <linhongye(a)h-partners.com>
driver inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/IBZQQR
----------------------------------------------------------------------
The core CPU control framework supports runtime SMT control which
is not yet supported on arm64. Besides the general vulnerabilities
concerns we want this runtime control on our arm64 server for:
- better single CPU performance in some cases
- saving overall power consumption
This patchset implements it in the following aspects:
- Provides a default topology_is_primary_thread()
- support retrieve SMT thread number on OF based system
- support retrieve SMT thread number on ACPI based system
- select HOTPLUG_SMT for arm64
Tests has been done on our ACPI based arm64 server and on ACPI/OF
based QEMU VMs.
Yicong Yang (5):
Revert "arm64: Kconfig: Enable HOTPLUG_SMT"
cpu/SMT: Provide a default topology_is_primary_thread()
arch_topology: Support SMT control for OF based system
arm64: topology: Support SMT control on ACPI based system
arm64: Kconfig: Enable HOTPLUG_SMT
arch/arm64/Kconfig | 2 +-
arch/arm64/configs/openeuler_defconfig | 1 -
arch/arm64/kernel/topology.c | 67 +++++++++++++++++++-------
arch/powerpc/include/asm/topology.h | 1 +
arch/x86/include/asm/topology.h | 3 +-
drivers/base/arch_topology.c | 61 +++++++----------------
include/linux/arch_topology.h | 14 ------
include/linux/topology.h | 24 +++++++++
8 files changed, 94 insertions(+), 79 deletions(-)
--
2.33.0
2
6
mainline inclusion
from mainline-v6.12-rc3
commit 654b33ada4ab5e926cd9c570196fefa7bec7c1df
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IBYOFS
CVE: CVE-2025-21999
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?…
--------------------------------
Fix race between rmmod and /proc/XXX's inode instantiation.
The bug is that pde->proc_ops don't belong to /proc, it belongs to a
module, therefore dereferencing it after /proc entry has been registered
is a bug unless use_pde/unuse_pde() pair has been used.
use_pde/unuse_pde can be avoided (2 atomic ops!) because pde->proc_ops
never changes so information necessary for inode instantiation can be
saved _before_ proc_register() in PDE itself and used later, avoiding
pde->proc_ops->... dereference.
rmmod lookup
sys_delete_module
proc_lookup_de
pde_get(de);
proc_get_inode(dir->i_sb, de);
mod->exit()
proc_remove
remove_proc_subtree
proc_entry_rundown(de);
free_module(mod);
if (S_ISREG(inode->i_mode))
if (de->proc_ops->proc_read_iter)
--> As module is already freed, will trigger UAF
BUG: unable to handle page fault for address: fffffbfff80a702b
PGD 817fc4067 P4D 817fc4067 PUD 817fc0067 PMD 102ef4067 PTE 0
Oops: Oops: 0000 [#1] PREEMPT SMP KASAN PTI
CPU: 26 UID: 0 PID: 2667 Comm: ls Tainted: G
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996)
RIP: 0010:proc_get_inode+0x302/0x6e0
RSP: 0018:ffff88811c837998 EFLAGS: 00010a06
RAX: dffffc0000000000 RBX: ffffffffc0538140 RCX: 0000000000000007
RDX: 1ffffffff80a702b RSI: 0000000000000001 RDI: ffffffffc0538158
RBP: ffff8881299a6000 R08: 0000000067bbe1e5 R09: 1ffff11023906f20
R10: ffffffffb560ca07 R11: ffffffffb2b43a58 R12: ffff888105bb78f0
R13: ffff888100518048 R14: ffff8881299a6004 R15: 0000000000000001
FS: 00007f95b9686840(0000) GS:ffff8883af100000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: fffffbfff80a702b CR3: 0000000117dd2000 CR4: 00000000000006f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
proc_lookup_de+0x11f/0x2e0
__lookup_slow+0x188/0x350
walk_component+0x2ab/0x4f0
path_lookupat+0x120/0x660
filename_lookup+0x1ce/0x560
vfs_statx+0xac/0x150
__do_sys_newstat+0x96/0x110
do_syscall_64+0x5f/0x170
entry_SYSCALL_64_after_hwframe+0x76/0x7e
[adobriyan(a)gmail.com: don't do 2 atomic ops on the common path]
Link: https://lkml.kernel.org/r/3d25ded0-1739-447e-812b-e34da7990dcf@p183
Fixes: 778f3dd5a13c ("Fix procfs compat_ioctl regression")
Signed-off-by: Ye Bin <yebin10(a)huawei.com>
Signed-off-by: Alexey Dobriyan <adobriyan(a)gmail.com>
Cc: Al Viro <viro(a)zeniv.linux.org.uk>
Cc: David S. Miller <davem(a)davemloft.net>
Cc: <stable(a)vger.kernel.org>
Signed-off-by: Andrew Morton <akpm(a)linux-foundation.org>
Conflicts:
fs/proc/inode.c
fs/proc/generic.c
fs/proc/internal.h
include/linux/proc_fs.h
[The pre-patch d919b33dafb3 ("proc: faster open/read/close with "permanent"
files") is not imported.]
Signed-off-by: Yongjian Sun <sunyongjian1(a)huawei.com>
---
fs/proc/inode.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/fs/proc/inode.c b/fs/proc/inode.c
index 31bf3bb8ddae..7d225a2b8b2a 100644
--- a/fs/proc/inode.c
+++ b/fs/proc/inode.c
@@ -462,6 +462,14 @@ struct inode *proc_get_inode(struct super_block *sb, struct proc_dir_entry *de)
make_empty_dir_inode(inode);
return inode;
}
+
+ if (!use_pde(de)) {
+ PROC_I(inode)->pde = NULL;
+ pde_put(de);
+ iput(inode);
+ return NULL;
+ }
+
if (de->mode) {
inode->i_mode = de->mode;
inode->i_uid = de->uid;
@@ -486,6 +494,7 @@ struct inode *proc_get_inode(struct super_block *sb, struct proc_dir_entry *de)
inode->i_fop = de->proc_fops;
}
}
+ unuse_pde(de);
} else
pde_put(de);
return inode;
--
2.39.2
2
1
This series includes adding Motorcomm YT6801 Gigabit ethernet driver
and adding yt6801 ethernet driver entry in MAINTAINERS file.
YT6801 integrates a YT8531S phy.
Frank Sae (14):
yt6801: Add support for a pci table in this module
yt6801: Implement mdio register
yt6801: Implement pci_driver shutdown
yt6801: Implement the fxgmac_init function
yt6801: Implement the .ndo_open function
yt6801: Implement the fxgmac_start function
net:phy:motorcomm: Add PHY_INTERFACE_MODE_INTERNAL to support YT6801
yt6801: Implement the fxgmac_hw_init function
yt6801: Implement the poll functions
yt6801: Implement .ndo_start_xmit function
yt6801: Implement some net_device_ops function
yt6801: Implement pci_driver suspend and resume
yt6801: Add makefile and Kconfig
yt6801: Update the Makefile, Kconfig and maintainer for yt6801
MAINTAINERS | 8 +
arch/arm64/configs/openeuler_defconfig | 4 +-
arch/powerpc/configs/openeuler_defconfig | 4 +-
arch/riscv/configs/openeuler_defconfig | 4 +-
arch/x86/configs/openeuler_defconfig | 4 +-
drivers/net/ethernet/Kconfig | 1 +
drivers/net/ethernet/Makefile | 1 +
drivers/net/ethernet/motorcomm/Kconfig | 27 +
drivers/net/ethernet/motorcomm/Makefile | 6 +
.../net/ethernet/motorcomm/yt6801/Makefile | 8 +
.../ethernet/motorcomm/yt6801/yt6801_desc.c | 565 +++
.../ethernet/motorcomm/yt6801/yt6801_desc.h | 35 +
.../ethernet/motorcomm/yt6801/yt6801_main.c | 3020 +++++++++++++++++
.../ethernet/motorcomm/yt6801/yt6801_type.h | 957 ++++++
drivers/net/phy/motorcomm.c | 6 +
15 files changed, 4646 insertions(+), 4 deletions(-)
create mode 100644 drivers/net/ethernet/motorcomm/Kconfig
create mode 100644 drivers/net/ethernet/motorcomm/Makefile
create mode 100644 drivers/net/ethernet/motorcomm/yt6801/Makefile
create mode 100644 drivers/net/ethernet/motorcomm/yt6801/yt6801_desc.c
create mode 100644 drivers/net/ethernet/motorcomm/yt6801/yt6801_desc.h
create mode 100644 drivers/net/ethernet/motorcomm/yt6801/yt6801_main.c
create mode 100644 drivers/net/ethernet/motorcomm/yt6801/yt6801_type.h
--
2.34.1
2
15

[openeuler:OLK-6.6 2117/2117] kernel/sched/fair.c:151:14: sparse: sparse: symbol 'sysctl_sched_prio_load_balance_enabled' was not declared. Should it be static?
by kernel test robot 11 Apr '25
by kernel test robot 11 Apr '25
11 Apr '25
tree: https://gitee.com/openeuler/kernel.git OLK-6.6
head: 62b846e657553d00552c1c71b6ecc26017eb1a9a
commit: 89bf80a4d6d5ba852b9042480e0be23c2c4a628c [2117/2117] sched: Introduce priority load balance for qos scheduler
config: loongarch-randconfig-r121-20250411 (https://download.01.org/0day-ci/archive/20250411/202504110741.FCO7H6rm-lkp@…)
compiler: loongarch64-linux-gcc (GCC) 14.2.0
reproduce: (https://download.01.org/0day-ci/archive/20250411/202504110741.FCO7H6rm-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/202504110741.FCO7H6rm-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
kernel/sched/fair.c:143:14: sparse: sparse: symbol 'sysctl_overload_detect_period' was not declared. Should it be static?
kernel/sched/fair.c:144:14: sparse: sparse: symbol 'sysctl_offline_wait_interval' was not declared. Should it be static?
>> kernel/sched/fair.c:151:14: sparse: sparse: symbol 'sysctl_sched_prio_load_balance_enabled' was not declared. Should it be static?
kernel/sched/fair.c:7578:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got unsigned int [noderef] __percpu * @@
kernel/sched/fair.c:7578:9: sparse: expected void *ptr
kernel/sched/fair.c:7578:9: sparse: got unsigned int [noderef] __percpu *
kernel/sched/fair.c:7578:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got unsigned int [noderef] __percpu * @@
kernel/sched/fair.c:7578:9: sparse: expected void *ptr
kernel/sched/fair.c:7578:9: sparse: got unsigned int [noderef] __percpu *
kernel/sched/fair.c:7578:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got unsigned int [noderef] __percpu * @@
kernel/sched/fair.c:7578:9: sparse: expected void *ptr
kernel/sched/fair.c:7578:9: sparse: got unsigned int [noderef] __percpu *
kernel/sched/fair.c:7578:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got unsigned int [noderef] __percpu * @@
kernel/sched/fair.c:7578:9: sparse: expected void *ptr
kernel/sched/fair.c:7578:9: sparse: got unsigned int [noderef] __percpu *
kernel/sched/fair.c:7578:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
kernel/sched/fair.c:7578:9: sparse: expected void *ptr
kernel/sched/fair.c:7578:9: sparse: got int [noderef] __percpu *
kernel/sched/fair.c:7578:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
kernel/sched/fair.c:7578:9: sparse: expected void *ptr
kernel/sched/fair.c:7578:9: sparse: got int [noderef] __percpu *
kernel/sched/fair.c:7578:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
kernel/sched/fair.c:7578:9: sparse: expected void *ptr
kernel/sched/fair.c:7578:9: sparse: got int [noderef] __percpu *
kernel/sched/fair.c:7578:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
kernel/sched/fair.c:7578:9: sparse: expected void *ptr
kernel/sched/fair.c:7578:9: sparse: got int [noderef] __percpu *
kernel/sched/fair.c:1271:34: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct sched_entity const *se @@ got struct sched_entity [noderef] __rcu * @@
kernel/sched/fair.c:1271:34: sparse: expected struct sched_entity const *se
kernel/sched/fair.c:1271:34: sparse: got struct sched_entity [noderef] __rcu *
kernel/sched/fair.c:12846:9: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct sched_domain *[assigned] sd @@ got struct sched_domain [noderef] __rcu *parent @@
kernel/sched/fair.c:12846:9: sparse: expected struct sched_domain *[assigned] sd
kernel/sched/fair.c:12846:9: sparse: got struct sched_domain [noderef] __rcu *parent
kernel/sched/fair.c:5925:22: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/sched/fair.c:5925:22: sparse: struct task_struct [noderef] __rcu *
kernel/sched/fair.c:5925:22: sparse: struct task_struct *
kernel/sched/fair.c:6667:38: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected struct task_struct *curr @@ got struct task_struct [noderef] __rcu *curr @@
kernel/sched/fair.c:6667:38: sparse: expected struct task_struct *curr
kernel/sched/fair.c:6667:38: sparse: got struct task_struct [noderef] __rcu *curr
kernel/sched/fair.c:7396:32: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got struct cpumask *[noderef] __percpu * @@
kernel/sched/fair.c:7396:32: sparse: expected void *ptr
kernel/sched/fair.c:7396:32: sparse: got struct cpumask *[noderef] __percpu *
kernel/sched/fair.c:7396:32: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got struct cpumask *[noderef] __percpu * @@
kernel/sched/fair.c:7396:32: sparse: expected void *ptr
kernel/sched/fair.c:7396:32: sparse: got struct cpumask *[noderef] __percpu *
kernel/sched/fair.c:7396:32: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got struct cpumask *[noderef] __percpu * @@
kernel/sched/fair.c:7396:32: sparse: expected void *ptr
kernel/sched/fair.c:7396:32: sparse: got struct cpumask *[noderef] __percpu *
kernel/sched/fair.c:7396:32: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got struct cpumask *[noderef] __percpu * @@
kernel/sched/fair.c:7396:32: sparse: expected void *ptr
kernel/sched/fair.c:7396:32: sparse: got struct cpumask *[noderef] __percpu *
kernel/sched/fair.c:7499:16: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got struct cpumask *[noderef] __percpu * @@
kernel/sched/fair.c:7499:16: sparse: expected void *ptr
kernel/sched/fair.c:7499:16: sparse: got struct cpumask *[noderef] __percpu *
kernel/sched/fair.c:7499:16: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got struct cpumask *[noderef] __percpu * @@
kernel/sched/fair.c:7499:16: sparse: expected void *ptr
kernel/sched/fair.c:7499:16: sparse: got struct cpumask *[noderef] __percpu *
kernel/sched/fair.c:7499:16: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got struct cpumask *[noderef] __percpu * @@
kernel/sched/fair.c:7499:16: sparse: expected void *ptr
kernel/sched/fair.c:7499:16: sparse: got struct cpumask *[noderef] __percpu *
kernel/sched/fair.c:7499:16: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got struct cpumask *[noderef] __percpu * @@
kernel/sched/fair.c:7499:16: sparse: expected void *ptr
kernel/sched/fair.c:7499:16: sparse: got struct cpumask *[noderef] __percpu *
kernel/sched/fair.c:7974:32: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got struct cpumask *[noderef] __percpu * @@
kernel/sched/fair.c:7974:32: sparse: expected void *ptr
kernel/sched/fair.c:7974:32: sparse: got struct cpumask *[noderef] __percpu *
kernel/sched/fair.c:7974:32: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got struct cpumask *[noderef] __percpu * @@
kernel/sched/fair.c:7974:32: sparse: expected void *ptr
kernel/sched/fair.c:7974:32: sparse: got struct cpumask *[noderef] __percpu *
kernel/sched/fair.c:7974:32: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got struct cpumask *[noderef] __percpu * @@
kernel/sched/fair.c:7974:32: sparse: expected void *ptr
kernel/sched/fair.c:7974:32: sparse: got struct cpumask *[noderef] __percpu *
kernel/sched/fair.c:7974:32: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got struct cpumask *[noderef] __percpu * @@
kernel/sched/fair.c:7974:32: sparse: expected void *ptr
kernel/sched/fair.c:7974:32: sparse: got struct cpumask *[noderef] __percpu *
kernel/sched/fair.c:7998:20: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct sched_domain *[assigned] sd @@ got struct sched_domain [noderef] __rcu *parent @@
kernel/sched/fair.c:7998:20: sparse: expected struct sched_domain *[assigned] sd
kernel/sched/fair.c:7998:20: sparse: got struct sched_domain [noderef] __rcu *parent
kernel/sched/fair.c:8310:9: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct sched_domain *[assigned] tmp @@ got struct sched_domain [noderef] __rcu *parent @@
kernel/sched/fair.c:8310:9: sparse: expected struct sched_domain *[assigned] tmp
kernel/sched/fair.c:8310:9: sparse: got struct sched_domain [noderef] __rcu *parent
kernel/sched/fair.c:8421:38: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected struct task_struct *curr @@ got struct task_struct [noderef] __rcu *curr @@
kernel/sched/fair.c:8421:38: sparse: expected struct task_struct *curr
kernel/sched/fair.c:8421:38: sparse: got struct task_struct [noderef] __rcu *curr
kernel/sched/fair.c:8641:22: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/sched/fair.c:8641:22: sparse: struct task_struct [noderef] __rcu *
kernel/sched/fair.c:8641:22: sparse: struct task_struct *
kernel/sched/fair.c:8706:16: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
kernel/sched/fair.c:8706:16: sparse: expected void *ptr
kernel/sched/fair.c:8706:16: sparse: got int [noderef] __percpu *
kernel/sched/fair.c:8706:16: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
kernel/sched/fair.c:8706:16: sparse: expected void *ptr
kernel/sched/fair.c:8706:16: sparse: got int [noderef] __percpu *
kernel/sched/fair.c:8706:16: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
kernel/sched/fair.c:8706:16: sparse: expected void *ptr
kernel/sched/fair.c:8706:16: sparse: got int [noderef] __percpu *
kernel/sched/fair.c:8706:16: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
kernel/sched/fair.c:8706:16: sparse: expected void *ptr
kernel/sched/fair.c:8706:16: sparse: got int [noderef] __percpu *
kernel/sched/fair.c:8763:13: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
kernel/sched/fair.c:8763:13: sparse: expected void *ptr
kernel/sched/fair.c:8763:13: sparse: got int [noderef] __percpu *
kernel/sched/fair.c:8763:13: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
vim +/sysctl_sched_prio_load_balance_enabled +151 kernel/sched/fair.c
149
150 #ifdef CONFIG_QOS_SCHED_PRIO_LB
> 151 unsigned int sysctl_sched_prio_load_balance_enabled;
152 #endif
153
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
1
0

[openeuler:OLK-6.6 2117/2117] drivers/iommu/loongarch_iommu.c:1292:22: sparse: sparse: incorrect type in argument 1 (different address spaces)
by kernel test robot 11 Apr '25
by kernel test robot 11 Apr '25
11 Apr '25
tree: https://gitee.com/openeuler/kernel.git OLK-6.6
head: 62b846e657553d00552c1c71b6ecc26017eb1a9a
commit: 72fe4978ee346c10869113410da1b61710dd8d8f [2117/2117] LoongArch: add iommu support
config: loongarch-randconfig-r132-20250411 (https://download.01.org/0day-ci/archive/20250411/202504110226.FM6zQ8DE-lkp@…)
compiler: loongarch64-linux-gcc (GCC) 14.2.0
reproduce: (https://download.01.org/0day-ci/archive/20250411/202504110226.FM6zQ8DE-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/202504110226.FM6zQ8DE-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
drivers/iommu/loongarch_iommu.c:108:9: sparse: sparse: symbol 'la_iommu_last_bdf' was not declared. Should it be static?
drivers/iommu/loongarch_iommu.c:112:5: sparse: sparse: symbol 'loongarch_iommu_disable' was not declared. Should it be static?
drivers/iommu/loongarch_iommu.c:130:15: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got void * @@
drivers/iommu/loongarch_iommu.c:130:15: sparse: expected void const volatile [noderef] __iomem *addr
drivers/iommu/loongarch_iommu.c:130:15: sparse: got void *
drivers/iommu/loongarch_iommu.c:132:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got void * @@
drivers/iommu/loongarch_iommu.c:132:9: sparse: expected void volatile [noderef] __iomem *addr
drivers/iommu/loongarch_iommu.c:132:9: sparse: got void *
drivers/iommu/loongarch_iommu.c:135:15: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got void * @@
drivers/iommu/loongarch_iommu.c:135:15: sparse: expected void const volatile [noderef] __iomem *addr
drivers/iommu/loongarch_iommu.c:135:15: sparse: got void *
drivers/iommu/loongarch_iommu.c:137:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got void * @@
drivers/iommu/loongarch_iommu.c:137:9: sparse: expected void volatile [noderef] __iomem *addr
drivers/iommu/loongarch_iommu.c:137:9: sparse: got void *
drivers/iommu/loongarch_iommu.c:150:15: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got void * @@
drivers/iommu/loongarch_iommu.c:150:15: sparse: expected void const volatile [noderef] __iomem *addr
drivers/iommu/loongarch_iommu.c:150:15: sparse: got void *
drivers/iommu/loongarch_iommu.c:152:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got void * @@
drivers/iommu/loongarch_iommu.c:152:9: sparse: expected void volatile [noderef] __iomem *addr
drivers/iommu/loongarch_iommu.c:152:9: sparse: got void *
drivers/iommu/loongarch_iommu.c:155:15: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got void * @@
drivers/iommu/loongarch_iommu.c:155:15: sparse: expected void const volatile [noderef] __iomem *addr
drivers/iommu/loongarch_iommu.c:155:15: sparse: got void *
drivers/iommu/loongarch_iommu.c:157:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got void * @@
drivers/iommu/loongarch_iommu.c:157:9: sparse: expected void volatile [noderef] __iomem *addr
drivers/iommu/loongarch_iommu.c:157:9: sparse: got void *
drivers/iommu/loongarch_iommu.c:160:15: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got void * @@
drivers/iommu/loongarch_iommu.c:160:15: sparse: expected void const volatile [noderef] __iomem *addr
drivers/iommu/loongarch_iommu.c:160:15: sparse: got void *
drivers/iommu/loongarch_iommu.c:162:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got void * @@
drivers/iommu/loongarch_iommu.c:162:9: sparse: expected void volatile [noderef] __iomem *addr
drivers/iommu/loongarch_iommu.c:162:9: sparse: got void *
drivers/iommu/loongarch_iommu.c:190:15: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got void * @@
drivers/iommu/loongarch_iommu.c:190:15: sparse: expected void const volatile [noderef] __iomem *addr
drivers/iommu/loongarch_iommu.c:190:15: sparse: got void *
drivers/iommu/loongarch_iommu.c:193:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got void * @@
drivers/iommu/loongarch_iommu.c:193:9: sparse: expected void volatile [noderef] __iomem *addr
drivers/iommu/loongarch_iommu.c:193:9: sparse: got void *
drivers/iommu/loongarch_iommu.c:196:15: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got void * @@
drivers/iommu/loongarch_iommu.c:196:15: sparse: expected void const volatile [noderef] __iomem *addr
drivers/iommu/loongarch_iommu.c:196:15: sparse: got void *
drivers/iommu/loongarch_iommu.c:199:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got void * @@
drivers/iommu/loongarch_iommu.c:199:9: sparse: expected void volatile [noderef] __iomem *addr
drivers/iommu/loongarch_iommu.c:199:9: sparse: got void *
drivers/iommu/loongarch_iommu.c:206:15: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got void * @@
drivers/iommu/loongarch_iommu.c:206:15: sparse: expected void const volatile [noderef] __iomem *addr
drivers/iommu/loongarch_iommu.c:206:15: sparse: got void *
drivers/iommu/loongarch_iommu.c:306:17: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got void * @@
drivers/iommu/loongarch_iommu.c:306:17: sparse: expected void volatile [noderef] __iomem *addr
drivers/iommu/loongarch_iommu.c:306:17: sparse: got void *
drivers/iommu/loongarch_iommu.c:310:17: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got void * @@
drivers/iommu/loongarch_iommu.c:310:17: sparse: expected void volatile [noderef] __iomem *addr
drivers/iommu/loongarch_iommu.c:310:17: sparse: got void *
drivers/iommu/loongarch_iommu.c:312:23: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got void * @@
drivers/iommu/loongarch_iommu.c:312:23: sparse: expected void const volatile [noderef] __iomem *addr
drivers/iommu/loongarch_iommu.c:312:23: sparse: got void *
drivers/iommu/loongarch_iommu.c:314:17: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got void * @@
drivers/iommu/loongarch_iommu.c:314:17: sparse: expected void volatile [noderef] __iomem *addr
drivers/iommu/loongarch_iommu.c:314:17: sparse: got void *
drivers/iommu/loongarch_iommu.c:322:23: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got void * @@
drivers/iommu/loongarch_iommu.c:322:23: sparse: expected void const volatile [noderef] __iomem *addr
drivers/iommu/loongarch_iommu.c:322:23: sparse: got void *
drivers/iommu/loongarch_iommu.c:325:17: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got void * @@
drivers/iommu/loongarch_iommu.c:325:17: sparse: expected void volatile [noderef] __iomem *addr
drivers/iommu/loongarch_iommu.c:325:17: sparse: got void *
drivers/iommu/loongarch_iommu.c:327:23: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got void * @@
drivers/iommu/loongarch_iommu.c:327:23: sparse: expected void const volatile [noderef] __iomem *addr
drivers/iommu/loongarch_iommu.c:327:23: sparse: got void *
drivers/iommu/loongarch_iommu.c:329:17: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got void * @@
drivers/iommu/loongarch_iommu.c:329:17: sparse: expected void volatile [noderef] __iomem *addr
drivers/iommu/loongarch_iommu.c:329:17: sparse: got void *
drivers/iommu/loongarch_iommu.c:349:15: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got void * @@
drivers/iommu/loongarch_iommu.c:349:15: sparse: expected void const volatile [noderef] __iomem *addr
drivers/iommu/loongarch_iommu.c:349:15: sparse: got void *
drivers/iommu/loongarch_iommu.c:352:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got void * @@
drivers/iommu/loongarch_iommu.c:352:9: sparse: expected void volatile [noderef] __iomem *addr
drivers/iommu/loongarch_iommu.c:352:9: sparse: got void *
drivers/iommu/loongarch_iommu.c:610:6: sparse: sparse: symbol 'domain_deattach_iommu' was not declared. Should it be static?
drivers/iommu/loongarch_iommu.c:651:28: sparse: sparse: symbol 'lookup_rlooptable' was not declared. Should it be static?
drivers/iommu/loongarch_iommu.c:662:24: sparse: sparse: symbol 'find_iommu_by_dev' was not declared. Should it be static?
drivers/iommu/loongarch_iommu.c:721:21: sparse: sparse: symbol 'la_iommu_probe_device' was not declared. Should it be static?
drivers/iommu/loongarch_iommu.c:752:19: sparse: sparse: symbol 'get_iommu_info_from_dom' was not declared. Should it be static?
drivers/iommu/loongarch_iommu.c:794:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got void * @@
drivers/iommu/loongarch_iommu.c:794:9: sparse: expected void volatile [noderef] __iomem *addr
drivers/iommu/loongarch_iommu.c:794:9: sparse: got void *
drivers/iommu/loongarch_iommu.c:795:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got void * @@
drivers/iommu/loongarch_iommu.c:795:9: sparse: expected void volatile [noderef] __iomem *addr
drivers/iommu/loongarch_iommu.c:795:9: sparse: got void *
drivers/iommu/loongarch_iommu.c:796:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got void * @@
drivers/iommu/loongarch_iommu.c:796:9: sparse: expected void volatile [noderef] __iomem *addr
drivers/iommu/loongarch_iommu.c:796:9: sparse: got void *
drivers/iommu/loongarch_iommu.c:1178:24: sparse: sparse: symbol 'la_iommu_ops' was not declared. Should it be static?
drivers/iommu/loongarch_iommu.c:1197:24: sparse: sparse: symbol 'loongarch_get_iommu_by_devid' was not declared. Should it be static?
drivers/iommu/loongarch_iommu.c:1215:6: sparse: sparse: symbol 'check_device_compat' was not declared. Should it be static?
drivers/iommu/loongarch_iommu.c:1259:25: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void *confbase @@ got void [noderef] __iomem * @@
drivers/iommu/loongarch_iommu.c:1259:25: sparse: expected void *confbase
drivers/iommu/loongarch_iommu.c:1259:25: sparse: got void [noderef] __iomem *
>> drivers/iommu/loongarch_iommu.c:1292:22: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got void *confbase @@
drivers/iommu/loongarch_iommu.c:1292:22: sparse: expected void volatile [noderef] __iomem *addr
drivers/iommu/loongarch_iommu.c:1292:22: sparse: got void *confbase
drivers/iommu/loongarch_iommu.c:1319:30: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got void *confbase @@
drivers/iommu/loongarch_iommu.c:1319:30: sparse: expected void volatile [noderef] __iomem *addr
drivers/iommu/loongarch_iommu.c:1319:30: sparse: got void *confbase
drivers/iommu/loongarch_iommu.c:1344:28: sparse: sparse: symbol 'create_rlookup_entry' was not declared. Should it be static?
vim +1292 drivers/iommu/loongarch_iommu.c
1223
1224 static int loongarch_iommu_probe(struct pci_dev *pdev,
1225 const struct pci_device_id *ent)
1226 {
1227 int ret = 1;
1228 int bitmap_sz = 0;
1229 int tmp;
1230 bool compat = false;
1231 struct loongarch_iommu *iommu = NULL;
1232 resource_size_t base, size;
1233
1234 iommu = loongarch_get_iommu_by_devid(pdev);
1235 if (iommu == NULL) {
1236 pci_info(pdev, "%s can't find iommu\n", __func__);
1237 return -ENODEV;
1238 }
1239
1240 compat = check_device_compat(pdev);
1241 if (!compat) {
1242 pci_info(pdev,
1243 "%s The iommu driver is not compatible with this device\n",
1244 __func__);
1245 return -ENODEV;
1246 }
1247
1248 iommu->pdev = pdev;
1249 base = pci_resource_start(pdev, 0);
1250 size = pci_resource_len(pdev, 0);
1251 if (!request_mem_region(base, size, "loongarch_iommu")) {
1252 pci_err(pdev,
1253 "%d can't reserve mmio registers base %llx size %llx\n",
1254 __LINE__, base, size);
1255 return -ENOMEM;
1256 }
1257 iommu->confbase_phy = base;
1258 iommu->conf_size = size;
1259 iommu->confbase = ioremap(base, size);
1260 if (iommu->confbase == NULL) {
1261 pci_info(pdev, "%s iommu pci dev bar0 is NULL\n", __func__);
1262 return ret;
1263 }
1264
1265 pr_info("iommu confbase %llx pgtsize %llx\n",
1266 (u64)iommu->confbase, size);
1267 tmp = MAX_DOMAIN_ID / 8;
1268 bitmap_sz = (MAX_DOMAIN_ID % 8) ? (tmp + 1) : tmp;
1269 iommu->domain_bitmap = bitmap_zalloc(bitmap_sz, GFP_KERNEL);
1270 if (iommu->domain_bitmap == NULL) {
1271 pr_err("LA-IOMMU: domain bitmap alloc err bitmap_sz:%d\n",
1272 bitmap_sz);
1273 goto out_err;
1274 }
1275
1276 tmp = MAX_ATTACHED_DEV_ID / 8;
1277 bitmap_sz = (MAX_ATTACHED_DEV_ID % 8) ? (tmp + 1) : tmp;
1278 iommu->devtable_bitmap = bitmap_zalloc(bitmap_sz, GFP_KERNEL);
1279 if (iommu->devtable_bitmap == NULL) {
1280 pr_err("LA-IOMMU: devtable bitmap alloc err bitmap_sz:%d\n",
1281 bitmap_sz);
1282 goto out_err_1;
1283 }
1284
1285 ret = iommu_device_sysfs_add(&iommu->iommu_dev, &pdev->dev,
1286 NULL, "ivhd-%#x", iommu->devid);
1287 iommu_device_register(&iommu->iommu_dev, &la_iommu_ops, NULL);
1288 return 0;
1289
1290 out_err_1:
1291 iommu->pdev = NULL;
> 1292 iounmap(iommu->confbase);
1293 iommu->confbase = NULL;
1294 release_mem_region(iommu->confbase_phy, iommu->conf_size);
1295 iommu->confbase_phy = 0;
1296 iommu->conf_size = 0;
1297 kfree(iommu->domain_bitmap);
1298 iommu->domain_bitmap = NULL;
1299 out_err:
1300 return ret;
1301 }
1302
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
1
0