泰晓科技 -- 聚焦 Linux - 追本溯源,见微知著!
网站地址:https://tinylab.org

泰晓RISC-V实验箱,转战RISC-V,开箱即用
请稍侯

RISC-V Linux 内核及周边技术动态第 107 期

呀呀呀 创作于 2024/09/03

时间:20240901
编辑:晓瑜
仓库:RISC-V Linux 内核技术调研活动
赞助:PLCT Lab, ISCAS

内核动态

RISC-V 架构支持

v1: perf syscalltbl: Add syscalltbl__id_at_idx() with no syscall table support

This function is expected to be defined when HAVE_BPF_SKEL is defined.

v5: riscv: sophgo: Add pinctrl support for CV1800 series SoC

Add basic pinctrl driver for Sophgo CV1800 series SoCs.

v4: KVM: Register cpuhp/syscore callbacks when enabling virt

Register KVM’s cpuhp and syscore callbacks when enabling virtualization in hardware, as the sole purpose of said callbacks is to disable and re-enable virtualization as needed.

v4: riscv: mm: Add soft-dirty and uffd-wp support

This patchset adds soft dirty and userfaultfd write protect tracking support for RISC-V.

v5: Add SARADC support on Sophgo CV18XX series

This patchset adds initial ADC support for Sophgo CV18XX series SoC.

v1: drivers/perf: riscv: Align errno for unsupported perf type in pmu_sbi_event_map

RISC-V perf driver does not yet support PERF_TYPE_BREAKPOINT.

v1: RISC-V: KVM: Redirect instruction access fault trap to guest

The M-mode redirects an unhandled instruction access fault trap back to S-mode when not delegating it to VS-mode(hedeleg).

v1: Support SSTC while PM operations

When the cpu is going to be hotplug, stop the stimecmp to prevent pending interrupt.

v3: riscv: spacemit: add pinctrl support to K1 SoC

This series adds pinctrl support to SpacemiT’s K1 SoC, the controller uses a single register to describe all pin functions, including bias pull up/down, drive strength, schmitter trigger, slew rate, strong pull-up, mux mode.

v2: riscv: Report error when repeatedly recording CPU hardware ID

Ensure the uniqueness of the CPU hardware ID recorded in the __cpuid_to_hartid_map[] array.

v1: riscv: make ZONE_DMA32 optional

It is not necessary any RISCV platform has ZONE_DMA32.

v3: RISC-V: mm: do not treat hint addr on mmap as the upper bound to search

Previous patch series[1][2] changes a mmap behavior that treats the hint address as the upper bound of the mmap address range.

v12: riscv: sophgo: add dmamux support for Sophgo CV1800/SG2000 SoCs

Add dma multiplexer support for the Sophgo CV1800/SG2000 SoCs.

v1: riscv: mm: Do not restrict mmap address based on hint

There have been a couple of reports that using the hint address to restrict the address returned by mmap hint address has caused issues in applications.

v3: usb drivers use devm_clk_get_enabled() helpers

This simplifies the code and avoids calls to clk_disable_unprepare().

LoongArch 架构支持

v6: LoongArch: Implement getrandom() in vDSO

Implement stack-less ChaCha20 and wire it with the generic vDSO getrandom code.

v8: Add extioi virt extension support

KVM_FEATURE_VIRT_EXTIOI is paravirt feature defined with EXTIOI interrupt controller, it can route interrupt to 256 vCPUs and CPU interrupt pin IP0-IP7.

v5: LoongArch: vDSO: Wire up getrandom() vDSO implementation

Hook up the generic vDSO implementation to the LoongArch vDSO data page by providing the required __arch_chacha20_blocks_nostack, __arch_get_k_vdso_rng_data, and getrandom_syscall implementations.

v2: mm: Introduce MAP_BELOW_HINT

The riscv architecture needs a way to similarly restrict the virtual address space.

v3: uart: Introduce uart driver for the Loongson family chips

This patchset introduce a generic UART framework driver for Loongson family.

ARM 架构支持

v1: arm64: mm: keep low RAM dma zone

Commit ba0fb44aed47 (“dma-mapping: replace zone_dma_bits by zone_dma_limit”) optimistically assumed that device-tree dma-ranges property describes the system DMA limits.

v3: perf: Add Arm Network-on-Chip PMU driver

v5: Add Remoteproc Support for TI’s J722S SoCs

The K3 J722S SoCs have one single-core Arm Cortex-R5F processor in each of the WAKEUP, MCU and MAIN voltage domain, and two C71x DSP subsystems in MAIN voltage domain.

GIT PULL: Versatile SoC changes for v6.12

some nice patches from Krzysztof for v6.12, details in the signed tag.

v2: Support for running as a pKVM protected guest

This is version two of the series previously posted here.

v9: Introduction of a remoteproc tee to load signed firmware

Add support for tee_rproc_release_fw(), which allows releasing firmware that has been loaded.

v2: Revise Meta(Facebook) Harma BMC(AST2600)

Revise linux device tree entry related to Meta(Facebook) Harma specific devices connected to BMC(AST2600) SoC.

v1: Provides support for Trigger Generation Unit

Provide support for the TGU (Trigger Generation Unit).

v1: Do not shatter hugezeropage on wp-fault

It was observed at [1] and [2] that the current kernel behaviour of shattering a hugezeropage is inconsistent and suboptimal.

v14: Add Tegra241 (Grace) CMDQV Support (part 1/2)

NVIDIA’s Tegra241 (Grace) SoC has a CMDQ-Virtualization (CMDQV) hardware that extends standard ARM SMMUv3 to support multiple command queues with virtualization capabilities.

v2: aarch64: vdso: Wire up getrandom() vDSO implementation

Hook up the generic vDSO implementation to the aarch64 vDSO data page. The _vdso_rng_data required data is placed within the _vdso_data vvar page, by using a offset larger than the vdso_data.

v1: resend: mailbox: ARM_MHU_V3 should depend on ARM64

The ARM MHUv3 controller is only present on ARM64 SoCs. Hence add a dependency on ARM64, to prevent asking the user about this driver when configuring a kernel for a different architecture than ARM64.

v5: arm-cs-trace-disasm.py/perf must accommodate non-zero DSO text offset

v3: Add device tree for ArmSoM Sige 5 board

Add the rk3576-armsom-sige5 device tree as well as its rk3576.dtsi base and pinctrl information in rk3576-pinctrl.dtsi.

v1: gpiolib:legacy: Kill GPIOF_DIR_* and GPIOF_INIT_*

Shrink the legacy API and definition surface by killing the (internal) definitions.

v2: TQMa6x / MBa6x DT improvements

this is the 2nd version of the series

v5: Introduce J742S2 SoC and EVM

The series adds support for J742S2 family of SoCs. Also adds J742S2 EVM Support and re-uses most of the stuff from the superset device J784s4.

v1: kbuild: use objcopy to generate asm-offsets

In order to give assembly code access to C structs without having to hardcore member offsets, the kernel compiles a C source file listing all the structs and offsets that are needed in assembly code.

X86 架构支持

v2: platform/x86: wmi: Pass event data directly to legacy notify handlers

The current legacy WMI handlers are susceptible to picking up wrong WMI event data on systems where different WMI devices share some notification IDs.

v1: platform/x86/amd: pmf: Make ASUS GA403 quirk generic

The original quirk should match to GA403U so that the full range of GA403U models can benefit.

v2: CPU offlining with non-core MCA banks

The major change in this revision is to prevent the sysfs interface from being created in the first place for CPUs that shouldn’t be offlined.

v2: mm: Introduce guest_memfd library

In preparation for adding more features to KVM’s guest_memfd, refactor and introduce a library which abstracts some of the core-mm decisions about managing folios associated with the file.

v1: x86/cpu/intel: Replace PAT erratum model/family magic numbers

There’s an erratum that prevents the PAT from working correctly. The kernel currently disables PAT support on those CPUs.

v2: x86/bugs: Add missing NO_SSB flag

The Moorefield and Lightning Mountain Atom processors are missing the NO_SSB flag in the vulnerabilities whitelist. This will cause unaffected parts to incorrectly be reported as vulnerable. Add the missing flag.

v6: Introduce initial AMD I3C HCI driver support

The AMD SoC includes an I3C IP block as part of the Fusion Controller Hub (FCH). This series introduces the initial driver support to enable the I3C IP block on AMD’s latest processors.

v12: arm64/gcs: Provide support for GCS in userspace

The arm64 Guarded Control Stack (GCS) feature provides support for hardware protected stacks of return addresses, intended to provide hardening against return oriented programming (ROP) attacks and to make it easier to gather call stacks for applications such as profiling.

v1: KVM: x86: Ensure vcpu->mode is loaded from memory in kvm_vcpu_exit_request()

Wrap kvm_vcpu_exit_request()’s load of vcpu->mode with READ_ONCE() to ensure the variable is re-loaded from memory, as there is no guarantee the caller provides the necessary annotations to ensure KVM sees a fresh value, e.g. the VM-Exit fastpath could theoretically reuse the pre-VM-Enter value.

v2: Create Intel PMC SSRAM Telemetry driver

This patch series removes the SSRAM support from Intel PMC Core driver and creates a separate PCI driver for SSRAM device.

v1: random: vDSO: assume key is 32-bit aligned on x86_64

The prototype of this function ensures a u32* type for the key, and all uses of it are using state->key, which is a u32 array.

v1: x86/mm/tlb: Correct the comments in flush_tlb_mm_range() and arch_tlbbatch_flush()

Commit 4c1ba3923e6c (“x86/mm/tlb: Unify flush_tlb_func_local() and flush_tlb_func_remote()”) unified flush_tlb_func_local() and flush_tlb_func_remote() into flush_tlb_func().

v1: Introduce New AMD Heterogeneous Core Driver

The AMD Heterogeneous core design and Hardware Feedback Interface (HFI) provide behavioral classification and a dynamically updated ranking table for the scheduler to use when choosing cores for tasks.

进程调度

v1: sched/fair: Rework EAS to handle more cases

The current Energy Aware Scheduler has some known limitations which have became more and more visible with features like uclamp as an example.

v1: sched/syscalls: Allow setting niceness using sched_param struct

From userspace, spawning a new process with, for example, posix_spawn(), only allows the user to work with the scheduling priority value defined by POSIX in the sched_param struct.

v1: sched/fair: Properly deactivate sched_delayed task upon class change

the idea being that since the task has switched classes, we need to drop the sched_delayed logic and have that task be deactivated per its previous dequeue_task(…, DEQUEUE_SLEEP).

v1: -next: sched: Simplify sched_set_rq_online()

Use guards to simplify sched_set_rq_online()

v1: drm/sched: Document drm_sched_job_arm()’s effect on fences

The GPU Scheduler’s job initialization is split into two steps, drm_sched_job_init() and drm_sched_job_arm().

内存管理

v1: -next: Introduce several opposite string choice helpers

Similar to the exists helper: str_enable_disable/ str_enabled_disabled/str_on_off/str_yes_no helpers, we can add the opposite helpers. That’s str_disable_enable, str_disabled_enabled, str_off_on and str_no_yes.

v1: mm: arm64: advance pte for contpte_ptep_set_access_flags

it seems contpte_ptep_set_access_flags() has never advanced pte pfn, and it is setting all entries’ pfn to the first subpage.

v3: Increase mseal test coverage

Add check for vma_size, prot, and error code for existing tests. Add more testcases for madvise, munmap, mmap and mremap to cover sealing in different scenarios.

v3: Wire up getrandom() vDSO implementation on powerpc

This series wires up getrandom() vDSO implementation on powerpc.

v1: mm: mmap: Change DEFAULT_MAX_MAP_COUNT to INT_MAX

Raise default sysctl vm.max_map_count to INT_MAX, which effectively disables the limit for all sane purposes.

v1: mm/memcontrol: add per-memcg pgpgin/pswpin counter

In proactive memory reclamation scenarios, it is necessary to estimate the pswpin and pswpout metrics of the cgroup to determine whether to continue reclaiming anonymous pages in the current batch.

v1: mm,tmpfs: consider end of file write in shmem_is_huge

Take the end of a file write into consideration when deciding whether or not to use huge folios for tmpfs files when the tmpfs filesystem is mounted with huge=within_size

v1: mm, proc: collect percpu free pages into the free pages

The introduction of Per-CPU-Pageset (PCP) per zone aims to enhance the performance of the page allocator by enabling page allocation without requiring the zone lock.

v4: uprobes: RCU-protected hot path optimizations

This patch set is heavily inspired by Peter Zijlstra’s uprobe optimization patches ([0]) and continues that work, albeit trying to keep complexity to the minimum, and attepting to reuse existing primitives as much as possible.

v3: memcg: add charging of already allocated slab objects

At the moment, the slab objects are charged to the memcg at the allocation time.

v7: bpf-next: Harden and extend ELF build ID parsing logic

The goal of this patch set is to extend existing ELF build ID parsing logic, currently mostly used by BPF subsystem, with support for working in sleepable mode in which memory faults are allowed and can be relied upon to fetch relevant parts of ELF file to find and fetch .note.gnu.build-id information.

v1: Add disable_unmap_file arg to memory.reclaim

This patch proposes augmenting the memory.reclaim interface with a disable_unmap_file argument that will skip the mapped pages in that reclaim attempt.

v2: tools/mm: Use calloc and check the memory allocation failure

Replace malloc with calloc and add null pointer check in case of allocation failure.

v1: mm/mglru: wake up flushers when legacy cgroups run out of clean caches

This leads to premature OOM if there are too many dirty pages in cgroup: Killed

v1: tools/mm: Use calloc and check the potential memory allocation failure

Replace malloc with calloc and add memory allocating check of comm_str before used.

文件系统

v5: printk: add threaded printing + the rest

This is v5 of a series to implement threaded console printing as well as some other minor pieces (such as proc and sysfs recognition of nbcon consoles). v4 is here [0].

v3: iomap: flush dirty cache over unwritten mappings on zero range

Here’s v3 of the iomap zero range flush fixes. No real changes here other than comment updates to better explain the flush and stale logic. The latest version of corresponding test support is posted here [1].

v1: fuse: enable writeback cgroup to limit dirty page cache

Commit 3be5a52b30aa(“fuse: support writable mmap”) give a strict limit for about 1% max dirty ratio for fuse to protect that fuse won’t slow down the hole system by hogging lots of dirty memory.

v1: dcache: don’t discard dentry_hashtable or d_hash_shift

The runtime constant feature removes all the users of these variables, allowing the compiler to optimize them away. It’s quite difficult to extract their values from the kernel text, and the memory saved by removing them is tiny, and it was never the point of this optimization.

v3: nfsd: implement the “delstid” draft

The first couple of patches are prep patches from Neil, with some small cleanups. The first patch should probably go to mainline for v6.11 since it fixes a bug.

v14: nfs/nfsd: add support for LOCALIO

I think I addressed all of v13’s very helpful review comments. Special thanks to Neil and Chuck for their time and help!

网络设备

v1: iproute2-next: Add RDMA monitor support

This series from Chiara adds support to a new command to monitor IB events and expands the rdma-sys command to indicate whether this new functionality is supported.

v1: net: napi: Make napi_defer_irqs u32

In commit 6f8b12d661d0 (“net: napi: add hard irqs deferral feature”) napi_defer_irqs was added to net_device and napi_defer_irqs_count was added to napi_struct, both as type int.

v1: -next: atm: nicstar: Use str_enabled_disabled() helper

Use str_enabled_disabled() helper instead of open coding the same.

v1: net-next: net: Convert using devm_clk_get_enabled()/devm_clk_get_optional_enabled()

There are many examples[1][2] of clk resource leakage in LTS. The reason is that developers need to maintain the allocation and release of clk resources themselves, but this will increase the burden on developers.

v24: net-next: Device Memory TCP

[PATCH net 0/n] pull-request: can 2024-08-30

The first patch is by Kuniyuki Iwashima for the CAN BCM protocol that adds a missing proc entry removal when a device unregistered.

v1: net-next: pull-request: can-next 2024-08-30

The first patch is by Duy Nguyen and document the R-Car V4M support in the rcar-canfd DT bindings.

v3: iwl-next: i40e: add ability to reset vf for tx and rx mdd events

In cases when vf sends malformed packets that are classified as malicious, sometimes it causes tx queue to freeze. This frozen queue can be stuck for several minutes being unusable.

v3: can-next: can: rockchip_canfd: add support for CAN-FD IP core found on Rockchip RK3568

This series adds support for the CAN-FD IP core found on the Rockchip RK3568.

v1: net-next: ioam6: improve checks on user data

This patch improves two checks on user data.

v1: ipsec-next: xfrm: Initialise dir in xfrm_hash_rebuild()

The cited commit removed the initialisation of dir in one place too many: it is still used within the loop this patch updates.

v3: net-next: net-timestamp: introduce a flag to filter out rx software report

When one socket is set SOF_TIMESTAMPING_RX_SOFTWARE which means the whole system turns on the netstamp_needed_key button, other sockets that only have SOF_TIMESTAMPING_SOFTWARE will be affected and then print the rx timestamp information even without setting SOF_TIMESTAMPING_RX_SOFTWARE generation flag.

v2: net-next: net: dsa: microchip: rename and clean ksz8 series files

The first KSZ8 series implementation was done for a KSZ8795 device but since several other KSZ8 devices have been added. Rename these files to adhere to the ksz8 naming convention as already used in most functions and the existing ksz8.h; add an explanatory note.

v6: net-next: Add support of HIBMCGE Ethernet Driver

This patch set adds the support of Hisilicon BMC Gigabit Ethernet Driver.

v1: can: kvaser_usb: Simplify with dev_err_probe()

It can simplify the error path and unify a message template.

v1: ieee802154: at86rf230: Simplify with dev_err_probe()

Use dev_err_probe() to simplify the error path and unify a message template.

[PATCH net-next v2 RESEND] net: dsa: Simplify with scoped for each OF child loop

Use scoped for_each_available_child_of_node_scoped() when iterating over device nodes to make code a bit simpler.

v2: -next: net: dsa: Simplify with scoped for each OF child loop

Use scoped for_each_available_child_of_node_scoped() when iterating over device nodes to make code a bit simpler.

v4: net-next: net: Simplified with scoped function

Simplify with scoped for each OF child loop, as well as dev_err_probe().

v1: net-next: r8169: add support for RTL8126A rev.b

Add support for RTL8126A rev.b. Its XID is 0x64a. It is basically based on the one with XID 0x649, but with different firmware file.

安全增强

v1: -next: coccinelle: Add rules to find str_true_false/str_false_true replacements

After str_true_false()/str_false_true() has been introduced in the tree, we can add rules for finding places where str_true_false()/str_false_true() can be used.

v9: Add support for aw96103/aw96105 proximity sensor

Add drivers that support Awinic aw96103/aw96105 proximity sensors.

v3: -next: Add str_true_false()/str_false_true() helper

Add str_true_false()/str_false_true() helper to “true” or “false” string literal. And we found more than 10 cases currently exist in the tree. So these helpers can be used for these cases.

异步 IO

v1: io_uring/kbuf: return correct iovec count from classic buffer peek

io_provided_buffers_select() returns 0 to indicate success, but it should be returning 1 to indicate that 1 vec was mapped.

Rust For Linux

v1: block, rust: simplify validate_block_size() function

Using range and contains() method is just fancy shmancy way of writing two comparisons which IMO is less readable.

v7: rust: support for shadow call stack sanitizer

Add all of the flags that are needed to support the shadow call stack (SCS) sanitizer with Rust, and updates Kconfig to allow only configurations that work.

v2: scripts/checkpatch.pl: check for non-permalinks to Zulip

Zulip links to https://rust-for-linux.zulipchat.com can break in case of renaming the topic or channel if they are not message links (which are permanent links).

v1: Retiring from the Rust for Linux project

This is as short a series as one can be: just removing myself as maintainer of the Rust for Linux project.

v1: rust: Provide correct provenance when constructing THIS_MODULE

Currently while defining THIS_MODULE symbol in module!(), the pointer used to contruct ThisModule is derived from an immutable reference of __this_module, which means the pointer doesn’t have the provenance for writting, and that means any write to that pointer is UB regardless of data races or not.

v8: net-next: net: phy: add Applied Micro QT2025 PHY driver

This patchset adds a PHY driver for Applied Micro Circuits Corporation QT2025.

v1: rust: allow stable_features lint

Support for several Rust compiler versions started in commit 63b27f4a0074 (“rust: start supporting several compiler versions”).

v2: rust: add global lock support

Due to the initialization requirement, constructing a global mutex is unsafe with the current approach.

BPF

v1: bpf-next: bpf: cpumap: enable GRO for XDP_PASS frames

Recently, I’ve been looking through my old XDP hints tree[0] to check whether some patches not directly related to hints can be sent standalone.

v1: bpf-next: libbpf: ensure new BTF objects inherit input endianness

The pahole master branch recently added support for “distilled BTF” based on libbpf v1.5, but may add .BTF and .BTF.base sections with the wrong byte order (e.g. on s390x BPF CI), which then lead to kernel Oops when loaded.

[PATCH bpf-next RESEND] bpf: Use sockfd_put() helper

Replace fput() with sockfd_put() in bpf_fd_reuseport_array_update_elem().

[PATCH bpf-next RESEND] bpf: Use sockfd_put() helper

Replace fput() with sockfd_put() in bpf_fd_reuseport_array_update_elem().

v5: bpf-next: bpf: Add gen_epilogue to bpf_verifier_ops

This set allows the subsystem to patch codes before BPF_EXIT.

v1: bpf-next: bpf, sockmap: Correct spelling skmsg.c

Correct spelling in skmsg.c. As reported by codespell.

v1: -next: bpf: Use sockfd_put() helper

Replace fput() with sockfd_put() in bpf_fd_reuseport_array_update_elem().

v2: net-next: Unmask upper DSCP bits - part 2

tl;dr - This patchset continues to unmask the upper DSCP bits in the IPv4 flow key in preparation for allowing IPv4 FIB rules to match on DSCP.

v23: net-next: Device Memory TCP

v1: bpf: Add missing force_checksrc macro

According to the documentation, when building a kernel with the C=2 parameter, all source files should be checked. But this does not happen for the kernel/bpf/ directory.

v6: Faultable Tracepoints

Wire up the system call tracepoints with Tasks Trace RCU to allow the ftrace, perf, and eBPF tracers to handle page faults.

v2: bpf-next: bpf/btf: Use kvmemdup to simplify the code

Use kvmemdup instead of kvmalloc() + memcpy() to simplify the code.

v8: Improve the copy of task comm

Using {memcpy,strncpy,strcpy,kstrdup} to copy the task comm relies on the length of task comm. Changes in the task comm could result in a destination string that is overflow. Therefore, we should explicitly ensure the destination string is always NUL-terminated, regardless of the task comm. This approach will facilitate future extensions to the task comm.

v1: bpf-next: samples/bpf: tracex2: Replace kfree_skb from kprobe to tracepoint

In commit ba8de796baf4 (“net: introduce sk_skb_reason_drop function”) kfree_skb_reason() becomes an inline function and cannot be traced.

周边技术动态

Qemu

v13: riscv support for control flow integrity extensions

v13 for riscv zicfilp and zicfiss extensions support in qemu.

v12: riscv support for control flow integrity extensions

v12 for riscv zicfilp and zicfiss extensions support in qemu.

v1: target/riscv: Stop timer with infinite timecmp

While the spec doesn’t state it, setting timecmp to UINT64_MAX is another way to stop a timer, as it’s considered setting the next timer event to occur at infinity.

v11: riscv support for control flow integrity extensions

v11 for riscv zicfilp and zicfiss extensions support in qemu.

v4: bsd-user: Comprehensive RISCV Support

Key Changes Compared to Version 3: Minor comment changes and all the patches have been reviewed by Richard Henderson richard.henderson@linaro.org

v3: target: riscv: Add Svvptc extension support

The Svvptc extension describes a uarch that does not cache invalid TLB entries: that’s the case for qemu so there is nothing particular to implement other than the introduction of this extension.

v10: riscv support for control flow integrity extensions

v10 for riscv zicfilp and zicfiss extensions support in qemu.

v4: RISC-V: Add preliminary textra trigger CSR functions

This series support to write MHVALUE and MHSELECT fields into textra32 and textra64 trigger CSRs.

v1: target/riscv/tcg/tcg-cpu.c: consider MISA bit choice in implied rule

The user explicitly disabled F and the error message mentions a conflict with Zfinx and F.

v4: Make LMB memory map global and persistent

This is a follow-up from an earlier RFC series [1] for making the LMB and EFI memory allocations work together. This is a non-rfc version with only the LMB part of the patches, for making the LMB memory map global and persistent.



Read Album:

Read Related:

Read Latest: