lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20210901104130.10185-1-2014500726@smail.xtu.edu.cn>
Date:   Wed,  1 Sep 2021 18:41:30 +0800
From:   xiaoming <2014500726@...il.xtu.edu.cn>
To:     Gabriel Somlo <somlo@....edu>
Cc:     "Michael S . Tsirkin" <mst@...hat.com>, qemu-devel@...gnu.org,
        linux-kernel@...r.kernel.org,
        xiaoming <2014500726@...il.xtu.edu.cn>
Subject: [PATCH] [PATCH] drivers/firmware/qemu_fw_cfg: add RISCV support

In the latest release of qemu (qemu 6.0.0 or higher) riscv virt already supports fw_cfg, but
drivers/firmware/qemu_fw_cfg not support.

Signed-off-by: xiaoming <2014500726@...il.xtu.edu.cn>
---
 drivers/firmware/Kconfig       | 2 +-
 drivers/firmware/qemu_fw_cfg.c | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/firmware/Kconfig b/drivers/firmware/Kconfig
index 1db738d5b..4eb8d8a3a 100644
--- a/drivers/firmware/Kconfig
+++ b/drivers/firmware/Kconfig
@@ -186,7 +186,7 @@ config RASPBERRYPI_FIRMWARE
 
 config FW_CFG_SYSFS
 	tristate "QEMU fw_cfg device support in sysfs"
-	depends on SYSFS && (ARM || ARM64 || PARISC || PPC_PMAC || SPARC || X86)
+	depends on SYSFS && (ARM || ARM64 || PARISC || PPC_PMAC || SPARC || X86 || RISCV)
 	depends on HAS_IOPORT_MAP
 	default n
 	help
diff --git a/drivers/firmware/qemu_fw_cfg.c b/drivers/firmware/qemu_fw_cfg.c
index 172c751a4..36b5b2612 100644
--- a/drivers/firmware/qemu_fw_cfg.c
+++ b/drivers/firmware/qemu_fw_cfg.c
@@ -225,6 +225,10 @@ static void fw_cfg_io_cleanup(void)
 #  define FW_CFG_CTRL_OFF 0x00
 #  define FW_CFG_DATA_OFF 0x01
 #  define FW_CFG_DMA_OFF 0x04
+# elif defined(CONFIG_RISCV)
+#  define FW_CFG_CTRL_OFF 0x08
+#  define FW_CFG_DATA_OFF 0x00
+#  define FW_CFG_DMA_OFF 0x10
 # else
 #  error "QEMU FW_CFG not available on this architecture!"
 # endif
-- 
2.17.1



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ