<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/riscv/kernel/head.S, branch linux-5.5.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.5.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.5.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2020-03-21T07:15:41Z</updated>
<entry>
<title>riscv: set pmp configuration if kernel is running in M-mode</title>
<updated>2020-03-21T07:15:41Z</updated>
<author>
<name>Greentime Hu</name>
</author>
<published>2020-01-09T03:17:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=518c7d6fc19293181cbb23579728d1c1ab1022ad'/>
<id>urn:sha1:518c7d6fc19293181cbb23579728d1c1ab1022ad</id>
<content type='text'>
[ Upstream commit c68a9032299e837b56d356de9250c93094f7e0e3 ]

When the kernel is running in S-mode, the expectation is that the
bootloader or SBI layer will configure the PMP to allow the kernel to
access physical memory.  But, when the kernel is running in M-mode and is
started with the ELF "loader", there's probably no bootloader or SBI layer
involved to configure the PMP.  Thus, we need to configure the PMP
ourselves to enable the kernel to access all regions.

Signed-off-by: Greentime Hu &lt;greentime.hu@sifive.com&gt;
Reviewed-by: Palmer Dabbelt &lt;palmerdabbelt@google.com&gt;
Signed-off-by: Palmer Dabbelt &lt;palmerdabbelt@google.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>riscv: make sure the cores stay looping in .Lsecondary_park</title>
<updated>2020-01-16T02:07:54Z</updated>
<author>
<name>Greentime Hu</name>
</author>
<published>2020-01-15T06:54:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=20d2292754e72e445abe62b7ac453eb945fc626c'/>
<id>urn:sha1:20d2292754e72e445abe62b7ac453eb945fc626c</id>
<content type='text'>
The code in secondary_park is currently placed in the .init section. The
kernel reclaims and clears this code when it finishes booting. That
causes the cores parked in it to go to somewhere unpredictable, so we
move this function out of init to make sure the cores stay looping there.

The instruction bgeu a0, t0, .Lsecondary_park may have "a relocation
truncated to fit" issue during linking time. It is because that sections
are too far to jump. Let's use tail to jump to the .Lsecondary_park.

Signed-off-by: Greentime Hu &lt;greentime.hu@sifive.com&gt;
Reviewed-by: Anup Patel &lt;anup.patel@sifive.com&gt;
Cc: Andreas Schwab &lt;schwab@suse.de&gt;
Cc: stable@vger.kernel.org
Fixes: 76d2a0493a17d ("RISC-V: Init and Halt Code")
Signed-off-by: Paul Walmsley &lt;paul.walmsley@sifive.com&gt;</content>
</entry>
<entry>
<title>riscv: Fixup obvious bug for fp-regs reset</title>
<updated>2020-01-12T18:12:44Z</updated>
<author>
<name>Guo Ren</name>
</author>
<published>2020-01-05T02:52:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=dc6fcba72f0435b7884f2e92fd634bb9f78a2c60'/>
<id>urn:sha1:dc6fcba72f0435b7884f2e92fd634bb9f78a2c60</id>
<content type='text'>
CSR_MISA is defined in Privileged Architectures' spec: 3.1.1 Machine
ISA Register misa. Every bit:1 indicate a feature, so we should beqz
reset_done when there is no F/D bit in csr_misa register.

Signed-off-by: Guo Ren &lt;ren_guo@c-sky.com&gt;
[paul.walmsley@sifive.com: fix typo in commit message]
Fixes: 9e80635619b51 ("riscv: clear the instruction cache and all registers when booting")
Signed-off-by: Paul Walmsley &lt;paul.walmsley@sifive.com&gt;</content>
</entry>
<entry>
<title>riscv: fix scratch register clearing in M-mode.</title>
<updated>2019-12-20T11:32:24Z</updated>
<author>
<name>Greentime Hu</name>
</author>
<published>2019-12-19T06:44:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d411cf02ed0260dacc4b2fd61dd5040fc2aa97e7'/>
<id>urn:sha1:d411cf02ed0260dacc4b2fd61dd5040fc2aa97e7</id>
<content type='text'>
This patch fixes that the sscratch register clearing in M-mode. It cleared
sscratch register in M-mode, but it should clear mscratch register. That will
cause kernel trap if the CPU core doesn't support S-mode when trying to access
sscratch.

Fixes: 9e80635619b5 ("riscv: clear the instruction cache and all registers when booting")
Signed-off-by: Greentime Hu &lt;greentime.hu@sifive.com&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
Signed-off-by: Paul Walmsley &lt;paul.walmsley@sifive.com&gt;</content>
</entry>
<entry>
<title>riscv: add nommu support</title>
<updated>2019-11-17T23:17:39Z</updated>
<author>
<name>Christoph Hellwig</name>
</author>
<published>2019-10-28T12:10:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6bd33e1ece528f67646db33bf97406b747dafda0'/>
<id>urn:sha1:6bd33e1ece528f67646db33bf97406b747dafda0</id>
<content type='text'>
The kernel runs in M-mode without using page tables, and thus can't run
bare metal without help from additional firmware.

Most of the patch is just stubbing out code not needed without page
tables, but there is an interesting detail in the signals implementation:

 - The normal RISC-V syscall ABI only implements rt_sigreturn as VDSO
   entry point, but the ELF VDSO is not supported for nommu Linux.
   We instead copy the code to call the syscall onto the stack.

In addition to enabling the nommu code a new defconfig for a small
kernel image that can run in nommu mode on qemu is also provided, to run
a kernel in qemu you can use the following command line:

qemu-system-riscv64 -smp 2 -m 64 -machine virt -nographic \
	-kernel arch/riscv/boot/loader \
	-drive file=rootfs.ext2,format=raw,id=hd0 \
	-device virtio-blk-device,drive=hd0

Contains contributions from Damien Le Moal &lt;Damien.LeMoal@wdc.com&gt;.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
[paul.walmsley@sifive.com: updated to apply; add CONFIG_MMU guards
 around PCI_IOBASE definition to fix build issues; fixed checkpatch
 issues; move the PCI_IO_* and VMEMMAP address space macros along
 with the others; resolve sparse warning]
Signed-off-by: Paul Walmsley &lt;paul.walmsley@sifive.com&gt;</content>
</entry>
<entry>
<title>riscv: clear the instruction cache and all registers when booting</title>
<updated>2019-11-17T23:17:39Z</updated>
<author>
<name>Christoph Hellwig</name>
</author>
<published>2019-10-28T12:10:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9e80635619b51ddc56bdeca4da4056eb7a2a77e0'/>
<id>urn:sha1:9e80635619b51ddc56bdeca4da4056eb7a2a77e0</id>
<content type='text'>
When we get booted we want a clear slate without any leaks from previous
supervisors or the firmware.  Flush the instruction cache and then clear
all registers to known good values.  This is really important for the
upcoming nommu support that runs on M-mode, but can't really harm when
running in S-mode either.  Vaguely based on the concepts from opensbi.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
Signed-off-by: Paul Walmsley &lt;paul.walmsley@sifive.com&gt;</content>
</entry>
<entry>
<title>riscv: read the hart ID from mhartid on boot</title>
<updated>2019-11-17T23:17:39Z</updated>
<author>
<name>Damien Le Moal</name>
</author>
<published>2019-10-28T12:10:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=accb9dbc4affdb7ebf30db7e9ba71eee47280081'/>
<id>urn:sha1:accb9dbc4affdb7ebf30db7e9ba71eee47280081</id>
<content type='text'>
When in M-Mode, we can use the mhartid CSR to get the ID of the running
HART. Doing so, direct M-Mode boot without firmware is possible.

Signed-off-by: Damien Le Moal &lt;damien.lemoal@wdc.com&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
Reviewed-by: Atish Patra &lt;atish.patra@wdc.com&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Paul Walmsley &lt;paul.walmsley@sifive.com&gt;</content>
</entry>
<entry>
<title>riscv: abstract out CSR names for supervisor vs machine mode</title>
<updated>2019-11-05T17:20:42Z</updated>
<author>
<name>Christoph Hellwig</name>
</author>
<published>2019-10-28T12:10:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a4c3733d32a72f11dee86d0731d7565aa6ebe22d'/>
<id>urn:sha1:a4c3733d32a72f11dee86d0731d7565aa6ebe22d</id>
<content type='text'>
Many of the privileged CSRs exist in a supervisor and machine version
that are used very similarly.  Provide versions of the CSR names and
fields that map to either the S-mode or M-mode variant depending on
a new CONFIG_RISCV_M_MODE kconfig symbol.

Contains contributions from Damien Le Moal &lt;Damien.LeMoal@wdc.com&gt;
and Paul Walmsley &lt;paul.walmsley@sifive.com&gt;.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Acked-by: Thomas Gleixner &lt;tglx@linutronix.de&gt; # for drivers/clocksource, drivers/irqchip
[paul.walmsley@sifive.com: updated to apply]
Signed-off-by: Paul Walmsley &lt;paul.walmsley@sifive.com&gt;</content>
</entry>
<entry>
<title>arch/riscv: disable excess harts before picking main boot hart</title>
<updated>2019-09-20T15:36:36Z</updated>
<author>
<name>Xiang Wang</name>
</author>
<published>2019-09-06T03:56:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b47613da3b71ca59cc6924bad2d74974f86fab92'/>
<id>urn:sha1:b47613da3b71ca59cc6924bad2d74974f86fab92</id>
<content type='text'>
Harts with id greater than or equal to CONFIG_NR_CPUS need to be
disabled.  But the kernel can pick any hart as the main hart.  So,
before picking the main hart, the kernel must disable harts with ids
greater than or equal to CONFIG_NR_CPUS.

Signed-off-by: Xiang Wang &lt;merle@hardenedlinux.org&gt;
Reviewed-by: Palmer Dabbelt &lt;palmer@sifive.com&gt;
Reviewed-by: Anup Patel &lt;anup.patel@wdc.com&gt;
[paul.walmsley@sifive.com: updated to apply; cleaned up patch
 description]
Signed-off-by: Paul Walmsley &lt;paul.walmsley@sifive.com&gt;</content>
</entry>
<entry>
<title>Merge tag 'riscv/for-v5.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux</title>
<updated>2019-09-16T22:29:34Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2019-09-16T22:29:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=58d4fafd0b4c36838077a5d7b17df537b7226f1c'/>
<id>urn:sha1:58d4fafd0b4c36838077a5d7b17df537b7226f1c</id>
<content type='text'>
Pull RISC-V updates from Paul Walmsley:
 "Add the following new features:

   - Generic CPU topology description support for DT-based platforms,
     including ARM64, ARM and RISC-V.

   - Sparsemem support

   - Perf callchain support

   - SiFive PLIC irqchip modifications, in preparation for M-mode Linux

  and clean up the code base:

   - Clean up chip-specific register (CSR) manipulation code, IPIs, TLB
     flushing, and the RISC-V CPU-local timer code

   - Kbuild cleanup from one of the Kbuild maintainers"

[ The CPU topology parts came in through the arm64 tree with a shared
  branch   - Linus ]

* tag 'riscv/for-v5.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
  irqchip/sifive-plic: set max threshold for ignored handlers
  riscv: move the TLB flush logic out of line
  riscv: don't use the rdtime(h) pseudo-instructions
  riscv: cleanup riscv_cpuid_to_hartid_mask
  riscv: optimize send_ipi_single
  riscv: cleanup send_ipi_mask
  riscv: refactor the IPI code
  riscv: Add support for libdw
  riscv: Add support for perf registers sampling
  riscv: Add perf callchain support
  riscv: add arch/riscv/Kbuild
  RISC-V: Implement sparsemem
  riscv: Using CSR numbers to access CSRs
</content>
</entry>
</feed>
