On Sun, Jan 14, 2024 at 09:13:19PM +0800, Baolu Lu wrote:
> On 2024/1/13 5:56, Joel Granados wrote:
> > On Thu, Oct 26, 2023 at 10:49:24AM +0800, Lu Baolu wrote:
> >> Hi folks,
> >>
> >> This series implements the functionality of delivering IO page faults to
; drivers/iommu/iommufd/hw_pagetable.c | 260 +-
> drivers/iommu/iommufd/selftest.c | 56
> tools/testing/selftests/iommu/iommufd.c | 24 +-
> .../selftests/iommu/iommufd_fail_nth.c| 2 +-
> 12 files changed, 620 insertions(+), 16 deletions(-)
>
> --
> 2.34.1
>
--
Joel Granados
signature.asc
Description: PGP signature
On Tue, Dec 19, 2023 at 05:26:21PM +0800, Yi Liu wrote:
> On 2023/12/17 19:21, Joel Granados wrote:
> > Hey Yi
> >
> > I have been working with
> > https://protect2.fireeye.com/v1/url?k=b58750ce-ea1c9eaa-b586db81-000babda0201-365207d33731a099&q=1&e=ee73b69d-5c3
overage for IOMMU_HWPT_INVALIDATE ioctl
>
> Yi Liu (1):
> iommufd: Add IOMMU_HWPT_INVALIDATE
>
> drivers/iommu/iommufd/hw_pagetable.c | 35
> drivers/iommu/iommufd/iommufd_private.h | 9 ++
> drivers/iommu/iommufd/iommufd_test.h | 22 +
w_pagetable *hwpt = group->domain->fault_data;
> +
> + mutex_lock(&hwpt->fault->mutex);
> + list_add_tail(&group->node, &hwpt->fault->deliver);
> + mutex_unlock(&hwpt->fault->mutex);
> +
> + return 0;
> +}
> +
> int iommufd_hwpt_alloc(struct iommufd_ucmd *ucmd)
> {
> struct iommufd_hw_pagetable *(*alloc_fn)(
> @@ -364,6 +404,20 @@ int iommufd_hwpt_alloc(struct iommufd_ucmd *ucmd)
> goto out_unlock;
> }
>
> + if (cmd->flags & IOMMU_HWPT_ALLOC_IOPF_CAPABLE) {
> + hwpt->fault = hw_pagetable_fault_alloc();
> + if (IS_ERR(hwpt->fault)) {
> + rc = PTR_ERR(hwpt->fault);
> + hwpt->fault = NULL;
> + goto out_hwpt;
> + }
> +
> + hwpt->fault->ictx = ucmd->ictx;
> + hwpt->fault->hwpt = hwpt;
> + hwpt->domain->iopf_handler = iommufd_hw_pagetable_iopf_handler;
> + hwpt->domain->fault_data = hwpt;
> + }
> +
> cmd->out_hwpt_id = hwpt->obj.id;
> rc = iommufd_ucmd_respond(ucmd, sizeof(*cmd));
> if (rc)
> --
> 2.34.1
>
--
Joel Granados
signature.asc
Description: PGP signature
I call the IOMMU_HWPT_ALLOC ioctl with
.flags = IOMMU_HWPT_ALLOC_IOPF_CAPABLE and
.hwpt_type = IOMMU_HWPT_TYPE_DEFAULT
.pt_id = the default ioas id.
I have resolved this in a naive way by just not calling the
put_unused_fd function.
Have you run into this? Is this a path that you were expecting?
Also, please get back to me if you need more information about how I got
to this place. I have provided what I think is enough info, but I might
be missing something obvious.
Best
> kfree(fault);
> }
>
> @@ -347,7 +546,9 @@ int iommufd_hwpt_alloc(struct iommufd_ucmd *ucmd)
> struct mutex *mutex;
> int rc;
>
> - if (cmd->flags & ~IOMMU_HWPT_ALLOC_NEST_PARENT || cmd->__reserved)
> + if ((cmd->flags & ~(IOMMU_HWPT_ALLOC_NEST_PARENT |
> + IOMMU_HWPT_ALLOC_IOPF_CAPABLE)) ||
> + cmd->__reserved)
> return -EOPNOTSUPP;
> if (!cmd->data_len && cmd->hwpt_type != IOMMU_HWPT_TYPE_DEFAULT)
> return -EINVAL;
> @@ -416,6 +617,7 @@ int iommufd_hwpt_alloc(struct iommufd_ucmd *ucmd)
> hwpt->fault->hwpt = hwpt;
> hwpt->domain->iopf_handler = iommufd_hw_pagetable_iopf_handler;
> hwpt->domain->fault_data = hwpt;
> + cmd->out_fault_fd = hwpt->fault->fault_fd;
> }
>
> cmd->out_hwpt_id = hwpt->obj.id;
> --
> 2.34.1
>
--
Joel Granados
signature.asc
Description: PGP signature
| 50
> drivers/iommu/iommufd/device.c| 69 -
> drivers/iommu/iommufd/hw_pagetable.c | 260 +-
> drivers/iommu/iommufd/selftest.c | 56
> tools/testing/selftests/iommu/iommufd.c | 24 +-
> .../selftests/iommu/iommufd_fail_nth.c| 2 +-
> 12 files changed, 620 insertions(+), 16 deletions(-)
>
> --
> 2.34.1
>
--
Joel Granados
signature.asc
Description: PGP signature
From: Joel Granados
In some cases the result of test were hidden inside the stdout and it
was difficult to identify when a test was skipped and why.
List of changes
1. Capitalize all the words that express a test result : "OK", "SKIPPED"
and "FAIL".
2. Place a
more
easily identify which ones are OK, Skipped and Failed.
Comments are greatly appreciated
Best
Signed-off-by: Joel Granados
---
Joel Granados (3):
sysctl: Fix out of bounds access for empty sysctl registers
sysctl: Add a selftest for handling empty dirs
sysclt: Clarify the
From: Joel Granados
When registering tables to the sysctl subsystem there is a check to see
if header is a permanently empty directory (used for mounts). This check
evaluates the first element of the ctl_table. This results in an out of
bounds evaluation when registering empty directories.
The
From: Joel Granados
Basic test to ensure that empty directories can be registered and that
they in turn can serve as a base dir for other registrations.
Add one test to the sysctl selftest module. It first registers an empty
directory under "empty_add" and then uses that as a base t
11 matches
Mail list logo