History

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

Linus Torvalds committed 3 years ago

Commit 82210972 parents 9fdfb15 8eb8fe62 files · +9 −3Browse files

Unified · Split

2 files
  1. arch/riscv/include/asm/errata_list.h +2 −2
  2. arch/riscv/kernel/elf_kexec.c +7 −1
arch/riscv/include/asm/errata_list.h+2−2
@@ -105,7 +105,7 @@ asm volatile(ALTERNATIVE( \ · 104 unmodified lines
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( \ · 6 unmodified lines
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+7−1
@@ -98,7 +98,13 @@ static int elf_find_pbase(struct kimage *image, unsigned long kernel_len, · 97 unmodified lines
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;