Skip to content

Commit 8221097

Browse files
committed
Merge tag 'riscv-for-linus-6.6-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux
Pull RISC-V fixes from Palmer Dabbelt: - A fix to align kexec'd kernels to PMD boundries - The T-Head dcache.cva encoding was incorrect, it has been fixed to invalidate all caches (as opposed to just the L1) * tag 'riscv-for-linus-6.6-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: riscv: errata: fix T-Head dcache.cva encoding riscv: kexec: Align the kexeced kernel entry
2 parents 9fdfb15 + 8eb8fe6 commit 8221097

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

arch/riscv/include/asm/errata_list.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ asm volatile(ALTERNATIVE( \
105105
* | 31 - 25 | 24 - 20 | 19 - 15 | 14 - 12 | 11 - 7 | 6 - 0 |
106106
* 0000001 01001 rs1 000 00000 0001011
107107
* dcache.cva rs1 (clean, virtual address)
108-
* 0000001 00100 rs1 000 00000 0001011
108+
* 0000001 00101 rs1 000 00000 0001011
109109
*
110110
* dcache.cipa rs1 (clean then invalidate, physical address)
111111
* | 31 - 25 | 24 - 20 | 19 - 15 | 14 - 12 | 11 - 7 | 6 - 0 |
@@ -118,7 +118,7 @@ asm volatile(ALTERNATIVE( \
118118
* 0000000 11001 00000 000 00000 0001011
119119
*/
120120
#define THEAD_inval_A0 ".long 0x0265000b"
121-
#define THEAD_clean_A0 ".long 0x0245000b"
121+
#define THEAD_clean_A0 ".long 0x0255000b"
122122
#define THEAD_flush_A0 ".long 0x0275000b"
123123
#define THEAD_SYNC_S ".long 0x0190000b"
124124

arch/riscv/kernel/elf_kexec.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,13 @@ static int elf_find_pbase(struct kimage *image, unsigned long kernel_len,
9898
kbuf.image = image;
9999
kbuf.buf_min = lowest_paddr;
100100
kbuf.buf_max = ULONG_MAX;
101-
kbuf.buf_align = PAGE_SIZE;
101+
102+
/*
103+
* Current riscv boot protocol requires 2MB alignment for
104+
* RV64 and 4MB alignment for RV32
105+
*
106+
*/
107+
kbuf.buf_align = PMD_SIZE;
102108
kbuf.mem = KEXEC_BUF_MEM_UNKNOWN;
103109
kbuf.memsz = ALIGN(kernel_len, PAGE_SIZE);
104110
kbuf.top_down = false;

0 commit comments

Comments
 (0)