The following is a small patch for enabling fuse file system. I tested it on my morello PC and FVP. branch: https://git.morello-project.org/zatkh/linux/-/tree/morello/fuse
From 293351ba5a87beb4b20cc956025e5d7ab911a320 Mon Sep 17 00:00:00 2001 From: zatkh ztarkhani@microsoft.com Date: Wed, 11 Jan 2023 16:39:07 +0000 Subject: [PATCH 1/2] kernel fusefs enable
--- arch/arm64/configs/morello_transitional_pcuabi_defconfig | 2 ++ fs/fuse/file.c | 2 +- fs/fuse/fuse_i.h | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/configs/morello_transitional_pcuabi_defconfig b/arch/arm64/configs/morello_transitional_pcuabi_defconfig index 2c0798c18553..af37f9ed4e36 100644 --- a/arch/arm64/configs/morello_transitional_pcuabi_defconfig +++ b/arch/arm64/configs/morello_transitional_pcuabi_defconfig @@ -130,6 +130,7 @@ CONFIG_VFAT_FS=y CONFIG_TMPFS=y CONFIG_HUGETLBFS=y CONFIG_CONFIGFS_FS=y +CONFIG_FUSE_FS=y # CONFIG_EFIVAR_FS is not set CONFIG_9P_FS=y CONFIG_NLS_CODEPAGE_437=y @@ -147,3 +148,4 @@ CONFIG_DEBUG_FS=y # CONFIG_DEBUG_PREEMPT is not set # CONFIG_FTRACE is not set CONFIG_MEMTEST=y + diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 2318e66e7612..71b55bb83d25 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c @@ -1366,7 +1366,7 @@ static ssize_t fuse_cache_write_iter(struct kiocb *iocb, struct iov_iter *from)
static inline unsigned long fuse_get_user_addr(const struct iov_iter *ii) { - return (unsigned long)ii->iov->iov_base + ii->iov_offset; + return (__cheri_addr long)ii->iov->iov_base + ii->iov_offset; }
static inline size_t fuse_get_frag_size(const struct iov_iter *ii, diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h index 081fd8d0b45d..005801a8c07b 100644 --- a/fs/fuse/fuse_i.h +++ b/fs/fuse/fuse_i.h @@ -1302,7 +1302,7 @@ bool fuse_dax_check_alignment(struct fuse_conn *fc, unsigned int map_alignment); void fuse_dax_cancel_work(struct fuse_conn *fc);
/* ioctl.c */ -long fuse_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg); +long fuse_file_ioctl(struct file *file, unsigned int cmd, user_uintptr_t arg); long fuse_file_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg); int fuse_fileattr_get(struct dentry *dentry, struct fileattr *fa);