Skip to content

Add empty_change_file.txt for PR testing#13

Open
lzyprime wants to merge 674 commits into
OLK-6.6from
upstream/OLK-6.6
Open

Add empty_change_file.txt for PR testing#13
lzyprime wants to merge 674 commits into
OLK-6.6from
upstream/OLK-6.6

Conversation

@lzyprime
Copy link
Copy Markdown

This is an empty file created for initiating a PR and testing the pipeline.

Andrew Jones and others added 30 commits February 4, 2026 22:29
mainline inclusion
from mainline-v6.13
commit fc9fdf2c5ab71e27e64b9e14606b677cc2e45884
category: feature
bugzilla: https://github.com/RVCK-Project/rvck-olk/issues/36

--------------------------------

Statically linking makes it more convenient to copy the test to a
minimal busybox environment.

Signed-off-by: Andrew Jones <ajones@ventanamicro.com>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20230918131518.56803-12-ajones@ventanamicro.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Weihao Li <ieiao@outlook.com>
mainline inclusion
from mainline-v6.13
commit 2f248e0f8a6aa7199f435d77d94b53cf647e7d7b
category: feature
bugzilla: https://github.com/RVCK-Project/rvck-olk/issues/36

--------------------------------

Returning (exiting with) negative exit codes isn't user friendly,
because the user must output the exit code with the shell, convert it
from its unsigned 8-bit value back to the negative value, and then
look up where that comes from in the code (which may be multiple
places). Use the kselftests TAP interface, instead.

Signed-off-by: Andrew Jones <ajones@ventanamicro.com>
Link: https://lore.kernel.org/r/20230918131518.56803-13-ajones@ventanamicro.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Weihao Li <ieiao@outlook.com>
mainline inclusion
from mainline-v6.13
commit a29e2a48afe3549ee34d39cf42343ba3fced09c6
category: feature
bugzilla: https://github.com/RVCK-Project/rvck-olk/issues/36

--------------------------------

Add hwprobe test for Zicboz and its block size. Also, when Zicboz is
present, test that cbo.zero may be issued and works. Additionally
provide a command line option that enables testing that the Zicbom
instructions cause SIGILL and also that cbo.zero causes SIGILL when
Zicboz it's not present. The SIGILL tests require "opt-in" with a
command line option because the RISC-V ISA does not require
unimplemented standard opcodes to issue illegal-instruction
exceptions (but hopefully most platforms do).

Pinning the test to a subset of cpus with taskset will also restrict
the hwprobe calls to that set.

Signed-off-by: Andrew Jones <ajones@ventanamicro.com>
Reviewed-by: Xiao Wang <xiao.w.wang@intel.com>
Link: https://lore.kernel.org/r/20230918131518.56803-14-ajones@ventanamicro.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Weihao Li <ieiao@outlook.com>
mainline inclusion
from mainline-v6.13
commit 36d842d654beba970e74ff0f6016c93623b82d37
category: feature
bugzilla: https://github.com/RVCK-Project/rvck-olk/issues/36

--------------------------------

The "count" parameter associated with the 'cpus' parameter of the
hwprobe syscall is the size in bytes of 'cpus'. Naming it 'cpu_count'
may mislead users (it did me) to think it's the number of CPUs that
are or can be represented by 'cpus' instead. This is particularly
easy (IMO) to get wrong since 'cpus' is documented to be defined by
CPU_SET(3) and CPU_SET(3) also documents a CPU_COUNT() (the number
of CPUs in set) macro. CPU_SET(3) refers to the size of cpu sets
with 'setsize'. Adopt 'cpusetsize' for the hwprobe parameter and
specifically state it is in bytes in Documentation/riscv/hwprobe.rst
to clarify.

Reviewed-by: Palmer Dabbelt <palmer@rivosinc.com>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Andrew Jones <ajones@ventanamicro.com>
Link: https://lore.kernel.org/r/20231122164700.127954-7-ajones@ventanamicro.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Weihao Li <ieiao@outlook.com>
mainline inclusion
from mainline-v6.13
commit e178bf146e4b8c774a7b00aa2419e400f4f7894f
category: feature
bugzilla: https://github.com/RVCK-Project/rvck-olk/issues/36

--------------------------------

Introduce the first flag for the hwprobe syscall. The flag basically
reverses its behavior, i.e. instead of populating the values of keys
for a given set of cpus, the set of cpus after the call is the result
of finding a set which supports the values of the keys. In order to
do this, we implement a pair compare function which takes the type of
value (a single value vs. a bitmask of booleans) into consideration.
We also implement vdso support for the new flag.

Signed-off-by: Andrew Jones <ajones@ventanamicro.com>
Reviewed-by: Evan Green <evan@rivosinc.com>
Link: https://lore.kernel.org/r/20231122164700.127954-9-ajones@ventanamicro.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Weihao Li <ieiao@outlook.com>
mainline inclusion
from mainline-v6.13
commit 5b4d64a819c05e7e96e7ab3f00f4f0967246905f
category: feature
bugzilla: https://github.com/RVCK-Project/rvck-olk/issues/36

--------------------------------

Export the Ztso extension to userspace.

Signed-off-by: Clément Léger <cleger@rivosinc.com>
Link: https://lore.kernel.org/r/20231220155723.684081-3-cleger@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Weihao Li <ieiao@outlook.com>
mainline inclusion
from mainline-v6.13
commit 154a3706122978eeb34d8223d49285ed4f3c61fa
category: feature
bugzilla: https://github.com/RVCK-Project/rvck-olk/issues/36

--------------------------------

Export Zacas ISA extension through hwprobe.

Signed-off-by: Clément Léger <cleger@rivosinc.com>
Link: https://lore.kernel.org/r/20231220155723.684081-6-cleger@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Weihao Li <ieiao@outlook.com>
mainline inclusion
from mainline-v6.13
commit 3359866b40a97038405c72e68097a92a4a9caa71
category: feature
bugzilla: https://github.com/RVCK-Project/rvck-olk/issues/36

--------------------------------

Export the zicond extension to userspace using hwprobe.

Signed-off-by: Clément Léger <cleger@rivosinc.com>
Link: https://lore.kernel.org/r/20231220155723.684081-7-cleger@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Weihao Li <ieiao@outlook.com>
mainline inclusion
from mainline-v6.13
commit 5ea6764d9095e234b024054f75ebbccc4f0eb146
category: feature
bugzilla: https://github.com/RVCK-Project/rvck-olk/issues/36

--------------------------------

The current definition yields a negative 32bits signed value which
result in a mask with is obviously incorrect. Replace it by using a
1ULL bit shift value to obtain a single set bit mask.

Fixes: 5dadda5e6a59 ("riscv: hwprobe: export Zvfh[min] ISA extensions")
Signed-off-by: Clément Léger <cleger@rivosinc.com>
Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Link: https://lore.kernel.org/r/20240409143839.558784-1-cleger@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Weihao Li <ieiao@outlook.com>
mainline inclusion
from mainline-v6.13
commit 53b2b22850e1ff9e2729ce8efe2d846ed7d3bff4
category: feature
bugzilla: https://github.com/RVCK-Project/rvck-olk/issues/36

--------------------------------

As Palmer says, hwprobe is "sort of its own thing now, and it's only
going to get bigger..."

Suggested-by: Palmer Dabbelt <palmer@dabbelt.com>
Signed-off-by: Andrew Jones <ajones@ventanamicro.com>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20231122164700.127954-8-ajones@ventanamicro.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Weihao Li <ieiao@outlook.com>
mainline inclusion
from mainline-v6.13
commit 63f93a3ca891fd90353cf81f5d2fc4cbc3508f1a
category: feature
bugzilla: https://github.com/RVCK-Project/rvck-olk/issues/36

--------------------------------

Export the Zihintpause ISA extension through hwprobe which allows using
"pause" instructions. Some userspace applications (OpenJDK for
instance) uses this to handle some locking back-off.

Signed-off-by: Clément Léger <cleger@rivosinc.com>
Reviewed-by: Atish Patra <atishp@rivosinc.com>
Link: https://lore.kernel.org/r/20240221083108.1235311-1-cleger@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Weihao Li <ieiao@outlook.com>
mainline inclusion
from mainline-v6.13
commit de8f8282a969d0b7342702f355886aab3b14043d
category: feature
bugzilla: https://github.com/RVCK-Project/rvck-olk/issues/36

--------------------------------

The following Vector subextensions for "embedded" platforms are added
into RISCV_HWPROBE_KEY_IMA_EXT_0:
 - ZVE32X
 - ZVE32F
 - ZVE64X
 - ZVE64F
 - ZVE64D

Extensions ending with an X indicates that the platform doesn't have a
vector FPU.
Extensions ending with F/D mean that whether single (F) or double (D)
precision vector operation is supported.
The number 32 or 64 follows from ZVE tells the maximum element length.

Signed-off-by: Andy Chiu <andy.chiu@sifive.com>
Reviewed-by: Clément Léger <cleger@rivosinc.com>
Link: https://lore.kernel.org/r/20240510-zve-detection-v5-6-0711bdd26c12@sifive.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Weihao Li <ieiao@outlook.com>
mainline inclusion
from mainline-v6.13
commit 36f8960de887a5e2811c5d1c0517cfa6f419c1c4
category: feature
bugzilla: https://github.com/RVCK-Project/rvck-olk/issues/36

--------------------------------

Export Zimop ISA extension through hwprobe.

Signed-off-by: Clément Léger <cleger@rivosinc.com>
Reviewed-by: Charlie Jenkins <charlie@rivosinc.com>
Link: https://lore.kernel.org/r/20240619113529.676940-4-cleger@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Weihao Li <ieiao@outlook.com>
mainline inclusion
from mainline-v6.13
commit 0ad70db5eb21e50ed693fa274bea0346de453e29
category: feature
bugzilla: https://github.com/RVCK-Project/rvck-olk/issues/36

--------------------------------

Export Zca, Zcf, Zcd and Zcb ISA extension through hwprobe.

Signed-off-by: Clément Léger <cleger@rivosinc.com>
Reviewed-by: Charlie Jenkins <charlie@rivosinc.com>
Link: https://lore.kernel.org/r/20240619113529.676940-10-cleger@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Weihao Li <ieiao@outlook.com>
mainline inclusion
from mainline-v6.13
commit fc078ea317cc856c1e82997da7e8fd4d6da7aa29
category: feature
bugzilla: https://github.com/RVCK-Project/rvck-olk/issues/36

--------------------------------

Export Zcmop ISA extension through hwprobe.

Signed-off-by: Clément Léger <cleger@rivosinc.com>
Reviewed-by: Evan Green <evan@rivosinc.com>
Link: https://lore.kernel.org/r/20240619113529.676940-15-cleger@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Weihao Li <ieiao@outlook.com>
mainline inclusion
from mainline-v6.13
commit c9b8cd139c1dfb95eb86fd6a58cfe2089843d1d4
category: feature
bugzilla: https://github.com/RVCK-Project/rvck-olk/issues/36

--------------------------------

Some userspace applications (OpenJDK for instance) uses the free MSBs
in pointers to insert additional information for their own logic and
need to get this information from somewhere. Currently they rely on
parsing /proc/cpuinfo "mmu=svxx" string to obtain the current value of
virtual address usable bits [1]. Since this reflect the raw supported
MMU mode, it might differ from the logical one used internally which is
why arch_get_mmap_end() is used. Exporting the highest mmapable address
through hwprobe will allow a more stable interface to be used. For that
purpose, add a new hwprobe key named
RISCV_HWPROBE_KEY_HIGHEST_VIRT_ADDRESS which will export the highest
userspace virtual address.

Link: https://github.com/openjdk/jdk/blob/master/src/hotspot/os_cpu/linux_riscv/vm_version_linux_riscv.cpp#L171 [1]
Signed-off-by: Clément Léger <cleger@rivosinc.com>
Reviewed-by: Charlie Jenkins <charlie@rivosinc.com>
Link: https://lore.kernel.org/r/20240410144558.1104006-1-cleger@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Weihao Li <ieiao@outlook.com>
mainline inclusion
from mainline-v6.13
commit 244c18fbf64a33d152645766a033b2935ab0acb5
category: feature
bugzilla: https://github.com/RVCK-Project/rvck-olk/issues/36

--------------------------------

Export Zawrs ISA extension through hwprobe.

[Palmer: there's a gap in the numbers here as there will be a merge
conflict when this is picked up.  To avoid confusion I just set the
hwprobe ID to match what it would be post-merge.]

Signed-off-by: Andrew Jones <ajones@ventanamicro.com>
Reviewed-by: Clément Léger <cleger@rivosinc.com>
Link: https://lore.kernel.org/r/20240426100820.14762-12-ajones@ventanamicro.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Weihao Li <ieiao@outlook.com>
mainline inclusion
from mainline-v6.13
commit 52420e483d3e1562f11a208d3c540b27b5e5dbf4
category: feature
bugzilla: https://github.com/RVCK-Project/rvck-olk/issues/36

--------------------------------

The RISC-V architecture makes a real time counter CSR (via RDTIME
instruction) available for applications in U-mode but there is no
architected mechanism for an application to discover the frequency
the counter is running at. Some applications (e.g., DPDK) use the
time counter for basic performance analysis as well as fine grained
time-keeping.

Add support to the hwprobe system call to export the time CSR
frequency to code running in U-mode.

Signed-off-by: Yunhui Cui <cuiyunhui@bytedance.com>
Reviewed-by: Evan Green <evan@rivosinc.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Acked-by: Punit Agrawal <punit.agrawal@bytedance.com>
Link: https://lore.kernel.org/r/20240702033731.71955-2-cuiyunhui@bytedance.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Weihao Li <ieiao@outlook.com>
mainline inclusion
from mainline-v6.13
commit 3c2e0aff7b4f03fbc11b7d63c8db5b94a48978cf
category: feature
bugzilla: https://github.com/RVCK-Project/rvck-olk/issues/36

--------------------------------

Supm is a virtual ISA extension defined in the RISC-V Pointer Masking
specification, which indicates that pointer masking is available in
U-mode. It can be provided by either Smnpm or Ssnpm, depending on which
mode the kernel runs in. Userspace should not care about this
distinction, so export Supm instead of either underlying extension.

Hide the extension if the kernel was compiled without support for the
pointer masking prctl() interface.

Signed-off-by: Samuel Holland <samuel.holland@sifive.com>
Link: https://lore.kernel.org/r/20241016202814.4061541-9-samuel.holland@sifive.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Weihao Li <ieiao@outlook.com>
mainline inclusion
from mainline-v6.13
commit 3d8d459c8ba282a67df3b518c5f80bcb217a5b38
category: feature
bugzilla: https://github.com/RVCK-Project/rvck-olk/issues/36

--------------------------------

Currently the entries appear to be in a random order (although according
to Palmer he has tried to sort them by key value) which makes it harder
to find entries in a growing list, and more likely to have conflicts as
all patches are adding to the end of the list. Sort them alphabetically
instead.

Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Reviewed-by: Clément Léger <cleger@rivosinc.com>
Link: https://lore.kernel.org/r/20240717-dedicate-squeamish-7e4ab54df58f@spud
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Weihao Li <ieiao@outlook.com>
mainline inclusion
from mainline-v6.13
commit 0f2425411101128a38ad0166268975ca11fbcaeb
category: feature
bugzilla: https://github.com/RVCK-Project/rvck-olk/issues/36

--------------------------------

Vendor extensions are maintained in per-vendor structs (separate from
standard extensions which live in riscv_isa). Create vendor variants for
the existing extension helpers to interface with the riscv_isa_vendor
bitmaps.

Signed-off-by: Charlie Jenkins <charlie@rivosinc.com>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Reviewed-by: Andy Chiu <andy.chiu@sifive.com>
Link: https://lore.kernel.org/r/20240719-support_vendor_extensions-v3-3-0af7587bbec0@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Weihao Li <ieiao@outlook.com>
mainline inclusion
from mainline-v6.13
commit d4c8d79f5199055da38f880f782a3e62c599ff5d
category: feature
bugzilla: https://github.com/RVCK-Project/rvck-olk/issues/36

--------------------------------

The __riscv_has_extension_likely() and __riscv_has_extension_unlikely()
functions from the vendor_extensions.h can be used to simplify the
standard extension checking code as well. Migrate those functions to
cpufeature.h and reorganize the code in the file to use the functions.

Signed-off-by: Charlie Jenkins <charlie@rivosinc.com>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Reviewed-by: Andy Chiu <andy.chiu@sifive.com>
Link: https://lore.kernel.org/r/20240719-support_vendor_extensions-v3-4-0af7587bbec0@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Weihao Li <ieiao@outlook.com>
mainline inclusion
from mainline-v6.13
commit 010e12aa4925b36700ebacb763a7e6cfd771d9a2
category: feature
bugzilla: https://github.com/RVCK-Project/rvck-olk/issues/36

--------------------------------

asm/cmpxchg.h will soon need riscv_has_extension_unlikely() macros and
then needs to include asm/cpufeature.h which introduces a lot of header
circular dependencies.

So move the riscv_has_extension_XXX() macros into their own header which
prevents such circular dependencies by including a restricted number of
headers.

Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Reviewed-by: Andrea Parri <parri.andrea@gmail.com>
Link: https://lore.kernel.org/r/20241103145153.105097-2-alexghiti@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Weihao Li <ieiao@outlook.com>
mainline inclusion
from mainline-v6.13
commit be5e8872b3fbc74b4a58a7e6a7e9fb7e8509eaf8
category: feature
bugzilla: https://github.com/RVCK-Project/rvck-olk/issues/36

--------------------------------

Use "ANDES" rather than "ANDESTECH" to unify the naming
convention with directory, file names, Kconfig options
and other definitions.

Signed-off-by: Yu Chien Peter Lin <peterlin@andestech.com>
Reviewed-by: Charles Ci-Jyun Wu <dminus@andestech.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Link: https://lore.kernel.org/r/20240222083946.3977135-2-peterlin@andestech.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Weihao Li <ieiao@outlook.com>
mainline inclusion
from mainline-v6.11-rc1
commit fe1c408d50604f6013ca273d14b0ffeb845f23b1
category: feature
bugzilla: https://github.com/RVCK-Project/rvck-olk/issues/37

--------------------------------

ACPICA commit 93caddbf2f620769052c59ec471f018281dc3a24
Add definition of RISC-V Interrupt Controller(RINTC)
affinity structure which was approved by UEFI forum
and will be part of next ACPI spec version(6.6).
Link: acpica/acpica@93caddbf

Signed-off-by: Haibo Xu <haibo1.xu@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Gao Rui <gao.rui@zte.com.cn>
mainline inclusion
from mainline-v6.11-rc1
commit eabd9db64ea8ba64d2a0b1d70da38e1a95dcd08b
category: feature
bugzilla: https://github.com/RVCK-Project/rvck-olk/issues/37

--------------------------------

Add acpi_numa.c file to enable parse NUMA information from
ACPI SRAT and SLIT tables. SRAT table provide CPUs(Hart) and
memory nodes to proximity domain mapping, while SLIT table
provide the distance metrics between proximity domains.

Signed-off-by: Haibo Xu <haibo1.xu@intel.com>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Gao Rui <gao.rui@zte.com.cn>
mainline inclusion
from mainline-v6.11-rc1
commit 39494aec8a0454f9e8a68d2422d3bd4e5c5ee0c7
category: feature
bugzilla: https://github.com/RVCK-Project/rvck-olk/issues/37

--------------------------------

Add RINTC affinity structure handler during parsing SRAT table.

Signed-off-by: Haibo Xu <haibo1.xu@intel.com>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Gao Rui <gao.rui@zte.com.cn>
driver inclusion
category: feature
bugzilla: https://github.com/RVCK-Project/rvck-olk/issues/37
Reference: torvalds/linux@3a785e1

--------------------------------

The ACPI NUMA functions for the IA-64 architecture were implemented
separately due to its unique hardware design. In a higher version, the
kernel removed the IA-64 architecture code [1] and unify the ACPI NUMA
implementation. However, to avoid the risks associated with extensive code
modifications, we retained the IA-64 ACPI NUMA function definitions to
ensure compatibility and stability.

The acpi_numa_slit_init(), acpi_numa_memory_affinity_init() and
acpi_parse_cfmws() functions will be used on platforms that support RISC-V
ACPI_NUMA.

[1] commit cf8e8658100d ("arch: Remove Itanium (IA-64) architecture")

Signed-off-by: Gao Rui <gao.rui@zte.com.cn>
driver inclusion
category: feature
bugzilla: https://github.com/RVCK-Project/rvck-olk/issues/37
Reference: torvalds/linux@adc3e82

--------------------------------

x86/arm64/loongarch would select ACPI_NUMA by default and riscv
would do the same thing, so change it to a hidden option and the
select statements except for the X86_64_ACPI_NUMA can also go away.

Suggested-by: Arnd Bergmann <arnd@arndb.de>
Suggested-by: Sunil V L <sunilvl@ventanamicro.com>
Signed-off-by: Haibo Xu <haibo1.xu@intel.com>
Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>
Acked-by: Huacai Chen <chenhuacai@loongson.cn>
Acked-by: Will Deacon <will@kernel.org>
Reviewed-by: Hanjun Guo <guohanjun@huawei.com>
Link: https://lore.kernel.org/r/f1f96377b8ecd6e3183f28abf5c9ac21cb9855ea.1718268003.git.haibo1.xu@intel.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
[Since there is no sw_64 architecture in the upstream, changes were made
to that architecture for the same purpose.]
Signed-off-by: Gao Rui <gao.rui@zte.com.cn>
mainline inclusion
from mainline-v6.11-rc1
commit 5f76d4211ee44dcd9b2dc8a9065002bf8ecee81e
category: feature
bugzilla: https://github.com/RVCK-Project/rvck-olk/issues/37

--------------------------------

There are lots of ACPI enabled systems that aren't NUMA and If the
firmware didn't provide the SRAT/SLIT, then there will be a message
"Failed to initialise from firmware" from arch_acpi_numa_init() which
adding noise to the boot on all of those kind of systems. Replace the
pr_info with pr_debug in arch_acpi_numa_init() to avoid it.
Suggested-by: Sunil V L <sunilvl@ventanamicro.com>

Signed-off-by: Haibo Xu <haibo1.xu@intel.com>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Gao Rui <gao.rui@zte.com.cn>
bjorn-rivos and others added 25 commits February 4, 2026 22:30
mainline inclusion
from mainline-v6.7
commit c27fa53b858b4ee6552a719aa599c250cf98a586
category: feature
bugzilla: RVCK-Project/rvck#86

--------------------------------

The RISC-V Vector specification states in "Appendix D: Calling
Convention for Vector State" [1] that "Executing a system call causes
all caller-saved vector registers (v0-v31, vl, vtype) and vstart to
become unspecified.". In the RISC-V kernel this is called "discarding
the vstate".
Returning from a signal handler via the rt_sigreturn() syscall, vector
discard is also performed. However, this is not an issue since the
vector state should be restored from the sigcontext, and therefore not
care about the vector discard.
The "live state" is the actual vector register in the running context,
and the "vstate" is the vector state of the task. A dirty live state,
means that the vstate and live state are not in synch.
When vectorized user_from_copy() was introduced, an bug sneaked in at
the restoration code, related to the discard of the live state.
An example when this go wrong:
  1. A userland application is executing vector code
  2. The application receives a signal, and the signal handler is
     entered.
  3. The application returns from the signal handler, using the
     rt_sigreturn() syscall.
  4. The live vector state is discarded upon entering the
     rt_sigreturn(), and the live state is marked as "dirty", indicating
     that the live state need to be synchronized with the current
     vstate.
  5. rt_sigreturn() restores the vstate, except the Vector registers,
     from the sigcontext
  6. rt_sigreturn() restores the Vector registers, from the sigcontext,
     and now the vectorized user_from_copy() is used. The dirty live
     state from the discard is saved to the vstate, making the vstate
     corrupt.
  7. rt_sigreturn() returns to the application, which crashes due to
     corrupted vstate.
Note that the vectorized user_from_copy() is invoked depending on the
value of CONFIG_RISCV_ISA_V_UCOPY_THRESHOLD. Default is 768, which
means that vlen has to be larger than 128b for this bug to trigger.
The fix is simply to mark the live state as non-dirty/clean prior
performing the vstate restore.
Link: https://github.com/riscv/riscv-isa-manual/releases/download/riscv-isa-release-8abdb41-2024-03-26/unpriv-isa-asciidoc.pdf # [1]
Reported-by: Charlie Jenkins <charlie@rivosinc.com>
Reported-by: Vineet Gupta <vgupta@kernel.org>
Fixes: c2a658d41924 ("riscv: lib: vectorize copy_to_user/copy_from_user")

Signed-off-by: Björn Töpel <bjorn@rivosinc.com>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Gao Rui <gao.rui@zte.com.cn>
Signed-off-by: Yanteng Si <si.yanteng@linux.dev>
Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
riscv inclusion
category: feature
bugzilla: RVCK-Project/rvck#86

--------------------------------

Enable the following configs:
CONFIG_RISCV_ISA_V

The following configs have been merged in the previous PR and are now
enabled together:
CONFIG_SERIAL_EARLYCON_RISCV_SBI
CONFIG_PARAVIRT
CONFIG_PARAVIRT_TIME_ACCOUNTING

Then update openeuler_defconfig:
make save_oedefconfig
make update_oedefconfig

Build and boot testing passed.

Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
mainline inclusion
from mainline-v6.7-rc6
commit cbc2fe9d9cb226347365753f50d81bc48cc3c52e
category: bugfix
bugzilla: RVCK-Project/rvck#76

--------------------------------

Patch series "kexec_file: print out debugging message if required", v4.
Currently, specifying '-d' on kexec command will print a lot of debugging
informationabout kexec/kdump loading with kexec_load interface.
However, kexec_file_load prints nothing even though '-d' is specified.
It's very inconvenient to debug or analyze the kexec/kdump loading when
something wrong happened with kexec/kdump itself or develper want to check
the kexec/kdump loading.
In this patchset, a kexec_file flag is KEXEC_FILE_DEBUG added and checked
in code.  If it's passed in, debugging message of kexec_file code will be
printed out and can be seen from console and dmesg.  Otherwise, the
debugging message is printed like beofre when pr_debug() is taken.
Note:
****
=====
1) The code in kexec-tools utility also need be changed to support
passing KEXEC_FILE_DEBUG to kernel when 'kexec -s -d' is specified.
The patch link is here:
=========
[PATCH] kexec_file: add kexec_file flag to support debug printing
http://lists.infradead.org/pipermail/kexec/2023-November/028505.html
2) s390 also has kexec_file code, while I am not sure what debugging
information is necessary. So leave it to s390 developer.
Test:
****
====
Testing was done in v1 on x86_64 and arm64. For v4, tested on x86_64
again. And on x86_64, the printed messages look like below:
--------------------------------------------------------------
kexec measurement buffer for the loaded kernel at 0x207fffe000.
Loaded purgatory at 0x207fff9000
Loaded boot_param, command line and misc at 0x207fff3000 bufsz=0x1180 memsz=0x1180
Loaded 64bit kernel at 0x207c000000 bufsz=0xc88200 memsz=0x3c4a000
Loaded initrd at 0x2079e79000 bufsz=0x2186280 memsz=0x2186280
Final command line is: root=/dev/mapper/fedora_intel--knightslanding--lb--02-root ro
rd.lvm.lv=fedora_intel-knightslanding-lb-02/root console=ttyS0,115200N81 crashkernel=256M
E820 memmap:
0000000000000000-000000000009a3ff (1)
000000000009a400-000000000009ffff (2)
00000000000e0000-00000000000fffff (2)
0000000000100000-000000006ff83fff (1)
000000006ff84000-000000007ac50fff (2)
......
000000207fff6150-000000207fff615f (128)
000000207fff6160-000000207fff714f (1)
000000207fff7150-000000207fff715f (128)
000000207fff7160-000000207fff814f (1)
000000207fff8150-000000207fff815f (128)
000000207fff8160-000000207fffffff (1)
nr_segments = 5
segment[0]: buf=0x000000004e5ece74 bufsz=0x211 mem=0x207fffe000 memsz=0x1000
segment[1]: buf=0x000000009e871498 bufsz=0x4000 mem=0x207fff9000 memsz=0x5000
segment[2]: buf=0x00000000d879f1fe bufsz=0x1180 mem=0x207fff3000 memsz=0x2000
segment[3]: buf=0x000000001101cd86 bufsz=0xc88200 mem=0x207c000000 memsz=0x3c4a000
segment[4]: buf=0x00000000c6e38ac7 bufsz=0x2186280 mem=0x2079e79000 memsz=0x2187000
kexec_file_load: type:0, start:0x207fff91a0 head:0x109e004002 flags:0x8
---------------------------------------------------------------------------
This patch (of 7):
When specifying 'kexec -c -d', kexec_load interface will print loading
information, e.g the regions where kernel/initrd/purgatory/cmdline are
put, the memmap passed to 2nd kernel taken as system RAM ranges, and
printing all contents of struct kexec_segment, etc.  These are very
helpful for analyzing or positioning what's happening when kexec/kdump
itself failed.  The debugging printing for kexec_load interface is made in
user space utility kexec-tools.
Whereas, with kexec_file_load interface, 'kexec -s -d' print nothing.
Because kexec_file code is mostly implemented in kernel space, and the
debugging printing functionality is missed.  It's not convenient when
debugging kexec/kdump loading and jumping with kexec_file_load interface.
Now add KEXEC_FILE_DEBUG to kexec_file flag to control the debugging
message printing.  And add global variable kexec_file_dbg_print and macro
kexec_dprintk() to facilitate the printing.
This is a preparation, later kexec_dprintk() will be used to replace the
existing pr_debug().  Once 'kexec -s -d' is specified, it will print out
kexec/kdump loading information.  If '-d' is not specified, it regresses
to pr_debug().
Link: https://lkml.kernel.org/r/20231213055747.61826-1-bhe@redhat.com
Link: https://lkml.kernel.org/r/20231213055747.61826-2-bhe@redhat.com

Signed-off-by: Baoquan He <bhe@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Gao Rui <gao.rui@zte.com.cn>
Signed-off-by: Yanteng Si <si.yanteng@linux.dev>
Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
mainline inclusion
from mainline-v6.7-rc6
commit a85ee18c7900f001f42082d2fabce4eaf57e655f
category: bugfix
bugzilla: RVCK-Project/rvck#76

--------------------------------

Then when specifying '-d' for kexec_file_load interface, loaded locations
of kernel/initrd/cmdline etc can be printed out to help debug.
Here replace pr_debug() with the newly added kexec_dprintk() in kexec_file
loading related codes.
And also print out type/start/head of kimage and flags to help debug.
Link: https://lkml.kernel.org/r/20231213055747.61826-3-bhe@redhat.com

Signed-off-by: Baoquan He <bhe@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Gao Rui <gao.rui@zte.com.cn>
Signed-off-by: Yanteng Si <si.yanteng@linux.dev>
Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
mainline inclusion
from mainline-v6.7-rc6
commit e687b2fabd824d06e1126378b386c104341515f3
category: bugfix
bugzilla: RVCK-Project/rvck#76

--------------------------------

Then when specifying '-d' for kexec_file_load interface, loaded locations
of kernel/initrd/cmdline etc can be printed out to help debug.
Here replace pr_debug() with the newly added kexec_dprintk() in kexec_file
loading related codes.
And also print out e820 memmap passed to 2nd kernel just as kexec_load
interface has been doing.
Link: https://lkml.kernel.org/r/20231213055747.61826-4-bhe@redhat.com

Signed-off-by: Baoquan He <bhe@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Gao Rui <gao.rui@zte.com.cn>
Signed-off-by: Yanteng Si <si.yanteng@linux.dev>
Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
mainline inclusion
from mainline-v6.7-rc6
commit 6f8c1da071a46176966e377fb77a46366fb5af2d
category: bugfix
bugzilla: RVCK-Project/rvck#76

--------------------------------

Then when specifying '-d' for kexec_file_load interface, loaded locations
of kernel/initrd/cmdline etc can be printed out to help debug.
Here replace pr_debug() with the newly added kexec_dprintk() in kexec_file
loading related codes.
And also remove the kimage->segment[] printing because the generic code
has done the printing.
Link: https://lkml.kernel.org/r/20231213055747.61826-5-bhe@redhat.com

Signed-off-by: Baoquan He <bhe@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Gao Rui <gao.rui@zte.com.cn>
Signed-off-by: Yanteng Si <si.yanteng@linux.dev>
Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
mainline inclusion
from mainline-v6.7-rc6
commit eb7622d908a097fe0b845cb2dc4b579b99f04b59
category: bugfix
bugzilla: RVCK-Project/rvck#76

--------------------------------

Then when specifying '-d' for kexec_file_load interface, loaded locations
of kernel/initrd/cmdline etc can be printed out to help debug.
Here replace pr_debug() with the newly added kexec_dprintk() in kexec_file
loading related codes.
And also replace pr_notice() with kexec_dprintk() in elf_kexec_load()
because loaded location of purgatory and device tree are only printed out
for debugging, it doesn't make sense to always print them out.
And also remove kexec_image_info() because the content has been printed
out in generic code.
Link: https://lkml.kernel.org/r/20231213055747.61826-6-bhe@redhat.com

Signed-off-by: Baoquan He <bhe@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Gao Rui <gao.rui@zte.com.cn>
Signed-off-by: Yanteng Si <si.yanteng@linux.dev>
Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
mainline inclusion
from mainline-v6.7-rc6
commit 63b642e952f62b41033e34e81b74b9d9db33144b
category: bugfix
bugzilla: RVCK-Project/rvck#76

--------------------------------

Then when specifying '-d' for kexec_file_load interface, loaded locations
of kernel/initrd/cmdline etc can be printed out to help debug.
Here replace pr_debug() with the newly added kexec_dprintk() in kexec_file
loading related codes.
Link: https://lkml.kernel.org/r/20231213055747.61826-7-bhe@redhat.com

Signed-off-by: Baoquan He <bhe@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Gao Rui <gao.rui@zte.com.cn>
Signed-off-by: Yanteng Si <si.yanteng@linux.dev>
Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
mainline inclusion
from mainline-v6.7-rc6
commit d9e5a0ce2f16e57ccf2b91a213a5b434dcc1d88b
category: bugfix
bugzilla: RVCK-Project/rvck#76

--------------------------------

Currently, 8250_platform driver is used only for devices with fixed
serial ports (plat_serial8250_port). Extend this driver for any generic
16550A platform devices which can be probed using standard hardware
discovery mechanisms like ACPI.
This is required in particular for RISC-V which has non-PNP generic
16550A compatible UART that needs to be enumerated as ACPI platform
device.
Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Signed-off-by: Baoquan He <bhe@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Gao Rui <gao.rui@zte.com.cn>
Signed-off-by: Yanteng Si <si.yanteng@linux.dev>
Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
mainline inclusion
from mainline-v6.7-rc8
commit f4af41bf177add167e39e4b0203460b1d0b531f6
category: bugfix
bugzilla: RVCK-Project/rvck#76

--------------------------------

Jiri reported that the current kexec_dprintk() always prints out debugging
message whenever kexec/kdmmp loading is triggered.  That is not wanted.
The debugging message is supposed to be printed out when 'kexec -s -d' is
specified for kexec/kdump loading.
After investigating, the reason is the current kexec_dprintk() takes
printk(KERN_INFO) or printk(KERN_DEBUG) depending on whether '-d' is
specified.  However, distros usually have defaulg log level like below:
 [~]# cat /proc/sys/kernel/printk
 7       4      1       7
So, even though '-d' is not specified, printk(KERN_DEBUG) also always
prints out.  I thought printk(KERN_DEBUG) is equal to pr_debug(), it's
not.
Fix it by changing to use pr_info() instead which are expected to work.
Link: https://lkml.kernel.org/r/20240409042238.1240462-1-bhe@redhat.com
Fixes: cbc2fe9d9cb2 ("kexec_file: add kexec_file flag to control debug printing")

Signed-off-by: Baoquan He <bhe@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Gao Rui <gao.rui@zte.com.cn>
Signed-off-by: Yanteng Si <si.yanteng@linux.dev>
Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
mainline inclusion
from mainline-v6.16-rc1
commit 1df45f8a9fea5a7513bd1bad98604ce1fbefcaaf
category: bugfix
bugzilla: RVCK-Project/rvck#70

--------------------------------

This is the preparative patch for kexec_file_load Image support.
It separates the elf_kexec_load() as two parts:
- the first part loads the vmlinux (or Image)
- the second part loads other segments (e.g. initrd,fdt,purgatory)
And the second part is exported as the load_extra_segments() function
which would be used in both kexec-elf.c and kexec-image.c.
No functional change intended.

Signed-off-by: Song Shuai <songshuaishuai@tinylab.org>
Signed-off-by: Björn Töpel <bjorn@rivosinc.com>
Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Signed-off-by: Palmer Dabbelt <palmer@dabbelt.com>
Signed-off-by: Gao Rui <gao.rui@zte.com.cn>
Signed-off-by: Yanteng Si <si.yanteng@linux.dev>
Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
mainline inclusion
from mainline-v6.16-rc1
commit 809a11eea8e8c80491e3ba3a286af25409c072d5
category: bugfix
bugzilla: RVCK-Project/rvck#70

--------------------------------

This patch creates image_kexec_ops to load Image binary file
for kexec_file_load() syscall.

Signed-off-by: Song Shuai <songshuaishuai@tinylab.org>
Signed-off-by: Björn Töpel <bjorn@rivosinc.com>
Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Signed-off-by: Palmer Dabbelt <palmer@dabbelt.com>
Signed-off-by: Gao Rui <gao.rui@zte.com.cn>
Signed-off-by: Yanteng Si <si.yanteng@linux.dev>
Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
mainline inclusion
from mainline-v6.11-rc1
commit d9e5a0ce2f16e57ccf2b91a213a5b434dcc1d88b
category: bugfix
bugzilla: RVCK-Project/rvck#70

--------------------------------

Currently, 8250_platform driver is used only for devices with fixed
serial ports (plat_serial8250_port). Extend this driver for any generic
16550A platform devices which can be probed using standard hardware
discovery mechanisms like ACPI.
This is required in particular for RISC-V which has non-PNP generic
16550A compatible UART that needs to be enumerated as ACPI platform
device.
Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Signed-off-by: Sunil V L <sunilvl@ventanamicro.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Gao Rui <gao.rui@zte.com.cn>
Signed-off-by: Yanteng Si <si.yanteng@linux.dev>
Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
mainline inclusion
from Linux 6.6-rc6
commit fe0bab701e3b71a1d2db123c05b4f5c33098cc96
category: feature
bugzilla: RVCK-Project/rvck#67

--------------------------------

Add a placeholder for all registers such as henvcfg, hstateen etc
which have 'static' configurations depending on extensions supported by
the guest. The values are derived once and are then subsequently written
to the corresponding CSRs while switching to the vcpu.

Signed-off-by: Mayuresh Chitale <mchitale@ventanamicro.com>
Signed-off-by: Anup Patel <anup@brainfault.org>
Signed-off-by: yechao-w <wang.yechao255@zte.com.cn>
Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
mainline inclusion
from Linux 6.6-rc6
commit d21b5d342fc12eb0a0f812864aa58aa9bb2c0599
category: feature
bugzilla: RVCK-Project/rvck#67

--------------------------------

Configure hstateen0 register so that the AIA state and envcfg are
accessible to the vcpus. This includes registers such as siselect,
sireg, siph, sieh and all the IMISC registers.

Signed-off-by: Mayuresh Chitale <mchitale@ventanamicro.com>
Signed-off-by: Anup Patel <anup@brainfault.org>
Signed-off-by: yechao-w <wang.yechao255@zte.com.cn>
Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
mainline inclusion
from Linux 6.6-rc6
commit db3c01c7a3081c6a6a50570e48bdbea509ba30e4
category: feature
bugzilla: RVCK-Project/rvck#67

--------------------------------

Add senvcfg context save/restore for guest VCPUs and also add it to the
ONE_REG interface to allow its access from user space.

Signed-off-by: Mayuresh Chitale <mchitale@ventanamicro.com>
Signed-off-by: Anup Patel <anup@brainfault.org>
Signed-off-by: yechao-w <wang.yechao255@zte.com.cn>
Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
mainline inclusion
from Linux 6.6-rc6
commit 81f0f314fec92a69d6c4951b9d9db21d37419669
category: feature
bugzilla: RVCK-Project/rvck#67

--------------------------------

Define sstateen0 and add sstateen0 save/restore for guest VCPUs.

Signed-off-by: Mayuresh Chitale <mchitale@ventanamicro.com>
Signed-off-by: Anup Patel <anup@brainfault.org>
Signed-off-by: yechao-w <wang.yechao255@zte.com.cn>
Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
mainline inclusion
from Linux 6.6-rc6
commit c04913f2b54ee86be34d1a1e9df7b7876b12b8c0
category: feature
bugzilla: RVCK-Project/rvck#67

--------------------------------

Add support for sstateen0 CSR to the ONE_REG interface to allow its
access from user space.

Signed-off-by: Mayuresh Chitale <mchitale@ventanamicro.com>
Signed-off-by: Anup Patel <anup@brainfault.org>
Signed-off-by: yechao-w <wang.yechao255@zte.com.cn>
Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
mainline inclusion
from Linux Linux 6.7-rc8
commit 4c460eb369514d53383a7c6ba1aefbca4914c68b
category: feature
bugzilla: RVCK-Project/rvck#67

--------------------------------

The indentation of "break" in kvm_riscv_vcpu_set_reg_csr() is
inconsistent hence let us fix it.
Fixes: c04913f2b54e ("RISCV: KVM: Add sstateen0 to ONE_REG")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202312190719.kBuYl6oJ-lkp@intel.com/

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Signed-off-by: Anup Patel <anup@brainfault.org>
Signed-off-by: yechao-w <wang.yechao255@zte.com.cn>
Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
mainline inclusion
from Linux 6.15-rc5
commit 87ec7d5249bb8ebf40261420da069fa238c21789
category: feature
bugzilla: RVCK-Project/rvck#67

--------------------------------

Not resetting smstateen is a potential security hole, because VU might
be able to access state that VS does not properly context-switch.
Fixes: 81f0f314fec9 ("RISCV: KVM: Add sstateen0 context save/restore")

Signed-off-by: Radim Krčmář <rkrcmar@ventanamicro.com>
Signed-off-by: Anup Patel <anup@brainfault.org>
Signed-off-by: yechao-w <wang.yechao255@zte.com.cn>
Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
riscv inclusion
category: bugfix
bugzilla: ruyisdk/linux-xuantie-kernel#214
CVE: NA

--------------------------------

Make VHA select SYNC_FILE to avoid KUnit test errors:

    ld: drivers/soc/xuantie/nna/vha/vha_common.o: in function `.L0 ':
    vha_common.c:(.text+0x4da): undefined reference to `dma_fence_release'
    ld: drivers/soc/xuantie/nna/vha/vha_common.o: in function `dma_fence_put.part.0':
    vha_common.c:(.text+0x52e): undefined reference to `dma_fence_release'
    ld: drivers/soc/xuantie/nna/vha/vha_common.o: in function `_vha_in_merged_sync_cb':
    vha_common.c:(.text+0x58c): undefined reference to `dma_fence_release'
    ...
    ld: vha_common.c:(.text+0x2cbe): undefined reference to `sync_file_create'
    ld: drivers/soc/xuantie/nna/vha/vha_common.o: in function `.L774':
    vha_common.c:(.text+0x2ce8): undefined reference to `dma_fence_add_callback'
    ld: drivers/soc/xuantie/nna/vha/vha_common.o: in function `vha_buf_needs_inval':
    vha_common.c:(.text+0x2ec6): undefined reference to `sync_file_get_fence'
    ld: vha_common.c:(.text+0x2ee6): undefined reference to `dma_fence_add_callback'
    ld: vha_common.c:(.text+0x2f2e): undefined reference to `dma_fence_context_alloc'
    ld: vha_common.c:(.text+0x2f40): undefined reference to `dma_fence_array_create'
    ld: vha_common.c:(.text+0x2f52): undefined reference to `sync_file_create'

Signed-off-by: Yafen Fang <yafen@iscas.ac.cn>
[Sync from rvck.]
Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
mainline inclusion
from mainline-v6.14-rc7
commit b46064a18810bad3aea089a79993ca5ea7a3d2b2
category: feature
bugzilla: RVCK-Project/rvck#75

--------------------------------

It turns out that deferred default domain creation leaves a subtle
race window during iommu_device_register() wherein a client driver may
asynchronously probe in parallel and get as far as performing DMA API
operations with dma-direct, only to be switched to iommu-dma underfoot
once the default domain attachment finally happens, with obviously
disastrous consequences. Even the wonky of_iommu_configure() path is at
risk, since iommu_fwspec_init() will no longer defer client probe as the
instance ops are (necessarily) already registered, and the "replay"
iommu_probe_device() call can see dev->iommu_group already set and so
think there's nothing to do either.

Fortunately we already have the right tool in the right place in the
form of iommu_device_use_default_domain(), which just needs to ensure
that said default domain is actually ready to *be* used. Deferring the
client probe shouldn't have too much impact, given that this only
happens while the IOMMU driver is probing, and thus due to kick the
deferred probe list again once it finishes.

Reported-by: Charan Teja Kalla <quic_charante@quicinc.com>
Fixes: 98ac73f99bc4 ("iommu: Require a default_domain for all iommu drivers")
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Link: https://lore.kernel.org/r/e88b94c9b575034a2c98a48b3d383654cbda7902.1740753261.git.robin.murphy@arm.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
[Backport to rvck.]
Signed-off-by: Gao Rui <gao.rui@zte.com.cn>
[Sync to rvck-olk.]
Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
community inclusion
category: feature
bugzilla: RVCK-Project/rvck#71

-------------------------------------------------

Add PLIC early init supports and remove invalid
timer nodes in dp1000.dts.

Signed-off-by: Jia Wang <wangjia@ultrarisc.com>
Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
community inclusion
category: config
bugzilla: RVCK-Project/rvck#71
Reference:
RVCK-Project/rvck@cc4d46d

-------------------------------------------------

Update UltraRISC platform configs:

CONFIG_ARCH_ULTRARISC=y
CONFIG_PCIE_ULTRARISC=y
CONFIG_DWMAC_ULTRARISC=m
CONFIG_PINCTRL_ULTRARISC=y
CONFIG_PINCTRL_ULTRARISC_DP1000=y
CONFIG_CMA_SIZE_MBYTES=256

Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
This is an empty file created for initiating a PR and testing the pipeline.
@github-actions
Copy link
Copy Markdown


开始测试 log: https://github.com/OERV-RVCI/rvck-olk/actions/runs/23748968414

参数解析结果
args value
repository OERV-RVCI/rvck-olk
head ref pull/13/head
base ref OLK-6.6
LAVA repo RVCK-Project/lavaci
LAVA Template lava-job-template/qemu/qemu-ltp.yaml
Testcase path lava-testcases/common-test/ltp/ltp.yaml
need run job kunit-test,kernel-build,check-patch,lava-trigger

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 30, 2026


开始测试 log: https://github.com/OERV-RVCI/rvck-olk/actions/runs/23748968414

参数解析结果
args value
repository OERV-RVCI/rvck-olk
head ref pull/13/head
base ref OLK-6.6
LAVA repo RVCK-Project/lavaci
LAVA Template lava-job-template/qemu/qemu-ltp.yaml
Testcase path lava-testcases/common-test/ltp/ltp.yaml
need run job kunit-test,kernel-build,check-patch,lava-trigger

测试完成

详细结果:

RVCK result

check result
kunit-test success
kernel-build success
lava-trigger success
check-patch failure

Kunit Test Result

[14:26:07] Testing complete. Ran 454 tests: passed: 442, skipped: 12

Kernel Build Result

Kernel build succeeded: OERV-RVCI/rvck-olk/13__2/

03d4abf07c1df623ed3a84b019484016 /srv/guix_result/b22f52d2067c3052b6ef7ba77257ccf569d90b9d/Image
18cf288384e3ef0d7680b635a4bf1172 /root/initramfs.img

LAVA Check

args:

result:

Lava check done! lava log: https://lava.oerv.ac.cn/scheduler/job/1666

lava result count: [fail]: 20, [pass]: 1586, [skip]: 293

Check Patch Result

Total Errors 1
Total Warnings 0

@wangliu-iscas
Copy link
Copy Markdown

wangliu-iscas commented May 22, 2026

/check


开始测试 log: https://github.com/OERV-RVCI/rvck-olk/actions/runs/26295576042

参数解析结果
args value
repository OERV-RVCI/rvck-olk
head ref pull/13/head
base ref OLK-6.6
LAVA repo RVCK-Project/lavaci
LAVA hardware ['qemu', 'lpi4a', 'sg2042', 'k1']
LAVA Testcase path lava-testcases/common-test/ltp/ltp.yaml
need run job kunit-test,kernel-build,check-patch,lava-trigger

测试完成

详细结果:
check result
kunit-test success
kernel-build success
check-patch failure
lava-trigger-qemu success
lava-trigger-sg2042 failure
lava-trigger-k1 failure
lava-trigger-lpi4a success

Kunit Test Result

[15:10:42] Testing complete. Ran 454 tests: passed: 442, skipped: 12

Kernel Build Result

Check Patch Result

Total Errors 74861
Total Warnings 83965

LAVA Check (qemu)

args value
testcase_repo RVCK-Project/lavaci
lava_template lava-job-template/qemu/qemu-ltp.yaml
testcase_path lava-testcases/common-test/ltp/ltp.yaml
kernel_download_url http://10.30.190.110/openEuler-RISC-V/RVCK/OERV-RVCI/OERV-RVCI/rvck-olk/13_26295576042_1/Image
initramfs_download_url http://10.30.190.110/openEuler-RISC-V/RVCK/OERV-RVCI/OERV-RVCI/rvck-olk/13_26295576042_1/initramfs.img
rootfs_download_url https://fast-mirror.isrc.ac.cn/openeuler-sig-riscv/openEuler-RISC-V/RVCK/openEuler24.03-LTS-SP1/openeuler-rootfs.img.zst
testcase_ref main
testitem_name OERV-RVCI_rvck-olk_issue_comment_13__4519865712_common-test_qemu

result: Lava check done!

LAVA Check (sg2042)

args value
testcase_repo RVCK-Project/lavaci
lava_template lava-job-template/sg2042/sg2042-ltp.yaml
testcase_path lava-testcases/common-test/ltp/ltp.yaml
kernel_download_url http://10.30.190.110/openEuler-RISC-V/RVCK/OERV-RVCI/OERV-RVCI/rvck-olk/13_26295576042_1/Image
initramfs_download_url http://10.30.190.110/openEuler-RISC-V/RVCK/OERV-RVCI/OERV-RVCI/rvck-olk/13_26295576042_1/initramfs.img
rootfs_download_url https://fast-mirror.isrc.ac.cn/openeuler-sig-riscv/openEuler-RISC-V/RVCK/openEuler24.03-LTS-SP1/openeuler-rootfs.tar.gz
testcase_ref main
testitem_name OERV-RVCI_rvck-olk_issue_comment_13__4519865712_common-test_sg2042

result: Lava check fail!

LAVA Check (spacemit-k1-bananapi-f3)

args value
testcase_repo RVCK-Project/lavaci
lava_template lava-job-template/spacemit-k1-bananapi-f3/k1-bpif3-ltp.yaml
testcase_path lava-testcases/common-test/ltp/ltp.yaml
kernel_download_url http://10.30.190.110/openEuler-RISC-V/RVCK/OERV-RVCI/OERV-RVCI/rvck-olk/13_26295576042_1/Image
initramfs_download_url http://10.30.190.110/openEuler-RISC-V/RVCK/OERV-RVCI/OERV-RVCI/rvck-olk/13_26295576042_1/initramfs.img
rootfs_download_url https://fast-mirror.isrc.ac.cn/openeuler-sig-riscv/openEuler-RISC-V/RVCK/openEuler24.03-LTS-SP1/openeuler-rootfs.tar.gz
testcase_ref main
testitem_name OERV-RVCI_rvck-olk_issue_comment_13__4519865712_common-test_spacemit-k1-bananapi-f3

result: Lava check fail!

LAVA Check (lpi4a)

args value
testcase_repo RVCK-Project/lavaci
lava_template lava-job-template/lpi4a/lpi4a-ltp.yaml
testcase_path lava-testcases/common-test/ltp/ltp.yaml
kernel_download_url http://10.30.190.110/openEuler-RISC-V/RVCK/OERV-RVCI/OERV-RVCI/rvck-olk/13_26295576042_1/Image
initramfs_download_url http://10.30.190.110/openEuler-RISC-V/RVCK/OERV-RVCI/OERV-RVCI/rvck-olk/13_26295576042_1/initramfs.img
rootfs_download_url https://fast-mirror.isrc.ac.cn/openeuler-sig-riscv/openEuler-RISC-V/RVCK/openEuler24.03-LTS-SP1/openeuler-rootfs.tar.gz
testcase_ref main
testitem_name OERV-RVCI_rvck-olk_issue_comment_13__4519865712_common-test_lpi4a

result: Lava check done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.