Skip to contentSkip to conversation

Recent changes (master)

PATCH Jens Axboe 1 participant 1 message May 20, 2023

lore
Share & tools
lore

Jens Axboe

author
#0 lore raw

The following changes since commit 5cedafafeeb9dde862455342cd24c860d84f4f07:

ci: fix ups for 32-bit GitHub Actions Linux builds (2023-05-18 14:29:10 -0400)

are available in the Git repository at:

git://git.kernel.dk/fio.git master

for you to fetch changes up to 870ea00243b1290541334bec2a56428c9f68dba6:

io_ur: make sure that sync errors are noticed upfront (2023-05-19 19:30:38 -0600)

----------------------------------------------------------------
Jens Axboe (2):
Merge branch 'master' of https://github.com/huajingyun01/fio
io_ur: make sure that sync errors are noticed upfront

Jingyun Hua (1):
Add LoongArch64 support

 arch/arch-loongarch64.h | 10 ++++++++++
 arch/arch.h             |  3 +++
 configure               |  4 +++-
 io_u.c                  |  3 +++
 libfio.c                |  1 +
 os/os-linux-syscall.h   | 16 ++++++++++++++++
 6 files changed, 36 insertions(+), 1 deletion(-)
 create mode 100644 arch/arch-loongarch64.h

---

Diff of recent changes:

arch/arch-loongarch64.h new file +10 -0
new file mode 100644
index 00000000..43ea83b4
@@ -0,0 +1,10 @@
+#ifndef ARCH_LOONGARCH64_H
+#define ARCH_LOONGARCH64_H
+
+#define FIO_ARCH	(arch_loongarch64)
+
+#define read_barrier()		__asm__ __volatile__("dbar 0": : :"memory")
+#define write_barrier()		__asm__ __volatile__("dbar 0": : :"memory")
+#define nop			__asm__ __volatile__("dbar 0": : :"memory")
+
+#endif
arch/arch.h +3 -0
index fca003be..6e476701 100644
@@ -23,6 +23,7 @@ enum {
 	arch_hppa,
 	arch_mips,
 	arch_aarch64,
+	arch_loongarch64,
 
 	arch_generic,
 
@@ -97,6 +98,8 @@ extern unsigned long arch_flags;
 #include "arch-hppa.h"
 #elif defined(__aarch64__)
 #include "arch-aarch64.h"
+#elif defined(__loongarch64)
+#include "arch-loongarch64.h"
 #else
 #warning "Unknown architecture, attempting to use generic model."
 #include "arch-generic.h"
configure +3 -1
index ca03350b..74416fd4 100755
@@ -499,13 +499,15 @@ elif check_define __aarch64__ ; then
   cpu="aarch64"
 elif check_define __hppa__ ; then
   cpu="hppa"
+elif check_define __loongarch64 ; then
+  cpu="loongarch64"
 else
   cpu=`uname -m`
 fi
 
 # Normalise host CPU name and set ARCH.
 case "$cpu" in
-  ia64|ppc|ppc64|s390|s390x|sparc64)
+  ia64|ppc|ppc64|s390|s390x|sparc64|loongarch64)
     cpu="$cpu"
   ;;
   i386|i486|i586|i686|i86pc|BePC)
io_u.c +3 -0
index 30265cfb..6f5fc94d 100644
@@ -2027,6 +2027,8 @@ static void io_completed(struct thread_data *td, struct io_u **io_u_ptr,
 	}
 
 	if (ddir_sync(ddir)) {
+		if (io_u->error)
+			goto error;
 		td->last_was_sync = true;
 		if (f) {
 			f->first_write = -1ULL;
@@ -2082,6 +2084,7 @@ static void io_completed(struct thread_data *td, struct io_u **io_u_ptr,
 				icd->error = ret;
 		}
 	} else if (io_u->error) {
+error:
 		icd->error = io_u->error;
 		io_u_log_error(td, io_u);
 	}
libfio.c +1 -0
index ddd49cd7..5e3fd30b 100644
@@ -74,6 +74,7 @@ static const char *fio_arch_strings[arch_nr] = {
 	"hppa",
 	"mips",
 	"aarch64",
+	"loongarch64",
 	"generic"
 };
 
os/os-linux-syscall.h +16 -0
index c399b2fa..67ee4d91 100644
@@ -270,6 +270,22 @@
 #define __NR_ioprio_get		31
 #endif
 
+/* Linux syscalls for loongarch64 */
+#elif defined(ARCH_LOONGARCH64_H)
+#ifndef __NR_ioprio_set
+#define __NR_ioprio_set         30
+#define __NR_ioprio_get         31
+#endif
+
+#ifndef __NR_fadvise64
+#define __NR_fadvise64          223
+#endif
+
+#ifndef __NR_sys_splice
+#define __NR_sys_splice         76
+#define __NR_sys_tee          	77
+#define __NR_sys_vmsplice       75
+#endif
 #else
 #warning "Unknown architecture"
 #endif