From a70d46bb2ab84d451334170b92516216a09d9d3b Mon Sep 17 00:00:00 2001 From: Min Fanlei Date: Tue, 9 Sep 2025 16:40:49 +0800 Subject: [PATCH 01/14] sw64: kvm: add the C4 kvm_regs structure to uapi kvm.h This patch adds the definition of struct kvm_regs to uapi kvm.h to expose it to userspace. Signed-off-by: Min Fanlei Reviewed-by: He Sheng Signed-off-by: Gu Zitao --- arch/sw_64/include/uapi/asm/kvm.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/arch/sw_64/include/uapi/asm/kvm.h b/arch/sw_64/include/uapi/asm/kvm.h index 8cc5f752bc6b..98f7611c36d3 100644 --- a/arch/sw_64/include/uapi/asm/kvm.h +++ b/arch/sw_64/include/uapi/asm/kvm.h @@ -2,6 +2,8 @@ #ifndef _UAPI_ASM_SW64_KVM_H #define _UAPI_ASM_SW64_KVM_H +#include + /* * KVM SW specific structures and definitions. */ @@ -24,6 +26,20 @@ enum SW64_KVM_IRQ { #define KVM_NR_IRQCHIPS 1 +#ifndef __KERNEL__ +struct kvm_regs { + union { + struct user_pt_regs regs; + struct { + unsigned long r[31]; + unsigned long pc; + unsigned long ps; + }; + }; + struct user_fpsimd_state fpstate; +}; +#endif + /* * for KVM_GET_FPU and KVM_SET_FPU */ -- Gitee From dc7d783de3f8dcdb50d9a5d80d89f91c29421f2e Mon Sep 17 00:00:00 2001 From: Gu Yuchen Date: Mon, 8 Sep 2025 12:33:59 +0800 Subject: [PATCH 02/14] sw64: fix unresolved reference error when close pci The pcie_save and pcie_restore functions depend on CONFIG_PCI option, the subfunctions they call are only compiled when CONFIG_PCI option is enabled. This commit fixes the issue. Signed-off-by: Gu Yuchen Reviewed-by: He Sheng Signed-off-by: Gu Zitao --- arch/sw_64/kernel/chip_setup.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/sw_64/kernel/chip_setup.c b/arch/sw_64/kernel/chip_setup.c index df98e141b14f..d4e5b1736bc1 100644 --- a/arch/sw_64/kernel/chip_setup.c +++ b/arch/sw_64/kernel/chip_setup.c @@ -90,6 +90,7 @@ static void i2c_srst(void) writeq(0x1, spbu_base + OFFSET_I2C2_SRST_L); } +#ifdef CONFIG_PCI static void pcie_save(void) { struct pci_controller *hose; @@ -130,6 +131,17 @@ static void pcie_restore(void) } } +#else +static void pcie_save(void) +{ + +} + +static void pcie_restore(void) +{ + +} +#endif static unsigned long saved_dvc_int, saved_long_time; -- Gitee From b9a03e3097280e578503202fea2507c2ca2f2a67 Mon Sep 17 00:00:00 2001 From: Gao Chen Date: Wed, 24 Sep 2025 15:24:30 +0800 Subject: [PATCH 03/14] sw64: revert ioremap() to __va() in ioport_map() Revert ioremap() to __va() in ioport_map() since devices like UHCI call it during interrupts where ioremap() is forbidden. Signed-off-by: Gao Chen Reviewed-by: He Sheng Signed-off-by: Gu Zitao --- arch/sw_64/lib/iomap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/sw_64/lib/iomap.c b/arch/sw_64/lib/iomap.c index 51e7600b0fec..c73004a87dcd 100644 --- a/arch/sw_64/lib/iomap.c +++ b/arch/sw_64/lib/iomap.c @@ -262,8 +262,8 @@ EXPORT_SYMBOL(_memset_c_io); void __iomem *ioport_map(unsigned long port, unsigned int size) { if (port >= 0x100000) - return ioremap(port, size); + return __va(port); - return ioremap((port << legacy_io_shift) | legacy_io_base, size); + return __va((port << legacy_io_shift) | legacy_io_base); } EXPORT_SYMBOL(ioport_map); -- Gitee From 789c58b65e71b9d8089ce328fdbfe0cd73f45eb1 Mon Sep 17 00:00:00 2001 From: Mao Minkai Date: Mon, 14 Apr 2025 17:06:03 +0800 Subject: [PATCH 04/14] sw64: use orig_r0 as syscall nr Use orig_r0 as syscall number to make sure we can get the correct number after syscall_set_return_value() which modifies the value of regs[0]. For backward compatibility, any modifications made to $0 and $19 at syscall entry are also reflected on orig_r0 and orig_r19. If users want to skip syscall and set return value directly at syscall entry, they can use PTRACE_POKEUSR to set $0 and orig_r0 first, then use PTRACE_SETREGSET to set orig_r0 only (note type NT_SW64_SYSTEM_CALL). Signed-off-by: Mao Minkai Reviewed-by: He Sheng Signed-off-by: Gu Zitao --- arch/sw_64/include/asm/syscall.h | 2 +- arch/sw_64/kernel/ptrace.c | 22 ++++++++++++++++++---- arch/sw_64/kernel/sys_sw64.c | 4 +--- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/arch/sw_64/include/asm/syscall.h b/arch/sw_64/include/asm/syscall.h index a821bf68be16..33b4101a81e4 100644 --- a/arch/sw_64/include/asm/syscall.h +++ b/arch/sw_64/include/asm/syscall.h @@ -13,7 +13,7 @@ extern syscall_fn_t sys_call_table[]; static inline int syscall_get_nr(struct task_struct *task, struct pt_regs *regs) { - return regs->regs[0]; + return regs->orig_r0; } static inline long diff --git a/arch/sw_64/kernel/ptrace.c b/arch/sw_64/kernel/ptrace.c index a28a9daf893c..5a27cb51d38c 100644 --- a/arch/sw_64/kernel/ptrace.c +++ b/arch/sw_64/kernel/ptrace.c @@ -145,6 +145,20 @@ put_reg(struct task_struct *task, unsigned long regno, unsigned long data) return PTR_ERR(addr); else { *addr = data; + + /* + * Any modifications made to $0 and $19 at syscall entry + * should also be reflected on orig_r0 and orig_r19. + * + * See syscall_set() for how to modify orig_r0 only. + */ + if (task->ptrace_message == PTRACE_EVENTMSG_SYSCALL_ENTRY) { + if (regno == PT_REG_BASE) + task_pt_regs(task)->orig_r0 = data; + if (regno == (PT_REG_BASE + 19)) + task_pt_regs(task)->orig_r19 = data; + } + return 0; } } @@ -422,7 +436,6 @@ long arch_ptrace(struct task_struct *child, long request, asmlinkage unsigned long syscall_trace_enter(void) { - unsigned long ret = 0; struct pt_regs *regs = current_pt_regs(); if (test_thread_flag(TIF_SYSCALL_TRACE) && @@ -436,9 +449,10 @@ asmlinkage unsigned long syscall_trace_enter(void) #endif if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT))) - trace_sys_enter(regs, regs->regs[0]); - audit_syscall_entry(regs->regs[0], regs->regs[16], regs->regs[17], regs->regs[18], regs->regs[19]); - return ret ?: regs->regs[0]; + trace_sys_enter(regs, regs->orig_r0); + audit_syscall_entry(regs->orig_r0, regs->regs[16], + regs->regs[17], regs->regs[18], regs->regs[19]); + return regs->orig_r0; } asmlinkage void diff --git a/arch/sw_64/kernel/sys_sw64.c b/arch/sw_64/kernel/sys_sw64.c index 1397d86ac7a2..09289be850fc 100644 --- a/arch/sw_64/kernel/sys_sw64.c +++ b/arch/sw_64/kernel/sys_sw64.c @@ -346,7 +346,7 @@ asmlinkage void noinstr do_entSys(struct pt_regs *regs) regs->orig_r0 = regs->regs[0]; regs->orig_r19 = regs->regs[19]; - nr = regs->regs[0]; + nr = regs->orig_r0; if (ti_flags & _TIF_SYSCALL_WORK) { nr = syscall_trace_enter(); @@ -369,8 +369,6 @@ asmlinkage void noinstr do_entSys(struct pt_regs *regs) syscall_set_return_value(current, regs, -ENOSYS, 0); if (nr == NO_SYSCALL) goto syscall_out; - regs->orig_r0 = regs->regs[0]; - regs->orig_r19 = regs->regs[19]; } if (nr < __NR_syscalls) { -- Gitee From 84dfee30fc3d76a097fd008e7ee1d70b6574b60d Mon Sep 17 00:00:00 2001 From: Xu Yiwei Date: Mon, 29 Sep 2025 07:08:24 +0000 Subject: [PATCH 05/14] sw64: msi: fix affinity change of managed irq If a managed irq's affinity does not intersect with cpu_online_mask, it should be disabled instead of migrating into one of the online cpus. This patch add a check to stop affinity mask of a managed_irq from changing into cpu_online_mask. Signed-off-by: Xu Yiwei Reviewed-by: He Sheng Signed-off-by: Gu Zitao --- drivers/irqchip/irq-sunway-msi-v2.c | 3 +++ drivers/irqchip/irq-sunway-msi.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/drivers/irqchip/irq-sunway-msi-v2.c b/drivers/irqchip/irq-sunway-msi-v2.c index 8ac98399b5d9..b41da97eac9a 100644 --- a/drivers/irqchip/irq-sunway-msi-v2.c +++ b/drivers/irqchip/irq-sunway-msi-v2.c @@ -233,6 +233,9 @@ static int __assign_irq_vector(int virq, unsigned int nr_irqs, if (irqd_affinity_is_managed(irq_data)) { mask = irq_data_get_affinity_mask(irq_data); cpumask_and(&searchmask, mask, cpu_online_mask); + + if (cpumask_empty(&searchmask)) + return -EINVAL; } else { node = irq_data_get_node(irq_data); cpumask_copy(&searchmask, cpumask_of_node(node)); diff --git a/drivers/irqchip/irq-sunway-msi.c b/drivers/irqchip/irq-sunway-msi.c index 024d20c25dd7..8f248895825f 100644 --- a/drivers/irqchip/irq-sunway-msi.c +++ b/drivers/irqchip/irq-sunway-msi.c @@ -214,6 +214,9 @@ static int __assign_irq_vector(int virq, unsigned int nr_irqs, if (irqd_affinity_is_managed(irq_data)) { mask = irq_data_get_affinity_mask(irq_data); cpumask_and(&searchmask, mask, cpu_online_mask); + + if (cpumask_empty(&searchmask)) + return -EINVAL; } else { node = irq_data_get_node(irq_data); cpumask_copy(&searchmask, cpumask_of_node(node)); -- Gitee From f2e09d8b6b946f351ef7cacc1a3db1f072b6e27a Mon Sep 17 00:00:00 2001 From: Xu Yiwei Date: Mon, 22 Sep 2025 06:54:19 +0000 Subject: [PATCH 06/14] sw64: irqchip: update effective affinity for INTx As CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK is selected, it is necessary to update effective affinity when setting affinity for INTx. Signed-off-by: Xu Yiwei Reviewed-by: He Sheng Signed-off-by: Gu Zitao --- drivers/irqchip/irq-sunway-pci-intx.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/irqchip/irq-sunway-pci-intx.c b/drivers/irqchip/irq-sunway-pci-intx.c index 6b82872c2346..766de88170ef 100644 --- a/drivers/irqchip/irq-sunway-pci-intx.c +++ b/drivers/irqchip/irq-sunway-pci-intx.c @@ -60,6 +60,7 @@ static int __assign_piu_intx_config(struct intx_chip_data *chip_data, unsigned int cpu; int thread, node, core, rcid; unsigned int i; + struct irq_data *irq_data; if (is_guest_or_emul()) return 0; @@ -89,6 +90,9 @@ static int __assign_piu_intx_config(struct intx_chip_data *chip_data, (i << PCI_INTXCONFIG_OFFSET)); chip_data->intxconfig[i] = intxconfig; } + irq_data = irq_get_irq_data(hose->int_irq); + irq_data_update_effective_affinity(irq_data, cpumask_of(cpu)); + return 0; } -- Gitee From 8a67a94508f5b529372a896fc39db242feb20c24 Mon Sep 17 00:00:00 2001 From: Jing Li Date: Sat, 11 Oct 2025 15:28:14 +0800 Subject: [PATCH 07/14] sw64: smp: fix unaligned access before trap_init() Replace function sunway_machine_is_compatible() with function is_junzhang_v1() to avoid unaligned access before trap_init(). Signed-off-by: Jing Li Reviewed-by: He Sheng Signed-off-by: Gu Zitao --- arch/sw_64/kernel/smp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/sw_64/kernel/smp.c b/arch/sw_64/kernel/smp.c index 53aeb4c9792f..968772b7013f 100644 --- a/arch/sw_64/kernel/smp.c +++ b/arch/sw_64/kernel/smp.c @@ -72,7 +72,7 @@ static void upshift_freq(void) if (is_guest_or_emul()) return; - if (!sunway_machine_is_compatible("sunway,junzhang")) + if (!is_junzhang_v1()) return; cpu_num = sw64_chip->get_cpu_num(); @@ -95,7 +95,7 @@ static void downshift_freq(void) if (is_guest_or_emul()) return; - if (!sunway_machine_is_compatible("sunway,junzhang")) + if (!is_junzhang_v1()) return; for_each_online_cpu(cpu) { -- Gitee From 0320049142a4073d70e0937ac45946b17b4b80f2 Mon Sep 17 00:00:00 2001 From: Jing Li Date: Fri, 22 Aug 2025 09:07:31 +0800 Subject: [PATCH 08/14] sw64: powercap: avoid checking meaningless target freq The target freq field is only meaningful when powercap is enabled and frequency limitation is required. Signed-off-by: Jing Li Reviewed-by: He Sheng Signed-off-by: Gu Zitao --- drivers/platform/sw64/powercap.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/drivers/platform/sw64/powercap.c b/drivers/platform/sw64/powercap.c index 3f380ace5601..0bb62065065e 100644 --- a/drivers/platform/sw64/powercap.c +++ b/drivers/platform/sw64/powercap.c @@ -243,6 +243,16 @@ static inline bool is_powercap_cpu_match(const struct sunway_powercap_cpu *data, return true; } +static inline bool is_powercap_enabled(const struct sunway_powercap_freq *freq) +{ + return !!(freq->flags & FREQ_FLAG_ENABLE); +} + +static inline bool is_powercap_no_limit(const struct sunway_powercap_freq *freq) +{ + return !!(freq->flags & FREQ_FLAG_FREE); +} + static int sunway_powercap_validate_freq(const struct sunway_powercap_freq *freq, struct sunway_powercap_ack *ack) { @@ -268,6 +278,10 @@ static int sunway_powercap_validate_freq(const struct sunway_powercap_freq *freq ack->flags |= ACK_FLAG_VALID_NODE; ack->flags |= ACK_FLAG_VALID_CORE; + /* Make sure that the target freq field is meaningful */ + if (!is_powercap_enabled(freq) || is_powercap_no_limit(freq)) + return 0; + if (cpufreq_frequency_table_get_index(policy, target_freq) < 0) { pr_err("invalid target freq %u\n", target_freq); return -EINVAL; @@ -284,16 +298,6 @@ static int sunway_powercap_validate_freq(const struct sunway_powercap_freq *freq return -EINVAL; } -static inline bool is_powercap_enabled(const struct sunway_powercap_freq *freq) -{ - return !!(freq->flags & FREQ_FLAG_ENABLE); -} - -static inline bool is_powercap_no_limit(const struct sunway_powercap_freq *freq) -{ - return !!(freq->flags & FREQ_FLAG_FREE); -} - static inline bool is_powercap_freq_data_terminate(const struct sunway_powercap_freq *freq) { -- Gitee From a07f4552c1a2572314b2a2bd20b75f02e74fecb8 Mon Sep 17 00:00:00 2001 From: Jing Li Date: Thu, 18 Sep 2025 16:51:48 +0800 Subject: [PATCH 09/14] sw64: powercap: fix Kconfig dependency for SW64_POWERCAP The function of Sunway powercap driver is built on the basis of Sunway cpufreq driver, so SW64_POWERCAP depends on SW64_CPUFREQ rather than the generic CPUFREQ. Furthermore, Sunway powercap driver will fail to link when CONFIG_IPMI_HANDLER=m, so directly select IPMI_HANDLER. Signed-off-by: Jing Li Reviewed-by: He Sheng Signed-off-by: Gu Zitao --- arch/sw_64/Kconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/sw_64/Kconfig b/arch/sw_64/Kconfig index b4b8edbcf460..53d810186b8b 100644 --- a/arch/sw_64/Kconfig +++ b/arch/sw_64/Kconfig @@ -681,8 +681,9 @@ config ARCH_HIBERNATION_POSSIBLE config SW64_POWERCAP bool "Sunway powercap driver" + select IPMI_HANDLER select IPMI_SI - depends on SW64 && CPU_FREQ && ACPI && IPMI_HANDLER + depends on SW64_CPUFREQ && ACPI help This enables support for the sunway powercap driver based on BMC and IPMI system interface. -- Gitee From 02f8b637b67909e8d075196384ff521600eebbb6 Mon Sep 17 00:00:00 2001 From: Jing Li Date: Thu, 18 Sep 2025 17:08:38 +0800 Subject: [PATCH 10/14] sw64: powercap: increase the interval of polling mode The polling interval is too small, resulting in excessive occupation of IPMI bandwidth, thus increasing the polling interval. Signed-off-by: Jing Li Reviewed-by: He Sheng Signed-off-by: Gu Zitao --- drivers/platform/sw64/powercap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/platform/sw64/powercap.c b/drivers/platform/sw64/powercap.c index 0bb62065065e..61eef4095203 100644 --- a/drivers/platform/sw64/powercap.c +++ b/drivers/platform/sw64/powercap.c @@ -18,6 +18,8 @@ #define SUNWAY_POWERCAP_ACPI_NOTIFY_VALUE 0x84 +#define POLL_INTERVAL_UNIT_10MS 10 + enum sunway_powercap_version { SUNWAY_POWERCAP_V1 = 1, SUNWAY_POWERCAP_VERSION_MAX, @@ -531,7 +533,7 @@ static int sunway_powercap_setup_cfg(const struct sunway_powercap_cfg *cfg) driver_data.version = cfg->version; driver_data.mode = cfg->mode; - driver_data.poll_interval = cfg->poll_interval; + driver_data.poll_interval = cfg->poll_interval * POLL_INTERVAL_UNIT_10MS; if (is_poll_mode) { timer_setup(&driver_data.timer, sunway_powercap_poll_func, 0); -- Gitee From 9da07f3df6c2403d129983a6e653b4992dbd3f46 Mon Sep 17 00:00:00 2001 From: Jing Li Date: Thu, 18 Sep 2025 17:20:09 +0800 Subject: [PATCH 11/14] sw64: powercap: fix misuse of an uninitialized temporary variable Due to typo, the temporary variable related_cpu is misused. Signed-off-by: Jing Li Reviewed-by: He Sheng Signed-off-by: Gu Zitao --- drivers/platform/sw64/powercap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/platform/sw64/powercap.c b/drivers/platform/sw64/powercap.c index 61eef4095203..b1856ca24ddc 100644 --- a/drivers/platform/sw64/powercap.c +++ b/drivers/platform/sw64/powercap.c @@ -704,10 +704,10 @@ static int sunway_powercap_probe(struct platform_device *pdev) struct freq_qos_request *req; /* Initial state */ - powercap_cpu_data[related_cpu].state = SUNWAY_POWERCAP_STATE_FREE; + powercap_cpu_data[cpu].state = SUNWAY_POWERCAP_STATE_FREE; - powercap_cpu_data[related_cpu].core = rcid_to_core_id(rcid); - powercap_cpu_data[related_cpu].node = rcid_to_domain_id(rcid); + powercap_cpu_data[cpu].core = rcid_to_core_id(rcid); + powercap_cpu_data[cpu].node = rcid_to_domain_id(rcid); if (powercap_cpu_data[cpu].policy) continue; -- Gitee From 34b579677751e47c3e0a6676ea6f70b80c41a12f Mon Sep 17 00:00:00 2001 From: Jing Li Date: Fri, 17 Oct 2025 17:34:43 +0800 Subject: [PATCH 12/14] sw64: efi: fix compile error when CONFIG_EFI=n Signed-off-by: Jing Li Reviewed-by: He Sheng Signed-off-by: Gu Zitao --- arch/sw_64/kernel/cpu.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/arch/sw_64/kernel/cpu.c b/arch/sw_64/kernel/cpu.c index 172cca36e42d..7683fedda70f 100644 --- a/arch/sw_64/kernel/cpu.c +++ b/arch/sw_64/kernel/cpu.c @@ -70,7 +70,7 @@ static int cpuinfo_cpu_online(unsigned int cpu) return 0; } -static const char * __init dmi_get_string(const struct dmi_header *dm, u8 s) +static __maybe_unused const char * __init dmi_get_string(const struct dmi_header *dm, u8 s) { const u8 *bp = ((u8 *) dm) + dm->length; const u8 *nsp; @@ -90,7 +90,7 @@ static const char * __init dmi_get_string(const struct dmi_header *dm, u8 s) return ""; } -static void __init find_dmi_processor_version(const struct dmi_header *dm, +static __maybe_unused void __init find_dmi_processor_version(const struct dmi_header *dm, void *private) { char *dmi_data = (char *)dm; @@ -113,10 +113,12 @@ static void __init get_model_id(void) int i; unsigned long val; +#ifdef CONFIG_EFI /* Prefer model id from SMBIOS */ if (!IS_ENABLED(CONFIG_SUBARCH_C3B) && sunway_bios_version) dmi_walk(find_dmi_processor_version, NULL); +#endif if (strlen(model_id) > 0) return; @@ -128,7 +130,7 @@ static void __init get_model_id(void) } } -static void __init find_dmi_processor_manufacturer(const struct dmi_header *dm, +static __maybe_unused void __init find_dmi_processor_manufacturer(const struct dmi_header *dm, void *private) { char *dmi_data = (char *)dm; @@ -151,10 +153,12 @@ static void __init get_vendor_id(void) int i; unsigned long val; +#ifdef CONFIG_EFI /* Prefer vendor id from SMBIOS */ if (!IS_ENABLED(CONFIG_SUBARCH_C3B) && sunway_bios_version) dmi_walk(find_dmi_processor_manufacturer, NULL); +#endif if (strlen(vendor_id) > 0) return; @@ -166,7 +170,7 @@ static void __init get_vendor_id(void) } } -static void __init find_dmi_processor_family(const struct dmi_header *dm, +static __maybe_unused void __init find_dmi_processor_family(const struct dmi_header *dm, void *private) { char *dmi_data = (char *)dm; @@ -182,10 +186,12 @@ static void __init find_dmi_processor_family(const struct dmi_header *dm, static void __init get_family(void) { +#ifdef CONFIG_EFI /* Prefer processor family from SMBIOS */ if (!IS_ENABLED(CONFIG_SUBARCH_C3B) && sunway_bios_version) dmi_walk(find_dmi_processor_family, NULL); +#endif if (family) return; -- Gitee From 656447352847e334ddf9c9b805a69746bfa07aa3 Mon Sep 17 00:00:00 2001 From: Gao Chen Date: Wed, 22 Oct 2025 16:51:50 +0800 Subject: [PATCH 13/14] sw64: fix the condition for enabling hw_una_enabled The hw_una_enabled should be enabled by checking hmcode feature. Signed-off-by: Gao Chen Reviewed-by: He Sheng Signed-off-by: Gu Zitao --- arch/sw_64/kernel/setup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/sw_64/kernel/setup.c b/arch/sw_64/kernel/setup.c index 03974c001bf9..f8925a8a1b61 100644 --- a/arch/sw_64/kernel/setup.c +++ b/arch/sw_64/kernel/setup.c @@ -578,7 +578,7 @@ static void __init setup_firmware_fdt(void) static void __init setup_cpu_caps(void) { - if (!IS_ENABLED(CONFIG_SUBARCH_C3B) && !is_junzhang_v1()) + if (cpuid(GET_FEATURES, 0) & CPU_FEAT_UNA) static_branch_enable(&hw_una_enabled); } -- Gitee From 0e5de1168d824f2cbf8971b762cdf92a1d0e728d Mon Sep 17 00:00:00 2001 From: Gu Zitao Date: Fri, 24 Oct 2025 10:49:44 +0800 Subject: [PATCH 14/14] sw64: add SO_TVPC_INFO definition to fix compile error Signed-off-by: Gu Zitao Reviewed-by: He Sheng --- arch/sw_64/include/uapi/asm/socket.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/sw_64/include/uapi/asm/socket.h b/arch/sw_64/include/uapi/asm/socket.h index 1094d11fff5b..853b982bdb32 100644 --- a/arch/sw_64/include/uapi/asm/socket.h +++ b/arch/sw_64/include/uapi/asm/socket.h @@ -134,6 +134,8 @@ #define SO_PASSPIDFD 76 #define SO_PEERPIDFD 77 +#define SO_TVPC_INFO 5000 + #if !defined(__KERNEL__) #if __BITS_PER_LONG == 64 -- Gitee