Skip to content

Commit f2de37a

Browse files
bjorn-rivosmstsirkin
authored andcommitted
riscv, qemu_fw_cfg: Add support for RISC-V architecture
Qemu fw_cfg support was missing for RISC-V, which made it hard to do proper vmcore dumps from qemu. Add the missing RISC-V arch-defines. You can now do vmcore dumps from qemu. Add "-device vmcoreinfo" to the qemu command-line. From the qemu monitor: (qemu) dump-guest-memory vmcore The vmcore can now be used, e.g., with the "crash" utility. Acked-by: "Michael S. Tsirkin" <mst@redhat.com> Acked-by: Alistair Francis <alistair.francis@wdc.com> Tested-by: Clément Léger <cleger@rivosinc.com> Signed-off-by: Björn Töpel <bjorn@rivosinc.com> Message-Id: <20231012102852.234442-1-bjorn@kernel.org> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
1 parent 0d82410 commit f2de37a

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/firmware/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ config RASPBERRYPI_FIRMWARE
155155

156156
config FW_CFG_SYSFS
157157
tristate "QEMU fw_cfg device support in sysfs"
158-
depends on SYSFS && (ARM || ARM64 || PARISC || PPC_PMAC || SPARC || X86)
158+
depends on SYSFS && (ARM || ARM64 || PARISC || PPC_PMAC || RISCV || SPARC || X86)
159159
depends on HAS_IOPORT_MAP
160160
default n
161161
help

drivers/firmware/qemu_fw_cfg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ static void fw_cfg_io_cleanup(void)
211211

212212
/* arch-specific ctrl & data register offsets are not available in ACPI, DT */
213213
#if !(defined(FW_CFG_CTRL_OFF) && defined(FW_CFG_DATA_OFF))
214-
# if (defined(CONFIG_ARM) || defined(CONFIG_ARM64))
214+
# if (defined(CONFIG_ARM) || defined(CONFIG_ARM64) || defined(CONFIG_RISCV))
215215
# define FW_CFG_CTRL_OFF 0x08
216216
# define FW_CFG_DATA_OFF 0x00
217217
# define FW_CFG_DMA_OFF 0x10

0 commit comments

Comments
 (0)