Skip to content

Commit 9ed4f05

Browse files
committed
Merge remote-tracking branch 'stable/linux-6.1.y' into rpi-6.1.y
2 parents 19a1b03 + 6c44e13 commit 9ed4f05

File tree

189 files changed

+1975
-734
lines changed

Some content is hidden

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

189 files changed

+1975
-734
lines changed

Makefile

Lines changed: 1 addition & 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 = 1
4-
SUBLEVEL = 45
4+
SUBLEVEL = 46
55
EXTRAVERSION =
66
NAME = Curry Ramen
77

arch/alpha/kernel/setup.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,8 +385,7 @@ setup_memory(void *kernel_end)
385385
#endif /* CONFIG_BLK_DEV_INITRD */
386386
}
387387

388-
int __init
389-
page_is_ram(unsigned long pfn)
388+
int page_is_ram(unsigned long pfn)
390389
{
391390
struct memclust_struct * cluster;
392391
struct memdesc_struct * memdesc;

arch/loongarch/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ config LOONGARCH
1010
select ARCH_ENABLE_MEMORY_HOTPLUG
1111
select ARCH_ENABLE_MEMORY_HOTREMOVE
1212
select ARCH_HAS_ACPI_TABLE_UPGRADE if ACPI
13-
select ARCH_HAS_CPU_FINALIZE_INIT
1413
select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE
1514
select ARCH_HAS_PTE_SPECIAL
1615
select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST

arch/loongarch/kernel/setup.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
*/
1313
#include <linux/init.h>
1414
#include <linux/acpi.h>
15-
#include <linux/cpu.h>
1615
#include <linux/dmi.h>
1716
#include <linux/efi.h>
1817
#include <linux/export.h>
@@ -81,11 +80,6 @@ const char *get_system_type(void)
8180
return "generic-loongson-machine";
8281
}
8382

84-
void __init arch_cpu_finalize_init(void)
85-
{
86-
alternative_instructions();
87-
}
88-
8983
static const char *dmi_string_parse(const struct dmi_header *dm, u8 s)
9084
{
9185
const u8 *bp = ((u8 *) dm) + dm->length;

arch/riscv/include/asm/mmio.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,9 @@ static inline u64 __raw_readq(const volatile void __iomem *addr)
101101
* Relaxed I/O memory access primitives. These follow the Device memory
102102
* ordering rules but do not guarantee any ordering relative to Normal memory
103103
* accesses. These are defined to order the indicated access (either a read or
104-
* write) with all other I/O memory accesses. Since the platform specification
105-
* defines that all I/O regions are strongly ordered on channel 2, no explicit
106-
* fences are required to enforce this ordering.
104+
* write) with all other I/O memory accesses to the same peripheral. Since the
105+
* platform specification defines that all I/O regions are strongly ordered on
106+
* channel 0, no explicit fences are required to enforce this ordering.
107107
*/
108108
/* FIXME: These are now the same as asm-generic */
109109
#define __io_rbr() do {} while (0)
@@ -125,14 +125,14 @@ static inline u64 __raw_readq(const volatile void __iomem *addr)
125125
#endif
126126

127127
/*
128-
* I/O memory access primitives. Reads are ordered relative to any
129-
* following Normal memory access. Writes are ordered relative to any prior
130-
* Normal memory access. The memory barriers here are necessary as RISC-V
128+
* I/O memory access primitives. Reads are ordered relative to any following
129+
* Normal memory read and delay() loop. Writes are ordered relative to any
130+
* prior Normal memory write. The memory barriers here are necessary as RISC-V
131131
* doesn't define any ordering between the memory space and the I/O space.
132132
*/
133133
#define __io_br() do {} while (0)
134-
#define __io_ar(v) __asm__ __volatile__ ("fence i,r" : : : "memory")
135-
#define __io_bw() __asm__ __volatile__ ("fence w,o" : : : "memory")
134+
#define __io_ar(v) ({ __asm__ __volatile__ ("fence i,ir" : : : "memory"); })
135+
#define __io_bw() ({ __asm__ __volatile__ ("fence w,o" : : : "memory"); })
136136
#define __io_aw() mmiowb_set_pending()
137137

138138
#define readb(c) ({ u8 __v; __io_br(); __v = readb_cpu(c); __io_ar(__v); __v; })

arch/riscv/kernel/elf_kexec.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ static void *elf_kexec_load(struct kimage *image, char *kernel_buf,
281281
kbuf.buffer = initrd;
282282
kbuf.bufsz = kbuf.memsz = initrd_len;
283283
kbuf.buf_align = PAGE_SIZE;
284-
kbuf.top_down = false;
284+
kbuf.top_down = true;
285285
kbuf.mem = KEXEC_BUF_MEM_UNKNOWN;
286286
ret = kexec_add_buffer(&kbuf);
287287
if (ret)
@@ -425,6 +425,7 @@ int arch_kexec_apply_relocations_add(struct purgatory_info *pi,
425425
* sym, instead of searching the whole relsec.
426426
*/
427427
case R_RISCV_PCREL_HI20:
428+
case R_RISCV_CALL_PLT:
428429
case R_RISCV_CALL:
429430
*(u64 *)loc = CLEAN_IMM(UITYPE, *(u64 *)loc) |
430431
ENCODE_UJTYPE_IMM(val - addr);

arch/x86/boot/compressed/idt_64.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,14 @@ void load_stage2_idt(void)
6363
set_idt_entry(X86_TRAP_PF, boot_page_fault);
6464

6565
#ifdef CONFIG_AMD_MEM_ENCRYPT
66-
set_idt_entry(X86_TRAP_VC, boot_stage2_vc);
66+
/*
67+
* Clear the second stage #VC handler in case guest types
68+
* needing #VC have not been detected.
69+
*/
70+
if (sev_status & BIT(1))
71+
set_idt_entry(X86_TRAP_VC, boot_stage2_vc);
72+
else
73+
set_idt_entry(X86_TRAP_VC, NULL);
6774
#endif
6875

6976
load_boot_idt(&boot_idt_desc);

arch/x86/boot/compressed/sev.c

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,21 +354,54 @@ void sev_enable(struct boot_params *bp)
354354
if (bp)
355355
bp->cc_blob_address = 0;
356356

357+
/*
358+
* Do an initial SEV capability check before snp_init() which
359+
* loads the CPUID page and the same checks afterwards are done
360+
* without the hypervisor and are trustworthy.
361+
*
362+
* If the HV fakes SEV support, the guest will crash'n'burn
363+
* which is good enough.
364+
*/
365+
366+
/* Check for the SME/SEV support leaf */
367+
eax = 0x80000000;
368+
ecx = 0;
369+
native_cpuid(&eax, &ebx, &ecx, &edx);
370+
if (eax < 0x8000001f)
371+
return;
372+
373+
/*
374+
* Check for the SME/SEV feature:
375+
* CPUID Fn8000_001F[EAX]
376+
* - Bit 0 - Secure Memory Encryption support
377+
* - Bit 1 - Secure Encrypted Virtualization support
378+
* CPUID Fn8000_001F[EBX]
379+
* - Bits 5:0 - Pagetable bit position used to indicate encryption
380+
*/
381+
eax = 0x8000001f;
382+
ecx = 0;
383+
native_cpuid(&eax, &ebx, &ecx, &edx);
384+
/* Check whether SEV is supported */
385+
if (!(eax & BIT(1)))
386+
return;
387+
357388
/*
358389
* Setup/preliminary detection of SNP. This will be sanity-checked
359390
* against CPUID/MSR values later.
360391
*/
361392
snp = snp_init(bp);
362393

363-
/* Check for the SME/SEV support leaf */
394+
/* Now repeat the checks with the SNP CPUID table. */
395+
396+
/* Recheck the SME/SEV support leaf */
364397
eax = 0x80000000;
365398
ecx = 0;
366399
native_cpuid(&eax, &ebx, &ecx, &edx);
367400
if (eax < 0x8000001f)
368401
return;
369402

370403
/*
371-
* Check for the SME/SEV feature:
404+
* Recheck for the SME/SEV feature:
372405
* CPUID Fn8000_001F[EAX]
373406
* - Bit 0 - Secure Memory Encryption support
374407
* - Bit 1 - Secure Encrypted Virtualization support

arch/x86/entry/vdso/vma.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,8 +322,8 @@ static unsigned long vdso_addr(unsigned long start, unsigned len)
322322

323323
/* Round the lowest possible end address up to a PMD boundary. */
324324
end = (start + len + PMD_SIZE - 1) & PMD_MASK;
325-
if (end >= TASK_SIZE_MAX)
326-
end = TASK_SIZE_MAX;
325+
if (end >= DEFAULT_MAP_WINDOW)
326+
end = DEFAULT_MAP_WINDOW;
327327
end -= len;
328328

329329
if (end > start) {

arch/x86/include/asm/processor.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -867,4 +867,6 @@ bool arch_is_platform_page(u64 paddr);
867867
#define arch_is_platform_page arch_is_platform_page
868868
#endif
869869

870+
extern bool gds_ucode_mitigated(void);
871+
870872
#endif /* _ASM_X86_PROCESSOR_H */

0 commit comments

Comments
 (0)