mirror of
https://github.com/torvalds/linux.git
synced 2026-10-07 02:56:02 +02:00
Add support for the srmcfg CSR defined in the Ssqosid ISA extension. The CSR contains two fields: - Resource Control ID (RCID) for resource allocation - Monitoring Counter ID (MCID) for tracking resource usage Requests from a hart to shared resources are tagged with these IDs, allowing resource usage to be associated with the running task. Add a srmcfg field to thread_struct with the same format as the CSR. The context-switch path writes the field to the CSR, and resctrl_arch_set_closid_rmid() updates it when a task is assigned to a resctrl control or monitoring group. A per-cpu cpu_srmcfg_default holds the default srmcfg for each CPU, set by resctrl_arch_set_cpu_default_closid_rmid() on CPU group assignment. On context switch, RCID and MCID inherit from the CPU default independently: a task whose thread RCID field is zero takes the CPU default's RCID, and likewise for MCID. A per-cpu cpu_srmcfg variable mirrors the CSR state to avoid redundant writes. L1D-hot memory access is faster than a CSR read and avoids traps under virtualization. Link: https://github.com/riscv/riscv-ssqosid/releases/tag/v1.0 Assisted-by: Claude:claude-opus-4-7 Co-developed-by: Kornel Dulęba <mindal@semihalf.com> Signed-off-by: Kornel Dulęba <mindal@semihalf.com> Signed-off-by: Drew Fustini <fustini@kernel.org> Link: https://patch.msgid.link/20260729-dfustini-atl-sc-cbqri-dt-v6-3-7c22b05d461b@kernel.org Signed-off-by: Paul Walmsley <pjw@kernel.org>
133 lines
3.8 KiB
Makefile
133 lines
3.8 KiB
Makefile
# SPDX-License-Identifier: GPL-2.0-only
|
|
#
|
|
# Makefile for the RISC-V Linux kernel
|
|
#
|
|
|
|
CFLAGS_syscall_table.o += $(call cc-disable-warning, override-init)
|
|
CFLAGS_compat_syscall_table.o += $(call cc-disable-warning, override-init)
|
|
|
|
ifdef CONFIG_KEXEC_CORE
|
|
AFLAGS_kexec_relocate.o := -mcmodel=medany $(call cc-option,-mno-relax)
|
|
endif
|
|
|
|
# cmodel=medany and notrace when patching early
|
|
ifdef CONFIG_RISCV_ALTERNATIVE_EARLY
|
|
CFLAGS_alternative.o := -mcmodel=medany
|
|
CFLAGS_cpufeature.o := -mcmodel=medany
|
|
CFLAGS_sbi_ecall.o := -mcmodel=medany
|
|
ifdef CONFIG_FTRACE
|
|
CFLAGS_REMOVE_alternative.o = $(CC_FLAGS_FTRACE)
|
|
CFLAGS_REMOVE_cpufeature.o = $(CC_FLAGS_FTRACE)
|
|
endif
|
|
ifdef CONFIG_RELOCATABLE
|
|
CFLAGS_alternative.o += -fno-pie
|
|
CFLAGS_cpufeature.o += -fno-pie
|
|
CFLAGS_sbi_ecall.o += -fno-pie
|
|
endif
|
|
ifdef CONFIG_KASAN
|
|
KASAN_SANITIZE_alternative.o := n
|
|
KASAN_SANITIZE_cpufeature.o := n
|
|
KASAN_SANITIZE_sbi_ecall.o := n
|
|
endif
|
|
ifdef CONFIG_FORTIFY_SOURCE
|
|
CFLAGS_alternative.o += -D__NO_FORTIFY
|
|
CFLAGS_cpufeature.o += -D__NO_FORTIFY
|
|
CFLAGS_sbi_ecall.o += -D__NO_FORTIFY
|
|
endif
|
|
endif
|
|
|
|
ifdef CONFIG_FTRACE
|
|
CFLAGS_REMOVE_ftrace.o = $(CC_FLAGS_FTRACE)
|
|
CFLAGS_REMOVE_patch.o = $(CC_FLAGS_FTRACE)
|
|
CFLAGS_REMOVE_sbi.o = $(CC_FLAGS_FTRACE)
|
|
CFLAGS_REMOVE_return_address.o = $(CC_FLAGS_FTRACE)
|
|
CFLAGS_REMOVE_sbi_ecall.o = $(CC_FLAGS_FTRACE)
|
|
endif
|
|
|
|
always-$(KBUILD_BUILTIN) += vmlinux.lds
|
|
|
|
obj-y += head.o
|
|
obj-y += soc.o
|
|
obj-$(CONFIG_RISCV_ALTERNATIVE) += alternative.o
|
|
obj-y += cpu.o
|
|
obj-y += cpufeature.o
|
|
obj-y += entry.o
|
|
obj-y += irq.o
|
|
obj-y += process.o
|
|
obj-y += ptrace.o
|
|
obj-y += reset.o
|
|
obj-y += return_address.o
|
|
obj-y += setup.o
|
|
obj-y += signal.o
|
|
obj-y += syscall_table.o
|
|
obj-y += sys_riscv.o
|
|
obj-y += sys_hwprobe.o
|
|
obj-y += time.o
|
|
obj-y += traps.o
|
|
obj-y += riscv_ksyms.o
|
|
obj-y += stacktrace.o
|
|
obj-y += cacheinfo.o
|
|
obj-y += patch.o
|
|
obj-y += vendor_extensions.o
|
|
obj-y += vendor_extensions/
|
|
obj-y += probes/
|
|
obj-y += tests/
|
|
obj-$(CONFIG_MMU) += vdso.o vdso/
|
|
obj-$(CONFIG_RISCV_USER_CFI) += vdso_cfi/
|
|
|
|
obj-$(CONFIG_RISCV_MISALIGNED) += traps_misaligned.o
|
|
obj-$(CONFIG_RISCV_MISALIGNED) += unaligned_access_speed.o
|
|
obj-$(CONFIG_RISCV_PROBE_UNALIGNED_ACCESS) += copy-unaligned.o
|
|
obj-$(CONFIG_RISCV_PROBE_VECTOR_UNALIGNED_ACCESS) += vec-copy-unaligned.o
|
|
|
|
obj-$(CONFIG_FPU) += fpu.o
|
|
obj-$(CONFIG_FPU) += kernel_mode_fpu.o
|
|
obj-$(CONFIG_RISCV_ISA_V) += vector.o
|
|
obj-$(CONFIG_RISCV_ISA_V) += kernel_mode_vector.o
|
|
obj-$(CONFIG_SMP) += smpboot.o
|
|
obj-$(CONFIG_SMP) += smp.o
|
|
obj-$(CONFIG_SMP) += cpu_ops.o
|
|
|
|
obj-$(CONFIG_RISCV_BOOT_SPINWAIT) += cpu_ops_spinwait.o
|
|
obj-$(CONFIG_MODULES) += module.o
|
|
obj-$(CONFIG_MODULE_SECTIONS) += module-sections.o
|
|
|
|
obj-$(CONFIG_CPU_PM) += suspend_entry.o suspend.o
|
|
obj-$(CONFIG_HIBERNATION) += hibernate.o hibernate-asm.o
|
|
|
|
obj-$(CONFIG_FUNCTION_TRACER) += mcount.o ftrace.o
|
|
obj-$(CONFIG_DYNAMIC_FTRACE) += mcount-dyn.o
|
|
|
|
obj-$(CONFIG_PERF_EVENTS) += perf_callchain.o
|
|
obj-$(CONFIG_HAVE_PERF_REGS) += perf_regs.o
|
|
obj-$(CONFIG_RISCV_SBI) += sbi.o sbi_ecall.o
|
|
ifeq ($(CONFIG_RISCV_SBI), y)
|
|
obj-$(CONFIG_SMP) += sbi-ipi.o
|
|
obj-$(CONFIG_SMP) += cpu_ops_sbi.o
|
|
endif
|
|
obj-$(CONFIG_HOTPLUG_CPU) += cpu-hotplug.o
|
|
obj-$(CONFIG_PARAVIRT) += paravirt.o
|
|
obj-$(CONFIG_KGDB) += kgdb.o
|
|
obj-$(CONFIG_KEXEC_CORE) += kexec_relocate.o crash_save_regs.o machine_kexec.o
|
|
obj-$(CONFIG_KEXEC_FILE) += kexec_elf.o kexec_image.o machine_kexec_file.o
|
|
obj-$(CONFIG_CRASH_DUMP) += crash_dump.o
|
|
obj-$(CONFIG_VMCORE_INFO) += vmcore_info.o
|
|
|
|
obj-$(CONFIG_JUMP_LABEL) += jump_label.o
|
|
|
|
obj-$(CONFIG_CFI) += cfi.o
|
|
|
|
obj-$(CONFIG_EFI) += efi.o
|
|
obj-$(CONFIG_COMPAT) += compat_syscall_table.o
|
|
obj-$(CONFIG_COMPAT) += compat_signal.o
|
|
obj-$(CONFIG_COMPAT) += compat_vdso/
|
|
|
|
obj-$(CONFIG_64BIT) += pi/
|
|
obj-$(CONFIG_ACPI) += acpi.o
|
|
obj-$(CONFIG_ACPI_NUMA) += acpi_numa.o
|
|
|
|
obj-$(CONFIG_GENERIC_CPU_VULNERABILITIES) += bugs.o
|
|
obj-$(CONFIG_RISCV_USER_CFI) += usercfi.o
|
|
|
|
obj-$(CONFIG_RISCV_ISA_SSQOSID) += qos.o
|