Skip to content

Commit 4dc155e

Browse files
committed
Merge tag 'v6.12.96' into JH7110_VisionFive2_6.12.y_stable
This is the 6.12.96 stable release
2 parents cb86416 + 6d15a10 commit 4dc155e

327 files changed

Lines changed: 3344 additions & 1631 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Documentation/crypto/userspace-if.rst

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -328,33 +328,10 @@ CRYPTO_USER_API_RNG_CAVP option:
328328
Zero-Copy Interface
329329
-------------------
330330

331-
In addition to the send/write/read/recv system call family, the AF_ALG
332-
interface can be accessed with the zero-copy interface of
333-
splice/vmsplice. As the name indicates, the kernel tries to avoid a copy
334-
operation into kernel space.
335-
336-
The zero-copy operation requires data to be aligned at the page
337-
boundary. Non-aligned data can be used as well, but may require more
338-
operations of the kernel which would defeat the speed gains obtained
339-
from the zero-copy interface.
340-
341-
The system-inherent limit for the size of one zero-copy operation is 16
342-
pages. If more data is to be sent to AF_ALG, user space must slice the
343-
input into segments with a maximum size of 16 pages.
344-
345-
Zero-copy can be used with the following code example (a complete
346-
working example is provided with libkcapi):
347-
348-
::
349-
350-
int pipes[2];
351-
352-
pipe(pipes);
353-
/* input data in iov */
354-
vmsplice(pipes[1], iov, iovlen, SPLICE_F_GIFT);
355-
/* opfd is the file descriptor returned from accept() system call */
356-
splice(pipes[0], NULL, opfd, NULL, ret, 0);
357-
read(opfd, out, outlen);
331+
AF_ALG used to have zero-copy support, but it was removed due to it being a
332+
frequent source of vulnerabilities. For backwards compatibility the splice()
333+
and sendfile() system calls are still supported, but the kernel will make an
334+
internal copy of the data before passing it to the crypto code.
358335

359336

360337
Setsockopt Interface

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-License-Identifier: GPL-2.0
22
VERSION = 6
33
PATCHLEVEL = 12
4-
SUBLEVEL = 95
4+
SUBLEVEL = 96
55
EXTRAVERSION =
66
NAME = Baby Opossum Posse
77

@@ -851,6 +851,9 @@ KBUILD_RUSTFLAGS += $(KBUILD_RUSTFLAGS-y)
851851
ifdef CONFIG_FRAME_POINTER
852852
KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls
853853
KBUILD_RUSTFLAGS += -Cforce-frame-pointers=y
854+
# Work around rustc bug on compilers without
855+
# https://github.com/rust-lang/rust/pull/156980.
856+
KBUILD_RUSTFLAGS += $(if $(call rustc-min-version,109800),,-Zllvm_module_flag=frame-pointer:u32:2:max)
854857
else
855858
# Some targets (ARM with Thumb2, for example), can't be built with frame
856859
# pointers. For those, we don't have FUNCTION_TRACER automatically

arch/arm64/kernel/entry-fpsimd.S

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,13 @@ SYM_FUNC_END(sme_set_vq)
103103
* Save the ZA and ZT state
104104
*
105105
* x0 - pointer to buffer for state
106-
* x1 - number of ZT registers to save
106+
* w1 - number of ZT registers to save
107107
*/
108108
SYM_FUNC_START(sme_save_state)
109109
_sme_rdsvl 2, 1 // x2 = VL/8
110110
sme_save_za 0, x2, 12 // Leaves x0 pointing to the end of ZA
111111

112-
cbz x1, 1f
112+
cbz w1, 1f
113113
_str_zt 0
114114
1:
115115
ret
@@ -119,13 +119,13 @@ SYM_FUNC_END(sme_save_state)
119119
* Load the ZA and ZT state
120120
*
121121
* x0 - pointer to buffer for state
122-
* x1 - number of ZT registers to save
122+
* w1 - number of ZT registers to save
123123
*/
124124
SYM_FUNC_START(sme_load_state)
125125
_sme_rdsvl 2, 1 // x2 = VL/8
126126
sme_load_za 0, x2, 12 // Leaves x0 pointing to the end of ZA
127127

128-
cbz x1, 1f
128+
cbz w1, 1f
129129
_ldr_zt 0
130130
1:
131131
ret

arch/arm64/lib/insn.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,8 @@ u32 aarch64_insn_gen_cond_branch_imm(unsigned long pc, unsigned long addr,
338338
long offset;
339339

340340
offset = label_imm_common(pc, addr, SZ_1M);
341+
if (offset >= SZ_1M)
342+
return AARCH64_BREAK_FAULT;
341343

342344
insn = aarch64_insn_get_bcond_value();
343345

arch/loongarch/include/asm/acpi.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ static inline bool acpi_has_cpu_in_madt(void)
3838
extern struct list_head acpi_wakeup_device_list;
3939
extern struct acpi_madt_core_pic acpi_core_pic[MAX_CORE_PIC];
4040

41+
extern void acpi_add_early_pio(void);
42+
extern void acpi_remove_early_pio(void);
4143
extern int __init parse_acpi_topology(void);
4244

4345
static inline u32 get_acpi_id_for_cpu(unsigned int cpu)

arch/loongarch/kernel/acpi.c

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include <linux/memblock.h>
1616
#include <linux/of_fdt.h>
1717
#include <linux/serial_core.h>
18+
#include <linux/vmalloc.h>
1819
#include <asm/io.h>
1920
#include <asm/numa.h>
2021
#include <asm/loongson.h>
@@ -58,6 +59,33 @@ void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size)
5859
return ioremap_cache(phys, size);
5960
}
6061

62+
#define PIO_BASE (unsigned long)PCI_IOBASE
63+
#define PIO_SIZE ALIGN(ISA_IOSIZE, PAGE_SIZE)
64+
65+
static bool acpi_pio;
66+
67+
/* Add PIO for early access */
68+
void acpi_add_early_pio(void)
69+
{
70+
if (!acpi_disabled) {
71+
acpi_pio = true;
72+
vmap_page_range(PIO_BASE, PIO_BASE + PIO_SIZE,
73+
LOONGSON_LIO_BASE, pgprot_device(PAGE_KERNEL));
74+
}
75+
}
76+
77+
/* Remove PIO for PCI register */
78+
void acpi_remove_early_pio(void)
79+
{
80+
if (!acpi_pio)
81+
return;
82+
83+
if (!acpi_disabled) {
84+
acpi_pio = false;
85+
vunmap_range(PIO_BASE, PIO_BASE + PIO_SIZE);
86+
}
87+
}
88+
6189
#ifdef CONFIG_SMP
6290
static int set_processor_mask(u32 id, u32 pass)
6391
{

arch/loongarch/kernel/setup.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,8 @@ static __init int arch_reserve_pio_range(void)
510510
{
511511
struct device_node *np;
512512

513+
acpi_add_early_pio();
514+
513515
for_each_node_by_name(np, "isa") {
514516
struct of_range range;
515517
struct of_range_parser parser;

arch/loongarch/pci/acpi.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ static int acpi_prepare_root_resources(struct acpi_pci_root_info *ci)
6565
struct resource_entry *entry, *tmp;
6666
struct acpi_device *device = ci->bridge;
6767

68+
acpi_remove_early_pio();
69+
6870
status = acpi_pci_probe_root_resources(ci);
6971
if (status > 0) {
7072
acpi_evaluate_integer(device->handle, "PCIH", NULL, &pci_h);

arch/riscv/kernel/entry.S

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,11 @@
7474
/* Atomically reset the current cpu bit in new_vmalloc */
7575
amoxor.d a0, a1, (a0)
7676

77-
/* Only emit a sfence.vma if the uarch caches invalid entries */
78-
ALTERNATIVE("sfence.vma", "nop", 0, RISCV_ISA_EXT_SVVPTC, 1)
77+
/*
78+
* A sfence.vma is required here. Even if we had Svvptc, there's no
79+
* guarantee that after returning we wouldn't just fault again.
80+
*/
81+
sfence.vma
7982

8083
REG_L a0, TASK_TI_A0(tp)
8184
REG_L a1, TASK_TI_A1(tp)

arch/x86/kernel/cpu/resctrl/monitor.c

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -338,14 +338,20 @@ int resctrl_arch_rmid_read(struct rdt_resource *r, struct rdt_mon_domain *d,
338338
u64 *val, void *ignored)
339339
{
340340
struct rdt_hw_mon_domain *hw_dom = resctrl_to_arch_mon_dom(d);
341-
int cpu = cpumask_any(&d->hdr.cpu_mask);
342341
struct arch_mbm_state *am;
343342
u64 msr_val;
344343
u32 prmid;
344+
int cpu;
345345
int ret;
346346

347347
resctrl_arch_rmid_read_context_check();
348348

349+
if (cpumask_empty(&d->hdr.cpu_mask)) {
350+
pr_warn_once("Domain %d has no CPUs\n", d->hdr.id);
351+
return -EINVAL;
352+
}
353+
354+
cpu = cpumask_any(&d->hdr.cpu_mask);
349355
prmid = logical_rmid_to_physical_rmid(cpu, rmid);
350356
ret = __rmid_read_phys(prmid, eventid, &msr_val);
351357

@@ -382,9 +388,9 @@ void __check_limbo(struct rdt_mon_domain *d, bool force_free)
382388
struct rdt_resource *r = &rdt_resources_all[RDT_RESOURCE_L3].r_resctrl;
383389
u32 idx_limit = resctrl_arch_system_num_rmid_idx();
384390
struct rmid_entry *entry;
391+
bool rmid_dirty = true;
385392
u32 idx, cur_idx = 1;
386393
void *arch_mon_ctx;
387-
bool rmid_dirty;
388394
u64 val = 0;
389395

390396
arch_mon_ctx = resctrl_arch_mon_ctx_alloc(r, QOS_L3_OCCUP_EVENT_ID);
@@ -406,22 +412,27 @@ void __check_limbo(struct rdt_mon_domain *d, bool force_free)
406412
break;
407413

408414
entry = __rmid_entry(idx);
409-
if (resctrl_arch_rmid_read(r, d, entry->closid, entry->rmid,
410-
QOS_L3_OCCUP_EVENT_ID, &val,
411-
arch_mon_ctx)) {
412-
rmid_dirty = true;
413-
} else {
414-
rmid_dirty = (val >= resctrl_rmid_realloc_threshold);
415-
416-
/*
417-
* x86's CLOSID and RMID are independent numbers, so the entry's
418-
* CLOSID is an empty CLOSID (X86_RESCTRL_EMPTY_CLOSID). On Arm the
419-
* RMID (PMG) extends the CLOSID (PARTID) space with bits that aren't
420-
* used to select the configuration. It is thus necessary to track both
421-
* CLOSID and RMID because there may be dependencies between them
422-
* on some architectures.
423-
*/
424-
trace_mon_llc_occupancy_limbo(entry->closid, entry->rmid, d->hdr.id, val);
415+
if (!force_free) {
416+
if (resctrl_arch_rmid_read(r, d, entry->closid,
417+
entry->rmid, QOS_L3_OCCUP_EVENT_ID,
418+
&val, arch_mon_ctx)) {
419+
rmid_dirty = true;
420+
} else {
421+
rmid_dirty = (val >= resctrl_rmid_realloc_threshold);
422+
423+
/*
424+
* x86's CLOSID and RMID are independent numbers,
425+
* so the entry's CLOSID is an empty CLOSID
426+
* (X86_RESCTRL_EMPTY_CLOSID). On Arm the RMID
427+
* (PMG) extends the CLOSID (PARTID) space with
428+
* bits that aren't used to select the configuration.
429+
* It is thus necessary to track both CLOSID and
430+
* RMID because there may be dependencies between
431+
* them on some architectures.
432+
*/
433+
trace_mon_llc_occupancy_limbo(entry->closid, entry->rmid,
434+
d->hdr.id, val);
435+
}
425436
}
426437

427438
if (force_free || !rmid_dirty) {

0 commit comments

Comments
 (0)