Hi,
The top of the master branch has been tagged [1] as part of the
integration drop 1.8.0.
Below is the changelog for kernel users, since the previous integration
drop (1.7.0).
---------
* [Issue #4] The BPF syscall interface has been adapted to operate on
full capabilities, while retaining backwards-compatibility with
existing arm64 binaries (via 64-bit compat). Please refer to
include/uapi/linux/bpf.h [2] for a full list of modified uapi structs.
* [Issue #5, #58] User-provided capabilities are now always checked when
user memory is accessed (standard uaccess routines such as
copy_from_user() now use capability-based loads and stores to perform
the access). As a result, passing invalid capabilities to syscalls
will typically lead to the syscall failing with -EFAULT. New Morello
kselftests have been added to ensure that this capability checking
occurs as expected.
* The branch has been rebased on the 6.7 upstream release. The
morello.rst document has moved under Documentation/arch/arm64 as a
result, and a few uapi adaptations have been added for io_uring
features that appeared upstream since 6.4. For more details, please
refer to this email [3].
* Minor internal refactoring and cleanups related to 64-bit compat
support.
Contributions
-------------
Kudos to everyone who has contributed to Morello Linux! Here are the
contributors and number of patches since the previous integration drop:
21 Kevin Brodsky <kevin.brodsky(a)arm.com>
13 Zachary Leaf <zachary.leaf(a)arm.com>
1 Aditya Deshpande <aditya.deshpande(a)arm.com>
1 Akram Ahmad <Akram.Ahmad(a)arm.com>
Special thanks are also extended to everyone who has assisted in
reviewing these patches.
Cheers,
Kevin
[1]
https://git.morello-project.org/morello/kernel/linux/-/commits/morello-rele…
[2]
https://git.morello-project.org/morello/kernel/linux/-/blob/morello/master/…
[3]
https://op-lists.linaro.org/archives/list/linux-morello@op-lists.linaro.org…
Hi All,
This patch series introduces the mm reservation interface to manage
the owning capability of the allocated addresses. This series adds reservation
details in the VMA structure and different capability/reservation constraint checks.
Looking for feedback regarding API names, directory structure etc.
Details about several rules implemented can be found in PCuABI spec here [1].
This series is based on tree [2].
Changes in this v3 as compared with v2(Based on suggestions from Kevin):
1) Implemented all suggestion from Kevin on V2 version. However, suggestion to
use (unsigned long __user *) instead of user_uintptr_t was not done
due to not much benefits and lack of time.
2) vm_mmap() now takes address as unsigned long instead of
user_uintptr_t.
3) get_unmapped_area() now checks if address range falling within
reservation in case of MAP_FIXED address.
4) New function check_pcuabi_params() added to check parameters sanity
in mmap and mremap syscalls.
5) Several fixes and cleanups.
6) Patch 3, 24 and 25 are new patches.
Testing:
1) All tests by Chaitanya in v8 selftests [3] passes.
2) Purecap/Compat Busybox boot passes after adding [WIP] patches present in [4].
The whole series can be found here [4].
[1]: https://git.morello-project.org/morello/kernel/linux/-/wikis/Morello-pure-c…
[2]: https://git.morello-project.org/morello/kernel/linux morello/next
[3]: https://git.morello-project.org/chaitanya_prakash/linux.git review/purecap_mmap_testcases_v8
[4]: https://git.morello-project.org/amitdaniel/linux.git review/purecap_mm_reservation_v3
Thanks,
Amit Daniel
Amit Daniel Kachhap (25):
uapi: errno.h: Introduce PCuABI memory reservation error
linux/sched/coredump.h: Add MMF_PCUABI_RESERV mm flag
linux/user_ptr.h: Add a typedef user_ptr_perms_t
mm/cap_addr_mgmt: Add capability reservation interfaces in VMA
linux/user_ptr.h: Add two helpers to operate on user pointers
lib/user_ptr: Add helpers to be used by mm syscalls
mm/mmap: Modify get free unmapped address space management code
mm/(mmap,mremap): Add PCuABI reservation during VMA operation
mm/mmap: Add reservation constraints in mmap/munmap parameters
mm/mremap: Add reservation constraints in mremap parameters
mm/mprotect: Add the PCuABI reservation constraints
mm/madvise: Add the PCuABI reservation constraints
mm/mlock: Add the PCuABI reservation constraints
mm/msync: Add the PCuABI reservation constraints
mm/mmap: Disable MAP_GROWSDOWN mapping flag for PCuABI
uapi: mman-common.h: Macros for maximum capability permissions
lib/user_ptr: Add user pointer permission helpers for PCuABI
arm64: user_ptr: Implement morello capability permission helpers
mm/mmap: Add capability permission constraints for PCuABI
mm/mremap: Add capability permission constraints for PCuABI
mm/mprotect: Add capability permission constraints for PCuABI
mm/mincore: Add PCuABI reservation/capability constraints
fs/binfmt_elf: Add PCuABI reservation constraints
ipc/shm: Add the PCuABI reservation constraints
arm64: vDSO: Add appropriate capability bounds
Documentation/core-api/user_ptr.rst | 28 +++
arch/Kconfig | 3 +
arch/arm64/Kconfig | 1 +
arch/arm64/include/asm/elf.h | 5 +-
arch/arm64/include/asm/mmu.h | 2 +-
arch/arm64/include/asm/user_ptr.h | 34 ++++
arch/arm64/kernel/signal.c | 2 +-
arch/arm64/kernel/vdso.c | 29 +++-
fs/binfmt_elf.c | 78 ++++++---
include/linux/cap_addr_mgmt.h | 227 +++++++++++++++++++++++++
include/linux/mm.h | 16 +-
include/linux/mm_types.h | 9 +
include/linux/sched/coredump.h | 2 +
include/linux/shm.h | 4 +-
include/linux/user_ptr.h | 101 +++++++++++
include/uapi/asm-generic/errno.h | 2 +
include/uapi/asm-generic/mman-common.h | 6 +
io_uring/advise.c | 2 +-
ipc/shm.c | 27 +--
kernel/fork.c | 3 +
lib/user_ptr.c | 74 ++++++++
mm/Makefile | 1 +
mm/cap_addr_mgmt.c | 150 ++++++++++++++++
mm/damon/vaddr.c | 2 +-
mm/internal.h | 2 +-
mm/madvise.c | 27 ++-
mm/mincore.c | 46 ++++-
mm/mlock.c | 36 +++-
mm/mmap.c | 188 +++++++++++++++++---
mm/mprotect.c | 26 ++-
mm/mremap.c | 98 ++++++++---
mm/msync.c | 13 +-
mm/util.c | 9 +-
33 files changed, 1119 insertions(+), 134 deletions(-)
create mode 100644 arch/arm64/include/asm/user_ptr.h
create mode 100644 include/linux/cap_addr_mgmt.h
create mode 100644 mm/cap_addr_mgmt.c
--
2.25.1
From: Carsten Haitzler <carsten.haitzler(a)arm.com>
This series starts to enable purecap support for drm ioctls. This
series enables all the libdrm tests (tested and working). You will
also need the purecap libdrm port as well to complement this.
Carsten Haitzler (3):
drm: Fix copy to/from user so that caps transport in the region
drm: Fix purecap vblank handling
drm: fix up purecap handling of all iotcls in libdrm test tools
drivers/gpu/drm/drm_atomic_uapi.c | 104 ++++++++++++++++++------
drivers/gpu/drm/drm_connector.c | 108 +++++++++++++++++++------
drivers/gpu/drm/drm_file.c | 2 +-
drivers/gpu/drm/drm_ioctl.c | 6 +-
drivers/gpu/drm/drm_mode_config.c | 126 +++++++++++++++++++++---------
drivers/gpu/drm/drm_mode_object.c | 37 ++++++++-
drivers/gpu/drm/drm_plane.c | 89 +++++++++++++++++----
drivers/gpu/drm/drm_property.c | 89 +++++++++++++++++----
drivers/gpu/drm/drm_vblank.c | 39 ++++++---
include/drm/drm_vblank.h | 23 ++++++
include/uapi/drm/drm.h | 6 +-
include/uapi/drm/drm_mode.h | 42 +++++-----
tools/include/uapi/drm/drm.h | 2 +-
13 files changed, 509 insertions(+), 164 deletions(-)
--
2.25.1
The "mmc: Support capabilities in MMC_IOC_{MULTI_}CMD ioctls" patch
previously hard-coded the ioctl command value in order to maintain
compatibility with non-PCuABI ioctl handlers such as those found in
block.c. This deviates from the standard approach which is to always
define the ioctl command value in terms of the struct size (which may
change), instead providing any fixes in the kernel via compat ioctl
handlers.
This patch therefore aligns the MMC ioctl handlers in block.c with
the standard approach. Undoing the hard-coding in the header leaves
the ioctl command value unchanged in all situations except in PCuABI
where the structs sizes, and hence the ioctl command values, are
now larger (the ioctl value remains unchanged in compat64 as well).
The additional comments that were added in the aforementioned patch
regarding the changing size of the structs is also removed in this
patch.
Signed-off-by: Akram Ahmad <Akram.Ahmad(a)arm.com>
---
drivers/mmc/core/block.c | 64 ++++++++++++++++++++++++++++++++--
include/uapi/linux/mmc/ioctl.h | 22 +++---------
2 files changed, 66 insertions(+), 20 deletions(-)
diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
index 17a1d24bdaed..ad63ba425d47 100644
--- a/drivers/mmc/core/block.c
+++ b/drivers/mmc/core/block.c
@@ -76,6 +76,15 @@ MODULE_ALIAS("mmc:block");
#define MMC_EXTRACT_INDEX_FROM_ARG(x) ((x & 0x00FF0000) >> 16)
#define MMC_EXTRACT_VALUE_FROM_ARG(x) ((x & 0x0000FF00) >> 8)
+/*
+ * The compat_mmc_ioc_{multi_}cmd structs have different sizes in PCuABI and in
+ * compat64, which affects the expected MMC_IOC_{MULTI_}CMD ioctl values. The
+ * following ioctl values reflect the sizes of the compat64 structs defined in
+ * this file.
+ */
+#define MMC_IOC_CMD_COMPAT _IOWR(MMC_BLOCK_MAJOR, 0, struct compat_mmc_ioc_cmd)
+#define MMC_IOC_MULTI_CMD_COMPAT _IOWR(MMC_BLOCK_MAJOR, 1, struct compat_mmc_ioc_multi_cmd)
+
static DEFINE_MUTEX(block_mutex);
/*
@@ -891,7 +900,38 @@ static int mmc_blk_ioctl(struct block_device *bdev, blk_mode_t mode,
static int mmc_blk_compat_ioctl(struct block_device *bdev, blk_mode_t mode,
unsigned int cmd, unsigned long arg)
{
- return mmc_blk_ioctl(bdev, mode, cmd, (user_uintptr_t) compat_ptr(arg));
+ struct mmc_blk_data *md;
+ int ret;
+ void __user *uarg = compat_ptr(arg);
+
+ switch (cmd) {
+ case MMC_IOC_CMD_COMPAT:
+ ret = mmc_blk_check_blkdev(bdev);
+ if (ret)
+ return ret;
+ md = mmc_blk_get(bdev->bd_disk);
+ if (!md)
+ return -EINVAL;
+ ret = mmc_blk_ioctl_cmd(md,
+ uarg,
+ NULL);
+ mmc_blk_put(md);
+ return ret;
+ case MMC_IOC_MULTI_CMD_COMPAT:
+ ret = mmc_blk_check_blkdev(bdev);
+ if (ret)
+ return ret;
+ md = mmc_blk_get(bdev->bd_disk);
+ if (!md)
+ return -EINVAL;
+ ret = mmc_blk_ioctl_multi_cmd(md,
+ uarg,
+ NULL);
+ mmc_blk_put(md);
+ return ret;
+ default:
+ return -EINVAL;
+ }
}
#endif
@@ -2700,7 +2740,27 @@ static long mmc_rpmb_ioctl(struct file *filp, unsigned int cmd,
static long mmc_rpmb_ioctl_compat(struct file *filp, unsigned int cmd,
unsigned long arg)
{
- return mmc_rpmb_ioctl(filp, cmd, (user_uintptr_t)compat_ptr(arg));
+ struct mmc_rpmb_data *rpmb = filp->private_data;
+ int ret;
+ void __user *uarg = compat_ptr(arg);
+
+ switch (cmd) {
+ case MMC_IOC_CMD_COMPAT:
+ ret = mmc_blk_ioctl_cmd(rpmb->md,
+ uarg,
+ rpmb);
+ break;
+ case MMC_IOC_MULTI_CMD_COMPAT:
+ ret = mmc_blk_ioctl_multi_cmd(rpmb->md,
+ uarg,
+ rpmb);
+ break;
+ default:
+ ret = -EINVAL;
+ break;
+ }
+
+ return ret;
}
#endif
diff --git a/include/uapi/linux/mmc/ioctl.h b/include/uapi/linux/mmc/ioctl.h
index 9d34bfc49198..3ca3cd4785f7 100644
--- a/include/uapi/linux/mmc/ioctl.h
+++ b/include/uapi/linux/mmc/ioctl.h
@@ -64,29 +64,15 @@ struct mmc_ioc_multi_cmd {
struct mmc_ioc_cmd cmds[];
};
-/*
- * The size of struct mmc_ioc_cmd changes in PCuABI due to the use of
- * __kernel_uintptr_t, which in turn modifies the command value for this
- * ioctl. It is therefore necessary to hard-code the value for the ioctl
- * using the size of the struct that is expected in any ABI other than
- * PCuABI, to ensure that the value for MMC_IOC_CMD is unchanged. The
- * original definition is as follows:
- *
- * #define MMC_IOC_CMD _IOWR(MMC_BLOCK_MAJOR, 0, struct mmc_ioc_cmd)
- */
-#define MMC_IOC_CMD _IOC(_IOC_READ|_IOC_WRITE, MMC_BLOCK_MAJOR, 0, 72)
+#define MMC_IOC_CMD _IOWR(MMC_BLOCK_MAJOR, 0, struct mmc_ioc_cmd)
+
/*
* MMC_IOC_MULTI_CMD: Used to send an array of MMC commands described by
* the structure mmc_ioc_multi_cmd. The MMC driver will issue all
* commands in array in sequence to card.
- *
- * Note: the size of struct mmc_ioc_multi_cmd changes in PCuABI, due to the
- * increased alignment of struct mmc_ioc_cmd. For that reason, its value needs
- * to be hard-coded too. Original definition:
- *
- * #define MMC_IOC_MULTI_CMD _IOWR(MMC_BLOCK_MAJOR, 1, struct mmc_ioc_multi_cmd)
*/
-#define MMC_IOC_MULTI_CMD _IOC(_IOC_READ|_IOC_WRITE, MMC_BLOCK_MAJOR, 1, 8)
+#define MMC_IOC_MULTI_CMD _IOWR(MMC_BLOCK_MAJOR, 1, struct mmc_ioc_multi_cmd)
+
/*
* Since this ioctl is only meant to enhance (and not replace) normal access
* to the mmc bus device, an upper data transfer limit of MMC_IOC_MAX_BYTES
--
2.34.1
From: Carsten Haitzler <carsten.haitzler(a)arm.com>
This series starts to enable purecap support for drm ioctls. This
series enables all the libdrm tests (tested and working). You will
also need the purecap libdrm port as well to complement this.
Carsten Haitzler (3):
drm: Fix copy to/from user so that caps transport in the region
drm: Fix purecap vblank handling
drm: fix up purecap handling of all iotcls in libdrm test tools
drivers/gpu/drm/drm_atomic_uapi.c | 98 +++++++++++++++++------
drivers/gpu/drm/drm_connector.c | 108 +++++++++++++++++++------
drivers/gpu/drm/drm_file.c | 2 +-
drivers/gpu/drm/drm_ioctl.c | 6 +-
drivers/gpu/drm/drm_mode_config.c | 126 +++++++++++++++++++++---------
drivers/gpu/drm/drm_mode_object.c | 37 ++++++++-
drivers/gpu/drm/drm_plane.c | 89 +++++++++++++++++----
drivers/gpu/drm/drm_property.c | 89 +++++++++++++++++----
drivers/gpu/drm/drm_vblank.c | 39 ++++++---
include/drm/drm_vblank.h | 23 ++++++
include/uapi/drm/drm.h | 6 +-
include/uapi/drm/drm_mode.h | 42 +++++-----
tools/include/uapi/drm/drm.h | 2 +-
13 files changed, 506 insertions(+), 161 deletions(-)
--
2.25.1
From: Carsten Haitzler <carsten.haitzler(a)arm.com>
This series starts to enable purecap support for drm ioctls. This
series enables all the libdrm tests (tested and working). You will
also need the purecap libdrm port as well to complement this.
Carsten Haitzler (3):
drm: Fix copy to/from user so that caps transport in the region
drm: Fix purecap vblank handling
drm: fix up purecap handling of all iotcls in libdrm test tools
drivers/gpu/drm/drm_atomic_uapi.c | 98 +++++++++++++++++------
drivers/gpu/drm/drm_connector.c | 108 +++++++++++++++++++------
drivers/gpu/drm/drm_file.c | 2 +-
drivers/gpu/drm/drm_ioctl.c | 6 +-
drivers/gpu/drm/drm_mode_config.c | 126 +++++++++++++++++++++---------
drivers/gpu/drm/drm_mode_object.c | 37 ++++++++-
drivers/gpu/drm/drm_plane.c | 89 +++++++++++++++++----
drivers/gpu/drm/drm_property.c | 89 +++++++++++++++++----
drivers/gpu/drm/drm_vblank.c | 39 ++++++---
include/drm/drm_vblank.h | 23 ++++++
include/uapi/drm/drm.h | 6 +-
include/uapi/drm/drm_mode.h | 42 +++++-----
tools/include/uapi/drm/drm.h | 2 +-
13 files changed, 506 insertions(+), 161 deletions(-)
--
2.25.1
From: Carsten Haitzler <carsten.haitzler(a)arm.com>
This series starts to enable purecap support for drm ioctls. This
series enables all the libdrm tests (tested and working). You will
also need the purecap libdrm port as well to complement this.
Carsten Haitzler (3):
drm: Fix copy to/from user so that caps transport in the region
drm: Fix purecap vblank handling
drm: fix up purecap handling of all iotcls in libdrm test tools
drivers/gpu/drm/drm_atomic_uapi.c | 98 +++++++++++++++++------
drivers/gpu/drm/drm_connector.c | 108 +++++++++++++++++++------
drivers/gpu/drm/drm_file.c | 2 +-
drivers/gpu/drm/drm_ioctl.c | 6 +-
drivers/gpu/drm/drm_mode_config.c | 126 +++++++++++++++++++++---------
drivers/gpu/drm/drm_mode_object.c | 37 ++++++++-
drivers/gpu/drm/drm_plane.c | 89 +++++++++++++++++----
drivers/gpu/drm/drm_property.c | 89 +++++++++++++++++----
drivers/gpu/drm/drm_vblank.c | 39 ++++++---
include/drm/drm_vblank.h | 23 ++++++
include/uapi/drm/drm.h | 6 +-
include/uapi/drm/drm_mode.h | 42 +++++-----
tools/include/uapi/drm/drm.h | 6 +-
13 files changed, 508 insertions(+), 163 deletions(-)
--
2.25.1
The "mmc: Support capabilities in MMC_IOC_{MULTI_}CMD ioctls" patch
previously hard-coded the ioctl command value in order to maintain
compatibility with non-PCuABI ioctl handlers such as those found in
block.c. This deviates from the standard approach which is to always
define the ioctl command value in terms of the struct size (which may
change), instead providing any fixes in the kernel via compat ioctl
handlers.
This patch therefore aligns the MMC ioctl handlers in block.c with
the standard approach. Undoing the hard-coding in the header leaves
the ioctl command value unchanged in all situations except in PCuABI
where the structs sizes, and hence the ioctl command values, are
now larger. (The ioctl value remains unchanged in compat64 as well).
Signed-off-by: Akram Ahmad <Akram.Ahmad(a)arm.com>
---
drivers/mmc/core/block.c | 62 ++++++++++++++++++++++++++++++++--
include/uapi/linux/mmc/ioctl.h | 21 +++++-------
2 files changed, 69 insertions(+), 14 deletions(-)
diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
index 17a1d24bdaed..d9b50bbd54ee 100644
--- a/drivers/mmc/core/block.c
+++ b/drivers/mmc/core/block.c
@@ -76,6 +76,15 @@ MODULE_ALIAS("mmc:block");
#define MMC_EXTRACT_INDEX_FROM_ARG(x) ((x & 0x00FF0000) >> 16)
#define MMC_EXTRACT_VALUE_FROM_ARG(x) ((x & 0x0000FF00) >> 8)
+/*
+ * The compat_mmc_ioc_{multi_}cmd structs have different sizes in PCuABI and in
+ * compat64, which affects the expected MMC_IOC_{MULTI_}CMD ioctl values. The
+ * following ioctl values reflect the sizes of the compat64 structs defined in
+ * this file.
+ */
+#define MMC_IOC_CMD_COMPAT _IOWR(MMC_BLOCK_MAJOR, 0, struct compat_mmc_ioc_cmd)
+#define MMC_IOC_MULTI_CMD_COMPAT _IOWR(MMC_BLOCK_MAJOR, 1, struct compat_mmc_ioc_multi_cmd)
+
static DEFINE_MUTEX(block_mutex);
/*
@@ -891,7 +900,37 @@ static int mmc_blk_ioctl(struct block_device *bdev, blk_mode_t mode,
static int mmc_blk_compat_ioctl(struct block_device *bdev, blk_mode_t mode,
unsigned int cmd, unsigned long arg)
{
- return mmc_blk_ioctl(bdev, mode, cmd, (user_uintptr_t) compat_ptr(arg));
+ struct mmc_blk_data *md;
+ int ret;
+
+ switch (cmd) {
+ case MMC_IOC_CMD_COMPAT:
+ ret = mmc_blk_check_blkdev(bdev);
+ if (ret)
+ return ret;
+ md = mmc_blk_get(bdev->bd_disk);
+ if (!md)
+ return -EINVAL;
+ ret = mmc_blk_ioctl_cmd(md,
+ (struct mmc_ioc_cmd __user *)arg,
+ NULL);
+ mmc_blk_put(md);
+ return ret;
+ case MMC_IOC_MULTI_CMD_COMPAT:
+ ret = mmc_blk_check_blkdev(bdev);
+ if (ret)
+ return ret;
+ md = mmc_blk_get(bdev->bd_disk);
+ if (!md)
+ return -EINVAL;
+ ret = mmc_blk_ioctl_multi_cmd(md,
+ (struct mmc_ioc_multi_cmd __user *)arg,
+ NULL);
+ mmc_blk_put(md);
+ return ret;
+ default:
+ return -EINVAL;
+ }
}
#endif
@@ -2700,7 +2739,26 @@ static long mmc_rpmb_ioctl(struct file *filp, unsigned int cmd,
static long mmc_rpmb_ioctl_compat(struct file *filp, unsigned int cmd,
unsigned long arg)
{
- return mmc_rpmb_ioctl(filp, cmd, (user_uintptr_t)compat_ptr(arg));
+ struct mmc_rpmb_data *rpmb = filp->private_data;
+ int ret;
+
+ switch (cmd) {
+ case MMC_IOC_CMD_COMPAT:
+ ret = mmc_blk_ioctl_cmd(rpmb->md,
+ (struct mmc_ioc_cmd __user *)arg,
+ rpmb);
+ break;
+ case MMC_IOC_MULTI_CMD_COMPAT:
+ ret = mmc_blk_ioctl_multi_cmd(rpmb->md,
+ (struct mmc_ioc_multi_cmd __user *)arg,
+ rpmb);
+ break;
+ default:
+ ret = -EINVAL;
+ break;
+ }
+
+ return ret;
}
#endif
diff --git a/include/uapi/linux/mmc/ioctl.h b/include/uapi/linux/mmc/ioctl.h
index 9d34bfc49198..e99d932268c6 100644
--- a/include/uapi/linux/mmc/ioctl.h
+++ b/include/uapi/linux/mmc/ioctl.h
@@ -67,26 +67,23 @@ struct mmc_ioc_multi_cmd {
/*
* The size of struct mmc_ioc_cmd changes in PCuABI due to the use of
* __kernel_uintptr_t, which in turn modifies the command value for this
- * ioctl. It is therefore necessary to hard-code the value for the ioctl
- * using the size of the struct that is expected in any ABI other than
- * PCuABI, to ensure that the value for MMC_IOC_CMD is unchanged. The
- * original definition is as follows:
- *
- * #define MMC_IOC_CMD _IOWR(MMC_BLOCK_MAJOR, 0, struct mmc_ioc_cmd)
+ * ioctl. As this command value is not hard-coded to represent the original
+ * size of the struct, any ioctl handlers in compat64 must handle this change
+ * in values instead.
*/
-#define MMC_IOC_CMD _IOC(_IOC_READ|_IOC_WRITE, MMC_BLOCK_MAJOR, 0, 72)
+#define MMC_IOC_CMD _IOWR(MMC_BLOCK_MAJOR, 0, struct mmc_ioc_cmd)
+
/*
* MMC_IOC_MULTI_CMD: Used to send an array of MMC commands described by
* the structure mmc_ioc_multi_cmd. The MMC driver will issue all
* commands in array in sequence to card.
*
* Note: the size of struct mmc_ioc_multi_cmd changes in PCuABI, due to the
- * increased alignment of struct mmc_ioc_cmd. For that reason, its value needs
- * to be hard-coded too. Original definition:
- *
- * #define MMC_IOC_MULTI_CMD _IOWR(MMC_BLOCK_MAJOR, 1, struct mmc_ioc_multi_cmd)
+ * increased alignment of struct mmc_ioc_cmd. Similarly to MMC_IOC_CMD, any
+ * ioctl handlers must account for this change when running in compat64.
*/
-#define MMC_IOC_MULTI_CMD _IOC(_IOC_READ|_IOC_WRITE, MMC_BLOCK_MAJOR, 1, 8)
+#define MMC_IOC_MULTI_CMD _IOWR(MMC_BLOCK_MAJOR, 1, struct mmc_ioc_multi_cmd)
+
/*
* Since this ioctl is only meant to enhance (and not replace) normal access
* to the mmc bus device, an upper data transfer limit of MMC_IOC_MAX_BYTES
--
2.34.1
From: Carsten Haitzler <carsten.haitzler(a)arm.com>
This series starts to enable purecap support for drm ioctls. This
series enables all the libdrm tests (tested and working). You will
also need the purecap libdrm port as well to complement this.
Carsten Haitzler (3):
drm: Fix copy to/from user so that caps trasnport in the region
drm: Fix purecap vblank handling
drm: fix up purecap handling of all iotcls in libdrm test tools
drivers/gpu/drm/drm_atomic_uapi.c | 3 +-
drivers/gpu/drm/drm_connector.c | 108 +++++++++++++++++++------
drivers/gpu/drm/drm_file.c | 2 +-
drivers/gpu/drm/drm_ioc32.c | 1 +
drivers/gpu/drm/drm_ioctl.c | 8 +-
drivers/gpu/drm/drm_mode_config.c | 126 +++++++++++++++++++++---------
drivers/gpu/drm/drm_mode_object.c | 37 ++++++++-
drivers/gpu/drm/drm_plane.c | 89 +++++++++++++++++----
drivers/gpu/drm/drm_property.c | 89 +++++++++++++++++----
drivers/gpu/drm/drm_vblank.c | 39 ++++++---
include/drm/drm_vblank.h | 23 ++++++
include/uapi/drm/drm.h | 6 +-
include/uapi/drm/drm_mode.h | 30 +++----
tools/include/uapi/drm/drm.h | 6 +-
14 files changed, 430 insertions(+), 137 deletions(-)
--
2.25.1